How to edit trade-network (air-trade)?

Great Oleander

Chieftain
Joined
Jun 27, 2006
Messages
67
Hi everybody :wavey:

I’m currently playing a scenario from the Fall from Heaven 2 Mod (scenario - Wages of Sin) and because there are enemies between me and my allies (with “always war” on) I would like to know if there is a way to edit something so that I can either trade through air (via building) or through the enemy territory?

I tried to enable the “global define” parameter IGNORE_PLOT_GROUP_FOR_TRADE_ROUTES (if this is set the player doesn’t need to own tiles to trade through them), but it’s not working… maybe because war cancels this parameter … :dunno:
I also looked at one building (planar gates – is similar to an airport, can airlift units), but couldn’t find anything about trading through air.

I know in Civ3 trading through air was possible, but don't know if it is in Civ4? :dunno:

Any help or push in the right direction would be highly appreciated! :)

cheers,
great oleander
 
The plot group thing is mostly about trade connections, but peace and open borders are still required.

Trade through airports can be enabled with DLL modding if you want to go down that route.
 
Looking through the DLL, I see no hints of trade networks being enabled on anything other than plotgroups. Plotgroups may spread across routes (aka roads) or terrain type, allowing spread on water plots. Regardless on how you set this up, it only spreads from plot to plot and doesn't jump like you are asking for.

CvCity::getMaxAirlift() appears to be the indicator to tell if there is an airport in the city. However it is only used to tell if units can in fact airlift. I used it in the modcomp to display a plane icon on the city billboard if there is an airport in the city.

I suspect what you want to do is something like loop all cities and for each city with CvCity::getMaxAirlift() > 0, merge the plotgroup with all cities where CvCity::getMaxAirlift() > 0. The plotgroup system is essentially a cache, which mean modding anything related to plotrgroup spread should include the usual considerations regarding invalidating and updating the cache.

IGNORE_PLOT_GROUP_FOR_TRADE_ROUTES appears to work according to the vanilla code. However it does precisely what it says: enables trade routes. This mean you can get trade going to generate extra income. It doesn't spread bonuses, which I assume is what you want to do.


While we are on the topic of joining your empire in FFH2, I currently have a game where I have two sections divided by a row of peaks. It's one plot wide and the only way around it is by sailing. The ships doesn't have to move to act as a bridge, but it does involve a bunch of micromanagement as well as preventing me from setting rally points in the "other" part of the empire. Any good ideas besides using WE to remove a peak?
 
Thanks for your answers!

@Leoreth: I'ver never done any dll-compiling, I think it's a bit to complex for me :crazyeye:

@Nightinggale: Yes, only the bonus-trade is important for me. In fact, it's not so important how it could be implemented, only the result that I can trade through or above the enemy territory would be important.

Hm, in FFH2 peaks cannot be removed without using the Worldeditor. The only unit that can pass through impassable terrain would be flying units (dragons, griffons) and iirc the druid. Or you can use the airlift ability from the obsidian gate (not the planar gate, which I wrote mistakenly in my first post).
 
I'ver never done any dll-compiling, I think it's a bit to complex for me :crazyeye:
I set up a server to compile for people with that problem (technically not a server, but it feels like one). However compiling if just half the problem. What you need is modified code to be compiled, which is likely more complex than the issue of compiling itself. The idea with the compile server was to allow people to change hardcoded values like MAX_PLAYERS or merge modcomps, not to make a new feature like this one. I wouldn't trust such a major chance if it comes from somebody, who can't debug or similar to verify that it is actually working as intended.

Hm, in FFH2 peaks cannot be removed without using the Worldeditor. The only unit that can pass through impassable terrain would be flying units (dragons, griffons) and iirc the druid. Or you can use the airlift ability from the obsidian gate (not the planar gate, which I wrote mistakenly in my first post).
I don't like any of those solutions. What I would like would be to place road on a peak. That would bypass the terrain check, which mean walking units would be able to pass. I just haven't figured out way to place workers on a peak :think:
 
Hm ok, thanks for the offer, but it seems this whole issue is a bit too much for me :think:

Aside from the Worldeditor, i think I don't know any other ways to place a worker on a peak.
 
Try this mod. I have it implemented in my mod. I think I had to tweak it to fit in with KMod, but it has all the necessary code and would certainly be easy enough for you to adjust to your needs as it isn't overly complex.
Looks interesting, but it would be faster to just use WE to add one plot of road or change terrain. Generally allowing moving over peaks would most likely spoil the concept of mountains in FFH2, at least with some map generators.
 
Back
Top Bottom