1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

How do I create new traits?

Discussion in 'Civ5 - Creation & Customization' started by Evalis, Sep 29, 2010.

  1. Evalis

    Evalis Prince

    Joined:
    Mar 2, 2009
    Messages:
    493
    So I've been meaning to make a new trait for sulieman but going about doing this doesn't seem readily apparent, nor does altering any of the current traits beyond their numerical scope. For example.. Ramhkaengs +50% bonus from food and culture is simply listed as bonus from city states. How would I go about seperating the two?

    Any help on this would be appreciated ^^;
     
  2. Kruelgor

    Kruelgor Emperor

    Joined:
    May 12, 2010
    Messages:
    1,165
    Location:
    The United States
  3. Evalis

    Evalis Prince

    Joined:
    Mar 2, 2009
    Messages:
    493
    Read it again.. it uses a promotion that already exists.. i'm referring to the creation of something that doesn't.
     
  4. dagriggstar

    dagriggstar King

    Joined:
    Mar 23, 2006
    Messages:
    609
    Location:
    Adelaide, Australia
    I only have the demo, but based on the demo civ5traits file the following xml tags are unused

    LevelExperienceModifier = Old Charismatic trait (Faster Promotions)
    GreatPeopleRateModifier = Old Philosophical trait (More great people)
    GreatScientistRateModifier = (Used for Babylonian trait if you have it)
    MaxGlobalBuildingProductionModifier = Old Industrial trait (Faster world wonders, note that Egypt uses a different tag)
    MaxTeamBuildingProductionModifier = Old Industrial trait (Faster "team" wonders)
    MaxPlayerBuildingProductionModifier = Old Industrial trait (Faster national wonders)
    CityStateCombatModifier = (Probably) Better combat vs city-states.
    PlotCultureCostModifier = (Probably) Less culture required for expansion (Similar to Angkor Wat Wonder)
    PolicyCostModifier = (Probably) Cheaper social policies
    FasterAlongRiver = (Probably) Units move faster along rivers

    These two appear to work together. For example (Babylon) if writing is put as the FreeUnitPrereqTech and the FreeUnit is a great scientist, the civ with this trait will receive a great scientist when writing is researched
    FreeUnit = Receive a free unit at some point in the game (see below) (I assume this is used for Babylon)
    FreeUnitPrereqTech = After a tech has been researched, the freeunit defined above is given (Babylon)

    These two appear to work together. For example, If 2 food is set in ExtraYieldThresholds and 1 gold is set in YieldChanges, every hex that produces 2 food will produce an extra 1 gold for the civ with this trait.
    ExtraYieldThresholds = (Probably) Used for old financial trait. Works differently. Determines the amount of (example) food on a hex before getting a bonus (see below)
    YieldChanges = Determines the bonus amount (see above).

    YieldModifiers = Unsure. Possibly gives a % boost to hex tiles (eg a city produces 10 food per turn has a 10% bonus from this trait, produces 11 food per turn)

    Trait_MovesChangeUnitCombats = (Probably) increases the amount of moves certain types of units have. Note that the English +2 move bonus to naval units is handled differently.

    I beleive everything else would be used in some way by a civ in the original 18. Some tags may not actually be used by the game itself (ie they don't do anything at all).
     
  5. DioBrando

    DioBrando Warlord

    Joined:
    Oct 10, 2008
    Messages:
    207
    What do you suppose it would say if i wanted to make all iron tiles give me +2 commerce?
     
  6. dagriggstar

    dagriggstar King

    Joined:
    Mar 23, 2006
    Messages:
    609
    Location:
    Adelaide, Australia
    You would either need to be very creative with xml, add a new tag (Beyond my understanding, would probably need to know lua) or simply settle for +2 gold for all strategic resources (similar to part of the Russian ability).

    The simple settle for +2 gold for all strategic resources is below

    <Trait_YieldChangesStrategicResources>
    <Row>
    <TraitType>TRAIT_NAME_OF_TRAIT_HERE</TraitType>
    <YieldType>YIELD_GOLD</YieldType>
    <Yield>2</Yield>
    </Row>
    </Trait_YieldChangesStrategicResources>

    Note that <Trait_YieldChangesStrategicResources> tag is already open, so you shouldn't need to add that (Just put it there so you know where in the xml file the xml goes)




    If you want to get creative, you could give the civ a kind of "unique tech" that will allow a "unique improvement" that is only buildable on hexes that have iron. Would have to edit.
    1. CIV5Civilizations.xml
    2. CIV5Technologies.xml
    3. CIV5Builds.xml
    4. CIV5Improvements.xml
    Somehow, I don't think you'll bother, but incase you do, code is below. If that doesn't work, well I'm missing something I can't check until I actually get the full game :p

    * denotes that this part is already present in the file, I've put it in to show you where in the file to edit

    1. Edit CIV5Civilizations.xml (Give the civ a freetech)
    <Civilization_FreeTechs>*
    <Row>
    <CivilizationType>CIVILIZATION_NAME</CivilizationType>
    <TechType>TECH_NAME</TechType>
    </Row>
    </Civilization_FreeTechs>*

    2. Edit CIV5Technologies.xml (Disable the tech so other civs can't get it, thus it stays unique)
    <Technologies>*
    <Row>
    <Type>TECH_NAME</Type>
    <Cost>10</Cost>
    <Description>TXT_KEY_TECH_NAME_TITLE</Description>
    <Civilopedia>TXT_KEY_TECH_NAME_DESC</Civilopedia>
    <Help>TXT_KEY_TECH_NAME_HELP</Help>
    <Era>ERA_ANCIENT</Era>
    <GridX>0</GridX>
    <GridY>0</GridY>
    <Disable>true</Disable>
    </Row>
    </Technologies>*

    3. CIV5Builds.xml (So workers can actually build the improvement, also to make the improvement require the "unique tech")
    <Builds>*
    <Row>
    <Type>BUILD_NAME</Type>
    <PrereqTech>TECH_NAME</PrereqTech>
    <Time>700</Time>
    <ImprovementType>IMPROVEMENT_NAME</ImprovementType>
    <Description>TXT_KEY_BUILD_NAME</Description>
    <Recommendation>TXT_KEY_BUILD_PROD_REC</Recommendation>
    <EntityEvent>ENTITY_EVENT_MINE</EntityEvent>
    <HotKey>KB_N</HotKey>
    <OrderPriority>96</OrderPriority>
    </Row>
    </Builds>*

    4. CIV5Improvements.xml (What the actual yields are, Only allow it to be built when Iron is present on a hex) (Need to edit in multiple places)

    <Improvements>*
    <Row>
    <Type>IMPROVEMENT_NAME</Type>
    <Description>TXT_KEY_IMPROVEMENT_NAME</Description>
    <Civilopedia>TXT_KEY_CIV5_IMPROVEMENTS_NAME</Civilopedia>
    <ArtDefineTag>ART_DEF_IMPROVEMENT_MINE</ArtDefineTag>
    <PillageGold>20</PillageGold>
    <PortraitIndex>26</PortraitIndex>
    <IconAtlas>TERRAIN_ATLAS</IconAtlas>
    </Row>
    </Improvements>*

    Seperate section
    <Improvement_ResourceTypes>*
    <Row>
    <ImprovementType>IMPROVEMENT_MINE</ImprovementType>
    <ResourceType>RESOURCE_IRON</ResourceType>
    </Row>
    </Improvement_ResourceTypes>*

    Seperate section
    <Improvement_ResourceType_Yields>*
    <Row>
    <ImprovementType>IMPROVEMENT_NAME</ImprovementType>
    <ResourceType>RESOURCE_IRON</ResourceType>
    <YieldType>YIELD_PRODUCTION</YieldType>
    <Yield>1</Yield>
    </Row>
    <Row>
    <ImprovementType>IMPROVEMENT_NAME</ImprovementType>
    <ResourceType>RESOURCE_IRON</ResourceType>
    <YieldType>YIELD_GOLD</YieldType>
    <Yield>2</Yield>
    </Row>
    </Improvement_ResourceType_Yields>*
     
  7. Carnarvan

    Carnarvan Chieftain

    Joined:
    Jul 5, 2013
    Messages:
    23
    Location:
    New Hampshire
    Please help me i have absolutely no idea.
     
  8. Machiavelli24

    Machiavelli24 Mod creator

    Joined:
    May 9, 2012
    Messages:
    818
    That would be easy.

    1) Make a building no one can build that gives +2 gold from the Iron resource (there is a building table that lets you do +yield from resources).

    2) Use the freeBuildingInAllCities trait (that Carthage uses to get harbors) to give the building created in step 1 to all cities.
    -----------------
    You can do the same way as +2 gold from Iron. Make a building that gives a defensive strength bonus (look at what walls does for an example) and than use the freeBuilding trait to give it to every city.
    -----------
    Bah, I did not see the time stamps. Carnavan, you would have been better off making a new thread.
     

Share This Page