HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Object Height Question

04-01-2008, 02:11 AM#1
MysticGeneral
Are there any units/objects or anything clickable at all that NEVER changes height because of terrain?
04-01-2008, 03:15 AM#2
gallin
cant you just make minimail hight and maximin hight the same(sorry for misspelling im a bad speller)
04-01-2008, 03:57 AM#3
PurgeandFire111
I don't think so. As far as I know, the Z height would actually be 0 no matter what the terrain height is. So sadly, I don't think you can have people sink into the ground or walk through the ground.

Only way I know would be to make the model below regular height level (edit the model)

Either that or I'm just not thinking hard enough.
04-01-2008, 07:48 AM#4
Pyrogasm
On the contrary, yes you can, but it will take some math in the long run:
Make a unit that has movement type "ground"; then, use the flyheight trick/bug to make it act as a flying unit. You can now set its height with triggers and it will go below the ground.

So if you wanted it to stay at a constant height, you could do something like this:
Trigger:
Collapse Events
Time - Every 0.04 seconds of game-time
Conditions
Collapse Actions
Set TempPoint = Position of (Your Unit 0001 <gen>)
Unit - Set Your Unit 0001 <gen>'s flyheight to (TheHeightYouWant - Z Height of (TempPoint)) at 0.00
Custom script: call RemoveLocation(udg_TempPoint)
04-02-2008, 05:05 AM#5
MysticGeneral
I don't exactly know what th flyheight trick/bug thing is. Care to explain? Now, is it me, or don't events that occur every .04 seconds tend to lag the game? Also, this unit is constantly being moved by a trigger to a new location, this will not effect it, will it?
04-02-2008, 10:10 AM#6
Gwypaas
The game won't lagg with 0.04 seconds interval. Most spells uses about 0.03 and they do more then setting a height.
04-02-2008, 10:31 AM#7
Alexander244
The flyheight trick is that by adding and removing Amrf (Raven Form) to a ground unit, you are then able to use SetUnitFlyHeight to change the fly height of that unit.

Changing height every 0.04 seconds is fine.
04-03-2008, 07:35 PM#8
MysticGeneral
So what I do is create a ground unit in the object editor. Then add and remove the ability Amrf by trigger? Then I can set it's SetUnitFlyHeight whenever I want? And it can go below ground?
04-03-2008, 08:23 PM#9
Alexander244
Not below ground, but for the rest yes.
04-03-2008, 08:32 PM#10
MysticGeneral
Damn, I need it to go below ground... So that it is unaffected by terrain cliffs/hills.
04-03-2008, 08:33 PM#11
Alexander244
You could always hide it when it gets to places where it should be below terrain, and then unhide when it is in places above terrain.

Edit: If you need it selectable, you could also alpha the model using vertex colouring.
04-03-2008, 08:45 PM#12
MysticGeneral
I need it to be selectable. However, it is always invisible to the player. The problem is that when the player needs to select it, they won't be able to click it because the terrain cliff/hills will affect it's actual location. Thus, making it unclickable.
04-03-2008, 08:57 PM#13
Alexander244
If it was truely below the terrain wouldn't it be completely unselectable anyway?

How/why is the player meant to select an invisible unit? - Maybe there is another method to achieve what you want.
04-03-2008, 09:01 PM#14
MysticGeneral
Nope, you can make them go below the ground just by using the object editor. They are completely selectable. Set min height to -150, and it's actual height to -100. It'll be below the ground. But, that's not the problem I have.

Using triggers to make it go below ground, will actually reset it back to a default of 0 flying height. No matter what # I put in.

What I'm trying to do now is find a way to get a hill's height, that way I can offset the position of the unit depending on the height of the hill. However, there's no way to detect the height of a hill...
04-04-2008, 01:43 AM#15
Pyrogasm
The thing here is this:
  • If the unit has movement type "flying" or "hover" in the Object Editor, it will not be able to be set below the ground.
  • If the unit has movement type "ground" or anything that's not the above and is then made to act like a flying unit (via the flyheight trick/bug) can be moved below the ground with triggers.
Quote:
Originally Posted by MysticGeneral
What I'm trying to do now is find a way to get a hill's height, that way I can offset the position of the unit depending on the height of the hill. However, there's no way to detect the height of a hill...
That's what the function "Z Height of <Point>" is for!