• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

[General] Lightning effect

Status
Not open for further replies.
Level 11
Joined
Aug 11, 2009
Messages
597
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