Mission Editor/Events

Events are the main system for mission flow within Scenarios created on the Mission Editor. There are three types of Events available to use: **Timed, Trigger, and Sequence.** Events can be combined with other aspects of the Mission Editor in order to provide a logical flow of event actions for any Scenario.

## Event Types

### Timed

Timed Events run specific actions for a certain period of time. They are classified as Event Groups and can trigger multiple actions in a single group, each with different relative timing. Checking "Begin Immediately" will cause the Event to trigger automatically at the start of the mission. Timed Events can contain an unlimited number of "events" inside; each event can trigger multiple actions at once. The Event Group itself can be given an Initial Delay in seconds, which adds a delay before the Event Group's activation. Each Event within the Group can be given a Time value (also in seconds), which determine how long the Event runs for before moving to the next one.

### Trigger

Trigger Events are arguably the simplest kind of Events available. They run a single group of actions when triggered, and are usually used for less complex action chains. Trigger Events have two Trigger Type options: *Proximity* and *Conditional.* *Proximity* allows the Event to be automatically triggered once a unit enters or exits range of a specified Waypoint. It can also be specified if the Trigger can be set off by the player, a specific unit, any allies, any enemies, or any unit at all. The Trigger's Event Mode has two options for the Trigger behavior: onEnter and onExit; the former causes the Event to trigger once a unit enters the area while the latter triggers the Event after a unit leaves. A radius around the Waypoint can also be set to determine the Trigger area's size; it takes on a cylinder shape by default, but the Spherical Radius checkbox can change the shape to a sphere instead if desired. *Conditional* allows more complex trigger conditions to be set in place using the Condition Editor (see the Condition Editor section for more info).

### Sequence

Event Sequences run one event after another with customizable timing and enter/exit conditions per Event. Checking "Begin Immediately" will cause the Event to trigger automatically at the start of the mission. Event Sequences are composed of Nodes which, like with Timed Events, can run an unlimited amount of Actions at once. The Nodes in Event Sequences, however, can be given Entry and Exit conditions, which must be fulfilled for the Node to run or to move to the next Node respectively. A gray box with a line in it can be dragged up or down the Event Sequence to change the Node order as needed.

## Conditional Editor

The Conditional Editor is used by certain Events to act as a gateway for Actions to wait at until a condition is fulfilled before they can activate. It is represented as a table of sorts in which different nodes can be chained together to form different types of conditions. By default, a lone output node is present in the middle of the table; it cannot be deleted, but it can be moved if necessary. The available nodes to use are as follows:

#### *Logic*

* AND: Has a minimum of two inputs (more can be added/removed as desired) and one output. All inputs must be *true* in order for the output to move forward.
* OR: Has a minimum of two inputs (more can be added/removed as desired) and one output. At least one input must be *true* in order for the output to move forward.

#### *Conditions*

* Unit: Checks the properties of a single unit and determines whether the relevant state is true (IS) or false (IS NOT).
* Unit Group: Same as Unit, but it checks an entire unit Group instead. Cannot be used to check multiple units at once.
* Unit List: Same as Unit Group, but can check through a custom list of individual units.
* Static Object: Used exclusively to check whether or not a specified Oil Rig Object has been destroyed.
* Chance: Has a chance of outputting, whose percentage number is determined by a slider or a text box included.
* Vehicle Control: Reads a value from the player's aircraft, such as their fuel level or if a certain button is pressed, and outputs based on the configuration.
* Global Value: Reads a Global Value and compares it to a given number. Outputs if the Global Value is greater than, less than/ or equal to the given number.

## Event Action Browser

Event Actions are used to control the actions and behavior of units among other Scenario functions.

**Universal Unit Actions**
* Set Engage Enemies: Set whether the unit should engage enemies at all.
* Spawn Unit: Spawns the unit if it hasn't already been spawned (does not duplicate units)
* Destroy: This event destroys the unit immediately. Depending on the unit, their model will eventually despawn.
* Set Invincible: Set whether the unit can take damage. Allied units have collisions with each other disabled in formation as AI is tweaked.

Unit Actions (Player)
* Set Waypoint: Set the player's current Waypoint.
* Kill Pilot: Kill the pilot instantaneously (as if killed by g-forces or impact).
* Destroy Vehicle: Destroy the player's vehicle without killing the pilot.

In multiplayer missions, **MP Spawn** is used instead, and has a different set of functions:

* Move Spawn: Moves the player slot's spawn point to the given location. Bearing, start mode, and initial speed can be reconfigured as well.
* Set RTB Waypoint: Sets/Moves the player slot's RTB waypoint to the given waypoint.
* Set RTB Unit: Sets the unit used for the player slot's RTB waypoint. Used for carriers.
* Set RTB To Spawn: Sets the player slot's RTB waypoint to their spawn point location.
* Set Fuel Waypoint: Sets the player slot's Fuel waypoint to the given waypoint value.
* Set Fuel Unit: Sets the player slot's Fuel waypoint to the given unit. Used for carriers or specific tankers.

Unit Actions (Air)
* Set Unit Commands: Exclusive to allied aircraft. Sets whether or not this unit will accept commands given by the player.
* Set Path: Set the aircraft to fly along a path.
* Taxi Path: Command the aircraft to taxi on a certain path.
* Taxi Path Speed: Command the aircraft to taxi on a certain path at a certain speed.
* Orbit Waypoint: Command the aircraft to orbit a way point at a specified radius and altitude.
* Set Nav Speed: Set the aircraft's default navigation airspeed (when not in combat)
* Set Altitude: Set the aircraft's default altitude. AI will still take into account ground collision
* Form on Pilot: Command the aircraft to form up on a particular air unit regardless of faction or grouping
* Refuel From Tanker: Command the aircraft to refuel from the specified tanker aircraft.
* Fire ASM: Command an aircraft to fire an Anti-Ship Missile on the given path if available.
* Take Off: Command the pilot to take off. At an airbase or carrier, a plane will automatically follow ATC procedures, or vertical take off if possible from a helipad. When not at an airbase, the fixed wing will attempt to use the ground in front of it for takeoff roll or vertical take off.
* Land: Land at a specified airfield.
* Land at WPT: Vertically land on a specified waypoint if capable.
* Land at WPT w/ Direction: Same as Land at WPT, but takes in a bearing value for the unit to face towards when landing.
* Rearm: A combination of actions being Land, rearm/refuel, and take off again.
* Attack Target: Orders the unit to attack a specific target, regardless of detection or other threats. This overrides priority targets until the target is destroyed.
* Cancel Attack Target: Clears the unit's designated Attack Target.
* Set Radio Comms: Set whether the AI pilot will communicate with the player via radio.
* Add Priority Targets: Adds selected unit(s) to the AI pilot's priority target list. They will attack these before other when those targets are detected.
* Set Priority Targets: Sets or Replaces the AI pilot's priority target list to a new list populated by selected units.
* Clear Priority Targets: Clears the AI pilot's priority target list.
* Add Non-Targets: Specifies hostile units that this unit should not engage under any circumstances.
* Set Non-Targets: Same as Add Non-Targets, but it clears any existing lists beforehand.
* Clear Non-Targets: Clears the unit's Non-Target list.
* Bomb waypoint: Carpet bomb the waypoint from a certain heading and altitude, and with a certain number of bombs. The pilot will automatically configure ripple rate and release timing to center the line of bombs over the waypoint.
* Set Radar: Toggles the unit's radar on or off if it has one. This functions independently of a unit's *Engage Enemies* property, meaning units can be set to attack while maintaining radar silence to avoid detection.

The following functions are exclusive to the AV-42C:

* Unload Passengers: Causes all passengers inside the AV-42C to exit the vehicle if the ship is landed.
* Load Passengers: Orders specific Infantrymen to approach and board the AV-42C.
* Load Unit Group: Orders an Infantry group to approach and board the AV-42C.

Unit (Ground)
* Set Movement Speed: Determines the unit's designated Move Speed. Players can choose between three movement speed options: *Slow (10), Medium (20),* or *Fast (30).* The number designates its movement speed in meters per second.
* Set Path: Orders a unit to move along a given path.
* Park Now: Cancels all present move orders and orders the unit to remain in place.
* Move To: Orders a unit to move directly to a waypoint.

Unit (Sea)
* Launch All: Applies to any unit with a configurable deck aircraft storage (Edit Carrier setting). Commands all onboard aircraft to take off. Scrambles the aircraft assigned to the carrier via the "Edit Carrier" sub menu.
* Launch Drones: Exclusive to the Drone Carrier. Causes it to launch all of its stored drones if they're available.
* Move to: Commands the vessel to move directly to a given waypoint.
* Move Path: Commands the vessel to move along a path.

UnitGroup
Similar to the actions used for individual units, but given to each unit within a group.

Objective
* Begin Objective: Starts the objective if it has not already been completed.
* Complete Objective: Marks the objective as completed if it has not yet been finished already.
* Fail Objective: Marks the objective as failed. If the objective in question is listed as required, then it will trigger a total mission failure.
* Cancel Objective: Stops the objective without completing or failing it.

Timed/Sequence Events
* Begin: Starts the event sequence.
* Stop: Stops the event sequence or prevents it from being triggered if it hasn't yet been.

Trigger Events
* Enable: Arms the Trigger event, allowing it to be triggered if its conditions are met.
* Disable: Disarms the Trigger event, preventing it from being triggered by its inputted trigger logic.
* Trigger: Triggers the event regardless of whether or not it is armed.

System
* Radio Message: Plays an audio clip over the player's radio comms system. Queues a radio message up if one is already playing.
* Play Priority Message: Similar to Radio Message, but it stops any currently-playing radio messages beforehand, giving the designated audio clip maximum priority.
* Stop Radio Messages: Immediately stops the currently-playing radio message and clears the radio message queue.
* Radio Message Team: *Multiplayer mission exclusive.* Plays a radio message for only the given team to hear.
* Copilot Radio Message: *Multiplayer mission exclusive.* Plays a radio message on the copilot audio channel.
* Copilot Priority Radio Message: *Multiplayer mission exclusive.* Plays a radio message on the copilot audio channel, giving the designated audio clip maximum priority.
* Fire Conditional Action: A very useful Event Action that triggers other Event Actions based on given IF, ELSE IF, and ELSE statements. Useful in conjunction with the Mission Editor's Global Values system.
* Play BGM: Plays an audio clip on a loop in the background. This functions independently of a ship's radio comms.
* Stop BGM: Fades out any currently-playing background music.
* Send WPT to GPS: Creates and sends a GPS group to the player's GPS tab (MSN prefix). The points are designated by inputted Mission Editor waypoints.
* Send Path to GPS: Creates and sends a GPS group to the player's GPS tab (MSN prefix). The path is determined by a given Mission Editor path and the GPS's Path mode is enabled for these points by default.
* Light Flare: Creates a flare at a designated map position. Its color and duration can be set beforehand.
* Add Score: *Multiplayer mission exclusive.* Adds a certain amount of points to the given team's Score.
* Force Quicksave: Causes the game to quicksave. It bypasses any predetermined quicksave limitations, making it useful as an autosave feature.
* Force Quickload: Causes the game to quickload if there is a quicksave available.