#2062 closed enhancement (fixed)
[PATCH] Landing and Go-Around for Flying Units
Reported by: | scythetwirler | Owned by: | peter |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 14 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
I've implemented landing and a go around function for (mostly) the P-51 Mustang. The land command is issued using the stop button and to go around, simply press the stop button again (to abort the landing).
I've also adjusted a couple speeds on the Mustang.
Attachments (3)
Change History (18)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
by , 11 years ago
Attachment: | landingFlyingUnits.diff added |
---|
comment:3 by , 11 years ago
Thanks for the great review! :) I've fixed all of them except your 6th bullet. Removing the parenthesis seems to make it function differently.
Also, the GetGroundLevel() function seems to always detect terrain, ignoring water levels. I'm not sure how to resolve this.
comment:6 by , 11 years ago
Keywords: | review removed |
---|
Ah, thanks, nice patch.
I didn't like the "steps" a plane took when it was climbing or landing. So I implemented some interpolation. Now it climbs smoothly.
If you want to research the angle a plane has when landing or climbing, you can implement that too. Just with the SetRotation method. X is sideways rotation (aka roll) so you don't need this (= always 0), but Z is forward/backward rotation (aka pitch), this is the one you need. Normally, the rotation would already be smooth. You can also put those angles in the XML, as it will probably differ by plane type.
One remark on the code: If you have a block like
if (!condition) CODE BLOK 1 else CODE BLOK 2
it's better to turn it around for readability
if (condition) CODE BLOK 2 else CODE BLOK 1
the only reason to use if (!condition) is if you don't have an else block. As the patch is already in, I won't change it, just remember it for the next time.
comment:9 by , 11 years ago
There is one rather annoying problem with the patch though. When you land your planes next to the edge of the map, you can lose some planes
It would be nice if, after landing, you can check if the planes are on the map, and if they aren't, move them to the map (riding is enough, don't have to fly).
by , 11 years ago
Attachment: | watersink.patch added |
---|
comment:10 by , 11 years ago
Thanks sanderd17! I've reversed the if else code.
New patch fixes planes landing below the surface of the water.
comment:11 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:12 by , 11 years ago
Keywords: | review added |
---|
by , 11 years ago
Attachment: | watersink.2.patch added |
---|
comment:13 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:15 by , 11 years ago
Keywords: | review removed |
---|
Functionality-wise, this works quite well and looks really cool. I'm having some trouble landing the planes however, and I saw one go underwater briefly. I unfortunately don't have more time to test this currently, but I'll get back to it.
Code-wise I have a few problems, mostly relating to coding style:
this.touchdown
tothis.onGround
or similar, IMO it is more descriptive that way. I was initially slightly confused whethertouchdown
meant that it was in the process of landing or was already on the ground. That would also remove the need for the redundant comment on UnitFlyingMotion line 45.