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

Lightning Effect Height

Status
Not open for further replies.
Level 13
Joined
Jul 26, 2008
Messages
1,009
native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning

z is height, 1 is from origin and 2 is to point.

Hopefully if you're versed enough at custom script you might know how to set this up, as I'm not sure where the lightning is going to.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Custom script: set udg_Temp_Lightning_1 = AddLightningEx( "AFOD" , true, GetLocationX(udg_Temp_Loc_1), GetLocationY(udg_Temp_Loc_1), GetLocationZ(udg_Temp_Loc_1) + 60, GetLocationX(udg_Temp_Loc_2), GetLocationY(udg_Temp_Loc_2), GetLocationZ(udg_Temp_Loc_2) + 60)


"AFOD" is the lightning type.
Temp_Loc_1 is the starting loc (you can use GetUnitX() instead).
Temp_Loc_2 is the end loc.
+60 is the height offset.

You must have that "Temp_Lightning_1" variable created in variable editor. Or you can use a local lightning.
 
Level 9
Joined
Sep 28, 2004
Messages
365
It is a must to use Temp_Lightning_1 or i can use any name? What does check visibility mean? I see you set to true.

EDIT: After testing, for some reason, the height of the chain remains at 0. Why is this so?

Here is my code:

  • Set tempPos[4] = (Position of Caster)
  • Set tempPos[5] = (Position of TargetUnit)
  • Set ChainX[1] = (X of tempPos[4])
  • Set ChainY[1] = (Y of tempPos[4])
  • Set ChainZ[1] = 100.00
  • Set ChainX[2] = (X of tempPos[5])
  • Set ChainY[2] = (Y of tempPos[5])
  • Set ChainZ[2] = 100.00
  • Custom script: set udg_LightningSFX = AddLightningEx( udg_ChainSFX , true , udg_ChainX[1] , udg_ChainY[1] , udg_ChainZ[1] , udg_ChainX[2] , udg_ChainY[2] , udg_ChainZ[2])
 
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313

  • Set tempPos[4] = (Position of Caster)
  • Set tempPos[5] = (Position of TargetUnit)
  • Set ChainX[1] = (X of tempPos[4])
  • Set ChainY[1] = (Y of tempPos[4])
  • Set ChainZ[1] = 100.00
  • Set ChainX[2] = (X of tempPos[5])
  • Set ChainY[2] = (Y of tempPos[5])
  • Set ChainZ[2] = 100.00
  • Custom script: set udg_LightningSFX = AddLightningEx( udg_ChainSFX , true , udg_ChainX[1] , udg_ChainY[1] , udg_ChainZ[1] , udg_ChainX[2] , udg_ChainY[2] , udg_ChainZ[2])

u probably did not set ChainSFX anywhere which might be the problem
you can also use the GUI "create lightning at loc from loc to loc" where loc is the same loc in both cases
this will make a lightning with a length of 0 so it won't be shown
as soon as you call "MoveLightningEx" the lightning will be expanded and shown
 
Level 9
Joined
Sep 28, 2004
Messages
365
The chain shows correctly. But not the height.. The height remains at 0, and i did set the chainSFX.

If i use the default move lightning, the chain will go back to default height?

EDIT: Just tested. Default move lightning will reset the height =/ May i know the custom script for MoveLightningEX?

EDIT 2: Solved [: Thanks alot! Now my chain system is almost perfect :D
 
Last edited:
Level 5
Joined
Dec 20, 2008
Messages
67
  • Set tempPos[4] = (Position of Caster)
  • Set tempPos[5] = (Position of TargetUnit)
  • Set ChainX[1] = (X of tempPos[4])
  • Set ChainY[1] = (Y of tempPos[4])
  • Set ChainZ[1] = (Z of tempPos[4])+60.00
  • Set ChainX[2] = (X of tempPos[5])
  • Set ChainY[2] = (Y of tempPos[5])
  • Set ChainZ[2] = (Z of tempPos[5])+60.00
  • Custom script: set udg_LightningSFX = AddLightningEx( udg_ChainSFX , true , udg_ChainX[1] , udg_ChainY[1] , udg_ChainZ[1] , udg_ChainX[2] , udg_ChainY[2] , udg_ChainZ[2])
thats right code
if you set chain Z to 100 it will be always at the 100 yrds abowe lowest layer of map, you need to set it to (units actual layer(heigh of the terrain)+100

im not sure about flying units, you must try yourself
 
Status
Not open for further replies.
Top