OR Techs Allowed - Visible OR Tech Links in Tech Tree and Civilopedia

Cecil Lizard

Chieftain
Joined
Oct 29, 2010
Messages
61
Location
Norwich, Norfolk, UK
Link to Download: http://forums.civfanatics.com/downloads.php?do=file&id=23673

Link to Steam Download: http://steamcommunity.com/sharedfiles/filedetails/?id=391459314

This mod changes the lua and xml files for both the Tech Tree and Civilopedia.

The base game actually includes the code for techs having OR prerequired techs that is techs that can be researched after only one tech from a list of techs has been acquired. However the links would not turn up on the Tech Tree, nor would such connections be visible in the Civilopedia. This mod makes it that the game will show such links and info should another mod add OR prerequirements.

An example I have is with another little mod, which just adds a tech called "Test", which definitely requires Animal Husbandry and also either Pottery or Archery. Without this mod, as you can see in the first 2 attachments to this post, the "AND" information is shown in the Tech Tree and Civilopedia, but not the "OR" information. If someone was to do a (proper) mod with "OR" prerequirements for some techs, anyone playing it would have a difficult time finding out where those "OR" prerequirements were.

So this mod does two things:

1- Adds any lines in the Tech Tree for "OR" links. In order so that people can tell them apart from the normal "AND" links, I have coloured them red.

It does not look very elegant I will admit, but it shows all the information the player needs. For instance, the 3rd attachment to this post shows the Tech Tree with that little mod activated with this mod now also activated. The player can see the information, that is-

Animal Husbandry is required for Test, Trapping and The Wheel
Pottery is required for Sailing, Calendar, and Writing
Archery is required for The Wheel
And either Pottery or Archery is required for Test.

2 - Adds, should a tech have "OR" prerequirements, a little box below their "AND" prerequirements box (the normal one) on their Civilopedia page with the appropriate techs showing there (see the 4th attachment). It also adds techs that techs lead to through an "OR" link to that prerequired tech's "leads to" box on their page (see the 5th attachment).

With these changes should anyone do any mods which add "OR" tech links, the changes will be visible.

Extra - Adding "OR" links

Normal "AND" links are coded thus:

<Technology_PrereqTechs>
<Row>
<TechType>TECH_TEST</TechType>
<PrereqTech>TECH_ANIMAL_HUSBANDRY</PrereqTech>
</Row>
</Technology_PrereqTechs>

"OR" ones are simply like this:

<Technology_ORPrereqTechs>
<Row>
<TechType>TECH_TEST</TechType>
<PrereqTech>TECH_POTTERY</PrereqTech>
</Row>
<Row>
<TechType>TECH_TEST</TechType>
<PrereqTech>TECH_ARCHERY</PrereqTech>
</Row>
</Technology_ORPrereqTechs>

Pretty much the same.
 

Attachments

  • 2015-02-12_00007.jpg
    2015-02-12_00007.jpg
    219.7 KB · Views: 426
  • 2015-02-12_00008.jpg
    2015-02-12_00008.jpg
    170.7 KB · Views: 338
  • 2015-02-12_00002.jpg
    2015-02-12_00002.jpg
    228.5 KB · Views: 396
  • 2015-02-12_00005.jpg
    2015-02-12_00005.jpg
    181.6 KB · Views: 307
  • 2015-02-12_00006.jpg
    2015-02-12_00006.jpg
    251.8 KB · Views: 279
  • 2015-02-12_00003.jpg
    2015-02-12_00003.jpg
    223.8 KB · Views: 316
  • 2015-02-12_00004.jpg
    2015-02-12_00004.jpg
    227.8 KB · Views: 294
I think it might be the lower ID, it always chooses Pottery in my test case, unless I use shift to choose Archery first. Though I don't know if that would still be the case where the different routes had different tech costs.
 
Top Bottom