problem with CIV5Gamespeed

ImperatrMaximus

Chieftain
Joined
Oct 15, 2010
Messages
8
This is probably a stupid question but the answer keeps eluding. I'm trying to do a straightforward change to the CIV5Gamespeed file. That is, I change the original:

<Row>
<GameSpeedType>GAMESPEED_MARATHON</GameSpeedType>
<MonthIncrement>180</MonthIncrement>
<TurnsPerIncrement>100</TurnsPerIncrement>
</Row>

into this:

<Row>
<GameSpeedType>GAMESPEED_MARATHON</GameSpeedType>
<MonthIncrement>360</MonthIncrement>
<TurnsPerIncrement>50</TurnsPerIncrement>
</Row>

Basically I double the pace of the first section while also cutting the time in half. Problem is that it doesn't show up when I start a game! I've managed to successfully add mods to the game using Mod Buddy before but this one seems different. So what am I missing?
 
We'd need to see your XML Update syntax. For instance, you can't just use a
<Where GameSpeed="GAMESPEED_MARATHON"/>, since there'll be eight of those.

Also, to be clear: making this change has many other side-effects. For instance, the Standard game is designed around a total of 500 turns, with the other speeds going 350, 750, and 1500. If you change one of the gamespeed brackets without changing the others, and you don't ALSO edit all of the <StartPercent> values in the Era table, then it'll do screwy things like changing the year when you start a game in a later era than Ancient.

In my own mod, for instance, the addition of future-era content required me to double the total numbers of turns (700, 1000, 1500, 3000). The Marathon change was like so:
Spoiler :
Code:
		<Update>
			<Set MonthIncrement="200" TurnsPerIncrement="180"/>
			<Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="180" TurnsPerIncrement="100"/>
		</Update>
		<Update>
			<Set MonthIncrement="160" TurnsPerIncrement="90"/>
			<Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="120" TurnsPerIncrement="300"/>
		</Update>
		<Update>
			<Set MonthIncrement="80" TurnsPerIncrement="90"/>
			<Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="60" TurnsPerIncrement="170"/>
		</Update>
		<Update>
			<Set MonthIncrement="40" TurnsPerIncrement="90"/>
			<Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="24" TurnsPerIncrement="201"/>
		</Update>
		<Update>
			<Set MonthIncrement="20" TurnsPerIncrement="270"/>
			<Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="12" TurnsPerIncrement="129"/>
		</Update>
		<Update>
			<Set MonthIncrement="16" TurnsPerIncrement="180"/>
			<Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="6" TurnsPerIncrement="180"/>
		</Update>
		<Update>
			<Set MonthIncrement="8" TurnsPerIncrement="270"/>
			<Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="3" TurnsPerIncrement="264"/>
		</Update>
		<Update>
			<Set MonthIncrement="4" TurnsPerIncrement="720"/>
			<Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="1" TurnsPerIncrement="156"/>
		</Update>
		<Row>
			<GameSpeedType>GAMESPEED_MARATHON</GameSpeedType>
			<MonthIncrement>2</MonthIncrement>
			<TurnsPerIncrement>1110</TurnsPerIncrement>
		</Row>


In the above, I modified all of the existing entries (like you're trying to do), and then added an additional block at the end to extend into future years. I then had a similar set of Updates and Rows for the other three game speeds.

So post your XML, and we can tell you what went wrong.
 
Here is the original modded file (the "_a" is just to distinguish it from the other one i'm posting). I also tried using the update lines that you brought up and I still don't see a change. (that's the "_b" if you want to look at it too)

I also just want to add that I appreciate you bringing up the side effects of doing this sort of thing. This will definitely be something to keep in my mind if (and when) I start up my larger mod idea.

One more thing, sorry if my using a rar file is annoying. For some reason I got an error when I tried to upload the xml files.
 

Attachments

One more thing, sorry if my using a rar file is annoying. For some reason I got an error when I tried to upload the xml files.

You're only allowed to upload specific types of files (it gives the list in the attachments popup). You're generally SUPPOSED to put things in .rar or .zip files, so there's no need to apologize. Pure-text files like .modinfo files, or jpegs and such, those can be attached directly, but anything capable of executing commands (like XML or HTML) has to be zipped up.

As for your files, the problem is that you're doing it completely wrong. When modding a gamedata XML file, you do NOT replace the entire original file with your changed version. The game loads the original, and THEN modifies it based on what you said in your file.
The code in my above post is the entire mod (at least as it relates to the marathon game speed), I wasn't quoting a small piece of the file. Well, okay, I left out the <GameData> and <GameSpeed_Turns> brackets, you still need those for it to work, but other than that all you need is the OnModActivated/UpdateDatabase.

Also, you don't need to name your file the same as the name of the original. Again, it's not replacing the old file with your new one; you could name it Bob.xml and it'd still work as long as the schemas match inside the file.

That means:
> No Table declarations, because the original file already has that.
> No Row declarations for game speeds that already exist. You use Updates when modifying ones that already exist, and only use a Row entry when adding a NEW speed.
> Same for the GameSpeed_Turns modifications: you use Updates to change any existing entries, and only use a Row if you're adding a new entry to the end of the list.

So your entire mod would look like this:
Code:
<GameData>
  <GameSpeed_Turns>
    <Update>
      <Set MonthIncrement="360" TurnsPerIncrement="50"/>
      <Where GameSpeedType="GAMESPEED_MARATHON" MonthIncrement="180" TurnsPerIncrement="100"/>
    </Update>
  </GameSpeed_Turns>
</GameData>
barring the eras change I mentioned previously. That's the entire file.

Go over to the Tutorials forum and read Kael's beginner modders' guide, it's stickied at the top. It'll explain how this whole thing works.
 
Back
Top Bottom