1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

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

Discussion in 'Civ5 - Mod Components' started by Cecil Lizard, Feb 12, 2015.

  1. Cecil Lizard

    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.
     

    Attached Files:

  2. bane_

    bane_ Howardianism High-Priest

    Joined:
    Nov 27, 2013
    Messages:
    1,559
    Awesome. Will be very useful for me. :)
    What happens if you click on the 'Test' tech? Will it choose randomly between the two prereqs, the one with the lower ID or some other choice?
     
  3. Cecil Lizard

    Cecil Lizard Chieftain

    Joined:
    Oct 29, 2010
    Messages:
    61
    Location:
    Norwich, Norfolk, UK
    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.
     

Share This Page