Class MESSAGE

Message System to display Messages for Clients and Coalitions or All.

Messages are grouped on the display panel per Category to improve readability for the players. Messages are shown on the display panel for an amount of seconds, and will then disappear. Messages are identified by an ID. The messages with the same ID belonging to the same category will be overwritten if they were still being displayed on the display panel. Messages are created with MESSAGE:New(). Messages are sent to Clients with MESSAGE:ToClient(). Messages are sent to Coalitions with MESSAGE:ToCoalition(). Messages are sent to All Players with MESSAGE:ToAll().

Methods

MESSAGE:New (MessageText, MessageCategory, MessageDuration, MessageID) Creates a new MESSAGE object.
MESSAGE:ToClient (Client) Sends a MESSAGE to a Client Group.
MESSAGE:ToCoalition (CoalitionSide) Sends a MESSAGE to a Coalition.
MESSAGE:ToAll () Sends a MESSAGE to all players.

Class MESSAGEQUEUE

MESSAGEQUEUE:_DisplayMessages () This function is called automatically by the MESSAGEQUEUE scheduler.
MESSAGE._MessageQueue The _MessageQueue object is created when the MESSAGE class module is loaded.


Methods

MESSAGE:New (MessageText, MessageCategory, MessageDuration, MessageID)
Creates a new MESSAGE object. Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions ToClient or ToCoalition or ToAll to send these Messages to the respective recipients.

Parameters:

  • MessageText string is the text of the Message.
  • MessageCategory string is a string expressing the Category of the Message. Messages are grouped on the display panel per Category to improve readability.
  • MessageDuration number is a number in seconds of how long the MESSAGE should be shown on the display panel.
  • MessageID string is a string expressing the ID of the Message.

Returns:

    MESSAGE

Usage:

     -- Create a series of new Messages.
     -- MessageAll is meant to be sent to all players, for 25 seconds, and is classified as "Score".
     -- MessageRED is meant to be sent to the RED players only, for 10 seconds, and is classified as "End of Mission", with ID "Win".
     -- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
     -- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
     MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
     MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
     MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
     MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
MESSAGE:ToClient (Client)
Sends a MESSAGE to a Client Group. Note that the Group needs to be defined within the ME with the skillset "Client" or "Player".

Parameters:

  • Client CLIENT is the Group of the Client.

Returns:

    MESSAGE

Usage:

     -- Send the 2 messages created with the New method to the Client Group.
     -- Note that the Message of MessageClient2 is overwriting the Message of MessageClient1.
     ClientGroup = Group.getByName( "ClientGroup" )
    
     MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
     MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
     or
     MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
     MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
     or
     MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
     MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
     MessageClient1:ToClient( ClientGroup )
     MessageClient2:ToClient( ClientGroup )
MESSAGE:ToCoalition (CoalitionSide)
Sends a MESSAGE to a Coalition.

Parameters:

  • CoalitionSide needs to be filled out by the defined structure of the standard scripting engine ???.

Returns:

    MESSAGE

Usage:

     -- Send a message created with the New method to the RED coalition.
     MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
     or
     MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
     or
     MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
     MessageRED:ToCoalition( coalition.side.RED )
MESSAGE:ToAll ()
Sends a MESSAGE to all players.

Returns:

    MESSAGE

Usage:

     -- Send a message created to all players.
     MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
     or
     MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
     or
     MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
     MessageAll:ToAll()

Class MESSAGEQUEUE

MESSAGEQUEUE
MESSAGEQUEUE:_DisplayMessages ()
This function is called automatically by the MESSAGEQUEUE scheduler.
MESSAGE._MessageQueue
The _MessageQueue object is created when the MESSAGE class module is loaded.
generated by LDoc 1.4.3 Last updated 2015-01-29 21:06:10