D
Diamond Hunter Zero
Guest
This is a call out for assistance on how to effectively repeatedly execute moments within a single timeline within GML.
As part of a game I'm working on, I want to employ a cut-scene mechanic where distinct stages of cut-scenes are all written as a sequence of timeline moments. This means that each moment within these timelines contains a bunch of code doing stuff such as drawing and changing variables which work together to produce a single stage within the cut-scene sequence. It's intended to work like this:
As part of a game I'm working on, I want to employ a cut-scene mechanic where distinct stages of cut-scenes are all written as a sequence of timeline moments. This means that each moment within these timelines contains a bunch of code doing stuff such as drawing and changing variables which work together to produce a single stage within the cut-scene sequence. It's intended to work like this:
An object called Obj_cutscene initializes a timeline like this:
And in it's step event, runs this code:
Meanwhile, each moment/step in cutscene_timeline looks something like this:
There is a moment for every step in the timeline (step 0,1,2,3 ...) all corresponding to stages 0,1,2,3 ... and so on in the cut-scene.
The problem is that Gamemaker only executes each moment in the timeline ONCE (as expected...). I need Obj_cutscene to repeatedly execute each moment of the timeline as if it were in a step event, until the timer completes and it moves on to the next stage/moment. Otherwise, the various text, sprites, and shapes drawn exist only for a single frame.
I don't want to hard-code these cutscene stages into the draw event of the object itself, since there would be simply to many variables and if-statements to worry about.
So I'm asking, is there a way to make an object repeatedly execute a specific moment in a timeline every single step, Or is there another way of performing this staged drawing mechanic?
Code:
var_timer = 0;
timeline_id = cutscene_timeline
timeline_running = true;
timeline_speed = 1;
Code:
if(var_timer > 90)
{timeline_position += 1;
timeline_speed = 0;
var_timer = 0}
else
{var_timer += 1}
Code:
//run some surface drawing events
//draw more shapes and text here
//move a object to x,y
// etc ......
timeline_speed = 0;
The problem is that Gamemaker only executes each moment in the timeline ONCE (as expected...). I need Obj_cutscene to repeatedly execute each moment of the timeline as if it were in a step event, until the timer completes and it moves on to the next stage/moment. Otherwise, the various text, sprites, and shapes drawn exist only for a single frame.
I don't want to hard-code these cutscene stages into the draw event of the object itself, since there would be simply to many variables and if-statements to worry about.
So I'm asking, is there a way to make an object repeatedly execute a specific moment in a timeline every single step, Or is there another way of performing this staged drawing mechanic?