So, I'm a reasonably proficient scripter but new to Lua and new to using it in Civ 5 modding.
When are scripts in the global context executed? Is it just at game start and on loading the saved game? Less often? More often?
I put this as the first line in a .lua file:
It does print to the log as expected on starting a game and on loading a saved game, but I need to know if I can rely on that.
I'm having issues with save/load situations with mod-specific data, and I'm considering throwing in an initialization function. Having it fire off when (and only when) the mod starts and when I load a game would be ideal.
When are scripts in the global context executed? Is it just at game start and on loading the saved game? Less often? More often?
I put this as the first line in a .lua file:
Code:
print ("***************************************************************************Global context!");
It does print to the log as expected on starting a game and on loading a saved game, but I need to know if I can rely on that.
I'm having issues with save/load situations with mod-specific data, and I'm considering throwing in an initialization function. Having it fire off when (and only when) the mod starts and when I load a game would be ideal.