Retail SEXPs

From FreeSpace Wiki
Jump to: navigation, search

This page is quick a reference of SEXPs available in the retail version of FRED. To see the list of SEXPs that have been added, moved or modified by the SCP, go to the SCP SEXPs page. For tips and examples for how to properly use a SEXP when building missions, as well as warnings about potential pitfalls, follow the link to the detail page for the SEXP you are interested in.

Contents

Objectives

is-destroyed-delay

Is destroyed delay (Boolean operator)
        Becomes true <delay> seconds after all specified ships have been destroyed.

Returns a boolean value; Takes 2 or more arguments:
        1:      Time delay in seconds (see above).
        Rest:   Name of ship (or wing) to check status of.

is-subsystem-destroyed-delay

Is subsystem destroyed delay (Boolean operator)
        Becomes true <delay> seconds after the specified subsystem of the specified ship is destroyed.

Returns a boolean value; Takes 3 arguments:
        1:      Name of ship the subsystem we are checking is on.
        2:      The name of the subsystem we are checking status of.
        3:      Time delay in seconds (see above).

is-disabled-delay

Is disabled delay (Boolean operator)
        Becomes true <delay> seconds after the specified ship(s) are disabled.  A ship is disabled when all of it's engine
subsystems are destroyed.  All ships must be diabled for this function to return true.

Returns a boolean value; Takes 2 or more arguments:
        1:      Time delay is seconds (see above).
        Rest:   Names of ships to check disabled status of.

Is-disarmed-delay

Is disarmed delay (Boolean operator)
        Becomes true <delay> seconds after the specified ship(s) are disarmed.  A ship is disarmed when all of it's turret
subsystems are destroyed.  All ships must be disarmed for this function to return true.

Returns a boolean value; Takes 2 or more arguments:
        1:      Time delay is seconds (see above).
        Rest:   Names of ships to check disarmed status of.

has-docked-delay

Has docked delay (Boolean operator)
        Becomes true <delay> seconds after the specified ships have docked the specified number of times.

Returns a boolean value; Takes 4 arguments:
        1:      The name of the docker ship
        2:      The name of the dockee ship
        3:      The number of times they have to have docked
        4:      Time delay in seconds (see above).

has-undocked-delay

Has undocked delay (Boolean operator)
        Becomes true <delay> seconds after the specified ships have undocked the specified number of times.

Returns a boolean value; Takes 4 arguments:
        1:      The name of the docker ship
        2:      The name of the dockee ship
        3:      The number of times they have to have undocked
        4:      Time delay in seconds (see above).

has-arrived-delay

Has arrived delay (Boolean operator)
        Becomes true <delay> seconds after the specified ship(s) have arrived into the mission

Returns a boolean value; Takes 2 or more arguments:
        1:      Time delay in seconds (see above).
        Rest:   Name of ship (or wing) we want to check has arrived.

has-departed-delay

Has departed delay (Boolean operator)
        Becomes true <delay> seconds after the specified ship(s) or wing(s) have departed from the mission by warping out.  If any 
ship was destroyed, this operator will never be true.

Returns a boolean value; Takes 2 or more arguments:
        1:      Time delay in seconds (see above).
        Rest:   Name of ship (or wing) we want to check has departed.

are-waypoints-done-delay

Waypoints done delay (Boolean operator)
        Becomes true <delay> seconds after the specified ship has completed flying the specified waypoint path.

Returns a boolean value; Takes 3 arguments:
        1:      Name of ship we are checking.
        2:      Waypoint path we want to check if ship has flown.
        3:      Time delay in seconds (see above).

ship-type-destroyed

Ship Type Destroyed (Boolean operator)
        Becomes true when the specified percentage of ship types in this mission have been destroyed.  The ship type is a generic
type such as fighter/bomber, transport, etc.  Fighters and bombers count as the same type.

Returns a boolean value; Takes 2 arguments:
        1:      Percentage of ships that must be destroyed.
        2:      Ship type to check for.

percent-ships-departed

percent-ships-departed
        Boolean function which returns true if the percentage of ships in the listed ships and wings which have departed is
greater or equal to the given percentage.  For wings, all ships of all waves are used for calculation for the total possible
ships to depart.

Takes 2 or more arguments:
        1:      Percentge of departed ships at which this function will return true.
        2+:     List of ships/wing whose departure status should be determined.

percent-ships-destroyed

percent-ships-destroyed
        Boolean function which returns true if the percentage of ships in the listed ships and wings which have been destroyed
is greater or equal to the given percentage.  For wings, all ships of all waves are used for calculation for the total possible
ships to be destroyed.

Takes 2 or more arguments:
        1:      Percentge of destroyed ships at which this function will return true.
        2+:     List of ships/wing whose destroyed status should be determined.

depart-node-delay

depart-node-delay
        Returns true N seconds after the listed ships depart, if those ships depart within the radius of the given jump node.
The delay value is given in seconds.

Takes 3 or more arguments:
        1:      Delay in seconds after the last ship listed departed before this expression can return true.
        2:      Name of a jump node
        3+:     List of ships to check for departure within radius of the jump node

destroyed-or-departed-delay

destroyed-or-departed-delay
        Returns true N seconds after all the listed ships or wings have been destroyed or have departed.

Takes 2 or more arguments:
        1:      Delay in seconds after the last ship/wing is destroyed or departed this expression can return true.
        2+:     Name of a ship or wing

Time

time-ship-destroyed

Time ship destroyed (Time operator)
        Returns the time the specified ship was destroy.

Returns a numeric value; Takes 1 argument:
        1:      Name of ship we want to check.

time-ship-arrived

Time ship arrived (Time operator)
        Returns the time the specified ship arrived into the mission.

Returns a numeric value; Takes 1 argument:
        1:      Name of ship we want to check.

time-ship-departed

Time ship departed (Time operator)
        Returns the time the specified ship departed the mission by warping out.  Being destroyed doesn't count departed.

Returns a numeric value; Takes 1 argument:
        1:      Name of ship we want to check.

time-wing-destroyed

Time wing destroyed (Time operator)
        Returns the time the specified wing was destroy.

Returns a numeric value; Takes 1 argument:
        1:      Name of wing we want to check.

time-wing-arrived

Time wing arrived (Time operator)
        Returns the time the specified wing arrived into the mission.

Returns a numeric value; Takes 1 argument:
        1:      Name of wing we want to check.

time-wing-departed

Time wing departed (Time operator)
        Returns the time the specified wing departed the mission by warping out.  All ships in the wing have to have warped out.   If any are destroyed, the wing can never be considered departed.

Returns a numeric value; Takes 1 argument:
        1:      Name of ship we want to check.

mission-time

Mission time (Time operator)
        Returns the current time into the mission.

Returns a numeric value.

time-docked

Time docked (Time operator)
        Returns the time the specified ships docked.

Returns a numeric value; Takes 3 arguments:
        1:      The name of the docker ship.
        2:      The name of the dockee ship.
        3:      The number of times they must have docked to be true.

time-undocked

Time undocked (Time operator)
        Returns the time the specified ships undocked.

Returns a numeric value; Takes 3 arguments:
        1:      The name of the docker ship.
        2:      The name of the dockee ship.
        3:      The number of times they must have undocked to be true.

Logical

true

True (Boolean operator)
	A true boolean state

Returns a boolean value.

false

False (Boolean operator)
	A false boolean state

Returns a boolean value.

and

And (Boolean operator)
	And is true if all of its arguments are true.

Returns a boolean value.  Takes 2 or more boolean arguments.

and-in-sequence

And in sequence (Boolean operator)
	Returns true if all of its arguments have become true in the order they are listed in.

Returns a boolean value.  Takes 2 or more boolean arguments.

or

Or (Boolean operator)
	Or is true if any of its arguments are true.

Returns a boolean value.  Takes 2 or more boolean arguments.

not

Not (Boolean operator)
	Returns opposite boolean value of argument (True becomes false, and false becomes true).

Returns a boolean value; Takes 1 boolean argument.

=

Equals (Boolean operator)
	Is true if all of it's arguments are equal.

Returns a boolean value; Takes 2 or more numeric arguments.

>

Greater than (Boolean operator)
	True if first argument is greater than the second argument.

Returns a boolean value; Takes 2 numeric arguments.

<

Less than (Boolean operator)
	True if first argument is less than the second argument.

Returns a boolean value; Takes 2 numeric arguments.

is-iff

Is IFF (Boolean operator)
	True if ship{s} are all of the specified team.

Returns a boolean value; Takes 2 or more arguments:
/t1:	Team ("friendly", "hostile" or "unknown").
	Rest:	Name of ship to check.

has-time-elapsed

Has time elapsed (Boolean operator)
        Becomes true when the specified amount of time has elapsed (Mission time becomes greater than the specified time).
Returns a boolean value; Takes 1 numeric argument:
        1:      The amount of time in seconds.

Arithmetic

+

+
    Plus (Arithmetic operator)
    Adds numbers and returns results.

    Returns a number. Takes 2 or more numeric arguments.

-

-
    Minus (Arithmetic operator)
    Subtracts numbers and returns results.

    Returns a number. Takes 2 or more numeric arguments.

*

*
    Multiply (Arithmetic operator)
    Multiplies numbers and returns results.

    Returns a number. Takes 2 or more numeric arguments.

/

/
    Divide (Arithmetic operator)
    Divides numbers and returns results.

    Returns a number. Takes 2 or more numeric arguments.

mod

mod
    Mod (Arithmetic operator)
    Divides numbers and returns the remainer.

    Returns a number. Takes 2 or more numeric arguments.

rand

rand
    Rand (Arithmetic operator)
    Gets a random number. This number will not change on successive calls to this sexp.

    Returns a number. Takes 2 or 3 numeric arguments...
    1: Low range of random number.
    2: High range of random number.
    3: (optional) A seed to use when generating numbers. (Setting this to 0 is the same as having no seed at all)

Status

is-ship-visible

is-ship-visible
    is-ship-visible
    Check whether ship is visible on Player's radar
    Single Player Only! Returns 0 - not visible, 1 - partially visible, 2 - fully visible.
    1: Name of ship to check 

is-cargo-known-delay

is-cargo-known-delay
    Is cargo known (delay) (Boolean operator)
    Returns true if all of the specified objects' cargo is known by the player (i.e. they have scanned each one.

    Returns a boolean value after seconds when all cargo is known. Takes 2 or more arguments...
    1: Delay in seconds after which sexpression will return true when all cargo scanned. Rest: Names of ships/cargo
    to check for cargo known..

cap-subsys-cargo-known-delay

cap-subsys-cargo-known-delay
    Is capital ship subsystem cargo known (delay) (Boolean operator)
    Returns true if all of the specified subsystem cargo is known by the player.
    Note: Cargo must be explicitly named.

    Returns a boolean value after seconds when all cargo is known. Takes 3 or more arguments...
    1: Delay in seconds after which sexpression will return true when all cargo scanned.
    2: Name of capital ship
    Rest: Names of subsystems to check for cargo known..

has-been-tagged-delay

has-been-tagged-delay
    Has ship been tagged (delay) (Boolean operator)
    Returns true if all of the specified ships have been tagged.

    Returns a boolean value after seconds when all ships have been tagged. Takes 2 or more arguments...
    1: Delay in seconds after which sexpression will return true when all cargo scanned. Rest: Names of ships to check if tagged..

is-tagged

is_tagged
    is-tagged
    Returns whether a given ship is tagged or not 

num-kills

num_kills
    num-kills
    Returns the # of kills a player has. The ship specified in the first field should be the ship the player is in.
    So, for single player, this would be Alpha 1. For multiplayer, it can be any ship with a player in it. If, at any
    time there is no player in a given ship, this sexpression will return 0

num-type-kills

num_type_kills
    num-type-kills
    Returns the # of kills a player has on a given ship type (fighter, bomber, cruiser, etc).
    The ship specified in the first field should be the ship the player is in.
    So, for single player, this would be Alpha 1. For multiplayer, it can be any ship with a player in it. If, at any
    time there is no player in a given ship, this sexpression will return 0

num-class-kills

num_class_kills
    num-class-kills
    Returns the # of kills a player has on a specific ship class (Ulysses, Hercules, etc).
    The ship specified in the first field should be the ship the player is in.
    So, for single player, this would be Alpha 1. For multiplayer, it can be any ship with a player in it. If, at any
    time there is no player in a given ship, this sexpression will return 0

shield-recharge-pct

shield-recharge-pct
    shield-recharge-pct
    Returns a percentage from 0 to 100
    1: Ship name 

engine-recharge-pct

engine-recharge-pct
    engine-recharge-pct
    Returns a percentage from 0 to 100
    1: Ship name 

weapon-recharge-pct

weapon-recharge-pct
    weapon-recharge-pct
    Returns a percentage from 0 to 100
    1: Ship name 

shield-quad-low

shield-quad-low
    shield-quad-low
    Returns true if the specified ship has a shield quadrant below
    the specified threshold percentage
    1: Ship name
    2: Percentage 

secondary-ammo-pct

secondary-ammo-pct
    secondary-ammo-pct
    Returns the percentage of ammo remaining in the specified bank (0 to 100)
    1: Ship name
    2: Bank to check (0, 1, 2 and 3 are legal banks. 4 will return the cumulative average for all banks)

is-secondary-selected

is-secondary-selected
    is-secondary-selected
    Returns true if the specified bank is selected (0 .. num_banks - 1)
    1: Ship name
    2: Bank to check (0 .. num_banks - 1) 

is-primary-selected

is-primary-selected
    is-primary-selected
    Returns true if the specified bank is selected (0 .. num_banks - 1)
    1: Ship name
    2: Bank to check (0 .. num_banks - 1) 

shields-left

shields-left
    Shields left (Status operator)
    Returns the current level of the specified ship's shields as a percentage.

    Returns a numeric value. Takes 1 argument...
    1: Name of ship to check.

hits-left

hits-left
    Hits left (Status operator)
    Returns the current level of the specified ship's hull as a percentage.

    Returns a numeric value. Takes 1 argument...
    1: Name of ship to check.

hits-left-subsystem

hits-left-subsystem
    Hits left subsystem (Status operator)
    Returns the current level of the specified ship's subsystem integrity as a percentage.

    Returns a numeric value. Takes 1 argument...
    1: Name of ship to check.
    2: Name of subsystem on ship to check.

distance

distance
    Distance (Status operator)
    Returns the distance between two objects. These objects can be either a ship, a wing, or a waypoint.
    When a wing or team is given (for either argument) the answer will be the shortest distance.

    Returns a numeric value. Takes 2 arguments...
    1: The name of one of the objects.
    2: The name of the other object.

is-ship-visible

is-ship-visible
    is-ship-visible
    Check whether ship is visible on Player's radar
    Single Player Only! Returns 0 - not visible, 1 - partially visible, 2 - fully visible.
    1: Name of ship to check 

team-score

team-score
    team-score
    Get the score of a multi team vs team game.
    1: Team index (1 for team 1 and 2 for team 2) 

time-elapsed-last-order

time-elapsed-last-order
    Last order time (Status operator)
    Returns true if seconds have elapsed since one or more ships have received a meaningful order from the player.
    A meaningful order is currently any order that is not the warp out order.

    Returns a boolean value. Takes 2 or more arguments...
    1: Time in seconds that must elapse.
    Rest: Name of ship or wing to check for having received orders.

skill-level-at-least

skill-level-at-least
    Skill level at least (Boolean operator)
    Returns true if the player has selected the given skill level or higher.

    Returns a boolean value. Takes 1 argument...
    1: Name of the skill level to check.

num-players

num-players
    Num players (Status operator)
    Returns the current number of players (multiplayer) playing in the current mission.

    Returns a numeric value. Takes no arguments.

special-warp-dist

special-warp-dist
    special-warp-dist
    Returns distance to the plane of the knossos device in percent length of ship
    (ie, 100 means front of ship is 1 ship length from plane of knossos device)
    1: Ship name

Change

modify-variable

modify-variable
    Modify-variable (Misc. operator)
    Modifies variable to specified value

    Takes 2 arguments...
    1: Name of Variable.
    2: Value to be set.

special-warpout-name

special-warpout-name
    special-warpout-name
    Sets the name of the knossos device to be used for warpout
    1: Ship name to exit
    2: Name of knossos device 

do-nothing

do-nothing
    Do-nothing (Action operator)
    Does nothing. This is used as the default for any required action arguments of an operator.

add-goals

add-goal
    Add goal (Action operator)
    Adds a goal to a ship or wing.

    Takes 2 arguments...
    1: Name of ship or wing to add goal to.
    2: Goal to add.

clear-goals

clear-goals
    Clear goals (Action operator)
    Clears the goals for the specified ships and/or wings.

    Takes 1 or more arguments...
    All: Name of ship or wing.

change-iff

change-iff
    Change IFF (Action operator)
    Sets the specified ship(s) or wing(s) to the specified team.
    Takes 2 or more arguments...
    1: Team to change to ("friendly", "hostile" or "unknown").
    Rest: Name of ship or wing to change team status of.

protect-ship

protect-ship
    Protect ship (Action operator)
    Protects a ship from being attacked by any enemy ship. Any shipthat is protected will not come under enemy fire.

    Takes 1 or more arguments...
    All: Name of ship(s) to protect.

unprotect-ship

unprotect-ship
    Unprotect ship (Action operator)
    Unprotects a ship from being attacked by any enemy ship. Any shipthat is not protected can come under enemy fire.
    This function is the oppositeof protect-ship.

    Takes 1 or more arguments...
    All: Name of ship(s) to protect.

beam-protect-ship

beam-protect-ship
    Beam Protect ship (Action operator)
    Protects a ship from being attacked with beam weapon. Any shipthat is beam protected will not come under enemy beam fire.

    Takes 1 or more arguments...
    All: Name of ship(s) to protect.

beam-unprotect-ship

beam-unprotect-ship
    Beam Unprotect ship (Action operator)
    Unprotects a ship from being attacked with beam weapon. Any shipthat is not beam protected can come under enemy beam fire.
    This function is the oppositeof beam-protect-ship.

    Takes 1 or more arguments...
    All: Name of ship(s) to protect.

send-message

send-message
    Send message (Action operator)
    Sends a message to the player. Can be send by a ship, wing, or special source. To send it from a special source,
    make the first character of the first argument a "#".
    Takes 3 arguments...
    1: Name of who the message is from.
    2: Priority of message ("Low", "Normal" or "High").
    3: Name of message (from message editor).

self-destruct

self-destruct
    Self destruct (Action operator)
    Causes the specified ship(s) to self destruct.

    Takes 1 or more arguments...
    All: Name of ship to self destruct.

end-campaign

end-campaign
    end-campaign
    Ends the builtin campaign. Should only be used by the main FreeSpace campaign
Takes 1 optional argument
1: End Campaign even if the player is dead (optional; defaults to true)

sabotage-subsystem

sabotage-subsystem
    Sabotage subystem (Action operator)
    Reduces the specified subsystem integrity by the specified percentage.If the percntage strength of the subsystem
    (after completion) is less than 0%,subsystem strength is set to 0%.
    Takes 3 arguments...
    1: Name of ship subsystem is on.
    2: Name of subsystem to sabotage.
    3: Percentage to reduce subsystem integrity by.

repair-subsystem

repair-subsystem
    Repair Subystem (Action operator)
    Increases the specified subsystem integrity by the specified percentage.If the percntage strength of the subsystem
    (after completion) is greater than 100%,subsystem strength is set to 100%.

    Takes 4 arguments...
    1: Name of ship subsystem is on.
    2: Name of subsystem to repair.
    3: Percentage to increase subsystem integrity by.
    4: Repair turret submodel. Optional argument that defaults to true.

set-subsystem-strength

set-subsystem-strength
    Set Subsystem Strength (Action operator)
    Sets the specified subsystem to the the specified percentage.If the percentage specified is < 0, strength is set to 0.
    If the percentage is > 100 % the subsystem strength is set to 100%.

    Takes 3 arguments...
    1: Name of ship subsystem is on.
    2: Name of subsystem to set strength.
    3: Percentage to set subsystem integrity to.
    4: Repair turret submodel. Optional argument that defaults to true.

invalidate-goal

invalidate-goal
    Invalidate goal (Action operator)
    Makes a mission goal invalid, which causes it to not show up on mission goals screen, or be evaluated.
    Takes 1 or more arguments...
    All: Name of mission goal to invalidate.

validate-goal

validate-goal
    Validate goal (Action operator)
    Makes a mission goal valid again, so it shows up on mission goals screen.
    Takes 1 or more arguments...
    All: Name of mission goal to validate.

send-random-message

send-random-message
    Send random message (Action operator)
    Sends a random message to the player from those supplied. Can be send by a ship, wing, or special source.
    To send it from a special source, make the first character of the first argument a "#".

    Takes 3 or more arguments...
    1: Name of who the message is from.
    2: Priority of message ("Low", "Normal" or "High"). Rest: Name of message (from message editor).

transfer-cargo

transfer-cargo
    Transfer Cargo (Action operator)
    Transfers the cargo from one ship to another ship.

    Takes 2 arguments...
    1: Name of ship that cargo is being transferred from.
    2: Name of ship that cargo is being transferred to.

exchange-cargo

exchange-cargo
    Exchange Cargo (Action operator)
    Exchanges the cargos of two ships. If one of the two ships contains no cargo, the cargo is transferred instead.
    Takes 2 arguments...
    1: Name of one of the ships.
    2: Name of the other ship.

good-rearm-time

good-rearm-time
    Good rearm time (Action operator)
    Informs the game logic that right now is a good time for a given team to attempt to rearm their ships.
    The time parameter specified how long the "good time" will last.

    Takes 2 arguments...
    1: Team Name
    2: Time in seconds rearm window should last

allow-ship

allow-ship
    Allow ship (Action operator)
    This operator makes the given ship type available to the Terran team. Players will be able to have ships of this type
    in their starting wings in all future missions of this campaign.

    Takes 1 argument...
    1: Name of ship type (or ship class) to allow.

allow-weapon

allow-weapon
    Allow weapon (Action operator)
    This operator makes the given weapon available to the Terran team. Players will be able to equip ships with
    in all future missions of this campaign.

    Takes 1 argument...
    1: Name of weapon (primary or secondary) to allow.

break-warp

break-warp
    break-warp
    Break the warp drive on the specified ship. A broken warp drive can be repaired by a repair ship. Takes 1 or more arguments...
    All: List of ships to break the warp drive on

fix-warp

fix-warp
    fix-warp
    Fixes a broken warp drive instantaneously. This option applies to warp drives broken with the break-warp sepxression.
    Takes 1 or more arguments...
    All: List of ships whose warp drive should be fixed

never-warp

never-warp
    never-warp
    Never allows a ship to warp out. When this sexpression is used, the given ships will never be able to warp out.
    The warp drive cannot be repaired. Takes 1 or more arguments...
    All: List of ships whose are not allowed to warp out under any condition

allow-warp

allow-warp
    allow-warp
    Allows a ship which was previously not allowed to warp out to do so. When this sexpression is used, the given ships
    will be able to warp out again. Takes 1 or more arguments...
    All: List of ships whose are allowed to warp out

good-secondary-time

good-secondary-time
    Set preferred secondary weapons
    This sexpression is used to inform the AI about preferred secondary weapons to fire during combat. When this expression
    is evaulated, any AI ships of the given team prefer to fire the given weapon at the given ship. (Preferred over other
    secondary weapons)
    Takes 4 argument...
    1: Team name which will prefer firing given weapon
    2: Maximum number of this type of weapon above team can fire.
    3: Weapon name (list includes only the valid weapons for this expression
    4: Ship name at which the above named team should fire the above named weapon.

ship-invisible

ship-invisible
    ship-invisible
    Causes the ships listed in this sexpression to be invisible to player sensors.

    Takes 1 or more arguments...
    1+: Name of ships to make invisible to sensors.

ship-visible

ship-visible
    ship-visible
    Causes the ships listed in this sexpression to be visible with player sensors.

    Takes 1 or more arguments...
    1+: Name of ships to make visible to sensors.

ship-invulnerable

ship-invulnerable
    ship-invulnerable
    Causes the ships listed in this sexpression to be invulnerable to weapons. Use with caution!!!!

    Takes 1 or more arguments...
    1+: Name of ships to make invulnerable to weapons.

ship-vulnerable

ship-vulnerable
    ship-vulnerable
    Causes the ship listed in this sexpression to be vulnerable to weapons.

    Takes 1 or more arguments...
    1+: Name of ships to make vulnerable to weapons.

red-alert

red-alert
    red-alert
    Causes Red Alert status in a mission. This function ends the current mission, and moves to the next mission
    in the campaign under red alert status. There should only be one branch from a mission that uses this expression

    Takes no arguments.

jettison-cargo-delay

jettison-cargo-delay
    jettison-cargo-delay
    Causes a cargo carrying ship to jettison its cargo without the undocking procedure. Takes 2 or more arguments...
    1: Ship to jettison cargo
    2: Delay after which to jettison cargo (note that this isn't actually used)
    Rest (optional): Cargo to jettison. If no optional arguments are specified, the ship jettisons all cargo. 

fire-beam

fire-beam
    beam-fire
    Fire a beam weapon from a specified subsystem
    1: Ship which will be firing
    2: Turret which will fire the beam (note, this turret must have at least 1 beam weapon on it)
    3: Ship which will be targeted
    Use add-data to add a specific subsystem to target on the specified target ship

beam-free

beam-free
    beam-free
    Sets one or more beam weapons to allow firing for a given ship
    1: Ship to be operated on
    2, 3, etc : List of turrets to activate 

beam-free-all

beam-free-all
    beam-free-all
    Sets all beam weapons on the specified ship to be active 

beam-lock

beam-lock
    beam-lock
    Sets one or more beam weapons to NOT allow firing for a given ship
    1: Ship to be operated on
    2, 3, etc : List of turrets to deactivate 

beam-lock-all

beam-lock-all
    beam-lock-all
    Sets all beam weapons on the specified ship to be deactivated 

turret-free

turret-free
    turret-free
    Sets one or more turret weapons to allow firing for a given ship
    1: Ship to be operated on
    2, 3, etc : List of turrets to activate 

turret-free-all

turret-free-all
    turret-free-all
    Sets all turret weapons on the specified ship to be active 

turret-lock

turret-lock
    turret-lock
    Sets one or more turret weapons to NOT allow firing for a given ship
    1: Ship to be operated on
    2, 3, etc : List of turrets to deactivate 

turret-lock-all

turret-lock-all
    turret-lock-all
    Sets all turret weapons on the specified ship to be deactivated 

add-remove-escort

add-remove-escort
    add-remove-escort
    Adds or removes a ship from an escort list.
    1: Ship to be added or removed
    2: 0 to remove from the list, any positive value will be used as the escort priority
    NOTE : it _IS_ safe to add a ship which may already be on the list or remove
    a ship which is not on the list 

awacs-set-range

awacs-set-radius
    awacs-set-radius
    Sets the awacs radius for a given ship subsystem. NOTE : does not work properly in multiplayer
    1: Ship which has the awacs subsystem
    2: Awacs subsystem
    3: New radius 

send-message-list

send-message-list
    send-message-list
    Sends a series of delayed messages. All times are accumulated 1: Name of who the message is from.
    2: Priority of message ("Low", "Normal" or "High").
    3: Name of message (from message editor).
    4: Delay in ms
    Use Add-Data for multiple messagesIMPORTANT : each additional message in the list MUST HAVE 4 entries;
    any message without the 4 proper fields will be ignored, as will any
    successive messages

cap-waypoint-speed

cap-waypoint-speed
    cap-waypoint-speed
    Sets the maximum speed of a ship while flying waypoints.
    1: Ship name
    2: Maximum speed while flying waypoints
    NOTE: This will only work if the ship is already in the game
    NOTE: Set to -1 to reset 

ship-guardian

ship-guardian
    ship-guardian
    Causes the ships listed in this sexpression to not be killable by weapons. Use with caution!!!!

    Takes 1 or more arguments...
    1+: Name of ships to make unkillable.

ship-no-guardian

ship-no-guardian
    ship-no-guardian
    Causes the ships listed in this sexpression to be killable by weapons, if not invulnerable.

    Takes 1 or more arguments...
    1+: Name of ships to make killable.

ship-vanish

ship-vanish
    ship-vanish
    Makes the named ship vanish (no log and vanish)
    Single Player Only! Warning: This will cause ship exit not to be logged, so 'has-departed', etc. will not work
    1: List of ship names to vanish 

turret-tagged-only

turret-tagged-only
    turret-tagged-only
    Makes turrets target and hence fire strictly at tagged objects
    1: Ship name
    NOTE: Will not stop a turret already firing at an untagged ship 

turret-tagged-clear

turret-tagged-clear
    turret-tagged-clear
    Relaxes restriction on turrets targeting only tagged ships
    1: Ship name 

subsys-set-random

subsys-set-random
    subsys-set-random
    Sets ship subsystem strength in a given range
    1: Ship name
    2: Low range
    3: High range
    4: List of subsys names not to be randomized 

supernova-start

supernova-start
    supernova-start
    1: Time in seconds until the supernova shockwave hits the player 

cargo-no-deplete

cargo-no-deplete
    cargo-no-deplete
    Causes the named ship to have unlimited cargo.
    Note: only applies to BIG or HUGE ships
    Takes 1 or more arguments...
    1: Name of one of the ships.
    2: optional: 1 disallow depletion, 0 allow depletion.

Conditionals

when

when
    When (Conditional operator)
    Performs specified actions when a condition becomes true

    Takes 2 or more arguments...
    1: Boolean expression that must be true for actions to take place.
    Rest: Actions to take when boolean expression becomes true.

Debugging

error

Ai goals

ai-chase

ai-chase
    Ai-chase (Ship goal)
    Causes the specified ship to chase and attack the specified target.

    Takes 2 arguments...
    1: Name of ship to chase.
    2: Goal priority (number between 0 and 89).

ai-dock

ai-dock
    Ai-dock (Ship goal)
    Causes one ship to dock with another ship.

    Takes 4 arguments...
    1: Name of dockee ship (The ship that "docker" will dock with).
    2: Docker's docking point - Which dock point docker uses to dock.
    3: Dockee's docking point - Which dock point on dockee docker will move to.
    4: Goal priority (number between 0 and 89).

ai-undock

ai-undock
    Ai-undock (Ship goal)
    Causes the specified ship to undock from who it is currently docked with.

    Takes 1 or 2 arguments...
    1: Goal priority (number between 0 and 89).
    2 (optional): Ship to undock from. If none is specified, the code will pick the first docked ship.

ai-warp-out

ai-warp-out
    Ai-warp-out (Ship/Wing Goal)
    Causes the specified ship/wing to warp out of the mission. Currently, the ship will warp out at its current location.
    This behavior will change. Currently, the first argument means nothing.

    Takes 2 arguments...
    1: Name of waypoint path to follow to warp out (not used).
    2: Goal priority (number between 0 and 89).

ai-waypoints

ai-waypoints
    Ai-waypoints (Ship goal)
    Causes the specified ship to fly a waypoint path continuously.

    Takes 2 arguments...
    1: Name of waypoint path to fly.
    2: Goal priority (number between 0 and 89).

ai-waypoints-once

ai-waypoints-once
    Ai-waypoints once (Ship goal)
    Causes the specified ship to fly a waypoint path.

    Takes 2 arguments...
    1: Name of waypoint path to fly.
    2: Goal priority (number between 0 and 89).

ai-destroy-subsystem

ai-destroy-subsystem
    Ai-destroy subsys (Ship goal)
    Causes the specified ship to attack and try and destroy the specified subsystem on the specified ship.

    Takes 3 arguments...
    1: Name of ship subsystem is on.
    2: Name of subsystem on the ship to attack and destroy.
    3: Goal priority (number between 0 and 89).

ai-disable-ship

ai-disable-ship
    Ai-disable-ship (Ship/wing goal)
    This AI goal causes a ship/wing to destroy all of the engine subsystems on the specified ship.
    This goal is different than ai-destroy-subsystem since a ship may have multiple engine subsystems requiring
    the use of > 1 ai-destroy-subsystem goals.

    Takes 2 arguments...
    1: Name of ship whose engine subsystems should be destroyed
    2: Goal priority (number between 0 and 89).

ai-disarm-ship

ai-disarm-ship
    Ai-disarm-ship (Ship/wing goal)
    This AI goal causes a ship/wing to destroy all of the turret subsystems on the specified ship.
    This goal is different than ai-destroy-subsystem since a ship may have multiple turret subsystems requiring
    the use of > 1 ai-destroy-subsystem goals.

    Takes 2 arguments...
    1: Name of ship whose turret subsystems should be destroyed
    2: Goal priority (number between 0 and 89).

ai-guard

ai-guard
    Ai-guard (Ship goal)
    Causes the specified ship to guard a ship from other ships not on the same team.

    Takes 2 arguments...
    1: Name of ship to guard.
    2: Goal priority (number between 0 and 89).

ai-chase-any

ai-chase-any
    Ai-chase-any (Ship goal)
    Causes the specified ship to chase and attack any ship on the opposite team.

    Takes 1 argument...
    1: Goal priority (number between 0 and 89).

ai-evade-ship

ai-evade-ship
    Ai-evade ship (Ship goal)
    Causes the specified ship to go into evade mode and run away like the weak sally-boy it is.

    Takes 2 arguments...
    1: Name of ship to evade from.
    2: Goal priority (number between 0 and 89).

ai-stay-near-ship

ai-stay-near-ship
    Ai-stay near ship (Ship goal)
    Causes the specified ship to keep itself near the given ship and not stray too far away from it.

    Takes 2 arguments...
    1: Name of ship to stay near.
    2: Goal priority (number between 0 and 89).

ai-keep-safe-distance

ai-keep-safe-distance
    Ai-keep safe distance (Ship goal)
    Tells the specified ship to stay a safe distance away from any ship that isn't on the same team as it.

    Takes 1 argument...
    1: Goal priority (number between 0 and 89).

ai-ignore

ai-ignore
    Ai-ignore (Ship goal)
    Tells all ships to ignore the given ship and not consider it as a valid target to attack.

    Takes 2 arguments...
    1: Name of ship to ignore.
    2: Goal priority (number between 0 and 89).

ai-stay-still

ai-stay-still
    Ai-stay still (Ship goal)
    Causes the specified ship to stay still. The ship will do nothing until attacked at which time the ship will
    come to life and defend itself.

    Takes 2 arguments...
    1: Ship or waypoint the ship staying still will directly face (currently not implemented)
    2: Goal priority (number between 0 and 89).

ai-play-dead

ai-play-dead
    Ai-play dead (Ship goal)
    Causes the specified ship to pretend that it is dead and not do anything. This expression should be used to indicate
    that a ship has no pilot and cannot respond to any enemy threats. A ship playing dead will not respond to any attack.
    This should really be named ai-is-dead

    Takes 1 argument...
    1: Goal priority (number between 0 and 89).

Event/Goals

is-goal-incomplete

is-goal-incomplete
    Mission Goal Incomplete (Boolean operator)
    Returns true if the specified goal in the this mission is incomplete. This sexpression will only be useful
    in conjunction with another sexpression likehas-time-elapsed. Used alone, it will return true upon misison startup.
    Returns a boolean value. Takes 1 argument...
    1: Name of the event in the mission.

is-goal-true-delay

is-goal-true-delay
    Mission Goal True (Boolean operator)
    Returns true N seconds after the specified goal in the this mission is true (or succeeded). It returns false otherwise.

    Returns a boolean value. Takes 2 required arguments and 1 optional argument...
    1: Name of the event in the mission.
    2: Number of seconds to delay before returning true.

is-goal-false-delay

is-goal-false-delay
    Mission Goal False (Boolean operator)
    Returns true N seconds after the specified goal in the this mission is false (or failed). It returns false otherwise.

    Returns a boolean value. Takes 2 required arguments and 1 optional argument...
    1: Name of the event in the mission.
    2: Number of seconds to delay before returning true.

is-event-incomplete

is-event-incomplete
    Mission Event Incomplete (Boolean operator)
    Returns true if the specified event in the this mission is incomplete. This sexpression will only be useful
    in conjunction with another sexpression likehas-time-elapsed. Used alone, it will return true upon misison startup.
    Returns a boolean value. Takes 1 argument...
    1: Name of the event in the mission.

is-event-true-delay

is-event-true-delay
    Mission Event True (Boolean operator)
    Returns true N seconds after the specified event in the this mission is true (or succeeded). It returns false otherwise.

    Returns a boolean value. Takes 2 required arguments and 1 optional argument...
    1: Name of the event in the mission.
    2: Number of seconds to delay before returning true.
    3: (Optional) True/False which signifies this is a current event, whether true, false, or unknown, for use as a directive.

is-event-false-delay

is-event-false-delay
    Mission Event False (Boolean operator)
    Returns true N seconds after the specified event in the this mission is false (or failed). It returns false otherwise.

    Returns a boolean value. Takes 2 required arguments and 1 optional argument...
    1: Name of the event in the mission.
    2: Number of seconds to delay before returning true.
    3: (Optional) True/False which signifies this is a current event, whether true, false, or unknown, for use as a directive.

is-previous-goal-true

is-previous-goal-true
    Previous Mission Goal True (Boolean operator)
    Returns true if the specified goal in the specified mission is true (or succeeded). It returns false otherwise.

    Returns a boolean value. Takes 2 required arguments and 1 optional argument...
    1: Name of the mission.
    2: Name of the goal in the mission.
    3: (Optional) True/False which signifies what this sexpession should return when this mission is played as a single mission.

is-previous-goal-false

is-previous-goal-false
    Previous Mission Goal False (Boolean operator)
    Returns true if the specified goal in the specified mission is false (or failed). It returns false otherwise.

    Returns a boolean value. Takes 2 required arguments and 1 optional argument...
    1: Name of the mission.
    2: Name of the goal in the mission.
    3: (Optional) True/False which signifies what this sexpession should return when this mission is played as a single mission.

is-previous-event-true

is-previous-event-true
    Previous Mission Event True (Boolean operator)
    Returns true if the specified event in the specified mission is true (or succeeded). It returns false otherwise.

    Returns a boolean value. Takes 2 required arguments and 1 optional argument...
    1: Name of the mission.
    2: Name of the event in the mission.
    3: (Optional) True/False which signifies what this sexpession should return when this mission is played as a single mission.

is-previous-event-false

is-previous-event-false
    Previous Mission Event False (Boolean operator)
    Returns true if the specified event in the specified mission is false (or failed). It returns false otherwise.

    Returns a boolean value. Takes 2 required arguments and 1 optional argument...
    1: Name of the mission.
    2: Name of the event in the mission.
    3: (Optional) True/False which signifies what this sexpession should return when this mission is played as a single mission.

Training

key-pressed

key-pressed
    Key-pressed (Boolean training operator)
    Becomes true when the specified default key has been pressed. Default key refers to the what the key normally
    is when not remapped. FreeSpace will automatically account for any keys that have been remapped.
    If the optional delay is specified, becomes true that many seconds after the key has been pressed.

    Returns a boolean value. Takes 1 or 2 arguments...
    1: Default key to check for.
    2: Delay before operator registers as true (optional). 

key-reset

key-reset
    Key-reset (Training operator)
    Marks the specified default key as having not been pressed, so key-pressed will be false until the player presses it again.
    See key-pressed help for more information about what a default key is.

    Note that this sexp will not work properly in repeating events. Use key-reset-multiple if this is to be called
    multiple times in one event.

    Returns a boolean value. Takes 1 or more arguments...
    All: Default key to reset.

targeted

targeted
    Targeted (Boolean training operator)
    Is true as long as the player has the specified ship (or ship's subsystem) targeted, or has been targeted for the
    specified amount of time.

    Returns a boolean value. Takes 1 to 3 arguments (first required, rest optional):
    1: Name of ship to check if targeted by player.
    2: Length of time target should have been kept for (optional).
    3: Name of subsystem on ship to check if targeted (optional).

speed

speed
    Speed (Boolean training operator)
    Becomes true when the player has been within the specified speed range set by set-training-context-speed for the
    specified amount of time.

    Returns a boolean value. Takes 1 argument...
    1: Time in seconds.

facing

facing
    Facing (Boolean training operator)
    Is true as long as the specified ship is within the player's specified forward cone. A forward cone is defined as
    any point that the angle between the vector of the point and the player, and the forward facing vector is within
    the given angle.

    Returns a boolean value. Takes 2 argument...
    1: Ship to check is withing forward cone.
    2: Angle in degrees of the forward cone.

facing-waypoint

facing-waypoint
    Facing Waypoint(Boolean training operator)
    Is true as long as the specified first waypoint is within the player's specified forward cone.
    A forward cone is defined as any point that the angle between the vector of the point and the player,
    and the forward facing vector is within the given angle.

    Returns a boolean value. Takes 2 argument...
    1: Name of waypoint path whose first point is withing forward cone.
    2: Angle in degrees of the forward cone.

order

order
    Order (Boolean training operator)
    Becomes true when the player had given the specified ship or wing the specified order.

    Returns a boolean value. Takes 2 or 3 arguments...
    1: Name of ship or wing to check if given order to.
    2: Name of order to check if player has given.
    3: Name of the target of the order (optional).

waypoint-missed

waypoint-missed
    Waypoint-missed (Boolean training operator)
    Becomes true when a waypoint is flown, but the waypoint is ahead of the one they are supposed to be flying.
    The one they are supposed to be flying is the next one in sequence in the path after the last one they have hit.

    Returns a boolean value. Takes no arguments.

waypoint-twice

waypoint-twice
    Waypoint-twice (Boolean training operator)
    Becomes true when a waypoint is hit that is before the last one hit, which indicates they have flown a waypoint twice.

    Returns a boolean value. Takes no arguments.

path-flown

path-flown
    Path-flown (Boolean training operator)
    Becomes true when all the waypoints in the path have been flown, in sequence.

    Returns a boolean value. Takes no arguments.

training-msg

training-msg
    Training-msg (Action training operator)
    Sends the player a training message. Uses the same messages as normal messages, only they get displayed differently
    using this operator. If a secondary message is specified, it is sent the last time, while the primary message is
    sent all other times (event should have a repeat count greater than 1).

    Takes 1-3 arguments...
    1: Name of primary message to send.
    2: Name of secondary message to send (optional).
    3: Delay (in seconds) to wait before sending message. (optional)
    4: Amount of Time (in seconds) to display message (optional).

flash-hud-gauge

flash-hud-gauge
    Ai-flash hud gauge (Training goal)
    Causes the specified hud gauge to flash to draw the player's attention to it.

    Takes 1 argument...
    1: Name of hud gauge to flash.

special-check

special-check
    Special-check
    Mike K.'s special training sexp. Returns a boolean value. Takes 1 argument as follows:
    0: Ship "Freighter 1" is aspect locked by the player
    1: Player has fired Interceptor#Weak at Freighter 1
    2: Ship "Freighter 1", subsystem "Weapons" is aspect locked by the player
    3: Apply 10 points of damage to player's forward shields (action operator)
    4: Player's front shields are nearly gone
    5: Quickly recharge player's front shields (action operator)
    6: Reduce all shield quadrants except front to 0 (action operator)
    7: Front shield quadrant is near maximum strength
    8: Rear shield quadrant is near maximum strength
    9: Reduce left and right shield quadrants to 0 (action operator)
    10: Player has fewer than 8 missiles left
    11: Player has 8 or more missiles left
    12: Player has fewer than 4 missiles left
    13: Reduce front shield quadrant to 0 (action operator)
    100: Player is out of countermeasures
    2000: Training failed

secondaries-depleted

secondaries-depleted
    secondaries-depleted
    Returns true if ship is out of secondary weapons
    1: Ship name 

set-training-context-fly-path

set-training-context-fly-path
    Set-training-context-fly-path (Training context operator)
    Tells FreeSpace that the player is expected to fly a waypoint path. This must be executed before waypoint-missed,
    waypoint-twice and path-flown operators become valid.

    Takes 2 arguments...
    1: Name of waypoint path player should fly.
    2: Distance away a player needs to be from a waypoint for it to be registered as flown.

set-training-context-speed

set-training-context-speed
    Set-training-context-speed (Training context operator)
    Tells FreeSpace that the player is expected to fly within a certain speed range. Once this operator has been executed,
    you can measure how long they have been within this speed range with the speed operator.

    Takes 2 arguments...
    1: Minimum speed of range player is to fly between.
    2: Maximum speed of range player is to fly between.