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

[General] Lightning effect

Status
Not open for further replies.
Level 11
Joined
Aug 11, 2009
Messages
605
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
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
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)
 
Level 16
Joined
May 1, 2008
Messages
1,605
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()
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
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.
Top