Resource icon

[Reusable] Footsteps

This thread contains content that may be reused, modified, or ported by anyone.

Gomynola

Gomiken
Hi, I made this little script that is based on the Modern Sonic script made by MotdSpork. I have kept the freeslots and the texture assignments with the sounds, but everything else I did a complete rework.

It gives step sounds to the main characters of the game, based mainly on their animations. It can also be used with custom characters.


If you are interested in having your characters work with this script just include this in your script:
Code:
if not PlayerAnimInfo
	rawset(_G, "PlayerAnimInfo", {})
end

PlayerAnimInfo["skinname"] = {
		["runFrames"] = {0, 2},
		["dashFrames"] = {-1},
		["walkFrames"] = {3, 7},
		["waitFrames"] = {0},
		["milnekickFrames"] = {0, 4},
		["run"] = true,
		["dash"] = false,
		["walk"] = true,
		["idle"] = true,
		["wait"] = true,
		["milnekick"] = true,
		["superRun"] = false,
		["superDash"] = false,
		["superWalk"] = true,
		["superIdle"] = true,
		["superWait"] = false
}

Replace "skinname" with your character.

New! - If you want to import your own sounds you just need this in your script, (and the sound files... Heh heh)

Code:
if not SoundListInfo
	rawset(_G, "SoundListInfo", {})
end

SoundListInfo["customname"] = {
		["grass"] = {
		  ["steps"] = {sfx_sogr1, sfx_sogr2, sfx_sogr3, sfx_sogr4, sfx_sogr5},
		  ["skid"] = {sfx_sogrbr},
		  ["land"] = {sfx_sogrln},
		},
		["metal_heavy"] = {
		  ["steps"] = {sfx_some1, sfx_some2, sfx_some3, sfx_some4, sfx_some5},
		  ["skid"] = {sfx_somebr},
		  ["land"] = {sfx_someln},
		},
		["metal_light"] = {
		  ["steps"] = {sfx_some1, sfx_some2, sfx_some3, sfx_some4, sfx_some5},
		  ["skid"] = {sfx_somebr},
		  ["land"] = {sfx_someln},
		},
		["dirt"] = {
		  ["steps"] = {sfx_sodi1, sfx_sodi2, sfx_sodi3, sfx_sodi4, sfx_sodi5},
		  ["skid"] = {sfx_sodibr},
		  ["land"] = {sfx_sodiln},
		},
		["snow"] = {
		  ["steps"] = {sfx_sodi1, sfx_sodi2, sfx_sodi3, sfx_sodi4, sfx_sodi5},
		  ["skid"] = {sfx_sodibr},
		  ["land"] = {sfx_sodiln},
		},
		["cloth"] = {
		  ["steps"] = {sfx_sodi1, sfx_sodi2, sfx_sodi3, sfx_sodi4, sfx_sodi5},
		  ["skid"] = {sfx_sodibr},
		  ["land"] = {sfx_sodiln},
		},
		["sand"] = {
		  ["steps"] = {sfx_sodi1, sfx_sodi2, sfx_sodi3, sfx_sodi4, sfx_sodi5},
		  ["skid"] = {sfx_sodibr},
		  ["land"] = {sfx_sodiln},
		},
		["wood_heavy"] = {
		  ["steps"] = {sfx_sowo1, sfx_sowo2, sfx_sowo3, sfx_sowo4, sfx_sowo5},
		  ["skid"] = {sfx_sowobr},
		  ["land"] = {sfx_sowoln},
		},
		["wood_light"] = {
		  ["steps"] = {sfx_sowo1, sfx_sowo2, sfx_sowo3, sfx_sowo4, sfx_sowo5},
		  ["skid"] = {sfx_sowobr},
		  ["land"] = {sfx_sowoln},
		},
		["concrete"] = {
		  ["steps"] = {sfx_soco1, sfx_soco2, sfx_soco3, sfx_soco4, sfx_soco5},
		  ["skid"] = {sfx_socobr},
		  ["land"] = {sfx_socoln},
		},
		["water"] = {
		  ["steps"] = {sfx_sowa1, sfx_sowa2, sfx_sowa3, sfx_sowa4, sfx_sowa5},
		  ["skid"] = {sfx_sowabr},
		  ["land"] = {sfx_sowaln},
		},
		["lava"] = {
		  ["steps"] = {sfx_sowa1, sfx_sowa2, sfx_sowa3, sfx_sowa4, sfx_sowa5},
		  ["skid"] = {sfx_sowabr},
		  ["land"] = {sfx_sowaln},
		},
		["glass"] = {
		  ["steps"] = {sfx_sogl1, sfx_sogl2, sfx_sogl3},
		  ["skid"] = {sfx_soglbr},
		  ["land"] = {sfx_soglln},
		}
}

Please note that you must replace the sfx_xxx with the sounds you have included in your mod. Then, In-game, use the fssoundlist command and as an argument "customname"

Compatible characters!
(Do you want your character here?, Let me know!)
  • Vanilla Characters
  • LegacyHinote
  • NeoSonic
  • Bandages
  • SSNSonicHD
  • Sukapon
  • Rabbid
  • FeelSonic
  • Skip
  • Gemma
  • Werehog
  • Silver
  • Kirby
  • Milne w/ Milne Kick Dance - (90%) Some animations don't work.

Fully Compatible campaigns!
(Do you want your favorite campaign here?, Let me know!)
*Other campaigns may be compatible, but I do not include them here, because they have not been tested*
  • Vanilla Campaign
  • Sonic 2006

Available Sound Lists!
(Do you want a particular Sound List here?, Let me know!)
*Remember: Use the fssoundlist command!*
  • Modern Sonic Games (Default)
  • Half Life 1 & 2
  • The Legend of Zelda: Ocarina of Time
  • Minecraft
  • S4 League

Now every player can have their own soundlist in a multiplayer game!

Knownbugs:
When the script does not detect a texture, the texture used the previous time is reused. This is not a bug as such, I have done it on purpose, because there are situations where I have not yet implemented correctly the way to detect those textures:

-When a character is on the edge of a Sector the game contemplates that he is in the adjacent Sector and when he is not on the floor of this one, the script does not detect the texture.

unknown.png

Changelog:
v1
Initial release
v1.2
Fix - Added some missing textures/sound assignments from CEZ
v1.3
Fix - Minor tweaks
v1.4
Code cleaning and some reworks
v1.5
"Concrete sound material" is played by default if no texture is detected.
Support for characters with DASH. (Check the example code above)
Good practices in code.
Revised compatibility with XMomentum.
v1.6
Sonic 2006 campaign support
Legacy Hinote support
Neo Sonic support
Minor fixes
v2.0
Custom Sounds Support
New command: fssoundlist argument. Set the sound list to be played as footsteps sounds.
New pre-installed sound list from some games: Modern Sonic's footsteps (as default), Half-Life, Half-Life 2, The Legend of Zelda ... and more!
v2.1
Minecraft Sound List
More step materials sounds! - metal_light/heavy, wood_light/heavy, snow, cloth, sand, lava
IO Support
Bandages character support
SSNSonicHD character support
Sukapon character support
Rabbid character support
FeelSonic character support
Skip character support
Gemma character support
Werehog character support
Silver character support
Kirby character support
Milne character support (Read adobe)
v2.2
minor texture assigments changes
v2.3
fixed S_MILNE_KICK warning message when Milne is not in the game.

Notes:
This is my first contribution in the community, I hope you like it.

If after analyzing the code you think that I have committed a plagiarism violation by publishing this, I need to know it to focus on the right way to do it.

For example, I don't think it can be considered plagiarism to reuse a generic function to get the texture of the floor where the character is. Because it is so generic that if I made it from scratch I would end up doing the same thing. I don't know if I explain myself correctly.
 

Attachments

  • L_footsteps-v2.3.pk3
    2.3 MB · Views: 1,110
Last edited:

Larz T

Siced
Judge
After talking about it to some other judges, we decided that we are going to let this through. It's not like MotdSpork owns footstep technology and as you said before, you reversed engineered this to be more streamlined for other people to use it for the Vanilla cast or even for some custom characters.
Welcome to releases and thank you for your patience!
 
It's very cool, I've been waiting for such a mod to appear for a long time. But I found another bug - for some reason the script does not detect custom textures, there is no sound of footsteps at all.
 

Dabir

Nitpicker
I made something like this a while ago, but yours seems a lot more thorough and probably works quite a bit better. I remember looking at how Modern Sonic did it at the time and my eyes glazing over, so props for even figuring out which bits to use and how to make them work.

From taking a quick peek at your code, I'd just like to point out that you've used rawset to set a few things, presumably because Modern Sonic did it. Rawsetting functions and variables to _G makes them global, so that they can be accessed outside the file they're created in. Modern Sonic uses multiple Lua files, so it needs to do that in order to work, but you only have one file here. PlayerAnimInfo would need to be rawset to work with custom characters, but you could probably make most of the rest local. It's not likely to cause any problems, but it would be more sanitary to just make local variables and functions. You'd probably also benefit from adding comments throughout, if nothing else so that if you come back to this later you'll have a reminder of how it all works.
 
Last edited:

Xian.exe

Quiet Stargazer
I noticed this doesn't support characters with dashmode, but otherwise, this is great, I like it.
 

Larz T

Siced
Judge
It's very cool, I've been waiting for such a mod to appear for a long time. But I found another bug - for some reason the script does not detect custom textures, there is no sound of footsteps at all.
I think that's something either the creator of the level with the custom textures has to define themselves or the Gomynola has to define. I could be wrong on how it works but that is what I gathered on how this works by peeping at the Lua code for a second.


EDIT: Please beat me up on Discord if I am wrong.
 

Gomynola

Gomiken
Hello, custom textures have to be mapped with the sounds in a specific way. In the Modern Sonic version when the texture is not mapped the "concrete material" sounds are used by default. I took this out on purpose, but maybe it would be better to put that sound in after all.

Anyway, I will update this script soon with new mapped textures of the most recurrent mods and also with your suggestions and best practices in the code.

If someone wants me to implement the mapping of some textures you can comment it here or by private message.

Thanks for your feedback.
 

Mr.Siphon

Do YoU bElIeVe In GrAvItY?
Love it. Sadly it doesn't work with Junio and alt sonic's dash modes but otherwise great mod! If only it supported custom textures.....
 

Sir Thoksalot

What the thok
If someone wants me to implement the mapping of some textures you can comment it here or by private message.

I think Dirk's ice platforms (and ice surfing) should be implemented. Maybe making the dirt or concrete sound.

I also found a glitch with his ice platforms as well. If you make an ice platform above any texture. It will play the sound mapped to that texture. Example: I made an ice platform above the wooden bridges in GFZ and it made the "wood" sound.

Edit: I found a glitch when this mod is paired with XMomentum. (Loaded before or after) Sonic tapping his foot is supposed to make the sound of whatever texture he's standing on, yet when paired with XMomentum, the foot-tapping sound only plays once.
 
Last edited:

Mr.Siphon

Do YoU bElIeVe In GrAvItY?
Idk if this works for other people, but for me it still doesn't seem to work with the character i put in the script.
Any reason why?
 
Last edited:

right_in_the_tockles

please unban my discord :(
I like the IDEA of this, but the footsteps add to what makes Modern Sonic unique. Is there any way you could have the sound effects lower fidelity audio for other characters or maybe even just a different set of sounds entirely?
 

MrMago

Member
i love this mod

will you make the sonic metal turbine sound? Ps: i'm using google translator so sorry if i'm wrong.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Top