ZDoom / gzdoom

GZDoom is a feature centric port for all Doom engine games, based on ZDoom, adding an OpenGL renderer and powerful scripting capabilities
http://zdoom.org
GNU General Public License v3.0
2.47k stars 540 forks source link

Add a basic overridable footstep system and TERRAIN lump fixes. #2743

Open inkoalawetrust opened 19 hours ago

inkoalawetrust commented 19 hours ago

This PR mainly adds a basic footstep system (Off my default) through a MakeFootsteps() virtual in PlayerPawn, it's off by default and must be turned on with a new bMakeFootsteps PlayerPawn flag. And makes use of all the footstep-related parameters in TERRAIN that have apparently existed for about twenty years. The MakeFootsteps() virtual can be used for totally custom footstep logic as well, such as replacing it with a more logical system that plays footsteps at a frequency dependant on how fast the player is actually moving.

In addition to the new barebones footstep system using existing variables. This PR also fixes a 20-something year old discrepancy that made the Walk/RunStepTics variables unusable. Adds two flags for customizing HitWater(). And also adds a generic, foot-agnostic StepSound field to TERRAIN.

Also, below is an example mod attached, MAP01 has several TERRAIN surfaces, a few liquids and one metal terrain with footstep sounds defined. To enabled the footsteps, type "give TerrainSearch" in the console. splash.zip