A_StopAllSounds

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

A_StopAllSounds

Postby Major Cooke » Sat Jan 18, 2020 11:15 am

A_StopAllSounds(int start = 0, int end = 0)

Since we now have A_StartSound which has a near infinite number of channels for usage, this means actors such as inventory items that are playing sounds no longer account for sounds that are outside of 1 through 8.

Code: Select allExpand view
void BecomeItem ()
{
   if (!bNoBlockmap || !bNoSector)
   {
      A_ChangeLinkFlags(1, 1);
   }
   ChangeTid(0);
   bSpecial = false;
   // if the item was turned into a monster through Dehacked, undo that here.
   bCountkill = false;
   bIsMonster = false;
   ChangeStatNum(STAT_INVENTORY);
   // stop all sounds this item is playing.
   for(int i = 1;i<=7;i++) A_StopSound(i); //<--------------------------------
   SetState (FindState("Held"));
}


I think it would be wise to include a feature that works similar to A_ClearOverlays where you can specify a range of sounds to stop and it's done internally. If no numbers are specified, it will completely silence the actor.

Because doing a for loop from 1 to int_max will naturally kill the game the moment it occurs.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: A_StopAllSounds

Postby Marisa Kirisame » Sun Jan 19, 2020 5:00 am

I would appreciate this too.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_StopAllScreeching

Postby Uni-000 » Tue Jan 21, 2020 8:15 pm

Mmm, tasty Idea, I think this would do!
User avatar
Uni-000
 
Joined: 01 Apr 2017
Discord: Uni#4057

Re: A_StopAllSounds

Postby Matt » Thu Jan 23, 2020 5:35 pm

Related request: IsActorPlayingAnySound()
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: A_StopAllSounds

Postby Uni-000 » Fri Jan 24, 2020 11:19 am

Matt wrote:Related request: IsActorPlayingAnySound()


Could be useful for TItlemaps. +1
User avatar
Uni-000
 
Joined: 01 Apr 2017
Discord: Uni#4057

Re: A_StopAllSounds

Postby Major Cooke » Sun Jan 26, 2020 4:01 pm

Matt, you should make a new thread for it.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: A_StopAllSounds

Postby Graf Zahl » Mon Jan 27, 2020 1:08 am

Matt wrote:Related request: IsActorPlayingAnySound()



Can already be done by passing 0 for the channel and sound id to the existing check functions.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A_StopAllSounds

Postby Matt » Mon Jan 27, 2020 1:58 am

Sweet, that would've been exactly what I would've suggested had it not already been the case!
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest