BIS fnc addStackedEventHandler: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[[cC]ategory:\{\{Name\|arma3\}\}: [fF]unctions\|\{\{uc:[a-z A-Z_]*\}\}\]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - "<code> +" to "<code>") |
||
Line 45: | Line 45: | ||
<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. | {{GVI|arma3|1.22}} Stack all codes into one PFH will be less demanding than separated calling within multiple PFH. E.g. | ||
<code> | <code>{ | ||
{ | |||
[([[format]] [“%1”,_forEachIndex]),”[[onEachFrame]]”,_code,[_x]] [[call]] [[BIS_fnc_addStackedEventHandler]]; | [([[format]] [“%1”,_forEachIndex]),”[[onEachFrame]]”,_code,[_x]] [[call]] [[BIS_fnc_addStackedEventHandler]]; | ||
} [[forEach]] [var0…var100]; //pretty demanding | } [[forEach]] [var0…var100]; //pretty demanding | ||
</code> | </code> | ||
<code> | <code>[_id, ”[[onEachFrame]]”,{ | ||
[_id, ”[[onEachFrame]]”,{ | |||
{_x [[call]] _code} [[forEach]] [var0…var100]; | {_x [[call]] _code} [[forEach]] [var0…var100]; | ||
}] [[call]] [[BIS_fnc_addStackedEventHandler]]; //faster | }] [[call]] [[BIS_fnc_addStackedEventHandler]]; //faster |
Revision as of 16:51, 7 February 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.)