HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Air Height Problems

08-29-2005, 01:58 AM#1
Tim.
Alright, lets say I have a flying unit with Minimum Fly Height set to 0 (Or any negative value) and I fly through a bridge. Even though the minimum fly height is set to 0, the unit still moves up. The problem is that then the unit's fly height value is not accurate in triggers.

Is there a way to make an air unit not get effected by bridges and such?
08-29-2005, 03:04 AM#2
Zandose
You could try changing the collision side of either the unit or the gridge to 0.
08-29-2005, 03:05 AM#3
Kalvorod
Well... Air units do not keep a steady Z. They move up on cliffs etc. Bridges are concidered cliffs(that's why you can't walk under them) so the air units will move up.

Only way I can think of is to have a bridge, but have it not change the cliff height. This would make ground units look clumsy I'm pretty sure.

You can probobly script it to change fly height every .1 seconds, but even that, unless it's a 1 player game, will look clumsy.
08-29-2005, 10:33 AM#4
Tim.
Hmm. Oh wait, I forogt I'm giving the unit ALoc. It wont get in the way anyway even if its a ground unit .

Oh well, thanks anyway.
08-29-2005, 01:16 PM#5
Vexorian
Unit flying height is an offset to the terrain height.

So if you don't want it to go up you would need a trigger that substracts the unit's flying height based on the height of the terrain
08-29-2005, 09:08 PM#6
Tim.
It seems I will need to know how to do this, because the ground unit will be lifted or lowered a little too far as well. Hense, ignore my previous post stating that I would just use a ground unit.

Yeah I thought about that, but I'm having trouble getting it right. Below is an image that better explains the situation. I want the BLUE rectangle to always be the same exact fly height above the origin of the RED rectangle (40). The issue is that the BLUE rectangle's origin is 100 units away from the RED rectangle's origin. I need to solve for the Value of X (How much to add to 40 in order to get the correct value so the BLUE rectangle is always at 40 fly height relative to the RED recantgle's origin.)



08-30-2005, 09:03 AM#7
Anitarf
Get two locations, one the position of red rect and the other of blue. Then get their heights (GetLocationZ() ... btw, there isn't a similar function that would take xy instead of a location, is there?). Compare the two heights and apply their difference as a height bonus to the blue rectangle.
08-30-2005, 12:47 PM#8
Tim.
Thats what I thought, but it wont seem to work.. Code attached.

Quote:
Set CamHeroPoint = (Position of Hero[1])
Custom script: set udg_CamZloc = GetLocationZ(udg_CamHeroPoint)
Camera - Set (Player(1))'s camera Height Offset to (CamZloc + 100.00) over 0.00 seconds
Set CamHeroPoint = (Position of PlayerHand[1])
Custom script: set udg_CamZLocHand = GetLocationZ(udg_CamHeroPoint)
Set CamZLocHand = (CamZloc - CamZLocHand)
Animation - Change PlayerHand[1] flying height to (CamZLocHand + 40.00) at -100000000.00
08-30-2005, 03:09 PM#9
Anitarf
Isn't camera Z offset measured from the ground up? Shouldn't it be a constant value? Other than that, it seems to me it should work, unless the movement type of the hand doesn't follow the terrain height at it's origin.
08-30-2005, 03:43 PM#10
Tim.
Nope. Camera offset needs to be adjusted, I know, I tried without it.

Hmm, maybe if I send you the map you could try for yourself?
08-30-2005, 04:18 PM#11
Anitarf
I could, but you probably know best what is what in your map. What is the camera target locked to, anyway? The hand or the body?
08-30-2005, 05:55 PM#12
Tim.
The hand. I want the hand to remain in the same position on the screen at all times.
08-30-2005, 06:10 PM#13
Anitarf
Then you must alter the offset of the camera by the same ammount as the offset of the hand.

Set CamHeroPoint = (Position of Hero[1])
Custom script: set udg_CamZloc = GetLocationZ(udg_CamHeroPoint)
Custom script: call RemoveLocation( udg_CamHeroPoint )
Set CamHeroPoint = (Position of PlayerHand[1])
Custom script: set udg_CamZLocHand = GetLocationZ(udg_CamHeroPoint)
Custom script: call RemoveLocation( udg_CamHeroPoint )
Set CamZLocHand = (CamZloc - CamZLocHand)
Animation - Change PlayerHand[1] flying height to (CamZLocHand + 40.00) at -100000000.00
Camera - Set (Player(1))'s camera Height Offset to (CamZlocHand + 100.00) over 0.00 seconds
08-30-2005, 08:29 PM#14
Tim.
Not exactly, you still need to add the distance from the real ground to the bridge's ground. Heres the result.

Quote:
Camera - Set (Player((Integer A)))'s camera Distance to target to 141.00 over 0.00 seconds
Camera - Set (Player((Integer A)))'s camera Angle of attack to AngleofAttack[(Integer A)] over 0.00 seconds
Set CamHeroPoint = (Position of PlayerHand[1])
Custom script: set udg_CamZLocHand = GetLocationZ(udg_CamHeroPoint)
Custom script: call RemoveLocation( udg_CamHeroPoint )
Set CamZLocHand = (CamZloc - CamZLocHand)
Set CamHeroPoint = (Position of PlayerHand[1])
Custom script: set udg_CamZloc = GetLocationZ(udg_CamHeroPoint)
Custom script: call RemoveLocation( udg_CamHeroPoint )
Animation - Change PlayerHand[1] flying height to (CamZLocHand + 40.00) at -100000000.00
Camera - Set (Player(1))'s camera Height Offset to ((CamZloc + CamZLocHand) + 100.00) over 0.00 seconds

It works fine it seems, except for some reason the hand is not effected by the '+40' that is added (Bolded). It only goes to the 'CamZLocHand.'
08-31-2005, 04:43 AM#15
Antimodes
Wow, you're doing way too much work. There's an easy solution to all this my friend.

Go into the bridge's properties in the object editor, and change the "fly over height" to 0.