Civ 4 Guide - Creating A New Technology

After you are done editing everything in your mod folder, do you just copy your edited files from your mod folder to your original game folder?
 
xaviel said:
After you are done editing everything in your mod folder, do you just copy your edited files from your mod folder to your original game folder?

no... you don't ever (well, very rarely) need to overwrite any files in the game folder. Everything goes in the folder belonging to your mod. If Civ4 needs a file that's not in your mod's folder, it'll automatically use the standard version of that file.
 
austin316hockey said:
The only thing is, there is no sample of the syntax (exactly what tags belong in this block), although I have a feeling it's identical to the <FreeTechs> block.

On a side note, can anyone out there shed some light on that block, what the tags should actually be?

You can look at the schema for guidelines on what to add. In this particular case it looks like it would be:

Code:
<DisableTechs>
  <DisableTech>
    <TechType>TECH_AGRICULTURE</TechType>
    <bDisableTech>1</bDisableTech>
  </DisableTech>
  <DisableTech>
    <TechType>TECH_MASONRY</TechType>
    <bDisableTech>1</bDisableTech>
  </DisableTech>
<DisableTechs>

Note: This is the CIV4CivilizationInfos.xml file, the <bDisable> line in the tech file is a boolean field (0 or 1)
 
Excellent tutorial. My only question is can you add a new tech to a new branch and have it not show up on the tech tree. I want to create a tech, in this case TECH_TEXAS, that can be used as a prerequisite for all the civilization specific buildings I am adding for a civ. This way I can disable the default buildings I don't want to appear, and make this tech a dependency for this civilizations specific buildings. As the tech will be given to that civ for free and will not be tradable or researchable, in theory I think this would work. But I don't need it to show up on the tech tree hence my question.

Thanks
 
Epicurist oooh..make the alamo a wonder!

That's one of the Civ Specific wonders I wanted to add, going to use it to replace the Heroic Epic wonder. I even have several 3d models of it, if I can figure out how to add them.
 
Thanks to everyone who gave advice to me with the problem of nonsensical tech tree lines. In this case I think it was simply a matter of not enough room for the lines it needed to add and this somehow messed up the spacing. Of course it could have been something else but as soon as I spaced out the first few rows of techs at the start of the ancient era the same code worked just fine with the appropriate grid # adjustments.
I'd also like to say that I especially appreciate the time people took to write/copy/paste the code examples here. Im very happy to know that if I have more questions theres people out there willing to answer them.
 
BLueGreen said:
27.> It is important to realise that the technology you create will now appear in the main game in the technology panel (F4). The <iGridX>1</iGridX> and <iGridY>11</iGridY> entries refer to the co-ordinates which your technology will be placed on that research map in game. If you simply leave these numbers as they are it wont affect your game at all. But it will mean your technologies will overlap technologies with the same iGridX and iGrixY co-ordinates. You should therefore go in the game and look for an appropriate place to place your technology.
If a technology is listed as say 4 grid places right and 8 grid places down on the technology map in the actual game it will be listed as: <iGridX>4</iGridX>, <iGridY>8</iGridY> in the 'Civ4TechInfos.xml' file under that technology. So find an empty place preferably to the right of a perquisite technology and write down the grid spot. Then you can go back in to your 'Civ4TechInfos.xml' file and record the new co-ordinates. This will ensure you&#8217;re in game technology tree still looks presentable and not a jumbled mess.

I've made a simple diagram for reference when adding iGridX and iGridY coordinates to your custom made tech. It contains all tech coordinates between Y1 - Y14 and X1 - X19.. Alot of empty spaces to fill with your own custom made tech.

I don't know if this will help any one but I'll attatch it anyway..
 

Attachments

  • Tech x y grid.doc
    78.5 KB · Views: 224
Eugenius said:
The Questions:Where do I put the techs if there is 2 that lead to one tech? Does the position of the new tech have to be the same in all of the xml files I added Lore into? The way it draws the lines, some of them actually begin BEFORE the first techs and pass behind them where you can see them because the tech boxes are slightly transparent. Is this just a syntax error? It would seem that some people have run into this problem while others were able to add techs without any difficulty. However, I dont see any mods with new techs only the same techs with altered effects.
If anyone has the same or a similar problem please, post here with your questions and perhaps we can find a solution together. If anyone has any suggestions or answers or can post a mod with a new tech added that people with this problem can have a look at it would be very much appreciated that you add to the discussion. If anyone looks at some of my ideas and likes them, please by alll means use them but I would ask that you notify me with a link here so i can check out your work.
Thank you in advance.

I'm not an expert so don't be to angry if i'm wrong.
eg.
Meditation (X2/Y10) and Polythism (X2/X12) Leads to Priesthood(X3/Y9)
So far so good.
You have a tech that you would like to come after Meditation and polythism but don't want to replace priesthood? Am i correct?
Simple. Just put <iGridX>3</iGridX> <iGridY>10<iGridY> (the numbers 1,2,3,4,5,7,8,10,12 and 13 are free to use In the X3 row(No one will ever understand what I meen cause I'm kind of lost my self) where they should be and then the put
<OrPreReqs>
<PrereqTech>TECH_MEDITATION</PrereqTech>
<PrereqTech>TECH_POLYTHEISM</PrereqTech>
</OrPreReqs>
where it should be...

If it helped in someway Im happy.. If it somehow screwed up your game I'm sorry in advance.
 
Ancaria said:
I'm not an expert so don't be to angry if i'm wrong.
eg.
Meditation (X2/Y10) and Polythism (X2/X12) Leads to Priesthood(X3/Y9)
So far so good.
You have a tech that you would like to come after Meditation and polythism but don't want to replace priesthood? Am i correct?
Simple. Just put <iGridX>3</iGridX> <iGridY>10<iGridY> (the numbers 1,2,3,4,5,7,8,10,12 and 13 are free to use In the X3 row(No one will ever understand what I meen cause I'm kind of lost my self) where they should be and then the put
<OrPreReqs>
<PrereqTech>TECH_MEDITATION</PrereqTech>
<PrereqTech>TECH_POLYTHEISM</PrereqTech>
</OrPreReqs>
where it should be...

If it helped in someway Im happy.. If it somehow screwed up your game I'm sorry in advance.

actually that would screw it up :p

The techs take up 2 rows to display... so having a tech at (X3/Y9) and (X3/Y10) would cause the tech to display overlapping eachother in a tech tree...

I just rewrote every tech after steam power for the next update in my mod and it was rather horendus trying to get them to look right. The easiest way i found is use Excel. It makes it easy to tell whats overlapping (as long as you plan for the tech to take 2 rows).
 
Eugenius said:
...im getting lines all over the place on my tech tree and the game crashes when I click any tech aside from Lore. I read a few posts later about adding in the techs in the order they come in and about branches, which made sense since XML appears to me to be a linear language. ...

On a long shot, try changing the button back to a vanilla one:
Code:
<Button>,Art/Interface/Buttons/TechTree/Meditation.dds,Art/Interface/Buttons/TechTree_Atlas.dds,5,5</Button>
I'm assuming you edited meditation to:
Code:
<OrPreReqs>
  <PrereqTech>TECH_LORE</PrereqTech>
</OrPreReqs>
and that all of your tags are closed properly, also might open it in notepad or wordpad(if your using an editor) and make sure there are no non-standard characters. it should look comething simular to
Spoiler :

Code:
        <TechInfo>
            <Type>TECH_LORE</Type>
            <Description>TXT_KEY_TECH_LORE</Description>
            <Civilopedia>TXT_KEY_TECH_LORE_PEDIA</Civilopedia>
            <Help/>
            <Strategy>TXT_KEY_TECH_LORE_STRATEGY</Strategy>
            <Advisor>ADVISOR_RELIGION</Advisor>
            <iAIWeight>0</iAIWeight>
            <iAITradeModifier>0</iAITradeModifier>
            <iCost>80</iCost>
            <Era>ERA_ANCIENT</Era>
            <FirstFreeUnitClass>NONE</FirstFreeUnitClass>
            <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>1</bTrade>
            <bDisable>0</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>
            <bBridgeBuilding>0</bBridgeBuilding>
            <bIrrigation>0</bIrrigation>
            <bIgnoreIrrigation>0</bIgnoreIrrigation>
            <bWaterWork>0</bWaterWork>
            <iGridX>1</iGridX>
            <iGridY>9</iGridY>
            <DomainExtraMoves/>
            <CommerceFlexible/>
            <TerrainTrades/>
            <Flavors>
                <Flavor>
                    <FlavorType>FLAVOR_RELIGION</FlavorType>
                    <iFlavor>10</iFlavor>
                </Flavor>
                <Flavor>
                    <FlavorType>FLAVOR_SCIENCE</FlavorType>
                    <iFlavor>2</iFlavor>
                </Flavor>
                <Flavor>
                    <FlavorType>FLAVOR_CULTURE</FlavorType>
                    <iFlavor>7</iFlavor>
                </Flavor>
            </Flavors>
            <OrPreReqs/>
            <AndPreReqs/>
            <Quote>TXT_KEY_TECH_LORE_QUOTE</Quote>
            <Sound>AS2D_TECH_LORE</Sound>
            <SoundMP>AS2D_TECH_MP_LORE</SoundMP>
            <Button>,Art/Interface/Buttons/TechTree/Lore.dds</Button>
        </TechInfo>


as to the lines all over the place, if everything here is right you may have to bump the other techs around the grid to make room for yours(I typically just create empty columns for new techs, bumping everything up a few).

I've haven't had a problem yet with where I place the new tech in the xml however, ymmv
 
I've added a new Tech and got everything working but one. I like to play long games and have a problem with starvation after the cities get above level 26-30. Iwanted to add a Tech that would allow for some extra food production. So far alls I've been able to change is "spead irrigation" or "build farm without irrigation". I've looked at all that I know of about the "Biology Tech and it doesn't show anything that would help. I've also added my new tech under biology as a preregtech under bonus farms in CIV4ImprovementInfos XML. Somebody please help.
 
I'll post this here in hopes that someone else has experienced the same problem and knows how to fix it.

I've created a new tech called TECH_NOTRESEARCHABLE for my mod. I'm using it for a UNIT_NOTRESEARCHABLE in order to allow the player to build old units once new ones are available instead of having those old units obsoleted and replaced. The XML seems to check out properly, up until I get into the game and take my first turn.

I can even look at my tech tree and see it there, sandwiched between Mysticism and Polytheism. I can even highlight it. Right now it's just a copy of Mysticism with the name changed. However, as soon as I close the tech tree, the game crash-closes (no error message).

I can also not look at the tech tree, but as soon as I END-TURN, the game also crashes.

This also happened when I had the tech disabled. The tech upgrade does have the intended effect, if only it didn't crash the game on the first turn...

Anyone else run into this problem?
 
Yes.

A few things to try:
1) Move the tech's position to outside the range of the normal techs - IIRC the Firaxis mods used the default tech-trees with some disabled... so it might work.

2) Edit CvTechChooser.py. Basically, you can make it so that it doesn't show disabled techs on the tech tree, no matter where they are. IMO it should be like this by default.
 
You wouldn't happen to have an already modified version of CvTechChooser.py, would you? I tried method #1 but that just introduced scrollbars into the techtree (and crashed anyway), and I have no idea where to start, Python-wise, with method #2.
 
Raize said:
You wouldn't happen to have an already modified version of CvTechChooser.py, would you? I tried method #1 but that just introduced scrollbars into the techtree (and crashed anyway), and I have no idea where to start, Python-wise, with method #2.
I'll see what I can bash together...

EDIT: Hmmm, very weird. It would seem that the code I'm using doesn't check to see if the techs are disabled or not as I thought it did. It also doesn't show disabled techs. I do have all my disabled techs at grid 0,0 - so that might be it.

EDIT2: Does the tech show if the Civ doesn't have it?
 
The tech did show, but I set the coordinates to 0,0 and it no longer appears. I still crash, though.

I'm perplexed. :confused:
 
Okay, I removed the tech entirely, but left the unit itself in with a different pre-requisite (existing) tech. The game still crashes. So I think it actually has nothing to do with the tech. Sorry.
 
Top Bottom