• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Making units ignore terrain height

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I have a spell that summons a fireball out of the ground and throws it around. It works fine on flat terrain, but if I do it near cliffs, trees or other doodads it will be summoned up in the air.

I use a dummy flying unit, setting its height to 10. I then have a trigger raise the height over time. Again, it works okay on flat terrain.

How do I get the unit it ignore the terrain around it for purposes of height? I tried setting sampling radius to 0, tried turning off collision with a trigger, tried setting pathing collison to 0 in the object editor... none of that worked.
 
This is what I would do:

Use the following Jass native in order to get the z height of your terrain at a given location:

JASS:
native GetLocationZ takes location whichLocation returns real

How to use it?

  • Custom script: set udg_MyGUIHeightVariable = GetLocationZ(udg_MyGUILocationVariable)
Where MyGUIHeightVariable is a real variable and MyGUILocationVariable is a point variable.

This can then be used to calculate the difference between the z height of terrain for at for example the position of your unit and the position of a dummy unit placed upon a cliff.

You can set the flying height of the unit to the difference of these two locations with a customized offset to make it look good.
 
Ah, thank you both. Setting movement to NONE worked and I don't know JASS well, so I'll just stick with that. +rep to you both though, thanks.

Changing height over time isn't anything fancy...just a repeat timer that moves it up point by point.
 
Status
Not open for further replies.
Back
Top