Projectile won't always play death sound

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!)

Projectile won't always play death sound

Postby nekostuffing » Wed Jan 05, 2022 7:01 am

A projectile i made in decorate will sometimes fail to play its death sound, wich is defined in sndinfo, i tried using A_PlaySound and A_StartSound instead, but the result is always the same, all other sounds play fine. I even attempted to change the sound file with a different one but same thing happened, why could this be.


My weapon code
Spoiler:


My weapon in sndinfo
Spoiler:
User avatar
nekostuffing
 
Joined: 31 Aug 2019
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Projectile won't always play death sound

Postby XASSASSINX » Wed Jan 05, 2022 11:26 am

I'm a bit confused, unless i misread something, none of your projectiles uses A_PlaySound or A_StartSound, and if the problem is the projectile, you could use A_PlaySound or A_StartSound in the projectile instead of using DeathSound, since yeah, it can be a bit finnicky.
XASSASSINX
 
Joined: 20 Dec 2016
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: Projectile won't always play death sound

Postby Enjay » Wed Jan 05, 2022 12:47 pm

"sometimes fail to play its death sound" is not very specific. If this is happening when you fire a lot of projectiles in short succession and they are hitting a similar target, then it could be that the sound is reaching its $limit value - which can be increased in SNDINFO.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Projectile won't always play death sound

Postby XASSASSINX » Wed Jan 05, 2022 1:20 pm

which can be increased in SNDINFO.


Question, is that necessary? A_StartSound allows you to overlap a sound in channel, which takes away the point of increasing the limit of, y'know, sound queing and stuff.
XASSASSINX
 
Joined: 20 Dec 2016
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: Projectile won't always play death sound

Postby Enjay » Wed Jan 05, 2022 1:31 pm

Honestly, I'm not sure. So I'll go for - maybe not? ;)

Either way, I'm just throwing out an idea that is a common problem and given that OP says A_StartSound was tried, but I don't see it in the code so I don't know what parameters it was used with.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Projectile won't always play death sound

Postby XASSASSINX » Wed Jan 05, 2022 2:14 pm

Yeah, me neither, i hope OP can point this too, since there is quite a hefty amount of code here to look.
XASSASSINX
 
Joined: 20 Dec 2016
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: Projectile won't always play death sound

Postby nekostuffing » Wed Jan 05, 2022 6:28 pm

XASSASSINX wrote:I'm a bit confused, unless i misread something, none of your projectiles uses A_PlaySound or A_StartSound, and if the problem is the projectile, you could use A_PlaySound or A_StartSound in the projectile instead of using DeathSound, since yeah, it can be a bit finnicky.


I tried using A_PlaySound and then A_StartSound but since they both had the same result as DeathSound i changed it back to that instead
Last edited by nekostuffing on Wed Jan 05, 2022 6:52 pm, edited 1 time in total.
User avatar
nekostuffing
 
Joined: 31 Aug 2019
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Projectile won't always play death sound

Postby nekostuffing » Wed Jan 05, 2022 6:39 pm

Enjay wrote:"sometimes fail to play its death sound" is not very specific. If this is happening when you fire a lot of projectiles in short succession and they are hitting a similar target, then it could be that the sound is reaching its $limit value - which can be increased in SNDINFO.


Yeah thats basically it , i cant find any examples of this , but based on the wiki i think i should do it like this, is this correct?

Code: Select allExpand view
$limit weapons/magshexp   MAGSHEX <100> [40]
User avatar
nekostuffing
 
Joined: 31 Aug 2019
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Projectile won't always play death sound

Postby Blue Shadow » Thu Jan 06, 2022 1:58 am

nekostuffing wrote:is this correct?

Not quite. It should be like this:

Code: Select allExpand view
$limit weapons/magshexp 100 40

The < > means the parameter is required, while [ ] means it's optional; you can specify it you want, or leave it out and the engine will use the default value.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Projectile won't always play death sound

Postby nekostuffing » Thu Jan 06, 2022 3:34 am

Thanks a lot going to test this right away

(EDIT) Works like a charm.
User avatar
nekostuffing
 
Joined: 31 Aug 2019
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: Projectile won't always play death sound

Postby Jekyll Grim Payne » Mon Jan 10, 2022 10:06 am

XASSASSINX wrote:
which can be increased in SNDINFO.


Question, is that necessary? A_StartSound allows you to overlap a sound in channel, which takes away the point of increasing the limit of, y'know, sound queing and stuff.


Just for clarity—yes, It is. A_StartSound allows you to overlap a sound within a specific actor and their channels. $limit allows to control the limit on the total number of instances of this sound played in the game, which is different.
User avatar
Jekyll Grim Payne
 
 
 
Joined: 21 Jul 2008
Discord: Agent_Ash#4401
Github ID: jekyllgrim
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest