The Civ4EventTriggerInfos file contains all the event triggers in the game. In BtS, the "events" are the choices, so the triggers are what one would normally think of as the event.
All tags must be opened and closed; the first is the "open", the second the "close" tag. If nothing goes inside a "list tag", then it should just be the opening tag with a "/" before the closing bracket. The following tables contain all available tags, as well as their purpose and accepted values.
These tags typically bracket other tags, sometimes the entire file, and are generally used to specify more than one piece of data.
|EventTriggerInfos||This tag surrounds all entries in the file|
|EventTriggerInfo||This tag surrounds each entry|
|Type||This is the trigger type identifier. Takes the form of EVENTTRIGGER_NAME|
|WorldNewsTexts||Is a text string identifier, which spiecifies the text to be displayed to all players when the event occurs.|
|Civic||Is a civic identifier, NONE for no civic. If used, specifies the civic required for the trigger to activate.|
|MinDifficulty||Is a difficulty level specifier, NONE for no difficulty. If used, specifies the minimum difficulty level required for the event trigger to activate|
|OtherPlayerHasTech||Is a technology identifier, NONE for no technology. If used, specifies the technology that the other player must have for the trigger to activate.|
|PythonCanDo||If specified, it’s the name of the Python function which is executed to check whether the trigger can be triggered.|
|PythonCanDoCity||If specified, it’s the name of the Python function which checks whether a city is eligible to be picked by the trigger.|
|PythonCanDoUnit||If specified, it’s the name of the Python function which checks whether a unit is eligible to be picked by the trigger.|
|PythonCallback||If specified, it’s the name of the Python function which is called when the trigger activates. Not used in any of the BtS events. Don’t confuse with <PythonCallback> in event descriptions in Civ4EventInfos.xml, which is the function which gets called when the event happens.|
All of these tags have a numerical value. Though it sometimes can be negative, it usually is not.
|iPercentGamesActive||Is a number from 0 to 100. When you start a new game, not all events will be in it. This number determines the probability of this event trigger being included in a new game. Thus you can create events that will be rarely seen – or, on the contrary, be eligible to occur in every game.|
|iWeight||Affects the probability of this trigger triggering. Applies to events that are active in this game only (as does everything else). Set to -1 if the trigger needs to always occur if the other conditions are met (for example, triggers that determine quest completion should be with -1).|
|iMinTreasury||Specifies the minimum amount of gold in the player’s treasury for the trigger to activate.|
|iMinPopulation||Specifies the minimum total population that a player must have for the trigger to activate.|
|iMaxPopulation||Specifies the maximum total population that a player is allowed to have for the trigger to activate.|
|iMinMapLandmass||Specifies the minimum amount of land areas that must be on the map for the trigger to activate. Can be used, essentially, to specify the minimum amount of continents required.|
|iMinOurLandmass||Specifies the minimum amount of land areas that must be under player’s control (specifically, have cities on them) for the trigger to activate.|
|iMaxOurLandmass||Specifies the maximum amount of land areas that the player is allowed to control for the trigger to activate. Use -1 to have no restrictions.|
|iAngry||Specifies the minimum anger level (unhappiness – happiness) in a city for the trigger to activate. Applies to triggers that target a city.|
|iUnhealthy||Specifies the minimum unhealthiness level (bad health – good health) in a city for the trigger to activate. Applies to triggers that target a city.|
|iNumUnits||Specifies the amount of unts that must be on a plot for the trigger to activate – used for events which pick a plot. If used in conjunction with <UnitsRequired>, only units of the listed classes will be counted.|
|iNumUnitsGlobal||Specifies the amount of units that the player must have for the trigger to activate. If used in conjunction with <UnitsRequired>, only units of the listed classes will be counted.|
|iUnitDamageWeight||Denotes the probability of the trigger activating for wounded units. Set to 1 for event triggers that you wish to deal with damaged units.|
|iUnitDistanceWeight||For events that affect a plot, increases the probability (if set to 1) of the trigger activating if a unit is far away from the plot.|
|iUnitExperienceWeight||When set to 1, increases the probability of triggering for a highly-experienced unit.|
|iNumBuildings||Is a number used in conjunction with <BuildingsRequired>. Set to 1 to indicate that 1 building of that type is required in a city, for city-picking events.|
|iNumBuildingsGlobal||Specifies the minimum amount of buildings listed in <BuildingsRequired> that the player must have in total for the trigger to activate.|
|iNumPlotsRequired||Should be set to 1 for triggers that require a plot that meets specific conditions. See below for tags that specify these conditions.|
|iPlotType||Specifies the plot type that the plot must have to meet the condition. Set to -1 to ignore plot type. Unless otherwise modded, 0 stands for peaks (PLOT_PEAK), 1 for hills (PLOT_HILLS), 2 for land plots (PLOT_LAND) and 3 for ocean plots (PLOT_OCEAN). The enumeration listing plot types is PlotTypes in the SDK and Python.|
|iNumReligions||Specifies how many of the religions listed in <ReligionsRequired> must be present for the trigger to activate. If <ReligionsRequired> has been left empty, then any religions will do. For example, for a trigger that affects a city, if <ReligionsRequired> is empty and <iNumReligions> is 2, then cities with at least different 2 religions in them will be eligible for the trigger.|
|iNumCorporations||Works exactly like <iNumReligions>, but for corporations instead of religions. Specifies how many of the corporations listed in <CorporationsRequired> must be present for the trigger to activate. If <CorporationsRequired> has been left empty, then any corporation will do.|
|iOtherPlayerShareBorders||Specifies the minimum amount of land plots that the affected player and the other player must have along the border (adjacent to one another).|
|iCityFoodWeight||Acts as a probability multiplier for the food stored in a city. That is, for triggers that pick a city, cities with more food stored will have a higher probability of being picked as iCityFoodWeight increases. 1 is a sane value to prioritize cities with a lot of food stored.|
All of these can either be 1 (on, or true) or 0 (off, or false). Be careful, as you can wind up with a double-negative, which the game will interpret as "True".
|bSinglePlayer||If set to 1, the event can only trigger in singleplayer games.|
|bProbabilityUnitMulitply||If set to 1, the trigger probability increases as the player builds more units.|
|bProbabilityBuildingMultiply||If set to 1, the trigger probability increases as the player builds more buildings.|
|bUnitsOnPlot||When set to 1, means that the trigger checks for the presence of units (listed in <UnitsRequired>) on the affected plot.|
|bOwnPlot||If set to 1, specifies that the plot must be owned by the affected player to meet conditions.|
|bPickReligion||If set to 1, then the trigger will pick a religion for the events that it activates. Which religion is picked can be further specified by the next variables.|
|bStateReligion||If set to 1 and <bPickReligion> is 1, then the affected player’s state religion will be picked.|
|bHolyCity||If set to 1 and <bPickReligion> is 1, then the player must own the religion’s holy city in order for it to be picked. If the trigger also picks a city, then the picked city must be the religion’s holy city. For example, if <bPickReligion>, <bStateReligion>, <bHolyCity> are all 1 and the trigger picks a city (<bPickCity> is also 1), then the city picked will be the holy city of the player’s state religion, provided he owns that city.|
|bPickCorporation||If set to 1, then a corporation will be picked by the trigger. The corporation must be present in the player’s civilization to be picked.|
|bHeadquarters||If set to 1 and <bPickCorporation> is 1 then the player must own the corporation’s headquarters in order for it to be picked. If the trigger also picks a city, then the picked city must be the corporation headquarters. Works like <bHolyCity> does for religions.|
|bPrereqEventPlot||For triggers that have PrereqEvents specified, if set to 1, means that the trigger will fire on the same plot where the prerequisite events fired. This is used with triggers such as continuing slave revolts or dustbowls – if the prerequisite event has fired, dustbowl or revolts will, if triggered, happen again in the same place where they did before.|
|bRecurring||If set to 1, the trigger can activate multiple times throughout the game for the same player. If set to 0, it can only activate once per player. Note that the <ClearEvents> field in event description can reset events, making the game forget they have occurred.|
|bTeam||If set to 1, the trigger applies to all players on the same team. Not used in any of the events shipping in BtS.|
|bGlobal||If set to 1, applies to all players. That means that, when triggered for one player, it’s cosidered to have triggered for all players. Combined with <bRecurring> set to 0, it will result in triggers that can only happen once per game.|
|bPickPlayer||If set to 1, then the trigger will pick another player to affect by the event. This is how events that give stuff to other players or affect relations with them are created. The specific player who gets selected can be further narrowed down by the next six tags.|
|bOtherPlayerWar||If set to 1, then the trigger can activate when the affected player and the other player are at war. When set to 1, the trigger activates for player pairs at peace.|
|bOtherPlayerHasReligion||If set to 1, then the other player must have the religion picked by the trigger (see <bPickReligion>). If <bStateReligion> is 0, then the other player must have the religion somewhere in his empire. If <bStateReligion> is 1, then the other player must have the same state religion.|
|bOtherPlayerHasOtherReligon||Works opposite to the previous variable. If set to 1, the other player must have a different religion than the picked one. If <bStateReligion> is 1, then the other player’s state religion must be different.|
|bOtherPlayerAI||If set to 1, then the other player must be an AI player.|
|bPickCity||If set to 1, then the trigger will pick a city.|
|bPickOtherPlayerCity||If set to 1, then the trigger will pick one of the other player’s cities.|
|bShowPlot||If set to 1, then the plot in which the event happens will be visually highlighted.|
All List tags consist of an opening/closing tag, which is shown here, and then each entry within it is another tag with the same name as the parent tag, minus the "s" (i.e. singular, rather than plural).
|TriggerTexts||Text string identifiers can be specified for additional trigger messages, in particular, texts tied to an era. For instance, the Ruins effect:
<TriggerTexts> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_CITY_RUINS_ANCIENT_1</Text> <Era>ERA_ANCIENT</Era> </TriggerText> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_CITY_RUINS_ANCIENT_1</Text> <Era>ERA_CLASSICAL</Era> </TriggerText> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_CITY_RUINS_ANCIENT_1</Text> <Era>ERA_MEDIEVAL</Era> </TriggerText> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_CITY_RUINS_ANCIENT_1</Text> <Era>ERA_RENAISSANCE</Era> </TriggerText> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_CITY_RUINS_INDUSTRIAL_1</Text> <Era>ERA_INDUSTRIAL</Era> </TriggerText> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_CITY_RUINS_INDUSTRIAL_1</Text> <Era>ERA_MODERN</Era> </TriggerText> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_CITY_RUINS_INDUSTRIAL_1</Text> <Era>ERA_FUTURE</Era> </TriggerText> </TriggerTexts>
Here, separate text is being given for every era, so that the correct text would appear at the appropriate time.
|UnitsRequired||If non-empty, contains information about required units to trigger. So, if specified, events can only be triggered for the listed unit classes. Example:
<UnitsRequired> <UnitClass>UNITCLASS_GALLEY</UnitClass> <UnitClass>UNITCLASS_TRIREME</UnitClass> <UnitClass>UNITCLASS_CARAVEL</UnitClass> <UnitClass>UNITCLASS_GALLEON</UnitClass> <UnitClass>UNITCLASS_PRIVATEER</UnitClass> <UnitClass>UNITCLASS_FRIGATE</UnitClass> <UnitClass>UNITCLASS_SHIP_OF_THE_LINE</UnitClass> <UnitClass>UNITCLASS_IRONCLAD</UnitClass> <UnitClass>UNITCLASS_TRANSPORT</UnitClass> <UnitClass>UNITCLASS_DESTROYER</UnitClass> <UnitClass>UNITCLASS_STEALTH_DESTROYER</UnitClass> <UnitClass>UNITCLASS_BATTLESHIP</UnitClass> <UnitClass>UNITCLASS_MISSILE_CRUISER</UnitClass> <UnitClass>UNITCLASS_SUBMARINE</UnitClass> <UnitClass>UNITCLASS_ATTACK_SUBMARINE</UnitClass> <UnitClass>UNITCLASS_CARRIER</UnitClass> </UnitsRequired>
Such a trigger would make the event only affect the listed naval units.
|BuildingsRequired||If non-empty, contains informations about the buildings required to trigger. Example:
<BuildingsRequired> <BuildingClass>BUILDINGCLASS_FORGE</BuildingClass> </BuildingsRequired>
That would denote that a Forge is required for the trigger.
|FeaturesRequired||If non-empty, specifies the features that the plot must have to meet the condition. For example:
<FeaturesRequired> <FeatureType>FEATURE_FOREST</FeatureType> </FeaturesRequired>
That is to require a plot to have Forest. Note that you can also explicitly require a plot not to have any features as follows:
<FeaturesRequired> <FeatureType>NONE</FeatureType> </FeaturesRequired>
Please note that flood plains also count as a feature and the above example would exclude any floodplain plots.
|TerrainsRequired||If non-empty, specifies the terrain type that the plot must have to meet the condition. For example:
<TerrainsRequired> <TerrainType>TERRAIN_GRASS</TerrainType> <TerrainType>TERRAIN_PLAINS</TerrainType> </TerrainsRequired>
To indicate that Grasslands or Plains plots are eligible for the trigger.
|ImprovementsRequired||If non-empty, specifies the improvements that the plot must have to meet the condition. As an example:
<ImprovementsRequired> <ImprovementType>IMPROVEMENT_PLANTATION</ImprovementType> </ImprovementsRequired>
That is to require a Plantation. Note that you can, just like with Features, set the variable to NONE to explicitly require no improvement to be present.
|BonusesRequired||If non-empty, specifies the bonus (resource) types that the plot must have to meet the condition. So,
<BonusesRequired> <BonusType>BONUS_INCENSE</BonusType> </BonusesRequired>
Requires Incense in the plot. And again, setting the variable to NONE will explicitly require no bonus to be present.
|RoutesRequired||The last variable specifying plot conditions. If non-empty, specifies the route types that the plot must have to meet the condition.
<RoutesRequired> <RouteType>ROUTE_ROAD</RouteType> <RouteType>ROUTE_RAILROAD</RouteType> </RoutesRequired>
The above requires either a road or a railroad in the plot.
|ReligionsRequired||If non-empty, specifies the religions required for the trigger to activate. For triggers that affect a city, the religions must be present in the city. For triggers not affecting a city, the religion must be present anywhere in the civilization. Hence:
<ReligionsRequired> <ReligionType>RELIGION_BUDDHISM</ReligionType> <ReligionType>RELIGION_CONFUCIANISM</ReligionType> <ReligionType>RELIGION_TAOISM</ReligionType> </ReligionsRequired>
That code would check for the presence of Buddhism, Confucianism and Taoism. It’s used in conjunction with the next variable, see below.
|CorporationsRequired||If non-empty, specifies the corporations required for the trigger to activate. For triggers that affect a city, the religions must be present in the city. For triggers not affecting a city, the religion must be present anywhere in the civilization.
<CorporationsRequired> <CorporationType>CORPORATION_1</CorporationType> <CorporationsRequired>
That would require the first corporation, which is Cereal Mills. Just like <ReligionsRequired>, this is used in combination with the next variable.
|Events||This, ladies and gentlemen, is the holy grail of the trigger XML file. Here event identifiers from Civ4EventInfos.xml are listed that denote the events triggered by this particular trigger. Note that each choice is also technically an event – therefore, for events that have choices, multiple identifiers will be listed. Take a look at the slave revolt event example:
<Events> <Event>EVENT_SLAVE_REVOLT_1</Event> <Event>EVENT_SLAVE_REVOLT_2</Event> <Event>EVENT_SLAVE_REVOLT_3</Event> </Events>
The code means that, when the trigger activates, the player will be allowed to choose between three events. So in-game, a popup with three options will appear. The effects of every choice are, of course, specified in Civ4EventInfos.xml. Triggers that do not have a choice associated with them simply list one event:
<Events> <Event>EVENT_TORNADO_1</Event> <Events>
Here the player will have no choice but to accept what happened.
|PrereqEvents||Another fun field, this lists the events that must have already happened for this trigger to possibly activate. There are two main uses. One is to simply specify conditional triggers. For example, EVENTTRIGGER_DUSTBOWL_CONT has
<PrereqEvents> <Event>EVENT_DUSTBOWL_2</Event> </PrereqEvents>
That means that the trigger can only activate if the EVENT_DUSTBOWL_2 event has occurred previously. The second use is for quest done triggers. When creating quests, each quest needs a trigger that checks whether its conditions have been fulfilled. However, a quest can only be completed if it’s been given. Therefore, for example, EVENTTRIGGER_HORSE_WHISPERING_DONE, which fires when you complete the Horse Whispering quest, has:
<PrereqEvents> <Event>EVENT_HORSE_WHISPERING_1</Event> </PrereqEvents>
That code makes sure that the trigger only activates if the EVENT_HORSE_WHISPERING_1 event has occurred, that being the event which assigns the Horse Whispering quest.
|OrPreReqs||If non-empty, lists technologies that player must have for the trigger to activate. These requirements are Or requirements – that is, only one technology of the listed ones is required. Example:
<OrPreReqs> <PrereqTech>TECH_STEAM_POWER</PrereqTech> <PrereqTech>TECH_STEEL</PrereqTech> <PrereqTech>TECH_SCIENTIFIC_METHOD</PrereqTech> <PrereqTech>TECH_ARTILLERY</PrereqTech> </OrPreReqs>
That allows the trigger to activate if the player has Steam Power or Steel or Scientific Method or Artillery.
|AndPreReqs||If non-empty, lists technologies that the player must have for the trigger to activate. These are And requirements – the player must have all the listed technologies for the trigger. Example:
<AndPreReqs> <PrereqTech>TECH_RIFLING</PrereqTech> <PrereqTech>TECH_STEEL</PrereqTech> </AndPreReqs>
This trigger can only fire when the player has both Rifling and Steel technologies.
|ObsoleteTechs||If non-empty, lists technologies that obsolete the trigger, making it ineligible to activate. If multiple technologies are listed, having any of those will invalidate the trigger for that player.
<ObsoleteTechs> <ObsoleteTech>TECH_RIFLING</ObsoleteTech> <ObsoleteTech>TECH_RAILROAD</ObsoleteTech> <ObsoleteTech>TECH_ECONOMICS</ObsoleteTech> </ObsoleteTechs>
These settings would obsolete the trigger for any player who has Rifling or Railroad or Economics.
In the following example of code, please note that there is a specific order of all of the tags. You must list the tags in this order for the game to properly interpret your file.
<EventTriggerInfo> <Type>EVENTTRIGGER_FOREST_FIRE</Type> <WorldNewsTexts> <Text>TXT_KEY_EVENTTRIGGER_FOREST_FIRE</Text> </WorldNewsTexts> <TriggerTexts> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_FOREST_FIRE_1</Text> <Era>NONE</Era> </TriggerText> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_FOREST_FIRE_2</Text> <Era>NONE</Era> </TriggerText> <TriggerText> <Text>TXT_KEY_EVENT_TRIGGER_FOREST_FIRE_3</Text> <Era>NONE</Era> </TriggerText> </TriggerTexts> <bSinglePlayer>0</bSinglePlayer> <iPercentGamesActive>70</iPercentGamesActive> <iWeight>100</iWeight> <bProbabilityUnitMultiply>0</bProbabilityUnitMultiply> <bProbabilityBuildingMultiply>0</bProbabilityBuildingMultiply> <Civic>NONE</Civic> <iMinTreasury>0</iMinTreasury> <iMinPopulation>0</iMinPopulation> <iMaxPopulation>0</iMaxPopulation> <iMinMapLandmass>0</iMinMapLandmass> <iMinOurLandmass>0</iMinOurLandmass> <iMaxOurLandmass>-1</iMaxOurLandmass> <MinDifficulty>NONE</MinDifficulty> <iAngry>0</iAngry> <iUnhealthy>0</iUnhealthy> <UnitsRequired/> <iNumUnits>0</iNumUnits> <iNumUnitsGlobal>0</iNumUnitsGlobal> <iUnitDamagedWeight>0</iUnitDamagedWeight> <iUnitDistanceWeight>0</iUnitDistanceWeight> <iUnitExperienceWeight>0</iUnitExperienceWeight> <bUnitsOnPlot>0</bUnitsOnPlot> <BuildingsRequired/> <iNumBuildings>0</iNumBuildings> <iNumBuildingsGlobal>0</iNumBuildingsGlobal> <iNumPlotsRequired>1</iNumPlotsRequired> <bOwnPlot>1</bOwnPlot> <iPlotType>-1</iPlotType> <FeaturesRequired> <FeatureType>FEATURE_FOREST</FeatureType> </FeaturesRequired> <TerrainsRequired/> <ImprovementsRequired/> <BonusesRequired/> <RoutesRequired/> <ReligionsRequired/> <iNumReligions>0</iNumReligions> <CorporationsRequired/> <iNumCorporations>0</iNumCorporations> <bPickReligion>0</bPickReligion> <bStateReligion>0</bStateReligion> <bHolyCity>0</bHolyCity> <bPickCorporation>0</bPickCorporation> <bHeadquarters>0</bHeadquarters> <Events> <Event>EVENT_FOREST_FIRE_1</Event> <Event>EVENT_FOREST_FIRE_2</Event> <Event>EVENT_FOREST_FIRE_3</Event> </Events> <PrereqEvents/> <bPrereqEventPlot>0</bPrereqEventPlot> <OrPreReqs/> <AndPreReqs/> <ObsoleteTechs/> <bRecurring>1</bRecurring> <bTeam>0</bTeam> <bGlobal>0</bGlobal> <bPickPlayer>0</bPickPlayer> <bOtherPlayerWar>0</bOtherPlayerWar> <bOtherPlayerHasReligion>0</bOtherPlayerHasReligion> <bOtherPlayerHasOtherReligion>0</bOtherPlayerHasOtherReligion> <bOtherPlayerAI>0</bOtherPlayerAI> <iOtherPlayerShareBorders>0</iOtherPlayerShareBorders> <OtherPlayerHasTech>NONE</OtherPlayerHasTech> <bPickCity>1</bPickCity> <bPickOtherPlayerCity>0</bPickOtherPlayerCity> <bShowPlot>1</bShowPlot> <iCityFoodWeight>0</iCityFoodWeight> <PythonCanDo/> <PythonCanDoCity/> <PythonCanDoUnit/> <PythonCallback/> </EventTriggerInfo>