Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Ancient EviL

Playing a sound after picking up a weapon(resolved)

Question

Hello, I'm trying to figure out how to have a specific sound play when pick up a weapon that is attached to a script. I have the sound imported, but I'm not quite understanding how to get the script to recognize the sound as I don't know how to define it in the SNDINFO. If someone could explain in simple terms how to define the sound so the script recognizes it; it would be appreciated. I did look on the ZDoom wiki but it just confused me. Thanks!

Edited by Ancient EviL

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0

Usually in SNDINFO you want to register a sound in this format (this is just copy-pasted from a WAD I have open right now):

blackKnightAttack BKATT

 

The text on the left, "blackKnightAttack", is the custom name you choose that will call that sound--it can be anything you want, but it tends to help if it's something logical enough that you'll know what it is when you read your code later. BKATT, on the right, is the sound's actual file name within your wad. Whatever your sound file is actually named, that's what you would write. If you wanted to, for simplicity's sake, you could make the scripting name match the file name, or rename the file to match its scripting name so they were exactly the same. So, it could read "BLACKKNIGHT BLACKKNIGHT" if you wanted.

 

When you're writing the script that will actually play the sound, the scripting name on the left (blackKnightAttack in this case) is what the script actually wants to see. So, in decorate that would look like A_PlaySound("blackKnightAttack").

 

I'm not necessarily an expert but hope that helps!

Share this post


Link to post
  • 0
6 minutes ago, Gifty said:

Usually in SNDINFO you want to register a sound in this format (this is just copy-pasted from a WAD I have open right now):


blackKnightAttack BKATT

 

The text on the left, "blackKnightAttack", is the custom name you choose that will call that sound--it can be anything you want, but it tends to help if it's something logical enough that it'll make sense when you're writing your script. BKATT, on the right, is the literal file name of the sound you're importing; so whatever its name is within your wad, that's what you would write. If you wanted to, for simplicity's sake, you could make the scripting name match the file name, or rename the file to match its scripting name so they were exactly the same. So, it could read "BLACKKNIGHT BLACKKNIGHT" if you wanted.

 

When you're writing the script that will actually play the sound, the scripting name on the left (blackKngihtAttack in this case) is what you'll actually write. So, in decorate that would look like A_PlaySound("blackKnightAttack").

 

I'm not necessarily an expert but hope that helps!

So here is the image of my script in Doom builder, and the SNDINFO, I'm assuming the SNDINFO is the issue? That's the part I think I'm getting wrong.

scriptr.png

sladekk.png

Share this post


Link to post
  • 0

I haven't used ACS enough to be sure, but everything in your screencaps looks correct! Sound definitions in SNDINFO don't need to be tagged in quotes, that might be throwing the system off. You could also try checking if the sound channel you're triggering your sound on isn't being cockblocked by another sound in the game, I've had trouble with that in the past. Sorry that I don't have a more solid suggestion for you!

Share this post


Link to post
  • 0

Try changing the SNDINFO definition to

misc/shebitch SHEBITCH

without quotes around it.

 

Then in your script, add the "misc/" in front of the logical name in PlaySound.

Share this post


Link to post
  • 0
4 hours ago, Nevander said:

Try changing the SNDINFO definition to

 


misc/shebitch SHEBITCH

 

without quotes around it.

 

Then in your script, add the "misc/" in front of the logical name in PlaySound.

I've tried both things and still not working.

Share this post


Link to post
  • 0

I ended up figuring it out, the sound volume was set to 1 when it should've been 1.0 

 

Thank you fo the help everyone!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×