• 🏆 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!

Killing Hash-stored Destructible-s

Status
Not open for further replies.
Hello, I have a trigger, which spawns some destructibles around a target:
  • Trug
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • Set Point1 = (Position of (Triggering unit))
    • Unit - Create 1 Dragon at (Point1) for (Owner of (Triggering unit)) facing default building degrees
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Set Point2 = ((Point1) offset by 256.00 towards ((Real(IntegerA)) * 30)) degrees
        • Destructible - Create Summer Tree Wall at Point2 ...
        • Hashtable - Save handle of (Last created destructible) as Key(destructible) of (Key(Last created unit)) in (Destructible_Hash)
        • Custom script: call RemoveLocation (udg_Point2)
    • Custom script: call RemoveLocation (udg_Point1)
Now, I want it, so that, when the spawned dragon dies, so the destructibles do:

  • Trigger
  • Events
    • Unit - A unit dies
  • Conditions
    • (((Key destructible) is stored as a Handle of (Key (Triggering unit)) in Destructible_Hash) Equal to True)
  • Actions
    • Destructible - Kill (Load Key(destructible) of Key(Triggering unit) in (Destructible_Hash))
It doesn't work though!! Any ideas? + Rep will be given.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Hashtable - Save handle of (Last created destructible) as Key(ForLoopA) of (Key(Last created unit)) in (Destructible_Hash)
^In the first trigger.

  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
      • Destructible - Kill (Load Key(ForLoopA) of Key(Triggering unit) in (Destructible_Hash))
^In the second trigger.

EDIT: And remember to clear child hashtables after you destroy the destructibles.
 
Status
Not open for further replies.
Top