• 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!

SOLVED Getting individual instances from a sequence?

Gizmo199

Member
So I am having a hard time getting individual instance ID's from sequences. The function layer_sequence_get_objects() only returns object indexes and not the instance ID's from the objects being created in the sequence. I need to have individual ID's so I will be able to use 1 animation for multiple different NPC's / Players. So an example would be having an "obj_arm" object in a sequence that moves. The enemies and player can create the same animation and get the x/y/angle from the "obj_arm" in that specific sequence. Right now since layer_sequence_get_objects() only references object indexes and not Instance ID's the player and the enemy will play the same animation on the same frames ( since they reference the same object index).

Does anyone have any ideas or thoughts around this dilemma?


NVM solved. Had to override the instances with newly created instances.
 
Last edited:

Andrey

Member
NVM solved. Had to override the instances with newly created instances.
I'm also dealing with sequences. And a similar question arose. How did you decide?
GML:
inst_id = instance_create_layer(x, y, layer, obj);
var _seq_inst = layer_sequence_get_instance(sequence_id);
sequence_instance_override_object(_seq_inst, obj, inst_id);
 
Last edited:

Gizmo199

Member
I'm also dealing with sequences. And a similar question arose. How did you decide?
GML:
inst_id = instance_create_layer(x, y, layer, obj);
var _seq_inst = layer_sequence_get_instance(sequence_id);
sequence_instance_override_object(_seq_inst, obj, inst_id);
Well unfortunately GM doesn't allow you to get individual IDs easily. I think you can access them via the struct possibly, but it was just easier to override an object type with a specific instance.
 
Top