• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Only one lightning is destroyed

Status
Not open for further replies.
Level 7
Joined
Mar 13, 2008
Messages
228
This is my trigger:
  • Radiat Blast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Radiat Blast
    • Actions
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Unit - Create 1 gggg 2 for Neutral Passive at ((Position of (Casting unit)) offset by 150.00 towards ((Real((Integer A))) x (360.00 / 2.00)) degrees) facing Default building facing degrees
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Lightning - Create a Spirit Link lightning effect from source (Position of (Last created unit)) to target (Position of (Casting unit))
          • Set LightningEfeects[(Player number of (Owner of (Casting unit)))] = (Last created lightning effect)
      • Wait 5.00 seconds
      • Lightning - Destroy LightningEfeects[(Player number of (Owner of (Casting unit)))]
But the destroy lightning effect at the end only destroyes one of the lightning effects, any help?
 
Level 6
Joined
Jul 22, 2008
Messages
243
Not sure but, does the (Casting Unit) stay stored after a wait? Try with Triggering Unit instead.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
  • Set LightningEfeects[(Player number of (Owner of (Casting unit)))] = (Last created lightning effect)
This is set to the last created lightning effect.
Use 2 different variables or use on and replace
  • (Player number of (Owner of (Casting unit)))
with
  • For Loop Integer A
and use this at the end:
  • Lightning - Destroy LightningEfeects[1]
  • Lightning - Destroy LightningEfeects[2]
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
  • Set LightningEfeects[A] = (Last created lightning effect)
would be more effective since you can relay to the integer later on and thus not have to store it into 2 arrays ^^, so you just would have to destroy
  • For each (Integer A) from 1 to 2, do Lightning - Destroy LightningEfeects[A]
 
Status
Not open for further replies.
Top