Skip to content

Plot missions

The word “plot” is overloaded in X4 modding. There are three distinct things with “plot” in their name, and they are not the same system. This page disambiguates.

What people call “plot missions”Actual implementationReal page
Main story arc (Paranid plot, Buccaneers plot, etc.)story_*.xmlStory missions
Claim a sector plot (territorial expansion missions)gm_claimplot.xml (Generic template)This page
The plot.xml scriptActor-persistence storage cue, NOT a mission systemThis page

”Plot” as sector claim — gm_claimplot.xml

Section titled “”Plot” as sector claim — gm_claimplot.xml”

The gameplay concept “claim a plot of space” (= establish sector ownership) is implemented as one generic mission templatemd/gm_claimplot.xml (739 lines).

md.GM_ClaimPlot.Start
├── Do_Not_Start_Mission (early bail)
└── Do_Start_Mission
├── With_Offer
│ ├── CreateOffer
│ ├── Offer_Management (ref md.GenericMissions.OfferMission)
│ └── Offer_End
└── BriefingStarted
├── DisplayCutscene
├── MissionAccepted
│ ├── ActivateImmediately
│ ├── ActivateOnCondition
│ └── ActivateMission
│ └── ClaimPlot_Ref (ref md.RML_ClaimPlot.ClaimPlot)
└── BriefingStopped

It uses the standard generic-mission lifecycle from Generic missionsWith_Offer / BriefingStarted / MissionAccepted / ActivateMission — and delegates the actual claim-plot work to rml_claimplot.xml.

  1. Offer phase: A faction representative offers “Claim Sector X for our faction”
  2. Accept phase: Player chooses to accept, briefing plays
  3. Activate phase: Mission becomes active; player must satisfy claim conditions
  4. Claim phase (rml_claimplot.xml): Verify ownership criteria — own stations in sector, sufficient territorial presence
  5. Complete: Sector ownership transfers to faction (typically player’s faction for player-side claims)

Modding context — sector ownership change

Section titled “Modding context — sector ownership change”

This is the only vanilla mission template that changes sector ownership. If your mod wants to:

  • Add a new sector-claim variant (e.g. “Claim sector by destroying 50% of enemy stations”)
  • Reuse the claim-plot infrastructure in a custom mission

reference md.RML_ClaimPlot.ClaimPlot from your mission. The library handles the sector ownership transfer + map repaint + faction relation cascade.

md/plot.xml is 7 lines total:

<mdscript name="Plot">
<cues>
<!-- This cue is used as a storage area for persistent NPCs that are used in story missions,
so that multiple instances of the same actor are not created when two missions that
use the same NPC run simultaneously -->
<cue name="Actors" />
</cues>
</mdscript>

It is NOT a mission system. It is a shared namespace for cross-mission actor persistence.

When two story missions both reference “the Cardinal” character, they can’t both create_actor — that produces two Cardinals walking around. Pattern:

<!-- In your story mission: -->
<do_if value="not @md.Plot.Actors.$Cardinal">
<create_actor name="md.Plot.Actors.$Cardinal"
race="paranid"
... />
<add_anchored_object
object="md.Plot.Actors.$Cardinal"
reason="PLOT_ACTOR_CARDINAL"/>
</do_if>
<!-- Then use: -->
<set_value name="$MyCardinalRef"
exact="md.Plot.Actors.$Cardinal"/>

The first mission that needs Cardinal creates him; subsequent missions reuse him. The Actors cue is just a named bucket for these globals — md.Plot.Actors.$Cardinal.

By living in its own plot.xml, the storage cue activates at game start regardless of which story plays — actors can be created lazily by any story that needs them.

When players say “the plot” colloquially they mean the main story arc the player follows (Paranid plot, Welfare research plot, Buccaneers plot). These are implemented in story_*.xml, not in plot.xml. See Story missions.

  • plot.xml is NOT the main plot script — it’s a 7-line actor storage cue; the main plot lives in story_*.xml
  • gm_claimplot is a Generic template, not a separate category — it follows the Generic missions lifecycle
  • rml_claimplot performs the actual ownership change — if you customize claim conditions, reference md.RML_ClaimPlot.ClaimPlot
  • md.Plot.Actors.$X is global — name collisions between mods are silent corruption; always prefix $mlog_X style
ConcernFile
Claim-plot mission templategm_claimplot.xml (739 lines)
Claim-plot reusable libraryrml_claimplot.xml
Persistent actor storageplot.xml (7 lines)
Sector ownership changerml_claimplot.xml — search for set_owner sector=

If your mod docs say “adds new plot missions”, be specific about which “plot” — vanilla uses three different things with that name. Future-you and future-modders will thank you.