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

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,243
  • 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