Projectile bullet ricochet

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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
Mush256
Posts: 15
Joined: Tue May 31, 2022 2:05 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Czech Republic

Projectile bullet ricochet

Post by Mush256 »

Hey, just wanted to ask, is it possible to make a projectile not make an explosion sound, just a ricochet sound if it hits a wall? (not an actor)
I'm trying to make a projectile-based pistol instead of a hitscan one for the player, and I'm having trouble implementing this, as I'm quite a newbie to how zscript and DECORATE works.
Jarewill
 
 
Posts: 1855
Joined: Sun Jul 21, 2019 8:54 am

Re: Projectile bullet ricochet

Post by Jarewill »

You can define a specific state for hitting a wall and play the sound there.
Projectiles will enter the Death state by default or when they specifically hit a wall.
If you define XDeath and Crash states, the projectile will enter those when hitting an actor, making the Death state be only used for hitting walls.
For more information check the wiki.
User avatar
Mush256
Posts: 15
Joined: Tue May 31, 2022 2:05 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Czech Republic

Re: Projectile bullet ricochet

Post by Mush256 »

Thanks! Made it work now
Post Reply

Return to “Scripting”