Need help with Agenda, problem with war types

BeastUA

Chieftain
Joined
Oct 31, 2023
Messages
3
Hello everyone, I am trying to create an agenda for a new leader, this leader likes you when you declare joint wars, protectorate wars, defensive pact wars and liberation wars and in turn dislikes you if you did not do any of these.
This is what I have so far:
XML:
<?xml version="1.0" encoding="utf-8"?>
<GameData>

    <Types>
        <Row Type="TRAIT_AGENDA_BROTHERS_IN_ARMS" Kind="KIND_TRAIT"/>
    </Types>

    <Traits>
        <Row TraitType="TRAIT_AGENDA_BROTHERS_IN_ARMS"/>
    </Traits>

    <ExclusiveAgendas>
        <Row AgendaOne="AGENDA_BROTHERS_IN_ARMS" AgendaTwo="AGENDA_PARANOID"/>
    </ExclusiveAgendas>

    <AgendaTraits>
        <Row AgendaType="AGENDA_BROTHERS_IN_ARMS" TraitType="TRAIT_AGENDA_BROTHERS_IN_ARMS"/>
    </AgendaTraits>

    <TraitModifiers>
        <Row TraitType="TRAIT_AGENDA_BROTHERS_IN_ARMS" ModifierId="AGENDA_BROTHERS_IN_ARMS_LOYAL"/>
        <Row TraitType="TRAIT_AGENDA_BROTHERS_IN_ARMS" ModifierId="AGENDA_BROTHERS_IN_ARMS_DISLOYAL"/>
    </TraitModifiers>

    <Modifiers>
        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_LOYAL</ModifierId>
            <ModifierType>MODIFIER_PLAYER_DIPLOMACY_SIMPLE_MODIFIER</ModifierType>
            <SubjectRequirementSetId>PLAYER_BROTHERS_IN_ARMS</SubjectRequirementSetId>
        </Row>

        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_DISLOYAL</ModifierId>
            <ModifierType>MODIFIER_PLAYER_DIPLOMACY_SIMPLE_MODIFIER</ModifierType>
            <SubjectRequirementSetId>PLAYER_NOT_BROTHERS_IN_ARMS</SubjectRequirementSetId>
        </Row>
    </Modifiers>

    <ModifierArguments>
        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_LOYAL</ModifierId>
            <Name>InitialValue</Name>
            <Value>8</Value>
        </Row>
        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_LOYAL</ModifierId>
            <Name>ReductionTurns</Name>
            <Value>20</Value>
        </Row>
        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_LOYAL</ModifierId>
            <Name>ReductionValue</Name>
            <Value>0</Value>
        </Row>
        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_LOYAL</ModifierId>
            <Name>StatementKey</Name>
            <Value>LOC_DIPLO_KUDO_LEADER_SOMELEADER_REASON_ANY</Value>
        </Row>
        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_LOYAL</ModifierId>
            <Name>SimpleModifierDescription</Name>
            <Value>LOC_DIPLO_MODIFIER_BROTHERS_IN_ARMS_LOYAL</Value>
        </Row>

        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_DISLOYAL</ModifierId>
            <Name>InitialValue</Name>
            <Value>-5</Value>
        </Row>
        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_DISLOYAL</ModifierId>
            <Name>StatementKey</Name>
            <Value>LOC_DIPLO_WARNING_LEADER_SOMELEADER_REASON_ANY</Value>
        </Row>
        <Row>
            <ModifierId>AGENDA_BROTHERS_IN_ARMS_DISLOYAL</ModifierId>
            <Name>SimpleModifierDescription</Name>
            <Value>LOC_DIPLO_MODIFIER_BROTHERS_IN_ARMS_DISLOYAL</Value>
        </Row>
    </ModifierArguments>
    
    <ModifierStrings>
        <Row ModifierId="AGENDA_BROTHERS_IN_ARMS_LOYAL" Context="Sample" Text="LOC_TOOLTIP_SAMPLE_DIPLOMACY_ALL"/>
        <Row ModifierId="AGENDA_BROTHERS_IN_ARMS_DISLOYAL" Context="Sample" Text="LOC_TOOLTIP_SAMPLE_DIPLOMACY_ALL"/>
    </ModifierStrings>

    <RequirementSets>
        <Row>
            <RequirementSetId>PLAYER_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_DECLARED_ALLIED_WAR</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_NOT_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
    </RequirementSets>
    
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>PLAYER_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementId>REQUIRES_MAJOR_CIV_OPPONENT</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementId>REQUIRES_DECLARED_ALLIED_WAR</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementId>REQUIRES_MET_10_TURNS_AGO</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementId>REQUIRES_PLAYER_AT_PEACE</RequirementId>
        </Row>

        <Row>
            <RequirementSetId>PLAYER_DECLARED_ALLIED_WAR</RequirementSetId>
            <RequirementId>REQUIRES_PLAYER_DECLARED_JOINT_WAR</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_DECLARED_ALLIED_WAR</RequirementSetId>
            <RequirementId>REQUIRES_PLAYER_DECLARED_LIBERATION_WAR</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_DECLARED_ALLIED_WAR</RequirementSetId>
            <RequirementId>REQUIRES_PLAYER_DECLARED_PROTECTORATE_WAR</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_DECLARED_ALLIED_WAR</RequirementSetId>
            <RequirementId>REQUIRES_PLAYER_DECLARED_DEFENSIVE_PACT</RequirementId>
        </Row>
        
        <Row>
            <RequirementSetId>PLAYER_NOT_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementId>REQUIRES_MAJOR_CIV_OPPONENT</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_NOT_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementId>REQUIRES_NOT_BROTHERS_IN_ARMS</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>PLAYER_NOT_BROTHERS_IN_ARMS</RequirementSetId>
            <RequirementId>REQUIRES_MET_10_TURNS_AGO</RequirementId>
        </Row>
    </RequirementSetRequirements>

    <Requirements>
        <Row>
            <RequirementId>REQUIRES_DECLARED_ALLIED_WAR</RequirementId>
            <RequirementType>REQUIREMENT_REQUIREMENTSET_IS_MET</RequirementType>
        </Row>
        <Row>
            <RequirementId>REQUIRES_PLAYER_DECLARED_LIBERATION_WAR</RequirementId>
            <RequirementType>REQUIREMENT_PLAYER_DECLARED_WAR</RequirementType>
        </Row>
        <Row>
            <RequirementId>REQUIRES_PLAYER_DECLARED_PROTECTORATE_WAR</RequirementId>
            <RequirementType>REQUIREMENT_PLAYER_DECLARED_WAR</RequirementType>
        </Row>
        <Row>
            <RequirementId>REQUIRES_PLAYER_DECLARED_DEFENSIVE_PACT</RequirementId>
            <RequirementType>REQUIREMENT_PLAYER_DECLARED_WAR</RequirementType>
        </Row>
        <Row>
            <RequirementId>REQUIRES_NOT_BROTHERS_IN_ARMS</RequirementId>
            <RequirementType>REQUIREMENT_REQUIREMENTSET_IS_MET</RequirementType>
            <Inverse>true</Inverse>
        </Row>
    </Requirements>

    <RequirementArguments>
        <Row>
            <RequirementId>REQUIRES_DECLARED_ALLIED_WAR</RequirementId>
            <Name>RequirementSetId</Name>
            <Value>PLAYER_DECLARED_ALLIED_WAR</Value>
        </Row>
        
        <Row>
            <RequirementId>REQUIRES_PLAYER_DECLARED_LIBERATION_WAR</RequirementId>
            <Name>WarType</Name>
            <Value>LIBERATION_WAR</Value>
        </Row>
        <Row>
            <RequirementId>REQUIRES_PLAYER_DECLARED_PROTECTORATE_WAR</RequirementId>
            <Name>WarType</Name>
            <Value>PROTECTORATE_WAR</Value>
        </Row>
        <Row>
            <RequirementId>REQUIRES_PLAYER_DECLARED_DEFENSIVE_PACT</RequirementId>
            <Name>WarType</Name>
            <Value>DEFENSIVE_PACT</Value>
        </Row>
        
        <Row>
            <RequirementId>REQUIRES_NOT_BROTHERS_IN_ARMS</RequirementId>
            <Name>RequirementSetId</Name>
            <Value>PLAYER_BROTHERS_IN_ARMS</Value>
        </Row>
    </RequirementArguments>
</GameData>
There are several issues with how things are:
Firstly: the debuff modifier is not removed even if you get the positive modifier, which is weird to me since it is just using inversion, but in Firaxis Live Tuner I get that both of these are met at the same time, why does this happen when they are supposed to be the opposite?
The second issue is that for some reason when I declare Surprise War, all of these Requirements which I added are going to Met, even though the WarType in RequirementArguments does not match any of them. This does not happen with Joint war which is present in default civ, but is working properly. As far as I can tell my requirements are exactly the same, except the WarType RequirementArgument, but for some reason it triggers for other war types.
1698800013669.png

Can anyone point out what might be wrong here? I feel like I made a miniscule mistake and I am stuck because of it.
 
Hi, did you already fix your problem? I just wanted to ask how you gave this agenda to the civ/leader you created? I'm new to modding. Please let me know.
 
Hi, did you already fix your problem? I just wanted to ask how you gave this agenda to the civ/leader you created? I'm new to modding. Please let me know.
Hi, unfortunately I did not, and I was new to modding as well. I have paused working on this while I sort stuff out at uni and work. As far as I remember, you have to create an Agenda trait (see the top of the code I wrote) and give this trait to leader or civ, just like you would give building or district traits.
 
Thanks for the reply but the problem is that idk how to "give this trait to leader or civ". I can't find the code to do it.
 
If you want code example go to your civ game folder, Sid Meier's Civilization VI\Base\Assets\Gameplay\Data Here try to take a look at Leaders.xml and Agendas.xml.
We will take Hojo and his Bushido agenda for example.
In Leaders.xml in HistoricalAgendas section agenda type is bound to leader type:
XML:
<Row LeaderType="LEADER_HOJO" AgendaType="AGENDA_BUSHIDO"/>

Now we can search for AGENDA_BUSHIDO in folder with all these xmls.
Firstly, in this same Leaders.xml file we can see localization of this agenda in Agendas block:
XML:
<Row AgendaType="AGENDA_BUSHIDO" Name="LOC_AGENDA_BUSHIDO_NAME" Description="LOC_AGENDA_BUSHIDO_DESCRIPTION"/>

Secondly, in Agendas.xml we can see that in AgendaTraits block this AgendaType is bound to TraitType
XML:
<Row AgendaType="AGENDA_BUSHIDO" TraitType="TRAIT_AGENDA_BUSHIDO"/>
This means that having this agenda means having this trait, one agenda might have multiple traits, for example:
XML:
<Row AgendaType="AGENDA_WITH_YOUR_SHIELD_OR_ON_IT" TraitType="TRAIT_AGENDA_WITH_SHIELD"/>
<Row AgendaType="AGENDA_WITH_YOUR_SHIELD_OR_ON_IT" TraitType="TRAIT_AGENDA_IGNORE_WARMONGERING"/>

To finish with agenda before we go to trait, where the logic of agenda is defined, one last place where agenda is used is in ExclusiveAgendas block in Agendas.xml. This defines agendas which cannot be combined on one character (therefore it cannot be randomed for a bot for example).
XML:
<Row AgendaOne="AGENDA_BUSHIDO" AgendaTwo="AGENDA_CULTURED"/>
<Row AgendaOne="AGENDA_BUSHIDO" AgendaTwo="AGENDA_STANDING_ARMY"/>
<Row AgendaOne="AGENDA_BUSHIDO" AgendaTwo="AGENDA_DEVOUT"/>
<Row AgendaOne="AGENDA_BUSHIDO" AgendaTwo="AGENDA_PARANOID"/>

Now we move to TRAIT_AGENDA_BUSHIDO it is defined in Agendas xml Types block
XML:
<Row Type="TRAIT_AGENDA_BUSHIDO" Kind="KIND_TRAIT"/>
And Traits block
XML:
<Row TraitType="TRAIT_AGENDA_BUSHIDO"/>

Then in Trait modifiers we bind this Trait to TraitModifiers, once again, there might be several modifiers for one trait:
XML:
<Row TraitType="TRAIT_AGENDA_BUSHIDO" ModifierId="AGENDA_BUSHIDO"/>

Now we move to modifiers, lets look up modifier with ModifierId from above - AGENDA_BUSHIDO. It is in Agendas.xml, in Modifiers block:
XML:
<Row>
    <ModifierId>AGENDA_BUSHIDO</ModifierId>
    <ModifierType>MODIFIER_PLAYER_DIPLOMACY_AGENDA_BUSHIDO</ModifierType>
    <OwnerRequirementSetId>ON_TURN_STARTED</OwnerRequirementSetId>
    <SubjectRequirementSetId>PLAYER_IS_MAJOR_CIV_KNOWN_10_TURNS</SubjectRequirementSetId>
</Row>
In here it is declared what triggers the agenda in RequirementSetId, you can use exisitng requirements like PLAYER_DECLARED_FRIEND which will trigger when you declare friendship, or write your own - you can look up what I tried to do in my original post. In short there are Sets, which have requiremnts and modifiers, combine this in some way and you will have an agenda.
In modifier arguments block you can declare arguments for your agenda, for example:
XML:
<Row>
    <ModifierId>AGENDA_ALLY_OF_ENKIDU_FRIEND</ModifierId>
    <Name>InitialValue</Name>
    <Value>12</Value>
</Row>
<Row>
    <ModifierId>AGENDA_ALLY_OF_ENKIDU_FRIEND</ModifierId>
    <Name>ReductionTurns</Name>
    <Value>10</Value>
</Row>
<Row>
    <ModifierId>AGENDA_ALLY_OF_ENKIDU_FRIEND</ModifierId>
    <Name>ReductionValue</Name>
    <Value>1</Value>
</Row>
<Row>
    <ModifierId>AGENDA_ALLY_OF_ENKIDU_FRIEND</ModifierId>
    <Name>MessageThrottle</Name>
    <Value>20</Value>
</Row>
<Row>
    <ModifierId>AGENDA_ALLY_OF_ENKIDU_FRIEND</ModifierId>
    <Name>StatementKey</Name>
    <Value>LOC_DIPLO_KUDO_LEADER_GILGAMESH_REASON_ANY</Value>
</Row>
<Row>
    <ModifierId>AGENDA_ALLY_OF_ENKIDU_FRIEND</ModifierId>
    <Name>SimpleModifierDescription</Name>
    <Value>LOC_DIPLO_MODIFIER_ALLY_OF_ENKIDU_DECLARED_FRIEND</Value>
</Row>

That is from Gilgamesh agenda, it means that when you satisfy his agenda, it will give +12 relationship points which will be reduced by 1 each turn.

Lastly, there is this line which is present for all agendas as far as I can see in ModifierStrings meaning you should add it to your agenda too,
XML:
<Row ModifierId="AGENDA_ALLY_OF_ENKIDU_FRIEND" Context="Sample" Text="LOC_TOOLTIP_SAMPLE_DIPLOMACY_ALL"/>

I think that covers all aspects of agenda creation, I would suggest you copy some simple agenda like Gilgamesh's AGENDA_ALLY_OF_ENKIDU, rename the variables to your agenda and then start playing around with modifiers and requirements, I'd say that covers all of it.
 
Top Bottom