Ping - Theseus-Aegis/MissionTemplate GitHub Wiki
This page will explain the usage of the Ping function.
/*
* Author: Mike
* Creates a sonar-like marker ping on a specific location.
* The ping will remain at the location it started on.
* List of available colours can be found at: https://community.bistudio.com/wiki/Arma_3:_CfgMarkerColors
*
* Call directly from ACE Action or via server with global argument.
*
* Arguments:
* 0: Location <OBJECT>
* 1: Global <BOOL> (default: false)
* 2: Max size of ping <NUMBER> (default: 60, max 120)
* 3: Colour <STRING> (default: "ColorRed")
*
* Return Value:
* None
*
* Examples:
* [MyObject] call MFUNC(ping)
* [MyObject, true, 70, "ColorGrey"] call MFUNC(ping)
*/
The ping function creates an expanding circle from a designated object. It can be ran globally or locally and the maximum dimensions of the circle can be increased up to 120. The colour of the ping can also be changed by using the list provided here
Each object "ping" can only run once, not multiple times. This can be checked by using MyObject getVariable [QMGVAR(pingInProgress), false]
If the object is deleted (not killed) the ping will stop immediately. Dead objects can still be pinged.
Example:
[MyObject] call MFUNC(ping);
Advanced Example
[MyObject, true, 120, "ColorPink"] call MFUNC(ping);
This example will give you a ping that is global, quite large and pink.
ACE Action Example (initPlayerLocal)
private _action = [
QGVAR(PingMyObject),
"Ping Muh Object",
"",
{
[MyObject] call MFUNC(ping);
MyObject setVariable [QGVAR(missionTime), CBA_missionTime, true];
},
{
!(MyObject getVariable [QMGVAR(pingInProgress), false]) &&
(CBA_missionTime - (MyObject getVariable [QGVAR(missionTime), 0]) > 30)
}
] call ACEFUNC(interact_menu,createAction);
[_player, 1, ["ACE_SelfActions"], _action] call ACEFUNC(interact_menu,addActionToObject);
This example will only run locally for the player who calls it, using the advanced example would call it globally for all players. It will also only let you use the action every 30 seconds.
Each time the action is used, the time is set to the object and the action will not become available until 30 seconds have passed again. (This counts for every single player the action is available to)