Dummy unit height problem

WayTooShort

New Member
Reaction score
4
I have a dummy that should be on the same height as the caster, but if those two are on different cliffs one of them will be lower than the other. How can I set my dummy unit's height not dependant on the cliff beneath it?

Or better yet, somehow get the real height of the unit (the caster which rises into the air) and set the dummy unit's height to exactly the same level?
 

odd17

New Member
Reaction score
1
I'm not sure if i understood but this is what you need?

Untitled Trigger 001
Events
Conditions
Actions
Set CasterH = (Current flying height of (Casting unit))
Animation - Change Dummy 0000 <gen> flying height to CasterH at 0.00
 

WayTooShort

New Member
Reaction score
4
That is what I tried, but if the caster is on a cliff and I create the dummy to a lower cliff, the dummy will still be lower even after setting their flying height to same value.

The problem is that the flying height is counted from the height of the terrain below the unit, not the height from the bottom of the map.

Code:
  A
        
_____ 
     |           B
     |
     |________________
(line is the terrain)

Units A and B have the same flying height, but they are not on the same level..
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
You'll need to use a piece of JASS code (as custom script in GUI is fine) to get the terrain level. Provided TempPoint1 is the position of the caster and TempPoint2 is the position of the dummy:

Trigger:
  • ...
    • Custom script: set udg_TempReal = GetLocationZ(udg_TempPoint1) - GetLocationZ(udg_TempPoint2)
    • Animation - Change Dummy flying height to ((Current flying height of Caster) + (TempReal)) at 0.00
 

WayTooShort

New Member
Reaction score
4
Thanks, but doesnt GetLocationZ cause desyncs with terrain deformations? (I have a lot of shockwaves and thunderclaps..)
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Thanks, but doesnt GetLocationZ cause desyncs with terrain deformations?
It can, but I don't think it will in this case. It's not being used to change anything that will affect the game, right? (eg. if you were using it conditionally to destroy a dummy-projectile if it hits the ground, then it could cause a desync, since that's a game-altering purpose.)
 

WayTooShort

New Member
Reaction score
4
Yeah, the dummy is just a special effect with 1 second expiration timer. Well, I will use the GetLocationZ and hope for the best.

thanks for the help
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top