-
Notifications
You must be signed in to change notification settings - Fork 1
Footstep Sets
Normally in Garry's Mod footstep sound mods are limited to clientside changes, or one-off custom systems. This feature of the base aims to allow multiple footstep types to be defined & assigned to players, or allow them to pick one to use. Internally the assignment of this system works almost 1:1 the same as VoiceSets, meaning they can be grabbed or applied to players with DRC:GetFootsteps(ply)
& DRC:SetFootsteps(ply, ID, enforced)
.
Footsteps within the Draconic Base are functionally the same as Half-Life 2 in that they play at full volume when sprinting, about half when running, and etc etc as you go down the list of sprint -> run -> walk -> crouch. The only difference between HL2 footsteps and Draconic's Footsteps system is that it has additional context cues such as jumping, shuffling, and additionally an overlay sound for extra foley.
There is one major difference in setup between VoiceSets and Footsteps, and that is that Footsteps does not support scripted sounds. This is due to a game limitation that scripted sounds cannot have their volume modified.
local MyTable = {
["ID"] = "SOMETHING_UNIQUE",
["Name"] = "What is Displayed in the Menu",
["OverrideMode"] = 1,
["Volumes"] = {
["sprint"] = 1,
["run"] = 1,
["walk"] = 1,
["crouch"] = 1,
},
["run"] = {
["overlay"] = {
"",
},
["default"] = {
"npc/metropolice/gear1.wav",
},
["stone"] = {
"",
},
["MAT_METAL"] = {
"",
}
},
["walk"] = {},
["crouch"] = {},
["sprint"] = {},
}
DRC:RegisterFootSteps(MyTable)
ID: Something unique, this is used internally to identify your set.
Name: Displayed in the menu.
OverrideMode: When set to 0 your footstep set will not mute default HL2 footsteps.
Volumes: Used to fine-tune the overall volume of a given movement mode. Note that as this is sound level and not volume, a value of 0.5 is NOT half.
run/walk/crouch/sprint: The actual containers for your sound entries.
dirt/grass/default/MAT_WHATEVER: These are the places your relevant sounds go. Single shorthand words are from Draconic's internal surface property system and are used to save your sanity from needing to define & manage footstep sounds across the broad-stroke material types, but you can define a MAT enum directly to override that specific type.
Material Subsettings: The following subsounds exist, to use them just append them to the above context, i.e grass_jump
.
-
_shuffle
: Shuffle sounds, played when the player stops moving. -
_jump
: Jump sounds -
_land
: Landing sounds (If this is undefined, it will attempt to use_shuffle
as a fallback. -
_overlay
: Secondary sounds to be played alongside the regular one, for added flavor. -
_volume
: Use a decimal number value from 0-1. Fine-tuning volumes for individual sounds.
All of these subsettings, like the sound entries themselves, are 100% optional.
Inheritance: The footstep system is heavily built on inheritance. All sounds draw from the run
mode if they are not defined in another. For example, if I have grass
defined in both run
& walk
, and am walking it will pull from the walk
mode. However, if I have rubble
defined in run
, but not in walk
, then it will pull the sound from run
when I am walking. Additionally, if you are on a surface that is not defined by your footstep set it will fall back to default
.
Click to expand.
local DRCFS_MetroPoliceCustom = {
["ID"] = "DRCFS_MetroPoliceCustom",
["Name"] = "Metropolice",
["OverrideMode"] = 0,
["run"] = {
["overlay"] = {
"npc/metropolice/gear1.wav",
"npc/metropolice/gear2.wav",
"npc/metropolice/gear3.wav",
"npc/metropolice/gear4.wav",
"npc/metropolice/gear5.wav",
"npc/metropolice/gear6.wav"
},
},
["walk"] = {},
["crouch"] = {}
}
DRC:RegisterFootSteps(DRCFS_MetroPoliceCustom)
This example code will create a Footstep set with the name of "Metropolice" which adds the metropolice boot foley to the player only whenever they are running or sprinting, otherwise it will not play the foley. The reason this works is that the mode run
is effectively the fallback for all other modes if something is undefined. By not defining the mode sprint
, it will fall back to run
. Inversely, by defining walk
& crouch
with empty tables, the system will detect there are no sounds to be used there.