AddLightningEx and MoveLightningEx question.

n1mr0d

Member
Reaction score
1
Ok so here is this 2 command, as custom script, they have parameters like :
AddLightningEx(some lightning, true, x, y, z,x1,y1,z1)
MoveLightningEx(the lastcreated lightning, true,x,y,z,x2,y2,z2)
My question is what Z supposed to mean ?
As i know x and y are parameters that define a specific point. But what is Z?
 

Solu9

You can change this now in User CP.
Reaction score
216
From what I know from math class it's hight. You know if y is north/south and x is west/east then z is up/down.
 

n1mr0d

Member
Reaction score
1
and i'm creating 1 lightning, with AddLightningEx, but still i can't move with MoveLIghtningEx, can somebody explain me why ?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
611
How are you using the MoveLightningEx function? Post your trigger(s).
 

n1mr0d

Member
Reaction score
1
How are you using the MoveLightningEx function? Post your trigger(s).

Here it is :
Trigger:
  • Magical Nest
    • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Magical Nest
    • Actions
    • Set TempKey = (Key (Target unit of ability being cast))
    • Set Magical_Nest_Caster_Unit = (Triggering unit)
    • Set Magical_Nest_Caster_Point = (Position of Magical_Nest_Caster_Unit)
    • Set Magical_Nest_Unit = (Target unit of ability being cast)
    • Set TempPoint1 = (Position of Magical_Nest_Unit)
    • Unit - Pause Magical_Nest_Caster_Unit
    • Unit - Pause Magical_Nest_Unit
    • Special Effect - Create a special effect attached to the chest of Magical_Nest_Unit using Abilities\Spells\Human\AerialShackles\AerialShacklesTarget.mdl
    • Set Magical_Nest_Special_Effect = (Last created special effect)
    • Hashtable - Save Handle OfMagical_Nest_Special_Effect as 1 of TempKey in Magical_Hashtable
    • Set Magical_Nest_Range_Beetween = (Distance between Magical_Nest_Caster_Point and TempPoint1)
    • Hashtable - Save (2.00 x Magical_Nest_Range_Beetween) as 2 of TempKey in Magical_Hashtable
    • Set Magical_Nest_Angle = (Angle from Magical_Nest_Caster_Point to TempPoint1)
    • Hashtable - Save Magical_Nest_Angle as 3 of TempKey in Magical_Hashtable
    • Set X1 = (X of Magical_Nest_Caster_Point)
    • Set Y1 = (Y of Magical_Nest_Caster_Point)
    • Set Z1 = (Current flying height of Magical_Nest_Caster_Unit)
    • Set X2 = (X of TempPoint1)
    • Set Y2 = (Y of TempPoint1)
    • Set Z2 = (Current flying height of Magical_Nest_Unit)
    • Custom script: call AddLightningEx("LEAS",true,udg_X1,udg_Y1,udg_Z1,udg_X2,udg_Y2,udg_Z2)
    • Set Magical_Nest_Lightning = (Last created lightning effect)
    • Hashtable - Save Handle OfMagical_Nest_Lightning as 4 of TempKey in Magical_Hashtable
    • Set Magical_Nest_Speed = -1800.00
    • Hashtable - Save Magical_Nest_Speed as 5 of TempKey in Magical_Hashtable
    • Hashtable - Save Handle OfMagical_Nest_Caster_Unit as 6 of TempKey in Magical_Hashtable
    • Set Magical_Nest_Level = (Level of Magical Nest for Magical_Nest_Caster_Unit)
    • Hashtable - Save Magical_Nest_Level as 7 of TempKey in Magical_Hashtable
    • Set Magical_Nest_UnitHeight = (Current flying height of Magical_Nest_Unit)
    • Hashtable - Save Magical_Nest_UnitHeight as 8 of TempKey in Magical_Hashtable
    • Hashtable - Save (2.00 x Magical_Nest_Range_Beetween) as 9 of TempKey in Magical_Hashtable
    • Unit - Add Crow Form to Magical_Nest_Unit
    • Unit - Remove Crow Form from Magical_Nest_Unit
    • Unit Group - Add Magical_Nest_Unit to Magical_Nest_UnitGroup
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Magical Nest Effect <gen> is on) Equal to False
    • Then - Actions
    • Trigger - Turn on Magical Nest Effect <gen>
    • Else - Actions
    • Custom script: call RemoveLocation(udg_Magical_Nest_Caster_Point)
      • Custom script: call RemoveLocation(udg_TempPoint1)


Trigger:
  • Magical Nest Effect
    • Events
    • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
    • Unit Group - Pick every unit in Magical_Nest_UnitGroup and do (Actions)
    • Loop - Actions
    • Set Magical_Nest_Unit = (Picked unit)
    • Unit - Turn collision for Magical_Nest_Unit Off
    • Set TempKey = (Key (Picked unit))
    • Set Magical_Nest_Special_Effect = (Load 1 of TempKey in Magical_Hashtable)
    • Set Magical_Nest_Range_Beetween = (Load 2 of TempKey from Magical_Hashtable)
    • Set Magical_Nest_Angle = (Load 3 of TempKey from Magical_Hashtable)
    • Set Magical_Nest_Lightning = (Load 4 of TempKey in Magical_Hashtable)
    • Set Magical_Nest_Speed = (Load 5 of TempKey from Magical_Hashtable)
    • Set Magical_Nest_Caster_Unit = (Load 6 of TempKey in Magical_Hashtable)
    • Set Magical_Nest_Caster_Point = (Position of Magical_Nest_Caster_Unit)
    • Set Magical_Nest_Level = (Load 7 of TempKey from Magical_Hashtable)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Magical_Nest_Range_Beetween Greater than 0.00
    • Then - Actions
    • Unit - Make Magical_Nest_Caster_Unit face Magical_Nest_Unit over 0.01 seconds
    • Set TempPoint1 = (Position of Magical_Nest_Unit)
    • Set TempPoint2 = (TempPoint1 offset by (Magical_Nest_Speed x 0.03) towards Magical_Nest_Angle degrees)
    • Unit - Move Magical_Nest_Unit instantly to TempPoint2
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Magical_Nest_Range_Beetween Less than or equal to ((Load 9 of TempKey from Magical_Hashtable) / 2.00)
    • Then - Actions
    • Set Magical_Nest_UnitHeight = (Magical_Nest_UnitHeight - 25.00)
    • Animation - Change Magical_Nest_Unit flying height to Magical_Nest_UnitHeight at 1000000000.00
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Magical_Nest_UnitHeight Less than or equal to 0.00
    • Then - Actions
    • Unit - Create 1 Special Effect for (Owner of Magical_Nest_Caster_Unit) at TempPoint1 facing Default building facing degrees
    • Unit - Kill (Last created unit)
    • Else - Actions
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Magical_Nest_Range_Beetween Greater than ((Load 9 of TempKey from Magical_Hashtable) / 2.00)
    • Then - Actions
    • Set Magical_Nest_UnitHeight = (Magical_Nest_UnitHeight + 20.00)
    • Animation - Change Magical_Nest_Unit flying height to Magical_Nest_UnitHeight at 1000000000.00
    • Else - Actions
    • Set X1 = (X of Magical_Nest_Caster_Point)
    • Set Y1 = (Y of Magical_Nest_Caster_Point)
    • Set Z1 = (Current flying height of Magical_Nest_Caster_Unit)
    • Set X2 = (X of TempPoint2)
    • Set Y2 = (Y of TempPoint2)
    • Set Z2 = (Current flying height of Magical_Nest_Unit)
    • Custom script: call MoveLightningEx(udg_Magical_Nest_Lightning,true,udg_X1,udg_Y1,udg_Z1,udg_X2,udg_Y2,udg_Z2)
    • Hashtable - Save (Magical_Nest_Range_Beetween + (Magical_Nest_Speed x 0.03)) as 2 of TempKey in Magical_Hashtable
    • Custom script: call RemoveLocation(udg_TempPoint1)
    • Custom script: call RemoveLocation(udg_TempPoint2)
    • Else - Actions
    • Set TempPoint1 = (Position of Magical_Nest_Unit)
    • Special Effect - Destroy Magical_Nest_Special_Effect
    • Unit - Unpause Magical_Nest_Caster_Unit
    • Unit - Unpause Magical_Nest_Unit
    • Lightning - Destroy Magical_Nest_Lightning
    • Custom script: set bj_wantDestroyGroup = true
    • Destructible - Pick every destructible within 250.00 of TempPoint1 and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Current life of (Picked destructible)) Greater than or equal to 0.00
    • Then - Actions
    • Unit - Order Harvest to Harvest (Picked destructible)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Current order of Harvest) Equal to (Order(harvest))
    • Then - Actions
    • Destructible - Kill (Picked destructible)
    • Else - Actions
    • Unit - Order Harvest to Stop
    • Else - Actions
    • Unit Group - Pick every unit in (Units within 250.00 of TempPoint1) and do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • ((Picked unit) is A structure) Equal to False
    • ((Picked unit) belongs to an enemy of (Owner of Magical_Nest_Caster_Unit)) Equal to True
    • ((Picked unit) is alive) Equal to True
    • Magical_Nest_Unit Not equal to (Picked unit)
    • Then - Actions
    • Set TempPoint2 = (Position of (Picked unit))
    • Unit - Create 1 Damage And Stun for (Owner of Magical_Nest_Caster_Unit) at TempPoint2 facing Default building facing degrees
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Unit - Set level of Magical Nest Stun for (Last created unit) to Magical_Nest_Level
    • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
    • Custom script: call RemoveLocation(udg_TempPoint2)
    • Else - Actions
    • Special Effect - Create a special effect at TempPoint1 using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
    • Unit Group - Remove Magical_Nest_Unit from Magical_Nest_UnitGroup
    • Unit - Turn collision for Magical_Nest_Unit On
    • Hashtable - Clear all child hashtables of child TempKey in Magical_Hashtable
    • Animation - Reset Magical_Nest_Unit's animation
    • Custom script: call RemoveLocation(udg_TempPoint1)
    • Custom script: call RemoveLocation(udg_Magical_Nest_Caster_Point)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Magical_Nest_UnitGroup is empty) Equal to True
    • Then - Actions
    • Trigger - Turn off Magical Nest Effect <gen>
      • Else - Actions


To be easier to see where i use Add/MoveLightningEx here's this picture.
untitled.JPG
untitled1.JPG
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
611
Would you by any chance be able to copy this into a new map and upload that? Staring at long static code hurts my eyes >.<

EDIT: Looking at the fringes of your code, I'm assuming that the problem lies in the fact that you're storing variables into your hashtable, then wiping the variables.

This causes the variables to lose their values, so whatever was stored in the hashtable is also lost. Hence, you've also cleared the values stored in the hashtable.
 

shady

Member
Reaction score
7
I can help with the model of DoTa, anyway i don't know if it's changed or not. I found 2 models in my map, so i'm gonna add them.
 

Attachments

  • Walls.zip
    1.7 KB · Views: 177

n1mr0d

Member
Reaction score
1
Would you by any chance be able to copy this into a new map and upload that? Staring at long static code hurts my eyes >.<

EDIT: Looking at the fringes of your code, I'm assuming that the problem lies in the fact that you're storing variables into your hashtable, then wiping the variables.

This causes the variables to lose their values, so whatever was stored in the hashtable is also lost. Hence, you've also cleared the values stored in the hashtable.
maybe , but as what i observed it's working with Move Lightning and Create Lightning (in gui version), i'm gonna try what u said.

EDIT : Still not working... still the Lightning is not moving , and by the way i also can't destroy the lightning.
 

shady

Member
Reaction score
7
Instead of double post use EDIT button :), anyway you can DP only if 24H are passed and there is no answer in your thread.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top