• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[General] Lightning effect

Status
Not open for further replies.
Level 11
Joined
Aug 11, 2009
Messages
612
So i want to make a purple chain lightning but the problem i have is that the triggered lightning lies on the ground, which looks awful. I am wondering if there is any way to lift a triggered lightning up a bit or if i have to live with it being on the ground?

Thanks for any help
 
call AddLightningEx ( "CLSB", true, X, Y, Z, X2, Y2, Z2 )
Creates a lightning effect

call MoveLightningEx ( whichLightning, true, X, Y, Z, X2, Y2, Z2 )
Moves a lightning effect

X/Y, X2/Y2 represent the coordinates of the two points of the lightning effect
Z, Z2 is the height of the lightning effect

An example of creating the effect:
  • Custom script: set udg_X = GetUnitX(Target1)
  • Custom script: set udg_Y = GetUnitY(Target1)
  • Custom script: set udg_X2 = GetUnitX(Target2)
  • Custom script: set udg_Y2 = GetUnitY(Target2)
  • Custom script: set udg_Z = (70.00)
  • Custom script: set udg_Z2 = (70.00)
  • Custom script: call AddLightningEx ( "CLSB", true, udg_X, udg_Y, udg_Z, udg_X2, udg_Y2, udg_Z2 )
  • Set l = (Last created lightning effect)
 
call AddLightningEx ( "CLSB", true, X, Y, Z, X2, Y2, Z2 )
Creates a lightning effect

call MoveLightningEx ( whichLightning, true, X, Y, Z, X2, Y2, Z2 )
Moves a lightning effect

X/Y, X2/Y2 represent the coordinates of the two points of the lightning effect
Z, Z2 is the height of the lightning effect

An example of creating the effect:
  • Custom script: set udg_X = GetUnitX(Target1)
  • Custom script: set udg_Y = GetUnitY(Target1)
  • Custom script: set udg_X2 = GetUnitX(Target2)
  • Custom script: set udg_Y2 = GetUnitY(Target2)
  • Custom script: set udg_Z = (70.00)
  • Custom script: set udg_Z2 = (70.00)
  • Custom script: call AddLightningEx ( "CLSB", true, udg_X, udg_Y, udg_Z, udg_X2, udg_Y2, udg_Z2 )
  • Set l = (Last created lightning effect)

Just as a small note can't you use the variable directly?:
  • Custom script: set udg_l = AddLightningEx()
 
And if you want to attach the lightning effect to a flying unit, better do it like this: set udg_Z2 = GetUnitFlyHeight(udg_Target2)

This way, the lightning will be attached correctly to the position of that flying unit, without you have to adjust it according to your eye.
 
Status
Not open for further replies.
Back
Top