psparky
King
- Joined
- Feb 24, 2011
- Messages
- 624
A Mod (Vox Populi) adds a column to the 'Worlds' table in sql:
and sets it for each world size in sql e.g.:
In LUA code in the UI, I can access vanilla 'Worlds' columns like this:
When I try something similar for the added column it returns nil:
Is there a way to access the new column from LUA? I'm guessing that perhaps this problem arises because of the use of sql rather than xml.
I tried posting in the Vox Populi forum but nobody could help and it's really more of a general modding question anyway.
Thanks for any help!
Code:
ALTER TABLE Worlds ADD COLUMN 'ReformationPercentRequired' INTEGER DEFAULT 100;
Code:
UPDATE Worlds
SET ReformationPercentRequired = '100'
WHERE Type = 'WORLDSIZE_STANDARD';
Code:
GameInfo.Worlds[Map.GetWorldSize()].MaxActiveReligions
Code:
GameInfo.Worlds[Map.GetWorldSize()].ReformationPercentRequired
Is there a way to access the new column from LUA? I'm guessing that perhaps this problem arises because of the use of sql rather than xml.
I tried posting in the Vox Populi forum but nobody could help and it's really more of a general modding question anyway.
Thanks for any help!