Community Forum

Change Main Farm SIlo fillLevels

Forum Overview >> Scripting

Created05.07.2017 20:02

Jim Panousis (Jimi540) 05.07.2017 20:02

I want through script to change/decrease the fillLevel of a specific fruit in the main farm silo, etc wheat.

I know that the silo is here: g_currentMission.farmSiloTrigger
I know how to get the fillLevel of a fruit: g_currentMission.farmSiloTrigger:getFillLevel(fillType)

I can't make it work to change the capacity through: g_currentMission.farmSiloTrigger:setFillLevel(fillLevel - delta, fillType);
I'm taking always the error: attempt to call method 'setFillLevel' (a nil value)
whatever combination i'm making in the setFillLevel parameters.

Any help?

My Regards,

Emil Drefers (Unknown) 24.07.2017 07:56

the variable g_currentMission.farmSiloTrigger points to an inheritance of the SiloTrigger class.
This has a connection to some storage.
That connection was set by addSiloSource().
So, your 'target' is in the table 'siloSources' of the trigger and of type 'Storage'.


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