BIS fnc addStackedEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {2,}\}\}" to " }}")
m (Text replacement - "{{Function " to "{{RV|type=function ")
Line 1: Line 1:
{{Function
{{RV|type=function


| arma3
| arma3

Revision as of 01:09, 23 January 2021

Hover & click on the images for description

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
(ArmA3 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.)