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

[JASS] How can I change lightning height according to how much the terrain is raise.

Status
Not open for further replies.
Level 7
Joined
Oct 8, 2008
Messages
200
Ya is there anyways to raise the lightning to the right height if the target unit on a higher terrain or on a bridge doodad that raises.
 
1) For general Z ground searches:
Make a variable, called "Z_location" (Real). Store the location you want into a variable, called (for example) "loc1"; it's a Point variable. Then, use this custom script:
  • Custom script: set udg_Z_location = GetLocationZ(loc1)
This script will define the Z of the location you want.

2) Script for the creation of the Lightning. Set as Loc1 the first point of the lightning and the final as Loc2.
  • Custom script: set Lightning = AddLightningEx (<CodeName>, true, GetLocationX(loc1), GetLocationY(loc1), GetLocationZ(loc1), GetLocationX(loc2), GetLocationY(loc2), GetLocationZ(loc2))
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Element of Water, no. Destructable Z is based on the model, so you could even have a variable Z if the model is animated. That native returns the vision height which is used to tell if a unit should see behind the destructable.

If GetLocationZ does not return destructable terrain height, then there is no way, sorry.
 
Element of Water, no. Destructable Z is based on the model, so you could even have a variable Z if the model is animated. That native returns the vision height which is used to tell if a unit should see behind the destructable.

If GetLocationZ does not return destructable terrain height, then there is no way, sorry.
I'm quite sure the vision height should be the same as the model height - it makes sense - so shouldn't that work if the model isn't animated? Besides, I don't think there are any animated pathable destructables in wc3 so it's fine for most people.
 
Status
Not open for further replies.
Top