[Question] River Movement

Ambreville

Deity
Joined
Sep 28, 2006
Messages
2,255
Location
Windy City USA
More newb modder questions. How can I modify an existing unit so it can move faster along rivers? Can this be done through XML?

The idea is to have scouts, explorers, and some Native American warriors move more quickly along rivers, suggesting they have canoes. Better yet, if it were possible to move faster while following the river flow (two spaces upstream, three spaces downstream). Hmmm....
 
The DomainExtraMove in the tech file alters the move rate of various unit classes on certain terrain; an example is that refrigeration increases sea movement by one. (Don't ask me why; I can't see how refrigerators would do this :).) The problem I see is that rivers are not terrain per se, but terrain features. I'm not sure if this can be done exclusively in XML--you might have to set up some kind of python check to examine the terrain for a river.

I have another question along these same lines (directed at more experienced modders): how can I prohibit the crossing of rivers altogether? I want in a Roman scenario I am working on for the barbarians not to be able to cross a river (the Rhine) until late in the game.
 
The DomainExtraMove in the tech file alters the move rate of various unit classes on certain terrain; an example is that refrigeration increases sea movement by one. (Don't ask me why; I can't see how refrigerators would do this :).) The problem I see is that rivers are not terrain per se, but terrain features. I'm not sure if this can be done exclusively in XML--you might have to set up some kind of python check to examine the terrain for a river.

I ran into that. I could not find rivers listed in the features (along with forests and such). That's probably because they are "between" spaces. Darn.

I have another question along these same lines (directed at more experienced modders): how can I prohibit the crossing of rivers altogether? I want in a Roman scenario I am working on for the barbarians not to be able to cross a river (the Rhine) until late in the game.

Actually, this would be very useful in a WW2 or modern setting. This adds the complexity of how to make it possible to cross only where bridges exist. I doubt there would be a way to "blow up" bridges unfortunately!
 
an example is that refrigeration increases sea movement by one. (Don't ask me why; I can't see how refrigerators would do this .)

Easy: ships with refrigerators can store fresh food for a longer time and so have a greater movement range. They don't need any longer to stop at small islands hunting goats and harvesting bananas... :)
 
I think this might be very easy to do with python.
First check the unit, if it's the correct one. Then check if the terrain it's on is adjecent to a river (the game must have this check, how else would it know where to build hydro plants?). If it is, add n amount of moves for it.

Crossing the river, that might be a lot harder. No Idea how that could be done... Requires SDK me thinks.
 
Actually, this would be very useful in a WW2 or modern setting. This adds the complexity of how to make it possible to cross only where bridges exist. I doubt there would be a way to "blow up" bridges unfortunately!

It might be possible to do this simply by pillaging the roads on either side of the river. Then the bridge is effectively gone. Too bad you can't do this with aircraft--it'd be very realistic.
 
Another idea: this would make the amphibious promotion much more useful, if we changed it to allow river crossings.
 
Top Bottom