timeline_max_moment

Gives you the maximum moment placed in a given timeline.

Syntax:

timeline_max_moment(ind);


Argument Description
ind The index of the timeline to get the last moment of.


Returns: N/A


Description

This function will return the value of the moment in which the timeline performs its final action. So, if you have a timeline with 8 different actions placed 20 moments apart, this function would return the moment value of the last action in that timeline, which would be 160. This function is a good way to test whether a timeline has passed the last active moment when running, since the timeline position will continue incrementing every step of the game whether there are further actions or not.


Example:

if timeline_position > timeline_max_moment(timeline_index)
   {
   timeline_running = false;
   }

The above code will check the current timeline position against the maximum active moment, and if it is greater the timeline will be stopped.


Back: Timelines
Next: timeline_index
© Copyright YoYo Games Ltd. 2018 All Rights Reserved