triggerActivated: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma2 |Game name=
| arma2


|1.00|Game version=
|1.00


|arg= global|Multiplayer Arguments=
|arg= global


|gr1= Triggers |GROUP1=
|gr1= Triggers


| Returns true if the trigger has been activated.
| Returns true if the trigger has been activated.
Line 13: Line 13:
{{Informative | The engine does not provide precise way of detecting which player activated the trigger. The trigger has a default [[triggerInterval]] or 0.5 sec, so every 0.5 second it checks if there is anyone in the zone. There could be 100 people in the zone on the next scan, which one was the first? There is simply no data for this. You can make an imprecise guess by taking 1st person from [[thisList]] or [[list]]. Also you should do it on server only trigger. This will still not guarantee that person first on the list is the one who was first to activate trigger, but on balance will probably be the one.}}
{{Informative | The engine does not provide precise way of detecting which player activated the trigger. The trigger has a default [[triggerInterval]] or 0.5 sec, so every 0.5 second it checks if there is anyone in the zone. There could be 100 people in the zone on the next scan, which one was the first? There is simply no data for this. You can make an imprecise guess by taking 1st person from [[thisList]] or [[list]]. Also you should do it on server only trigger. This will still not guarantee that person first on the list is the one who was first to activate trigger, but on balance will probably be the one.}}


{{Important | The trigger could be [[local]] or remote but the result returned by this command will be for the trigger activated status on the client that executed the command. See [[createTrigger]] for more info.}} |DESCRIPTION=
{{Important | The trigger could be [[local]] or remote but the result returned by this command will be for the trigger activated status on the client that executed the command. See [[createTrigger]] for more info.}}


| [[triggerActivated]] trigger |SYNTAX=
| [[triggerActivated]] trigger


|p1= trigger: [[Object]] |PARAMETER1=
|p1= trigger: [[Object]]


| [[Boolean]] |RETURNVALUE=
| [[Boolean]]


|x1= <code>[[if]] ([[triggerActivated]] trg1) [[then]] {
|x1= <code>[[if]] ([[triggerActivated]] trg1) [[then]] {
{{cc|code}}
{{cc|code}}
};</code>|EXAMPLE1=
};</code>


| [[setTriggerActivation]], [[triggerActivation]], [[triggerInterval]], [[setTriggerInterval]], [[enableSimulation]], [[simulationEnabled]] |SEEALSO=
| [[setTriggerActivation]], [[triggerActivation]], [[triggerInterval]], [[setTriggerInterval]], [[enableSimulation]], [[simulationEnabled]]
}}
}}



Revision as of 11:25, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns true if the trigger has been activated.
The engine does not provide precise way of detecting which player activated the trigger. The trigger has a default triggerInterval or 0.5 sec, so every 0.5 second it checks if there is anyone in the zone. There could be 100 people in the zone on the next scan, which one was the first? There is simply no data for this. You can make an imprecise guess by taking 1st person from thisList or list. Also you should do it on server only trigger. This will still not guarantee that person first on the list is the one who was first to activate trigger, but on balance will probably be the one.
The trigger could be local or remote but the result returned by this command will be for the trigger activated status on the client that executed the command. See createTrigger for more info.
Groups:
Triggers

Syntax

Syntax:
triggerActivated trigger
Parameters:
trigger: Object
Return Value:
Boolean

Examples

Example 1:
if (triggerActivated trg1) then { // code };

Additional Information

See also:
setTriggerActivationtriggerActivationtriggerIntervalsetTriggerIntervalenableSimulationsimulationEnabled

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

14:50, 9 June 2015 (CEST)
MisterGoodson
If trigger already activated at least once, triggerActivated will only return false if trigger is set to activate Repeatedly.
In other words, a trigger set to activate Once will always return true once activated at least once (even if trigger is no longer activated).

Bottom Section