BIS fnc runLater: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^<]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^<]*) *<\/code>" to "<code>$1$2$3</code>")
m (Text replacement - "\{\{ *cc*\| *([^}]+) *\}\}" to "// $1")
Line 22: Line 22:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>{{cc|Hints current game time in the next frame after 5 seconds have passed}}
|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>
["uniqueId", { hint str time; }, 5] call BIS_fnc_runLater;</code>


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


|x3= <code>{{cc|Hints current game time in the next frame after BIS_variable is assigned}}
|x3= <code>// 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;</code>
["uniqueId", { hint str time; }, nil, nil, { !isNil { BIS_variable } }] call BIS_fnc_runLater;</code>


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


|x5= <code>{{cc|Hints current game time in the next frame}}
|x5= <code>// Hints current game time in the next frame
["uniqueId", { hint str time; }] call BIS_fnc_runLater;</code>
["uniqueId", { hint str time; }] call BIS_fnc_runLater;</code>


|seealso= [[BIS_fnc_CPWaitUntil]] [[waitUntil]] [[BIS_fnc_loop]]
|seealso= [[BIS_fnc_CPWaitUntil]] [[waitUntil]] [[BIS_fnc_loop]]
}}
}}

Revision as of 11:02, 13 July 2022

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