Difference between revisions of "SCP SEXPs"

From FreeSpace Wiki
Jump to: navigation, search
(All SCP sexps added. (whew))
m
Line 247: Line 247:
 
     Evaluates scriptTakes at least 1 argument...
 
     Evaluates scriptTakes at least 1 argument...
 
     1: Script to evaluate  
 
     1: Script to evaluate  
===Messaging and Mission Goals===
+
==Messaging and Mission Goals==
 
===[[disable-builtin-messages]]===
 
===[[disable-builtin-messages]]===
 
  Disable builtin messages (Action operator)
 
  Disable builtin messages (Action operator)

Revision as of 02:59, 3 August 2007

This page is a reference of SEXPs that are only available in the SCP version of FRED. This also includes any retail SEXPs that have been modified from their original behaviour. To see the list of SEXPs that are available in retail FRED, go to the Retail 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

percent-ships-disabled

percent-ships-disabled
    percent-ships-disabled
    Boolean function which returns true if the percentage of ships in the listed ships which have been disabled is greater or
    equal to the given percentage.

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

percent-ships-disarmed

percent-ships-disarmed
    percent-ships-disarmed
    Boolean function which returns true if the percentage of ships in the listed ships which have been disarmed is greater or
    equal to the given percentage.

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

Time

None

Logical

string-equals

string-equals
    String Equals (Boolean operator)
    Is true if all of its arguments are equal.

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

string-greater-than

string-greater-than
    String Greater Than (Boolean operator)
    True if the first argument is greater than the second argument.

    Returns a boolean value. Takes 2 string arguments.

string-less-than

string-less-than
    String Less Than (Boolean operator)
    True if the first argument is less than the second argument.

    Returns a boolean value. Takes 2 string arguments.

Arithmetic

rand-multiple

rand-multiple 
    Rand-multiple (Arithmetic operator) 
    Gets a random number. This number can and will change between 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)

abs

abs 
    Absolute value (Arithmetic operator) 
    Returns the absolute value of a number. Takes 1 numeric argument.

min

min 
    Minimum value (Arithmetic operator) 
    Returns the minimum of a set of numbers. Takes 1 or more numeric arguments.

max

max
    Maximum value (Arithmetic operator)
    Returns the maximum of a set of numbers. Takes 1 or more numeric arguments. 

avg

avg
    Average value (Arithmetic operator)
    Returns the average (rounded to the nearest integer) of a set of numbers. Takes 1 or more numeric arguments. 

Status

is-cargo

is-cargo
    Is Cargo (Status operator)
    Checks whether the specified ship or ship subsystem contains a particular cargo.
    Takes 2 or 3 arguments...
    1: Name of the cargo
    2: Name of the ship
    3: Name of the ship subsystem (optional)

is-ship-stealthy

is-ship-stealthy
    is-ship-stealthy
    Check whether ship is currently stealthy.
    True if stealth flag set, false otherwise. Takes 1 argument...
    1: Name of ship to check 

is-friendly-stealth-visible

is-friendly-stealth-visible
    is-friendly-stealth-visible
    Check whether ship will be visible to radar as a stealth friendly.
    Takes 1 argument...
    1: Name of ship to check 

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.

is-ai-class

is-ai-class
    Is AI Class (Boolean operator)
    True if ship or ship subsystem(s) is/are all of the specified AI class.

    Returns a boolean value. Takes 2 or more arguments...
    1: AI class ("None", "Coward", "Lieutenant", etc.)
    2: Name of ship to check.
    Rest: Name of ship subsystem(s) to check (optional)

is-ship-type

is-ship-type
    Is Ship Type (Boolean operator)
    True if ship or ships is/are all of the specified ship type.

    Returns a boolean value. Takes 2 or more arguments...
    1: Ship type ("fighter", "bomber", etc.)
    2: Name of ship to check. 

is-ship-class

is-ship-class
    Is Ship Class (Boolean operator)
    True if ship or ships is/are all of the specified ship class.

    Returns a boolean value. Takes 2 or more arguments...
    1: Ship class
    2: Name of ship to check. 

primary-ammo-pct

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

get-primary-ammo

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

get-secondary-ammo

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

distance-ship-subsystem

distance-ship-subsystem
    Distance from ship subsystem (Status operator)
    Returns the distance between an object and a ship subsystem. The object can be either a ship, a wing, or a waypoint.

    Returns a numeric value. Takes 3 arguments...
    1: The name of the object.
    2: The name of the ship which houses the subsystem.
    3: The name of the subsystem.

num-within-box

num-within-box
    Number of specified objects in the box specified
    1: Box center (X)
    2: Box center (Y)
    3: Box center (Z)
    4: Box width
    5: Box height
    6: Box depth
    Rest: Ships or wings to check

get-object-x

get-object-x
    get-object-x
    Returns the absolute X coordinate of a set of coordinates relative to a particular object (or object's subsystem). The input  
    coordinates are the coordinates relative to the object's position and orientation. If no input coordinates are specified,
    the coordinate returned is the coordinate of the object (or object's subsystem) itself. Takes 1 to 5 arguments...
    1: The name of a ship, wing, or waypoint.
    2: A ship subsystem (or "" if the first argument is not a ship - optional).
    3: The relative X coordinate (optional).
    4: The relative Y coordinate (optional).
    5: The relative Z coordinate (optional).

get-object-y

get-object-y
    get-object-y
    Returns the absolute Y coordinate of a set of coordinates relative to a particular object (or object's subsystem). The input
    coordinates are the coordinates relative to the object's position and orientation. If no input coordinates are specified,
    the coordinate returned is the coordinate of the object (or object's subsystem) itself. Takes 1 to 5 arguments...
    1: The name of a ship, wing, or waypoint.
    2: A ship subsystem (or "" if the first argument is not a ship - optional).
    3: The relative X coordinate (optional).
    4: The relative Y coordinate (optional).
    5: The relative Z coordinate (optional).

get-object-z

get-object-z
    get-object-z
    Returns the absolute Z coordinate of a set of coordinates relative to a particular object (or object's subsystem). The input
    coordinates are the coordinates relative to the object's position and orientation. If no input coordinates are specified,
    the coordinate returned is the coordinate of the object (or object's subsystem) itself. Takes 1 to 5 arguments...
    1: The name of a ship, wing, or waypoint.
    2: A ship subsystem (or "" if the first argument is not a ship - optional).
    3: The relative X coordinate (optional).
    4: The relative Y coordinate (optional).
    5: The relative Z coordinate (optional). 

was-promotion-granted

was-promotion-granted
    Was promotion granted (Boolean operator)
    Returns true if a promotion was granted via the 'Grant promotion' operator in the mission.

    Returns a boolean value. Takes no arguments.

was-medal-granted

was-medal-granted
    Was medal granted (Boolean operator)
    Returns true if a medal was granted via via the 'Grant medal' operator in the mission. If you provide the optional
    argument to this operator, then true is only returned if the specified medal was granted.

    Returns a boolean value. Takes 0 or 1 arguments...
    1: Name of medal to specifically check for (optional).

num-ships-in-battle

num-ships-in-battle
    num-ships-in-battle
    Returns the number of ships in battle or the number of ships in battle for a given team. Takes 1 argument...
    1: Team to query (optional)

num-ships-in-wing

num-ships-in-wing
    num-ships-in-wing
    Returns the number of ships in battle which belong to a given wing. Takes 1 or more arguments...
    1: Name of ship (or wing) to check

current-speed

current-speed
    current-speed
    Returns the speed of the given object. Takes 1 argument...
    1: HUD gauge to be modified

is-nav-visited

is-nav-visited
    Takes 1 argument: The Nav Point Name
    Returns whether that nav point has been visited (player within 1000 meters)

distance-to-nav

distance-to-nav
    Takes 1 argument: The Nav point Name
    Returns the distance from the player ship to that nav point

script-eval-num

script-eval-num
    script-eval-num
    Evaluates script to return a number
    Takes 1 argument...
    1: Script 

script-eval-string

script-eval-string
    script-eval-string
    Evaluates script to return a string
    Takes 1 argument...
    1: Script 

num-assists

Change

script-eval

script-eval
    script-eval
    Evaluates scriptTakes at least 1 argument...
    1: Script to evaluate 

Messaging and Mission Goals

disable-builtin-messages

Disable builtin messages (Action operator)
        Turns the built in messages sent by command or pilots off
Takes 0 or more arguments....
If no arguments are supplied all built in messages are disabled
        All:    Name of ship to allow to talk.

enable-builtin-messages

Enable builtin messages (Action operator)
        Turns the built in messages sent by command or pilots on
Takes 0 or more arguments...
If no arguments are supplied any ships not given individual silence orders will be able
to send buiilt in messages. Command will also be unsilenced
        All:    Name of ship to allow to talk.

AI and IFF

remove-goal

remove-goal
    Remove goal (Action operator)
    Removes a goal from a ship or wing.

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

change-ai-class

change-ai-class
    Change AI Class (Action operator)
    Sets the specified ship or ship subsystem(s) to the specified ai class.
    Takes 2 or more arguments...
    1: AI Class to change to ("None", "Coward", "Lieutenant", etc.)
    2: Name of ship to change AI class of
    Rest: Name of subsystem to change AI class of (optional)

kamikaze

kamikaze
    kamikaze
    Tells ships to perform a kamikaze on its current target. Takes 2 or more arguments...
    1: Damage dealt when kamikaze is done
    Rest: Names of ships to perform kamikaze 

not-kamikaze

not-kamikaze
    not-kamikaze
    Tells ships abort a kamikaze run Takes 1 or more arguments....
    All: Names of ships to abort kamikaze 

player-use-ai

player-use-ai
    player-use-ai
    Causes the player's ship to be controlled by the FreeSpace AI. Takes 0 arguments. 

player-not-use-ai

player-not-use-ai
    player-not-use-ai
    Causes the player's ship to not be controlled by the FreeSpace AI. Takes 0 arguments. 

Subsystems and Cargo

set-cargo

set-cargo
    Set Cargo (Action operator)
    Sets the cargo on a ship or ship subsystem. The cargo-no-deplete flag status is carried through to the new cargo.
    Takes 2 or 3 arguments...
    1: Name of the cargo
    2: Name of the ship
    3: Name of the ship subsystem (optional)

set-scanned

set-scanned
    set-scanned
    Sets the cargo on the specified ship or ship subsystem as known or scanned. Takes 1 or more arguments...
    1: Name of a ship
    Rest: Name of a subsystem on that ship (optional) 

set-unscanned

set-unscanned
    set-unscanned
    Sets the cargo on the specified ship or ship subsystem as unknown or unscanned. Takes 1 or more arguments...
    1: Name of a ship
    Rest: Name of a subsystem on that ship (optional) 

lock-rotating-subsystem

lock-rotating-subsystem
    lock-rotating-subsystem
    Instantaneously locks a rotating subsystem so that it cannot rotate unless freed by free-rotating-subsystem.
    Takes 2 or more arguments...
    1: Name of the ship housing the subsystem
    Rest: Name of the rotating subsystem to lock

free-rotating-subsystem

free-rotating-subsystem
    free-rotating-subsystem
    Instantaneously frees a rotating subsystem previously locked by lock-rotating-subsystem. Takes 2 or more arguments...
    1: Name of the ship housing the subsystem
    Rest: Name of the rotating subsystem to free

reverse-rotating-subsystem

reverse-rotating-subsystem
    reverse-rotating-subsystem
    Instantaneously reverses the rotation direction of a rotating subsystem. Takes 2 or more arguments...
    1: Name of the ship housing the subsystem
    Rest: Name of the rotating subsystem to reverse

rotating-subsys-set-turn-time

rotating-subsys-set-turn-time
    rotating-subsys-set-turn-time
    Sets the turn time of a rotating subsystem. Takes 3 or 4 arguments...
    1: Name of the ship housing the subsystem
    2: Name of the rotating subsystem to configure
    3: The time for one complete rotation, in milliseconds (positive is counterclockwise, negative is clockwise)
    4: The acceleration (x1000, just as #3 is seconds x1000) to change from the current turn rate to the desired turn rate.
    Not sure of the units on this one. (FS2 defaults to 0.5, which would be 500 in this sexp.)
    Omit this argument if you want an instantaneous change.

set-primary-ammo

set-primary-ammo
    set-primary-ammo
    Sets the amount of ammo for the specified ballistic bank
    1: Ship name
    2: Bank to check (0, 1, and 2 are legal banks)
    3: Number to set this bank to (If this is larger than the maximimum, bank will be set to maximum).
    4: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximimum,
    bank will be set to maximum)

set-secondary-ammo

set-secondary-ammo
    set-secondary-ammo
    Sets the amount of ammo for the specified bank
    1: Ship name
    2: Bank to check (0, 1, 2 and 3 are legal banks)
    3: Number to set this bank to (If this is larger than the maximimum, bank will be set to maximum).
    4: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximimum,
    bank will be set to maximum)

set-primary-weapon

set-primary-weapon
    set-primary-weapon
    Sets the weapon for the specified bank
    1: Ship name
    2: Bank to check (0, 1 and 2 are legal banks)
    3: Name of the primary weapon
    4: Number to set this bank to (If this is larger than the maximimum, bank will be set to maximum)
    5: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximimum,
    bank will be set to maximum)

set-secondary-weapon

set-secondary-weapon
    set-secondary-weapon
    Sets the weapon for the specified bank
    1: Ship name
    2: Bank to check (0, 1, 2 and 3 are legal banks)
    3: Name of the secondary weapon
    4: Number to set this bank to (If this is larger than the maximimum, bank will be set to maximum)
    5: Rearm Limit. Support ships will only supply this number of weapons (If this is larger than the maximimum,
    bank will be set to maximum)

lock-primary-weapon

lock-primary-weapon
    lock-primary-weapon
    Locks the primary banks for the specified ship(s)
    Takes 1 or more arguments
    (all): Name(s) of ship(s) to lock

unlock-primary-weapon

unlock-primary-weapon
    unlock-primary-weapon
    Unlocks the primary banks for the specified ship(s)
    Takes 1 or more arguments
    (all): Name(s) of ship(s) to lock

Ship Status

ship-guardian-threshold

ship-guardian-threshold
    ship-guardian-threshold
    Same as ship-guardian, except the lowest possible hull value is specified by the sexp rather than defaulting to 1.
    Call with a threshold of 0 (or use ship-no-guardian) to deactivate.

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

ship-subsys-guardian-threshold

ship-subsys-guardian-threshold
    ship-subsys-guardian-threshold
    Same as ship-guardian-threshold, but works on subsystems.
    Call with a threshold of 0 to deactivate.

    Takes 3 or more arguments...
    1: Threshold value.
    2: Ship housing the subsystem(s).
    3+: Subsystems to make unkillable.

ship-stealthy

ship-stealthy
    ship-stealthy
    Causes the ships listed in this sexpression to become stealth ships (i.e. invisible to radar).

    Takes 1 or more arguments...
    All: Name of ships to make stealthy.

ship-unstealthy

ship-unstealthy
    ship-unstealthy
    Causes the ships listed in this sexpression to become non-stealth ships (i.e. visible to radar).

    Takes 1 or more arguments...
    All: Name of ships to make non-stealthy.

friendly-stealth-invisible

friendly-stealth-invisible
    friendly-stealth-invisible
    Causes the friendly ships listed in this sexpression to be invisible to radar, just like hostile stealth ships.
    It doesn't matter if the ship is friendly at the time this sexp executes: as long as it is a stealth ship,
    it will be invisible to radar both as hostile and as friendly.

    Takes 1 or more arguments...
    All: Name of ships

friendly-stealth-visible

friendly-stealth-visible
    friendly-stealth-visible
    Causes the friendly ships listed in this sexpression to resume their normal behavior of being visible to radar
    as stealth friendlies. Does not affect their visibility as stealth hostiles.

    Takes 1 or more arguments...
    All: Name of ships

ship-targetable-as-bomb

ship-targetable-as-bomb
    ship-targetable-as-bomb
    Causes the ships listed in this sexpression to be targetable with bomb targetting key.

    Takes 1 or more arguments...
    1+: Name of ships to make targetable with bomb targeting key.

ship-untargetable-as-bomb

ship-untargetable-as-bomb
    ship-untargetable-as-bomb
    Causes the ships listed in this sexpression to not be targetable with bomb targetting key.

    Takes 1 or more arguments...
    1+: Name of ships to make nontargetable with bomb targeting key.

ship-subsys-targetable

ship-subsys-targetable
    ship-subsys-targetable
    Causes the specified ship subsystem(s) to be targetable on radar.
    Takes 2 or more arguments...
    1: Name of a ship
    Rest: Name of the ship's subsystem(s)

ship-subsys-untargetable

ship-subsys-untargetable
    ship-subsys-untargetable
    Causes the specified ship subsystem(s) to not be targetable on radar.
    Takes 2 or more arguments...
    1: Name of a ship
    Rest: Name of the ship's subsystem(s)

Beams and Turrets

turret-tagged-specific

turret-tagged-specific
    turret-tagged-specific
    Specific turrets on a ship only fire at tagged targets, as opposed to all turrets doing this using turret-tagged-only
    It is safe to slave turrets already slaved
    Takes 2 or more arguments...
    1: Name of ship to slave some turrets to target only tagged ships
    Rest: Turrets to slave 

turret-tagged-clear-specific

turret-tagged-clear-specific
    turret-tagged-clear-specific
    Specific turrets on a ship are free to fire on untagged ships, as opposed to all turrets doing this using turret-tagged-clear
    It is safe to unslave turrets already free
    Takes 2 or more arguments...
    1: Name of ship to unslave some turrets to target any hostile ship
    Rest: Turrets to unslave 

turret-change-weapon

turret-change-weapon
    turret-change-weapon
    Sets a given turret weapon slot to the specified weapon
    1: Ship turret is on
    2: Turret
    3: Weapon to set slot to
    4: Primary slot (or 0 to use secondary)
    5: Secondary slot (or 0 to use primary)

turret-set-target-order

turret-set-target-order
    turret-set-target-order
    Sets targeting order of a given turret
    1: Ship turret is on
    2: Turret
    rest: Target order type (Bombs,ships,asteroids)

ship-turret-target-order

ship-turret-target-order
    ship-turret-target-order
    Sets targeting order of all turrets on a given ship
    1: Ship turrets are on
    rest: Target order type (Bombs,ships,asteroids)

Mission and Campaign

end-mission

end-mission
    end-mission
    Ends the mission as if the player had engaged his subspace drive, but without him doing so. Dumps the player back into
    a normal debriefing. Does not invoke red-alert status.
    Takes no arguments.

force-jump

force-jump
    force-jump
    Forces activation of the player's subspace drive, thus ending the mission. Takes no arguments.

grant-promotion

grant-promotion
    Grant promotion (Action operator)
    In a single player game, this function grants a player an automatic promotion to the next rank which the player can obtain.
    If he is already at the highest rank, this operator has no effect. It takes no arguments.

grant-medal

grant-medal
    Grant medal (Action operator)
    In single player missions, this function grants the given medal to the player. Currently, only 1 medal will be
    allowed to be given per mission.

    Takes 1 argument...
    1: Name of medal to grant to player.

tech-add-ships

tech-add-ships
    Tech add ship (Action operator)
    This operator makes the given ship type available in the techroom database. Players will then be able to view this
    ship's specs there.

    Takes 1 or more arguments...
    All: Name of ship type (or ship class) to add.

tech-add-weapons

tech-add-weapons
    Tech add weapon (Action operator)
    This operator makes the given weapon available in the techroom database. Players will then be able to view this
    weapon's specs there.

    Takes 1 or more arguments...
    All: Name of weapon (primary or secondary) to add.

tech-add-intel

tech-add-intel
    Tech add intel (Action operator)
    This operator makes the given intel entry available in the techroom database. Players will then be able to view this
    intel entry there.

    Takes 1 or more arguments...
    All: Name of intel entry to add.

tech-reset-to-default

tech-reset-to-default
    Tech reset to default (Action operator)
    This operator resets the tech room to the default represented in the tables. This is useful for starting new campaigns,
    so that the player will not see tech entries carried over from previous campaigns.

    Takes no arguments.

Models and Textures

don't-collide-invisible

don't-collide-invisible
    don't-collide-invisible
    Sets the "dont collide invisible" flag on a list of ships. Takes 1 or more arguments... All: List of ships on which
    to set the "dont collide invisible" flag

collide-invisible

collide-invisible
    collide-invisible
    Unsets the "dont collide invisible" flag on a list of ships. Takes 1 or more arguments... All: List of ships on which
    to unset the "dont collide invisible" flag

change-ship-model

change-ship-class

change-ship-class
    change-ship-class
    Causes the listed ships' classes to be changed to the specified ship class. Takes 2 or more arguments...
    1: The name of the new ship class
    Rest: The list of ships to change the classes of

deactivate-glow-points

deactivate-glow-points
    deactivate-glow-points
    Deactivates all glow points on a ship. Takes 1 or more arguments...
    All: Name of ship on which to deactivate glow points 

activate-glow-points

activate-glow-points
    activate-glow-points
    Activates all glow points on a ship. Takes 1 or more arguments...
    All: Name of ship on which to activate glow points 

deactivate-glow-maps

deactivate-glow-maps
    deactivate-glow-maps
    Deactivates the glow maps for a ship. Takes 1 or more arguments...
    All: Name of ship on which to deactivate glow maps 

activate-glow-maps

activate-glow-maps
    activate-glow-maps
    Activates the glow maps for a ship. Takes 1 or more arguments...
    All: Name of ship on which to activate glow maps 

deactivate-glow-point-bank

deactivate-glow-point-bank
    deactivate-glow-point-bank
    Deactivates one or more glow point bank(s) on a ship. Takes 2 or more arguments...
    1: Name of ship on which to deactivate glow point bank(s)
    Rest: Name of glow point bank to deactivate 

activate-glow-point-bank

activate-glow-point-bank
    activate-glow-point-bank
    Activates one or more glow point bank(s) on a ship. Takes 2 or more arguments...
    1: Name of ship on which to activate glow point bank(s)
    Rest: Name of glow point bank to activate 

Coordinate Manipulation

set-object-speed-x

set-object-speed-x
    set-object-speed-x
    Sets the X speed of a ship, wing, or waypoint.Takes 2 or 3 arguments...
    1: The name of the object.
    2: The speed to set.
    3: Whether the speed should be set subjectively; i.e. from the object's point of view (optional; defaults to false). 

set-object-speed-y

set-object-speed-y
    set-object-speed-y
    Sets the Y speed of a ship, wing, or waypoint.Takes 2 or 3 arguments...
    1: The name of the object.
    2: The speed to set.
    3: Whether the speed should be set subjectively; i.e. from the object's point of view (optional; defaults to false). 

set-object-speed-z

set-object-speed-z
    set-object-speed-z
    Sets the Z speed of a ship, wing, or waypoint.Takes 2 or 3 arguments...
    1: The name of the object.
    2: The speed to set.
    3: Whether the speed should be set subjectively; i.e. from the object's point of view (optional; defaults to false). 

set-object-position

set-object-position
    set-object-position
    Instantaneously sets an object's spatial coordinates.Takes 4 arguments...
    1: The name of an object.
    2: The new X coordinate.
    3: The new Y coordinate.
    4: The new Z coordinate.

set-object-facing

set-object-facing
    set-object-facing
    Sets an object's orientation to face the specified coordinates. Takes 4 arguments...
    1: The name of an object.
    2: The X coordinate to face.
    3: The Y coordinate to face.
    4: The Z coordinate to face.
    5: Turn time (optional)
    6: Bank (optional)

set-object-facing-object

set-object-facing-object
    set-object-facing-object
    Sets an object's orientation to face the specified object. Takes 2 arguments...
    1: The name of an object.
    2: The object to face.
    3: Turn time (optional)
    4: Bank (optional)

Music and Sound

change-soundtrack

change-soundtrack
    change-soundtrack
    Changes the mission music. Takes 1 argument...
    �: Name of the music selection (taken from music.tbl)

play-sound-from-table

play-sound-from-table
    play-sound-from-table
    Plays a sound listed in the Game Sounds section of sounds.tbl. Takes 4 arguments...
    1: Origin X
    2: Origin Y
    3: Origin Z
    4: Sound (index into sounds.tbl)

play-sound-from-file

play-sound-from-file
    play-sound-from-file
    Plays a sound, such as a music soundtrack, from a file. Important: Only one sound at a time can be played with this sexp!
    Takes 1 or 2 arguments...
    1: Sound (file name)
    2: Enter a non-zero number to loop. default is off (optional).

close-sound-from-file

close-sound-from-file
    close-sound-from-file
    Closes the currently playing sound started by play-sound-from-file, if there is any. Takes 1 argument...
    1: Fade (default is true)

Hud

hud-disable

hud-disable
    hud-disable
    Sets whether the hud is disabled. Takes 1 argument...
    1: Flag (1 to disable, 0 to re-enable)

hud-disable-except-messages

hud-disable-except-messages
    hud-disable-except-messages
    Sets whether the hud (except for messages) is disabled. Takes 1 argument...
    1: Flag (1 to disable, 0 to re-enable)

hud-set-text

hud-set-text
    hud-set-text
    Sets the text value of a given HUD gauge. Works for custom and certain retail gauges. Takes 2 arguments...
    1: HUD gauge to be modified
    2: Text to be set

hud-set-text-num

hud-set-text-num
    hud-set-text-num
    Sets the text value of a given HUD gauge to a number. Works for custom and certain retail gauges. Takes 2 arguments...
    1: HUD gauge to be modified
    2: Number to be set

hud-set-coords

hud-set-coords
    hud-set-coord
    Sets the coordinates of a given HUD gauge. Works for custom and retail gauges. Takes 3 arguments...
    1: HUD gauge to be modified
    2: Coordinate X component
    2: Coordinate Y component

hud-set-frame

hud-set-frame
    hud-set-frame
    Sets the frame of a given HUD gauge's associated image. Works for custom and certain retail gauges. Takes 2 arguments...
    1: HUD gauge to be modified
    2: Frame number to be changed to

hud-set-color

hud-set-color
    hud-set-color
    Sets the color of a given HUD gauge. Works only for custom gauges Takes 4 arguments...
    1: HUD gauge to be modified
    2: Red component (0-255)
    3: Green component (0-255)
    4: Blue component (0-255)

radar-set-max-range

radar-set-max-range
    Takes 1 arguement: The Radar Range
    It sets the 'infinite' radar range value to the argument
    This has the same effect as the -radar_reduce command line option: except the player cannot skip it
    Useful for enforcing game balance

Cutscenes

set-cutscene-bars

set-cutscene-bars
    set-cutscene-bars
    Shows bars at the top and bottom of screen Takes 0 or 1 arguments...
    1: Milliseconds for bars to slide in 

unset-cutscene-bars

unset-cutscene-bars
    unset-cutscene-bars
    Removes cutscene bars Takes 0 or 1 arguments...
    1: Milliseconds for bars to slide out 

fade-in

fade-in
    fade-in
    Fades in Takes 0 or 1 arguments...
    1: Time to fade in (in milliseconds) 

fade-out

fade-out
    fade-out
    Fades in Takes 0 to 2 arguments...
    1: Time to fade in (in milliseconds)
    2: Color to fade to - 1 for white, 2 for red, default is black 

set-camera-position

set-camera-position
    set-camera-position
    Sets the camera position to a spot in mission space Takes 3 arguments...
    1: X position
    2: Y position
    3: Z position 

set-camera-facing

set-camera-facing
    set-camera-facing
    Makes the camera face the given point Takes 3 to 5 arguments...
    1: X position to face
    2: Y position to face
    3: Z position to face
    4: Total turn time
    5: Time to spend accelerating/decelerating 

set-camera-facing-object

set-camera-facing-object
    set-camera-facing-object
    Makes the camera face the given object Takes 1 to 3 arguments...
    1: Object to face
    2: Total turn time
    3: Time to spend accelerating/decelerating 

set-camera-rotation

set-camera-rotation
    set-camera-rotation
    Sets the camera rotation Takes 3 to 5 arguments...
    1: Pitch (degrees)
    2: Bank (degrees)
    3: Heading (degrees)
    4: Total turn time
    5: Time to spend accelerating/decelerating 

set-fov

set-fov
    set-fov
    Sets the field of view Takes 1 argument...
    1: New FOV (degrees) 

reset-fov

reset-fov
    reset-fov
    Resets the field of view

reset-camera

reset-camera
    reset-camera
    Resets the camera position and rotation

show-subtitle

show-subtitle
    show-subtitle
    Shows a subtitle Takes 4 to 12 arguments...
    1: X position (negative value to be from right of screen)
    2: Y position (negative value to be from bottom of screen)
    3: Text to display
    4: Time to be displayed, not including fadein/out
    (optional)
    5: Image name
    6: Fade in time
    7: Center horizontally?
    8: Center vertically?
    9: Width
    10: Text red component (0-255)
    11: Text green component (0-255)
    12: Text blue component (0-255)

set-time-compression

set-time-compression
    set-time-compression
    Sets the time compression Takes 1 to 3 arguments...
    1: New time compression (% of 1x)
    2: Time in ms for change to take
    3: Time compression to start from 

reset-time-compression

reset-time-compression
    reset-time-compression
    Resets the time compression; always call when done with set-time-compression

lock-perspective

lock-perspective
    lock-perspective
    Prevents or allows the player from changing the view mode Takes 1 or 2 arguments...
    1: True to lock the view mode, false to unlock it
    2: What view mode to lock; 0 for first-person, 1 for chase, 2 for external, 3 for top-down

set-camera-shudder

set-camera-shudder
    set-camera-shudder
    Causes the camera to shudder. Currently this will only work if the camera is showing the player's viewpoint (i.e. the HUD).

    Takes 2 arguments...
    1: Time (in milliseconds)
    2: Intensity (in "millishudders". For comparison, the Maxim is hard-coded to an intensity of 2500.

Jump Nodes

set-jumpnode-color

set-jumpnode-color
    set-jumpnode-color
    Sets the color of a jump node Takes 5 arguments...
    1: Jump node to change color for
    2: Red value
    3: Green value
    4: Blue value
    5: Alpha value 

set-jumpnode-model

set-jumpnode-model
    set-jumpnode-model
    Sets the model of a jump node Takes 3 arguments...
    1: Jump node to change model for
    2: Model filename
    3: Show as normal model 

show-jumpnode

show-jumpnode
    show-jumpnode
    Sets the model of a jump node Takes 1 arguments..
    1: Jump node to show 

hide-jumpnode

hide-jumpnode
    hide-jumpnode
    Sets the model of a jump node Takes 1 arguments...
    1: Jump node to hide 

Special

damaged-escort-priority

damaged-escort-priority
    damaged-escort-list
    Sets the most damaged ship in to , sets the others to . Don't use this sexp in the same mission as damaged-escort-list-all,
    or strange results might occur.
    1: Priority1
    2: Priority2
    Rest: 

damaged-escort-priority-all

damaged-escort-priority-all
    damaged-escort-list-all
    Sets the most damaged ship in the entire existing escort list (even what's not shown onscreen) to , the next most
    damaged to , and so on. If there are more ships than priorities, the least most damaged ships are all set to the last
    priority in the list. Don't use this sexp in the same mission as damaged-escort-list, or strange results might occur.
    Takes between 1 and MAX_COMPLETE_ESCORT_LIST (currently 20) arguments...
    1: Priority 1
    Rest: Priorities 2 through 20 (optional) 

ship-vaporize

ship-vaporize
    ship-vaporize
    Sets the ship to vaporize when it is destroyed. Does not actually destroy the ship - use self-destruct for that.
    Takes 1 or more arguments...
    All: List of ships on which to set the vaporize flag

ship-no-vaporize

ship-no-vaporize
    ship-no-vaporize
    Sets the ship to not vaporize when it is destroyed. Does not actually destroy the ship - use self-destruct for that.
    Takes 1 or more arguments...
    All: List of ships on which to unset the vaporize flag

primitive-sensors-set-range

primitive-sensors-set-range
    primitive-sensors-set-range
    Sets the range of the primitive sensors on a ship. Ships outside of this range will not appear on sensors.
    Has no effect on ships that do not have the "primitive-sensors" flag2 set. Takes 2 arguments...
    1: Ship on which to set range
    2: Range, in meters 

set-support-ship

set-support-ship
    set-support-ship
    Sets information for all support ships in a mission. Takes 6 arguments...
    1: Arrival location
    2: Arrival anchor
    3: Departure location
    4: Departure anchor
    5: Ship class
    6: Maximum number of support ships in this mission (use a negative number for infinity)

    Note: The support ship will emerge from or depart into hyperspace if the location is set as hyperspace *or* the anchor
    is set as .

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 

ship-create

ship-create
    ship-create
    Creates a new ship
    Takes 5 to 8 arguments...
    1: Name of new ship (use "" for a default name)
    2: Class of new ship
    3: X position
    4: Y position
    5: Z position
    6: Pitch (optional)
    7: Bank (optional)
    8: Heading (optional) 

weapon-create

weapon-create
    weapon-create
    Creates a new weapon
    Takes 5 to 10 arguments...
    1: Name of parent ship (or "" for no parent)
    2: Class of new weapon
    3: X position
    4: Y position
    5: Z position
    6: Pitch (optional)
    7: Bank (optional)
    8: Heading (optional)
    9: Targeted ship (optional)
    10: Targeted subsystem (optional) 

shields-on

shields-on
    shields-on
    Causes the ship listed in this sexpression to have their shields activated.

    Takes 1 or more arguments...
    1+: Name of ships to activate shields on.

shields-off

shields-off
    shields-off
    Causes the ships listed in this sexpression to have their shields deactivated.

    Takes 1 or more arguments...
    1+: Name of ships to deactivate shields on.

ship-tag

ship-tag
    ship-tag
    Tags a ship. Takes 3 or 7 arguments...
    1: The name of a ship.
    2: The tag level (currently 1, 2, or 3).
    3: The tag time (in seconds).
    4: A SSM missile (optional - used only for TAG-C).
    5: The X origin of the SSM missile (optional - used only for TAG-C).
    6: The Y origin of the SSM missile (optional - used only for TAG-C).
    7: The Z origin of the SSM missile (optional - used only for TAG-C).

ship-untag

ship-untag
    Min arguments: 1, Max arguments: 1

explosion-effect

explosion-effect
    explosion-effect
    Causes an explosion at a given origin, with the given parameters. Takes 11 or 13 arguments...
    1: Origin X
    2: Origin Y
    3: Origin Z
    4: Damage
    5: Blast force
    6: Size of explosion (if 0, explosion will not be visible)
    7: Inner radius to apply damage (if 0, explosion will not be visible)
    8: Outer radius to apply damage (if 0, explosion will not be visible)
    9: Shockwave speed (if 0, there will be no shockwave)
    10: Type (0 = medium, 1 = large1, 2 = large2)
    11: Sound (index into sounds.tbl)
    12: EMP intensity (optional)
    13: EMP duration in seconds (optional)

warp-effect

warp-effect
    warp-effect
    Causes a subspace warp effect at a given origin, facing toward a given location, with the given parameters.
    Takes 12 arguments...
    1: Origin X
    2: Origin Y
    3: Origin Z
    4: Location X
    5: Location Y
    6: Location Z
    7: Radius
    8: Duration in seconds
    9: Warp opening sound (index into sounds.tbl)
    10: Warp closing sound (index into sounds.tbl)
    11: Type (0 for standard blue [default], 1 for Knossos green)
    12: Shape (0 for 2-D [default], 1 for 3-D)

ship-change-alt-name

ship-change-alt-name
    ship-change-alt-name
    Changes the alternate ship class name displayed in the HUD target window. Takes 2 or more arguments...
    1: The ship class name to display
    Rest: The ships to display the new class name

set-death-message

set-death-message
    set-death-message
    Sets the message displayed when the specified players are killed. Takes 1 or more arguments...
    1: The message
    Rest: The players for whom this message is displayed (optional) (currently not implemented)

Backgrounds and Nebula

mission-set-nebula

mission-set-nebula
    mission-set-nebula
    Turns nebula on/off
    Takes1 argument...
    1: 0 for nebula off, 1 for nebula on

add-background-bitmap

add-background-bitmap
    add-background-bitmap
    Adds a background bitmap to the sky. Returns an integer that is stored in a variable so it can be deleted
    using remove-background-bitmap

    Takes 9 arguments...
    1: Background bitmap name
    2: Pitch
    3: Bank
    4: Heading
    5: X scale (expressed as a percentage of the original size of the bitmap)
    6: Y scale (expressed as a percentage of the original size of the bitmap)
    7: X divisions.
    8: Y divisions.
    9: Variable in which to store result 

remove-background-bitmap

remove-background-bitmap
    remove-background-bitmap
    Removes the nth background bitmap from the mission

    Takes 1 argument...
    1: Zero based bitmap index from the 'Bitmap' box in the background editor
    You can also use the result of a previous call to add-background-bitmap to remove that added bitmap 

add-sun-bitmap

add-sun-bitmap
    add-sun-bitmap
    Adds a sun bitmap to the sky. Returns an integer that is stored in a variable so it can be deleted using remove-sun-bitmap

    Takes 6 arguments...
    1: Sun bitmap name
    2: Pitch
    3: Bank
    4: Heading
    5: Scale (expressed as a percentage of the original size of the bitmap)
    6: Variable in which to store result 

remove-sun-bitmap

remove-sun-bitmap
    remove-sun-bitmap
    Removes the nth sun from the mission

    Takes 1 argument...
    1: Zero based sun index from the 'Suns' box in the background editor
    You can also use the result of a previous call to add-sun-bitmap to remove that added sun 

nebula-change-storm

nebula-change-storm
    nebula-change-storm
    Changes the current nebula storm

    Takes 1 argument...
    1: Nebula storm to change to 

nebula-toggle-poof

nebula-toggle-poof
    nebula-toggle-poof
    Toggles the state of a nebula poof

    Takes 2 arguments...
    1: Name of nebula poof to toggle
    2: A True boolean expression will toggle this poof on. A false one will do the opposite.

set-skybox-model

set-skybox-model
    set-skybox-model
    Sets the current skybox model

    Takes 1 argument...
    1: Model filename (with .pof extension) to switch to

    If the model filename is set to "default" with no extension then it will switch to the mission supplied default skybox.

Conditionals

when-argument

when-argument
    When-argument (Conditional operator)
    Performs specified actions when a condition, given a set of arguments, becomes true.

    Takes 3 or more arguments...
    1: The arguments to evaluate (see any-of, every-of, random-of, etc.).
    2: Boolean expression that must be true for actions to take place.
    Rest: Actions to take when the boolean expression becomes true.

every-time

every-time
    Every-time (Conditional operator)
    This is a version of "when" that will always evaluate its arguments. It's useful in situations where you need to
    repeatedly check things that may become true more than once. Since this sexp will execute every time it's evaluated,
    you may need to use it as an argument to "when" if you want to impose restrictions on how it's called.

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

every-time-argument

every-time-argument
    Every-time-argument (Conditional operator)
    This is a version of "when-argument" that will always evaluate its arguments. It's useful in situations where you need to
    repeatedly  check things that may become true more than once. Since this sexp will execute every time it's evaluated,
    you may need to use it as an  argument to "when" (not "when-argument") if you want to impose restrictions on how it's called.

    Takes 3 or more arguments...
    1: The arguments to evaluate (see any-of, all-of, random-of, etc.).
    2: Boolean expression that must be true for actions to take place.
    Rest: Actions to take when the boolean expression becomes true.

any-of

any-of
    Any-of (Conditional operator)
    Supplies arguments for the special data item. Any of the supplied arguments can satisfy the expression(s) in which is used.

    Takes 1 or more arguments...
    All: Anything that could be used in place of .

every-of

every-of
    Every-of (Conditional operator)
    Supplies arguments for the special data item. Every one of the supplied arguments will be evaluated to satisfy the
    expression(s) in which is used.

    Takes 1 or more arguments...
    All: Anything that could be used in place of .

random-of

random-of
    Random-of (Conditional operator)
    Supplies arguments for the special data item. A random supplied argument will be selected to satisfy the expression(s)
    in which is used. The same argument will be returned by all subsequent calls

    Takes 1 or more arguments...
    All: Anything that could be used in place of .

random-multiple-of

random-multiple-of
    Random-multiple-of (Conditional operator)
    Supplies arguments for the special data item. A random supplied argument will be selected to satisfy the expression(s)
    in which is used.

    Takes 1 or more arguments...
    All: Anything that could be used in place of .

number-of

number-of
    Number-of (Conditional operator)
    Supplies arguments for the special data item. Any [number] of the supplied arguments can satisfy the expression(s)
    in which is used.

    Takes 2 or more arguments...
    1: Number of arguments, as above
    Rest: Anything that could be used in place of .

in-sequence

in-sequence
    In-Sequence (Conditional operator)
    Supplies arguments for the special data item. The first argument in the list will be selected to satisfy the expression(s)
    in which is used. The same argument will be returned by all subsequent calls

    Takes 1 or more arguments...
    All: Anything that could be used in place of .

invalidate-argument

invalidate-argument
    Invalidate-argument (Conditional operator)
    Removes an argument from future consideration as a special data item.
    Takes 1 or more arguments...
    All: The argument to remove from the preceding argument list.

Ai goals

ai-ignore-new

ai-ignore-new
    Ai-ignore-new (Ship goal)
    Tells the specified ship 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).

Event/Goals

None

Autopilot/Navpoints

add-nav-waypoint

add-nav-waypoint
    Takes 3 Arguments: NavPoint Name, Waypoint Path Name, Waypoint Path Point #
    IE Setting up 'Nav 1' to be on the first Waypoint on Wapoint Path 'Intercept' the arguments would be:
    'Nav 1', 'Intercept', '1'

add-nav-ship

add-nav-ship
    Takes 2 Arguments: NavPoint Name, Ship Name
    Binds the named navpoint to the named ship - when the ship moves, the waypoint moves with it

del-nav

del-nav
    Takes 1 Argument: NavPoint Name, and deletes that NavPoint

hide-nav

hide-nav
    Takes 1 Argument: NavPoint Name, it then 'hides' that Nav Point
    This causes the nav point to be unselectable, if in the future the Nav Map screen is implemented
    then a hidden nav point will not be displayed on it 

restrict-nav

restrict-nav
    Takes 1 Argument: NavPoint Name, it then 'restricts' that Nav Point
    This causes the nav point to be unselectable, if in the future the Nav Map screen is implemented
    then a restrict nav point will be displayed on it, but unselectable 

unhide-nav

unhide-nav
    Takes 1 Argument: NavPoint Name, it then unhides it 

unrestrict-nav

unrestrict-nav
    Takes 1 Argument: NavPoint Name, it then unrestricts it 

set-nav-visited

set-nav-visited
    Takes 1 Argument: NavPoint Name, it then sets its visited flag 

unset-nav-visited

unset-nav-visited
    Takes 1 Argument: NavPoint Name, it then unsets its visited flag 

set-nav-carry

set-nav-carry
    Takes at least 1 argument, but can take as many as you give it.
    It takes ship and/or wing names as sets their Nav Carry flag -- a ship with the nav carry flag
    will autopilot with the player 

unset-nav-carry

unset-nav-carry
    Takes atleast 1 argument, but can take as many as you give it.
    It takes ship and/or wing names and unsets their Nav Carry flag 

Training

None