Page 1 of 1

Question about Updating Mods

Posted: Wed Mar 04, 2015 11:47 pm
by JohnWordsworth
I was just wondering what happens when you upgrade a mod to a new version and load a save from the previous version.

I presume that no script_entities are run again, but what happens to objects that have changed in your init.lua script - do these change? If so, are new "onInit" scripts run for objects that are spawned / already spawned? I assume "onInit" is effectively "onSpawn" not "onLoadGame" (for things with previous saves).

Anyway, if someone can give me a rundown here it would be greatly appreciated!

Re: Question about Updating Mods

Posted: Thu Mar 05, 2015 1:18 am
by minmay
onInit runs again on reload if the object is defined with minimalSaveState (my understanding is that minimalSaveState basically respawns the object on reload). I think on other objects all components are saved so changes in the definitions wouldn't affect objects that already exist, but I haven't tested this yet. Not sure about external scripts either. Asset files do have to be loaded again from the .dat so any change to textures, models, sounds, asset definitions should be applied (but again, asset definition changes may not apply to existing items). Dungeon.lua changes probably won't do anything at all. But again I haven't tested any of this except onInit.

Re: Question about Updating Mods

Posted: Thu Mar 05, 2015 1:31 am
by Azel
From my experience nothing really changes; no updates are actually reflected until a new game is started from the updated version. I have added new walls, updated Timers, Counters, and scripts. None of which were in effect until a new game was created.