triggerActivated: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*) ([^ ]*) ([^ ]*)<\/code>" to "<code>$1$2$3 $4 $5</code>") |
Lou Montana (talk | contribs) m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*) ([^ ]*) ([^ ]*)<\/code>" to "<code>$1$2$3 $4 $5</code>") |
||
Line 27: | Line 27: | ||
|r1= [[Boolean]] | |r1= [[Boolean]] | ||
|x1= <code>if ( | |x1= <code>if (triggerActivated trg1) [[then]] { | ||
// code | // code | ||
};</code> | };</code> |
Revision as of 11:44, 12 May 2022
Description
- Description:
- Returns true if the trigger has been activated.
- Problems:
- The engine does not provide precise way of detecting which player activated the trigger. The trigger has a default triggerInterval of ~0.5 seconds, so every halfe 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.
- Groups:
- Triggers
Syntax
- Syntax:
- triggerActivated trigger
- Parameters:
- trigger: Object
- Return Value:
- Boolean
Examples
- Example 1:
if (triggerActivated trg1) then { // code };
Additional Information
- See also:
- setTriggerActivation triggerActivation triggerInterval setTriggerInterval enableSimulation simulationEnabled
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
- 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).