New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added helicopter takeoff and landing sound #8784
Conversation
@@ -35,6 +35,7 @@ public HeliFly(Actor self, Target t, WDist minRange, WDist maxRange) | |||
this.minRange = minRange; | |||
} | |||
|
|||
static int previousdz; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this static shares it over all helicopters!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops!
4ea1f7e
to
aac93e3
Compare
Please change this to explicitly check for takeoff and landing. Attaching the logic to any height changes will make the sounds play when the helicopters move over bumpy terrain (after #7904 or a similar pr fixes aircraft height). |
aac93e3
to
3a1b900
Compare
I tied this together differently now. The main problem is that helicopters never properly fire the TakeOff activity. Not sure why. Also Aircraft does not expose Info and making it public would hide stuff. |
3a1b900
to
3acd6f1
Compare
@@ -53,6 +54,12 @@ public override Activity Tick(Actor self) | |||
if (IsCanceled || !target.IsValidFor(self)) | |||
return NextActivity; | |||
|
|||
if (!playedSound && helicopter.Info.TakeoffSound != null && helicopter.CenterPosition.Z == helicopter.Info.LandAltitude.Length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a lot clearer if it uses LandAltitude.Z
instead of LandAltitude.Length
, which is the same, because X and Y are supposed to be 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LandAltitude
is WDist
(1D so there is no X, Y or Z)
I'd say we're not ready for this (the aircraft needs a lot of work before this can work properly), but maybe we choose the "complete solution to this and related issues" path way too often. In summary: I'm not a huge fan of the way this is implemented, but I don't see an alternative without asking you to refactor the entire aircraft code. So I'll go with "better have it and polish later" this time 👍 |
Your suggestions are very vague, but I already tried those (sticking it to |
The takeoff sound is also played when loading units off the orca transport. |
@@ -144,12 +146,19 @@ ORCATRAN: | |||
Cost: 1200 | |||
Tooltip: | |||
Name: Orca Transport | |||
Buildable: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unrelated to takeoff and landing sounds, so needs to be at least in its own commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separated.
3acd6f1
to
353e607
Compare
353e607
to
3d2c959
Compare
The bug with unloading is gone now, but no sound is played when units take off after being produced. |
OK so I have |
3d2c959
to
25ee5f7
Compare
Updated to make use of the new function from #8866. |
That may not have been the best idea because aircraft remain completely incompatible with terrain height. I'll be surprised if |
IMO this PR has done all it can with the current aircraft code. The sounds are played when produced (once, ofc) and when landing (every time). This is good enough for me until we have a fix for the aircraft's apparently broken |
Looks good to me. 👍 / ✅ |
Added helicopter takeoff and landing sound
Used for Tiberian Sun dropships.