FRED: Using SEXPS

a simple sexp Symbolic expression trees, or sexps, allow you to program sophisticated behavior with FRED. A sexp consists of an operator and one or more arguments; each argument can be data or another operator. (Some editors have a root item, such as an event name, above each sexp.) For example, in the sexp at right, the operator is is-destroyed-delay, and the arguments are 10, Leo, and Sagittarius. In some editors, there is also a name for the sexp.

In most editors, when you have an operator selected, text at the bottom of the editor explains when it becomes true. Depending on the context, this is the condition for the ship to arrive, the objective to be satisfied, etc.

A red 'op' to the left of a line indicates that it is an operator. A sheet of paper symbol indicates data, and a blue ball indicates a name.

Editing sexps is easy. Click on the little +s and -s to the left of operators to expand or contract them; this doesn't change them, just they way they are displayed for editing. To do anything else, right-click on the thing you want to edit, and poke around in the resulting pop-up menu. Irrelevant choices will be grayed out. One thing to notice: if you want an operator to have more arguments than it has, right click on the operator and pick "Add Data" or "Add Operator".

When you select an operator, there is documentation at the bottom of the editor explaining what it does. This is reproduced in the table below.

Plus (Arithmetic) Adds numbers and returns results.

Returns a number; Takes 2 or more numeric arguments.
Minus (Arithmetic) Subtracts numbers and returns results.

Returns a number; Takes 2 or more numeric arguments.
Mod (Arithmetic) Divides numbers and returns the remainer.

Returns a number; Takes 2 or more numeric arguments.
Multiply (Arithmetic) Multiplies numbers and returns results.

Returns a number; Takes 2 or more numeric arguments.
Divide (Arithmetic) Divides numbers and returns results.

Returns a number; Takes 2 or more numeric arguments.
True (Boolean) A true boolean state

Returns a boolean value.
False (Boolean) A false boolean state

Returns a boolean value.
And (Boolean) And is true if all of it's arguments are true.

Returns a boolean value; Takes 2 or more boolean arguments.
Or (Boolean) Or is true if any of it's arguments are true.

Returns a boolean value; Takes 2 or more boolean arguments.
Equals (Boolean) Is true if all of it's arguments are equal.

Returns a boolean value; Takes 2 or more numeric arguments.
Greater than (Boolean) True if first argument is greater than the second argument.

Returns a boolean value; Takes 2 numeric arguments.
Less than (Boolean) True if first argument is less than the second argument.

Returns a boolean value; Takes 2 numeric arguments.
Is IFF (Boolean) True if ship
Has time elapsed (Boolean) 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.
Not (Boolean) Returns opposite boolean value of argument (True becomes false, and false becomes true).

Returns a boolean value; Takes 1 boolean argument.
Previous Mission Goal True (Boolean) Returns true if the specified goal in the specified mission is true (or succeeded). It returns false otherwise.

Returns a boolean value; Takes 2 arguments + 1 optional:
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.
Previous Mission Goal False (Boolean ) Returns true if the specified goal in the specified mission is false (or failed). It returns false otherwise.

Returns a boolean value; Takes 2 arguments + 1 optional:
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.
Previous Mission Goal Incomplete (Boolean ) Returns true if the specified goal in the specified mission is incomplete (not true or false). It returns false otherwise.

Returns a boolean value; Takes 2 arguments + 1 optional:
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.
Previous Mission Event True (Boolean ) Returns true if the specified event in the specified mission is true (or succeeded). It returns false otherwise.

Returns a boolean value; Takes 2 arguments + 1 optional:
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.
Previous Mission Event False (Boolean ) Returns true if the specified event in the specified mission is false (or failed). It returns false otherwise.

Returns a boolean value; Takes 2 arguments + 1 optional:
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.
Previous Mission Event Incomplete (Boolean) Returns true if the specified event in the specified mission is incomplete (not true or false). It returns false otherwise.

Returns a boolean value; Takes 2 arguments + 1 optional:
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.
Mission Goal True (Boolean) 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 arguments:
1:Name of the event in the mission.
2:Number of seconds to delay before returning true.
Mission Goal False (Boolean) 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 arguments:
1:Name of the event in the mission.
2:Number of seconds to delay before returning true.
Mission Goal Incomplete (Boolean) Returns true if the specified goal in the this mission is incomplete. This sexpression will only be useful in conjunction with another sexpression like has-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.
Mission Event True (Boolean) 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 arguments:
1:Name of the event in the mission.
2:Number of seconds to delay before returning true.
Mission Event False (Boolean) 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 arguments:
1:Name of the event in the mission.
2:Number of seconds to delay before returning true.
Mission Event Incomplete (Boolean) Returns true if the specified event in the this mission is incomplete. This sexpression will only be useful in conjunction with another sexpression like has-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 destroyed delay (Boolean) Becomes true 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 (Boolean ) Becomes true 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 (Boolean) Becomes true 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 (Boolean) Becomes true 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 (Boolean) Becomes true 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 (Boolean) Becomes true 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 (Boolean) Becomes true 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 (Boolean) Becomes true 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.
Waypoints done delay (Boolean) Becomes true 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 (Boolean) 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.
Time ship destroyed (Time) 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) 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) 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) 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) 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) 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 (Time) Returns the current time into the mission.

Returns a numeric value.
Time docked (Time) 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) 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.
Sheilds left (Status) 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 (Status) 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 (Status) 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 (Misc.) Returns the distance between 2 objects. These objects can be either a ship, a wing, or a waypoint.

Returns a numeric value; Takes 2 arguments:
1:The name of one of the objects.
2:The name of the other object.
Last order time (Status) 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.
When (Conditional) 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.
Blah
Change IFF (Action) Sets the specified ship(s) to the specified team.
Takes 2 or more arguments:
1:Team to change to (\friendly\, \hostile\ or \unknown\).
Rest:Name of ship to change team status of.
Protect ship (Action) Protects a ship from being attacked by any enemy ship. Any ship that is protected will not come under enemy fire.

Takes 1 or more arguments:
All:Name of ship(s) to protect.
Unprotect ship (Action) Unprotects a ship from being attacked by any enemy ship. Any ship that is not protected can come under enemy fire. This function is the opposite of protect-ship.

Takes 1 or more arguments:
All:Name of ship(s) to protect.
Send message (Action) 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 (Action) Causes the specified ship(s) to self destruct.

Takes 1 or more arguments:
All:Name of ship to self destruct.
Next Mission (Action) The next mission operator is used for campaign branching in the campaign editor. It specifies which mission should played be next in the campaign. This operator generally follows a 'when' or 'cond' statment in the campaign file.

Takes 1 argument:
1:Name of mission (filename) to proceed to.
Clear goals (Action) Clears the goals for the specified ships and/or wings.

Takes 1 or more arguments:
All:Name of ship or wing.
Add goal (Action) Adds a goal to a ship or wing.

Takes 2 arguments:
1:Name of ship or wing to all goal to.
2:Goal to add.
Sabotage subystem (Action) 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 Subystem (Action) 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 3 arguments:
1:Name of ship subsystem is on.
2:Name of subsystem to repair.
3:Percentage to increase subsystem integrity by.
Set Subsystem Strength (Action) 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.
Invalidate goal (Action) Makes a mission goal invalid, which causes it to now show up on mission goals screen, or be evaluated.
Takes 1 or more arguments:
All:Name of mission goal to invalidate.
Validate goal (Action) 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 (Action) 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 (Action) 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 (Action) 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.
Error (Debug) Causes the game to halt with an error.
Ai-chase (Ship) 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 (Ship) 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 (Ship) Causes the specified ship to undock from who it is currently docked with.

Takes 1 arguments:
1:Goal priority (number between 0 and 89).
Ai-warp-out (Ship/Wing) Causes the specified ship/wing to warp out of the mission. Currently, the ship will warp out at it's 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 (Ship) 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 (Ship) 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 subsys (Ship) 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-chase wing (Ship) Causes the specified ship to chase and attack the specified target.

Takes 2 arguments:
1:Name of wing to chase.
2:Goal priority (number between 0 and 89).
Ai-disable-ship (Ship/wing) 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 (Ship/wing) 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 (Ship) 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 (Ship) Causes the specified ship to chase and attack any ship on the opposite team.

Takes 1 arguments:
1:Goal priority (number between 0 and 89).
Ai-guard wing (Ship) Causes the specified ship to guard a wing of ships from other ships not on the same team.

Takes 2 arguments:
1:Name of wing to guard.
2:Goal priority (number between 0 and 89).
Do-nothing (Action) Does nothing. This is used as the default for any required action arguments of an operator.
Key-pressed (Boolean training) 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 (Training) 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.

Returns a boolean value; Takes 1 argument:
1:Default key to reset.
Targeted (Boolean training) 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 (Boolean training) 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 (Boolean training) 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.
Order (Boolean training) Becomes true when the player had given the specified ship or wing the specified order.

Returns a boolean value; Takes 2 arguments:
1:Name of ship or wing to check if given order to.
2:Name of order to check if player has given.
Waypoint-missed (Boolean training) 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.
Path-flown (Boolean training) Becomes true when all the waypoints in the path have been flown, in sequence.

Returns a boolean value; Takes no arguments.
Waypoint-twice (Boolean training) 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.
Training-msg (Action training) 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).
Set-training-context-fly-path (Training context) 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 (Training context) 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.
Grant promotion (Action) 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 (Action) 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.
Set prefered secondary weapons This sexpression is used to inform the AI about prefered 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. (Prefered 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.
And in sequence (Boolean) Returns true if all of it's arguments have become true in the order they are listed in.

Returns a boolean value; Takes 2 or more boolean arguments.
Skill level at least (Boolean) Returns true if the player has selected the given skill level or higher.

Returns a boolean value; Takes 1 arguments:
1:Name of the skill level to check.
Num players (Status) Returns the current number of players (multiplayer) playing in the current mission.

Returns a numeric value; Takes no arguments.
Is cargo known (Boolean) 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; Takes 1 or more arguments:
All:Name of ship to check if it's cargo is known.
Is cargo known (delay) (Boolean) 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..
Was promotion granted (Boolean) 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 (Boolean) 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).
Good rearm time (Action) 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 (Action) 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 arguments:
1:Name of ship type (or ship class) to allow.
Allow weapon (Action) 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 arguments:
1:Name of weapon (primary or secondary) to allow.
Tech add ship (Action) 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 weapon (Action) 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.
Ai-evade ship (Ship) 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 (Ship) 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 (Ship) 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 (Ship) 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).
Ai-stay still (Ship) 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 (Ship) 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).
Ai-flash hud gauge (Training) 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.
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-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-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.
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.
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 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.
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.
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:r\n 1:Delay in seconds after the last ship listed departe 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 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 seconda after the last ship/wing is destroyed or departerd this expression can return true.
2+:Name of a ship or wing
Special-check Do some special check in training. Ask Mike K. about how it works.

Returns a boolean value; Takes 1 argument:
1:Extra special number (tm)
end-campaign Ends the builtin campaign. Should only be used by the main FreeSpace campaign

See the second walkthrough for plenty of examples of SEXPs.

Back to Index

  Site
  - Current News
  - News Archive
  - Submit News
  - Poll Archives
  - Articles
  - Staff


  FreeSpace
  - Game Info
  - Image Gallery
  - Tactical
  - Downloads
  - Cheats
  - Weapons Database
  - Multiplayer
  - FRED Help
  - Silent Threat
  - FAQ
  - MODing
  - Missions


  FreeSpace 2
  - Game Info
  - Image Gallery
  - Tactical
  - Downloads
  - Weapons Database
  - Game Preview
  - Cheats
  - FRED2 Help
  - Concept Art
  - MODing
  - Missions


  Hosted
  - Get Hosted
  - Babylon Project
  - Campaign Watch
  - COB2POF
  - Ellis Station
  - FRED Zone
  - GTD Excellence
  - LFTS
  - Segeltuch
  - Tech Freespace
  - Triton Dynamics
  - Source Code Project
  - United Space


  Campaigns
  - Aeos Affair
  - Aftermath
  - BlackWater Ops
  - Behind Enemy Lines
  - Derelict
  - Project Armageddon
  - Twilight
  - The Babel Effect
  - Warzone


  Forums
  - VWatchBB
  - Volition BB
  - FreeSpace
  - SquadWar
  - FRED2


  Community
  - Hyperlinks
  - Wilds Warped Rant
  - Interviews
  - FS1 Webring
  - FS2 Webring
  - FS Frenzy
  - Fan Fiction
  - Fan Art
  - Editorials


  Network
  - Volition Watch
  - Summoner Watch
  - Red Faction Watch
  - Archives


  Staff
  - Brando
  - Dynamo
  - IceFire
  - Orange
  - Remora
  - Stealth


  

FreeSpace Watch is copyrighted 2000 except where Volition or Interplay may apply. Web design by Colin Czerneda and Todd Miller.