Community Forum

fruitTypes & fillTypes

Forum Overview >> Scripting

Created24.08.2015 23:55

Dirk Peeters (Unknown) 25.08.2015 00:15
is it correct that all vehicles, triggers ingame use Fillable.FILLTYPE_(type) as main variable to seed, transport and so on?

this string Fillable.FILLTYPE_(type) is what triggers the actual self.fillTypes?
do all filltypes need to be defined in the map.i3d FoliageSubLayer section or only the once you seed and harvest?

i ask this for a project we are starting, just to confirm our idea and the direction we had in mind.


Emil Drefers (Unknown) 25.08.2015 08:13

fill types don't need to be defined inside the map.i3d.
You could also create 'virtual fill types'

you can see how a new fill type can be registered (Fillable.registerFillType())

Hope that helps somehow ...


Dirk Peeters (Unknown) 25.08.2015 09:12
thanks, it has bin a long time ago i edit a map for the game but i just want to be sure before i start writing code.

i have a modified Fillable.lua where i tweaked the register function, but my intention is to use this in our project.

the project we working on will be mainly focused on the animal part of the game. but will use Fillable.lua to control loading and all related functions.

also our intention is to (if possible) make our project so you do not need to go edit every single map or mod to get it to work.

o yes i almost forgot a major thing to report on the mods and how thy load.
in fs2011, 2013 and still in 2015, the game loads information out mods that are in modfolder but not used.
so if i have like 3 the same maps or mods inside the modfolder it loads all instead of just that map your playing on.

this result in double huds, gui and unwanted results during gameplay.

is there a way to prevent the game from loading stuff double?

- game start > loads all mods in > you select the game to play > game loads the map you selected, + all other maps also. That last part is the problem not isolating the other maps.

just to let you guy's now and its a problem for those that have the long, big modfolders with alot of modified mods in it. if you only have 1 map and some mods, you will never notis it.

grts & thx

Emil Drefers (Unknown) 26.08.2015 07:51

why would like to have one mod multiple times in your mod folder?

If you want to disable a mod quickly, just rename the modDesc.xml to something else (e.g. DisabledmodDesc.xml) and the mod will not be loaded.

Or make use of multiple mod folders and switch between them.

So, the game has to load all mods which are in the mod folder.
A mod is registered first, than compiled and finally/eventually loaded.
But there's only one map active at a time.


D. Ecker (Decker_MMIV) 27.08.2015 22:36
Hi Jengske_BE,

The main problem with "loading information from mods that should not be used in this game-session", is basically the result of the map-makers and their usage of the <extraSourceFiles> in ModDesc.XML.

I sort-of explained that problem (and possible solution) in this old post: - Unfortunately this kind of information, due to it being 'code' and LUA-scripting, seems to frighten most mod-makers.

My guess is, that this sort of "problem" will still exist in future Farming Simulator versions (unless GIANTS actually want to understand the problem us players have with multiple map-mods in our MODS folder), so it must be up to the us 'the player community' and mod-map-makers to ensure that their map-mods does NOT make use of the <extraSourceFiles>, but instead first loads whatever extra scripts they need _within_ the SampleModMap.LUA (or whatever it has been renamed to by the map-maker).

Also I'm a bit curious about your "modified Fillable.LUA". - What need do you have with your project, to make a different implementation of the Fillable.LUA script?

Be aware of, that Fillable.registerFillType() is called from FruitUtils.registerFruitType() and Sprayer.registerSprayType(), and these calls for the vanilla/default "fruit-types", "spray-types" and "fill-types" are executed even before any mods are loaded and have a change of altering the vanilla/default scripts (based on my knowledge of the FS2013 scripts).

Decker_MMIV (you know where you can contact me, if you don't want to continue here on the GDN forum).

Dirk Peeters (Unknown) 28.08.2015 01:52
Hi Decker,

i was thinking of contacting you about the new project.

'Also I'm a bit curious about your "modified Fillable.LUA". '
first i was looking where i could modify it but i just created a script that adds a variable to Fillable.MAX_NUM_FILLTYPES = 130; and then use that variable instead of 64.

for now the project is more in prepairing github and workspaces and also getting scripting in lua back as i mainly study c# the last year.

not to mutch info over here i will contact you monday or so.

nice to hear from you

D. Ecker (Decker_MMIV) 28.08.2015 19:39
So you're trying to circumvent the 'max 64 fill-types' problem.

Take a look at these then:

Personally I think that RC-Devil and Marhu's solution creates a new subtle problem with the _fruit_-types, as I believe - and Emil please correct me if I'm wrong here - that registered _fruit_-types should be kept to a minimum and only to the seedable crop types which also has a foliage-sub-layer in the map.I3D. So no need to register a _fruit_-type "beef" or "cattle", as those are _fill_-types in my opinion.

But since a SiloTrigger can only be configured with 'fruitType' (and not 'fillType') user-attribute, then maybe that is why RC-Devil & Marhu have also increased the number of fruit-types in their (closed-source) mod.

Perhaps map-makers should start using the MultiSiloTrigger more, as it must be configured with a 'fillTypes' user-attribute. - Maybe GIANTS could patch the SiloTrigger script so it also would take a 'fillType' user-attribute, and fall back to the 'fruitType' user-attribute for backwards compatibility? - line 56. - line 53..


Dirk Peeters (Unknown) 28.08.2015 21:05
not directly to insert in my project but more as thy asked me if i could do it.
the FILLTYPE_"type" is where my interest is going for, FRUITTYPE_"type" also not, like you stated above, beef and cows and oil are filltypes things you load in a trailer things not growing out the earth.

mainly the project its a aspect off the animal side of the game not directly the fruits and stuff i'm interested about.
ok you need to grow stuff before thy could eat but nothing more for fruits to do. filltype instead is used to transport things so thats my focus.

the trigger you made last year, is perfect and i know as i used it daily. and yes, that one if it runs in 2015, i'l be using alot also.

the default triggers are also good but listing the things you got and selecting them for load is a lot nicer, mapmakers can create small load spots instead of building a silo plant of + 64 fruitypes :-)

sounds funny but believe me i tested a lot of maps and mods sinds 2011 and you find those maps, but i would say to giants imput more fruits, go back in time and look over the years what fruits are most used in the maps and incl them default, you could not satisfy everyone but many would love it.

selectable in the create new savedgame so you select what you want at the beginning to not overload the game, something like it.


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