BIS fnc eventTimeline: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (fixed typo)
m (Text replacement - "{{Feature|Informative|" to "{{Feature|informative|")
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function
{{RV|type=function


|game1= arma3
|game1= arma3
|version1= 1.78
|version1= 1.78


|eff= local
|eff= local


|gr1 = Timeline |GROUP1=
|gr1= Timeline


|gr2 = Systems |GROUP2=
|gr2= Systems


|descr= Universal system for playing sequential events defined by time. {{Informative|''codeInterrupt'' and ''codeEnd'' are [[call]]ed while the code in the timeline is [[spawn]]ed.}}
|descr= Universal system for playing sequential events defined by time. {{Feature|informative|''codeInterrupt'' and ''codeEnd'' are [[call]]ed while the code in the timeline is [[spawn]]ed.}}


|s1= [timeline, index, music, codeInterrupt, codeEnd] [[call]] [[BIS_fnc_eventTimeline]]
|s1= [timeline, index, music, codeInterrupt, codeEnd] call [[BIS_fnc_eventTimeline]]


|p1= timeline: [[Array]] - Timeline in format [ [1.0, {code} ], [2.0, {code} ], [2.3, {code} ], [4.7, {code} ] ]
|p1= timeline: [[Array]] - timeline in format <nowiki>[[1.0, {code}], [2.0, {code}], [2.3, {code}], [4.7, {code}]]</nowiki>


|p2= index: [[Number]] - (Optional, default 0) Index of the event to play
|p2= index: [[Number]] - (Optional, default 0) index of the event to play


|p3= music: [[String]] - (Optional, default "") Music to be played which will provide the sync time for the timeline
|p3= music: [[String]] - (Optional, default "") music to be played which will provide the sync time for the timeline


|p4= codeInterrupt: [[Code]] - (Optional, default<br>
|p4= codeInterrupt: [[Code]] - (Optional, default  
{{Inline code|[[params]] ["_pointer", "_baseTime", "_evenTime"];}}<br>
<sqf inline>params ["_pointer", "_baseTime", "_evenTime"];
{{Inline code|["Timeline interrupted while playing event nr.: %1 (%2)", _pointer, _baseTime + _eventTime] [[call]] [[BIS_fnc_logFormat]];}})<br>Code to be executed if the timeline is interrupted with  
["Timeline interrupted while playing event nr.: %1 (%2)", _pointer, _baseTime + _eventTime] call BIS_fnc_logFormat;</sqf>)<br>Code to be executed if the timeline is interrupted with  
{{Inline code|[[missionNamespace]] [[setVariable]] ["BIS_fnc_eventTimeline_playing", [[false]]]}}
<sqf inline>missionNamespace setVariable ["BIS_fnc_eventTimeline_playing", false]</sqf>


|p5= codeEnd: [[Array]] or [[Code]] - (Optional, default [[nil]]) [[Code]] or [[Array]] of codes to be executed once the timeline is finished. The codes are [[call]]ed one after the other.
|p5= codeEnd: [[Array]] or [[Code]] - (Optional, default [[nil]]) [[Code]] or [[Array]] of codes to be executed once the timeline is finished. The codes are [[call]]ed one after the other.
Line 30: Line 29:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1 =  
|x1= <sqf>
<code>[[private]] _timeline =  
private _timeline =
[  
[
[0.0, { [[hint]] "Start of the Timeline" } ],  
[0.0, { hint "Start of the Timeline" }],
[1.0, { [[hint]] "Event 1" }     ],  
[1.0, { hint "Event 1" }],
[3.0, { [[hint]] "End of the timeline" } ]  
[3.0, { hint "End of the timeline" }]
];
];


[_timeline, 0, "", {[[hint]] "Interrupted"}, {[[hint]] "Timeline done"}] [[spawn]] [[BIS_fnc_eventTimeline]];</code>
[_timeline, 0, "", { hint "Interrupted" }, { hint "Timeline done" }] spawn BIS_fnc_eventTimeline;
</sqf>


|exec= spawn
|exec= spawn


|seealso= [[BIS_fnc_animatedBriefing]]
|seealso= [[BIS_fnc_animatedBriefing]]
}}
}}
[[Category:Functions|{{uc:eventTimeline}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:eventTimeline}}]]

Latest revision as of 01:24, 2 February 2024

Hover & click on the images for description

Description

Description:
Universal system for playing sequential events defined by time.
codeInterrupt and codeEnd are called while the code in the timeline is spawned.
Execution:
spawn
Groups:
TimelineSystems

Syntax

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 play
music: String - (Optional, default "") music to be played which will provide the sync time for the timeline
codeInterrupt: Code - (Optional, default params ["_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 with missionNamespace 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.
Return Value:
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;

Additional Information

See also:
BIS_fnc_animatedBriefing

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