Reisal Posted December 24, 2014 I was thinking of a few lines in a map that play a sound, stop and play again if activated via +use with the sound playing in a specific region (in front of the line) and not everybody in a network game and one being toggleable like a radio. What would I do for this via scripting? /KnowsNothingAboutACS 0 Quote Share this post Link to post
scifista42 Posted December 24, 2014 Glaice said:I was thinking of a few lines in a map that play a sound, stop and play again if activated via +use with the sound playing in a specific region (in front of the line) and not everybody in a network game and one being toggleable like a radio.Can you please divide this sentence into separate sentences, where each one will describe exactly one problem you have? I'd like to help you out, but I'm confused how do you actually want it to work. 0 Quote Share this post Link to post
Reisal Posted December 24, 2014 I want to make a 2 sided linedef to activate a one-time playable but repeatable sound (like a soundboard) and another toggleable sound that can be turned on and off but loops while on. 0 Quote Share this post Link to post
scifista42 Posted December 24, 2014 I'm still not 100% certain if I understand you right. I wanted to suggest this script:int soundIsOn = 0; // A variable that will remember whether the sound is On or Off script 1 (void) { // Let this script be activated by pressing a linedef, with repeatable action if(soundIsOn) { // Variable == 1 soundIsOn = 0; // Toggle variable StopSound(0,0); // Stopping to play the looping sound } else { // Variable == 0 soundIsOn = 1; // Toggle variable PlaySound(0,"misc/chat2",0,1.0,1,1.0); // The looping sound } PlaySound(0,"misc/chat",0,1.0,0,1.0); // The non-looping sound }But when I've tried it myself, neither DB2 nor GZDB can compile this script, because it doesn't know StopSound and PlaySound functions - I guess you need updated configs for that (ZDoom 2.7.1+) (?). 0 Quote Share this post Link to post
Reisal Posted December 24, 2014 The thing is I wanted to make my friend giggle from the alterations within Zandronum and activated by a switch (for the looping one), which I don't know if it would be possible to do. What would I edit in the second one that is non-looping, but repeatable via activating? 0 Quote Share this post Link to post
scifista42 Posted December 24, 2014 Oh, so in Zandronum, it's going to be much harder, because these nice flexible functions don't exist there (they're ZDoom 2.7.1+ only). Here you have a list of some sound-related ACS functions you can mess with - ThingSound looks promising, though it cannot handle looping. The looping might be faked by a looping script playing the sound again and again, perhaps using Restart. I'm going to sleep right now, sorry for rushing it and giving just general tips, I might be more helpful again tomorrow, if needed. 0 Quote Share this post Link to post
scifista42 Posted December 25, 2014 So the easiest part: The non-looping sound. Place a linedef, and place a Map Spot thing in front of the linedef. The linedef will launch script 1 via ACS_ExecuteAlways, if you don't want any delay, or via ACS_Execute, if you want a little delay before the switch can be pressed again. Assign tag 999 to the Map Spot thing. Then write this script to the Scripts window:script 1 (void) { ThingSound(999,"misc/chat",127); // or use another sound instead of "misc/chat" Delay(10); // omit this line if you don't want a delay, or feel free change the value }I don't know how to do a looping sound easily. 0 Quote Share this post Link to post
Reisal Posted December 25, 2014 I guess I can get away with non-looping for the loop one as it's like 15 seconds long. In DB2, I do not see the Map Spot thing, where/what do I do to put this in? 0 Quote Share this post Link to post
scifista42 Posted December 25, 2014 With the looping sound, maybe you can spawn a new custom thing (tagged 998, for example) from the 999 thing using SpawnSpot, and make this new thing to play and loop your sound using DECORATE or sound sequences or anything. Then, when you wanted to turn the sound off, you can use Thing_Remove to remove the thing with tag 998. 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.