Description
Universal system for playing sequential events defined by time.
Note
codeInterrupt and codeEnd are called while the code in the timeline is spawned.
Syntax
[timeline, index, music, codeInterrupt, codeEnd] call BIS_fnc_eventTimeline
Parameters:
timeline: Array - timeline in format [[1.0, {code}], [2.0, {code}], [2.3, {code}], [4.7, {code}]]index: Number - (Optional, default 0) index of the event to playmusic: String - (Optional, default "") music to be played which will provide the sync time for the timelinecodeInterrupt: Code - (Optional, defaultparams ["_pointer", "_baseTime", "_evenTime"]; ["Timeline interrupted while playing event nr.: %1 (%2)", _pointer, _baseTime + _eventTime] call BIS_fnc_logFormat;) Code to be executed if the timeline is interrupted withmissionNamespace setVariable ["BIS_fnc_eventTimeline_playing", false]codeEnd: Array or Code - (Optional, default nil) Code or Array of codes to be executed once the timeline is finished. The codes are called one after the other.
Returns: Nothing
Examples
Example 1
private _timeline =
[
[0.0, { hint "Start of the Timeline" }],
[1.0, { hint "Event 1" }],
[3.0, { hint "End of the timeline" }]
];
[_timeline, 0, "", { hint "Interrupted" }, { hint "Timeline done" }] spawn BIS_fnc_eventTimeline;