Banner Image

Module Functional.Fox

Functional - Yet Another Missile Trainer.

Practice to evade missiles without being destroyed.

Main Features:

  • Handles air-to-air and surface-to-air missiles.
  • Define your own training zones on the map. Players in this zone will be protected.
  • Define launch zones. Only missiles launched in these zones are tracked.
  • Define protected AI groups.
  • F10 radio menu to adjust settings for each player.
  • Alert on missile launch (optional).
  • Marker of missile launch position (optional).
  • Adaptive update of missile-to-player distance.
  • Finite State Machine (FSM) implementation.
  • Easy to use. See examples below.

Demo Missions


Author: funkyfranky

Global(s)

Global FOX

Fox 3!


Banner Image

The FOX Concept

As you probably know Fox is a NATO brevity code for launching air-to-air munition.

#FOX FOX

Fox 3!


Banner Image

The FOX Concept

As you probably know Fox is a NATO brevity code for launching air-to-air munition.

Therefore, the class name is not 100% accurate as this script handles air-to-air but also surface-to-air missiles.

Basic Script

-- Create a new missile trainer object.
fox=FOX:New()

-- Start missile trainer.
fox:Start()

Training Zones

Players are only protected if they are inside one of the training zones.

-- Create a new missile trainer object.
fox=FOX:New()

-- Add training zones.
fox:AddSafeZone(ZONE:New("Training Zone Alpha"))
fox:AddSafeZone(ZONE:New("Training Zone Bravo"))

-- Start missile trainer.
fox:Start()

Launch Zones

Missile launches are only monitored if the shooter is inside the defined launch zone.

-- Create a new missile trainer object.
fox=FOX:New()

-- Add training zones.
fox:AddLaunchZone(ZONE:New("Launch Zone SA-10 Krim"))
fox:AddLaunchZone(ZONE:New("Training Zone Bravo"))

-- Start missile trainer.
fox:Start()

Protected AI Groups

Define AI protected groups. These groups cannot be harmed by missiles.

Add Individual Groups

-- Create a new missile trainer object.
fox=FOX:New()

-- Add single protected group(s).
fox:AddProtectedGroup(GROUP:FindByName("A-10 Protected"))
fox:AddProtectedGroup(GROUP:FindByName("Yak-40"))

-- Start missile trainer.
fox:Start()

Notes

The script needs to be running before you enter an airplane slot. If FOX is not available to you, go back to observers and then join a slot again.

Type(s)

FOX , extends Core.Fsm#FSM
Fields and Methods inherited from FOX Description

FOX:AddLaunchZone(zone)

Add a launch zone.

FOX:AddProtectedGroup(group)

Add a group to the protected set.

FOX:AddSafeZone(zone)

Add a training zone.

FOX.ClassName

Name of the class.

FOX.Debug

Debug mode. Messages to all about status.

FOX:EnterSafeZone(player)

Triggers the FSM event "EnterSafeZone".

FOX:ExitSafeZone(player)

Triggers the FSM event "ExitSafeZone".

FOX:GetMissileTarget(missile)

Get missile target.

FOX.MenuF10

Main radio menu on group level.

FOX.MenuF10Root

Main radio menu on mission level.

FOX:MissileDestroyed(missile)

Triggers the FSM event "MissileDestroyed".

FOX:MissileLaunch(missile)

Triggers the FSM event "MissileLaunch".

FOX:New()

Create a new FOX class object.

FOX:OnAfterEnterSafeZone(From, Event, To, player)

On after "EnterSafeZone" event user function.

FOX:OnAfterExitSafeZone(From, Event, To, player)

On after "ExitSafeZone" event user function.

FOX:OnAfterMissileDestroyed(From, Event, To, missile)

On after "MissileDestroyed" event user function.

FOX:OnAfterMissileLaunch(From, Event, To, missile)

On after "MissileLaunch" event user function.

FOX:OnEventBirth(EventData)

FOX event handler for event birth.

FOX:OnEventHit(EventData)

FOX event handler for event hit.

FOX:OnEventPlayerEnterAircraft(EventData)

FOX event handler for event birth.

FOX:OnEventShot(EventData)

FOX event handler for event shot (when a unit releases a rocket or bomb (but not a fast firing gun).

FOX:SetDebugOff()

Set debug mode off.

FOX:SetDebugOn()

Set debug mode on.

FOX:SetDebugOnOff(switch)

Set debug mode on/off.

FOX:SetDefaultLaunchAlerts(switch)

Set default player setting for launch alerts.

FOX:SetDefaultLaunchMarks(switch)

Set default player setting for marking missile launch coordinates

FOX:SetDefaultMissileDestruction(switch)

Set default player setting for missile destruction.

FOX:SetDisableF10Menu()

Disable F10 menu for all players.

FOX:SetEnableF10Menu()

Enable F10 menu for all players.

FOX:SetExplosionDistance(distance)

Set missile-player distance when missile is destroyed.

FOX:SetExplosionDistanceBigMissiles(distance, explosivemass)

Set missile-player distance when BIG missiles are destroyed.

FOX:SetExplosionPower(power)

Set explosion power.

FOX:SetProtectedGroupSet(groupset)

Add a protected set of groups.

FOX:SetVerbosity(VerbosityLevel)

Set verbosity level.

FOX:Start()

Triggers the FSM event "Start".

FOX:Status()

Triggers the FSM event "Status".

FOX:_AddF10Commands(_unitName)

Add menu commands for player.

FOX:_CheckCoordLaunch(coord)

Check if a coordinate lies within a launch zone.

FOX:_CheckCoordSafe(coord)

Check if a coordinate lies within a safe training zone.

FOX:_CheckMissileStatus()

Missile status.

FOX:_CheckPlayers()

Check status of players.

FOX:_DeadText()

Get a random text message in case you die.

FOX._FuncImpact(weapon, self, missile)

Callback function on impact or destroy otherwise.

FOX._FuncTrack(weapon, self, missile)

Function called from weapon tracking.

FOX:_GetNotchingHeadings(weapon)

Returns the unit of a player and the player name.

FOX:_GetPlayerFromUnit(unit)

Retruns the player data from a unit.

FOX:_GetPlayerFromUnitname(unitName)

Returns the player data from a unit name.

FOX:_GetPlayerUnitAndName(_unitName)

Returns the unit of a player and the player name.

FOX:_GetTargetMissiles(playername)

Turn player's launch alert on/off.

FOX:_GetWeapongHeading(weapon)

Returns the unit of a player and the player name.

FOX:_IsProtected(targetunit)

Check if missile target is protected.

FOX:_MyStatus(_unitname)

Turn player's launch alert on/off.

FOX:_RemoveMissile(missile)

Remove missile.

FOX:_SayNotchingHeadings(playerData, weapon)

Tell player notching headings.

FOX:_ToggleDestroyMissiles(_unitname)

Turn destruction of missiles on/off for player.

FOX:_ToggleLaunchAlert(_unitname)

Turn player's launch alert on/off.

FOX:_ToggleLaunchMark(_unitname)

Turn player's launch marks on/off.

FOX:__EnterSafeZone(delay, player)

Triggers the FSM delayed event "EnterSafeZone".

FOX:__ExitSafeZone(delay, player)

Triggers the FSM delayed event "ExitSafeZone".

FOX:__MissileDestroyed(delay, missile)

Triggers the FSM delayed event "MissileDestroyed".

FOX:__MissileLaunch(delay, missile)

Triggers the FSM delayed event "MissileLaunch".

FOX:__Start(delay)

Triggers the FSM event "Start" after a delay.

FOX:__Status(delay)

Triggers the FSM event "Status" after a delay.

FOX:__Stop(delay)

Triggers the FSM event "Stop" after a delay.

FOX.bigmissilemass

Explosion power of big missiles. Default 50 kg TNT. Big missiles will be destroyed earlier.

FOX.destroy

Default player setting for destroying missiles.

FOX.dt00

Time step [sec] for missile position updates if distance to target < 1 km. Default 0.01 sec.

FOX.dt01

Time step [sec] for missile position updates if distance to target > 1 km and < 5 km. Default 0.1 sec.

FOX.dt05

Time step [sec] for missile position updates if distance to target > 5 km and < 10 km. Default 0.5 sec.

FOX.dt10

Time step [sec] for missile position updates if distance to target > 10 km and < 50 km. Default 1 sec.

FOX.dt50

Time step [sec] for missile position updates if distance to target > 50 km. Default 5 sec.

FOX.explosiondist

Missile player distance in meters for destroying smaller missiles. Default 200 m.

FOX.explosiondist2

Missile player distance in meters for destroying big missiles. Default 500 m.

FOX.explosionpower

Power of explostion when destroying the missile in kg TNT. Default 5 kg TNT.

FOX.launchalert

Default player setting for launch alerts.

FOX.launchzones

Table of launch zones.

FOX.lid

Class id string for output to DCS log file.

FOX.marklaunch

Default player setting for mark launch coordinates.

FOX.menuadded

Table of groups the menu was added for.

FOX.menudisabled

If true, F10 menu for players is disabled.

FOX.missiles

Table of tracked missiles.

FOX:onafterMissileLaunch(From, Event, To, missile)

Missle launch event.

FOX:onafterStart(From, Event, To)

On after Start event.

FOX:onafterStatus(From, Event, To)

Check spawn queue and spawn aircraft if necessary.

FOX:onafterStop(From, Event, To)

On after Stop event.

FOX.players

Table of players.

FOX.protectedset

Set of protected groups.

FOX.safezones

Table of practice zones.

FOX.verbose

Verbosity level.

FOX.version

FOX class version.

Fields and Methods inherited from FSM Description

FOX:AddEndState(State)

Adds an End state.

FOX:AddProcess(From, Event, Process, ReturnEvents)

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

FOX:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

FOX:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

FOX:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

FOX.CallScheduler

FOX.Events

FOX:GetCurrentState()

Get current state.

FOX:GetEndStates()

Returns the End states.

FOX:GetProcess(From, Event)

FOX:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

FOX:GetScores()

Returns a table with the scores defined.

FOX:GetStartState()

Returns the start state of the FSM.

FOX:GetState()

Get current state.

FOX:GetSubs()

Returns a table with the Subs defined.

FOX:GetTransitions()

Returns a table of the transition rules defined within the FSM.

FOX:Is(State)

Check if FSM is in state.

FOX:LoadCallBacks(CallBackTable)

Load call backs.

FOX:New()

Creates a new FSM object.

FOX.Scores

FOX:SetProcess(From, Event, Fsm)

FOX:SetStartState(State)

Sets the start state of the FSM.

FOX._EndStates

FOX._EventSchedules

FOX._Processes

FOX._Scores

FOX._StartState

FOX._Transitions

FOX:_add_to_map(Map, Event)

Add to map.

FOX:_call_handler(step, trigger, params, EventName)

Call handler.

FOX:_create_transition(EventName)

Create transition.

FOX:_delayed_transition(EventName)

Delayed transition.

FOX:_eventmap(Events, EventStructure)

Event map.

FOX:_gosub(ParentFrom, ParentEvent)

Go sub.

FOX:_handler(EventName, ...)

Handler.

FOX:_isendstate(Current)

Is end state.

FOX:_submap(subs, sub, name)

Sub maps.

FOX:can(e)

Check if can do an event.

FOX:cannot(e)

Check if cannot do an event.

FOX.current

FOX.endstates

FOX:is(State, state)

Check if FSM is in state.

FOX.options

FOX.subs

Fields and Methods inherited from FOX.MissileData Description

FOX.MissileData.Weapon

Weapon object.

FOX.MissileData.active

If true the missile is active.

FOX.MissileData.explosive

Explosive mass in kg TNT.

FOX.MissileData.fuseDist

Fuse distance in meters.

FOX.MissileData.missileCoord

Missile coordinate during tracking.

FOX.MissileData.missileName

Name of missile.

FOX.MissileData.missileRange

Range of missile in meters.

FOX.MissileData.missileType

Type of missile.

FOX.MissileData.shooterCoalition

Coalition side of the shooter.

FOX.MissileData.shooterGroup

Group that shot the missile.

FOX.MissileData.shooterName

Name of the shooter unit.

FOX.MissileData.shooterUnit

Unit that shot the missile.

FOX.MissileData.shotCoord

Coordinate where the missile was fired.

FOX.MissileData.shotTime

Abs. mission time in seconds the missile was fired.

FOX.MissileData.targetName

Name of the target unit or "unknown".

FOX.MissileData.targetOrig

Name of the "original" target, i.e. the one right after launched.

FOX.MissileData.targetPlayer

Player that was targeted or nil.

FOX.MissileData.targetUnit

Unit that was targeted.

FOX.MissileData.weapon

Missile weapon object.

Fields and Methods inherited from FOX.PlayerData Description

FOX.PlayerData.callsign

Callsign of player.

FOX.PlayerData.client

Client object of player.

FOX.PlayerData.coalition

Coalition number of player.

FOX.PlayerData.dead

Number of missiles not defeated.

FOX.PlayerData.defeated

Number of missiles defeated.

FOX.PlayerData.destroy

Destroy missile.

FOX.PlayerData.group

Aircraft group of player.

FOX.PlayerData.groupname

Name of the the player aircraft group.

FOX.PlayerData.inzone

Player is inside a protected zone.

FOX.PlayerData.launchalert

Alert player on detected missile launch.

FOX.PlayerData.marklaunch

Mark position of launched missile on F10 map.

FOX.PlayerData.name

Player name.

FOX.PlayerData.unit

Aircraft of the player.

FOX.PlayerData.unitname

Name of the unit.

FOX class.

Field(s)

#string FOX.ClassName

Name of the class.

#boolean FOX.Debug

Debug mode. Messages to all about status.

#table FOX.MenuF10

Main radio menu on group level.

#table FOX.MenuF10Root

Main radio menu on mission level.

#number FOX.bigmissilemass

Explosion power of big missiles. Default 50 kg TNT. Big missiles will be destroyed earlier.

#boolean FOX.destroy

Default player setting for destroying missiles.

#number FOX.dt00

Time step [sec] for missile position updates if distance to target < 1 km. Default 0.01 sec.

#number FOX.dt01

Time step [sec] for missile position updates if distance to target > 1 km and < 5 km. Default 0.1 sec.

#number FOX.dt05

Time step [sec] for missile position updates if distance to target > 5 km and < 10 km. Default 0.5 sec.

#number FOX.dt10

Time step [sec] for missile position updates if distance to target > 10 km and < 50 km. Default 1 sec.

#number FOX.dt50

Time step [sec] for missile position updates if distance to target > 50 km. Default 5 sec.

#number FOX.explosiondist

Missile player distance in meters for destroying smaller missiles. Default 200 m.

#number FOX.explosiondist2

Missile player distance in meters for destroying big missiles. Default 500 m.

#number FOX.explosionpower

Power of explostion when destroying the missile in kg TNT. Default 5 kg TNT.

#boolean FOX.launchalert

Default player setting for launch alerts.

#table FOX.launchzones

Table of launch zones.

#string FOX.lid

Class id string for output to DCS log file.

#boolean FOX.marklaunch

Default player setting for mark launch coordinates.

#table FOX.menuadded

Table of groups the menu was added for.

#boolean FOX.menudisabled

If true, F10 menu for players is disabled.

#table FOX.missiles

Table of tracked missiles.

#table FOX.players

Table of players.

Core.Set#SET_GROUP FOX.protectedset

Set of protected groups.

#table FOX.safezones

Table of practice zones.

#number FOX.verbose

Verbosity level.

#string FOX.version

FOX class version.

Function(s)

Add a launch zone.

Only missiles launched within these zones will be tracked.

Defined in:

FOX

Parameter:

Training zone.

Return value:

#FOX:

self

Add a group to the protected set.

Works only with AI!

Defined in:

FOX

Parameter:

Protected group.

Return value:

#FOX:

self

Add a training zone.

Players in the zone are safe.

Defined in:

FOX

Parameter:

Training zone.

Return value:

#FOX:

self

Triggers the FSM event "EnterSafeZone".

Defined in:

FOX

Parameter:

Player data.

Triggers the FSM event "ExitSafeZone".

Defined in:

FOX

Parameter:

Player data.

Get missile target.

Defined in:

FOX

Parameter:

The missile data table.

Triggers the FSM event "MissileDestroyed".

Defined in:

FOX

Parameter:

Data of the destroyed missile.

Triggers the FSM event "MissileLaunch".

Defined in:

FOX

Parameter:

Data of the fired missile.

Create a new FOX class object.

Defined in:

FOX

Return value:

#FOX:

self.

On after "EnterSafeZone" event user function.

Called when a player enters a safe zone.

Defined in:

FOX

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Player data.

On after "ExitSafeZone" event user function.

Called when a player exists a safe zone.

Defined in:

FOX

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Player data.

On after "MissileDestroyed" event user function.

Called when a missile was destroyed.

Defined in:

FOX

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Data of the destroyed missile.

On after "MissileLaunch" event user function.

Called when a missile was launched.

Defined in:

FOX

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Data of the fired missile.

FOX event handler for event birth.

Defined in:

FOX

Parameter:

FOX event handler for event hit.

Defined in:

FOX

Parameter:

FOX event handler for event birth.

Defined in:

FOX

Parameter:

FOX event handler for event shot (when a unit releases a rocket or bomb (but not a fast firing gun).

Defined in:

FOX

Parameter:

Set debug mode off.

Defined in:

FOX

Return value:

#FOX:

self

Set debug mode on.

Defined in:

FOX

Return value:

#FOX:

self

Set debug mode on/off.

Defined in:

FOX

Parameter:

#boolean switch

If true debug mode on. If false/nil debug mode off.

Return value:

#FOX:

self

Set default player setting for launch alerts.

Defined in:

FOX

Parameter:

#boolean switch

If true launch alerts to players are active. If false/nil no launch alerts are given.

Return value:

#FOX:

self

Set default player setting for marking missile launch coordinates

Defined in:

FOX

Parameter:

#boolean switch

If true missile launches are marked. If false/nil marks are disabled.

Return value:

#FOX:

self

Set default player setting for missile destruction.

Defined in:

FOX

Parameter:

#boolean switch

If true missiles are destroyed. If false/nil missiles are not destroyed.

Return value:

#FOX:

self

Disable F10 menu for all players.

Defined in:

FOX

Return value:

#FOX:

self

Enable F10 menu for all players.

Defined in:

FOX

Return value:

#FOX:

self

Set missile-player distance when missile is destroyed.

Defined in:

FOX

Parameter:

#number distance

Distance in meters. Default 200 m.

Return value:

#FOX:

self

Set missile-player distance when BIG missiles are destroyed.

Defined in:

FOX

Parameters:

#number distance

Distance in meters. Default 500 m.

#number explosivemass

Explosive mass of missile threshold in kg TNT. Default 50 kg.

Return value:

#FOX:

self

Set explosion power.

This is an "artificial" explosion generated when the missile is destroyed. Just for the visual effect. Don't set the explosion power too big or it will harm the aircraft in the vicinity.

Defined in:

FOX

Parameter:

#number power

Explosion power in kg TNT. Default 0.1 kg.

Return value:

#FOX:

self

Add a protected set of groups.

Defined in:

FOX

Parameter:

The set of groups.

Return value:

#FOX:

self

Set verbosity level.

Defined in:

FOX

Parameter:

#number VerbosityLevel

Level of output (higher=more). Default 0.

Return value:

#FOX:

self

Triggers the FSM event "Start".

Starts the FOX. Initializes parameters and starts event handlers.

Defined in:

FOX

Triggers the FSM event "Status".

Defined in:

FOX

Add menu commands for player.

Defined in:

FOX

Parameter:

#string _unitName

Name of player unit.

Check if a coordinate lies within a launch zone.

Defined in:

FOX

Parameter:

Coordinate to check. Can also be a DCS#Vec2.

Return value:

#boolean:

True if in launch zone.

Check if a coordinate lies within a safe training zone.

Defined in:

FOX

Parameter:

Coordinate to check. Can also be a DCS#Vec3.

Return value:

#boolean:

True if safe.

Missile status.

Defined in:

FOX

Check status of players.

Defined in:

FOX

Get a random text message in case you die.

Defined in:

FOX

Return value:

#string:

Text in case you die.

Callback function on impact or destroy otherwise.

Defined in:

FOX

Parameters:

Weapon object.

#FOX self

FOX object.

Fired missile.

Function called from weapon tracking.

Defined in:

FOX

Parameters:

Weapon object.

#FOX self

FOX object.

Fired missile

Returns the unit of a player and the player name.

If the unit does not belong to a player, nil is returned.

Defined in:

FOX

Parameter:

DCS#Weapon weapon

The weapon.

Return values:

#number:

Notching heading right, i.e. missile heading +90°.

#number:

Notching heading left, i.e. missile heading -90°.

Retruns the player data from a unit.

Defined in:

FOX

Parameter:

Return value:

Player data.

Returns the player data from a unit name.

Defined in:

FOX

Parameter:

#string unitName

Name of the unit.

Return value:

Player data.

Returns the unit of a player and the player name.

If the unit does not belong to a player, nil is returned.

Defined in:

FOX

Parameter:

#string _unitName

Name of the player unit.

Return values:

Unit of player or nil.

#string:

Name of the player or nil.

Turn player's launch alert on/off.

Defined in:

FOX

Parameter:

#string playername

Name of the player.

Return values:

#number:

Number of missiles targeting the player.

#string:

Missile info.

Returns the unit of a player and the player name.

If the unit does not belong to a player, nil is returned.

Defined in:

FOX

Parameter:

DCS#Weapon weapon

The weapon.

Return value:

#number:

Heading of weapon in degrees or -1.

Check if missile target is protected.

Defined in:

FOX

Parameter:

Wrapper.Unit#UNIT targetunit

Target unit.

Return value:

#boolean:

If true, unit is protected.

Turn player's launch alert on/off.

Defined in:

FOX

Parameter:

#string _unitname

Name of the player unit.

Remove missile.

Defined in:

FOX

Parameter:

Missile data.

Tell player notching headings.

Defined in:

FOX

Parameters:

#FOX.PlayerData playerData

Player data.

DCS#Weapon weapon

The weapon.

Turn destruction of missiles on/off for player.

Defined in:

FOX

Parameter:

#string _unitname

Name of the player unit.

Turn player's launch alert on/off.

Defined in:

FOX

Parameter:

#string _unitname

Name of the player unit.

Turn player's launch marks on/off.

Defined in:

FOX

Parameter:

#string _unitname

Name of the player unit.

Triggers the FSM delayed event "EnterSafeZone".

Defined in:

FOX

Parameters:

#number delay

Delay in seconds before the function is called.

Player data.

Triggers the FSM delayed event "ExitSafeZone".

Defined in:

FOX

Parameters:

#number delay

Delay in seconds before the function is called.

Player data.

Triggers the FSM delayed event "MissileDestroyed".

Defined in:

FOX

Parameters:

#number delay

Delay in seconds before the function is called.

Data of the destroyed missile.

Triggers the FSM delayed event "MissileLaunch".

Defined in:

FOX

Parameters:

#number delay

Delay in seconds before the function is called.

Data of the fired missile.

Triggers the FSM event "Start" after a delay.

Starts the FOX. Initializes parameters and starts event handlers.

Defined in:

FOX

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Status" after a delay.

Defined in:

FOX

Parameter:

#number delay

Delay in seconds.

Triggers the FSM event "Stop" after a delay.

Stops the FOX and all its event handlers.

Defined in:

FOX

Parameter:

#number delay

Delay in seconds.

Missle launch event.

Defined in:

FOX

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Fired missile

On after Start event.

Starts the missile trainer and adds event handlers.

Defined in:

FOX

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Check spawn queue and spawn aircraft if necessary.

Defined in:

FOX

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

On after Stop event.

Stops the missile trainer and unhandles events.

Defined in:

FOX

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Field(s)

#string FOX.ClassName

Name of the class.

#boolean FOX.Debug

Debug mode. Messages to all about status.

#table FOX.MenuF10

Main radio menu on group level.

#table FOX.MenuF10Root

Main radio menu on mission level.

#number FOX.bigmissilemass

Explosion power of big missiles. Default 50 kg TNT. Big missiles will be destroyed earlier.

#boolean FOX.destroy

Default player setting for destroying missiles.

#number FOX.dt00

Time step [sec] for missile position updates if distance to target < 1 km. Default 0.01 sec.

#number FOX.dt01

Time step [sec] for missile position updates if distance to target > 1 km and < 5 km. Default 0.1 sec.

#number FOX.dt05

Time step [sec] for missile position updates if distance to target > 5 km and < 10 km. Default 0.5 sec.

#number FOX.dt10

Time step [sec] for missile position updates if distance to target > 10 km and < 50 km. Default 1 sec.

#number FOX.dt50

Time step [sec] for missile position updates if distance to target > 50 km. Default 5 sec.

#number FOX.explosiondist

Missile player distance in meters for destroying smaller missiles. Default 200 m.

#number FOX.explosiondist2

Missile player distance in meters for destroying big missiles. Default 500 m.

#number FOX.explosionpower

Power of explostion when destroying the missile in kg TNT. Default 5 kg TNT.

#boolean FOX.launchalert

Default player setting for launch alerts.

#table FOX.launchzones

Table of launch zones.

#string FOX.lid

Class id string for output to DCS log file.

#boolean FOX.marklaunch

Default player setting for mark launch coordinates.

#table FOX.menuadded

Table of groups the menu was added for.

#boolean FOX.menudisabled

If true, F10 menu for players is disabled.

#table FOX.missiles

Table of tracked missiles.

#table FOX.players

Table of players.

Core.Set#SET_GROUP FOX.protectedset

Set of protected groups.

#table FOX.safezones

Table of practice zones.

#number FOX.verbose

Verbosity level.

#string FOX.version

FOX class version.

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Transitions.

Check if FSM is in state.

Defined in:

Parameter:

#string State

State name.

Return value:

#boolean:

If true, FSM is in this state.

Load call backs.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

Call handler.

Defined in:

Parameters:

#string step

Step "onafter", "onbefore", "onenter", "onleave".

#string trigger

Trigger.

#table params

Parameters.

#string EventName

Event name.

Return value:

Value.

Create transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Delayed transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Event map.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

Check if can do an event.

Defined in:

Parameter:

#string e

Event name.

Return values:

#boolean:

If true, FSM can do the event.

#string:

To state.

Check if cannot do an event.

Defined in:

Parameter:

#string e

Event name.

Return value:

#boolean:

If true, FSM cannot do the event.

Check if FSM is in state.

Defined in:

Parameters:

#string State

State name.

state

Return value:

#boolean:

If true, FSM is in this state.

Missile data table.

Field(s)

#boolean FOX.MissileData.active

If true the missile is active.

#number FOX.MissileData.explosive

Explosive mass in kg TNT.

#number FOX.MissileData.fuseDist

Fuse distance in meters.

Core.Point#COORDINATE FOX.MissileData.missileCoord

Missile coordinate during tracking.

#string FOX.MissileData.missileName

Name of missile.

#number FOX.MissileData.missileRange

Range of missile in meters.

#string FOX.MissileData.missileType

Type of missile.

#number FOX.MissileData.shooterCoalition

Coalition side of the shooter.

Wrapper.Group#GROUP FOX.MissileData.shooterGroup

Group that shot the missile.

#string FOX.MissileData.shooterName

Name of the shooter unit.

Wrapper.Unit#UNIT FOX.MissileData.shooterUnit

Unit that shot the missile.

Core.Point#COORDINATE FOX.MissileData.shotCoord

Coordinate where the missile was fired.

#number FOX.MissileData.shotTime

Abs. mission time in seconds the missile was fired.

#string FOX.MissileData.targetName

Name of the target unit or "unknown".

#string FOX.MissileData.targetOrig

Name of the "original" target, i.e. the one right after launched.

#FOX.PlayerData FOX.MissileData.targetPlayer

Player that was targeted or nil.

DCS#Weapon FOX.MissileData.weapon

Missile weapon object.

Function(s)

Player data table holding all important parameters of each player.

Field(s)

#string FOX.PlayerData.callsign

Callsign of player.

Wrapper.Client#CLIENT FOX.PlayerData.client

Client object of player.

#number FOX.PlayerData.coalition

Coalition number of player.

#number FOX.PlayerData.dead

Number of missiles not defeated.

#number FOX.PlayerData.defeated

Number of missiles defeated.

#boolean FOX.PlayerData.destroy

Destroy missile.

Wrapper.Group#GROUP FOX.PlayerData.group

Aircraft group of player.

#string FOX.PlayerData.groupname

Name of the the player aircraft group.

#boolean FOX.PlayerData.inzone

Player is inside a protected zone.

#boolean FOX.PlayerData.launchalert

Alert player on detected missile launch.

#boolean FOX.PlayerData.marklaunch

Mark position of launched missile on F10 map.

#string FOX.PlayerData.name

Player name.

Wrapper.Unit#UNIT FOX.PlayerData.unit

Aircraft of the player.

#string FOX.PlayerData.unitname

Name of the unit.

Function(s)