Zombie footsteps.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Zombie footsteps.

Post by Hidden Hands »

Okay so I have a single footstep sound and I want it to play on ever frame of the zombies animation when it walks. So it would be on say...

POSS ABCD 4

The foot step sound would play on the POSS B and D frames. As the foot touches the ground as a full step. If that makes sense. How would I go about achieving this please?

Also, player footsteps if possible.

Thanks in advance.
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Zombie footsteps.

Post by ramon.dexter »

POSS A 4
POSS B 4 A_Playsound(sound)
POSS C 4
POSS D 4 A_playsound(sound)
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Zombie footsteps.

Post by Hidden Hands »

Great thank you
User avatar
Enjay
 
 
Posts: 26533
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Zombie footsteps.

Post by Enjay »

Don't forget that you still need A_Chase in the walking code if you want the zombie to have normal seek and attack behaviour. If you reduce the number of A_Chase calls, you will alter the zombie's behaviour. (Sorry, not easy to type example code on my phone.)
User avatar
Cherno
Posts: 1311
Joined: Tue Dec 06, 2016 11:25 am

Re: Zombie footsteps.

Post by Cherno »

For the vanila ZombieMan, this would be

Code: Select all

POSS AA 4 A_Chase
TNT1 A 0 A_Playsound(sound)
POSS BB 4 A_Chase
POSS CC 4 A_Chase
TNT1 A 0 A_Playsound(sound)
POSS DD 4 A_Chase
In your own example, it would be

Code: Select all

[code]
POSS A 4 A_Chase
TNT1 A 0 A_Playsound(sound)
POSS B 4 A_Chase
POSS C 4 A_Chase
TNT1 A 0 A_Playsound(sound)
POSS D 4 A_Chase
[/code]
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Zombie footsteps.

Post by Hidden Hands »

Hmm. OK I think I get the idea. I'll try this later and see if I can get it working. Thank you.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Zombie footsteps.

Post by Hidden Hands »

EDIT: Okay so I got it working but now I'm faced with another problem. The zombies are walking to fast. It's a chain of footsteps really fast not the 1 - 2 -3 -4 but rather 1234123412341234. Also the animation for the zombie seems to have sped up to.
User avatar
Enjay
 
 
Posts: 26533
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Zombie footsteps.

Post by Enjay »

I'd try Cherno's first code example rather than the second. Using logic similar to the original zombieman might solve what you describe.
Post Reply

Return to “Scripting”