Mik57 Posted October 19, 2008 Does anyone know the ACS code for making a thunder sound file play whenever lightning strikes? 0 Share this post Link to post
Steeveeo Posted October 19, 2008 This is a flexible one I used for my weather demo: script 1 open //lightning { // Lightning sector flicker Light_ChangeToValue (1, 255); delay(2); Light_ChangeToValue (1, 128); delay(2); Light_ChangeToValue (1, 255); delay(2); Light_ChangeToValue (1, 128); //Sounds delay(random(70,210)); //Sound travels slower than light, wait 2-6 seconds) ambientsound("Thunder", random(32, 127)); //Play the sound at a random audible volume delay(random(175,2100)); //Wait 5-60 seconds until next strike restart; }Hope that helps! 0 Share this post Link to post
Enjay Posted October 19, 2008 You may not be aware that this can be handled by MAPINFO. If you put the word "lightning" in your map definition, the game will automatically make thunder and lightning for you. No need to tag all your sectors etc to flash. The lightning temporarily flashes all sectors with a sky flat and any sectors with types such as "indoor lightning". It also plays the sound world/thunder (IIRC) which you have to define in sndinfo. In addition, if you have 2 sky graphics set up, eg 1 normal sky and one with forks of lightning drawn on it, the sky will briefly change to the second sky too. And all that happens just because of that keyword in mapinfo. What's more, if you still want additional scripted things to happen every time the lightning flashes, there is also the "lightning" script type which runs a script every time the level activates lightning. So, short version, no need to script unless you want to. 0 Share this post Link to post
Mik57 Posted October 19, 2008 Alright, thanks guys. I already tried the script from your rain example, and It just kept flashing repeatedly and making 3 thunder noises happen at the same time. But at least I learned a bit from it. I'm gonna try Enjay's way. I already knew about the lightning keyword in mapinfo, but I didn't know about the sound name in SND info. Thanks again. 0 Share this post Link to post
Steeveeo Posted October 20, 2008 whoops, forgot to add the restart; at the end of the clip, fixing. 0 Share this post Link to post
Enjay Posted October 20, 2008 Should have mentioned this before. Got to this site http://members.lycos.co.uk/enjay001/ And about half way down the page look for a file called redsky.zip (just search for it - I can't hotlink to files from that site). Download it and load it into Doom2. Then go outside in map01 and look at the sky. Eventually, you'll get a lightning flash, a thunder sound and a change of sky - all done with the MAPINFO thingy. 0 Share this post Link to post