Trade node modding
This page is an explanation of how to mod a trade nodes. The relevant folder is /Europa Universalis IV/common/tradenodes. In the vanilla game, this folder only contains one file 00_tradenodes.txt. To change the existing nodes and connections between them, you must edit that file. In case you are simply adding nodes or connections, a new file may be added to the folder (e.g. 01_hormuz_to_ceylon.txt).
Warning: Trade companies, events, missions, and decisions reference specific trade nodes in their scripting. Deleting a node will require modding these files as well. Adding/removing connections, on the other hand, should cause no conflicts.
Warning: In the tradenodes text file, the order that nodes are ordered is very important top to bottom. All nodes that contribute trade to a downstream node, must be declared before the downstream node's entry in the text file. For example if Canton feeds into Malacca, the canton node section MUST be before the Malacca node section.
Trade nodes code[edit | edit source]
A trade node is defined as follows.
hormuz={ location=1334 outgoing={ name="basra" path={ 2219 1335 } control={ 3687.000000 1082.000000 3650.000000 1073.000000 } } members={ 435 2224 2229 2230 #sistan_area 397 398 404 2333 #pirate_coast_area 432 2220 2234 4345 #kerman_area 434 575 2231 2232 2233 #makran_area 430 2219 2223 4332 #persian_gulf_coast 2218 4329 4330 4331 #farsistan_area 403 4285 4287 #oman_area 399 400 4286 #mascat_area 431 2999 4327 #mogostan_area 1332 1334 1335 4347#Sea } }
Name[edit | edit source]
Each trade node needs a unique name, which begin the entry. If you are adding connections to an existing node in a new file, simply use the same name, and enlose a new outgoing
.
hormuz={ outgoing={ # Your code here } }
Location[edit | edit source]
This is the province ID of the trade node. In the example above, it is the Straits of Hormuz. On the map, it is represented as a harbor buoy for sea provinces, a trade depot for land provinces. If it is a land province, you can optionally add the line inland=yes
to mark the node to use caravan power.
Members[edit | edit source]
This is a list of all province IDs that contribute trade value and trade power to a node. You must include the location
ID as well. Be sure to add sea provinces as well so light ships can protect trade.
Outgoing[edit | edit source]
Each node either has outgoing connections, or is an end node. If it is an end node, simply add end=yes
. Otherwise, add connections, each in their own outgoing={}
closure.
In the example above, name
indicates that the connection goes to the Basra trade node. The path
is a list of adjacent provinces that lead from the Straits of Hormuz (1334) to the Persian Gulf (1335), which is the location
of the Basra trade node. control
determines the visual representation of the trade route on the map; they are pairs of X, Y coordinates that mark the inflection points of the curving line between trade nodes. Add as many as needed to created for longer, snaking paths. The easiest way to edit the paths is with the nudge tool, which can be accessed by adding -nudge
to the launch commands and clicking the nudge button on the bottom right. Click trade nodes on the map to edit them. Click save when done.
A Complete Example[edit | edit source]
Here is an example modding the Malacca trade node. It removes the connection from Malacca to Zanzibar, and adds one between Malacca and Ceylon.
malacca={ location=1361 outgoing={ name="comorin_cape" path={ 1348 1349 1613 1614 1340 # Straits of Malacca -> Nicobar Islands -> # Southern Bay of Bengal -> Ceylon Sea -> # Comorin Cape } control={ 4242.000 787.000 4092.000 727.000 # Nicobar Islands -> Ceylon Sea (down 25px) } } outgoing={ name="ganges_delta" path={ 1348 1347 1345 1344 1343 } control={ 4329.000000 740.000000 4311.000000 813.000000 4279.000000 878.000000 4242.000000 943.000000 } } members={ 593 594 595 596 597 598 599 617 618 619 620 621 622 623 636 637 638 639 640 659 1361 1998 1999 2390 2391 2392 2393 2394 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2740 1101 } ai_will_propagate_through_trade = yes }
Localisations[edit | edit source]
Localisation is handled in the same way as any other localisation string. For example:
comorin_cape:0 "Ceylon"
Documentation | Effects • Triggers • Modifiers • Scopes • Variables • Localisation • Customizable localization • Run files |
Scripting | Scripted function • Advisors • Ages • Bookmarks • Buildings • Casus belli • Colonial regions • Countries • Culture • Decisions • Defines • Diplomatic actions • Disasters • Empire of China • Estates • Events • Factions • Government • Great projects • History • Holy Roman Empire • Idea groups • Institutions • Mercenaries • Missions • Modifiers • Nation designer • On Actions • Parliament • Peace treaties • Policies • Rebel types • Religion • Subject types • Technology • Trade companies • Trade goods • Units |
Map | Map • Nation designer • Random New World • Trade nodes |
Graphics | 3D Models • Interface • Graphical Assets • Fonts • Particles • Shaders • Unit models |
Audio | Music • Sound |
Other | Console commands • Checksum • JoroDox mod making tool • Mod structure • Troubleshooting • The Validator • Run files |
Guides | Adding a province • Save-game editing |