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

Destroy Lightning in a hashtable

Status
Not open for further replies.
Level 13
Joined
Sep 29, 2008
Messages
672
  • 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,243
  • 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