How to add a Tech (open)

Discussion in 'Civ4 - Modding Tutorials & Reference' started by GarretSidzaka, Nov 18, 2006.

  1. GarretSidzaka

    GarretSidzaka Deity

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    Please feel free to add to this basic description.
    1. Add the program you want to use to edit XML. like "XML marker" "XMLspy" or just plain old notepad.
    2. go to the warlords directory. go to the mods directory there. copy the "barebones mod" and rename the copy after your mod.
    3. open it to Mods/<yourmodhere>/assets/xml/technologies/CIV4TechInfos.xml. open this file with the program you want to use to edit
    4. you should see this:
      Spoiler :
      Code:
      <?xml version="1.0"?>
      <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Soren Johnson (Firaxis Games) -->
      <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Jon Shafer (Firaxis Games) -->
      <!-- Sid Meier's Civilization 4 -->
      <!-- Copyright Firaxis Games 2005 -->
      <!-- -->
      <!-- Tech Infos -->
      <Civ4TechInfos xmlns="x-schema:CIV4TechnologiesSchema.xml">
          <TechInfos>
              <TechInfo>
                  <Type>TECH_MYSTICISM</Type>
                  <Description>TXT_KEY_TECH_MYSTICISM</Description>
                  <Civilopedia>TXT_KEY_TECH_MYSTICISM_PEDIA</Civilopedia>
                  <Help/>
                  <Strategy>TXT_KEY_TECH_MYSTICISM_STRATEGY</Strategy>
                  <Advisor>ADVISOR_RELIGION</Advisor>
                  <iAIWeight>0</iAIWeight>
                  <iAITradeModifier>0</iAITradeModifier>
                  <iCost>500</iCost>
                  <Era>ERA_ANCIENT</Era>
                  <FirstFreeUnitClass>NONE</FirstFreeUnitClass>
                  <iFeatureProductionModifier>50</iFeatureProductionModifier>
                  <iWorkerSpeedModifier>0</iWorkerSpeedModifier>
                  <iTradeRoutes>0</iTradeRoutes>
                  <iHealth>0</iHealth>
                  <iHappiness>0</iHappiness>
                  <iFirstFreeTechs>0</iFirstFreeTechs>
                  <iAsset>8</iAsset>
                  <iPower>0</iPower>
                  <bRepeat>0</bRepeat>
                  <bTrade>0</bTrade>
                  <bDisable>0</bDisable>
                  <bGoodyTech>0</bGoodyTech>
                  <bExtraWaterSeeFrom>0</bExtraWaterSeeFrom>
                  <bMapCentering>0</bMapCentering>
                  <bMapVisible>0</bMapVisible>
                  <bMapTrading>0</bMapTrading>
                  <bTechTrading>0</bTechTrading>
                  <bGoldTrading>1</bGoldTrading>
                  <bOpenBordersTrading>1</bOpenBordersTrading>
                  <bDefensivePactTrading>0</bDefensivePactTrading>
                  <bPermanentAllianceTrading>0</bPermanentAllianceTrading>
                  <bVassalTrading>1</bVassalTrading>
                  <bBridgeBuilding>1</bBridgeBuilding>
                  <bIrrigation>0</bIrrigation>
                  <bIgnoreIrrigation>0</bIgnoreIrrigation>
                  <bWaterWork>1</bWaterWork>
                  <iGridX>1</iGridX>
                  <iGridY>1</iGridY>
                  <DomainExtraMoves/>
                  <CommerceFlexible/>
                  <TerrainTrades>
                      <TerrainTrade>
                          <TerrainType>TERRAIN_COAST</TerrainType>
                          <bTerrainTrade>1</bTerrainTrade>
                      </TerrainTrade>
                  </TerrainTrades>
                  <Flavors>
                      <Flavor>
                          <FlavorType>FLAVOR_RELIGION</FlavorType>
                          <iFlavor>9</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_GOLD</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_CULTURE</FlavorType>
                          <iFlavor>8</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_GROWTH</FlavorType>
                          <iFlavor>2</iFlavor>
                      </Flavor>
                  </Flavors>
                  <OrPreReqs/>
                  <AndPreReqs/>
                  <Quote/>
                  <Sound/>
                  <SoundMP/>
                  <Button>,Art/Interface/Buttons/TechTree/Mysticism.dds,Art/Interface/Buttons/TechTree_Atlas.dds,4,11</Button>
              </TechInfo>
              <TechInfo>
                  <Type>TECH_FUTURE_TECH</Type>
                  <Description>TXT_KEY_TECH_FUTURE_TECH</Description>
                  <Civilopedia>TXT_KEY_TECH_FUTURE_TECH_PEDIA</Civilopedia>
                  <Help/>
                  <Strategy>TXT_KEY_TECH_FUTURE_TECH_STRATEGY</Strategy>
                  <Advisor>ADVISOR_SCIENCE</Advisor>
                  <iAIWeight>0</iAIWeight>
                  <iAITradeModifier>0</iAITradeModifier>
                  <iCost>10000</iCost>
                  <Era>ERA_FUTURE</Era>
                  <FirstFreeUnitClass>NONE</FirstFreeUnitClass>
                  <iFeatureProductionModifier>0</iFeatureProductionModifier>
                  <iWorkerSpeedModifier>0</iWorkerSpeedModifier>
                  <iTradeRoutes>0</iTradeRoutes>
                  <iHealth>1</iHealth>
                  <iHappiness>1</iHappiness>
                  <iFirstFreeTechs>0</iFirstFreeTechs>
                  <iAsset>64</iAsset>
                  <iPower>0</iPower>
                  <bRepeat>1</bRepeat>
                  <bTrade>0</bTrade>
                  <bDisable>1</bDisable>
                  <bGoodyTech>0</bGoodyTech>
                  <bExtraWaterSeeFrom>0</bExtraWaterSeeFrom>
                  <bMapCentering>0</bMapCentering>
                  <bMapVisible>0</bMapVisible>
                  <bMapTrading>0</bMapTrading>
                  <bTechTrading>0</bTechTrading>
                  <bGoldTrading>0</bGoldTrading>
                  <bOpenBordersTrading>0</bOpenBordersTrading>
                  <bDefensivePactTrading>0</bDefensivePactTrading>
                  <bPermanentAllianceTrading>0</bPermanentAllianceTrading>
                  <bVassalTrading>0</bVassalTrading>
                  <bBridgeBuilding>0</bBridgeBuilding>
                  <bIrrigation>0</bIrrigation>
                  <bIgnoreIrrigation>0</bIgnoreIrrigation>
                  <bWaterWork>0</bWaterWork>
                  <iGridX>1</iGridX>
                  <iGridY>3</iGridY>
                  <DomainExtraMoves/>
                  <CommerceFlexible/>
                  <TerrainTrades/>
                  <Flavors>
                      <Flavor>
                          <FlavorType>FLAVOR_MILITARY</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_RELIGION</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_PRODUCTION</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_GOLD</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_SCIENCE</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_CULTURE</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                  </Flavors>
                  <OrPreReqs/>
                  <AndPreReqs/>
                  <Quote>TXT_KEY_TECH_FUTURE_TECH_QUOTE</Quote>
                  <Sound>AS2D_TECH_FUTURE</Sound>
                  <SoundMP>AS2D_TECH_MP_FUTURE</SoundMP>
                  <Button>,Art/Interface/Buttons/TechTree/Future Tech.dds,Art/Interface/Buttons/TechTree_Atlas.dds,2,4</Button>
              </TechInfo>
          </TechInfos>
      </Civ4TechInfos>
    5. you should cut and paste this part as many times as you need techs. For now just once.
      Spoiler :
      Code:
          <TechInfo>
                  <Type>TECH_FUTURE_TECH</Type>
                  <Description>TXT_KEY_TECH_FUTURE_TECH</Description>
                  <Civilopedia>TXT_KEY_TECH_FUTURE_TECH_PEDIA</Civilopedia>
                  <Help/>
                  <Strategy>TXT_KEY_TECH_FUTURE_TECH_STRATEGY</Strategy>
                  <Advisor>ADVISOR_SCIENCE</Advisor>
                  <iAIWeight>0</iAIWeight>
                  <iAITradeModifier>0</iAITradeModifier>
                  <iCost>10000</iCost>
                  <Era>ERA_FUTURE</Era>
                  <FirstFreeUnitClass>NONE</FirstFreeUnitClass>
                  <iFeatureProductionModifier>0</iFeatureProductionModifier>
                  <iWorkerSpeedModifier>0</iWorkerSpeedModifier>
                  <iTradeRoutes>0</iTradeRoutes>
                  <iHealth>1</iHealth>
                  <iHappiness>1</iHappiness>
                  <iFirstFreeTechs>0</iFirstFreeTechs>
                  <iAsset>64</iAsset>
                  <iPower>0</iPower>
                  <bRepeat>1</bRepeat>
                  <bTrade>0</bTrade>
                  <bDisable>1</bDisable>
                  <bGoodyTech>0</bGoodyTech>
                  <bExtraWaterSeeFrom>0</bExtraWaterSeeFrom>
                  <bMapCentering>0</bMapCentering>
                  <bMapVisible>0</bMapVisible>
                  <bMapTrading>0</bMapTrading>
                  <bTechTrading>0</bTechTrading>
                  <bGoldTrading>0</bGoldTrading>
                  <bOpenBordersTrading>0</bOpenBordersTrading>
                  <bDefensivePactTrading>0</bDefensivePactTrading>
                  <bPermanentAllianceTrading>0</bPermanentAllianceTrading>
                  <bVassalTrading>0</bVassalTrading>
                  <bBridgeBuilding>0</bBridgeBuilding>
                  <bIrrigation>0</bIrrigation>
                  <bIgnoreIrrigation>0</bIgnoreIrrigation>
                  <bWaterWork>0</bWaterWork>
                  <iGridX>1</iGridX>
                  <iGridY>3</iGridY>
                  <DomainExtraMoves/>
                  <CommerceFlexible/>
                  <TerrainTrades/>
                  <Flavors>
                      <Flavor>
                          <FlavorType>FLAVOR_MILITARY</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_RELIGION</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_PRODUCTION</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_GOLD</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_SCIENCE</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                      <Flavor>
                          <FlavorType>FLAVOR_CULTURE</FlavorType>
                          <iFlavor>1</iFlavor>
                      </Flavor>
                  </Flavors>
                  <OrPreReqs/>
                  <AndPreReqs/>
                  <Quote>TXT_KEY_TECH_FUTURE_TECH_QUOTE</Quote>
                  <Sound>AS2D_TECH_FUTURE</Sound>
                  <SoundMP>AS2D_TECH_MP_FUTURE</SoundMP>
                  <Button>,Art/Interface/Buttons/TechTree/Future Tech.dds,Art/Interface/Buttons/TechTree_Atlas.dds,2,4</Button>
              </TechInfo>
    6. after you paste these, you need to change this part with the name of the tech. be consistant (very important)
      Code:
      <Type>TECH_FUTURE_TECH</Type>
      <Description>TXT_KEY_TECH_FUTURE_TECH</Description>
      <Civilopedia>TXT_KEY_TECH_FUTURE_TECH_PEDIA</Civilopedia>
      <Help/>
      <Strategy>TXT_KEY_TECH_FUTURE_TECH_STRATEGY</Strategy>
    7. Then check this page to understand what the other variables are
    8. when you finish, you have to load the mod and check the civiliopaedia.
    9. more than likely, you typoed (especially if you just use notepad) and it will tell you more or less what is wrong. this is not easy and cannot be taught, it is debugging.
    10. repeat the above steps a few dozen times, until you techs are done!

    Here are some more hints:
    Spoiler :

    Code:
    <iGridX>1</iGridX>
    <iGridY>3</iGridY>
    
    these entries are just above the "flavors" entry. these are postitional coordinates, in the "X" axis and "Y" axis (just like high school math class) you place the techs "floating" on the tech tree screen at those coordinates.
    just experiment with it :goodjob:

    You will also need to go to <yourmodname>/Assets/Art/Interface/Buttons/TechTree/
    *you will likely need to create these folders!!!*

    Then you can make a 64X64 pixel JPG picture and convert it using either GIMP 2.0 with GIMP DDS PLUGINS or some other comprable graphics program and DDS conversion tool.

    save the file in the above folder i told you to create. save as "testtech.dds"

    now go back to the XML file and look here:
    Code:
    <Button>,Art/Interface/Buttons/TechTree/Future Tech.dds,Art/Interface/Buttons/TechTree_Atlas.dds,2,4</Button>
            </TechInfo>
    Notice it says </TechInfo>
    that means its the end of the tech and anything that follows must begin with
    <TechTree> (beginning)
    anyways..you will change the above codebox contents to this:
    Code:
    <Button>Art/Interface/Buttons/TechTree/[B]testtech.dds[/B]</Button>
    </TechInfo>
    Remember to remove all commas! as this will create strange pink dots!!

    What you will have to do is make some changes, save it, and then run the mod in civ4 to observe the consequences of your changes.



    I hope this helps. And please, post here so we can make this more complete!
     
  2. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,709
    Gender:
    Male
    Location:
    MN
    Usually there are like three or four files you have to change to get something added in the game, to add a tech, there is only this ONE? How do you tell where the tech will go?? What if you want a tech after Assembly Line and before Facism? Just as an example?
     
  3. GarretSidzaka

    GarretSidzaka Deity

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    Code:
    <iGridX>1</iGridX>
    <iGridY>3</iGridY>
    
    these entries are just above the "flavors" entry. these are postitional coordinates, in the "X" axis and "Y" axis (just like high school math class) you place the techs "floating" on the tech tree screen at those coordinates.
    just experiment with it :goodjob:

    You will also need to go to <yourmodname>/Assets/Art/Interface/Buttons/TechTree/
    *you will likely need to create these folders!!!*

    Then you can make a 64X64 pixel JPG picture and convert it using either GIMP 2.0 with GIMP DDS PLUGINS or some other comprable graphics program and DDS conversion tool.

    save the file in the above folder i told you to create. save as "testtech.dds"

    now go back to the XML file and look here:
    Code:
    <Button>,Art/Interface/Buttons/TechTree/Future Tech.dds,Art/Interface/Buttons/TechTree_Atlas.dds,2,4</Button>
            </TechInfo>
    Notice it says </TechInfo>
    that means its the end of the tech and anything that follows must begin with
    <TechTree> (beginning)
    anyways..you will change the above codebox contents to this:
    Code:
    <Button>Art/Interface/Buttons/TechTree/[B]testtech.dds[/B]</Button>
    </TechInfo>
    Remember to remove all commas! as this will create strange pink dots!!

    What you will have to do is make some changes, save it, and then run the mod in civ4 to observe the consequences of your changes.
     
  4. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,709
    Gender:
    Male
    Location:
    MN
    Is there anyway i can get a HOW to from start to finish starting with One file then going to another etc?
     
  5. GarretSidzaka

    GarretSidzaka Deity

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    your best bet is this, copy and paste the vanilla technology that you want to make your tech have its abilities. Then change the stuff that i pointed out above. there is not going to be a line by line walkthru as these xml entires are like a hundred lines of text in some places.

    the closest thing to a line by line walkthru is here, and is what i used to learn this stuff. if you dont look very closely at this link, you wont learn techs. this is what i used to learn what i know.
     
  6. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,709
    Gender:
    Male
    Location:
    MN
    Thats not quite what i was asking for more like this:

    -file cityLsystem, scroll down till you see this:

    <!--LEAF 2x2 BUILDINGS-->

    and enter there this:

    <ArtRef Name="building:BUILDING_ARCHERY_RANGE">
    <Scale>1.05</Scale>
    </ArtRef>

    -file buildingclassinfos.xml:

    <BuildingClassInfo>
    <Type>BUILDINGCLASS_ARCHERY_RANGE</Type>
    <Description>Archery Range</Description>
    <iMaxGlobalInstances>-1</iMaxGlobalInstances>
    <iMaxTeamInstances>-1</iMaxTeamInstances>
    <iMaxPlayerInstances>-1</iMaxPlayerInstances>
    <iExtraPlayerInstances>0</iExtraPlayerInstances>
    <bNoLimit>0</bNoLimit>
    <bMonument>0</bMonument>
    <DefaultBuilding>BUILDING_ARCHERY_RANGE</DefaultBuilding>
    <VictoryThresholds/>
    </BuildingClassInfo>

    -file buildinginfos.xml:
    you enter this: <<<<


    -file artdefinesbuildings.xml: you enter this:


    dont need what they stand for:

    thats all i am saying, maybe my writing is not that good, sorry?
     
  7. GarretSidzaka

    GarretSidzaka Deity

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    there is only one file for techs, and i have given you the stuff you need to read. and yes, you need to read each individual thing, and then, let's say that one tech has an entry you need, you can either cut/paste the entire tech, or just the part of it you need.
     
  8. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,709
    Gender:
    Male
    Location:
    MN

    OH ok, i just thought it was more difficult than that like adding a unit, you have to edit three files (unitinfo, classinfo and artdefines), this makes it so much better only one file.
     
  9. GarretSidzaka

    GarretSidzaka Deity

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    yeah bro :D
    and the stuff up here should totally illuminate the project for you. have fun making a techtree :yuck:
     
  10. HecticHermit

    HecticHermit Chieftain

    Joined:
    Nov 21, 2006
    Messages:
    19
    Could you plz direct me to a good XML tutorial, I know HTML, but not XML, I'm still new to the Modding world but I know a few things about 3d animation and such....Also could you use PS instead of GIMP? Would this work in non warlords
     
  11. GarretSidzaka

    GarretSidzaka Deity

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    xml is simple to write, just have to keep track of what values are where. here is a civ4 mod reference (in construction) with alot of definitions of the xmls

    i dont use photoshop, but it should work, as long as it can save in a .DDS format (if not, just get a DDS plugin for PS)

    PS: come to the dune mod if you can model! we need skillful 3Dmodelers
     
  12. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,709
    Gender:
    Male
    Location:
    MN

    Quite hogging all the modellers, come to Japanese Mythology, LOL :goodjob: :joke: :ninja:
     
  13. GarretSidzaka

    GarretSidzaka Deity

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    LMAO :rotfl:
     
  14. BoydofZINJ

    BoydofZINJ Warlord

    Joined:
    Oct 7, 2007
    Messages:
    126
    I am having trouble adding techs to BtS ... and how do you eliminate techs all together?

    Let us say I want to make a "future" tech game and not worry about the first 50 or so original BtS techs... and want a new tech tree?
     
  15. neancit

    neancit Chieftain

    Joined:
    Jul 5, 2009
    Messages:
    9
    I've recently began modding CIV 4, although I didn't have much of a problem with understanding where I need to modify things, I've come across a problem while trying to add a new tech.

    The thing is: When I tried to make AndPreReqs's they just wouldn't apply to the game.

    Thank you in advance for and possible solutions.

    This is what's written

    Spoiler :

    <OrPreReqs/>
    <AndPreReqs>
    <PrereqTech>TECH_ASTRONOMY</PrereqTech>
    <PrereqTech>TECH_SCIENTIFIC_METHOD</PrereqTech>
    </AndPreReqs>
     
  16. The_J

    The_J Say No 2 Net Validations Super Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    33,950
    Location:
    DE/NL/FR
    Where do you see, that they are not applied?
    Have you looked at the civilopedia screen?
     
  17. neancit

    neancit Chieftain

    Joined:
    Jul 5, 2009
    Messages:
    9
    Yes I've checked both the Civilopedia and the Research screen.
     
  18. The_J

    The_J Say No 2 Net Validations Super Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    33,950
    Location:
    DE/NL/FR
    Could you please add a ingame screenshot of your technology?
     
  19. neancit

    neancit Chieftain

    Joined:
    Jul 5, 2009
    Messages:
    9
    Could you explain how I sould do that ( well I do know how to do a scrren shot)
     
  20. The_J

    The_J Say No 2 Net Validations Super Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    33,950
    Location:
    DE/NL/FR
    At the bottom of the answer page is a button "manage attachments".
    Click on it, search your screenshot, and upload it.


    And what i forgot: Welcome to CFC :).
     

Share This Page