SCP SEXPs
From FreeSpace Wiki
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
- 1 Objectives
- 2 Time
- 3 Logical
- 4 Arithmetic
- 5 Status
- 5.1 is-cargo
- 5.2 is-ship-stealthy
- 5.3 is-friendly-stealth-visible
- 5.4 is-iff
- 5.5 is-ai-class
- 5.6 is-ship-type
- 5.7 is-ship-class
- 5.8 primary-ammo-pct
- 5.9 get-primary-ammo
- 5.10 get-secondary-ammo
- 5.11 distance-ship-subsystem
- 5.12 num-within-box
- 5.13 get-object-x
- 5.14 get-object-y
- 5.15 get-object-z
- 5.16 was-promotion-granted
- 5.17 was-medal-granted
- 5.18 num-ships-in-battle
- 5.19 num-ships-in-wing
- 5.20 current-speed
- 5.21 is-nav-visited
- 5.22 distance-to-nav
- 5.23 script-eval-num
- 5.24 script-eval-string
- 5.25 num-assists
- 6 Change
- 7 AI and IFF
- 8 Subsystems and Cargo
- 8.1 set-cargo
- 8.2 set-scanned
- 8.3 set-unscanned
- 8.4 lock-rotating-subsystem
- 8.5 free-rotating-subsystem
- 8.6 reverse-rotating-subsystem
- 8.7 rotating-subsys-set-turn-time
- 8.8 set-primary-ammo
- 8.9 set-secondary-ammo
- 8.10 set-primary-weapon
- 8.11 set-secondary-weapon
- 8.12 lock-primary-weapon
- 8.13 unlock-primary-weapon
- 9 Ship Status
- 10 Beams and Turrets
- 11 Mission and Campaign
- 12 Models and Textures
- 13 Coordinate Manipulation
- 14 Music and Sound
- 15 Hud
- 16 Cutscenes
- 16.1 set-cutscene-bars
- 16.2 unset-cutscene-bars
- 16.3 fade-in
- 16.4 fade-out
- 16.5 set-camera-position
- 16.6 set-camera-facing
- 16.7 set-camera-facing-object
- 16.8 set-camera-rotation
- 16.9 set-fov
- 16.10 reset-fov
- 16.11 reset-camera
- 16.12 show-subtitle
- 16.13 set-time-compression
- 16.14 reset-time-compression
- 16.15 lock-perspective
- 17 Jump Nodes
- 18 Special
- 18.1 damaged-escort-priority
- 18.2 damaged-escort-priority-all
- 18.3 ship-vaporize
- 18.4 ship-no-vaporize
- 18.5 primitive-sensors-set-range
- 18.6 set-support-ship
- 18.7 special-warpout-name
- 18.8 ship-create
- 18.9 weapon-create
- 18.10 shields-on
- 18.11 shields-off
- 18.12 ship-tag
- 18.13 ship-untag
- 18.14 explosion-effect
- 18.15 warp-effect
- 18.16 ship-change-alt-name
- 18.17 set-death-message
- 19 Backgrounds and Nebula
- 20 Conditionals
- 21 Ai goals
- 22 Event/Goals
- 23 Autopilot/Navpoints
- 24 Training
Objectives
percent-ships-disabled
percent-ships-disarmed
Time
None
Logical
string-equals
string-greater-than
string-less-than
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
avg
Status
is-cargo
is-ship-stealthy
is-friendly-stealth-visible
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-ship-type
is-ship-class
primary-ammo-pct
get-primary-ammo
get-secondary-ammo
distance-ship-subsystem
num-within-box
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-medal-granted
num-ships-in-battle
num-ships-in-wing
current-speed
script-eval-num
script-eval-string
num-assists
Change
script-eval
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
change-ai-class
kamikaze
not-kamikaze
player-use-ai
player-not-use-ai
Subsystems and Cargo
set-cargo
set-scanned
set-unscanned
lock-rotating-subsystem
free-rotating-subsystem
reverse-rotating-subsystem
rotating-subsys-set-turn-time
set-primary-ammo
set-secondary-ammo
set-primary-weapon
set-secondary-weapon
lock-primary-weapon
unlock-primary-weapon
Ship Status
ship-guardian-threshold
ship-subsys-guardian-threshold
ship-stealthy
ship-unstealthy
friendly-stealth-invisible
friendly-stealth-visible
ship-targetable-as-bomb
ship-untargetable-as-bomb
ship-subsys-targetable
ship-subsys-untargetable
Beams and Turrets
turret-tagged-specific
turret-tagged-clear-specific
turret-change-weapon
turret-set-target-order
ship-turret-target-order
Mission and Campaign
end-mission
force-jump
grant-promotion
grant-medal
tech-add-ships
tech-add-weapons
tech-add-intel
tech-reset-to-default
Models and Textures
don't-collide-invisible
collide-invisible
change-ship-model
change-ship-class
deactivate-glow-points
activate-glow-points
deactivate-glow-maps
activate-glow-maps
deactivate-glow-point-bank
activate-glow-point-bank
Coordinate Manipulation
set-object-speed-x
set-object-speed-y
set-object-speed-z
set-object-position
set-object-facing
set-object-facing-object
Music and Sound
change-soundtrack
play-sound-from-table
play-sound-from-file
close-sound-from-file
Hud
hud-disable
hud-disable-except-messages
hud-set-text
hud-set-text-num
hud-set-coords
hud-set-frame
hud-set-color
radar-set-max-range
Cutscenes
set-cutscene-bars
unset-cutscene-bars
fade-in
fade-out
set-camera-position
set-camera-facing
set-camera-facing-object
set-camera-rotation
set-fov
reset-fov
reset-camera
show-subtitle
set-time-compression
reset-time-compression
lock-perspective
Jump Nodes
set-jumpnode-color
set-jumpnode-model
show-jumpnode
hide-jumpnode
Special
damaged-escort-priority
damaged-escort-priority-all
ship-vaporize
ship-no-vaporize
primitive-sensors-set-range
set-support-ship
special-warpout-name
ship-create
weapon-create
shields-on
shields-off
ship-tag
ship-untag
explosion-effect
warp-effect
ship-change-alt-name
set-death-message
Backgrounds and Nebula
mission-set-nebula
add-background-bitmap
remove-background-bitmap
add-sun-bitmap
remove-sun-bitmap
nebula-change-storm
nebula-toggle-poof
set-skybox-model
Conditionals
when-argument
every-time
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
every-of
random-of
random-multiple-of
number-of
in-sequence
invalidate-argument
Ai goals
ai-ignore-new
Event/Goals
None
Training
None