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

Locking Specific Techs, by Civilization

Discussion in 'Civ5 - Modding Tutorials & Reference' started by Scocou, Dec 27, 2010.

  1. Scocou

    Scocou Chieftain

    Joined:
    Dec 17, 2010
    Messages:
    18
    Location:
    On an island, in the Pacific
    This post won't be of interest to veteran mod'ers/programmers/scripters.

    For you ol' timey, non-XML types like me (who hasn't programmed since Turbo Pascal in '92); I found the existing tutorial to fall somewhat short (no offense intended, it was my deficiency) of helping me accomplish my goal - to disable research of specific techs, by civilization (not globally). After some research and experimentation I managed to figure it out, perhaps some other new mod'er may find the following info useful...

    For my example, we will disable America's ability to research both Pottery and Mining (nerf!!). Additionally, we will prevent France from researching Sailing (take that, Napoleon!).

    1. Create a file in your mod's XML directory, naming it something like: XML/Civilizations/CivilizationOverride.xml
    2. Open the file with your favorite text editor (or ModBuddy, if you prefer) and paste-in this snippet;
      Code:
      [FONT="Arial"]<?xml version="1.0" encoding="utf-8"?>
      <!-- Created by whoever on 12/26/2010 8:57:20 PM -->
      <GameData>
      	<Civilization_DisableTechs>
      		<Row>
      			<CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
      			<TechType>TECH_POTTERY</TechType>
      		</Row>
      		<Row>
      			<CivilizationType>CIVILIZATION_AMERICA</CivilizationType>
      			<TechType>TECH_MINING</TechType>
      		</Row>
      		<Row>
      			<CivilizationType>CIVILIZATION_FRANCE</CivilizationType>
      			<TechType>TECH_SAILING</TechType>
      		</Row>
      	</Civilization_DisableTechs>
      </GameData>[/FONT]
    3. Save and close the file.
    4. Add a typical new OnModActivated/UpdateDatabase entry for your CivilizationOverride.xml file and rebuild your mod (or manually edit your .modinfo/md5, if you don't use ModBuddy).
    5. Fire-up Civ5 and enable your mod in the usual manner.
    After starting your new game hit <F6>, the disabled tech's icon/button will be red and have a lock icon adjacent to it. All techs down-tree (those that have the disabled tech as a prerequisite) will also be rendered not researchable.

    As you can see in the attached screen-shots below, the restricted down-tree techs' icons/buttons will remain unchanged, only the specifically disabled techs will display a lock and be red. You can click on any of them with no effect aside from the standard sound (no lockup/freezing, as indicated in an alternate method).
    Spoiler :

    Spoiler :

    As a minor note, there is no entry in the tech-tree legend (see abv. pic) explaining the red icon/button. Perhaps some artistic individual will modify the art files to correct this omission...

    Enjoy... and cheers!:salute:
     
  2. Garett20

    Garett20 Prince

    Joined:
    Aug 10, 2010
    Messages:
    429
    Location:
    Toronto,Canada
    but how do I make a certain condition that has to be met before a tech unlocks?
     
  3. xxhe

    xxhe Prince

    Joined:
    Mar 10, 2008
    Messages:
    359
    Location:
    IN.
    I believe that needs some work in .lua:crazyeye:
     
  4. Renee

    Renee Chieftain

    Joined:
    Feb 12, 2011
    Messages:
    14
    Location:
    Toronto
    Is there an easy way to make all techs after a certain point (say just before Gunpowder) unresearchable for all civs WITHOUT having to put a line in for each tech under each civ?

    I've tried the following things already and none have worked (for each tech of course):

    <Technologies>

    <Delete type="TECH_AGRICULTURE"/>
    </Technologies>

    <Technologies>

    <Row>

    <Type>TECH_AGRICULTURE</Type>

    <Disable>True</Disable>

    </Row>
    </Technologies>

    <Technologies>

    <Row>

    <Type>TECH_AGRICULTURE</Type>

    <Disable>1</Disable>

    </Row>
    </Technologies>

    I have not tried making the techs pre-reqs for themselves yet, that seemed like a lot of work too.

    *Edit* the indents didn't work but I assure you that my syntax in mod buddy was correct :p
     
  5. markusbeutel

    markusbeutel NiGHTS

    Joined:
    Sep 26, 2010
    Messages:
    1,976
    Location:
    Vancouver BC Canada

    Disabling is as easy as this.

    <Technologies>
    <Update>
    <Where Type="TECH_PARTICLE_PHYSICS"/>
    <Set Disable="true"/>
    </Update>
    <Technologies>

    If you don't want the Tech to show up on the Tech Tree a safe and easy way to get rid of it is to simply move it out of view. Doing this avoids any problems that deleting a tech can cause whereby random files are still trying to reference that specific tech.

    <Update>
    <Set GridY="27" />
    <Where Type="TECH_PARTICLE_PHYSICS" />
    </Update>

    Here I've just move Particle Physics high out of site after disabling it, all through XML and easily reversible.
     
  6. RenaissanceFan

    RenaissanceFan Warlord

    Joined:
    Mar 15, 2011
    Messages:
    125
    You can also disable by era:

    <Technologies>
    <Update>
    <Where Era="ERA_(era to disable)"/>
    <Set Disable="true"/>
    </Update>
    <Technologies>

    Remember, however, that writing it this way will disable ALL of a era's techs, so be careful. If you don't replace the repeating tech (Future Tech by standard), once you research the last available tech, the game will not progress!
     
  7. jimmymc05

    jimmymc05 Chieftain

    Joined:
    Jul 29, 2011
    Messages:
    1
    Location:
    Chicago, IL
    I've been doing some research for creating a mod where technology sort of stops. Is that possible? Using the world builder is there some way to just disable techs so that no further research is possible or maybe it just goes into future tech or something? I was thinking of disabling Rifling, Steam Power, Navigation, Military Science, and Dynamite. This would give me a sort of late middle ages/early Renaissance thing I was going for. Would this work or would the game just crash. I'd appreciate any help.
     
  8. Colonel_Dile

    Colonel_Dile Chieftain

    Joined:
    Jan 5, 2012
    Messages:
    4
    But where do I put this text? What kind of file to I write it in? I'm utterly new to Civ modding/fiddling, so can anyone provide a little bit of info on where to do this?
     
  9. human machine

    human machine Chieftain

    Joined:
    Jan 25, 2009
    Messages:
    32
    Welcome to Civ 5 Modding! The ways of modding in Civ5 are a bit different than Civ 4.
    The best way to get started would be to read Kael's Guide found here: http://forums.civfanatics.com/showthread.php?t=385009

    that should get you going, and if you have any more questions feel free to start a thread in the main Civ 5 Creation & Customization forum.

    Good Luck!
     
  10. Andrew Harlane

    Andrew Harlane Chieftain

    Joined:
    Nov 30, 2016
    Messages:
    6
    Gender:
    Male
    Please, could you explain the meaning of "Add a typical new OnModActivated/UpdateDatabase entry for your CivilizationOverride.xml file" and how to do it?
    Thank you so much.
     
  11. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,449
    Location:
    Illinois, USA
    See http://steamcommunity.com/sharedfiles/filedetails/?id=120875856

    About 2/3 of the way down the tutorial. You can ignore the parts about art creation as they are not relevant to your question.

    And also this is a really really really old thread. I don't think any of the previous commenters are even active members anymore, at least so far as modding goes.
     

Share This Page