Change gameplay setup from Lua

Infixo

Deity
Joined
Jan 9, 2016
Messages
4,015
Location
Warsaw
Is there a way to change gameplay setup (i.e. things that normally are changed via UpdateDatabase scripts) from Lua? Let's say I want to randomize some values before the game will start. Will changing GameInfo work or is it only some read-only copy and actual values used to run game are not accessible?
 
the database is not really write-enabled from lua

In civ5 there were some very limited usages in which you could store data as changes to the database, but I am not sure even this limited capability is provided in civ6.
 
the database is not really write-enabled from lua
No, no, not DB. I'm talking about data stored in memory (?) that is used to run the game and i.e. later is saved to save files.
So: DB -> UpdateDatabase -> game starts -> here want to modify -> game uses new data but DB is intact
 
Most of the DB is not stored with the save and when you reload it use the current DB, even if mods have been updated since the save was made.

Some things could be stored and updated using what is exposed to Lua, but you'll need access to the source code for everything else.
 
Top Bottom