[TUTORIAL] Making a Technology Un-Researchable

Joe Danger

Chieftain
Joined
Oct 11, 2010
Messages
12
EDIT: Ok, so a much cleaner way to do this as Horem pointed out is to use <Disable>1<Disable>. So, go use that. For posterity though, my original post:

I found this out on accident. If you set a tech's prerequisite as itself, it will not be available to research, and the game won't crash or do anything angry.

Like so:

For existing techs:
Code:
<Technology_PrereqTechs>
   <Delete TechType="TECH_IRON_WORKING"/>
   <Update>
      <Where TechType="TECH_IRON_WORKING"/>
      <Set PrereqTech="TECH_IRON_WORKING"/>
   </Update>
</Technology_PrereqTechs>
This makes Iron working un-researchable. Keep in mind anything that requires Iron Working will also become un-researchable unless you add *before* the above code.
Code:
<Delete PrereqType="TECH_IRON_WORKING"/>

Or for a new tech (that you've already defined):
Code:
<Technology_PrereqTechs>
   <Row>
      <TechType>TECH_NEWTECH</TechType>
      <PrereqTech>TECH_NEWTECH</PrereqTech>
    </Row>
</Technology_PrereqTechs>

Why would you want to do this? I don't know, but the thing that comes easily to mind is giving the tech as a free tech to a civ, giving that civ a unique tech with unique whatevers in it. I'm sure there's plenty of other reasons people can think of.

Go play!:cool:
 
Hey, you never know. Some time, months, perhaps years down the line, someone may find a use for this block of code. ;)

On a slightly more serious (and less foreshadowy) note, do you wrap the whole first block in <update> tags? Because if you do, you're missing the opening tag in that first code block. If not, then you should probably axe the <update> tag since it might confuse people.

If I recall correctly, when I deleted every civ in the game, wrapping it in update tags just resulted in ineffective code and removing them got it working again. So, please clarify.
 
I've just tried this, and it had the unfortunate side-effect of causing the game to freeze when clicking on the the technology I'd set as its own prereq in the tech tree screen. I'm guessing Firaxis understandably didn't take this possibility into account when they made the algorithm that queues techs for you when you click on one that's not immediately researchable, so it got stuck in an infinite loop.

I don't know if it can be fixed without having access to the C++ code, but I'm leaning on the side of "no".
 
Well urm why not just use <Disable>1<Disable>? Works a treat for hiding Civ specific Techs, also allows you to gift them as free techs without any repocussions.
 
So, please clarify.

Fixed, as I should have used update tags and set-where tags in there. My bad.

Very useful indeed, so thanks.

Glad to hear it :)

I've just tried this, and it had the unfortunate side-effect of causing the game to freeze when clicking on the the technology
Well urm why not just use <Disable>1<Disable>?

Hmm, I suppose I never actually clicked the tech :blush: Point taken, and I've updated the post to show the cleaner and more sane way to do this ;)
 
Last I checked under techs the disable option was boolean (true/false).

Where are you inserting this anyway? <Disable>1</Disable>?

I want to disable all techs from gunpowder on, for all civs. Would this work?
 
Last I checked under techs the disable option was boolean (true/false).

Where are you inserting this anyway? <Disable>1</Disable>?

I want to disable all techs from gunpowder on, for all civs. Would this work?

Disabling is as easy as this.

<Technologies>
<Update>
<Where Type="TECH_PARTICLE_PHYSICS"/>
<Set Disable="true"/>
</Update>
<Technologies>

If you don't want the Tech to show up on the Tech Tree a safe and easy way to get rid of it is to simply move it out of view. Doing this avoids any problems that deleting a tech can cause whereby random files are still trying to reference that specific tech.

<Update>
<Set GridY="27" />
<Where Type="TECH_PARTICLE_PHYSICS" />
</Update>

Here I've just move Particle Physics out of site after disabling it, all through XML. Easy :)
 
Top Bottom