Help on changing Economic slot

batalhadematos

Chieftain
Joined
Feb 25, 2017
Messages
22
Hi all,

I am learning on how to mod CIV6 a at this time I am working on a new civilization using xml structure.
I have been following examples from other mods and until now everything runs fine except for a problem I found on changing the additional MILITARY slot to ECOMONIC slot.

I have been looking on several civilization mods I could not find any which includes this change, at least on xml format.

What I want to:
- Change my code to give an additional economic slot instead of additiona military slot;
- Be abble to give an additional economic slot when a specific civic is researched (let's say reformation civic);

The code I have for leaders trait is:

Code:
    <LeaderTraits>
        <Row LeaderType="LEADER_KING_MANDUMBE" TraitType="TRAIT_LEADER_THE_KWANHAMA"/>
    </LeaderTraits>
    <Traits>
        <Row TraitType="TRAIT_LEADER_THE_KWANHAMA" Name="LOC_TRAIT_LEADER_THE_KWANHAMA_NAME" Description="LOC_TRAIT_LEADER_THE_KWANHAMA_DESCRIPTION"/>
    </Traits>
    <TraitModifiers>
        <Row TraitType="TRAIT_LEADER_THE_KWANHAMA" ModifierId="TRAIT_MILITARY_GOVERNMENT_SLOT"/>
    </TraitModifiers>
    <Modifiers>
        <Row>
            <ModifierId>TRAIT_MILITARY_GOVERNMENT_SLOT</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>TRAIT_MILITARY_GOVERNMENT_SLOT</ModifierId>
            <Name>GovernmentSlotType</Name>
            <Value>SLOT_MILITARY</Value>
        </Row>
    </ModifierArguments>

I have tryed to change the TRAIT_MILITARY_GOVERNMENT_SLOT with TRAIT_WILDCARD_GOVERNMENT_SLOT and worked for wildcard slot (I get an additiona wildcard slot). I just can't change it to ECONOMIC slot... tested with TRAIT_ECONOMIC_SLOT, TRAIT_ECONOMY_SLOT and nothing happens.

The second point (be abble to give an additional economic slot when a specific civic is researched), I just don't know how to do it...

Can anyone help?

Thank you in advance

Regards

Paulo
 
You got lucky when you changed the ModifierId to TRAIT_WILDCARD_GOVERNMENT_SLOT . The only reason that worked is because it happens to already be the name of the Greek ability. You switched over from one trait already in the game (Barbarossa) to another trait already in the game (Greece).

When you changed it to TRAIT_ECONOMIC_GOVERNMENT_SLOT you picked a ModifierId that does not currently exist in the game. You will need to create that Modifier yourself.


<Modifiers>
<Row>
<ModifierId>TRAIT_ECONOMIC_GOVERNMENT_SLOT</ModifierId>
<ModifierType>MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER</ModifierType>
</Row>
</Modifiers>
<ModifierArguments>
<Row>
<ModifierId>TRAIT_ECONOMIC_GOVERNMENT_SLOT</ModifierId>
<Name>GovernmentSlotType</Name>
<Value>SLOT_ECONOMIC</Value>
</Row>
</ModifierArguments>
 
But I have also used this approach.
I have used (and confirmed again when received your answer):

Code:
<Modifiers>
        <Row>
            <ModifierId>TRAIT_ECONOMIC_GOVERNMENT_SLOT</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>TRAIT_ECONOMIC_GOVERNMENT_SLOT</ModifierId>
            <Name>GovernmentSlotType</Name>
            <Value>SLOT_ECONOMIC</Value>
        </Row>
    </ModifierArguments>

Since I need to change from military to economic and following the code structure I have changed all MILITARY texts to ECONOMIC.

As stated, used the same approach for WILDCARD (lucky) and worked.

Thank you
 
But I have also used this approach.
I have used (and confirmed again when received your answer):

Code:
<Modifiers>
        <Row>
            <ModifierId>TRAIT_ECONOMIC_GOVERNMENT_SLOT</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>TRAIT_ECONOMIC_GOVERNMENT_SLOT</ModifierId>
            <Name>GovernmentSlotType</Name>
            <Value>SLOT_ECONOMIC</Value>
        </Row>
    </ModifierArguments>

Since I need to change from military to economic and following the code structure I have changed all MILITARY texts to ECONOMIC.

As stated, used the same approach for WILDCARD (lucky) and worked.

Thank you


Sorry, so does that work for you? Or not?
 
Please find the code for the leaders.xml file.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <Types>
        <Row Type="LEADER_KING_MANDUMBE" Kind="KIND_LEADER"/>
        <Row Type="TRAIT_LEADER_THE_KWANHAMA" Kind="KIND_TRAIT"/>
    </Types>
    <Leaders>
        <Row LeaderType="LEADER_KING_MANDUME" Name="LOC_LEADER_KING_MANDUMBE_NAME" InheritFrom="LEADER_DEFAULT" SceneLayers="4"/>
    </Leaders>
    <HistoricalAgendas>
        <Row LeaderType="LEADER_KING_MANDUME" AgendaType="AGENDA_IRON_CROWN"/>
    </HistoricalAgendas>
    <AiListTypes>
        <Row ListType="KingCivics"/>
        <Row ListType="KingTechs"/>
        <Row ListType="KingWonders"/>
    </AiListTypes>
    <AiLists>
        <Row ListType="KingWonders" LeaderType="TRAIT_LEADER_KING_MADUMBE" System="Buildings"/>
        <Row ListType="KingCivics" LeaderType="TRAIT_LEADER_KING_MADUMBE" System="Civics"/>
        <Row ListType="KingTechs" LeaderType="TRAIT_LEADER_KING_MADUMBE" System="Technologies"/>
    </AiLists>
    <AiFavoredItems>
        <Row ListType="KingWonders" Item="BUILDING_TERRACOTTA_ARMY"/>
        <Row ListType="KingCivics" Item="CIVIC_MEDIEVAL_FAIRES"/>
        <Row ListType="KingCivics" Item="CIVIC_EARLY_EMPIRE"/>
        <Row ListType="KingCivics" Item="CIVIC_POLITICAL_PHILOSOPHY"/>
        <Row ListType="KingCivics" Item="CIVIC_THE_ENLIGHTENMENT"/>
        <Row ListType="KingCivics" Item="CIVIC_CIVIL_ENGINEERING"/>
        <Row ListType="KingCivics" Item="CIVIC_DEFENSIVE_TACTICS"/>
        <Row ListType="KingCivics" Item="CIVIC_TOTALITARIANISM"/>
        <Row ListType="KingTechs" Item="TECH_NUCLEAR_FUSION"/>
        <Row ListType="KingTechs" Item="TECH_NUCLEAR_FISSION"/>
        <Row ListType="KingTechs" Item="TECH_STIRRUPS"/>
        <Row ListType="KingTechs" Item="TECH_MILITARY_SCIENCE"/>
        <Row ListType="KingTechs" Item="TECH_MILITARY_ENGINEERING"/>
        <Row ListType="KingTechs" Item="TECH_BRONZE_WORKING"/>
        <Row ListType="KingTechs" Item="TECH_METAL_CASTING"/>
    </AiFavoredItems>
    <LeaderTraits>
        <Row LeaderType="LEADER_KING_MANDUMBE" TraitType="TRAIT_LEADER_THE_YAM"/>
    </LeaderTraits>
    <Traits>
        <Row TraitType="TRAIT_LEADER_THE_KWANHAMA" Name="LOC_TRAIT_LEADER_KING_MANDUMBE_NAME" Description="LOC_TRAIT_LEADER_KING_MANDUMBE_DESCRIPTION"/>
    </Traits>
    <TraitModifiers>
        <Row TraitType="TRAIT_LEADER_THE_KWANHAMA" ModifierId="TRAIT_ECONOMIC_GOVERNMENT_SLOT"/>
    </TraitModifiers>
    <Modifiers>
        <Row>
            <ModifierId>TRAIT_ECONOMIC_GOVERNMENT_SLOT</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>TRAIT_ECONOMIC_GOVERNMENT_SLOT</ModifierId>
            <Name>GovernmentSlotType</Name>
            <Value>SLOT_ECONOMIC</Value>
        </Row>
    </ModifierArguments>
</GameInfo>

What's wrong with this code? I simple cannot get an additonal economic government slot.

Regards

Paulo
 
Your leaders.xml file looks ok to me. The Modifers and ModifierArguments are correct as I've used exactly the same in my UK Civilization Mod.

Have you checked the Database.log and Modding.log file to see if there is another issue with your mod which is them stopping this from taking effect?
 
Hi there,

Yes I have checked both and everything seems to be normal. No errors.
I also reinstalled Civ 6 in order to garantee everything runs and disabled all other mods.
The strange thing is that the mod runs fine, but this part does not work (to add an additional ECONOMIC slot to the civilization).

Tested several ways, add just ECONOMIC, add with MILITARY and WILDCARD and all works fine except for ECONOMIC slot.

Is there anyway I can do that?

Do you know any good step-by-step tutorial on how to build a new civilization (can be xml ou sql).

Thank you very much

Regards

Paulo
 
The Punt Civilization is a good one to start with.
https://forums.civfanatics.com/threads/punt-civilization.601946/

It's fairly simple and I know a lot of people have used it to start with. It's not been changed to have files under a Data directory though.
It also has an additional economic slot which is all defined in Punt_Leaders.xml

It is a .rar file so you will need something like PeaZip to extract it though.
If you attach your Civ in a Zip file then I can take a look at it.
 
The Add Economic Slot modifier is already used by the Big Ben wonder. Why not just add it to your trait? The modifier is: BIG_BEN_ECONOMIC_GOVERNMENT_SLOT

See if that works.
 
Thank you DavDarkelf,

Can you please help me change the code above in order to use the modifier you refer? Hi am just changing existing code and really do not know what I am exactly doing... o:) really need a step by step tutorial.

I will download the Punt Civilization and study it.

Thank you in advance

Regards

Paulo
 
As I said it appears the modifier you use is correct. If you could zip up your mod as it is then I could take a look at it. I suspect the problem isn't in your leaders.xml file.
Both the Punt civ and my UK civ use the same modifier that you do so in as is it should be working.
 
Thank you my friend.
My new civilization will be based on the attached one "Zulu".

In fact, all tests I am doing directly into this module and later will pass them to final civilization.

The problems I am having are on this civ. I need to change de additional MILITARY government slot to ECONOMIC and also need to add an additional one when a specific CIVIC is researched. I want the REFORMATION civic.

That is, mod starts with an additional economic slot and when reformation civic is researched, mod player gets an addional one.

Thank you very much

Paulo
 

Attachments

  • ZuluV0.1.zip
    6.6 KB · Views: 165
I've changed the extra Military Slot to an Economic one in the file attached. I'm not sure how to get an extra one when a specific Civic is researched without doing it using LUA which I'm not familiar with.
 

Attachments

  • ZuluV0.2.zip
    6.7 KB · Views: 163
Thank you very much.

I will test the module and update you asap.

Thank you once again and best regards

Paulo
 
Thank you very much

It worked. I will try to find why I could not make it to work.

Thank you once again

Regards

Paulo
 
FIRST: In order to link the extra Policy Slot to a Civic, do the following:

Code:
<GameInfo>

<Modifiers>

        <Row>
            <ModifierId>CIVIC_GRANT_ADDITIONAL_ECONOMIC_POLICY_SLOT</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER</ModifierType>
            <RunOnce>true</RunOnce>
            <Permanent>true</Permanent>
        </Row>

</Modifiers>

<ModifierArguments>

        <Row>
            <ModifierId>CIVIC_GRANT_ADDITIONAL_ECONOMIC_POLICY_SLOT</ModifierId>
            <Name>GovernmentSlotType</Name>
            <Value>SLOT_ECONOMIC</Value>
        </Row>

</ModifierArguments>

<CivicModifiers>

        <Row>
            <CivicType>CIVIC_REFORMED_CHURCH</CivicType>
            <ModifierId>CIVIC_GRANT_ADDITIONAL_ECONOMIC_POLICY_SLOT</ModifierId>
        </Row>

</CivicModifiers>
</GameInfo>

The code above (a) creates a Modifier granting an additional Economic Policy Slot and (b) triggers this effect when CIVIC_REFORMED_CHURCH is researched. (I was not sure what you meant by REFORMATION Civic, so I picked the one I thought you meant. You can easily change this by replacing the bolded part above with the Civic you want.)

SECOND: I am not sure, but it sounds to me like you want to limit this extra Policy Slot to a particular civilization/leader. If so, you will need to insert a Requirement into your Modifier. If you have a specific civilization/leader in mind, you can use either of the following (depending on your needs - you can restrict to a specific civilization or to a specific leader).

REQUIREMENT_LEADER_TYPE_MATCHES

REQUIREMENT_CIV_TYPE_MATCHES

You can do the following:

Code:
<GameInfo>

<CivicModifiers>
        <Row>
            <CivicType>CIVIC_REFORMED_CHURCH</CivicType>
            <ModifierId>CIVIC_GRANT_ADDITIONAL_ECONOMIC_POLICY_SLOT</ModifierId>
        </Row>
</CivicModifiers>

<Modifiers>
        <Row>
            <ModifierId>CIVIC_GRANT_ADDITIONAL_ECONOMIC_POLICY_SLOT</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CULTURE_ADJUST_GOVERNMENT_SLOTS_MODIFIER</ModifierType>
            <OwnerRequirementSetId>RECEPIENT_IS_LEADER_KING_MANDUMBE</OwnerRequirementSetId>
            <RunOnce>true</RunOnce>
            <Permanent>true</Permanent>
        </Row>
</Modifiers>

<ModifierArguments>
        <Row>
            <ModifierId>CIVIC_GRANT_ADDITIONAL_ECONOMIC_POLICY_SLOT</ModifierId>
            <Name>GovernmentSlotType</Name>
            <Value>SLOT_ECONOMIC</Value>
        </Row>
</ModifierArguments>

<RequirementSets>
    <Row>
        <RequirementSetId>RECEPIENT_IS_LEADER_KING_MANDUMBE</RequirementSetId>
        <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    </Row>
</RequirementSets>

<RequirementSetRequirements>
    <Row>
        <RequirementSetId>RECEPIENT_IS_LEADER_KING_MANDUMBE</RequirementSetId>
        <RequirementId>REQUIRES_LEADER_KING_MANDUMBE</RequirementId>
    </Row>
</RequirementSetRequirements>

<Requirements>
    <Row>
        <RequirementId>REQUIRES_LEADER_KING_MANDUMBE</RequirementId>
        <RequirementType>REQUIREMENT_LEADER_TYPE_MATCHES</RequirementType>
    </Row>
</Requirements>

<RequirementArguments>
    <Row>
        <RequirementId>REQUIRES_LEADER_KING_MANDUMBE</RequirementId>
        <Name>LeaderType</Name>
        <Value>LEADER_KING_MANDUMBE</Value>
    </Row>
</RequirementArguments>

</GameInfo>

Follow the example to restrict this by CivType instead of by LeaderType. There may also be another approach. Instead of granting the extra Economic Slot through a Civic, you can code a latent ability into LEADER_KING_MANDUMBE to activate an extra Economic Slot once he reaches a certain techonology (there is no Requirement for reaching a specific Civic, unfortunately -- AFAIK). You would have to create an additional TraitModifier and use REQUIREMENT_PLAYER_HAS_TECHNOLOGY.

Hope this helps!
Cheers.

EDIT: I noticed there were a few typos with Mandumbe's name in your opening post. Be careful. A typo in the wrong place and the code won't work. Good luck!
 
Hi Gleb,

Thank you very much.
I will try to follow your instructions step-by-step and post here in case of any problem I found

Best regards

Paulo
 
Top Bottom