X4: Foundations

File information

Last updated

Original upload

Created by


Uploaded by


Virus scan

Safe to use

About this mod

Create civilian fleets to help manage traders and miners.

Permissions and credits
Civilian Fleets
Managing your civilian ships has never been easier.
  • An update to the currently-broken mod Mining Trading Fleet
  • Steam release available in case you need it; check the Mirrors section above.
  • Since v2.00: requires SirNukes Mod Support API
  • Since v3.00: no longer requires Right Click API!

What are "Civilian Fleets"?
"Civilian Fleets" are fleets that are formed to fulfill civilian objectives, as opposed to the vanilla fleets (previously "wings"), where they fulfill military objectives and actually do battle. They are a good way of managing your trading and mining ships by grouping ships together in your GUI.

With the new "fleet group" mechanics of Update v3.0, the term "Civilian Fleets" now refers to fleet groups under a single commander that fulfill civilian objectives. The adaptability of the new fleet groups means that you are now able to assign battle/escort groups alongside civilian groups under the same commander with much reduced hassle.

EgoSoft seems interested in implementing their own version of "civilian fleets", as seen from the disabled portions of their official aiscripts. Stay tuned to them for more info.

What Civilian Fleets are Available?
There are a number of civilian fleets available, but I like to categorize them into a few logical groups. Note that everything is already included in the same main file, no need to download anything extra (except the other mods of course).

The Core Group
All the things related to vanilla X4: Foundations.
  • Trading fleet: uses AutoTrade default behavior ("TradeRoutine" AI-script)
  • Mining fleet: uses AutoMine default behavior, but recognizes Sector AutoMine, etc. ("MiningRoutine" AI-script)
  • Distribution fleet: uses Distribute Wares default behavior ("Middleman" AI-script)

The Core+ Group
All the things related to a slightly-modified X4: Foundations.

The TaterTrade Group
The alternative traders from the revived TaterTrade project .
  • TaterTrade fleet: uses TaterTrade default behavior ("TaterTrade" AI-script)

The Mules Group
The once-again-revived Mules from the Mules Supply and Warehouses Extended mod, now happily receives one extra Mule member. Their Mx numbering is omitted for simplicity.
  • Station Mule fleet: uses StationMule default behavior ("StationMule" AI-script)
  • Distribution Mule fleet: uses DistriMule default behavior ("DistriMule" AI-script)
  • Travel Mule fleet: uses TravelMule default behavior ("TravelMule" AI-script)
  • Supply Mule fleet: uses SupplyMule default behavior ("SupplyMule" AI-script)

Newly-formed civilian fleets will be named in the format of "Civilian XX YY", where "XX" represents a number, and "YY" represents the fleet type as described above.

Fleet names are automatically updated to reflect their current fleet order. This can be useful when e.g. you decide to convert your AutoTrade fleet into e.g. TaterTrade fleet. The fleet name will be updated eventually.

You have the option to disable fleet auto-renaming. Configure this by going to the Extension Options created by SirNukes Mod Support API mod.

What Civilian Fleets are NOT Available?
Everything listed here will never be inside this mod (unless things changed so drastically), because others have made effort to mimic what this mod does. Let's try not to reinvent the wheel.

The Other Exploration Group
There is an underlying non-trivial organization behind the exploration fleets of AnotherExplorerV2, so I rather not mess with them.
  • AnotherExplorerV2 fleet

The Random Group
A group of three related mods banded together, they offer quick trading/mining solutions.

The Reactive Group
Local security forces from the Reactive Force mod.
  • Reactive fleet

How to Form Civilian Fleets?
It's simple and intuitive. With Update v3.0 available, it is even more simple and even more intuitive.

  1. Set and confirm the default behavior of the fleet leader; the default behavior of the fleet leader will be applied to other members of the civilian fleet
  2. Select your other ships (traders, miners, etc.)
  3. Right click on the leader
  4. Assign them to a fleet group with the "Trader" or "Miner" role (refer to the attached pic above)
  5. Setup complete
  6. Forget about the fleet
  7. ???
  8. Profit.

Note: the available roles at step 4 depends on the abilities of your ships (i.e., traders only get "Trader", miners can get both "Trader" and "Miner").

Newly-assigned ships receive the normally impossible "trade" or "mining" assignment using scripts, so to distinguish themselves from the usual "defend"/"attack"/"intercept" assignment and the relevant escort/attack behavior.

You can also nest trading fleets too, i.e., assign trader B to trader A, and then assign trader C to trader B, so in the end, you will have something like A -> B -> C hierarchy. But unless you really need it, you should assign everybody to be under the same leader to reduce redundancy and management pain.

With Update v3.0, you can also assign Traders to belong to different fleet groups too, like you can have an Alpha Trade Group, a Beta Trade Group, and a Kappa Trade Group. Perhaps you may want to organize your civilian fleet members by e.g. ship types. But then, ultimately, since they are all taking commands from the same commander and therefore have the same civilian command, this may be less ideal than having everyone under the same group.

Can I Change the Details of the Civilian Fleets?
Sure! Members of a civilian fleet regularly synchronizes their default behaviors with their leader.

Behavior sync occurs when:
  • The leader docks at a docking bay; the leader broadcasts their command to all civilian fleet subordinates (but not to those doing other "unrelated" stuff e.g. Escorting Ship)
  • A civilian fleet member docks at a docking bay; this member obtains the leader's (maybe-updated) default behavior

Docking should occur naturally in any kinds of civilian fleet behavior (e.g., trading ware transfer, give minerals to stations). But still, you may order your civilian leaders/followers to dock so to instantly broadcast/obtain their latest orders.
Leaders of nested civilian fleets will obtain orders from their commander first before broadcasting them to their own subordinates.

Order sync will also trigger fleet auto-renaming; this is explained above, and can be disabled.

Can I Remove This Mod Safely?
Yes! But notice the following:
  • You will NOT lose existing civilian default orders
  • Civilian fleet members will no longer sync orders with their commander
  • Recall Subordinates will summon civilian fleet members to defend the commander

Can I View the Source Code?
Sure. I always want to open source my stuff, so to reduce the risk of me losing the files. They are available here: https://github.com/Vectorial1024/v1024_civilian_fleets

Oh No! The Mod Won't Load!
When in doubt, disable, remove and reinstall.

But, please make sure that you are installing this mod at the game's /extension folder, not your user documents' /extension folder! This should apply to other UI mods of X4.

A separate, older version of this mod is available for users who are still using Update v2.6 of X4. Check the Files tab fore more details.

Thanks to EgoSoft Forums user Nyito for helping out with the debugging in Win7, there are no longer any problems when using this mod in an Win7 environment.

The Trusty Fallback Mode
The Fallback Mode was made and reinforced in response to reports about Right Click API breaking after EgoSoft releases another beta. The outdated Right Click API would break the right click menu, obstructing users from managing civilian fleets properly.

When this mod cannot detect Right Click API, Fallback Mode is engaged. There are announcements in-game to explain the situation, but basically:
  • No changes to already-functioning civilian fleets
  • Only ships with primary purpose = "mine" will be eligible to join mining fleets
  • Only ships with primary purpose = "trade" will be eligible to join trading fleets
  • Other ships (e.g. fight ships) cannot join civilian fleets, but can join defense/escort groups under the commander instead

These changes should allow acceptable level of functionality for when the dependencies fail to load.

This mod can now function without Right Click API (that's basically back to the original Mining Trading Fleet...), but you are strongly recommended to re-enable Right Click API whenever it gets fixed to get the most out of it.

One thing to note: there are some known issues regarding the Fallback Mode:
  • When fallback mode is active, forming/joining civilian fleets will temporarily consume an assignment group; newly-assigned ships should be automatically moved to the correct groups a while later
Concluding Notes
I would like to thank some people in my journey in making this mod. Further details are at the Credits section above.

And, that's all. May fortune favor you!