Banner Image

Module Core.UserFlag

Core - Manage user flags to interact with the mission editor trigger system and server side scripts.


Features:

  • Set or get DCS user flags within running missions.

Author: FlightControl


Global(s)

Global USERFLAG

Management of DCS User Flags.

#USERFLAG USERFLAG

Management of DCS User Flags.

1. USERFLAG constructor

Type(s)

Fields and Methods inherited from USERFLAG Description

USERFLAG:Get()

Get the userflag Number.

USERFLAG:GetName()

Get the userflag name.

USERFLAG:Is(Number)

Check if the userflag has a value of Number.

USERFLAG:New(UserFlagName)

USERFLAG Constructor.

USERFLAG:Set(Number, Delay)

Set the userflag to a given Number.

USERFLAG.UserFlagName

Field(s)

Function(s)

Get the userflag Number.

Defined in:

USERFLAG

Return value:

#number:

Number The number value to be checked if it is the same as the userflag.

Usage:

  local BlueVictory = USERFLAG:New( "VictoryBlue" )
  local BlueVictoryValue = BlueVictory:Get() -- Get the UserFlag VictoryBlue value.
  

Get the userflag name.

Defined in:

USERFLAG

Return value:

#string:

Name of the user flag.

Check if the userflag has a value of Number.

Defined in:

USERFLAG

Parameter:

#number Number

The number value to be checked if it is the same as the userflag.

Return value:

#boolean:

true if the Number is the value of the userflag.

Usage:

  local BlueVictory = USERFLAG:New( "VictoryBlue" )
  if BlueVictory:Is( 1 ) then
    return "Blue has won"
  end

USERFLAG Constructor.

Defined in:

USERFLAG

Parameter:

#string UserFlagName

The name of the userflag, which is a free text string.

Return value:

Set the userflag to a given Number.

Defined in:

USERFLAG

Parameters:

#number Number

The number value to set the flag to.

#number Delay

Delay in seconds, before the flag is set.

Return value:

The userflag instance.

Usage:

  local BlueVictory = USERFLAG:New( "VictoryBlue" )
  BlueVictory:Set( 100 ) -- Set the UserFlag VictoryBlue to 100.