Community Forum

Error: Invalid foliage type index

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created21.09.2019 23:23


Erika Mcdonald (erikacm) 21.09.2019 23:23
Hello,
I have been trying to add additional fruittypes to a map. The map loads all the fruit types in Giants Editor but when I try to load in game I get this set of errors:
2019-09-21 16:41 Error: Invalid foliage type index redCabbage.
2019-09-21 16:41 Error: Invalid foliage type index rye.
2019-09-21 16:41 Error: Invalid foliage type index cabbage.

Interestingly this only shows up for some of the fruittypes I've added.
I think it has something to do with this line in the I3d:
<FoliageMultiLayer densityMapId="222" numChannels="10" numTypeIndexChannels="6" compressionChannels="5">
But I am not sure which setting I need to change.

If anybody knows how to deal with this I would appreciate your help

Thanks,
Erika

Bilbo Beutlin (BBeutlin) 22.09.2019 06:09
It's basic math: numChannels = numTypeIndexChannels + compressionChannels

Erika Mcdonald (erikacm) 22.09.2019 17:06
Ok, so I tried it with numChannels="11" and it still crashes when loading giving me this error"

2019-09-22 10:56 Error: GDM file has wrong number of channels (10 should be 11)
2019-09-22 10:56 Error: DensityMap failed to load GDM file.
2019-09-22 10:56 Error: Can't load resource 'C:/Users/Erika/Documents/MyGames/FarmingSimulator2019/mods/FS19_GSM/maps/mapDE/fruit_density.gdm'.

Also giants editor crashes when I try to load it now. Do I need to somehow update the fruit_density.gdm? Im not sure how to do that.

Thanks

Bilbo Beutlin (BBeutlin) 22.09.2019 17:23
To go sure, maybe also set compressionChannels eq. numTypeIndexChannels (or try out). It's not always necessary, but just for safety.

And yes - the old GDM file is invalid now. Delete it - the GE should create an empty new one.

Erika Mcdonald (erikacm) 22.09.2019 19:50
I changed compressionChannels to equal numTypeIndexChannels (both are now 6), and the numChannels to 12. I deleted the old fruit density, but GE still crashes when I try to load the map.

I think Im missing something.

How do I go about creating a new fruit_density.gdm?

Bilbo Beutlin (BBeutlin) 22.09.2019 23:00
Then take the old "fruit_density.gdm" and convert it to .png (with the GRLE Converter available here on Downloads). In the .png are no more channel infos.
If the GE doesn't want to eat it, change the <File fileId=".." filename="{path}/fruit_density.gdm"/> to <File fileId=".." filename="{path}/fruit_density.png"/>
After saving should be generated also a .gdm file. Later change the filename=.. back to .gdm.

Erika Mcdonald (erikacm) 24.09.2019 16:27
So, I managed to do this and it kind of worked. I created the new fruit_density and GE can now load the map without crashing and error free but when I try to load the map in game I still get the "invalid foliage type index" error from my original post.

Should I try different combinations of numbers for numChannels, numTypeIndexChannels, and compressionChannels? Of is there something else I need to do?

Thanks.

Bilbo Beutlin (BBeutlin) 25.09.2019 00:14
If you have setup
<FoliageMultiLayer .. numChannels="12" numTypeIndexChannels="6" compressionChannels="6">
all should be fine.
But of course you can also try with numChannels="11" numTypeIndexChannels="6" compressionChannels="5" - perhaps that works better.

The problem is, the old "fruit_density" had only 5+5 channels/bits. By extending to 6+6 channels/bits might occur an overflow and invalix index is stated.
Example: let's say there was a binary value "00001 00001". By extending to 6 bits it's now "000000 100001". You see? That gives the invalid index.

Try at first another gdm -> png conversion, afaik the game accepts png's. Else you have to re-convert in the GE.

What you also should check:
Is the order of <FoliageType ..> in <FoliageMultiLayer ..> the same in old vs. new map? The new foliageTypes must be added behind, else the density map is smashed.

What I'm not sure about, is whether the game needs a custom mission.lua - that is often required if certain basic default settings are changed.
I'd suggest, you examine some multi-fruit maps with more than 31 fruits. There are a few around in web.


Note: Log in to post. Create a new account here.