How to make sounds NOT loop (like a death cry)

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.

How to make sounds NOT loop (like a death cry)

Postby Hidden Hands » Mon Oct 11, 2021 2:18 pm

I have pasted my code below. This is an animation that happens in a scene and the problem I have is that the sounds used with "A_PlaySound" keep looping. How do I make them play and stop, like a demons death cry? Also, sounds cut off previous ones. Can I fix this?

Code: Select allExpand view
ACTOR DemonKillsDonnie 2222
{
//$Category Apparition
//$Title DemonKillsDonnie
//$Sprite DEXEC0
    Scale 0.7
    Renderstyle "Normal"
    Height 60
   Mass 40
    +SOLID
    States
   {
   Spawn:
    DAPR A 8
    DAPR B 8
    DAPR C 8
    DAPR D 15
    DEXE A 8
    DEXE B 8
    DEXE C 8 A_PlaySound ("Gore/Slash", CHAN_VOICE, 0.7, 1, ATTN_STATIC, 0)
    DEXE D 8 A_PlaySound ("Gore/Drop1", CHAN_VOICE, 0.7, 1, ATTN_STATIC, 0)
    DEXE E 8
    DEXE F 8
    DEXE G 8
    DEXE H 8
    DEXE I 8 A_PlaySound ("Gore/Drop2", CHAN_VOICE, 0.7, 1, ATTN_STATIC, 0)
    DEXE J 8
    DEXE K -1
    Stop
   }
}
User avatar
Hidden Hands
Cherub
 
Joined: 20 Sep 2016
Location: London, England
Discord: VGCtm
Operating System: Windows Vista/7/2008 32-bit

Re: How to make sounds NOT loop (like a death cry)

Postby Caligari87 » Mon Oct 11, 2021 2:56 pm

Check your parameters A_PlaySound

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: How to make sounds NOT loop (like a death cry)

Postby Graf Zahl » Mon Oct 11, 2021 3:05 pm

Also, use A_StartSound which has clearer parameters than A_PlaySound.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: How to make sounds NOT loop (like a death cry)

Postby ramon.dexter » Tue Oct 12, 2021 4:59 am

Hidden Hands, are you checking the wiki when you encounter a problem, or do you head straight here, without trying to solve the problem by yourself? This issue could be 100% solved by yourself, if you just opened the wiki and pasted the A_playsound there.

Also, are you using slade to edit the actor definitions? If so, you dont even need to head to wiki, slade shows you the functions parameters, so again, you should be able to solve it by careful check...

The sound is looping, because you told the function to make it looping. Copied the code somewhere, don't you?
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests