• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[Solved] Count Destructables in Region

Status
Not open for further replies.
Level 30
Joined
Aug 29, 2012
Messages
1,356
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.
Top