MOOSE/docs/Documentation/Message.html
FlightControl 52f4051901 Various Fixes
-- Documentation fixes with links not working.
-- MENU_CLIENT_COMMAND had a small glitch, fixed that one too.
-- Implemented new Event Dispatcher.
--
2017-02-04 15:16:32 +01:00

483 lines
14 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
<li><a href="AI_Cas.html">AI_Cas</a></li>
<li><a href="AI_Patrol.html">AI_Patrol</a></li>
<li><a href="Account.html">Account</a></li>
<li><a href="Airbase.html">Airbase</a></li>
<li><a href="AirbasePolice.html">AirbasePolice</a></li>
<li><a href="Assign.html">Assign</a></li>
<li><a href="Base.html">Base</a></li>
<li><a href="Cargo.html">Cargo</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="CommandCenter.html">CommandCenter</a></li>
<li><a href="Controllable.html">Controllable</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Detection.html">Detection</a></li>
<li><a href="DetectionManager.html">DetectionManager</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="Fsm.html">Fsm</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="Identifiable.html">Identifiable</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li>Message</li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="Object.html">Object</a></li>
<li><a href="Point.html">Point</a></li>
<li><a href="Positionable.html">Positionable</a></li>
<li><a href="Process_JTAC.html">Process_JTAC</a></li>
<li><a href="Process_Pickup.html">Process_Pickup</a></li>
<li><a href="Route.html">Route</a></li>
<li><a href="ScheduleDispatcher.html">ScheduleDispatcher</a></li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li><a href="Set.html">Set</a></li>
<li><a href="Smoke.html">Smoke</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="Static.html">Static</a></li>
<li><a href="Task.html">Task</a></li>
<li><a href="Task_A2G.html">Task_A2G</a></li>
<li><a href="Task_PICKUP.html">Task_PICKUP</a></li>
<li><a href="Task_SEAD.html">Task_SEAD</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="Utils.html">Utils</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Message</code></h1>
<p>This module contains the MESSAGE class.</p>
<h1>1) <a href="Message.html##(MESSAGE)">Message#MESSAGE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>Message System to display Messages to Clients, Coalitions or All.
Messages are shown on the display panel for an amount of seconds, and will then disappear.
Messages can contain a category which is indicating the category of the message.</p>
<h2>1.1) MESSAGE construction methods</h2>
<p>Messages are created with <a href="Message.html##(MESSAGE).New">Message#MESSAGE.New</a>. Note that when the MESSAGE object is created, no message is sent yet.
To send messages, you need to use the To functions.</p>
<h2>1.2) Send messages with MESSAGE To methods</h2>
<p>Messages are sent to:</p>
<ul>
<li>Clients with <a href="Message.html##(MESSAGE).ToClient">Message#MESSAGE.ToClient</a>.</li>
<li>Coalitions with <a href="Message.html##(MESSAGE).ToCoalition">Message#MESSAGE.ToCoalition</a>.</li>
<li>All Players with <a href="Message.html##(MESSAGE).ToAll">Message#MESSAGE.ToAll</a>.
</li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#MESSAGE">MESSAGE</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(MESSAGE)">Type <code>MESSAGE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).ClassName">MESSAGE.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).MessageCategory">MESSAGE.MessageCategory</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).MessageID">MESSAGE.MessageID</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).New">MESSAGE:New(MessageText, MessageDuration, MessageCategory)</a></td>
<td class="summary">
<p>Creates a new MESSAGE object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).ToAll">MESSAGE:ToAll()</a></td>
<td class="summary">
<p>Sends a MESSAGE to all players. </p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).ToBlue">MESSAGE:ToBlue()</a></td>
<td class="summary">
<p>Sends a MESSAGE to the Blue coalition.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).ToClient">MESSAGE:ToClient(Client)</a></td>
<td class="summary">
<p>Sends a MESSAGE to a Client Group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).ToCoalition">MESSAGE:ToCoalition(CoalitionSide)</a></td>
<td class="summary">
<p>Sends a MESSAGE to a Coalition. </p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).ToGroup">MESSAGE:ToGroup(Group)</a></td>
<td class="summary">
<p>Sends a MESSAGE to a Group. </p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MESSAGE).ToRed">MESSAGE:ToRed()</a></td>
<td class="summary">
<p>Sends a MESSAGE to the Red Coalition. </p>
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(MESSAGE)">#MESSAGE</a></em>
<a id="MESSAGE" >
<strong>MESSAGE</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(Message)" >Type <code>Message</code></a></h2>
<h2><a id="#(MESSAGE)" >Type <code>MESSAGE</code></a></h2>
<p>The MESSAGE class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(MESSAGE).ClassName" >
<strong>MESSAGE.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(MESSAGE).MessageCategory" >
<strong>MESSAGE.MessageCategory</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(MESSAGE).MessageID" >
<strong>MESSAGE.MessageID</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MESSAGE).New" >
<strong>MESSAGE:New(MessageText, MessageDuration, MessageCategory)</strong>
</a>
</dt>
<dd>
<p>Creates a new MESSAGE object.</p>
<p>Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions <a href="ToClient.html">ToClient</a> or <a href="ToCoalition.html">ToCoalition</a> or <a href="ToAll.html">ToAll</a> to send these Messages to the respective recipients.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string MessageText </em></code>:
is the text of the Message.</p>
</li>
<li>
<p><code><em>#number MessageDuration </em></code>:
is a number in seconds of how long the MESSAGE should be shown on the display panel.</p>
</li>
<li>
<p><code><em>#string MessageCategory </em></code>:
(optional) is a string expressing the "category" of the Message. The category will be shown as the first text in the message followed by a ": ".</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(MESSAGE)">#MESSAGE</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- 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!", 25, "End of Mission" )
MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty" )
MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", 25, "Score" )
MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score")</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MESSAGE).ToAll" >
<strong>MESSAGE:ToAll()</strong>
</a>
</dt>
<dd>
<p>Sends a MESSAGE to all players. </p>
<h3>Return value</h3>
<p><em><a href="##(MESSAGE)">#MESSAGE</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- 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()</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MESSAGE).ToBlue" >
<strong>MESSAGE:ToBlue()</strong>
</a>
</dt>
<dd>
<p>Sends a MESSAGE to the Blue coalition.</p>
<h3>Return value</h3>
<p><em><a href="##(MESSAGE)">#MESSAGE</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- Send a message created with the @{New} method to the BLUE coalition.
MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
or
MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
or
MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
MessageBLUE:ToBlue()</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MESSAGE).ToClient" >
<strong>MESSAGE:ToClient(Client)</strong>
</a>
</dt>
<dd>
<p>Sends a MESSAGE to a Client Group.</p>
<p>Note that the Group needs to be defined within the ME with the skillset "Client" or "Player".</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Client.html##(CLIENT)">Wrapper.Client#CLIENT</a> Client </em></code>:
is the Group of the Client.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(MESSAGE)">#MESSAGE</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- 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 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MESSAGE).ToCoalition" >
<strong>MESSAGE:ToCoalition(CoalitionSide)</strong>
</a>
</dt>
<dd>
<p>Sends a MESSAGE to a Coalition. </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> CoalitionSide </em></code>:
needs to be filled out by the defined structure of the standard scripting engine <a href="coalition.side.html">coalition.side</a>. </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(MESSAGE)">#MESSAGE</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- 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 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MESSAGE).ToGroup" >
<strong>MESSAGE:ToGroup(Group)</strong>
</a>
</dt>
<dd>
<p>Sends a MESSAGE to a Group. </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> Group </em></code>:
is the Group.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(MESSAGE)">#MESSAGE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(MESSAGE).ToRed" >
<strong>MESSAGE:ToRed()</strong>
</a>
</dt>
<dd>
<p>Sends a MESSAGE to the Red Coalition. </p>
<h3>Return value</h3>
<p><em><a href="##(MESSAGE)">#MESSAGE</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>-- 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" ):ToRed()
or
MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
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:ToRed()</code></pre>
</dd>
</dl>
</div>
</div>
</body>
</html>