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

Unit With Two Prereq Techs?

Discussion in 'CivBE - General Modding Discussion' started by Bandobras Took, Aug 26, 2017.

  1. Bandobras Took

    Bandobras Took Chieftain

    Joined:
    Jun 27, 2007
    Messages:
    1,914
    Location:
    Orem, UT
    Is it possible to make a unit require two different techs to be researched before it can be built?
     
  2. Ryika

    Ryika Lazy Wannabe Artista

    Joined:
    Aug 30, 2013
    Messages:
    9,398
    No, not directly.

    Assuming you really want to do it for Beyond earth and have not just chosen the wrong forum, the most elegant workaround I can think of:

    - Give the unit a Unit_BuildingClassRequireds-Prereq.
    - Then you create a dummy building that has no Tech requirement and a cost of -1 (which means it can't be constructed and won't show up in the UI, other than the Civilopedia) as well as a ConquestProbability to 0.
    - Add a free PlayerPerk to the other Tech via Technology_FreePlayerPerks.
    - Make that PlayerPerk grant the free FreeBuilding. (Note that this requires the buildingCLASS, not a building type -> <FreeBuilding>BUILDINGCLASS_RELIC</FreeBuilding>)

    That way, you have the unit show up on one technology, and on the other Technology you can use the PlayerPerk to add a Note via the Help-Tag.

    If instead you meant to post in the Civ5 forums, the easiest way to do it would be via lua. Use City.CanTrain() and check for both technologies.
     
  3. Bandobras Took

    Bandobras Took Chieftain

    Joined:
    Jun 27, 2007
    Messages:
    1,914
    Location:
    Orem, UT
    Actually, just creating a building for a prereq might work just as well. Thanks.
     
  4. Ryika

    Ryika Lazy Wannabe Artista

    Joined:
    Aug 30, 2013
    Messages:
    9,398
    Haha... yeah, that's of course even easier if you're willing to alter the core concept. ^^
     
  5. Bandobras Took

    Bandobras Took Chieftain

    Joined:
    Jun 27, 2007
    Messages:
    1,914
    Location:
    Orem, UT
    It's not even that much of an alteration -- I'm learning how to change the tech web and I wanted people to have to research some spacey stuff to build satellites without putting all the satellites in that area. :)
     
    Last edited: Aug 28, 2017

Share This Page