Creating technology prerequisites

wilkotek

Chieftain
Joined
Jul 25, 2023
Messages
1
I'm doing my best to figre out Civ 6 Modding, and I'm attempting to make a custom technology. I tried looking at a mod which did this and figure it out from there, which sort of worked? I have the technology in game but I cannot make it link to another one in the tech tree. Can anyone help?

1690287651075.png

1690287662348.png

1690287690036.png
 
I haven't played around with techs much but looking at the base game files, this is how the tech prerequisites appear to be set.

XML:
<TechnologyPrereqs>
<Row Technology="TECH_IRRIGATION" PrereqTech="TECH_POTTERY"/>
</TechnologyPrereqs>

Your code has spaces which may not make any difference but deleting those can't hurt. That being said, you should probably remove the SQL insertion since you've duplicated that in the XML file. If you want to use SQL instead, it needs to be like this:

SQL:
INSERT INTO TechnologyPrereqs (Technology, PrereqTech) VALUES ('TECH_ASTROLOGY', 'TECH_TOTEMS');

This is literally doing the same thing you're doing in your XML file for the astrology tech anyway, so I'd simply remove that line from the SQL entirely. If you're not familiar with SQL, you can also delete techs via XML and do away with the SQL file entirely. Here's how the base game does that in the Australia Scenario:

XML:
<Types>
<Delete Type="TECH_IRRIGATION"/>
</Types>

This is derived from copying the 3 relevant lines from the file AustraliaScenario_RemoveData.xml but you can open the file and see it for yourself, if you like. I have the game installed in the default location via Steam so that folder is here on my system:

C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\DLC\AustraliaScenario\Data\

It may, of course, be elsewhere on yours if you don't use Windows, Steam, or the default location but that should give you some idea of where it ought to be. For the rest of this post, I'll omit the Steam specific portion of the path since it isn't really necessary once you know where the main game folder is on your own system.

I'm not 100% sure you need to do this in a separate file as they do but it certainly can't hurt to do so. You probably ought to look at adding a Boost for this, as well. Here is the boost for Irrigation from this base game file

Sid Meier's Civilization VI\Base\Assets\Gameplay\Data\Technologies.xml

XML:
<Boosts>
<Row TechnologyType="TECH_IRRIGATION" Boost="50" TriggerDescription="LOC_BOOST_TRIGGER_IRRIGATION" TriggerLongDescription="LOC_BOOST_TRIGGER_LONGDESC_IRRIGATION" BoostClass="BOOST_TRIGGER_HAVE_X_IMPROVEMENTS" ImprovementType="IMPROVEMENT_FARM" RequiresResource="true" NumItems="1"/>
</Boosts>

Assuming you want to use the same boost, you should be able to simply replace the technology with your own and add relevant descriptions as well then change those to whatever you wish. It is best practice to separate the localization text into different files but if this is just for your own uses, you may not need to.

Hope that helps some. As I said, I haven't played much with editing technologies myself but the base game files are fairly easy to look at. I find it easiest to search the entire game install path with Notepad++ using the Find in Files tab in the Find dialog. You can invoke that directly via the keyboard shortcut Ctrl+Shift+F. You'd then put the full install path of your game in the Directory field and to limit the search only to XML files, just put *.XML in the filters field. It takes a little bit to search the entire installation for specific things but searching for TECH_IRRIGATION using that is how I found the information I've put in the post.

Hope that helps.
 
Last edited:
Top Bottom