Legacy GM Selecting all of a certain object [solved]

A

aguy

Guest
I currently need to know a way of selecting all of a certain object.
My previous solution was:
Code:
with all
{
         if(self = ob_box)
         {
                  //actions
         }
}
but i'm now pretty certain that that doesn't work at all and is the cause of many bugs.
Is there a way of selecting all of a certain object? I haven't been able to find one in the manual.
Thanks for any help
 

KurtBlissZ

Member
You can do
Code:
with ob_box
{
    //actions
}
You could even do (though this won't take into account children objects, if you want it to look into using object_is_ancestor)
Code:
with all
{
    if object_index == ob_box
    {
        //action
    }
}
 

Xer0botXer0

Senpai
Hmm.. how about.

With (obj_balloon)
{
}

I wonder if that would work, because you have instances of objects, so if you focus on the object itself then maybe the instances get destroyed.. if not


An alternative solution:

When ever an instance of said object is created, store it's instance_id that you receive using instance_create into a 1D Array, then to modify them all at once use a for loop and look through the array.

Whoops Kurt beat me to it
 
Top