Modding Movement Questions

jaldaen

Prince
Joined
Feb 19, 2006
Messages
467
Hello All,

I'm just messing around with making a mod and was wondering if there was an easy way to add +1 movement to all units. What about adding +1 to bipeds, +2 to Quads, +3 to wheeled/boat, +4 air? I know each unit has its moves defined in the Civ5Units.xml, but I was wondering if there was an easy way to modify the movement of everything (or by unit type). What about adding movement points when new techs are achieved? How would I change the movement costs of certain terrains?

Thanks,
Joseph

PS: I know I could do something like:

<Update>
<Set Moves="9"/>
<Where Moves="8"/>
</Update>

Etc., but I was wondering if there was a nice wildcard character I could use to make the +1 movement to all units...
 
I don't think there's an easy way to do anything with Civ V modding, honestly.

Terrain movement cost is defined in one of the terrain XMLs, can't remember which one.

For mass movements changing, I don't really see a way you could do it, unless you were able to do a set/where in a case where you have the set and where looking at the same variable, for example:

Code:
<Units>
<Update>
<Where Moves="2"/>
<Set Moves="3"/>
</Update>
</Units>

Should theoretically change every unit who has 2 moves to now have 3 moves. If my understanding of how loading a mods works, you could change units who currently have three moves to having four moves if you have that update in line before the other change.
 
Aaroc,

Thanks for your comments... that's what I thought, but I was hoping for an easier mod. And I'll definitely set it up so the mod converts the higher values first so that the units don't all move at 9+ a turn ;)

Best Wishes,
Joseph
 
Should be very easy to do with SQL. I think there are some tutorials floating around.

You could also just add a new promotion that increases movement to one, and use XML to add the promotion to all units, but then it will show up on the UI in game.
 
Okay... I wrote this:

nm... I found out that you have to do each change as a seperate update... although the mod still isn't working.

And enabled the mod (and made sure the OnModActivated was included), but it's not working (warriors and settlers still have 2 movement points)... so I'm doing something wrong. I'll have to come back to it later after lunch. If anyone spots something wrong in the code, then let me know. Is it the inclusion of the move rates? I was trying to give biped/quads +1 move, while giving the later units +2, but perhaps those additions are confusing the issue.

Thanks,
Joseph
 
Well I tried the following code and it also didn't work:

nm... I found out that you have to do each change as a seperate update... although the mod still isn't working.

So I'm wondering what I'm missing... it's probably something simple, but I can't figure it out. Btw... is it OnModActivated or OnModInitialized? I've seen both ways mentioned, but right now I'm using OnModActivated.

Thanks,
Joseph
 
Still working on this... so I decided to just try this code:

<GameData>
<Units>
<Update>
<Set Moves="3"/>
<Where Moves="2"/>
</Update>
</Units>
</GameData>

Unfortunately, it is also not working... (I also tried putting the Where statement first, but it didn't work either). Any ideas about where I'm going wrong?

Thanks,
Joseph
 
Another day... and another failed attempt... at least now I know that each change needs it's own update, however, the following code isn't working:

Spoiler :
<GameData>
<Units>​
<Update>​
<Where Moves="8"/>​
<Set Moves="10"/>​
</Update>​
<Update>​
<Where Moves="7"/>​
<Set Moves="9"/>​
</Update>​
<Update>​
<Where Moves="6">​
<Set Moves="8"/>​
</Update>​
<Update>​
<Where Moves="5">​
<Set Moves="6"/>​
</Update>​
<Update>​
<Where Moves="4"/>​
<Set Moves="5"/>​
</Update>​
<Update>​
<Where Moves="3"/>​
<Set Moves="4"/>​
</Update>​
<Update>​
<Where Moves="2"/>​
<Set Moves="3"/>​
</Update>​
</Units>​
</GameData>


Any ideas where I'm going wrong?

Thanks,
Joseph
 
Finally! I got the updates to work, but the odd thing is that I had to use the following code, which isn't what I'm seeing in other people's codes (most people have one main field [like units] with lots of updates within it, but I had to do lots of individual fields and updates):

Spoiler :
<GameData>
<Units>
<Update>
<Where Moves="8"/>
<Set Moves="10"/>
</Update>
</Units>
<Units>
<Update>
<Where Moves="7"/>
<Set Moves="9"/>
</Update>
</Units>
<Units>
<Update>
<Where Moves="6"/>
<Set Moves="8"/>
</Update>
</Units>
<Units>
<Update>
<Where Moves="5"/>
<Set Moves="6"/>
</Update>
</Units>
<Units>
<Update>
<Where Moves="4"/>
<Set Moves="5"/>
</Update>
</Units>
<Units>
<Update>
<Where Moves="3"/>
<Set Moves="4"/>
</Update>
</Units>
<Units>
<Update>
<Where Moves="2"/>
<Set Moves="3"/>
</Update>
</Units>
</GameData>


But it works and so I'm not going to complain. Maybe it's a specific problem with how unit movement is working. Anyways, I'm just glad that I finally figured out how to mod the movements.

Best Wishes,
Joseph
 
I'm just messing around with making a mod and was wondering if there was an easy way to add +1 movement to all units.

It's not very elegant, but there IS an easy way to do this.

Create a new promotion, called "Jaldaen's Movement Bonus". Have it add +1 movement. Set it to "Cannot be purchased". Have the Palace give it to every unit type (see the Himeji Castle promotion if you need to see how this can be done) with no tech prerequisite.

There. Now everything moves 1 more, forever. By tying it to the palace you ensure that it can't be stacked from multiple sources and will always be there from turn 1.

(I did something similar in my mod: I wanted every unit to have a +10% bonus when fighting within my own territory, to discourage massive invasions. So my Palace now gives a free promotion with this effect.)
 
Top Bottom