• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 [SUGGESTION] Timeline revamping IDEAS!

xDGameStudios

GameMaker Staff
GameMaker Dev.
Hi everyone, I wanted to know your opinion or work around on a topic regarding timelines...

1) What if I need to add multiple scripts to the same point in time?!
it would be nice to allow adding an array of scripts to a momment :)
Code:
timeline_moment_add_script(id, 5, script_a)
timeline_moment_add_script(id, 5, script_b)
or
Code:
timeline_moment_add_script(id, 5, [script_a, script_b])
2) another thing would be reverse the timeline!
I don't know if it is already possible (not mentioned in the manual) setting the speed to negative would be great if it could reverse the timeline.

3) having the timeline (moment) to hold data in the form of an array for example.
Code:
timeline_moment_add_script_ext(id, step, script*, array)
this would let you use argument[x] inside the script as it would have the array reference.
and the arguments could even change during the timeline ;)

4) array references inside timelines would be release as timeline_moment_clear is called.

I heard timelines were getting a revamp to have some new features but that doesn't appear in the roadmap!

Having said this, I want to justify myself about the topic... it would be great to put this to use... timeline could be the base of a tween system... a build tween system!
 

gnysek

Member
For now, you can just use one script for all steps.

Code:
timeline_moment_add_script(tid, 5, script_for_timeline1);
Code:
///script_for_timeline1

switch(timeline_position) {
    case 5:
        script_a();
        script_b();
        break;
}

But in fact, this way... do you need a timeline, or just variable to hold current step position ? (or two if you want to make timeline step every X frames). Like:

Code:
/// create
step = 0;
step_counter = 0;
step_frames = 10; // after how many frames even should be performed

/// step
step_counter ++;
if (step_counter >= step_frames) {
   step_counter = 0;
   step++;
   /// .. perform code, step is now your "timeline_position".
}

In my honest opinion, timelines are for people who use DND. For those who use GML, they are useless, as you can be more flexible with your own system, which will mimic original one plus even more.
 

xDGameStudios

GameMaker Staff
GameMaker Dev.
Well I really wanted to use timelines because they are just that - a way for executing scripts in a given moment in time/tick. If using an object to do that it is more powerful, but more performance costly... because objects can do that an do also a lot more (hidden stuff).
So that was my tentative of solution for the problem, and since light_objects seem to be a 'undefined' time away
(nothing on the roadmap so far and for all we know we don't even have an ideia when the next 'major' update will be.. it can be next month it can be next year) :) Staff memebers that read this and want to share something ;)
 
Top