Skip to content

Game API

The Game API describes the in-universe abstractions a mod interacts with: things that exist in the X4 universe, their properties, what you can do to them, and what events they fire.

When you have a question like:

  • β€œHow do I change ownership of a ship?” β†’ look up Ship
  • β€œHow do I list stations in a sector?” β†’ look up Sector
  • β€œHow do I react when a station is destroyed?” β†’ look up Station (Events section)

You’ll find: description, properties, actions, libraries, events, examples, gotchas, related abstractions.

For how to write the code that uses these β€” Cue, Library, Event/Condition, Action, Variable, Expression β€” see the Modding language reference instead.

The spatial hierarchy where everything exists β€” Universe β†’ Cluster β†’ Sector β†’ Zone, plus Highway and Gate.

Things that exist in the world β€” Station (and its 8 subtypes), Ship, Module, Resource region.

Who owns and controls things β€” Faction (parent), Player, NPC factions, Crew.

Ware, Trade offer, Subscription, Inventory, Cargo.

What objects do in-universe β€” Order (a ship is executing X), Mission (a player has accepted Y), Conversation, Boarding operation.

For the language-side of behavior (how to write an order or a generic mission) see Aiscript Framework and MD Framework.


Currently filled: Station and Sector. Other pages are placeholders to demonstrate navigation structure.