[SOLVED]How to stop a sound?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Riclo
 
Posts: 26
Joined: Sun Mar 09, 2014 2:14 am

[SOLVED]How to stop a sound?

#1

Post by Riclo » Wed May 27, 2015 7:46 pm

For example, I have a sound that's going to be activating within a map using the ThingSound ACS command. How would I be able to cut the sound off?

So far removing the mapspot the sound is being spawned from doesn't work, and creating a decorate item that triggers the sound and removing that doesn't work either.

Solved:
[spoiler]

Code: Select all

Actor Musicsound
{
-NOGRAVITY
reactiontime 999
states
{
spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundex ("Music", CHAN_VOICE, 9.0, 0) 
goto butloop

butloop:
TNT1 A 35
TNT1 A 0 A_JumpIf (ACS_ExecuteWithResult(20), "cutoff") 	
TNT1 A 0 A_CountDown
loop

cutoff:
TNT1 AA 0 A_Stopsoundex("Voice")

Death:
TNT1 A 0 
stop
}
}
//////
Script 20 (void)
{
{
        If(!Situation()) {
            SetResultValue(FALSE);
        } else {
            SetResultValue(TRUE);
        }
}
}
[/spoiler]
Last edited by Riclo on Wed May 27, 2015 8:46 pm, edited 1 time in total.

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: How to stop a sound?

#2

Post by Ænima » Wed May 27, 2015 8:07 pm

The only way to do this is with a_playsoundex and a_stopsoundex. Unfortunately a_stopsoundex has no ACS equivalent so you'll have to use some hackery and make your script spawn DECORATE actor that calls a_stopsoundex on itself when you need to.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Riclo
 
Posts: 26
Joined: Sun Mar 09, 2014 2:14 am

RE: [SOLVED]How to stop a sound?

#3

Post by Riclo » Wed May 27, 2015 8:47 pm

Ænima wrote: The only way to do this is with a_playsoundex and a_stopsoundex. Unfortunately a_stopsoundex has no ACS equivalent so you'll have to use some hackery and make your script spawn DECORATE actor that calls a_stopsoundex on itself when you need to.
Thanks alot, it seems to be working now

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: [SOLVED]How to stop a sound?

#4

Post by Ænima » Wed May 27, 2015 9:31 pm

Awesome. That code is pretty much exactly how I would have done it.
Last edited by Ænima on Wed May 27, 2015 9:32 pm, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

FateLord
Forum Regular
Posts: 307
Joined: Fri Apr 05, 2013 8:39 pm
Location: Columbus, USA

RE: [SOLVED]How to stop a sound?

#5

Post by FateLord » Wed May 27, 2015 10:24 pm

sounds like a tracker suggestion: add an ACS-equivalent to a_stopsoundex
<Sean> .broadcast FateLord has a massive, hard wallhack
<Exciter> Global broadcast sent.

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: [SOLVED]How to stop a sound?

#6

Post by Ænima » Thu May 28, 2015 8:24 am

FateLord wrote: sounds like a tracker suggestion: add an ACS-equivalent to a_stopsoundex
That's more of a ZDoom suggestion.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Post Reply