• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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,337
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