• 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.

Detecting Destructible

Status
Not open for further replies.
I have this trigger and no effect is created or action is taken.

  • Barriers
    • Events
      • Destructible - A destructible within (Playable map area) dies
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Barrier Holder
    • Actions
      • Set TempLoc14 = (Position of (Dying destructible))
      • Special Effect - Create a special effect at TempLoc14 using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
      • Special Effect - Destroy (Last created special effect)
      • Destructible - Pick every destructible within 2000.00 of TempLoc14 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Barrier
            • Then - Actions
              • Destructible - Kill (Picked destructible)
            • Else - Actions
      • Custom script: call RemoveLocation (udg_TempLoc14)
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
A comment on style / efficiency: Dying destructible should probably be cached beforehand so the function doesn't need to get called twice.

Did you put any debug messages in? Put them in, and see where the trigger fails or even crashes. Or does the trigger fire at all? I'd put a display text message in between every line if you are really not sure what's wrong.

If the trigger is never firing, then that's an issue outside of the logic of your actual trigger probably.

You could always try this resource: http://www.hiveworkshop.com/forums/jass-resources-412/snippet-getclosestwidget-204217/. It has a function that will serve your purpose I believe.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
The event only registers the first 64 destructables within the rect when the event is being created -> map init. There is a gray hint which states that. It's better to create single destructable death events. Pick/loop over them at init and enwrap the creation of new ones.
 
The event only registers the first 64 destructables within the rect when the event is being created -> map init. There is a gray hint which states that. It's better to create single destructable death events. Pick/loop over them at init and enwrap the creation of new ones.

Is this not a single event?
 
Status
Not open for further replies.
Top