A_SetPitch that gets spread across a duration automatically?

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

A_SetPitch that gets spread across a duration automatically?

Post by Nevander »

Using A_SetPitch can get frustrating, especially when you have to figure out how much to add back to bring it back to center and when you start throwing other action functions in and figuring out the best place to put the pitch changes. I was thinking, why isn't there one that interpolates the pitch change automatically across a duration set by the same function?

Example:

Instead of...

Code: Select all

A_SetPitch(pitch-2.0)
to set the pitch only, you'd have

Code: Select all

A_NewPitchFunctionName(float amount, int direction, int tics, whatever else)
where amount is how much of course, and direction is up or down and tics is across how many tics of the current state should it interpolate the pitch changes.

Also I forgot to mention the function would automatically go back up or down by itself after it reaches the amount to move, and the duration would be both directions (the full movement).
User avatar
Zhs2
Posts: 1303
Joined: Fri Nov 07, 2008 3:29 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Maryland, USA, but probably also in someone's mod somewhere

Re: A_SetPitch that gets spread across a duration automatica

Post by Zhs2 »

[wiki]A_SetPitch[/wiki] has a flag to enable interpolation. As for returning to the player's previous pitch, there's always storing it to a variable before any A_SetPitch changes - let's say "prevpitch" - and later calling A_SetPitch(prevpitch, SPF_INTERPOLATE) (or spreading this out a number of calls for a delayed return, or so forth. In effect, DIY.)
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: A_SetPitch that gets spread across a duration automatica

Post by Nevander »

I'm not sure I understand how to use the interpolate flag though. I tried setting it to do pitch-2.0 and then tried 0.0, SPF_INTERPOLATE but it didn't interpolate (was still instant).

Return to “Feature Suggestions [GZDoom]”