Oweniyo Posted November 18, 2023 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! 1 Quote Share this post Link to post
ViolentBeetle Posted November 19, 2023 What map format/port you are working for? 0 Quote Share this post Link to post
Gez Posted November 20, 2023 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. 0 Quote Share this post Link to post
Oweniyo Posted November 20, 2023 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. 0 Quote Share this post Link to post
Oweniyo Posted November 20, 2023 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? 0 Quote Share this post Link to post
Gez Posted November 20, 2023 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. 0 Quote Share this post Link to post
Oweniyo Posted November 20, 2023 (edited) 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 November 20, 2023 by Oweniyo 0 Quote Share this post Link to post
Oweniyo Posted November 20, 2023 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? 0 Quote Share this post Link to post
Gez Posted November 20, 2023 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. 0 Quote Share this post Link to post
Oweniyo Posted November 20, 2023 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. 1 Quote Share this post Link to post
SupremeBioVizier Posted November 21, 2023 for a quick fix you can always use the boss shooter sprite that is invisible and place it wherever you want a custom sound to trigger, just put the mp3 or wav into the file and rename it as DSBOSSIT, sndinfo lumps are easy as well https://github.com/ZDoom/gzdoom/blob/master/wadsrc/static/filter/game-doomchex/sndinfo.txt 0 Quote Share this post Link to post
Oweniyo Posted November 23, 2023 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! 1 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.