Default value for tech tree pre reqs?

rhettrongun

Prince
Joined
Mar 19, 2011
Messages
341
Location
TX
Is there a default input to replace a pre req technology that I'd like to remove altogether? I've tried using "" and NULL but those result in the tech tree breaking. For the moment I'm using agriculture and pottery, and that at least allows the tech tree to load up properly. The problem with that is that it's ugly to look at connection pipes going all the way across the tree.

ie. Tech A requires both techs B & C. I want to make it so tech A requires only B.

Seems so simple, but I can't seem to figure out what the default entry is and it's not listed at the top of the xml table.
 
No, there isn't a default, and if you try changing it to blank or null you'll break things.

But it's a secondary table and not built into the primary <Technologies> table, so all you have to do is delete the entry in question. Like so:
Code:
<GameData>
	<Technology_PrereqTechs>
		<Delete TechType="TECH_MATHEMATICS" PrereqTech="TECH_THE_WHEEL"/>
	</Technology_PrereqTechs>
</GameData>
That makes it so that Mathematics no longer depends on The Wheel. It won't change any of the other dependencies of a tech; the only thing to watch out for is that you shouldn't remove all of a tech's prerequisites at once, for obvious reasons.
 
Great, thanks for the help :D

I had deletions lead to crashes before, so I just quit using it. I guess that's only for primary items like you point out.
 
I guess that's only for primary items like you point out.

Correct. If a table has an ID field, then deletion can often cause crashes. In a few cases the devs have explicitly fixed this (you CAN delete a Unit, Building, or Technology safely now, as long as you also remember to delete any other table entries involving that unit, like its Flavors or FreePromotions), in others they still haven't (you still can't delete a Promotion without it crashing, unless you immediately fill the now-empty ID slot with a new promotion OR use a utility someone whipped up that renumbers all of the existing promotions to fill in any gaps). These "Primary" tables will also usually have a "Type" field. Not UnitType or BuildingType or whatever, but just a straight Type.

What I refer to as "Secondary" tables are those without ID entries. Secondary tables rarely have default values; the lack of an entry is already treated as a null, effectively, so there's little need for it. These tables will have their identifier entries (unit type, building type, etc.) explicitly link back to a Primary table. You see this in the XML declarations at the top of the file; it'll say that the UnitType field is a Reference pointing back to Units(Type). This is the easy way to distinguish the two types of tables.
The only defaults you'll see in secondaries will be for things like the Unit resource quantity requirement table, where it defaults to using 1 unit of the specified resource but you can change that to 2 or more if you want to (like with the GDR). There are a few other tables that have a few of these, but it's pretty rare.

So again, when you're talking about technologies, it's perfectly safe to delete an entry in the TechPrerequisites table, as long as you make sure you're not left with a tech that has no prerequisites. (If you DO make this mistake, you'll see the tech as researchable from the start.) Actually, that's not quite true; you CAN remove all of a tech's prerequisites and give it the <Disabled> status. It won't be researchable, and will appear on the tech tree in red. You can then use Lua to award that tech if you want, although this causes a bunch of problems with City-States or Barbarians. (Trust me, I've dealt with this more than enough.)
 
Back
Top Bottom