• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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,198
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