BIS fnc onLoad: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *(arg|eff|mp|serverExec|gr[0-9]) *= *(.*) * *\|([^=]{12})" to "|$1=$2 |descr=$3")
m (Text replacement - "<code>([^<]+)<\/code>" to "<sqf>$1</sqf>")
 
(12 intermediate revisions by the same user not shown)
Line 3: Line 3:
|game1= tkoh
|game1= tkoh
|version1= 1.00
|version1= 1.00
|game2= arma3
|version2= 0.50


|gr1= Event Handlers
|gr1= Event Handlers


|descr= Register code to be executed after a mission load (from a save, for example).
|descr= Register code to be executed after a mission load (from a save, for example).
{{Feature|important|Replaced by [[Arma 3: Event Handlers/addMissionEventHandler#Loaded|"loaded" mission event handler]].<br>
{{Feature|important|Replaced by [[Arma 3: Mission Event Handlers#Loaded|"loaded" mission event handler]].<br>
This function now exists only because of backward compatibility}}
This function now exists only because of backward compatibility}}


Line 19: Line 22:
|r1= [[Number]] - index of onLoad code
|r1= [[Number]] - index of onLoad code


|x1= <code>_codeIndex = { [[hint]] "Welcome back!"; } [[call]] [[BIS_fnc_onLoad]];</code>
|x1= <sqf>private _codeIndex = { hint "Welcome back!"; } call BIS_fnc_onLoad;</sqf>


|x2= <code>0 [[call]] [[BIS_fnc_onLoad]]; {{cc|removes code with index 0}}</code>
|x2= <sqf>0 call BIS_fnc_onLoad; // removes code with index 0</sqf>


|seealso= [[Arma 3: Event Handlers/addMissionEventHandler|Mission Event Handlers]], [[addMissionEventHandler]]
|seealso= [[Arma 3: Mission Event Handlers|Mission Event Handlers]] [[addMissionEventHandler]]
}}
}}
[[Category:{{Name|arma3}}: Functions|{{uc:onLoad}}]]

Latest revision as of 17:11, 13 July 2022

Hover & click on the images for description

Description

Description:
Register code to be executed after a mission load (from a save, for example).
Replaced by "loaded" mission event handler.
This function now exists only because of backward compatibility
Execution:
call
Groups:
Event Handlers

Syntax

Syntax:
parameter call BIS_fnc_onLoad
Parameters:
parameter: Code or Number:
  • Code - code to be executed on mission load
  • Number - index of code to remove
 
Return Value:
Number - index of onLoad code

Examples

Example 1:
private _codeIndex = { hint "Welcome back!"; } call BIS_fnc_onLoad;
Example 2:
0 call BIS_fnc_onLoad; // removes code with index 0

Additional Information

See also:
Mission Event Handlers addMissionEventHandler

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