BIS fnc addScriptedEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 63: Line 63:
</code><br>
</code><br>
Note that this is capable of stacking code, the order of stacking code matters!
Note that this is capable of stacking code, the order of stacking code matters!
</dd>
</dl>
<!-- DISCONTINUE Notes -->
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on May 18, 2016 - 18:38 (UTC)</dd>
<dt class="note">[[User:RageBone|RageBone]]</dt>
<dd class="note">
the first parameter can also be Boolean, preferably "true".<br>
it then defaults to the missionNamespace as the place where it stores the event code.<br><br>
the code gets stored in the variable: <code>
_handlerName = "BIS_fnc_addScriptedEventHandler_" +  _handlerName;<br>
// some other code for stacking the event-code. (_handlers) <br>
_namespace setvariable [_handlerName,_handlers];<br>
</code><br><br>
location of the function:<br>
Addons\functions_f\misc
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 20:38, 18 May 2016


Hover & click on the images for description

Description

Description:
/*

	Description:
	Add scripted event handler

	Parameter(s):
		0: NAMESPACE, OBJECT, GROUP or LOCATION - namespace in which handler is saved
		1: STRING - handler name
		2: CODE or STRING - code executed upon calling

	Returns:
	NUMBER - handler ID
*/
(Placeholder description extracted from the function header by BIS_fnc_exportFunctionsToWiki)
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
Syntax needed
Return Value:
Return value needed

Examples

Example 1:

Additional Information

See also:
BIS_fnc_callScriptedEventHandler

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

Bottom Section

Posted on May 15, 2016 - 19:13 (UTC)
RageBone
Example:
_index = [missionNamespace,"event",{someCode = "Hello World";}] call bis_fnc_addScriptedEventhandler;
//_index == 0
_index = [missionNamespace,"event","hint someCode;"}] call bis_fnc_addScriptedEventhandler;
// _index == 1
//executing will hint "hello world".
[missionNamespace,"event",[]] call bis_fnc_callScriptedEventHandler;

Note that this is capable of stacking code, the order of stacking code matters!
Posted on May 18, 2016 - 18:38 (UTC)
RageBone
the first parameter can also be Boolean, preferably "true".
it then defaults to the missionNamespace as the place where it stores the event code.

the code gets stored in the variable: _handlerName = "BIS_fnc_addScriptedEventHandler_" + _handlerName;
// some other code for stacking the event-code. (_handlers)
_namespace setvariable [_handlerName,_handlers];


location of the function:
Addons\functions_f\misc