Question about Updating Mods

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Question about Updating Mods

Post 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!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Question about Updating Mods

Post 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.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Question about Updating Mods

Post 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.
Post Reply