Constant flying height help

Arre

You can change this now in User CP.
Reaction score
1
I am currently working on a flightsystem but got a problem when the plane flies gets to a cliff. As you may have noticed when a flying unit gets close to a cliff it flies higher up in the air which makes my flightsystem look unsmooth.

When I search here on thw for a solution I only found solutions in jass unfortunately :(. Now my question to you if this can be solved with as much gui as possible.

Yes you can do loops on my flightsystem ;)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
You could check for terrain height and reduce the plane's height accordingly.
 

keychup

Active Member
Reaction score
34
solution:
Every 0.10 seconds

Set Plane = Unit
Set PointA = Position of Plane
Set PointB = PointA offset by 50 towards Facing of Plane
If Integer (Environment Cliff Height at PointB) is Greater than (Environment Cliff Height at PointA)
Then

Here you can do one of the following:
To change the height in such a way that the plane moves smoothly:
Set Flying Height of Plane: (Flying Height of Plane+(125*((Environment Cliff Height at PointB)-(Environment Cliff Height at PointA))))

To force back the plane in a way that bumping into a cliff won't allow you to move over it:
Move Plane instantly to PointA
 

Arre

You can change this now in User CP.
Reaction score
1
Well thanks for the replies though i solved my problem by myself and som googling

heres my solution if you're wondering. This works for both cliffs and raise terrain.

Every 0.03 seconds

Custom script: set udg_Tempreal[4] = GetLocationZ(udg_Temppoint[1])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Flight_Terrainheight_real[(Integer A)] Not equal to Tempreal[4]
Then - Actions
Set Tempreal[5] = (Flight_Terrainheight_real[(Integer A)] - Tempreal[4])
Set Flight_Terrainheight_real[(Integer A)] = Tempreal[4]
Animation - Change Flight_Flyingunit[(Integer A)] flying height to (((Current flying height of Flight_Flyingunit[(Integer A)]) + Tempreal[5]) + 0.00) at 0.00
Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top