How to add a City State to the selection list in the Advanced Setup Screen (deprecated)

Status
Not open for further replies.

Gedemon

Modder
Super Moderator
Joined
Oct 4, 2004
Messages
11,592
Location
France
Edit : Deprecated method since the official CS picker has been added

Spoiler old post :

YnAMP add a selection list for City States in the advanced setup screen, with all the base game CS.

You can add your own City States in that list by adding a few lines in a XML file loaded in <FrontEndActions> in the .modinfo
Code:
    <FrontEndActions>
        <UpdateDatabase id="YOUR_SETTING">
            <File>Configuration/Config.xml</File>
        </UpdateDatabase>
    </FrontEndActions>

Config.xml
Code:
    <Parameters>
        <Replace ParameterId="LEADER_MINOR_CIV_YOURMINORCIV" Name="LOC_CIVILIZATION_YOURMINORCIV_NAME"  Description="LOC_CIVILIZATION_YOURMINORCIV_DESCRIPTION" Domain="bool" DefaultValue="0"  ConfigurationGroup="Map" ConfigurationId="LEADER_MINOR_CIV_YOURMINORCIV" GroupId="MapOptions" SortIndex="90"/>
    </Parameters>
    <ParameterDependencies>
        <Replace ParameterId="LEADER_MINOR_CIV_YOURMINORCIV" ConfigurationGroup="Map" ConfigurationId="SelectCityStates" Operator="Equals" ConfigurationValue="1"/>
    </ParameterDependencies>
The <ParameterDependencies> section tells the game to show your City State line(s) on the setup screen only when YnAMP "Manual Selection of City States" option is checked.

The <Parameters> section contains the data for the line(s) that can be checked to select your minor civilization:
  • ParameterId: an identifier, it must be the same in <ParameterDependencies> and <Parameters>. It doesn't need to be in the form of "LEADER_MINOR_CIV_XXX", but it must be unique and not used in another mod.
  • Name, Description: the text shown on the setup screen line and its mouse over description, that have to be defined in a file loaded using <UpdateText> in the <FrontEndActions> of the .modinfo
  • DefaultValue : 0 means the CS line is unchecked by default
  • ConfigurationGroup : must be "Map"
  • ConfigurationId : must be the exact <LeaderType> of your City State. That type name must contain (at the beginning, middle, or end, but exactly) the "LEADER_MINOR_CIV" string to be correctly identified as a City State by YnAMP.
  • GroupId: must be "MapOptions"
  • SortIndex: the position in the game/map section of the setup screen, must be a value between 83 and (I think) 200. "82" is the position of the YnAMP option to show the list, "83" is the position of all vanilla CS, "84" is the Viking DLC CS, "85" is the R&F CS and "86" is the Gathering Storm CS. So I'd suggest to skip a few (for a potential third XP or more DLC) and use values >90 and <200 for custom CS.
 
Last edited:
Presumably this could be used to delete city states from the list also? With Anno Domini, where there have been a number of Ancient World city states added (which I can do via your code above), I also need to delete those city states that have been deleted by the mod.

One other question (and again thinking of my mod), is there any way of adding and deleting resources on the various maps?
 
Yes, you can use either a sql or xml file in FrontEnd to delete CS from the list (just make sure it load after YnAMP, can't say if I use one for the setup file, just check the modinfo on github)
 
Thanks! I've managed to add the Anno Domini city-states to the list, which is great.

In order to delete unwanted city-states from the list, the only way I've found to do this (by accident!!) was this:

Code:
<GameInfo>
 <ParameterDependencies>
  <Replace ParameterId="Anno"        ConfigurationGroup="Map" ConfigurationId="SelectCityStates"  Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_ANTANANARIVO" ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_AUCKLAND"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_BOLOGNA"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_BRUSSELS"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_BUENOS_AIRES" ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_CAHOKIA"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_CARDIFF"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_FEZ"    ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_GRANADA"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_HONG_KONG"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_JAKARTA"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_KABUL"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_KANDY"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_KUMASI"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_LA_VENTA"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_MEXICO_CITY"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_NAN_MADOL"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_NAZCA"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_NGAZARGAMU"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_PALENQUE"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_PRESLAV"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_RAPA_NUI"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_VALLETTA"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_VILNIUS"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_YEREVAN"   ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
  <Replace ParameterId="LEADER_MINOR_CIV_ZANZIBAR"  ConfigurationGroup="Map" ConfigurationId="Anno"     Operator="Equals"  ConfigurationValue="1"/>
 </ParameterDependencies>
</GameInfo>
 
In XML to delete an entry, IIRC, you can use:
Code:
<GameInfo>
    <Parameters>
        <Delete ParameterId="LEADER_MINOR_CIV_ANTANANARIVO"/>
    </Parameters>
</GameInfo>
 
Status
Not open for further replies.
Top Bottom