• 🏆 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!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

Flying units move weird over cliffs.

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Hi all.

I am making a missile system and came to this weird thing.

I set flying height of the missile to (Flying height of missile + (difference between Z of new and old location) + vertical speed)
But when I tested it on cliffs... well...
XLf5cih.jpg
The missile has the proper height after the cliff but when it is over the cliff, the height is lower.
How is that happening?

Also is that a common problem and is it ever solved?
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
I have this problem a very long time ago (the 1st map i ever made but not finished) and managed to solve it. But I forgot how it works, here is the copy of the unprotected map (it is full of bugs and debug command such as global blink).

Just Select Daryl Dixon Hero because he initially has the crossbow item and Learn the global Blink. Test it in cliffs and Study how it works especially this trigger code.

  • Custom script: set udg_arrowHeight=GetLocationZ(udg_arrowMovement)
  • Animation - Change (Picked Unit) flying height to (128*(Real(arrowTerrainCasLocLvl[arrowCusVal]) - 2) + arrowChangeHeightGravity - arrowHeight at 0.00
PS: I was a noob back then at triggering Spells thats why I discontinued the development of that map because it is full of bugs, leaks and inefficient triggering.
 

Attachments

  • The Walking Dead v2.1backup.w3x
    1.1 MB · Views: 58
Level 24
Joined
Aug 1, 2013
Messages
4,657
I have this problem a very long time ago (the 1st map i ever made but not finished) and managed to solve it. But I forgot how it works, here is the copy of the unprotected map (it is full of bugs and debug command such as global blink).

Just Select Daryl Dixon Hero because he initially has the crossbow item and Learn the global Blink. Test it in cliffs and Study how it works especially this trigger code.
Will take a look. Thanks already ;)

(Flying height of missile + (difference between Z of new and old location) + vertical speed)
->
(Flying height of missile - (difference between Z of new and old location) + vertical speed)

Depends

Difference between new and old can be (new - old) or (old - new)
Still difference ;)
I in fact do "+ (old-new)"
JASS:
set height = GetUnitFlyHeight(udg_CMS_Param_Missile)
        set height = height + v_v*0.03
        set height = height + (GetLocationZ(oldLocation) - GetLocationZ(newLocation))
        if height < 0 then
            set udg_CMS_Param_Destroy = true
        endif
        call SetUnitFlyHeight(udg_CMS_Param_Missile, height, 999)
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Hmm, another thing it could be is the missile unit's movement type.

In my functional missile system (no warping over cliffs), the dummy has:
Height - 0
Speed base - 1
Type - Foot

Then I add and remove Crow Form to give it flying ability.

The issue might be related to how flying units automatically smooth their height near cliffs.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
@rulerofiron99
hmm... I have the same settings as you (except I use None as type) but all types do the same, with the exception of flying... that one raises and drops instead of drops and raises.

@latent Heat
I cant see where you move the arrow.
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
@rulerofiron99
hmm... I have the same settings as you (except I use None as type) but all types do the same, with the exception of flying... that one raises and drops instead of drops and raises.

@latent Heat
I cant see where you move the arrow.

In the Abilities trigger category, look for Arrow Move trigger. Have you tested it and does it meet your requirements?
 
Level 14
Joined
Aug 30, 2004
Messages
909
Make sure your units maximum pitch and roll are at 0 (though that's probably not it).

You should set Art-elevation - Sample Points to 1 and "Art - Elevation - sample radius" to 0.

Also, make sure the unit is paused so it doesn't try to move on its own (though that's probably not it either.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Make sure your units maximum pitch and roll are at 0 (though that's probably not it).

You should set Art-elevation - Sample Points to 1 and "Art - Elevation - sample radius" to 0.

Also, make sure the unit is paused so it doesn't try to move on its own (though that's probably not it either.

none worked... though that pause thing is pretty good to remember.

My dummies all have 0 in almost every value.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Here it is.

I have tried to set the dummy to exacly the dummy from latent heat´s map.
But as none of that worked... I set everything back to what it was.

(When you test the map just simply type "-start" and "-stop" to test.)
 

Attachments

  • Custom Missile System 0.2.w3x
    57.4 KB · Views: 89
Level 24
Joined
Aug 1, 2013
Messages
4,657
  • Custom script: set udg_arrowHeight=GetLocationZ(udg_arrowMovement)
  • Animation - Change (Picked Unit) flying height to (128*(Real(arrowTerrainCasLocLvl[arrowCusVal]) - 2) + arrowChangeHeightGravity - arrowHeight at 0.00

Well... as you can see in my map... I change the height of the missile accordingly to the exact LocationZ of the position on the map.
It includes cliffs, ramps and height smooths.
But you change the height of the missile at 0.00 and I did it at 999.00
That was the difference.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Excellent, glad you got it solved. I'm not the best with the world editor, but I have a lot of experience with missile systems (see my Battle for Tatooine map). Changing unit's height at speed "0" makes it instant, so I always use that. Also, the game registers the unit's current height as the target height you gave it. So if you said, "Change unit's height to 100 at speed 50" the game would immediately register it's height at 100 even if it doesn't look that way.

The only other problem I get continually is that when I create a new unit they often respond to terrain and collision and sometimes don't show up right where I want them. It helps to create them offcamera somewhere, remove collision with triggers, then move them exactly where you want them to be.
 
Status
Not open for further replies.
Top