Changing the era of a tech

Craig_Sutter

Deity
Joined
Aug 13, 2002
Messages
2,753
Location
Calgary, Canada
I'm reposting this from a thread in the modders guide:

Continued from: http://forums.civfanatics.com/showthread.php?t=385009&page=24

As a first step in the mod I am working on, I wish to move astronomy to the Medieval Era from Renaissance.

It is not working... I've gotten XML files from other mods to when copied to my mod, so I know how to do that... I checked true for Importing to VFS and all the file properties show up as they should. The logs are normal with no errors that are not inherent in the game.

Have I done the coding wrong? If someone could take a quick look.

Oh, and I tested this by giving one of my on map civs all the medieval tech... astronomy does not show up as researched.



Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/3/2012 5:53:49 PM -->
<GameData>
	<Technologies>
		<Update>
			<Set Era="ERA_MEDIEVAL"/>
			<Where Type="TECH_ASTRONOMY"/>
		</Update>
	</Technologies>
</GameData>

Thank-You
 
As we said in the previous discussion:

> You don't use VFS for gamedata XML
> You DO use OnModActivated/UpdateDatabase
> You need to adjust the GridX value of the tech to put it in the right place on the tree. This would probably require moving a lot of other techs around as well, to make them all fit into the right eras.
 
You are going to have problems moving Astronomy into the Medieval era as there is no where to put it in Medieval-Column-2 (M2) as it depends on Education which is already in M2.

To keep the dependancy you'll need to create M3 which can only be done by shifting EVERY Renaisance/Industrial/Modern/Future techs right one place.
(Edit: Which before someone else posts it, is a piece of .... with SQL)

The alternative would be to remove the dependancy on Education, and replace it with one on Theology, which means you can then then pull Compass back into M1 and use the resulting blank space at the top of M2 for it.

The code is probably right, but it's incomplete, so the question is moot.
 


Code:
<GameData>
  <Technologies>
    <Update>
      <Where Type="TECH_COMPASS"/>
      <Set GridX="4"/>
    </Update>

    <Update>
      <Where Type="TECH_ASTRONOMY"/>
      <Set Era="ERA_MEDIEVAL" GridX="5"/>
    </Update>
  </Technologies>

  <Technology_PrereqTechs>
    <Delete TechType="TECH_ASTRONOMY" PrereqTech="TECH_EDUCATION"/>
    <Row>
      <TechType>TECH_ASTRONOMY</TechType>
      <PrereqTech>TECH_THEOLOGY</PrereqTech>
    </Row>
  </Technology_PrereqTechs>
</GameData>

Key parts from the .modinfo file

Code:
<Mod id="cd57be7f-30a2-4103-8e4a-9be13e06156b" version="1">
  <Properties>
    <Name>Test - Move Astronomy</Name>
    <AffectsSavedGames>1</AffectsSavedGames>
  </Properties>
  <Files>
    <File md5="30B48D405C23504628C54EE5A1ADC86F" [COLOR="red"]import="0"[/COLOR]>Game Rules1.xml</File>
  </Files>
  <Actions>
    [COLOR="Red"]<OnModActivated>
      <UpdateDatabase>Game Rules1.xml</UpdateDatabase>
    </OnModActivated>[/COLOR]
  </Actions>
</Mod>
 
Top Bottom