BIS fnc addStackedEventHandler: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "ArmA3" to "{{arma3}}") |
m (Text replacement - "({{arma3}} 1.22)" to "{{GVI|arma3|1.22}}") |
||
Line 44: | Line 44: | ||
<dd class="notedate">Posted on 25 Jun, 2014</dd> | <dd class="notedate">Posted on 25 Jun, 2014</dd> | ||
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]<dd class="note"> | <dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]<dd class="note"> | ||
{{GVI|arma3|1.22}} Stack all codes into one PFH will be less demanding than separated calling within multiple PFH. E.g. | |||
<code> | <code> | ||
{ | { |
Revision as of 16:17, 31 January 2021
Description
- Description:
- Description needed
- Execution:
- call
- Groups:
- Event Handlers
Syntax
- Syntax:
- Syntax needed
- Parameters:
- id: String - custom id, a unique identifier. Adding same type of EH with the same id will overwrite existing
- event: String - event handler name, see description for supported EHs
- code: Code or String. The String is treated as function name
- arguments: Array of Anything - arguments to make available in code in _this array
- Return Value:
- Return value needed
Examples
- Example 1:
["someId", "onEachFrame", {hintSilent str time}] call BIS_fnc_addStackedEventHandler;
- Example 2:
["someId", "onEachFrame", {hintSilent str position (_this select 0)}, [player]] call BIS_fnc_addStackedEventHandler;
Additional Information
- See also:
- See also needed
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
- Posted on 25 Jun, 2014
- ffur2007slx2_5
-
1.22 Stack all codes into one PFH will be less demanding than separated calling within multiple PFH. E.g.
{ [(format [“%1”,_forEachIndex]),”onEachFrame”,_code,[_x]] call BIS_fnc_addStackedEventHandler; } forEach [var0…var100]; //pretty demanding
[_id, ”onEachFrame”,{ {_x call _code} forEach [var0…var100]; }] call BIS_fnc_addStackedEventHandler; //faster
- Posted on January 3, 2019 - 13:52 (UTC)
- DrSova
-
For returning array with all ids:
missionNamespace getVariable [format["BIS_stackedEventHandlers_%1",_event],[]];
Where is _event - name of event ('OnEachFrame', etc.)