Civ4CommerceInfo

From Civilization Modding Wiki
Revision as of 01:45, 22 May 2009 by Ginger Ale (talk | contribs)
Jump to navigationJump to search

The Civ4CommerceInfo file defines various values for the gold, research, culture, and espionage sliders, controlling things like how the AI weights each slider and the initial percentages at the start of the game.

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.


Tags

Headers

These tags typically bracket other tags, sometimes the entire file, and are generally used to specify more than one piece of data.

Tag Name Description
CommerceInfos This begins and ends the file. Everything must go in between these two, or it will not work.
CommerceInfo Encloses the entry for each commerce type.
Type The name that can be used in other files and in the SDK to refer to a particular commerce type.
Description References the text which contains the commerce description (e.g. "gold" or "research"). The text is specified in any of the Assets\XML\Text files.
Button The path of a .dds file that contains the image for that commerce type.


Integers

All of these tags have a numerical value. Though it sometimes can be negative, it usually is not.

Tag Name Description
iInitialPercent The percent value given to a commerce type when the game starts (default is 100 for research, 0 for all others).
iInitialHappiness Sets the happiness received by this commerce type. Each n% to that commerce type provides a happy face (default is 10 for culture, 0 for all others).
iAIWeightPercent Sets the importance of this commerce type for the AI (default is 100 for gold, 125 for research, and 25 for culture and espionage).


Boolean

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".

Tag Name Description
bFlexiblePercent Sets whether a commerce type can be given a % of your total commerce. "Flexible" commerce types have their percent slider on the main screen. "Non-Flexible" commerce types might require certain techs to be given a percent slider,like Drama for culture (default is 1 for science and espionage, 0 for gold and culture).


Example

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.

 <CommerceInfos>
  <CommerceInfo>
   <Type>COMMERCE_GOLD</Type>
   <Description>TXT_KEY_COMMERCE_GOLD</Description>
   <iInitialPercent>0</iInitialPercent>
   <iInitialHappiness>0</iInitialHappiness>
   <iAIWeightPercent>100</iAIWeightPercent>
   <bFlexiblePercent>0</bFlexiblePercent>
   <Button>Art/Interface/Buttons/Process/ProcessWealth.dds</Button>
  </CommerceInfo>
 </CommerceInfos>