Sid Meier's Civilization VI

Sid Meier's Civilization VI

Great Sovereigns
Publicola 15. dec. 2024 kl. 12:55
Code for 'Oracle' to add GPP to Government Plaza
I *think* I figured out the code to get the Oracle to work correctly, though I still need to test it in-game, which may take some time.

EDIT: Well, it caused my game to not start up correctly, so I'm guessing I messed up somehow. Not sure which part of my code was the issue, but it's non-functional for now. If anyone wants to take a look, let me know what you find out!

<><><><><><><><><><>

The Oracle uses a 'SubjectRequirementSetId' to determine which districts are in a city so it knows to boost their GPP. Every other district is defined in (base game) Leaders.xml or Expansion1_Leaders.xml, but I have not found if/where there's a spot where 'District_Is_Government' has been defined, so I had to reverse-engineer that section of code (the part in <GameInfo>).

Apart from that, this is basically copy-pasted from the (confirmed working) 'Tweaks for JFD's Great Theologian' mod. Insert these lines into the GreatSovereigns_Core.xml, at the bottom after </Building_GreatPersonPoints>. The code below includes both </Building_GreatPersonPoints> and </GameData> so you can remove both lines.

<><><><><><><><><><><>

</Building_GreatPersonPoints>
<Modifiers>
<Row>
<ModifierId>ORACLE_GREATSOVEREIGNPOINTS</ModifierId>
<ModifierType>MODIFIER_SINGLE_CITY_DISTRICTS_ADJUST_GREAT_PERSON_POINTS</ModifierType>
<SubjectRequirementSetId>DISTRICT_IS_GOVERNMENT</SubjectRequirementSetId>
</Row>
</Modifiers>
<ModifierArguments>
<Row>
<ModifierId>ORACLE_GREATSOVEREIGNPOINTS</ModifierId>
<Name>GreatPersonClassType</Name>
<Value>GREAT_PERSON_CLASS_GreatSovereigns</Value>
</Row>
<Row>
<ModifierId>ORACLE_GREATSOVEREIGNPOINTS</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
</ModifierArguments>
<BuildingModifiers>
<Row>
<BuildingType>BUILDING_ORACLE</BuildingType>
<ModifierId>ORACLE_GREATSOVEREIGNPOINTS</ModifierId>
</Row>
</BuildingModifiers>
</GameData>
<GameInfo>
<RequirementSets>
<Row>
<RequirementSetId>DISTRICT_IS_GOVERNMENT</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
</RequirementSets>
<RequirementSetRequirements>
<Row>
<RequirementSetId>DISTRICT_IS_GOVERNMENT</RequirementSetId>
<RequirementId>REQUIRES_DISTRICT_IS_GOVERNMENT</RequirementId>
</Row>
</RequirementSetRequirements>
<Requirements>
<Row>
<RequirementId>REQUIRES_DISTRICT_IS_GOVERNMENT</RequirementId>
<RequirementType>REQUIREMENT_DISTRICT_TYPE_MATCHES</RequirementType>
</Row>
</Requirements>
<RequirementArguments>
<Row>
<RequirementId>REQUIRES_DISTRICT_IS_GOVERNMENT</RequirementId>
<Name>DistrictType</Name>
<Value>DISTRICT_GOVERNMENT</Value>
</Row>
</RequirementArguments>
</GameInfo>
Sidst redigeret af Publicola; 15. dec. 2024 kl. 13:25
< >
Viser 1-2 af 2 kommentarer
RoxyRiku94 18. dec. 2024 kl. 20:04 
If coding in SQL, you could actually write it for example like so:

INSERT OR IGNORE INTO Modifiers
(ModifierId, ModifierType, SubjectRequirementSetId)
VALUES ('ORACLE_PLATI_GREAT_SOVEREIGN_POINTS', 'MODIFIER_SINGLE_CITY_DISTRICTS_ADJUST_GREAT_PERSON_POINTS', 'DISTRICT_IS_GOVERNMENT');

INSERT OR IGNORE INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('ORACLE_PLATI_GREAT_SOVEREIGN_POINTS', 'GreatPersonClassType',
'GREAT_PERSON_CLASS_GreatSovereigns'),
('ORACLE_PLATI_GREAT_SOVEREIGN_POINTS', 'Amount',
2);

INSERT OR IGNORE INTO BuildingModifiers
(BuildingType, ModifierId)
VALUES ('BUILDING_ORACLE', 'ORACLE_PLATI_GREAT_SOVEREIGN_POINTS');

Of course, how the original modder wants to define the entries if up to Plati to decide.
Not gonna list setting up the custom Requirement like your post above bc of space constraints, but you'll get the idea how to code it properly if you know SQL ;-)

Source: Code Snippet from JNR's Great Explorer mod, just changed to adapt for Great Sovereigns (the same could be changed for Great Entertainers from Plati's mod as well)
Plati  [udvikler] 27. dec. 2024 kl. 23:23 
Thank you both, I have introduced theses changes in latest update.
< >
Viser 1-2 af 2 kommentarer
Per side: 1530 50