[ZScript] Global Footsteps Proof-of-Concept

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
User avatar
DenisBelmondo
Posts: 381
Joined: Fri Jun 06, 2008 6:26 pm
Location: Two-Key Return
Contact:

[ZScript] Global Footsteps Proof-of-Concept

Post by DenisBelmondo »

One of my favorite light mods for ZDoom has to be The Zombie Killer's GDCC-ACS-based footsteps mod and its ability to provide the effect regardless of player class. I decided to implement something similar in ZScript as a learning experiment. It's far from the greatest code I've written and it doesn't have CVars, but it does the job. It's multiplayer-friendly and SR40/50 aware, meaning that the delay between footstep sounds are clamped. Like The Zombie Killer's implementation, this one runs from what is essentially a key/value thing in a language lump. However, it is not compatible with the definitions in The Zombie Killer's mod. This mod also features a type of "shuffling" that you can hear when walking down stairs of a certain elevation and at a certain speed, an effect that I quite enjoy personally.

Along the way, I had a working prototype that grabbed the LeftStepSound and RightStepSound from the flat's terrain definition, but if you were playing with a mod that had an existing terrain lump it would break compatibility. At some point in the future if I refactor this, I would also like to add CVars, a clause that decreases the delay if you're playing with a faster player class, and landing sounds.

If you include this in a mod, I hope you don't mind just mentioning me in the credits.



Download

Credits: Valve Software (wood plank sounds), Turtle Rock Studios (the rest of the sounds), The Zombie Killer (the idea even wrt to the implementation like speed-based sound volume)
Norourke71
Posts: 2
Joined: Thu Feb 27, 2025 2:33 pm
Operating System Version (Optional): Windows 11

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by Norourke71 »

Hi, I'm trying to implement Zombiekiller's mod. Do you have any advice? I cant get it to work.
User avatar
Enjay
 
 
Posts: 26936
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by Enjay »

How do you mean "can't get it to work"? People will need a bit more than that to go on if they are to figure out the problem.

Is it crashing, not working properly, or not working at all?

What are you doing to try to get it to work? e.g. how are you loading it?

Any other mods that might be conflicting?

Anything else relevant?
User avatar
ArchDoomer
Posts: 66
Joined: Mon Sep 26, 2022 5:12 am
Contact:

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by ArchDoomer »

I have a different problem. I was really happy to have found this little mod. However, it "swallows" all other sounds in the game. When I'm not moving, weapon sounds, ambient noises, etc. are completely normal. As soon as I walk/run, all the sounds are swallowed up and choppy. :-(

EDIT: I`m using a few other mods. Actually I play Complex Doom with some ambient sound mods...
User avatar
BLSZDOOM
Posts: 106
Joined: Fri Jun 21, 2024 5:04 pm

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by BLSZDOOM »

i have a similar problem,when playing with this mod it overwelms reload sounds unless i stop moving.
User avatar
Enjay
 
 
Posts: 26936
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by Enjay »

If anyone who has this problem wants to try something, and is comfortable with editing a ZScript file, it might be worth at least trying this edit.

Using a text editor, or SLADE, open the file StepEventHnadler.zc in the ZScripts folder inside the PK3 and search for CHAN_BODY (it's on line 69).
Try changing it to a different channel. I suggest changing it to CHAN_AUTO. ( See here: https://zdoom.org/wiki/A_PlaySound#Sound_slots )

CHAN_BODY is the default for many sounds and sound-playing commands. So, there is likely just a conflict. Using CHAN_AUTO means that sounds on that channel won't be played over, but it may also deconflict the sounds from the reloads. Maybe. You could try another channel of that doesn't work.

The ZScript code is quite old, and uses some deprecated commands, but there is no harm in trying the above anyway.
User avatar
ArchDoomer
Posts: 66
Joined: Mon Sep 26, 2022 5:12 am
Contact:

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by ArchDoomer »

Sounds good and seems to work. I edited the file as suggested, and the steps and other sounds sound as they should. For editing, I recommend the Notepad++ Editor! Thank you very much! If the problem occurs again, I'll let you know...

Here is the edited file for those who have difficulty editing: DOWNLOAD

Best regards
User avatar
BLSZDOOM
Posts: 106
Joined: Fri Jun 21, 2024 5:04 pm

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by BLSZDOOM »

Enjay wrote: Mon Apr 21, 2025 10:21 am If anyone who has this problem wants to try something, and is comfortable with editing a ZScript file, it might be worth at least trying this edit.

Using a text editor, or SLADE, open the file StepEventHnadler.zc in the ZScripts folder inside the PK3 and search for CHAN_BODY (it's on line 69).
Try changing it to a different channel. I suggest changing it to CHAN_AUTO. ( See here: https://zdoom.org/wiki/A_PlaySound#Sound_slots )

CHAN_BODY is the default for many sounds and sound-playing commands. So, there is likely just a conflict. Using CHAN_AUTO means that sounds on that channel won't be played over, but it may also deconflict the sounds from the reloads. Maybe. You could try another channel of that doesn't work.

The ZScript code is quite old, and uses some deprecated commands, but there is no harm in trying the above anyway.
awesome gonna try this soon.
User avatar
Enjay
 
 
Posts: 26936
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by Enjay »

There are certainly no guarantees, but let us know if it works.
User avatar
ArchDoomer
Posts: 66
Joined: Mon Sep 26, 2022 5:12 am
Contact:

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by ArchDoomer »

Mr Gold wrote: Mon Apr 21, 2025 1:35 pm Sounds good and seems to work. I edited the file as suggested, and the steps and other sounds sound as they should. For editing, I recommend the Notepad++ Editor! Thank you very much! If the problem occurs again, I'll let you know...

Here is the edited file for those who have difficulty editing: DOWNLOAD

Best regards
For me it works!
User avatar
Enjay
 
 
Posts: 26936
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [ZScript] Global Footsteps Proof-of-Concept

Post by Enjay »

Sorry, I missed that you'd already done it. Thanks for confirming that it worked and for providing your fixed file.
Post Reply

Return to “Script Library”