Playsound problem with an actor

Discuss all aspects related to modding Zandronum here.
Post Reply
Mr.Man
Forum Regular
Posts: 657
Joined: Thu May 09, 2013 7:25 pm

Playsound problem with an actor

#1

Post by Mr.Man » Sun Nov 03, 2013 8:11 pm

Hi, does anyone know why this isnt working? I want it to play MRMXPL when it activates, which is an explosion sound. However, it doesnt.

ACTOR StiffExplosion2 20040
{
//$Category Stijfjes Stuff
States
{
Spawn:
EXP2 A 0 A_PlaySound("MRMXPL")
EXP2 ABCDEFGHIJKLMN 2
Stop
}
}

W1D3A55
Forum Regular
Posts: 327
Joined: Sun Sep 30, 2012 12:39 am
Location: Here

RE: Playsound problem with an actor

#2

Post by W1D3A55 » Sun Nov 03, 2013 9:24 pm

It most likely needs to be defined in SNDINFO.
Watermelon wrote: Stall is notorious for his D.
Lollipop wrote: What does ETA mean? I'm sorry, but I don't get too much around on the internet.
For the best song you'll ever hear, click this link
I DARE YOU

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

RE: Playsound problem with an actor

#3

Post by Ænima » Sun Nov 03, 2013 9:57 pm

You also can't execute an action in the first frame of an actor's Spawn state ...

Try this instead:

Code: Select all

ACTOR StiffExplosion2 20040
{
//$Category Stijfjes Stuff
  States
  {
  Spawn:
    EXP2 A 0 // you can't do actions here, you have to wait until the second frame
    EXP2 A 0 A_PlaySound("MRMXPL")  
    EXP2 ABCDEFGHIJKLMN 2
    Stop
  }
}
Last edited by Ænima on Sun Nov 03, 2013 9:59 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

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Playsound problem with an actor

#4

Post by Ivan » Sun Nov 03, 2013 10:30 pm

Or you can put an extra A to that line, meaning

Code: Select all

EXP2 AA 0 A_PlaySound("MRMXPL")
This will also work in case you want to make it take less lines :p
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
-Jes-
Frequent Poster Miles card holder
Posts: 975
Joined: Fri Aug 03, 2012 9:55 am
Location: Void Zone

RE: Playsound problem with an actor

#5

Post by -Jes- » Mon Nov 04, 2013 12:51 am

The first frame in an actor's spawn state can indeed not perform any actions.

In fact, ZDoom just recently introduced an actor flag to remove this behavior.

Mr.Man
Forum Regular
Posts: 657
Joined: Thu May 09, 2013 7:25 pm

RE: Playsound problem with an actor

#6

Post by Mr.Man » Mon Nov 04, 2013 8:16 am

Ah, explains. Yeah, i has it in SNDINFO, ill try it when i get to a proper pc. Thanks for the help.

Mr.Man
Forum Regular
Posts: 657
Joined: Thu May 09, 2013 7:25 pm

RE: Playsound problem with an actor

#7

Post by Mr.Man » Tue Nov 05, 2013 12:43 pm

i tried with the double A and it works! But its not very loud, can this be increased?

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

RE: Playsound problem with an actor

#8

Post by Ænima » Tue Nov 05, 2013 3:50 pm

Mr.Man wrote: i tried with the double A and it works! But its not very loud, can this be increased?
Yeah, open the sound with Audacity and amplify it.
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
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Playsound problem with an actor

#9

Post by Ivan » Tue Nov 05, 2013 4:10 pm

Ænima wrote:
Mr.Man wrote: i tried with the double A and it works! But its not very loud, can this be increased?
Yeah, open the sound with Audacity and amplify it.
No, there's an even better solution. Put more A there and in the sound definition at SNDINFO do this:

Code: Select all

$limit Soundname 0
Notice the 0 means "No limit" so you can play same types of these sounds at any channel as many times as you want, giving it an amplification effect. If it turns out to be too loud, you can make the limit to say, 2 or 4. Also note that the number of A you add means the more instances of that sound being played, so it amplifies like 2 times, 3 times, 4 times and so on.
Last edited by Ivan on Tue Nov 05, 2013 4:10 pm, edited 1 time in total.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Playsound problem with an actor

#10

Post by Ijon Tichy » Tue Nov 05, 2013 4:19 pm

That is not a better solution. Playing the same sound on multiple channels clogs up those channels (they're shared across the entire player actor), as well as the global sound channels (64 or so by default), and since only one sound can be played per channel, you're basically silencing other sounds because you couldn't be bothered to go into Audacity and use an Amplify function. By default, it makes the sound as loud as possible without clipping, so it's literally just three clicks once you have the sound open.

If you're using automatic, really rapid firing weapons, switching between three or four audio channels for each shot might make the weapon sound better, but that's something else. Even then, use only as many sound channels as you need to make it sound good.
Last edited by Ijon Tichy on Tue Nov 05, 2013 4:22 pm, edited 1 time in total.

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Playsound problem with an actor

#11

Post by Ivan » Tue Nov 05, 2013 4:22 pm

Ijon Tichy wrote: That is not a better solution. Playing the same sound on multiple channels clogs up those channels (they're shared across the entire player actor), as well as the global sound channels (64 or so by default). Amplifying it really isn't that big of a deal, and it means less stupid code bloat.
But it's an external actor, so it shouldn't affect the player in any way.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Playsound problem with an actor

#12

Post by Ijon Tichy » Tue Nov 05, 2013 4:25 pm

Doesn't change the fact that it's still clogging up sound channels, as well as being a really nasty hack.

The only reason I'd use this hack is because it seems to bypass clipping to some extent, but even then, I'd use it only sparingly.
Last edited by Ijon Tichy on Tue Nov 05, 2013 4:26 pm, edited 1 time in total.

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Playsound problem with an actor

#13

Post by Ivan » Tue Nov 05, 2013 4:30 pm

Ijon Tichy wrote: Doesn't change the fact that it's still clogging up sound channels, as well as being a really nasty hack.

The only reason I'd use this hack is because it seems to bypass clipping to some extent, but even then, I'd use it only sparingly.
Yes, that is exactly why I suggested it, no clipping. It does what many of the sound editing tools fail to do, Audacity included. Often times, no matter how loud I tried to make an effect, or a weapon firing sound, it would not work. I used this and voila, perfect. IMO it can be very useful if done right.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Playsound problem with an actor

#14

Post by Klofkac » Thu Nov 07, 2013 7:27 pm

About playsound, I noticed that compressed formats are much quietter than the wave format, while using completely same, normalized sound.
The similar applies to stereo sounds.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Playsound problem with an actor

#15

Post by Ivan » Thu Nov 07, 2013 7:28 pm

Klofkac wrote: About playsound, I noticed that compressed formats are much quietter than the wave format, while using completely same, normalized sound.
The similar applies to stereo sounds.
Yeah I noticed this a long while ago too, but I thought it was just me... There certainly is something weird with how Zandronum handles those.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

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

RE: Playsound problem with an actor

#16

Post by Ænima » Thu Nov 07, 2013 7:48 pm

Ivan wrote:
Klofkac wrote: About playsound, I noticed that compressed formats are much quietter than the wave format, while using completely same, normalized sound.
The similar applies to stereo sounds.
Yeah I noticed this a long while ago too, but I thought it was just me... There certainly is something weird with how Zandronum handles those.
I have never noticed this. Infact I have recently batch-converted all of SST's sounds (which were all WAVs) to OGG's and everything sounds just as loud as it used to (and no it's not just relative, sometimes I play with headphones on at 100% volume and everything sounds just as loud as before the conversion).

It may be related to your guys' sound drivers or even OS (not sure if Linux Zandro handles sound file decompression differently than Windows).


The only thing i've noticed in relation to compressed sound formats in Zandro is that with long clips (mostly just music) can lag for a second before the sound plays for the first time due the sound needing to be decompressed as it's loaded. This is most noticeable when a map/server changes the music to an MP3 in the middle of a map. If it were a WAV, there would be hardly any pause. (But the filesize would be ridiculous ... a 3-minute song in WAV format alone is like 30 fucking megabytes...)
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