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

Destroy Lightning in a hashtable

Status
Not open for further replies.
Level 13
Joined
Sep 29, 2008
Messages
671
  • For each (Integer NV_Loop) from 4 to 12, do (Actions)
    • Loop - Actions
      • Set NV_Reals[0] = (NV_Reals[0] + 45.00)
      • Set NV_Points[1] = (NV_Points[0] offset by 480.00 towards NV_Reals[0] degrees)
      • Set NV_Points[2] = (NV_Points[0] offset by 480.00 towards (NV_Reals[0] + 45.00) degrees)
      • Custom script: call AddLightningEx( "CLPB" , true , GetLocationX(udg_NV_Points[1]) , GetLocationY(udg_NV_Points[1]) , GetLocationZ(udg_NV_Points[1]) + 100, GetLocationX(udg_NV_Points[2]) , GetLocationY(udg_NV_Points[2]) , GetLocationZ(udg_NV_Points[2]) + 100)
      • Hashtable - Save Handle Of(Last created lightning effect) as NV_Loop of (Key (Triggering unit)) in NV_Hashtable
      • Lightning - Destroy (Load NV_Loop of (Key (Triggering unit)) in NV_Hashtable)
      • Custom script: call RemoveLocation(udg_NV_Points[1])
      • Custom script: call RemoveLocation(udg_NV_Points[2])
I was testing this on how to remove lighting in hashtable i saved. when i casted the spell the lightning shouldn't show because it should have been destroyed after saving it in hashtable but lightning still shows. is there something I missed? Help pls.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • For each (Integer NV_Loop) from 4 to 12, do (Actions)
    • Loop - Actions
      • Set NV_Reals[0] = (NV_Reals[0] + 45.00)
      • Set NV_Points[1] = (NV_Points[0] offset by 480.00 towards NV_Reals[0] degrees)
      • Set NV_Points[2] = (NV_Points[0] offset by 480.00 towards (NV_Reals[0] + 45.00) degrees)
      • Custom script: set bj_lastCreatedLightning = AddLightningEx( "CLPB" , true , GetLocationX(udg_NV_Points[1]) , GetLocationY(udg_NV_Points[1]) , GetLocationZ(udg_NV_Points[1]) + 100, GetLocationX(udg_NV_Points[2]) , GetLocationY(udg_NV_Points[2]) , GetLocationZ(udg_NV_Points[2]) + 100)
      • Hashtable - Save Handle Of(Last created lightning effect) as NV_Loop of (Key (Triggering unit)) in NV_Hashtable
      • Lightning - Destroy (Load NV_Loop of (Key (Triggering unit)) in NV_Hashtable)
      • Custom script: call RemoveLocation(udg_NV_Points[1])
      • Custom script: call RemoveLocation(udg_NV_Points[2])
Only the GUI actions set last created lightning. If you use native functions, you need to set it yourself.
 
Status
Not open for further replies.
Top