-- The definitions of mission source for Luau's language server (luau-lsp): its declarations, -- the functions and values of its script, the game's commands and the names of the game's -- values. Add this file to the luau-lsp.types.definitionFiles setting under a name, such as -- "@mission", and turn on Luau's new type solver (luau-lsp.fflags.enableNewSolver). -- Generated by `sltool dte definitions` from the game's tables; don't change it by hand. -- The names of the game's values, as the scripting API names them. A value without a name, -- such as a mod's ship type, is a number. --- A ship type, by its name, or by its number where the game doesn't name it. It also accepts any text, as the scripting API's type does, but `sltool dte build` only accepts the game's names. export type ShipType = "predator" | "naginata" | "grendel" | "crusader" | "coyote" | "mirage" | "tempest" | "patriot" | "wolverine" | "reaper" | "shroud" | "phoenix" | "reliant" | "yamato" | "alsace" | "kestrel" | "falco" | "victorious" | "endeavour" | "mitchell" | "bremen" | "arc_ship" | "ulysses" | "sai" | "nanny" | "galahad" | "hades" | "mule" | "lonestar" | "limpet_car" | "prowler" | "ripper" | "lueneburg" | "mammoth" | "intruder" | "sentry" | "goodwill" | "stork" | "sky_hawk" | "haidar" | "karak" | "salin" | "azan" | "sabre" | "lagg" | "kamov" | "saracen" | "salamander" | "scimitar" | "basilisk" | "kossac" | "yao" | "ramases" | "kozlov" | "morzov" | "badanov" | "pukov" | "xia" | "riza" | "cyclops" | "kurgan" | "sharov" | "gurevich" | "berijev" | "kirov" | "loki" | "kalan_shuttle" | "saladin" | "darkreign" | "stalag" | "antanov" | "kronstadt" | "boridin" | "troop_car" | "torpedo" | "ulysses_back" | "ulysses_fin" | "escape_pod" | "debris" | "debris_1" | "debris_2" | "debris_3" | "debris_4" | "debris_5" | "debris_6" | "debris_7" | "debris_8" | "debris_9" | "crewman" | "crewman_1" | "crewman_2" | "crewman_3" | "russian_torpedo" | "mammoth_back" | "baxter" | "neptune_hi" | "triton_hi" | "uranus_hi" | "saturn_hi" | "titan_hi" | "jupiter_hi" | "europa_hi" | "ganymede_hi" | "io_hi" | "calisto_hi" | "venus_hi" | "earth" | "kronstadt_wreck" | "planet_placeholder_4" | "proto_gate" | "advanced_gate" | "proximity_mine" | "black_box" | "satellite" | "mammoth_wreck_front" | "mammoth_wreck_back" | "proto_gate_panel" | "badanov_wreck_back" | "badanov_wreck_front" | "kurgan_wreck" | "krasnaya" | "asteroid_1" | "asteroid_2" | "asteroid_3" | "asteroid_4" | "asteroid_5" | "asteroid_6" | "asteroid_7" | "research_station" | "latov" | "gurevich_wreck_back" | "training_hoop" | "czar_docked" | "turret_asteroid_1" | "turret_asteroid_2" | "turret_asteroid_3" | "turret_asteroid_4" | "turret_asteroid_5" | "turret_asteroid_6" | "turret_asteroid_7" | "powerup_random" | "dm_beacon_gate" | "dm_beacon" | "pukov_wreck_back" | "other_escape_pod" | "cargo_pod" | "other_cargo_pod" | "grazer_gun_sat" | "archer_missile_sat" | "kafelnikof" | "reliant_wreck_back" | "stalag_doors" | "stalag_duct_cover" | "yakob_shuttle" | "krasny" | "varyag" | "other_ramases" | "fort_carter" | "koenig" | "washington" | "other_mitchell" | "ufelsky" | "kresta" | "krasnaya_left_arm" | "krasnaya_right_arm" | "rogue_base" | "kronstadt_arm" | "boridin_gun_dome" | "boridin_breakaway" | "darkreign_wreck_hat" | "yamato_wreck_back" | "maintenance_droid" | "maintenance_astronaut" | "rogue_base_wreck_top" | "tank" | "training_target" | "zakov" | "shell" | "rock_chunk" | "rock_chunk_tiny_1" | "rock_chunk_tiny_2" | "rock_chunk_tiny_3" | "rock_chunk_tiny_4" | "latov_wreck_1" | "latov_wreck_2" | "czar" | "zakov_wreck_back" | "sharov_wreck_back" | "limpet_pod" | "stalag_wreck_1" | "stalag_wreck_2" | "saladin_wreck" | "gegarin" | "krelov" | "kiev" | "kiev_wreck_back" | "baxter_wreck_top" | "victorious_wreck_front" | "mitchell_wreck_back" | "fort_bear" | "fort_sherman" | "neptune_lo" | "triton_lo" | "uranus_lo" | "saturn_lo" | "titan_lo" | "jupiter_lo" | "europa_lo" | "ganymede_lo" | "io_lo" | "calisto_lo" | "venus_lo" | "yamato_hangar" | "yamato_landing_bay" | "reliant_hangar" | "comms_relay" | "saladin_link" | "varyag_wreck_front" | "churchill" | "bokov" | "bulatov" | "shinnik" | "kovtun" | "late_escape_pod" | "other_late_escape_pod" | "fuel_pod" | "yevstafiy" | "mammoth_gulliver" | "mammoth_santa_maria" | "mammoth_rosario" | "mammoth_larsons_pride" | "mammoth_brittania" | "mammoth_sierra_madre" | "mammoth_mayan_gold" | "mammoth_dawn_chorus" | "mammoth_calysto" | "mammoth_sundown" | "mammoth_krenna" | "mammoth_seabound" | "mammoth_crimson_sky" | "asteroid_with_hole_1" | "asteroid_with_hole_2" | "asteroid_with_hole_3" | "asteroid_with_hole_4" | "t_predator" | "t_naginata" | "t_grendel" | "t_crusader" | "t_coyote" | "t_mirage" | "t_tempest" | "t_patriot" | "t_wolverine" | "t_reaper" | "t_shroud" | "t_phoenix" | "sun_marker" | "nebula_marker" | "dm_sphere_centre" | "beacon_marker" | "spawn_player" | "spawn_powerup" | "marker" | "stand_in" | number | string --- A pilot, by its name, or by its number where the game doesn't name it. It also accepts any text, as the scripting API's type does, but `sltool dte build` only accepts the game's names. export type PilotNumber = "bandit_tigers_leader" | "diceman_tigers_leader" | "moose_tigers" | "tigers" | "moose_volunteers" | "volunteers" | "bandit_volunteers_leader" | "viper" | "fifty_first" | "black_guard" | "black_sun_leader" | "black_sun" | "blades" | "black_eagle_leader" | "black_eagle" | "ivan_petrov" | "nicolai_petrov" | "black_aces" | "bremen_bridge_officer" | "buccaneer" | "cat_foster" | "cobra" | "couger" | "coalition_comms_officer" | "coalition_fighter" | "coalition_scientist" | "endeavour_bridge_officer" | "enriquez_reliant_bridge" | "enriquez_yamato_bridge" | "enriquez_cockpit" | "foster_dead" | "fort_bear_comms" | "fort_baxter_comms" | "fort_carter_comms" | "fort_sherman_comms" | "gamma_dead" | "gamma_leader" | "golden_warrior" | "hellcat_leader" | "hellcat" | "hornet" | "jackel_leader" | "jackel" | "jaguar" | "kestrel_command" | "koenig_bridge_officer" | "kestrel_bridge_officer" | "kurgen" | "lonestar" | "mauler" | "mcgann" | "mitchell_bridge_officer" | "nanny_leader" | "pirate_leader" | "pirate" | "prowler" | "pukov_captain" | "puma_leader" | "puma" | "raven" | "reliant_bridge_officer" | "ripper" | "ronin_leader" | "ronin" | "russian_bomber" | "sabre_leader" | "sabre" | "saracen" | "scorpion_leader" | "scorpion" | "saladin_captain" | "stahl_bridge" | "stahl_marines" | "steiner_ejected" | "stinger" | "stork" | "ulysses_captain" | "ulysses_captain_panicking" | "steiner_vampires_leader" | "vampire" | "varyag_captain" | "victorious_bridge_officer" | "virtual_flight_instructor" | "washington_bridge_officer" | "yamato_bridge_officer" | "frenchy" | "silky" | "mayday" | "trigger" | "vixen" | "cutter" | "claymore" | "skippy" | "juice" | "face" | "hawkeye" | "arrow" | "nero" | "rhino" | "stalker" | "flash" | "stretch" | "talon" | "butcher" | "snapper" | "banshee" | "wolf" | "reaper" | "worm" | "wildcat" | "siron" | "ferret" | "poker" | "blade" | "scarlet" | "rico" | "slick" | "irish" | "spider" | "ego" | "diceman" | "captain_mukai" | "cat_foster_prowler" | "coalition_torpedo_leader" | "general_reese_pod" | "kulov_borodin" | "kulov_pod" | "mammoth_1" | "mammoth_2" | "mammoth_3" | "mammoth_4" | "saracen_leader" | "stahl_ripper" | "golden_warrior_leader" | "hornet_leader" | "mammoth_5" | "mammoth_6" | "mammoth_7" | "bandit" | "marauder_leader" | "marauder" | "marine_leader" | "marine" | "jaguar_leader" | "buccaneer_leader" | number | string --- An order, by its name, or by its number where the game doesn't name it. export type Order = "do_nothing" | "fly_aimlessly" | "launch_missile" | "launch_jack_hammer" | "warp_in" | "warp_out" | "fly" | "run_away" | "land" | "escort" | "find_new_target" | "explode" | "ripper_grabs_target_object" | "object_attach" | "formation_regroup" | "patrol_route" | "toggle_cloak" | "ship_follow_curve" | "slow_rotate" | "jump_in" | "jump_out" | "find_scoop_up" | "random_spin_slow" | "random_spin_medium" | "random_spin_fast" | "fixed_gate_jump_in" | "fixed_gate_jump_out" | "formation" | "fixed_gate_open" | "fixed_gate_close" | "eject" | "fixed_gate_collapse" | "match_speed" | "dark_reign_shoot" | "move_to_spawn_pos" | "turns_object_lights_on" | "make_boridin_section_break_away" | "rotate_boridin_breakaway_warp_projector" | "start_warp_projection_from_boridin" | "make_ripper_drop_what_its_carrying" | "jump_in_spread" | "jump_out_spread" | "turns_object_lights_off" | "huuuuuuuge_explosion" | "immediately_set_ship_to_zero_velocity_and_rotation" | "fly_ship_backwards" | "player_control" | "multiplayer_control" | "avoid_target" | "torpedo" | "launch" | "fight" | "abandoned" | "scoop_up" | "eject_spin" | "dock" | "fire_ion_cannon" | "ripper_end_drop_object" | "ripper_attach_cargo_pod_to_mammoth" | "eject_fighter_attack" | "disrupted" | "make_capship_list_left" | "make_capship_list_right" | "friendly_fire" | "eject_player" | "ship_follow_curve_backwards" | "mill" | "deathmatch_respawn_effect" | "deathmatch_dark_reign_target" | number --- A condition, by its name, or by its number where the game doesn't name it. export type Condition = "shot_at" | "destroyed" | "launched" | "camera_reached" | "ship_reached" | "proximity_close" | "proximity_general" | "object_scooped" | "player_ready_to_jump" | "jumped_in" | "fixed_gate_jumped_in" | "player_ready_to_warp" | "jumped_through_hoop" | "player_wants_backup" | "ripper_grabbed_object" | "ripper_dropped_object" | "cloaked" | "decloaked" | "targetted" | "player_l1_doubletap" | "player_l2_doubletap" | "player_r1_doubletap" | "player_r2_doubletap" | "player_l1_l2_r1_r2_pressed" | "player_l1_r1_pressed" | "game_timer_expired" | "tractor_beam_locked" | "tractor_beam_broken" | "inside_object" | "outside_object" | "docked" | "undocked" | "being_chased" | "call_reinforcements" | "explosion_ship" | number --- A head movement, by its name, or by its number where the game doesn't name it. export type FaceFilm = "talking" | "laughing" | "squadron" | "dying" | number --- An environment effect, by its name, or by its number where the game doesn't name it. export type EnvironmentEffect = "ice_field" | "planet_bombard" | "bombard_flashes" | number --- The wing a flight group's ships are listed in. export type Wing = "player" | "second" | "third" | "none" | number --- A value of a condition's event, by its label in the condition catalogue, or by its place. export type EventValue = "Attacker" | "Shield Damage" | "Hull Damage" | "Victim" | "Weapon Fired" | "Killer" | "LaunchedShip" | "ReachedShip" | "ApproachingShip" | "Proximity" | "ObjectScooped" | "JumpedInShip" | "ShipJumpedIn" | "ObjectGrabbed" | "ObjectDropped" | "CloakingShip" | "Aggressor" | "TractoredShip" | "TractoringShip" | "ChasedShip" | "Chaser" | "PlayerTargetted" | "ExplosionShip" | number -- The records a mission declares, and the other types its words take and give. --- A ship, a capital ship, a station or a marker, such as a nav point. declare extern type MissionShip with end --- A flight group. declare extern type FlightGroup with end --- A squad. declare extern type Squad with end --- A camera or flight curve. declare extern type Curve with end --- A point of a formation. declare extern type FormationPoint with end --- A formation, whose points a ship names as `sabres[1]` for the first. declare extern type Formation with [number]: FormationPoint end --- A ship, a flight group or a squad: what a trigger watches, and what most commands act on. export type Entity = MissionShip | FlightGroup | Squad --- A place or a direction: `{ x, y, z }`. export type Vector = { number } --- The code a trigger runs: a function whose parameters are the values its condition's events carry. export type Code = (...any) -> number --- A part, which runs as `go_home()`, and which commands such as `CreateTimer` take. export type Part = (...any) -> number --- How a trigger repeats. export type Repeats = "once" | "always" | Counted | number --- The game's variables, which `game` holds. export type GameVariables = { jump_ready: number, warp_ready: number, backup_available: number, player_missiles_left: number, mcgann_alive: number, nicolai_petrov_alive: number, ivan_petrov_alive: number, kulov_alive: number, mission_over: number, landing_cleared: number, al_rahan_alive: number, sharif_alive: number, steiner_alive: number, mission_success: number, players: number, krasnaya_alive: number, rameses_alive: number, kozah_alive: number, fixed_gate_alive: number, warp_gate_alive: number, last_success: number, objectives_met: number, czar_alive: number, ghost_alive: number, reliant_alive: number, countdown: number, chapter2_thread3_shown: number, red_dragon_alive: number, yamato_alive: number, ion_cannons_hold_lock: number, [number]: number, } -- The tables of fields the declarations take. export type MissionFields = { --- OpenReliant's name for the mission, which the game doesn't read. name: string?, } export type FlightGroupFields = { --- The wing the group's ships are listed in: "player", "second", "third" or "none", the default. wing: Wing?, --- The formation the group flies in. formation: Formation?, } export type ShipFields = { --- The ship's type. type: ShipType, --- Its flight group. group: FlightGroup?, --- Its pilot, by its record of pilotstats.bin. pilot: PilotNumber?, --- Where it is, `{ x, y, z }`, in the game's coordinates, Y down; `{ 0, 0, 0 }` by default. position: Vector?, --- Its yaw, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. yaw: number?, --- Its pitch, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. pitch: number?, --- Its roll, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. roll: number?, --- Where it launches from: `{ from = "reliant", gate = 2 }`. By default it doesn't launch. launch: Launch?, --- Its place in a formation: `sabres[2]` is the second point of the formation `sabres`. formation_point: FormationPoint?, --- The loadout tier its missile racks are fitted by; 255, the default, asks for the campaign's. tier: number?, } export type MarkerFields = { --- Its flight group. group: FlightGroup?, --- Its pilot, by its record of pilotstats.bin. pilot: PilotNumber?, --- Where it is, `{ x, y, z }`, in the game's coordinates, Y down; `{ 0, 0, 0 }` by default. position: Vector?, --- Its yaw, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. yaw: number?, --- Its pitch, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. pitch: number?, --- Its roll, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. roll: number?, --- Where it launches from: `{ from = "reliant", gate = 2 }`. By default it doesn't launch. launch: Launch?, --- Its place in a formation: `sabres[2]` is the second point of the formation `sabres`. formation_point: FormationPoint?, --- The loadout tier its missile racks are fitted by; 255, the default, asks for the campaign's. tier: number?, } export type PointFields = { --- Its flight group. group: FlightGroup?, --- Its pilot, by its record of pilotstats.bin. pilot: PilotNumber?, --- Where it is, `{ x, y, z }`, in the game's coordinates, Y down; `{ 0, 0, 0 }` by default. position: Vector?, --- Its yaw, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. yaw: number?, --- Its pitch, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. pitch: number?, --- Its roll, in whole degrees; -1 where the mission leaves the angle unset. 0 by default. roll: number?, --- Where it launches from: `{ from = "reliant", gate = 2 }`. By default it doesn't launch. launch: Launch?, --- Its place in a formation: `sabres[2]` is the second point of the formation `sabres`. formation_point: FormationPoint?, --- The loadout tier its missile racks are fitted by; 255, the default, asks for the campaign's. tier: number?, --- For a point that marks a place on a curve: `{ curve = camera_curve, at = 0.5 }`. marker: Marker?, } export type Launch = { --- The type of ship it launches from, the first of that type in the mission. from: ShipType, --- The gate it launches through. gate: number, } export type Marker = { --- The curve it marks a place on. curve: Curve, --- The share of the way along the curve. at: number?, } export type CurveFields = { --- The ship the curve starts at; none by default. start: MissionShip?, --- The ship the curve ends at; none by default. finish: MissionShip?, --- Where the curve starts. from: Vector?, --- Where the curve ends. to: Vector?, --- The ship the curve's leaving tangent is drawn to. leaving_handle: MissionShip?, --- The ship the curve's arriving tangent is drawn to. arriving_handle: MissionShip?, --- The curve's leaving tangent. leaving: Vector?, --- The curve's arriving tangent. arriving: Vector?, } export type PartFields = { --- `true` runs the part as the mission starts, before any trigger is armed. start: boolean?, } export type TriggerFields = { --- "once", the default, which disarms the trigger as it fires; "always"; or `{ counted = 3 }`, which fires that many times each time the script arms it. repeats: Repeats?, --- The subject's component it watches, by its index; by default the subject itself. component: number?, --- `true` leaves the trigger's thread to the scheduler rather than running it inside the event. deferred: boolean?, --- What the event's "Attacker" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `shot_at`. attacker: (Entity | number)?, --- What the event's "Victim" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `shot_at` and `destroyed`. victim: (Entity | number)?, --- What the event's "Weapon Fired" must be for the trigger to fire: a number. In triggers of `shot_at`. weapon_fired: number?, --- What the event's "Killer" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `destroyed`. killer: (Entity | number)?, --- What the event's "LaunchedShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `launched`. launched_ship: (Entity | number)?, --- What the event's "ReachedShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `ship_reached`. reached_ship: (Entity | number)?, --- What the event's "ApproachingShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `proximity_close` and `proximity_general`. approaching_ship: (Entity | number)?, --- What the event's "ObjectScooped" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `object_scooped`. object_scooped: (Entity | number)?, --- What the event's "JumpedInShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `jumped_in`. jumped_in_ship: (Entity | number)?, --- What the event's "ShipJumpedIn" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `fixed_gate_jumped_in`. ship_jumped_in: (Entity | number)?, --- What the event's "ObjectGrabbed" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `ripper_grabbed_object`. object_grabbed: (Entity | number)?, --- What the event's "ObjectDropped" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `ripper_dropped_object`. object_dropped: (Entity | number)?, --- What the event's "CloakingShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `cloaked` and `decloaked`. cloaking_ship: (Entity | number)?, --- What the event's "Aggressor" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `targetted`. aggressor: (Entity | number)?, --- What the event's "TractoredShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `tractor_beam_locked` and `tractor_beam_broken`. tractored_ship: (Entity | number)?, --- What the event's "TractoringShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `tractor_beam_locked` and `tractor_beam_broken`. tractoring_ship: (Entity | number)?, --- What the event's "ChasedShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `being_chased`. chased_ship: (Entity | number)?, --- What the event's "Chaser" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `being_chased`. chaser: (Entity | number)?, --- What the event's "PlayerTargetted" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `call_reinforcements`. player_targetted: (Entity | number)?, --- What the event's "ExplosionShip" must be for the trigger to fire: a ship, a flight group, a squad or `any_ship`. In triggers of `explosion_ship`. explosion_ship: (Entity | number)?, } export type Counted = { --- How many times the trigger fires each time the script arms it. counted: number, --- How many firings are left as the mission starts; by default as many as it counts. left: number?, } -- The source's own words: its declarations, and the functions and values of its script. --- Gives the mission's own details. declare function mission(fields: MissionFields): () --- Declares a global: its display name and the value it starts with. declare function global(name: string, value: number): number --- Declares a flight group, by its display name. declare function flight_group(name: string, fields: FlightGroupFields?): FlightGroup --- Places a ship, a capital ship or a station, by its display name. declare function ship(name: string, fields: ShipFields): MissionShip --- Places a nav point, by its display name. declare function nav_point(name: string, fields: MarkerFields?): MissionShip --- Places a waypoint, by its display name. declare function waypoint(name: string, fields: MarkerFields?): MissionShip --- Places a point, by its display name, such as one a camera curve runs to. declare function point(name: string, fields: PointFields?): MissionShip --- Places a curve point, by its display name. declare function curve_point(name: string, fields: MarkerFields?): MissionShip --- Declares a squad: its display name and its members in their order, ships, ships' components, flight groups and other squads. declare function squad(name: string, members: { Entity }): Squad --- Declares a formation: its display name and its points, each where it stands from the formation's origin. A ship names a point as `sabres[1]` for the first. declare function formation(name: string, points: { Vector }): Formation --- Declares a curve, which has no display name. declare function curve(fields: CurveFields): Curve --- Declares a part: its display name and its code, a function whose parameters are the part's arguments. A part without a function has no block. declare function part(name: string, code: ((A...) -> number)?, fields: PartFields?): (A...) -> number --- Declares code that more than one trigger runs. declare function handler(code: (A...) -> number): (A...) -> number --- Declares a trigger: its subject, the ship, flight group or squad whose events it watches, or nil for none; its condition; its fields, which can be left out; and the code its events run, whose parameters are the values the condition's events carry. declare function on(subject: Entity?, condition: Condition, fields: (TriggerFields | Code)?, code: Code?): () --- A ship's component, by its index. declare function component(object: T, index: number): T --- Any of the players' ships, as a value a trigger checks. declare any_ship: MissionShip --- Runs a command the catalogue doesn't have, by its number. declare function command(number: number, ...: any): () --- Starts a part on a thread of its own, with its arguments after the part. declare function spawn(part: (A...) -> number, ...: A...): () --- Rolls a random choice: `local roll = random()`, then an `if` over the arms' thresholds, `if roll < 50 then`, with the default as `else`. declare function random(): number --- The result of the last command. declare function result(): number --- The game's variables, by their names, or by their numbers, as in `game[37]`, for those without. declare game: GameVariables --- A value of the event that started the thread, by its place, in a part. declare function thread_value(place: number): any --- A value an object keeps of its last event of a condition, by its label in the condition catalogue: `last_event(ship, "shot_at", "Hull Damage")`. declare function last_event(object: Entity, condition: Condition, value: EventValue): any --- A ship past the mission's records, by its index. declare function ship_index(index: number): MissionShip --- A flight group past the mission's records, by its index. declare function flight_group_index(index: number): FlightGroup --- A squad past the mission's records, by its index. declare function squad_index(index: number): Squad --- A curve past the mission's records, by its index. declare function curve_index(index: number): Curve --- A global past the mission's records, by its index. declare function global_index(index: number): number --- A part past the mission's records, by its index. declare function part_index(index: number): Part --- An object by its number in the built mission. A number past its records gets an entry of no record in the object table. declare function object_index(id: number): Entity --- A formation past the mission's records, by its index. declare function formation_index(index: number): Formation --- A formation point by its index among all the mission's points. declare function formation_point_index(index: number): FormationPoint --- Whether a ship is in a flight group. declare function in_flight_group(object: Entity, group: FlightGroup): boolean --- Whether a ship isn't in a flight group. declare function not_in_flight_group(object: Entity, group: FlightGroup): boolean --- Whether an object is in a squad. declare function in_squad(object: Entity, squad: Squad): boolean --- Whether an object isn't in a squad. declare function not_in_squad(object: Entity, squad: Squad): boolean --- `a > b`, comparing floating-point numbers. declare function greater_f(a: number, b: number): boolean --- `a >= b`, comparing floating-point numbers. declare function greater_equal_f(a: number, b: number): boolean --- `a < b`, comparing floating-point numbers. declare function less_f(a: number, b: number): boolean --- `a <= b`, comparing floating-point numbers. declare function less_equal_f(a: number, b: number): boolean --- `a + b`, in floating point. declare function add_f(a: number, b: number): number --- `a - b`, in floating point. declare function sub_f(a: number, b: number): number --- `a * b`, in floating point. declare function mul_f(a: number, b: number): number --- `a / b`, in floating point. declare function div_f(a: number, b: number): number --- `target += value`, in floating point. declare function add_assign_f(target: number, value: number): () --- `target -= value`, in floating point. declare function sub_assign_f(target: number, value: number): () --- `target *= value`, in floating point. declare function mul_assign_f(target: number, value: number): () --- `target /= value`, in floating point. declare function div_assign_f(target: number, value: number): () -- The game's commands, from its catalogue. Their names, their parameters' labels and their -- descriptions are the developers' own. A command the catalogue doesn't have runs as -- `command(number, ...)`. --- Test Function --- @param test_param_1 -- Test Param 1 --- @param test_param_2 -- Test Param 2 declare function PrintShipName(test_param_1: MissionShip | FlightGroup | string, test_param_2: number): () --- Creates a timer to invoke a function --- @param unique_id_to_identify_timer -- Unique ID to identify timer --- @param function_to_execute_when_timer_activates -- Function to execute when timer activates --- @param number_of_seconds_before_timer_activates -- Number of seconds before timer activates --- @param number_of_activations -- Number of activations (0 == continuous) declare function CreateTimer(unique_id_to_identify_timer: number, function_to_execute_when_timer_activates: Part, number_of_seconds_before_timer_activates: number, number_of_activations: number): () --- Destroys all timers associated with a function --- @param unique_id_of_timer_to_be_destroyed -- Unique ID of timer to be destroyed declare function DestroyTimer(unique_id_of_timer_to_be_destroyed: number): () --- Initializes a flight group --- @param flight_group_name_to_initialize -- Flight Group name to initialize declare function CreateFlightGroup(flight_group_name_to_initialize: FlightGroup): () --- Destroys a flight group --- @param flight_group_name_to_destroy -- Flight Group name to destroy declare function DestroyFlightGroup(flight_group_name_to_destroy: FlightGroup): () --- Stop Executing for N Seconds --- @param number_of_seconds_to_wait -- Number of Seconds to wait declare function Wait(number_of_seconds_to_wait: number): () --- Play a speech file --- @param name_of_speech_file -- Name of speech file declare function PlaySpeech(name_of_speech_file: string): () --- Pause script until speech is complete declare function WaitForSpeech(): () --- Play a movie in the comms window --- @param name_of_movie_file -- Name of movie file --- @param name_of_speech_file -- Name of speech file --- @param gtext_thingy_hangover_err -- GText thingy hangover err.... declare function PlayCommsMovie(name_of_movie_file: string, name_of_speech_file: string, gtext_thingy_hangover_err: number): () --- Pause script until comms movie is complete declare function WaitForMovie(): () --- Prints a debugging message on screen --- @param text_to_print -- Text to print declare function PrintDebugMessage(text_to_print: string): () --- Sets a Ship or Flight Group's AI pattern --- @param entity_to_be_controlled -- Entity to be controlled --- @param ai_mode -- AI Mode --- @param initialize_immediately -- Initialize Immediately (T/F) --- @param entity_to_target -- Entity to target (can be NULL) declare function SetAI(entity_to_be_controlled: Entity, ai_mode: Order, initialize_immediately: number, entity_to_target: Entity?): () --- Resets all AI intructions for an entity --- @param entity_to_be_cleared -- Entity to be cleared declare function ClearAI(entity_to_be_cleared: Entity): () --- Sends a Ship to follow a patrol route --- @param entity_to_send_to_patrol_route -- Entity to send to patrol route --- @param patrol_route_to_follow -- Patrol route to follow declare function SetPatrolRoute(entity_to_send_to_patrol_route: MissionShip | FlightGroup, patrol_route_to_follow: FlightGroup): () --- Assigns a pilot to fly a ship --- @param ship_to_host_pilot -- Ship to host pilot --- @param pilot_to_fly_ship -- Pilot to fly ship declare function SetPilot(ship_to_host_pilot: MissionShip, pilot_to_fly_ship: PilotNumber): () --- Enables or disables the state of a trigger --- @param entity_owning_trigger -- Entity owning trigger --- @param trigger_type_to_enable_disable -- Trigger type to enable/disable --- @param true_for_enable -- TRUE for enable; FALSE for disable declare function SetTriggerState(entity_owning_trigger: Entity, trigger_type_to_enable_disable: Condition, true_for_enable: number): () --- Sets the camera to start following a predefined path --- @param curve_for_camera_to_follow -- Curve for camera to follow (or Ship for static cam) --- @param ship_for_camera_to_track -- Ship for camera to track (can be NULL) --- @param duration_of_camera -- Duration of camera (seconds) --- @param tracks_curve_to_this_ship_s_speed -- Tracks curve to this ship's speed (can be NULL) --- @param ships_to_disable_for_duration -- Ships to disable for duration declare function StartDirectorCam(curve_for_camera_to_follow: MissionShip | Curve, ship_for_camera_to_track: MissionShip?, duration_of_camera: number, tracks_curve_to_this_ship_s_speed: MissionShip?, ships_to_disable_for_duration: Entity?): () --- Starts a specific animation for a ship --- @param ship_to_animate -- Ship to animate --- @param animation_name -- Animation Name declare function StartShipAnimation(ship_to_animate: MissionShip, animation_name: string): () --- Sets an ship/flight group to follow a predefined path --- @param entity_to_follow_curve -- Entity to follow curve --- @param the_curve_for_the_entity_to_follow -- The curve for the entity to follow --- @param duration_of_movement -- Duration of movement (seconds) declare function ShipFollowCurve(entity_to_follow_curve: MissionShip | FlightGroup, the_curve_for_the_entity_to_follow: Curve, duration_of_movement: number): () --- Sets up a ship ready to launch --- @param entity_to_be_launched -- Entity to be launched --- @param ship_to_launch_from -- Ship to launch from --- @param launch_position -- Launch position declare function SetupLaunch(entity_to_be_launched: Entity, ship_to_launch_from: Entity, launch_position: number): () --- Launches a ship --- @param entity_to_be_launched -- Entity to be launched declare function StartLaunch(entity_to_be_launched: Entity): () --- Prints a subtitle so we can understand those foreign bods --- @param gtext_pilot_define -- GText pilot define declare function DisplaySubTitle(gtext_pilot_define: number): () --- Clears/removes any priortiy order of the entity --- @param entity_to_have_priorities_reset -- Entity to have priorities reset declare function ResetCodePriority(entity_to_have_priorities_reset: Entity): () --- Stops script execution, will resume when trigger re-enabled declare function InterruptTriggerCode(): () --- Play a movie in the comms window --- @param ship_sending_comm -- Ship sending comm --- @param head_movement -- Head movement --- @param name_of_speech_file -- Name of speech file declare function CommsFromShip(ship_sending_comm: MissionShip, head_movement: FaceFilm, name_of_speech_file: string): () --- Play a movie in the comms window --- @param ship_sending_comm -- Ship sending comm --- @param head_movement -- Head movement --- @param name_of_speech_file -- Name of speech file declare function CommsFromPilot(ship_sending_comm: PilotNumber, head_movement: FaceFilm, name_of_speech_file: string): () --- Makes or stops a ship being invulnerable --- @param ship_concerned -- Ship concerned --- @param invulnerability -- Invulnerability (0 - non, 1 - player can hit, 2 - fully invulnerable, 3 - Eject before exploding) declare function SetInvulnerability(ship_concerned: Entity, invulnerability: number): () --- Sets an ship/flight group to follow a predefined path --- @param entity_to_follow_curve -- Entity to follow curve --- @param the_curve_for_the_entity_to_follow -- The curve for the entity to follow --- @param duration_of_movement -- Duration of movement (seconds) --- @param entity_for_curve_to_use_as_its_start_offset -- Entity for curve to use as its start offset declare function MovingShipFollowCurve(entity_to_follow_curve: MissionShip | FlightGroup, the_curve_for_the_entity_to_follow: Curve, duration_of_movement: number, entity_for_curve_to_use_as_its_start_offset: MissionShip): () --- Stops entities from being processed --- @param entity_concerned -- Entity concerned --- @param true_false -- True/False declare function DisableObject(entity_concerned: Entity, true_false: number): () --- Positions an entity relative to a ship/point's movement --- @param entity_to_position -- Entity to position --- @param ship_point_to_use_as_relative_marker -- Ship/Point to use as relative marker declare function PositionRelative(entity_to_position: Entity, ship_point_to_use_as_relative_marker: MissionShip): () --- Returns the number of seconds ago when the player jumped declare function WhenPlayerLastJumped(): () --- Starts director cam for a missile --- @param ship_that_fired_missile -- Ship that fired missile declare function StartMissileCam(ship_that_fired_missile: MissionShip): () --- Starts chase cam --- @param ship_to_follow -- Ship to follow declare function StartChaseCam(ship_to_follow: MissionShip?): () --- Sets player's target --- @param player_ship -- Player Ship --- @param ship_to_target -- Ship to target declare function SetPlayerTarget(player_ship: MissionShip, ship_to_target: MissionShip): () --- Sets an entity to be targetable or not --- @param entity -- Entity --- @param true_object_targetable -- true - object targetable, false - not targetable declare function SetTargetable(entity: Entity, true_object_targetable: number): () --- Play a Music Track --- @param name_of_music_file -- Name of music file --- @param true_play_immediately -- True - Play Immediately, false - Fade old tune first declare function PlayMusic(name_of_music_file: string, true_play_immediately: number): () --- Stops the Current Director Camera declare function StopDirectorCam(): () --- Sets the sphere for the action to be contained in. --- @param object_to_action_around -- Object to action around --- @param radius_of_sphere_0_for_default -- Radius of sphere - 0 for default declare function SetActionCentre(object_to_action_around: MissionShip, radius_of_sphere_0_for_default: number): () --- Dock Ship. --- @param ship_to_dock -- Ship to dock --- @param object_ship_is_to_dock_to -- Object ship is to dock to --- @param docking_port -- Docking port declare function Dock(ship_to_dock: MissionShip, object_ship_is_to_dock_to: MissionShip, docking_port: number): () --- Stops bad guys from taunting the player --- @param true_disable_bad_guy_taunts -- true - Disable bad guy taunts declare function DisableTaunts(true_disable_bad_guy_taunts: number): () --- Fly --- @param ship_param -- Ship --- @param point_to_fly_to -- Point to fly to --- @param speed -- Speed (0 - Default) declare function Fly(ship_param: Entity, point_to_fly_to: MissionShip?, speed: number): () --- Play a movie in the comms window (without looping) --- @param ship_sending_comm -- Ship sending comm --- @param head_movement -- Head movement --- @param name_of_speech_file -- Name of speech file declare function CommsFromShipOnce(ship_sending_comm: MissionShip, head_movement: FaceFilm, name_of_speech_file: string): () --- Play a movie in the comms window (without looping) --- @param ship_sending_comm -- Ship sending comm --- @param head_movement -- Head movement --- @param name_of_speech_file -- Name of speech file declare function CommsFromPilotOnce(ship_sending_comm: PilotNumber, head_movement: FaceFilm, name_of_speech_file: string): () --- Disable Object lights --- @param entity -- Entity --- @param true_or_false -- True or False declare function DisableLights(entity: Entity, true_or_false: number): () --- Sets an environment effect --- @param effect_type_to_set -- Effect type to set --- @param on_param -- On(TRUE) or Off(FALSE) declare function SetEnvironmentFX(effect_type_to_set: EnvironmentEffect, on_param: number): () --- Jay's shit declare function MultiPlayerSync(): () --- Stops hard coded comms events from triggering --- @param true_disable_all_hard_coded_comms_events -- True - Disable all hard coded comms events declare function DisableGenericComms(true_disable_all_hard_coded_comms_events: number): () --- Disables guns --- @param entity -- Entity --- @param true_disable_guns -- TRUE - disable guns, FALSE enable guns declare function DisableGuns(entity: Entity, true_disable_guns: number): () --- Set Nav Point --- @param entity -- Entity --- @param nav_point_param -- Nav Point declare function SetNavPoint(entity: Entity, nav_point_param: MissionShip?): () --- Set Escort Point --- @param entity -- Entity --- @param escort_point -- Escort Point declare function SetEscortPoint(entity: Entity, escort_point: MissionShip?): () --- Reset the player's afterburner fuel declare function ResetAfterBurners(): () --- Disables missiles --- @param entity -- Entity --- @param true_disable_missiles -- TRUE - disable missiles, FALSE enable missiles declare function DisableMissiles(entity: Entity, true_disable_missiles: number): () --- Disables engines --- @param entity -- Entity --- @param true_disable_engines -- TRUE - disable engines, FALSE enable engines declare function DisableEngines(entity: Entity, true_disable_engines: number): () --- Disables eject --- @param entity -- Entity --- @param true_disable_eject -- TRUE - disable eject, FALSE enable eject declare function DisableEject(entity: Entity, true_disable_eject: number): () --- Sets entity(s) to be hostile or not --- @param entity -- Entity --- @param true_entity -- true - entity(s) hostile, false - friendly declare function SetHostile(entity: Entity, true_entity: number): () --- Resets the player to a random spawn location (deathmatch only) declare function ResetToSpawnPositions(): () --- Updates state of environment FX instead of waiting for next jump declare function UpdateEnvironmentFXState(): () --- Set Primary Target --- @param entity -- Entity declare function SetPrimaryTarget(entity: MissionShip?): () --- Wait for ships to finish jumping or launching --- @param entity -- Entity declare function WaitForJumpOrLaunch(entity: Entity): () --- Sets entity(s) so comms can/cant disturb them --- @param entity -- Entity --- @param true_dont_disturb -- true - dont disturb, false - can disturb declare function DoNotDisturb(entity: Entity, true_dont_disturb: number): () --- Sets the nebula material and lighting --- @param index_of_nebula_material -- Index of nebula material (0..6) declare function SetEnvironmentFXNebula(index_of_nebula_material: number): () --- Starts a specific animation for a ship in reverse --- @param ship_to_animate -- Ship to animate --- @param animation_name -- Animation Name declare function StartShipAnimationReverse(ship_to_animate: MissionShip, animation_name: string): () --- Snaps a ship to a specific point --- @param ship_to_move -- Ship to move --- @param point_to_move_to -- Point to move to declare function SnapToPoint(ship_to_move: MissionShip, point_to_move_to: MissionShip): () --- Plays the Foster's Last Stand movie! declare function PlayFostersLastStand(): () --- Opens up a window on the HUD --- @param instrument_number_to_open -- Instrument number to open declare function OpenInstrument(instrument_number_to_open: number): () --- Closes a window on the HUD --- @param instrument_number_to_close -- Instrument number to close declare function CloseInstrument(instrument_number_to_close: number): () --- Destroys Subobject --- @param sub_object_to_destroy -- SubObject to destroy --- @param true_keep_damaged_model -- true - keep damaged model, false - no damaged model declare function DestroySubObject(sub_object_to_destroy: MissionShip, true_keep_damaged_model: number): () --- Sets a Mission Objective's status --- @param objective_number -- Objective number --- @param state -- State(0=Inactive, 1=Active, 2=Current) declare function SetObjective(objective_number: number, state: number): () --- Sets an Ejected pod's chances of survival --- @param probability_of_nanny_rescue -- Probability of Nanny Rescue ( 1-100% ) --- @param probability_of_antanov_capture -- Probability of Antanov Capture ( 1-100% ) --- @param probability_of_being_destroyed -- Probability of being Destroyed ( 1-100% ) declare function SetRescueProbabilities(probability_of_nanny_rescue: number, probability_of_antanov_capture: number, probability_of_being_destroyed: number): () --- Returns TRUE if ship is the players ship --- @param ship_to_test -- Ship to test declare function IsShipThisPlayer(ship_to_test: MissionShip): () --- Sets a Flyback marker on a ship or a group of ships after a set range --- @param entity_concerned -- Entity concerned --- @param range -- Range declare function SetFlybackMarker(entity_concerned: Entity, range: number): () --- Resets all flyback markers declare function ResetFlybackMarker(): () --- Stops a specific animation for a ship --- @param ship_to_stop_animation_for -- Ship to stop animation for --- @param animation_name -- Animation Name declare function StopShipAnimation(ship_to_stop_animation_for: MissionShip, animation_name: string): () --- Enables/Disables ship avoidance for the ship(s) --- @param entity_concerned -- Entity concerned --- @param true_disable_avoidance_code -- TRUE - Disable Avoidance code, FALSE - Enable avoidance code declare function SetShipAvoidance(entity_concerned: Entity, true_disable_avoidance_code: number): () --- Enables/Disables Match Speed with target --- @param entity_concerned -- Entity concerned --- @param true_enable_match_speed -- TRUE - Enable Match Speed, FALSE - Disable Match Speed declare function MatchSpeed(entity_concerned: MissionShip, true_enable_match_speed: number): () --- Sets an ship/flight group to follow a predefined path --- @param entity_to_follow_curve -- Entity to follow curve --- @param the_curve_for_the_entity_to_follow -- The curve for the entity to follow --- @param duration_of_movement -- Duration of movement (seconds) --- @param entity_for_curve_to_use_as_its_start_offset -- Entity for curve to use as its start offset declare function MovingShipBackupCurve(entity_to_follow_curve: MissionShip | FlightGroup, the_curve_for_the_entity_to_follow: Curve, duration_of_movement: number, entity_for_curve_to_use_as_its_start_offset: MissionShip?): () --- Stops script until key pressed --- @param key_number_to_wait_for -- Key number to wait for declare function WaitForKey(key_number_to_wait_for: number): () --- End the mission, and drop to death sequence declare function TerminateMission(): () --- Sets the target for a ships turret --- @param turret -- Turret --- @param entity_to_target -- Entity to target declare function TurretSetTarget(turret: MissionShip | Squad, entity_to_target: MissionShip): () --- Enables or disables the state of a trigger --- @param entity_owning_trigger -- Entity owning trigger --- @param trigger_type_to_enable_disable -- Trigger type to enable/disable --- @param true_for_enable -- TRUE for enable; FALSE for disable --- @param trigger_type_number -- Trigger Type Number(for triggers of same type - Count from 0) declare function SetAnyTriggerState(entity_owning_trigger: Entity, trigger_type_to_enable_disable: Condition, true_for_enable: number, trigger_type_number: number): () --- Waits for director cam to finish declare function WaitForDirectorCam(): () --- DANGER DANGER:Cancels ALL current script execution except the caller declare function KillAllScriptExecutionExecptMe(): () --- Sets the camera to start following a predefined path --- @param curve_for_camera_to_follow -- Curve for camera to follow (or Ship for static cam) --- @param ship_for_camera_to_track -- Ship for camera to track (can be NULL) --- @param duration_of_camera -- Duration of camera (seconds) --- @param tracks_curve_to_this_ship_s_speed -- Tracks curve to this ship's speed (can be NULL) --- @param ships_to_disable_for_duration -- Ships to disable for duration declare function StackDirectorCam(curve_for_camera_to_follow: MissionShip | Curve, ship_for_camera_to_track: MissionShip?, duration_of_camera: number, tracks_curve_to_this_ship_s_speed: MissionShip?, ships_to_disable_for_duration: Entity?): () --- Sets the scanner off --- @param object_to_scan_for_null_to_disable -- Object to scan for - NULL to disable declare function Scanner(object_to_scan_for_null_to_disable: MissionShip?): () --- Replaces subobject with another object --- @param sub_object_to_replace -- SubObject to replace --- @param object_to_replace_it_with -- Object to replace it with declare function ReplaceSubObject(sub_object_to_replace: MissionShip, object_to_replace_it_with: MissionShip): () --- Fires ships guns --- @param ship_to_fire -- Ship to fire --- @param duration -- Duration declare function Fire(ship_to_fire: MissionShip, duration: number): () --- Syncs scripts --- @param sync_number -- Sync number declare function MultiplayerScriptSync(sync_number: number): () --- Friendly Fire declare function FriendlyFire(): () --- Cloak --- @param entity_to_cloak -- Entity to cloak --- @param true_cloak_on -- True - Cloak on, False - cloak off declare function Cloak(entity_to_cloak: Entity, true_cloak_on: number): () --- Replenish Weapons --- @param entity_to_cloak -- Entity to cloak declare function ReplenishWeapons(entity_to_cloak: MissionShip): () --- Blag blag blag blag blag --- @param entity_to_cloak -- Entity to cloak declare function WillsBlag(entity_to_cloak: MissionShip): () --- Show Hud Icon --- @param icon -- Icon --- @param param_0_off -- 0 - off, 1 - on, 2 - flash declare function ShowHudIcon(icon: number, param_0_off: number): () --- Disable Listing --- @param ship_param -- Ship --- @param true_stop_listing -- true - stop listing, false - enable listing declare function DisableListing(ship_param: MissionShip, true_stop_listing: number): () --- Disables/enables object (e.g. planet) when the next jump/warp is made --- @param ship_param -- Ship --- @param true_disable -- true - disable, false - enable declare function DisableObjectAtNextJump(ship_param: MissionShip, true_disable: number): () --- Darrens Naughty Blag --- @param ship_param -- Ship --- @param ship_param_2 -- Ship declare function DarrensNaughtyBlag(ship_param: MissionShip, ship_param_2: MissionShip): ()