pRoJect45yt Posted February 22, 2024 (edited) I'm trying to play sound files when the player presses something or walks over a linedef. I've tried using the wiki and seeing what other people have done in their maps but I'm just not getting it. If someone could help me understand how the play sound function works, I would really appreciate it! (and if you could throw in a lesson on scripting that sound to play when a door opens (poly object) then that would be a ton of help too) Edited February 22, 2024 by pRoJect45yt 1 Quote Share this post Link to post
Chameeleoh Posted February 23, 2024 (edited) Hope this helps! As https://www.youtube.com/user/chubzdoomer ChubzDoomer tells us when learning scripting always keep this site up as a reference if you dont already! https://zdoom.org/wiki/Main_Page I havent had alot of success with that PlaySound function myself either XD idk what i was doing wrong with it. ActivatorSound has worked almost everytime for me. If youre just trying to call sounds from the original game. check this list out and call them like they did. https://github.com/ZDoom/gzdoom/blob/master/wadsrc/static/filter/game-doomchex/sndinfo.txt this worked for me by making a linedef call a function on player use. It should work regardless of the action that calls the script? but im just learning all this myself EXAMPLE script "floorlowerswitch01"(void) { setlinetexture(1,SIDE_FRONT,TEXTURE_BOTTOM, "SW2SKIN"); Floor_LowerByValue (1,6,24); //this is a classic sound as called from the link above. ActivatorSound("imp/pain", 100); } For custom sounds things like this have worked for me. but this requires you to go and add a SNDINFO to your WAD or PK3. not a ton of work, but useful knowledge. this one worked for me because i added it as an ambient sound, then called it from there. Spoiler EXAMPLE //basic polyobj door open sequence. script "floor_elevator_big"(void) { setlinetexture(0, SIDE_FRONT,TEXTURE_BOTTOM, "SW2COMM"); Polyobj_DoorSlide (5,4,128,48,105 ); Polyobj_DoorSlide (6,4,0,48,105); // I call 2 sounds here, one ingame, and one custom. ActivatorSound("switches/normbutn", 15); LocalAmbientSound("ELEVDING",127); } EXAMPLE //linedef player walk over, plays dog barking custom sound. script "dogbark_snd"(void) { LocalAmbientSound("DOGBARK",127); } idk if other modders have used this site, but ive been playing with the sounds from here in my current map.https://pixabay.com/sound-effects/ make sure to save the links of the files you download and convert and credit them in your WAD or PK3 as always :D The videos below will show you how thats done in detail. Also https://www.youtube.com/@signaltome LazyGamer on youtube has some good tutorials as well. Most likely going to have to get SLADE and follow some tutorials Heres a good one Spoiler Edited February 23, 2024 by Chameeleoh 0 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.