• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

GMS 2.3+ how to make the sequences within sequences keep playing

Tbug20

Member
I'm making a cool title screen animation for my game, and I have a sequence within a sequence as the animation. I'd like the sequence that's inside of the sequence to keep playing after the main sequence has ended. Is there a way to do that?
 

woods

Member
cant you do it the same way you would handle an animated sprite?
have 2 separate sequences..
at the end step (or destroy event rather) of the 1st sequence, start the 2nd sequence... and have the 2nd sequence repeat on a loop?

take a look at adding moments to your sequence as well... basically you are setting a call function()
 

woods

Member
brainstorming here ;o) dont mind me...

in a controller object,.
set a variable to true when the 1st sequence has been destroyed

if (that variable is true)
{
start the 2nd sequence;
}
 

Tbug20

Member
brainstorming here ;o) dont mind me...

in a controller object,.
set a variable to true when the 1st sequence has been destroyed

if (that variable is true)
{
start the 2nd sequence;
}
Okay, but how would i prevent it from creating a new sequence every frame after the variable becomes true?
 

woods

Member
doesnt the sequence get destroyed at the end of the animation? not the end of the step ..thats how i interpreted it anyway ;o)
 

Tbug20

Member
doesnt the sequence get destroyed at the end of the animation? not the end of the step ..thats how i interpreted it anyway ;o)
I mean in the controller object, once the variable becomes true, wouldn't it create a new instance of the second sequence every frame afterwards?
 

woods

Member
check if the 2nd one is already running..
if !sequence_exists(whatever you name the 2nd sequence)


Code:
if (that variable is true)
{
if !sequence_exists(whatever you name the 2nd sequence)
{
start the 2nd sequence;
} 
}
 

Tbug20

Member
I tried doing the creation of the new sequence and the deletion of the first in a "moment", but the first sequence is not deleting. I'm gonna try to look into this.
 

woods

Member
layer_sequence_destroy()
found some info for ya here on our forums ;o)
 

Tbug20

Member
layer_sequence_destroy()
found some info for ya here on our forums ;o)
I was actually looking at that same thread, lol. I usually use DnD but I'll just use the execute code block for this one.
 

Tbug20

Member
I tried doing the creation of the new sequence and the deletion of the first in a "moment", but the first sequence is not deleting. I'm gonna try to look into this.
I think my problem is that the sequence is created from the IDE. But I can't create it in an object create event for some reason, because for a reason I don't know, whenever I do that, the game freezes before the room can even load!
 

woods

Member
i think we gonna have to wait on more exp than what ive got bro ;o)

one would think it wouold work similar to instance_create and instance_destroy.. the events are all similar to a regular object related events and whatnot..
 

Tbug20

Member
i think we gonna have to wait on more exp than what ive got bro ;o)

one would think it wouold work similar to instance_create and instance_destroy.. the events are all similar to a regular object related events and whatnot..
okay, the creating on a create event works now for some reason, but the sequence still won't disappear! I think I'm just going to resort to making the last frame of the first sequence transparent.
 

woods

Member
making the last frame of the first sequence transparent.
now your gettin hillbilly with it ;o)

that'll make it disappear from the your view, but its still there ....gonna be aresource hog / memory leak

maybe add a moment inthe second sequence and destroy the 1st one there?
 

Tbug20

Member
now your gettin hillbilly with it ;o)

that'll make it disappear from the your view, but its still there ....gonna be aresource hog / memory leak

maybe add a moment inthe second sequence and destroy the 1st one there?
nope, doesnt work. i think ill stick with hillbillying it.
 

woods

Member
looking at the last three posts in that thread we were looking at earlier..

layer_sequence_destroy()


Toque
To destroy a sequence its quite simple.

Create:
sequence = layer_sequence_create("Instances", x,y,seq_1);

To destroy it:
layer_sequence_destroy(sequence);

Toque
I kept chasing sequence_destroy. Unaware that layer_sequence_destroy() existed. It was only when I clicked on "layer functions" buried in the manual did I find them.
 
Top