-
Posts
12 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by makoy
-
-
Hi, i have Aura shaker on one of my client computer. It's giving shakes from turbulence (by LUA-file) and some other voices from PM-sounds. Is it possible to get touchdown voices to it? The problem is, that if i use shaker on my server, i got every sound shaken my butt. Thanks. Cheers Marco
-
I KNOW I HAVE MESS IT, thats why i have ask help, becouse am totally new with LUA, i never havent write it before. Here is the script what dosent give errors. I just have add ref=0 , below of seatfl=0 -- seat belt flag , nothing else.
Looping sound stop now before landing.
------------------------------------------------------------------------------
-- Turbulence looping sound -- Seat Belts Messages -- ATC Radio Chatter
-- Initializing flags --
sndflg=0 -- turbulence sound flag
seatfl=0 -- seat belt 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("C:\\WideClient\\Sounds\\Turbulence.wav")
sndflg=1
ipc.sleep(1000)
if (seatfl == 2) or (seatfl == 4) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
end
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
end
if (value == 0) and (sndflg == 1) then
sound.stop(ref)
sndflg=0
if (seatfl == 2) or (seatfl ==4) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
end
end
end
-- Function to manage messages when seat belts sign changes - welcome on board -- descent --- on cruise ---- parked at the arrival gate
function seatbelt(offset,value)
if (value == 1) and (seatfl == 0) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\welcomeonboard.wav")
seatfl=1
end
if (value == 1) and (seatfl == 2) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\descent.wav")
seatfl=3
end
if (value == 0) and (seatfl == 1) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\levelautobelt.wav")
seatfl=2
end
if (value == 0) and (seatfl == 3) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\atgate.wav")
seatfl=4
end
end
-- Function to play ATC chatter - COM2 freqs 118.10 and 118.20 - 70 wavs for each freq - y var to make the frequency of chat random - x var to make the messages random
function ATC_Radio()
-- Radio squelch if a valid freq is selected
n = ipc.readUW(0x3118)
if (n == 0x1810) or (n == 0x1820) then
if (n1 ~= n) then
sound.play("C:\\WideClient\\Sounds\\Radio.wav")
n1=n
end
end
-- Radio chatter play routine
y= math.random(1,5)
if (y == 2) or (y == 4) then
if (n == 0x1810) then
x=math.random (1,70)
suono = "C:\\WideClient\\Sounds\\chatter1.wav"
sound.play(suono)
end
if (n == 0x1820) then
x=math.random (1,70)
suono = "C:\\WideClient\\Sounds\\chatter2.wav"
sound.play(suono)
end
end
end
-- FSUIPC LUA calls for the different events -- timer to exec the ATC function every 1 min
event.offset(0x0E88,"UW","turbulence")
event.offset(0x0E98,"UW","turbulence")
event.offset(0x341D,"UB","seatbelt")
event.timer(60000,"ATC_Radio")
------------------------------------------------------------------------
-
Original script work, except turbulence sound still play even after landing. I have try to fix it and result is this, yes i got errors. I keep on trying.
-
Please can you simply paste in the Lua script you are trying to use? I want to look at what YOU are using! I don't want references to other things and instructions! I need to see exactly what you are running!
Pete
Ok, here it is.
------------------------------------------------------------------------------
-- Turbulence looping sound -- Seat Belts Messages -- ATC Radio Chatter
-- Initializing flags --
sndflg=0 -- turbulence sound flag
seatfl=0 -- seat belt flag
ref=0 -- onground
-- 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("C:\\WideClient\\Sounds\\Turbulence.wav")
sndflg=1
ipc.sleep(1000)
if (seatfl == 2) or (seatfl == 4) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
end
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
end
if (value == 0) and (sndflg == 1) then
sound.stop(ref)
sndflg=0
if (seatfl == 2) or (seatfl ==4) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
end
end
function onground(offset,value)
if value ~=0 and sndflg ~=0 then
sound.stop(ref)
sndflg=0
end
end
end
-- Function to manage messages when seat belts sign changes - welcome on board -- descent --- on cruise ---- parked at the arrival gate
function seatbelt(offset,value)
if (value == 1) and (seatfl == 0) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\welcomeonboard.wav")
seatfl=1
end
if (value == 1) and (seatfl == 2) then
sound.play("C:\\Documents and Settings\\Delli\\Työpöytä\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\descent.wav")
seatfl=3
end
if (value == 0) and (seatfl == 1) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\levelautobelt.wav")
seatfl=2
end
if (value == 0) and (seatfl == 3) then
sound.play("C:\\WideClient\\Sounds\\nattend.wav")
ipc.sleep(1000)
sound.play("C:\\WideClient\\Sounds\\atgate.wav")
seatfl=4
end
end
-- Function to play ATC chatter - COM2 freqs 118.10 and 118.20 - 70 wavs for each freq - y var to make the frequency of chat random - x var to make the messages random
function ATC_Radio()
-- Radio squelch if a valid freq is selected
n = ipc.readUW(0x3118)
if (n == 0x1810) or (n == 0x1820) then
if (n1 ~= n) then
sound.play("C:\\WideClient\\Sounds\\Radio.wav")
n1=n
end
end
-- Radio chatter play routine
y= math.random(1,5)
if (y == 2) or (y == 4) then
if (n == 0x1810) then
x=math.random (1,70)
suono = "C:\\WideClient\\Sounds\\chatter1.wav"
sound.play(suono)
end
if (n == 0x1820) then
x=math.random (1,70)
suono = "C:\\WideClient\\Sounds\\chatter2.wav"
sound.play(suono)
end
end
end
-- FSUIPC LUA calls for the different events -- timer to exec the ATC function every 1 min
event.offset(0x0E88,"UW","turbulence")
event.offset(0x0E98,"UW","turbulence")
event.offset(0x341D,"UB","seatbelt")
event.timer(60000,"ATC_Radio")
event.offset(0x0366,"UW","onground")
------------------------------------------------------------------------
-
Pete, this is the script i try to add.
Of course, just test the on ground flag via an event, and stop the sound if it is playing. Add this to the code:
ref = 0
near the top , where the other variables are set, and this at the end:
function onground(off, val) if val ~= 0 and sndflg ~= 0 then sound.stop(ref) sndflg=0 end end event.offset(0x0366, "UW", "onground")
Regards
Pete
....and here is the lua, where that script goes. Turbulence sound dont stop, it continue even landed already. Can you please show how it should looks like. Sorry Pete but I dont get it right?
http://forum.simflight.com/topic/66922-turbulence-sound-atc-radio-chatter-lua/
-
Pete, i got it working, but sound still goes on and on (on ground). So i have try to add the script you write here earlier, but get always errors. This is my first time to trying with LUA-script, so am new of this. Is it possible to correct that script on Users Contributions to get it work like it should. Thank you.
Regards
Marco
-
Sound?
The offsets mentioned have not changed. Use logging to check.
Pete
Ok, so it cant be offsets, i have something totally wrong. Thanks Pete.
-
Okay. It wasn't too hard. In the process of working out what to do I also found that the facilities for those offsets in FSUIPC4 only worked for the lower three wind and cloud layers, owing to the way they are linked to the old FS98 facilities.
Versions FSUIPC 3.998p and FSUIPC 4.752 both include full support for offsets 0E84-0E88 for cloud data and 0E94-0E98 for wind data "at aircraft" no matter how many layers there are. Get the updates from the Download Links subforum.
Regards
Pete
Hi Pete, do 3.999 still have these offsets. I cant get sound out?
Regards
Marco
-
Okay. It wasn't too hard. In the process of working out what to do I also found that the facilities for those offsets in FSUIPC4 only worked for the lower three wind and cloud layers, owing to the way they are linked to the old FS98 facilities.
Versions FSUIPC 3.998p and FSUIPC 4.752 both include full support for offsets 0E84-0E88 for cloud data and 0E94-0E98 for wind data "at aircraft" no matter how many layers there are. Get the updates from the Download Links subforum.
Regards
Pete
Thank you very very much for your time and support Pete, you are Santa :razz:
Wish you relaxing and happy Christmas and new year.
Regards
Marco
-
I don't know. I'll take a look when I get time -- maybe next week. i have a lot of catching up to do after my holiday and I'm away this weekend too.
Regards
Pete
Hi Pete,
I know you are very busy, i just hope you havent forget this.
Thanks.
Regards
Marco
-
Hi all,
Is there way to make this work with FS9?
Most of cockpit builders use FS9 and goal is to use it with shakers or buttkickers.
Regards
Makoy
Touchdown voice to client?
in FSUIPC Support Pete Dowson Modules
Posted
I try to found offsets to touchdown, to trigger sounds on my client computer with sioc-script. Is there something i can use?
Cheers Marco