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

Lightning Effect Height

Status
Not open for further replies.
Level 26
Joined
Oct 2, 2011
Messages
2,490
I have a question about triggered lightning effects.
I want to set the lightning effect to a custom height (Z) of 40.
Right now, I can only connect it via GUI triggers, attaching it to the ground between two points.

Let's say we have two flying units at 270 height. I want to trigger a lightning effect between them without using any abilities.

Thanks in advance! :)
 
Level 18
Joined
May 11, 2012
Messages
2,108
  • Custom script: local integer zOffset = 80
-> set the lightning height
  • Custom script: call MoveLightningEx(udg_Lightning, true, GetLocationX(udg_point1), GetLocationY(udg_point1), GetLocationZ(udg_point1)+zOffset, GetLocationX(udg_point2), GetLocationY(udg_point2), GetLocationZ(udg_point2)+zOffset)
-> moves lightning from source point1 to target point2, adding zOffset.

Something like this will do.
 
To add on to what others have said, the Lightning - Create Lightning Effect calls the AddLightning() native, which only takes x and y as a parameter. This is why they "attach" to the ground. You will need to use the "JASS exclusive" AddLightningEx() that has an added parameter of z (height).

JASS:
native AddLightning takes string codeName, boolean checkVisibility, real x1, real y1, real x2, real y2 returns lightning

native AddLightningEx takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning
 
Status
Not open for further replies.
Top