Victoria 3

Victoria 3

Not enough ratings
How to Make Airports in Victoria 3
By Dotti Locari
Described within is a medium-difficulty method by which you can hack both your provinces.png and your adjacencies.csv to connect any state in the game to the world market as though it had a port.
   
Award
Favorite
Favorited
Unfavorite
What do you mean, airports?
This is a hack of the naval spline system, allowing every state to function as though it had a port. It stems from a joint effort between Anbennar and Exether to create a working airship system for our respective mods. This is a system with many applications! Anbennar will also use it represent the other planes of existence, The Sunless Seas mod will use it to represent the Unterzee... but for vanilla, it means airports.

As of writing, the system only works for trade; no unique airship fleets or fighter wings. I'd love to be proven wrong.

Required Reading
This guide builds a lot on the skills from this guide, so if you're not familiar with using the map editor, you should start there.
The Building
We'll start with the building itself. For Exether, it looks like this:

building_airship_dock = {
building_group = bg_public_infrastructure
city_type = city
texture = "gfx/interface/icons/building_icons/airship_dock.dds"

enable_air_connection = yes

has_max_level = yes
ignore_stateregion_max_level = yes
port = yes

unlocking_technologies = { airshipyards }

production_method_groups = {
pmg_base_building_airship_dock
}

required_construction = construction_cost_medium

possible = {
error_check = {
severity = fail

is_coastal = yes #god's light does not shine upon us

}
}
}

The important things:

  • "enable_air_connection" does not do what you think it does
  • port = yes determines whether a building can connect a state to the global market
  • is_coastal MUST BE YES. States that aren't coastal aren't allowed to have ports. We'll come back to this.
The Secret Spline
The crux of this setup is a special modded spline. Paradox had plans to implement more types of roads than actually made into the game, but even though they didn't make it into the game, these other road types did make into the map editor.

In gfx\map\spline_network\spline_types, pick the paved road and copy this:

pavedroad = {
id = 4
default_style = 4
color = { 0.75 0 1.5 }
merge_with_types = { 2 3 4 } # Specifed with id numbers
anchor_sparsity = 8 # Number of NavMesh vertices to skip between each anchor
anchor_type = 1
}

the most important thing here is the anchor type: by default, land hubs have an anchor type of 0 and naval hubs have a type of 1. What we end up with is a spline that naval units are not allowed to traverse, but trade and convoys are. You're free to change the color to whatever you want!

In gfx\map\spline_network\spline_styles, you can find everything you need to either give your air routes a different type of connection gfx, or remove the gfx altogether.
The Ugly
Remember how earlier, I said that airship building needed to be only buildable in coastal regions? Well, that's part of the hack: where we're going, everything's coastal. What you're gonna do is open up the map editor as well as your adjacencies.csv and get to work. Every state needs at least one adjacency, and you might want to give out spares in case they get treaty ported.

What states should you make them adjacent to? The easy answer is just connect them to their nearest coastal state, but the funner answer is to use those adjacencies.csv again to create a true network of air states for convoys to flow through. By hiding a network of tiny ocean states on the edge of the map, and connecting them to where they need to go only through adjacencies, you can create a network of air states just like the network of sea states used for vanilla sea trade.


These are my "air" states. They're just tiny, 2 pixel sea states! Make sure you add any provide IDs that you intend to use as sea starts in your default.map file. While you're at it, assign them a terrain in your province terrains file. I've just been using "ocean" but you could probably do something interesting with a custom province terrain...

You'll also need to make sure that you do harbor connections the same way port-->harbor connections are done in vanilla, i.e. you need naval exits in your state region files and you need a type 1 port hub for each state (you don't actually need a type 0 hub though the game will try to spawn one anyways), and you need to connect that hub to the the spline hub of its naval exit state.






Just like a harbor connection. But on land! If you have a valid state ID saved in your clipboard when you select a type 1 hub, it will automatically paste it to the hub, so if you can save a lot of time by ctrl-c-ing the city hub's ID straight onto the port hub. Note that any network segment you make MUST connect to the larger network (I think, to the null province specifically. Separate and distinct networks do not seem to be possible.


The game will still try to spawn the port locators; you can either ignore them or make a custom city type with a blank mesh for the port, with simple trigger:

trigger = {
any_scope_state = {
no_beaches = yes
}
}

and now, the very ugly: the no_beaches trigger; and the cooler_is_coastal trigger. You'll need both of these to fix some new and exciting behavior related to these beautiful landports
no_beaches and the_cooler_is_coastal
In Vanilla, "Is_coastal" is a trigger used to check the validity of certain buildings and diplo actions.

Now, recall that in doing this hack, we have rendered fundamentally worthless the vanilla is_coastal trigger. Since every state you want to be airport-capable is now considered a coastal state, we'll need to make a new trigger to replace the one we broke.

Enter no_beaches and the_cooler_is_coastal:

no_beaches is...

literally just a list of all of your states that don't have a coastline. Then, the_cooler_is_coastal is a just a simple
{
is_coastal = yes
no_beaches = no
}

Before you do this, determine whether it would be easier to compile a list of your coastal states than it would be your inland states; for Exether, I made a list of the states with a coastline instead, and just reversed the logic for no_beaches.

However you end up doing, you'll basically need to find/replace every instance of is_coastal in vanilla with whatever new trigger you end up creating. The important things to get are any naval related building (shipyards, military shipyards, naval bases and ports) and to add something like
scope:target_state = { the_cooler_is_coastal = yes } to your can_reach_target_state trigger and your can_reach_target_country trigger.
Final Tips:
All-in-all, you should be editing 8 files every time you add a new sky region:







You should have:

  • made a new sea state + a corresponding water strategic region (resist the urge to make a file specifically for your air states, it causes weird bugs that aren't easily reproducible. Put them with the water files.)
  • completed both the .splnet changes + provinces.png changes in the map editor
  • copied the province hex ID to both sea starts, and assign it a default terrain
  • added naval exits and treaty port hex IDs to all of the state_region files
  • connected the new sky state both to the larger network of sky/sea states, and to the land provinces that it provides trade access to. Remember, no disconnected networks!