[LUA] Civ5CoreDatabase.db update

Nefliqus

Prince
Joined
Sep 16, 2010
Messages
400
Location
Poland
How to change values in table in Civ5CoreDatabase.db? Is it possibile to execute SQL UPDATE command from LUA script?

I don't know why DB.Query("UPDATE Defines SET Value = 4 WHERE Name = 'CITY_ATTACK_RANGE'"); doesn't work.
There is no information about any errors in LiveTuner but if you check db in SQLiteSpy or other tool, value of CITY_ATTACK_RANGE' is still 2. Why? Did Firaxis block it?

SQL syntax is ok for sure, it works if you execute it from SQLiteSpy.
 
i haven't been able to modify it either. these are the only DB functions available

DB.Query
DB.StatementSQL
DB.StatementCount
DB.CollectMemoryUsage
DB.GetMemoryUsage
 
and in Civ5DebugDatabase.db ?
 
There are about 5 different threads on this, all of which (that I've found) peter out without answer.

So has anyone yet changed some data in the core db and had it function in a game? If so, could you post some sample code?
 
Use DB.Query but put the 'for do end' around it even though you're not expecting any return results, otherwise it won't work

Good to know. So did you get your Rationalism tech to work like you wanted it to using DB.Query?
 
Old thread but I'm wondering if anyone has had any success with direct changes to the database. Based on discussion above I tried:

sql = "UPDATE Units SET Combat = 20 WHERE Type = 'UNIT_WARRIOR'"
for row in DB.Query(sql) do end

But it doesn't seem to do anything.
 
Back
Top Bottom