Connection Option - "Air Corridor"
-
On my heavily edited version of Path to Victory, I'd like to be able to allow Air Units to pass over the Sahara Desert but not ground units. From what I understand, this is not currently possible to set up in the game XML file and is currently an engine limitation.
I tried looking through the source code but I'm having trouble figuring our how the game knows where connections are and (more importantly) what units are allowed to pass through those connections.
It would be nice if there was a way to simply mark a territory connection in the XML file as "airOnly".
-
You will need something like this, where;
All-Ground-Units is a a list of just that
3 means 3+1=4 movement to enter, meaning all All-Ground-Units cannot enter, because it costs 4 to enter<!-- Desert --> <attachment name="territoryEffectAttachment" attachTo="desert" javaClass="TerritoryEffectAttachment" type="territoryEffect"> <option name="movementCostModifier" value="$All-Ground-Units$" count="3"/> </attachment>
more here
https://forums.triplea-game.org/topic/2892/how-i-am-using-movementcostmodifier -
@thedog The Sahara Desert is not its own territory. It's just a section detailed on the overlay (see image).
The Sahara Desert covers a bunch of territory borders, and in Path to Victory, all of the connections between territories that the Sahara covers are simply not there in the XML file. However, this prevents Air Units from crossing the Sahara, which does not make sense to me.
What I'm asking for is a way for Air Units to pass over the Sahara, but not Ground Units.
Your suggestion, unfortunately, does not work here because it would apply to an entire territory, not just the connection between two of them.
EDIT: To further illustrate what I mean, I've attached another image.
In this image, I've added lines between each territory to note how I'd like the connections set up.
BLUE = Air & Ground units may travel between.
WHITE = Where I want Air Only.(However, as of right now, Ground Units can pass between all of these connections. I would rather they be limited to the blue route.)
-
Currently there is no connection control in the xml to do what you want.
As you have gathered the only way is to make the Sahara a territory or 2 or 3.
-
@thedog I'm not opposed to that, but I haven't made my own territories before. What would I need to know in order to do that?
-
In this case you will need to create a "canal" between the territories:
<!-- Tobruk to Anglo-Egyptian Sudan --> <attachment name="canalAttachmentTobrukAnglo-EgyptianSudan" attachTo="Tobruk" javaClass="CanalAttachment" type="territory"> <option name="canalName" value="TobrukAnglo-EgyptianSudanTravel"/> <option name="landTerritories" value="Pripet Marshes"/> </attachment> <attachment name="canalAttachmentTobrukAnglo-EgyptianSudan" attachTo="Anglo-Egyptian Sudan" javaClass="CanalAttachment" type="territory"> <option name="canalName" value="TobrukAnglo-EgyptianSudanTravel"/> <option name="landTerritories" value="Pripet Marshes"/> </attachment> <!-- Tobruk to French Central Africa --> <attachment name="canalAttachmentTobrukFrenchCentralAfrica" attachTo="Tobruk" javaClass="CanalAttachment" type="territory"> <option name="canalName" value="TobrukFrenchCentralAfricaTravel"/> <option name="landTerritories" value="Pripet Marshes"/> </attachment> <attachment name="canalAttachmentTobrukFrenchCentralAfrica" attachTo="French Central Africa" javaClass="CanalAttachment" type="territory"> <option name="canalName" value="TobrukFrenchCentralAfricaTravel"/> <option name="landTerritories" value="Pripet Marshes"/> </attachment> ... ... ...
Cheers...
-
@wc_sumpton
Now that is creative -
@wc_sumpton I considered a "dummy" canal, but canals act as blockers for enemy units, not allied ones. If I understand correctly, they also require being connected to water territories in some way as a sanity check by the engine so you couldn't get Sea Units on land somehow with a weird canal setup.
The reason why Canals have Submarines and Aircraft in their excluded units is because the line of logic is that enemy Submarines are stealthy and hard to prevent from crossing, and Aircraft can fly over them. "Excluded Units" in this case means "not blocked".
I appreciate the effort, but this doesn't quite work either.
-
@slendymctendies said in Connection Option - "Air Corridor":
@thedog I'm not opposed to that, but I haven't made my own territories before. What would I need to know in order to do that?
You will need the modify the following files
baseTiles using say Inkscape
reliefTiles using say GIMP or paint.net
centers.txt
place.txt...........safer to splice the two files together, the changed territories and old unchanged territories
polygons.txt...safer to splice the two files together, the changed territories and old unchanged territoriesIt will be a steep learning curve and the reliefTiles will probably look out as you dont have the original graphic source file only the flatten png
As you have never done the above before, what about using another map that has what you are after on it and just move your code into that new map?
-
@slendymctendies said in Connection Option - "Air Corridor":
"Excluded Units" in this case means "not blocked"
You are right!! But 'Himalayas' is "isImpassable" so "landTerritories" can equal 'Himalayas'. No one can own this territory, so it becomes impassable. And remove "excludedUnits" because "isAir" units, by default, are not verified.
Cheers...
P.S. Better yet use 'Pripet Marshes' as 'Himalayas' ownership is given "Chinese"
Cheers...
-
@wc_sumpton I think you're ultimately missing the point: Canals are specifically considering Sea Zones. The owners of the Land Territories are how they determine who owns the Canal, and therefore who is and isn't allowed to pass. The game will throw an error if I don't properly connect two Sea Zones, and we're working with Land Territory here.
I think my ultimate solution will be to edit the map and add Sahara sectors as territories. This will get me closest to what I ultimately want.
-
This works if 'Tobruk' connections are present, they are not in the default xml:
<connection t1="Anglo-Egyptian Sudan" t2="Tobruk"/> <connection t1="French Central Africa" t2="Tobruk"/>
Canal connections can be between 2 land territories, the land territory that is needed for ownership, does not need to be part of the canal. Try it, I did, you might be surprised!!
Cheers...
-
@wc_sumpton Hmmm....
-
@wc_sumpton Well well, I stand corrected.
I took your idea a small step further though. I created an extremely small territory that is effectively impossible to find on the map, made THAT impassible and have 0 connections (and soon will have a territory effect where it disallows all units, just in case). I made THAT the "owner" territory.
Why? Because I made Pripet Marshes and Himalayas passable by foot soldiers, and therefore technically conquerable. I might revert that change and use the "Air Canals" we just got figured out instead. Because, again, I don't see why aircraft can't pass over these territories. Not sure yet.
Thank you! I've never been more happy to be wrong lol
-
@slendymctendies said in Connection Option - "Air Corridor":
I created an extremely small territory that is effectively impossible to find on the map
No Land
centers.txt
No Land (0,0)polygons.txt
No Land < (0,0) (0,1) (1,0) (1,1) >place.txt
No Land (0,0) | overflowToLeft=falsexml
<territory name="No Land"/> ... ... ... <attachment name="territoryAttachment" attachTo="No Land" javaClass="games.strategy.triplea.attachments.TerritoryAttachment" type="territory"> <option name="isImpassable" value="true"/> </attachment>
That simple, no need to edit the map.
Cheers...
Edited to show @SlendyMcTendies correction, thank you!!
Cheers...
-
@wc_sumpton Right, that's what I did and meant. However, territories must have a height & width greater than 0, so "NoLand" would need to be < (0,0) (0,1) (1,0) (1,1) > in "polygons.txt", and assumedly the center and placement marker within those bounds as well. Didn't test if they could be outside the bounds, but I don't see any reason to either.