Has anyone created river-navigating units?

Chibiabos

Prince
Joined
May 24, 2005
Messages
424
I'm kinda curious. I'm teetering on the edge of trying to learn to mod, but am very intimidated. I wanna do some mods for C4C, among them giving Caravels the ability to navigate inland by means of rivers and maybe creating a 'barge' unit as a high-capacity river transport, but I don't know if its possible/feasible to make units that can use rivers.

Has anyone done this in their mods already that I could check out and possibly copy/modify? Thanks!
 
Well units travel along squares, but rivers travel in-between squares.. I don't think what yer looking for is possible. I could be wrong though.
 
I am curious, but are Rivers defined as Features or Routes?

If it was defined as a route, there was some python code that Zebra released that restricted a unit's movement to a defined Route.

Therefore, if Rivers are Routes, then this python code could be used to to restrict the boat to rivers.

I am not sure it will aesthetically pleasing, I imagine the boat would encompass the entire square, making it appear to be on land.
 
Another thing to consider is if you get it to work, would the AI understand that the unit can travel up a river?
 
You could make a feature like flood plains that inhabits all possible riverside tiles (rather than just desert). Then you could make a unit that can only travel on that feature. As a matter of fact I could probably do it...
OK, its a little more complicated than that. First of all, a feature like that would kill all riverside forest, so you would have to add not just one feature but three (riverside, riverside forest, and riverside jungle). Next, as was recently discussed in another thread, FeaturePassableTech doesnt make a feature passable, it just turns off unpassability if it was artificially imposed. Maybe it could still be done this way by making riverside impassable, then giving all civs a hidden free tech ShoreWalking that allows land units to pass riverside. But still theres no way to allow a unit of either domain to traverse land terrains only on the condition they have a specific feature or set of features. So maybe te ActsAsCity tag in improvements is an answer. Wherever you have riverside terrains, instead of regular improvements you can make RiversideFarm, RiversideTown, etc...and all these have the ability to act as city, which I believe is what makes Forts able to act as canals. However, this is limited to one tile or so. Maybe that could be changed with sdk or something.
 
I think the best way to handle it would be to drop the current river concept. Create a new river system by creating a tile that looks like a double-sided coast, but with the water in the middle. That should be doable with just 6 new terrains (two straights N-S, and E-W, and 4 right-angle joints.

Then only some units could use the new tiles.


Alternatively, make a specific map scenario using joined coasts to represent rivers---e.g. Chinese Warlords scenario.
 
First of all, a feature like that would kill all riverside forest, so you would have to add not just one feature but three (riverside, riverside forest, and riverside jungle).

But you can't have more than one feature on a tile at the same time. So if you added the Riverside Forest/Jungle, you would lose the feature that allowed travel.
 
In working on my future mod I just discovered something. I made a terrain Venus that was impassable to most units not by the Impassable tag in the TerrainInfos but TerrainImpassables in the UnitInfos, and gave it a feature Cloud. I found that the feature Cloud made the Venus terrain passable. In fact, any feature whatsoever will overide TerrainImpassables. If I used WB to put in Forest or Ice those also made Venus passable. Presumably, by making a land unit (or maybe a sea unit with AllTerrains, I'll have to experiment) called Riverbarge or Longboat, then going into UnitInfos and making all land terrains impassable to it, as well as all features other than Flood Plains or Riverside (which is a new feature that appears wherever rivers run through Grass, Plains, Tundra, or Snow just as Flood Plains appears wherever rivers run through Desert) you could make a unit that can only travel through tiles adjacent to rivers.

What I mean about RiversideForest is an additional feature called RiversideForest that also functions like Riverside and appears only on river side Grassland and looks like Forest. Unfortunately, if you chopped it you would lose river navigability unless you gave plain Riverside an incredible growth factor (like 5000) so it quickly filled the space and made sure to set the correct tag in the definition of the Riverside feature so that it only appears beside rivers.

OK, I did this as a mod and attached it. It works, but needs to be tweaked to make the riverside terrains generate on all riversides. The vikings have a sea unit called Longboat that can navigate rivers.
 

Attachments

Back
Top Bottom