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
613
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
613
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: 191

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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top