Search the Community
Showing results for tags 'fs2004 fs9 turb turbulence'.
Found 1 result
Folks, below is code that will successfully trigger a sound file when turbulence is detected, Conversely, once the turbulence no longer exists, the sound file stops. I have tested and retested the script and all is well. Credits to Pete Dowson and "cellular55" of which some code was ported. ___________________________________________________________________ Instructions for use: 1. Copy the below code (only in blue) and paste into Windows Notepad. 2. Save the file with the name: ipcready.lua 3. Place this file into your FS9/modules folder 4. Choose a sound (wav) file that best represents the sound of turbulence to you. i.e. rattle, bumps, etc. 5. Name this sound file turb.wav and place it into your FS9/sound folder. Note: I have attached the turb.wav file that I am using and it is specifically edited to use with tactile transducers. It may or may not suit you as well. Thats it. Regards, Michael Lehkamp __________________________________________________________________________ -- Turbulence looping sound -- -- Initializing flags -- sndflg=0 -- turbulence sound flag ref=0 -- Function to play sound if and until turbulence is detected -- function turbulence(offset,value) ground=ipc.readUW(0x0366) if (value > 0) and (sndflg == 0) and (ground == 0) then ref=sound.playloop("turb.wav") sndflg=1 end if (value == 0) and (sndflg == 1) then sound.stop(ref) sndflg=0 end end -- FSUIPC LUA events event.offset(0x0E88,"UW","turbulence") event.offset(0x0E98,"UW","turbulence") turb.wav