Lumina Posted April 22, 2017 Share Posted April 22, 2017 Hi, I would like to add some plants into my world. For diversity and balance, i want them to not grow during some seasons, like summer and autumn. So there is a "MakeNoGrowInWinter(inst)" that look like what i want, but i have two questions : function MakeNoGrowInWinter(inst) inst.components.pickable:WatchWorldState("iswinter", TogglePickable) TogglePickable(inst.components.pickable, TheWorld.state.iswinter) end local function TogglePickable(pickable, iswinter) if iswinter then pickable:Pause() else pickable:Resume() end end This is the MakeNoGrowInWinter function and the related function. First question, how does it works ? It seems to pause and resume pickable function, meaning that it will "disable" the time before regen and all this stuff ? Second question, if i want to do a similar function, i see what code i must have, more or less, but i don't see where to put it. The MakeNoGrowInWinter is in a data/script/standardcomponent.lua. Where and how should i place my function ? In modmain.lua ? creating a component ? In the file of the prefab itself ? (I have maybe one, or two prefabs when i want this function, so a shared code is maybe not needed). Thanks for your help. Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now