Discuss all aspects related to modding Zandronum here.
-
Riclo
-
- Posts: 26
- Joined: Sun Mar 09, 2014 2:14 am
#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.
-
Ænima
- Addicted to Zandronum
- Posts: 3583
- Joined: Tue Jun 05, 2012 6:12 pm
#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.
-
Riclo
-
- Posts: 26
- Joined: Sun Mar 09, 2014 2:14 am
#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
-
Ænima
- Addicted to Zandronum
- Posts: 3583
- Joined: Tue Jun 05, 2012 6:12 pm
#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.
-
FateLord
- Forum Regular
- Posts: 307
- Joined: Fri Apr 05, 2013 8:39 pm
- Location: Columbus, USA
#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.
-
Ænima
- Addicted to Zandronum
- Posts: 3583
- Joined: Tue Jun 05, 2012 6:12 pm
#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.