Jump to content

Sound files and their use


Oweniyo

Recommended Posts

Hello!

 

I have a question for you lot and it goes a little something like this:

If I were to choose to put in some custom sounds, let's say: a voice line or something similar, how do you make that happen? And can you even make that happen?

Has anyone ever done this or attempted it? Any feedback would be much obliged!

Share this post


Link to post

It's possible, it has been done before, and there are multiple ways of doing this depending on which source port compatibility you want.

 

At the lowest level, vanilla, you're pretty much limited to cheating by sacrificing a monster and turning it into an invisible "speaker" with your sound clip replacing the alert sound, so that when it "sees" the player it plays the line. A good candidate for this would be the monster spawner, just dehack away its monster spawning, and replace the "to win the game" clip with your own. If you've got more than one line to play, though, that will become more and more constraining as you'll have to sacrifice more and more of regular things to get your custom stuff going on.

 

At the other end of the spectrum, in something like ZDoom you can have scripts playing sounds a very precisely controlled times, including queuing voice lines one after the other. Heck, Hexen did that with the Korax taunts at the start of each hub.

Share this post


Link to post
On 11/19/2023 at 9:26 AM, ViolentBeetle said:

What map format/port you are working for?

The map format is UDMF, Hexen format, for GZDoom.

Share this post


Link to post
7 hours ago, Gez said:

It's possible, it has been done before, and there are multiple ways of doing this depending on which source port compatibility you want.

 

At the lowest level, vanilla, you're pretty much limited to cheating by sacrificing a monster and turning it into an invisible "speaker" with your sound clip replacing the alert sound, so that when it "sees" the player it plays the line. A good candidate for this would be the monster spawner, just dehack away its monster spawning, and replace the "to win the game" clip with your own. If you've got more than one line to play, though, that will become more and more constraining as you'll have to sacrifice more and more of regular things to get your custom stuff going on.

 

At the other end of the spectrum, in something like ZDoom you can have scripts playing sounds a very precisely controlled times, including queuing voice lines one after the other. Heck, Hexen did that with the Korax taunts at the start of each hub.

I'm using UDMF, Hexen format, on GZDoom. I thought that maybe I'd record a voice line and just add that in for a little story part at the beginning. I always thought that it would be like recording it, putting the file in Slade, then somehow script it so it triggers in the game. But it's probably not that easy is it? Like, that's the thing I wish to figure out. How can I fulfill that in this format that has so many possibilites?

Share this post


Link to post

Well if all you want is for a sound to be played at the start of a level, you basically want to do the same thing Hexen did. Not only is it possible, but it's not too hard to do.

 

The first step once you have your sound file is to put it in your .wad and create a SNDINFO lump to basically register it and give it its "logical name".

 

Once you have done that, you take your scripts lump for the level and add an OPEN or ENTER script. Cf. script types. In that script, you'll use a call to PlaySound to have your sound played at some map spot. If you use ATTN_NONE, it doesn't matter where the map spot is located, the sound will be heard at full volume everywhere on the map.

 

If you need to split your intro text into several different texts (e.g., one sound for "GREETINGS, MORTAL" and another for "ARE YOU READY TO DIE?"), then you can use delay to wait before two different PlaySound instructions.

Share this post


Link to post

I see here that it is limited to: ENTER, LOAD, RESPAWN, so these are then triggers for these lines to activate. I was wondering can you do it so that it triggers just like any other thing, like opening doors, or killing a certian amount of enemies in a room? I have envisioned this as, you get teleported somewhere and the marine says something, and again, at the end of the wad, when all enemies in a room are dead. Is that possible to achieve with this method?

Edited by Oweniyo

Share this post


Link to post
13 minutes ago, Gez said:

Well if all you want is for a sound to be played at the start of a level, you basically want to do the same thing Hexen did. Not only is it possible, but it's not too hard to do.

 

The first step once you have your sound file is to put it in your .wad and create a SNDINFO lump to basically register it and give it its "logical name".

 

Once you have done that, you take your scripts lump for the level and add an OPEN or ENTER script. Cf. script types. In that script, you'll use a call to PlaySound to have your sound played at some map spot. If you use ATTN_NONE, it doesn't matter where the map spot is located, the sound will be heard at full volume everywhere on the map.

 

If you need to split your intro text into several different texts (e.g., one sound for "GREETINGS, MORTAL" and another for "ARE YOU READY TO DIE?"), then you can use delay to wait before two different PlaySound instructions.

I see here that it is limited to: ENTER, LOAD, RESPAWN, so these are then triggers for these lines to activate. I was wondering can you do it so that it triggers just like any other thing, like opening doors, or killing a certian amount of enemies in a room? I have envisioned this as, you get teleported somewhere and the marine says something, and again, at the end of the wad, when all enemies in a room are dead. Is that possible to achieve with this method?

Share this post


Link to post

If you want the script to be executed when a player crosses a line, then you put ACS_Execute on that line, and your script will not have any of the special tags like ENTER, instead it'll have a list of parameters, which can be just (void) if you have no parameters at all. For playing the sound when all monsters are dead, you us an OPEN script but with a while (ThingCount(T_NONE ,0) > 0) delay(35); instruction in before the PlaySound instruction so it'll wait until all monsters are dead before playing the sound.

 

See A quick beginner's guide to ACS.

 

Share this post


Link to post
42 minutes ago, Gez said:

If you want the script to be executed when a player crosses a line, then you put ACS_Execute on that line, and your script will not have any of the special tags like ENTER, instead it'll have a list of parameters, which can be just (void) if you have no parameters at all. For playing the sound when all monsters are dead, you us an OPEN script but with a while (ThingCount(T_NONE ,0) > 0) delay(35); instruction in before the PlaySound instruction so it'll wait until all monsters are dead before playing the sound.

 

See A quick beginner's guide to ACS.

 

Man, you are really helping me out here, Gez. I've browsed some youtube videos but can't really get direct answers like this. I'll try my best to execute this method the way you told me, I hope you don't mind if I stumble upon another question to ask you, since I really can't find any other explanation. But it's nice to see that it's possible.

Share this post


Link to post

I wish to thank everyone who took the time to write their solutions, means a lot!

I'll try everything and hopefuly learn a few things along the way.

 

Cheers!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...