isau
Deity
- Joined
- Jan 15, 2007
- Messages
- 3,071
I've been working to merge the Combined Tweaks and Xavierlol's Improvements Patch mods. Combined Tweaks is mostly written in SQL and Improvements Patch is mostly written in XML. It's here where I've run into something I didn't anticipate as I tried to disentangle some codependent files in the Improvements Patch.
I'm hopeful I just made a mistake somewhere in the file and that XML can rely on objects created in SQL.
If I do this in SQL:
INSERT INTO RequirementSets (
RequirementSetType,
RequirementSetId
)
VALUES (
(
'REQUIREMENTSET_TEST_ALL',
'XAV_PLOT_HAS_LUXURY'
) ;
And this exists in the XML:
<Row>
<ModifierId>GUILDHALL_RESOURCEBONUS</ModifierId>
<ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
<SubjectRequirementSetId>XAV_PLOT_HAS_LUXURY</SubjectRequirementSetId>
</Row>
I get this error.
[1601618.856] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "XAV_PLOT_HAS_LUXURY" does not exist in RequirementSets
Now the interesting thing about this particular fail is if it happens, the mod completely fails to load. Meaning, not a single piece of SQL or XML that exists prior to the file gets executed and when you query the database its like it rolled back all changes in the database to the unmodded state. Its like there is a check on the XML that comes prior to everything else in the file that immediately rejects the mod if it can't find the linked object, and this check runs before any SQL that would set the object up. I've tried setting Priority=1 in the modinfo and still nothing.
It wasn't something I was hoping to run into. Can anyone confirm this observation? I'm hopeful I just messed something else up.
I'm hopeful I just made a mistake somewhere in the file and that XML can rely on objects created in SQL.
If I do this in SQL:
INSERT INTO RequirementSets (
RequirementSetType,
RequirementSetId
)
VALUES (
(
'REQUIREMENTSET_TEST_ALL',
'XAV_PLOT_HAS_LUXURY'
) ;
And this exists in the XML:
<Row>
<ModifierId>GUILDHALL_RESOURCEBONUS</ModifierId>
<ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
<SubjectRequirementSetId>XAV_PLOT_HAS_LUXURY</SubjectRequirementSetId>
</Row>
I get this error.
[1601618.856] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "XAV_PLOT_HAS_LUXURY" does not exist in RequirementSets
Now the interesting thing about this particular fail is if it happens, the mod completely fails to load. Meaning, not a single piece of SQL or XML that exists prior to the file gets executed and when you query the database its like it rolled back all changes in the database to the unmodded state. Its like there is a check on the XML that comes prior to everything else in the file that immediately rejects the mod if it can't find the linked object, and this check runs before any SQL that would set the object up. I've tried setting Priority=1 in the modinfo and still nothing.
It wasn't something I was hoping to run into. Can anyone confirm this observation? I'm hopeful I just messed something else up.