Skip to content

Player

The player keyword is a global accessor providing access to all player-specific state. It is not a datatype — it’s a special accessor that lives at the root of script lookups. Modders use player.X constantly: player.ship, player.galaxy, player.entity, player.money, player.headquarters, etc.

Type: keyword (not datatype) in scriptproperties.xml:2405. This distinguishes it from typed datatypes — player is the universal root accessor.

The player keyword has ~90 properties. Organised by concern.

PropertyTypeDescription
.existsboolPlayer exists
.namestringPlayer name
.rawnamestringRaw text entry reference
.agetimeCurrent game time
.systemtime.{format}stringSystem time (strftime format)
.moneymoneyPlayer account balance
.influenceintPlayer influence (Tides of Avarice)
PropertyTypeDescription
.entityentityPlayer as an entity (NPC perspective)
.controlledobjectCurrently controlled object (or null)
.containercontainerPlayer’s container context (ship or station)
.shipshipPlayer ship context (may be null when landed)
.stationstationPlayer station context (may be null in space)
.occupiedshipshipShip player is piloting (sitting in pilot seat)
.spacesuitspacesuitThe spacesuit, if EVA
.platformdockingbayLanding platform player stands on
.roomroomPlayer room
.zone / .sector / .cluster / .galaxyvariousSpatial context
.computerentityPlayer’s on-board computer (Betty)
.headquartersstationPlayer HQ (null before quest unlock)
PropertyTypeDescription
.targetobjectCurrently targeted object
.autopilottargetobjectAutopilot target
.activityactivityCurrent player activity
PropertyTypeDescription
.conversationstringCurrent conversation ID
.isinconversationboolA conversation is active
.conversationactorentityOther actor in conversation
PropertyTypeDescription
.diplomatslistFaction diplomats to player
.agents.listlistPlayer’s diplomacy agents
.agents.max / .capacity / .freeintAgent slot counts
.agents.research.{numeric}wareResearch needed to unlock N agent slots
.diplomacygiftknown.{faction}.{ware}boolPlayer knows gift effectiveness
PropertyTypeDescription
.hasactivemissionboolHas active mission
.activemissiontypemissiontypeMission type
.activemissionwaypointcomponentWaypoint to next sector
.hasacceptedonlinemissionboolOnline mission accepted
PropertyTypeDescription
.hascommission.{container or faction}boolPlayer has commission
.hascommission.{X}.{id}boolSpecific commission
.hasdiscount.{container or faction}boolPlayer has discount
.hasdiscount.{X}.{id}boolSpecific discount
PropertyTypeDescription
.canteleportto.{controllable}boolCan teleport to (respects restrictions)
.canforceteleportto.{controllable}boolCan teleport ignoring restrictions
PropertyTypeDescription
.hasscannerboolHas scanner software
.scanlevelintCurrent scan level
.maxscanlevelintMax scan level
.longrangeboolHas long-range scanner
PropertyTypeDescription
.encyclopedia.<libtype>.{id}.existsboolHas encyclopedia entry
.encyclopedia.<libtype>.{id}.namestringEntry name
.encyclopedia.<libtype>.{id}.descriptionstringDescription
(and more)variousImage, video, voice, date, group
PropertyTypeDescription
.blueprints.{ware}.any.existsboolHas any blueprint for ware
.blueprints.{ware}.any.cycle.timetimeCycle time of first blueprint
.blueprints.{ware}.<method>.existsboolSpecific production method
(and many more)variousFull blueprint introspection
PropertyTypeDescription
.isincontrolpositionboolSitting or standing in control
.ismessageunread.{id}boolHas unread message
.debugboolDebug options available
<do_if value="@player.occupiedship">
<!-- player is piloting a ship -->
</do_if>
<do_elseif value="@player.station">
<!-- player is on a station -->
</do_elseif>
<do_elseif value="@player.spacesuit">
<!-- player is in EVA -->
</do_elseif>
<do_if value="player.money ge 50000Cr">
<transfer_money
from="player.entity"
to="$Vendor"
amount="50000Cr"/>
</do_if>
<do_if value="player.blueprints.{ware.shieldgenerator_arg_l_standard_01_mk2}.any.exists">
<write_to_logbook
text="'Player can build this shield'"/>
</do_if>
<find_station_by_true_owner name="$Stations"
space="player.galaxy"
multiple="true"/>

player.galaxy is the canonical “the galaxy” reference for space= parameters.

  • player is a keyword, NOT a datatype. Don’t try typeof player == datatype.X. It’s the root accessor only.
  • .ship vs .occupiedship vs .controlled. .ship is the player’s last ship context (may persist when landed). .occupiedship is what the player is actually piloting. .controlled is the currently controlled object (could be a ship, a turret, etc.).
  • .sector can be NULL. When in a super-highway, the player has a cluster but no sector. Always null-check.
  • .headquarters is null before quest unlock. Pre-HQ-quest, this is null. Story-aware mods gate on @player.headquarters.
  • .entity is the canonical player NPC reference. Use this when adding inventory wares, sending signals, etc.
  • .galaxy is universally accessible. Doesn’t go null. Safe to use without null-check.
  • .money is in 1/100-credit internal units. Same as faction money — divide by 100 only for display.

Example 1: Where is player + give them context-appropriate message

Section titled “Example 1: Where is player + give them context-appropriate message”
<cue name="GreetPlayer" instantiate="true">
<conditions>
<event_player_signalled/>
</conditions>
<actions>
<do_if value="@player.occupiedship">
<write_to_logbook
text="'Piloting '
+ player.occupiedship.knownname"/>
</do_if>
<do_elseif value="@player.station">
<write_to_logbook
text="'On station '
+ player.station.knownname"/>
</do_elseif>
<do_else>
<write_to_logbook text="'Player in unknown context'"/>
</do_else>
</actions>
</cue>

Example 2: Give the player money + a blueprint + an item

Section titled “Example 2: Give the player money + a blueprint + an item”
<transfer_money
from="faction.argon"
to="player.entity"
amount="(500000)Cr"/>
<add_blueprints
wares="[ware.module_gen_storage_solid_l_01]"/>
<add_inventory
entity="player.entity"
ware="ware.inv_spaceflycaviar"
exact="10"/>

Example 3: Check player can teleport to a station

Section titled “Example 3: Check player can teleport to a station”
<do_if value="player.canteleportto.{$TargetStation}">
<!-- player has access — show teleport button -->
</do_if>
  • The player keyword is engine-side. Implemented in the script engine; not modifiable.
  • player.entity vs faction.player. The entity is the NPC; the faction is the political entity. Both exist; serve different purposes.
  • NPCplayer.entity IS-A NPC.
  • Galaxyplayer.galaxy is THE galaxy.
  • Factionfaction.player is the political faction.
  • Headquartersplayer.headquarters accessor.
  • Shipplayer.ship / player.occupiedship.