I have a lot of objects that have an Instance Variable called 'Status' .
The objects will change their behavior based off of 'Status'.
0 = Idle - Does nothing.
1 = Creation - Animate when being created.
2 = Destroy - Animate when being destroyed.
The objects don't move and don't have health, they are created and destroyed by variable changes.
The player Creates or Destroys using an in-game Item.
Each object is created into a group and each group is given a 'GroupID' Via Instance Variable.
If group 6 is destroyed every object with 'GroupID' 6 will be destroyed at the same time.
If group 5 is destroyed the next group created will be given 'GroupID' 5.
Only the highest 'GroupID' can only be destroyed at any given tick, but so can the next 'GroupID'.
Most of the time 'Status' will be 0. There is a chance a player can Create or Destroy quickly.
Is there a way to only enable a 'Function' if a 1 or 2 in the variable 'Status' is present in the layout?
I don't want it checking 800+ objects every single tick, but if they are destroyed or created they need to react instantly.
The only thing I could think of was creating a 'leader' in each group and then checking the variables needed on the 'leader' object. If the leader objects has the required variable then apply create/destroy to all of the same objects with the same 'GroupID'. Is that a proper solution or is there one better? I assume the 'leader' objects would have to be a 2nd object to prevent the the extra variable checks.
I only came up with it because of groups, is it possible to do it without groups?