Deon
Lt. of Mordor
Instead of prologue: EXTRA RULE:
If you comment your CIV4TechInfos.xml inside the <Techinfos></Techinfos> tags, you can get some problems with the tech prereqs. Be sure not to use the spaces before any tag (even "<!--") while you're using tabs in all the document.
If you're new to XML editing or want to add a tech without reading the modiki for all the tags info, here's some easy tutorial for you.
I'd recommend you to use some advanced text editor, because the basic notepad can be uncomfortable. I usually use Notepad2 freeware program.
Locate your \Assets\XML\Technologies\CIV4TechInfos.xml
Then copy it to your mod folder in the "BTS folder\Mods\Yourmod\Assets\XML\Technologies\". I hope you know how to make your own mod folder. Do not ever modify your vanilla game files (please
).
Open your new "BTS folder\Mods\Yourmod\Assets\XML\Technologies\CIV4TechInfos.xml" and scroll down to the end.
Maybe you will want to edit your existing tech (at least to give a place for your tech). I will describe how-to move the tech in the tech tree later.
To add a new tech you want to copy this text and paste it after the last </Techinfo> and before the </TechInfos> tags in your CIV4TechInfos.xml.
Here's the text:
Then you will want to edit the tech.
There're some parts of editing this sample tech.
1) You change its tags to be an unique tech.
2) You change the effect on game variables (like +1
, workers build improvements +50% faster and all).
3) You select the prerequisites for it.
4) You find a place for it in the techtree layout.
5) You make descriptions (name, pedia info) for it in TEXT xml files.
6) You make buttons for it.
1) Unique tech tags
Replace all the TECH_SAMPLE tags with your tech's name tags, like TECH_SAILING or TECH_KITCHENKNIFES. In Notepad2 there's a special hotkey combination Ctrl-H, which allows you to replace the one expression with another in the whole document.
This is the tech name tag which is referred to when you want some unit/civic/tech/anything to require this tech. YOURTECH is your tech's name.
<Type>TECH_YOURTECH</Type>
======================================
These are the text keys for the description (Name, pedia info, strategy, quote) of the tech in your text file, YOURTECH is your tech's name. You will make this file later.
<Description>TXT_KEY_TECH_YOURTECH_DESCR</Description>
<Civilopedia>TXT_KEY_TECH_YOURTECH_PEDIA</Civilopedia>
<Strategy>TXT_KEY_TECH_YOURTECH_STRATEGY</Strategy>
<Quote>TXT_KEY_TECH_YOURTECH_QUOTE</Quote>
======================================
This is the tag which points which advisor will recommend you the tech when it's the time.
<Advisor>
2) Various parameters of the tech.
Basic info
* Technology cost in beakers: <iCost>
* Era the tech is in: <Era>
* Score points for the tech: <iAsset>
* Power points for the tech: <iPower>
* Can be traded: <bTrade>
* Can be researched multiple times: <bRepeat>
* Can be found in native villages: <bGoodyTech>
* Flavors of the tech. For AI types, also allows certain great people to research the tech: <Flavors>
* The cost of the tech at the advanced start: <iAdvancedStartCost>. Set it to -1 to be unavaliable for the adv. start.
Free cakes
* Free unit for being 1st to research the tech: <FirstFreeUnitClass> (from CIV4UnitClassInfos.xml)
* Number of free techs given for being 1st to research the tech: <iFirstFreeTechs>
Your global parameters
* Water tiles can be worked in city radius: <bWaterWork>
* Increases the output of forest chopping (%): <iFeatureProductionModifier>
* Increases the workers' productivity (%): <iWorkerSpeedModifier>
* Allows bridgebuilding (no movement penalties with roads due a river-crossing): <bBridgeBuilding>
* Farms spread irrigation: <bIrrigation>
* Farms don't need irrigation: <bIgnoreIrrigation>
* Additional trade routes for each city: <iTradeRoutes>
* Additional
for each city: <iHealth>
* Additional
for each city: <iHappiness>
* Enables trade on rivers: <bRiverTrade>
* Reveals all the map: <bMapVisible>
* Centers the map: <bMapCentering>
* Increases the sight range over the water: <bExtraWaterSeeFrom>
* Increases the movement in the certain domain: <DomainExtraMoves>
Diplomacy
* Allows Map trading: <bMapTrading>
* Allows Open borders: <bOpenBordersTrading>
* Allows Technology trading: <bTechTrading>
* Allows Gold trading: <bGoldTrading>
* Allows defensive pacts: <bDefensivePactTrading>
* Allows permanent alliances <bPermanentAllianceTrading>
* Allows vassal state: <bDVassalTrading>
Bugged disable
* Stops the tech from being researched: <bDisable>. But beware of the bug. If you start the game in the later era than this tech's era, you will get it for free anyway.
3) Adding prerequisites.
Note: If your prereqs are not working, check your file for comments. There should be NO comments between <Techinfos></Techinfos> tags
There're tags :<OrPreReqs>, <AndPreReqs>, and they are used for indicating the technologies which are required for your tech to be researched.
Any of the techs written inside the <OrPreReqs></OrPreReqs> tag will have an arrow leading to your tech, and it means any of them could be researched to gain access to your tech.
All the techs written inside the <AndPreReqs></AndPreReqs> tag are REQUIRED to get your tech. Their buttons are shown on the tab after your tech's name.
i.e.
The tech requires Mining OR Hunting
The tech requires Mining AND Hunting
The tech requires (Mining) AND (Hunting OR Agriculture)
4) Tech coordinates
There're tags: <iGridX> and <iGridY> which represent the position of the tech on the tech-tree "table".
I.E.
means that the tech is in the 1st column and the 1st raw of the tech tree.
This is how the techs are placed:
So all the techs in the same column should has a step of 2 in the <GridX>, or they will overlap.
5)TEXT Descriptions
Make a file TechDescriptions.xml in the "BTS folder\Mods\Yourmod\Assets\XML\Text\" folder. You can simply make an empty txt file and change its extension to XML.
Fill it with the following text:
inside of the <Civ4GameText ... ></Civ4GameText> tags which are already present in the file. If you want the text to be avaliable in other languages, you may put the <italian> and other tags just after the </english> and before the </TEXT>
Now it's time to fill the text info about your tech.
1) Paste the sample code and rename TXT_KEY_SAMPLE to TXT_KEY_TECH_YOURTECH_DESCR, where TECH_YOURTECH is your tech's tag.
Then fill the space between <english> </english> with the name of your tech
After you made the description, it's time to make the strategy info, the pedia info and quote for your tech.
Follow the same algorythm as for the tech description, just replace the TXT_KEY_SAMPLE with TXT_KEY_TECH_YOUTECH_STRATEGY, TXT_KEY_TECH_YOUTECH_PEDIA and TXT_KEY_TECH_YOUTECH_QUOTE. As always, all the text shown in game goes between the <english></english> tags.
After you load the game everything should be at the place.
6) Buttons!
There's a nice tutorial about how to make your own buttons for your tech. Scroll down until you see the Part4 - that's it.
Place the final version of your button in the "BTS folder\Mods\Yourmod\Assets\Art\Interface\Buttons\Techtree" and make sure the path in your CIV4TechInfos.xml is right for the tech.
It is <button></button> tag, and it should look like
0) Just to make sure you're not forgotten: the guys who should get a credit for helping me to fix/expand this article:
-Seven05
If you comment your CIV4TechInfos.xml inside the <Techinfos></Techinfos> tags, you can get some problems with the tech prereqs. Be sure not to use the spaces before any tag (even "<!--") while you're using tabs in all the document.
If you're new to XML editing or want to add a tech without reading the modiki for all the tags info, here's some easy tutorial for you.
I'd recommend you to use some advanced text editor, because the basic notepad can be uncomfortable. I usually use Notepad2 freeware program.
Locate your \Assets\XML\Technologies\CIV4TechInfos.xml
Then copy it to your mod folder in the "BTS folder\Mods\Yourmod\Assets\XML\Technologies\". I hope you know how to make your own mod folder. Do not ever modify your vanilla game files (please

Open your new "BTS folder\Mods\Yourmod\Assets\XML\Technologies\CIV4TechInfos.xml" and scroll down to the end.
Maybe you will want to edit your existing tech (at least to give a place for your tech). I will describe how-to move the tech in the tech tree later.
To add a new tech you want to copy this text and paste it after the last </Techinfo> and before the </TechInfos> tags in your CIV4TechInfos.xml.
Here's the text:
Spoiler :
Code:
<TechInfo>
<Type>[COLOR="Blue"]TECH_SAMPLE[/COLOR]</Type>
<Description>[COLOR="Red"]TXT_KEY_TECH_SAMPLE[/COLOR]</Description>
<Civilopedia>[COLOR="#ff0000"]TXT_KEY_TECH_SAMPLE_PEDIA[/COLOR]</Civilopedia>
<Help/>
<Strategy>[COLOR="#ff0000"]TXT_KEY_TECH_SAMPLE_STRATEGY[/COLOR]</Strategy>
<Advisor>[COLOR="Blue"]ADVISOR_SCIENCE[/COLOR]</Advisor>
<iAIWeight>0</iAIWeight>
<iAITradeModifier>0</iAITradeModifier>
<iCost>100</iCost>
<iAdvancedStartCost>100</iAdvancedStartCost>
<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
<Era>[COLOR="#0000ff"]ERA_ANCIENT[/COLOR]</Era>
<FirstFreeUnitClass>NONE</FirstFreeUnitClass>
<iFeatureProductionModifier>0</iFeatureProductionModifier>
<iWorkerSpeedModifier>0</iWorkerSpeedModifier>
<iTradeRoutes>0</iTradeRoutes>
<iHealth>0</iHealth>
<iHappiness>0</iHappiness>
<iFirstFreeTechs>0</iFirstFreeTechs>
<iAsset>10</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>[COLOR="Blue"]0[/COLOR]</bMapTrading>
<bTechTrading>[COLOR="Blue"]0[/COLOR]</bTechTrading>
<bGoldTrading>[COLOR="Blue"]0[/COLOR]</bGoldTrading>
<bOpenBordersTrading>[COLOR="Blue"]0[/COLOR]</bOpenBordersTrading>
<bDefensivePactTrading>[COLOR="Blue"]0[/COLOR]</bDefensivePactTrading>
<bPermanentAllianceTrading>[COLOR="Blue"]0[/COLOR]</bPermanentAllianceTrading>
<bVassalTrading>[COLOR="Blue"]0[/COLOR]</bVassalTrading>
<bBridgeBuilding>0</bBridgeBuilding>
<bIrrigation>0</bIrrigation>
<bIgnoreIrrigation>0</bIgnoreIrrigation>
<bWaterWork>0</bWaterWork>
<iGridX>20</iGridX>
<iGridY>13</iGridY>
<DomainExtraMoves/>
<CommerceFlexible/>
<TerrainTrades/>
<bRiverTrade>0</bRiverTrade>
<Flavors>
<Flavor>
<FlavorType>FLAVOR_SCIENCE</FlavorType>
<iFlavor>1</iFlavor>
</Flavor>
</Flavors>
[COLOR="DarkGreen"] <OrPreReqs>
</OrPreReqs>
<AndPreReqs>
</AndPreReqs>[/COLOR]
<Quote>[COLOR="Red"]TXT_KEY_TECH_SAMPLE_QUOTE[/COLOR]</Quote>
<Sound/>
<SoundMP/>
<Button>Art/Interface/Buttons/TechTree/Sample.dds
</Button>
</TechInfo>
Then you will want to edit the tech.
There're some parts of editing this sample tech.
1) You change its tags to be an unique tech.
2) You change the effect on game variables (like +1

3) You select the prerequisites for it.
4) You find a place for it in the techtree layout.
5) You make descriptions (name, pedia info) for it in TEXT xml files.
6) You make buttons for it.
1) Unique tech tags
Replace all the TECH_SAMPLE tags with your tech's name tags, like TECH_SAILING or TECH_KITCHENKNIFES. In Notepad2 there's a special hotkey combination Ctrl-H, which allows you to replace the one expression with another in the whole document.
Spoiler :
This is the tech name tag which is referred to when you want some unit/civic/tech/anything to require this tech. YOURTECH is your tech's name.
<Type>TECH_YOURTECH</Type>
======================================
These are the text keys for the description (Name, pedia info, strategy, quote) of the tech in your text file, YOURTECH is your tech's name. You will make this file later.
<Description>TXT_KEY_TECH_YOURTECH_DESCR</Description>
<Civilopedia>TXT_KEY_TECH_YOURTECH_PEDIA</Civilopedia>
<Strategy>TXT_KEY_TECH_YOURTECH_STRATEGY</Strategy>
<Quote>TXT_KEY_TECH_YOURTECH_QUOTE</Quote>
======================================
This is the tag which points which advisor will recommend you the tech when it's the time.
<Advisor>
Spoiler :
(ADVISOR_GROWTH, ADVISOR_MILITARY, ADVISOR_ECONOMY, ADVISOR_SCIENCE, ADVISOR_CULTURE)
2) Various parameters of the tech.
Spoiler :
Basic info
* Technology cost in beakers: <iCost>
* Era the tech is in: <Era>
* Score points for the tech: <iAsset>
* Power points for the tech: <iPower>
* Can be traded: <bTrade>
* Can be researched multiple times: <bRepeat>
* Can be found in native villages: <bGoodyTech>
* Flavors of the tech. For AI types, also allows certain great people to research the tech: <Flavors>
* The cost of the tech at the advanced start: <iAdvancedStartCost>. Set it to -1 to be unavaliable for the adv. start.
Free cakes
* Free unit for being 1st to research the tech: <FirstFreeUnitClass> (from CIV4UnitClassInfos.xml)
* Number of free techs given for being 1st to research the tech: <iFirstFreeTechs>
Your global parameters
* Water tiles can be worked in city radius: <bWaterWork>
* Increases the output of forest chopping (%): <iFeatureProductionModifier>
* Increases the workers' productivity (%): <iWorkerSpeedModifier>
* Allows bridgebuilding (no movement penalties with roads due a river-crossing): <bBridgeBuilding>
* Farms spread irrigation: <bIrrigation>
* Farms don't need irrigation: <bIgnoreIrrigation>
* Additional trade routes for each city: <iTradeRoutes>
* Additional

* Additional

* Enables trade on rivers: <bRiverTrade>
* Reveals all the map: <bMapVisible>
* Centers the map: <bMapCentering>
* Increases the sight range over the water: <bExtraWaterSeeFrom>
* Increases the movement in the certain domain: <DomainExtraMoves>
Spoiler :
I.e. +1 sea movement
Code:
<DomainExtraMoves>
<DomainExtraMove>
<DomainType>DOMAIN_SEA</DomainType>
<iExtraMoves>1</iExtraMoves>
</DomainExtraMove>
</DomainExtraMoves>
Diplomacy
* Allows Map trading: <bMapTrading>
* Allows Open borders: <bOpenBordersTrading>
* Allows Technology trading: <bTechTrading>
* Allows Gold trading: <bGoldTrading>
* Allows defensive pacts: <bDefensivePactTrading>
* Allows permanent alliances <bPermanentAllianceTrading>
* Allows vassal state: <bDVassalTrading>
Bugged disable
* Stops the tech from being researched: <bDisable>. But beware of the bug. If you start the game in the later era than this tech's era, you will get it for free anyway.
3) Adding prerequisites.
Note: If your prereqs are not working, check your file for comments. There should be NO comments between <Techinfos></Techinfos> tags
There're tags :<OrPreReqs>, <AndPreReqs>, and they are used for indicating the technologies which are required for your tech to be researched.
Any of the techs written inside the <OrPreReqs></OrPreReqs> tag will have an arrow leading to your tech, and it means any of them could be researched to gain access to your tech.
All the techs written inside the <AndPreReqs></AndPreReqs> tag are REQUIRED to get your tech. Their buttons are shown on the tab after your tech's name.
Spoiler :
i.e.
The tech requires Mining OR Hunting
Code:
<OrPreReqs>
<PrereqTech>TECH_MINING</PrereqTech>
<PrereqTech>TECH_HUNTING</PrereqTech>
</OrPreReqs>
Code:
<AndPreReqs>
<PrereqTech>TECH_MINING</PrereqTech>
<PrereqTech>TECH_HUNTING</PrereqTech>
</AndPreReqs>
Code:
<OrPreReqs>
<PrereqTech>TECH_AGRICULTURE</PrereqTech>
<PrereqTech>TECH_HUNTING</PrereqTech>
</OrPreReqs>
<AndPreReqs>
<PrereqTech>TECH_MINING</PrereqTech>
</AndPreReqs>
4) Tech coordinates
There're tags: <iGridX> and <iGridY> which represent the position of the tech on the tech-tree "table".
I.E.
Code:
<iGridX>1</iGridX>
<iGridY>1</iGridY>
Spoiler :
This is how the techs are placed:

So all the techs in the same column should has a step of 2 in the <GridX>, or they will overlap.
5)TEXT Descriptions
Make a file TechDescriptions.xml in the "BTS folder\Mods\Yourmod\Assets\XML\Text\" folder. You can simply make an empty txt file and change its extension to XML.
Fill it with the following text:
Spoiler :
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Soren Johnson (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- Game Text Objects -->
<Civ4GameText xmlns="http://www.firaxis.com">
</Civ4GameText>
[/spoiler]
This is an empty file template for all of your descriptions.
After you've created this file, open it. You will need the code:
[code]<TEXT>
<TAG>TXT_KEY_SAMPLE<TAG>
<english>sample text</english>
</TEXT>
Now it's time to fill the text info about your tech.
1) Paste the sample code and rename TXT_KEY_SAMPLE to TXT_KEY_TECH_YOURTECH_DESCR, where TECH_YOURTECH is your tech's tag.
Then fill the space between <english> </english> with the name of your tech
Spoiler :
i.e.
Code:
<TEXT>
<TAG>TXT_KEY_TECH_ARCOLOGY_DESCR<TAG>
<english>Arcology</english>
</TEXT>
After you made the description, it's time to make the strategy info, the pedia info and quote for your tech.
Follow the same algorythm as for the tech description, just replace the TXT_KEY_SAMPLE with TXT_KEY_TECH_YOUTECH_STRATEGY, TXT_KEY_TECH_YOUTECH_PEDIA and TXT_KEY_TECH_YOUTECH_QUOTE. As always, all the text shown in game goes between the <english></english> tags.
After you load the game everything should be at the place.
6) Buttons!
There's a nice tutorial about how to make your own buttons for your tech. Scroll down until you see the Part4 - that's it.
Place the final version of your button in the "BTS folder\Mods\Yourmod\Assets\Art\Interface\Buttons\Techtree" and make sure the path in your CIV4TechInfos.xml is right for the tech.
It is <button></button> tag, and it should look like
Code:
<Button>Art/Interface/Buttons/TechTree/Yourtech.dds</Button>
0) Just to make sure you're not forgotten: the guys who should get a credit for helping me to fix/expand this article:
-Seven05