[Solved] Count Destructables in Region

Status
Not open for further replies.
Managed to do it in GUI, seems quite weird but this worked for me :

  • Destructible - Pick every destructible in My Region <gen> and do (Actions)
    • Boucle - Actions
      • Set My_Var = (My_Var + 1)
Of course you have to handle the leak, but that was just so you can see the idea =)

Edit : Ah yes sorry my WE is in French, boucle means loop!
 
I see how it works. I'll give it a shot and call a script to destroy the group. Also related; Do you know how to return a region that a destructible was destroyed in?

You don't need destroy anything. Destructable enumeration doesn't actually involve "group" objects. :)

As for your second question, no. There is no built-in way, because regions may overlap (so a destructable could belong to many regions). If your map is made so that all regions are disjoint, then you can use a hashtable to save the region under the handle ID of the destructable. You can just enumerate through all regions on initialization. Don't forget to map all the destructables you create/respawn through code as well.
 
Status
Not open for further replies.
Back
Top