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

GML Visual (GML explanation works as well) Some terminology clarification and automaticaly reading instance names

B

Bipp Bopp

Guest
For example inst_36147D42, inst_14B84C93, inst_173083D5, are these the names of the instance, or what are they called if not? For now I'll write assuming they are.

If we have multiple rooms, and in each room there are 3 instances of object A, as well as 1 instance of object B, and I want the instance of object B to perform certain actions on each instance of object A, what I currently do is have 3 variables that hold the names of each instance of object A. However in each room I am manually assigning the names to the variables and I'm sure it can be done in a better way. How can I access and read the instance name so I can automatically assign it to the variables? Or if you think this is a bad way to do it, how would you recommend I proceed?
 

Nidoking

Member
That's probably the most sensible way to do it. Other options are to use with to loop over the instances and check some value in each one to see which one it is, then make the assignment appropriately. It requires some manual setting either way.
 
Top