LUA: Changing the game database

Joined
Jul 31, 2014
Messages
836
Hi all!

Is it possible to change an element in the game database from LUA, such as inside a custom map script (short of writing up a custom 1-trick-pony function, that is).

As an example, if I were to use custom world sizes for a map, I would like to modify the Worlds table to reflect the new world sizes.
 
Yes and no. Yes you can use Lua to change the game database table(s) (using DB.Query(sUpdateStmt) - say table Xyz), but those changes won't be available via GameInfo.Xyz[...], as that C++ structure is populated after mods load but before any Lua code runs ... which effectively means only your own code can read back the changes (via DB.Query(sSelectStmt))

Edit: See post #12 in this thread
 
Back
Top Bottom