BIS fnc runLater: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *U([a-z ])" to "$1 - u$2")
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1=1.16


|1.16|Game version=
|gr1= Program Flow


|gr1 = Program Flow |GROUP1=
|descr= Stack code/function that should be run later, after some time/frames or/and custom condition. Internally calls [[BIS_fnc_loop]].


| Stack code/function that should be run later, after some time/frames or/and custom condition. |DESCRIPTION=
|s1= [id, code, timer, timerType, condition] call [[BIS_fnc_runLater]]


| param call [[BIS_fnc_runLater]]; |SYNTAX=
|p1= id: [[String]] - unique Id


|p1= Unique Id : [[String]] |PARAMETER1=
|p2= code: [[Code]] or [[String]] - code/function that is executed later
|p2= Code/function that is executed later : [<nowiki/>[[Code]], [[String]]<nowiki>]</nowiki> |PARAMETER2=
|p3= The timer value (can be in seconds or frames) : [[Number]] |PARAMETER3=
|p4= The timer type, can be "seconds" or "frames" : [[String]] |PARAMETER4=
|p5= The custom condition, code is only executed if timer is validated and condition is met : [[Code]] |PARAMETER5=


| [[Nothing]] |RETURNVALUE=
|p3= timer: [[Number]] - the timer value (can be in seconds or frames)
 
|x1= <code>//Hints current game time in the next frame after 5 seconds have passed
["uniqueId", { hint str time; }, 5] call BIS_fnc_runLater;</code> |Example1=


|x2= <code>//Hints current game time in the next frame after 120 frames have passed
|p4= timerType: [[String]] - can be "seconds" or "frames"
["uniqueId", { hint str time; }, 120, "frames"] call BIS_fnc_runLater;</code> |Example2=


|x3= <code>//Hints current game time in the next frame after BIS_variable is assigned
|p5= condition: [[Code]] - the custom condition, code is only executed if timer is validated and condition is met
["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;</code> |EXAMPLE3=


|x4= <code>//Hints current game time in the next frame after 5 seconds have passed and BIS_variable is assigned
|r1= [[Nothing]]
["uniqueId", { hint str time; }, 5, "seconds", { !isNil { BIS_variable } }] call BIS_fnc_runLater;</code> |EXAMPLE4=


|x5= <code>//Hints current game time in the next frame
|x1= <sqf>// Hints current game time in the next frame after 5 seconds have passed
["uniqueId", { hint str time; }] call BIS_fnc_runLater;</code> |EXAMPLE5=
["uniqueId", { hint str time; }, 5] call BIS_fnc_runLater;</sqf>


| |SEEALSO=
|x2= <sqf>// Hints current game time in the next frame after 120 frames have passed
["uniqueId", { hint str time; }, 120, "frames"] call BIS_fnc_runLater;</sqf>


}}
|x3= <sqf>// Hints current game time in the next frame after BIS_variable is assigned
["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;</sqf>
 
|x4= <sqf>// Hints current game time in the next frame after 5 seconds have passed and BIS_variable is assigned
["uniqueId", { hint str time; }, 5, "seconds", { !isNil { BIS_variable } }] call BIS_fnc_runLater;</sqf>


<h3 style="display:none">Bottom Section</h3>
|x5= <sqf>// Hints current game time in the next frame
["uniqueId", { hint str time; }] call BIS_fnc_runLater;</sqf>


[[Category:Functions|{{uc:runLater}}]]
|seealso= [[BIS_fnc_CPWaitUntil]] [[waitUntil]] [[BIS_fnc_loop]]
[[Category:{{Name|arma3}}: Functions|{{uc:runLater}}]]
}}

Latest revision as of 15:52, 8 November 2023

Hover & click on the images for description

Description

Description:
Stack code/function that should be run later, after some time/frames or/and custom condition. Internally calls BIS_fnc_loop.
Execution:
call
Groups:
Program Flow

Syntax

Syntax:
[id, code, timer, timerType, condition] call BIS_fnc_runLater
Parameters:
id: String - unique Id
code: Code or String - code/function that is executed later
timer: Number - the timer value (can be in seconds or frames)
timerType: String - can be "seconds" or "frames"
condition: Code - the custom condition, code is only executed if timer is validated and condition is met
Return Value:
Nothing

Examples

Example 1:
// Hints current game time in the next frame after 5 seconds have passed ["uniqueId", { hint str time; }, 5] call BIS_fnc_runLater;
Example 2:
// Hints current game time in the next frame after 120 frames have passed ["uniqueId", { hint str time; }, 120, "frames"] call BIS_fnc_runLater;
Example 3:
// Hints current game time in the next frame after BIS_variable is assigned ["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;
Example 4:
// Hints current game time in the next frame after 5 seconds have passed and BIS_variable is assigned ["uniqueId", { hint str time; }, 5, "seconds", { !isNil { BIS_variable } }] call BIS_fnc_runLater;
Example 5:
// Hints current game time in the next frame ["uniqueId", { hint str time; }] call BIS_fnc_runLater;

Additional Information

See also:
BIS_fnc_CPWaitUntil waitUntil BIS_fnc_loop

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