• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Sequence Object/Instance Struct

Hey all, so i've been trying to figure this out for a while, using the forums google etc to find resources or documentation about it, but can't find anything. I have a sequence which plays as a cutscene and uses sprites. The sequence gets paused to wait for player input but this also pauses sprite animation so my thought was to try and find the sprite instance/element and update the image_index manually but i just can't seem to find where to do this. I have looked in the sequence.tracks struct array but after getting the track struct and running variable_struct_get_names() it's not a struct and gives an empty value. I'm starting to wonder if this is even possible. Any help would be great as the documentation on sequence structs are very contradicting.

Currently I have _struct = layer_sequence_get_sequence(elementID). Then using that i get the track array with _arr = _struct.tracks . Finally trying to get the struct variable names with variable_struct_get_names(_arr) but comes up empty. show_debug_message(_arr) show what i'd expect with an array of structs but can't seem to get deeper into it to find any image_index variable.

Any help is greatly appreciated. Thanks!
 
Last edited:

rytan451

Member
Hi, as future reference, when you're writing code inline, use [icode] tags, like so: [icode]variable_struct_get_names(_arr[i])[/icode], which becomes variable_struct_get_names(_arr[i]). Otherwise, you get loads of your post italicized, like you can see above.
 
Hi, as future reference, when you're writing code inline, use [icode] tags, like so: [icode]variable_struct_get_names(_arr[i])[/icode], which becomes variable_struct_get_names(_arr[i]). Otherwise, you get loads of your post italicized, like you can see above.
Thanks! Didn't realise that was a thing
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
You need to call the function layer_sequence_get_instance() on the sequence element ID to get the actual sequence instance struct... The other function gets the sequence object (iirc) rather than the instance that's actually running. You should then be able to check the "activeTracks" array to get the track structs and go on from there.
 
You need to call the function layer_sequence_get_instance() on the sequence element ID to get the actual sequence instance struct... The other function gets the sequence object (iirc) rather than the instance that's actually running. You should then be able to check the "activeTracks" array to get the track structs and go on from there.
Oh i did try that to begin with but said it was read only in documentation, and then abit further that it was editable lol and couldn't find an image_index variable in there. I'll give it another go with get_instance. Thanks atleast i have a direction now instead of stabbing at it wildly lol
 
You need to call the function layer_sequence_get_instance() on the sequence element ID to get the actual sequence instance struct... The other function gets the sequence object (iirc) rather than the instance that's actually running. You should then be able to check the "activeTracks" array to get the track structs and go on from there.
Hey so did some testing and is still doesn't see what's inside activeTracks as a struct. I used typeof(activeTracks[I]) to see and it says it's a struct but when using is_struct it returns false. And using variable_struct_get_names() it's an empty array. It's very confusing. It's like it's a struct but not a normal useable struct[/I]
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
I'm afraid I can offer no further insight on the matter... My suggestion would be to file it as a bug with YYG (as it seems like one), and if it's not then they'll tell you and explain what is actually going on.
 
I'm afraid I can offer no further insight on the matter... My suggestion would be to file it as a bug with YYG (as it seems like one), and if it's not then they'll tell you and explain what is actually going on.
Thanks for the help. Did some more testing and it seems like the sequence structs are just all kinds of nope. Managed to edit the activeTracks imageindex value exactly what i wanted (But can't use is_struct or variable_struct_exists) but does nothing. I then tried putting the array back into activeTracks but can't set it because it's read only. Think i'm gonna have to call it quits with again but i did get closer this time. Thanks again.
 
Top