Module Client

The CLIENT models client units in multi player missions.

Clients are those groups defined within the Mission Editor that have the skillset defined as "Client" or "Player". Note that clients are NOT the same as groups, they are NOT necessarily alive.

Global(s)

CLIENT
ClientGroupUnit

Type CLIENT

CLIENT:AddBriefing(ClientBriefing)

AddBriefing adds a briefing to a CLIENT when a player joins a mission.

CLIENT:Alive(CallBack)

Checks for a client alive event and calls a function on a continuous basis.

CLIENT.AliveCheckScheduler
CLIENT.ClassName
CLIENT.ClientAlive
CLIENT.ClientAlive2
CLIENT.ClientBriefing
CLIENT.ClientBriefingShown
CLIENT.ClientCallBack
CLIENT.ClientGroupID
CLIENT.ClientGroupName
CLIENT.ClientGroupUnit
CLIENT.ClientID
CLIENT.ClientName
CLIENT:ClientPosition()

Returns the position of the CLIENT in DCSTypes#Vec3 format.

CLIENT.ClientTransport
CLIENT:GetAltitude()

Returns the altitude of the CLIENT.

CLIENT:GetClientGroupDCSUnit()

Returns the DCSUnit of the CLIENT.

CLIENT:GetClientGroupID()
CLIENT:GetClientGroupName()

Get the name of the group of the client.

CLIENT:GetClientGroupUnit()

Returns the UNIT of the CLIENT.

CLIENT:GetDCSGroup()

Return the DCSGroup of a Client.

CLIENT:GetPointVec2()

Returns the position of the CLIENT in DCSTypes#Vec2 format..

CLIENT:GetUnit()
CLIENT:IsAlive(Returns)

Checks if client is alive and returns true or false.

CLIENT:IsTransport()

Evaluates if the CLIENT is a transport.

CLIENT.MenuMessages
CLIENT.MenuRouteMessageOff
CLIENT.MenuRouteMessageOn
CLIENT:Message(Message, MessageDuration, MessageId, MessageCategory, MessageInterval)

The main message driver for the CLIENT.

CLIENT.Messages
CLIENT:New(ClientName, ClientBriefing)

Use this method to register new Clients within the MOF.

CLIENT.ONBOARDSIDE
CLIENT:Reset(ClientName)

Resets a CLIENT.

CLIENT:ShowCargo()

Shows the Cargo#CARGO contained within the CLIENT to the player as a message.

CLIENT.SwitchMessages(PrmTable)
CLIENT:Transport()

Transport defines that the Client is a Transport.

CLIENT:_AliveCheckScheduler()
CLIENT._Menus
CLIENT._Tasks

Global(s)

#CLIENT CLIENT
ClientGroupUnit

Type Client

Type CLIENT

The CLIENT class

Field(s)

CLIENT:AddBriefing(ClientBriefing)

AddBriefing adds a briefing to a CLIENT when a player joins a mission.

Parameter

  • #string ClientBriefing : is the text defining the Mission briefing.

Return value

#CLIENT:

CLIENT:Alive(CallBack)

Checks for a client alive event and calls a function on a continuous basis.

Parameter

  • #function CallBack : Function.

Return value

#CLIENT:

CLIENT.AliveCheckScheduler
#string CLIENT.ClassName
#boolean CLIENT.ClientAlive
#boolean CLIENT.ClientAlive2
CLIENT.ClientBriefing
#boolean CLIENT.ClientBriefingShown
CLIENT.ClientCallBack
CLIENT.ClientGroupID
CLIENT.ClientGroupName
CLIENT.ClientGroupUnit
CLIENT.ClientID
CLIENT.ClientName
CLIENT:ClientPosition()

Returns the position of the CLIENT in DCSTypes#Vec3 format.

Return value

DCSTypes#Vec3:

#boolean CLIENT.ClientTransport
CLIENT:GetAltitude()

Returns the altitude of the CLIENT.

Return value

DCSTypes#Distance:

CLIENT:GetClientGroupDCSUnit()

Returns the DCSUnit of the CLIENT.

Return value

DCSTypes#Unit:

CLIENT:GetClientGroupID()

TODO: Check DCSTypes#Group.ID - Get the group ID of the client. @param #CLIENT self @return DCSTypes#Group.ID

CLIENT:GetClientGroupName()

Get the name of the group of the client.

Return value

#string:

CLIENT:GetClientGroupUnit()

Returns the UNIT of the CLIENT.

Return value

Unit#UNIT:

CLIENT:GetDCSGroup()

Return the DCSGroup of a Client.

This function is modified to deal with a couple of bugs in DCS 1.5.3

Return value

DCSGroup#Group:

CLIENT:GetPointVec2()

Returns the position of the CLIENT in DCSTypes#Vec2 format..

Return value

DCSTypes#Vec2:

CLIENT:GetUnit()

TODO what is this??? check. possible double function.

CLIENT:IsAlive(Returns)

Checks if client is alive and returns true or false.

Parameter

  • #boolean Returns : true if client is alive.

CLIENT:IsTransport()

Evaluates if the CLIENT is a transport.

Return value

#boolean: true is a transport.

CLIENT.MenuMessages
CLIENT.MenuRouteMessageOff
CLIENT.MenuRouteMessageOn
CLIENT:Message(Message, MessageDuration, MessageId, MessageCategory, MessageInterval)

The main message driver for the CLIENT.

This function displays various messages to the Player logged into the CLIENT through the DCS World Messaging system.

Parameters

  • #string Message : is the text describing the message.

  • #number MessageDuration : is the duration in seconds that the Message should be displayed.

  • #string MessageId : is a text identifying the Message in the MessageQueue. The Message system overwrites Messages with the same MessageId

  • #string MessageCategory : is the category of the message (the title).

  • #number MessageInterval : is the interval in seconds between the display of the Message#MESSAGE when the CLIENT is in the air.

CLIENT.Messages
CLIENT:New(ClientName, ClientBriefing)

Use this method to register new Clients within the MOF.

Parameters

  • #string ClientName : Name of the Group as defined within the Mission Editor. The Group must have a Unit with the type Client.

  • #string ClientBriefing : Text that describes the briefing of the mission when a Player logs into the Client.

Return value

#CLIENT:

Usage:

-- Create new Clients.
	local Mission = MISSIONSCHEDULER.AddMission( 'Russia Transport Troops SA-6', 'Operational', 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 'Russia' )
	Mission:AddGoal( DeploySA6TroopsGoal )

	Mission:AddClient( CLIENT:New( 'RU MI-8MTV2*HOT-Deploy Troops 1' ):Transport() )
	Mission:AddClient( CLIENT:New( 'RU MI-8MTV2*RAMP-Deploy Troops 3' ):Transport() )
	Mission:AddClient( CLIENT:New( 'RU MI-8MTV2*HOT-Deploy Troops 2' ):Transport() )
	Mission:AddClient( CLIENT:New( 'RU MI-8MTV2*RAMP-Deploy Troops 4' ):Transport() )
CLIENT.ONBOARDSIDE
CLIENT:Reset(ClientName)

Resets a CLIENT.

Parameter

  • #string ClientName : Name of the Group as defined within the Mission Editor. The Group must have a Unit with the type Client.

CLIENT:ShowCargo()

Shows the Cargo#CARGO contained within the CLIENT to the player as a message.

The Cargo#CARGO is shown using the Message#MESSAGE distribution system.

CLIENT.SwitchMessages(PrmTable)

TODO (1) I urgently need to revise this. - A local function called by the DCS World Menu system to switch off messages.

Parameter

  • PrmTable :

CLIENT:Transport()

Transport defines that the Client is a Transport.

Transports show cargo.

Return value

#CLIENT:

CLIENT:_AliveCheckScheduler()
CLIENT._Menus
CLIENT._Tasks