• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 How to get a variable from multiple objects in a room?

Bokkie2988

Member
Does anyone know how to get a variable from multiple objects in a room?
for context: Im trying to make a turn based system where the player with the highest speed starts first.
So I want to get the current speed of the player and multiple other enemies.
(If someone has a good tutorial on turn based battle systems, that would be incredably usefull too)

Thanks,

Bojan
 

Slyddar

Member
The player, and enemies, should be children of a parent object, say o_actor, and you could then utilise the with() function to get the highest speed from them by comparing one to the next and storing the id of the highest one.

Also this is a good tutorial on a turn based system -
 
Top