Pieter Posted November 10, 2012 Report Posted November 10, 2012 Dear Pete, again i come to ask the flightsim Guru for advise :) It has not really anything to do with your products , but just flightsim in general. I want to have an alert (.wav) when hitting 10.000FT. ALWAYS so in climb and descent ...you think that is possible? I tried 1001 things already but can't get it.... the only thing i came across with is Project Magenta sounds they have it,... i'm not really into PM so would be nice to just have FSX command in CFG or something which i can add in to any aircraft i want JUST the 10000FT alert hope you know how to do this??? greets, Pieter
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 just want to add one more thing, regarding a problem i said occurred with wideFS... if i'm running wideFS on client pc, and i plug in and after use out a external HDD ...the wideFS fails strange hey :)
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 I want to have an alert (.wav) when hitting 10.000FT. ALWAYS so in climb and descent ...you think that is possible? Yes, easy enough with a small Lua plug-in program which reads the altitude and plays a wave when needed. Check out the Lua facilities documented n your FSUIPC Documents folder (in the FS Modules folder). Do you want true altitude AMSL, or the atimeter reading 10,000? I assume the former?: prevalt = -1mark = 10000 / 3.28084 --10000 feet in metresfunction check10000(off, val) if (val >= mark) and (prevalt < mark) then sound.play("name of climb wave file") elseif (val <= mark) and (prevalt > mark) then sound.play("name of descend wave file") end prevalt = valendevent.offset(0x0574, "SD", "check10000")[/CODE]Something like that anyway. You might want to tweak it a little to avoid it going off continuously when wobbling about near 10000. And you might want it to start a little below/above 10000 to allow for any small delay in activation. Also of course fill in the names of the wave files you want to play (which should be in your FS Sound folder).Save that as, say, "alert10000.lua" into your FS Modules folder and add this to your FSUIPC INI file[Auto]1=Lua alter10000RegardsPete
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 just want to add one more thing, regarding a problem i said occurred with wideFS... if i'm running wideFS on client pc, and i plug in and after use out a external HDD ...the wideFS fails Sorry, I've no idea what you are talking about here. Can you explain what you mean by "i plug in and after use out a external HDD"? What does that mean, it makes no sense as it stands. What is running where and what is it doing? What is the "failure"? What do the logs show? Obviously if you remove or change something whilst it is use you are asking for trouble -- corrupted files included. Pete
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 hey Pete, thanks for the QUICK response again... so if i'm getting you right ... i name the .wav file "10000FTalert.wav" AND enter this file into the FSX sound folder.....next i copy past (in notepad): prevalt = -1 mark = 10000 / 3.28084 --10000 feet in metres function check10000(off, val) if (val >= mark) and (prevalt < mark) then sound.play("10000FTalert.wav") elseif (val <= mark) and (prevalt > mark) then sound.play("10000FTalert.wav") end prevalt = val end event.offset(0x0574, "SD", "check10000") AND SAVE this as .lua into FS Modules folder AND just add into FSUIPC4.ini folder [Auto] 1=Lua alert10000 ===================> should it not be 1=Lua alert10000 ???? YES of course ... typo! THAT SHOULD BE IT??? yes indeed want 10000FT altimeter reading .... it can be just on 10000FT doesn't need to be that exact So am i right in doing all this? In FSX should i activate something? AND see in the text file were it said "fill in name of sound file" do i have to use the extension? greets, Pieter regarding other problem i wil get back to you about that
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 yes indeed want 10000FT altimeter reading .... In that case you need to change things -- offset 0574 gives the true AMSL reading. The altimeter reading is in 0x3324 and is in feet (unless you have FS running in metric altitude mode). So it would be: prevalt = -1mark = 10000function check10000(off, val) if (val >= mark) and (prevalt < mark) then sound.play("10000FTalert") elseif (val <= mark) and (prevalt > mark) then sound.play("10000FTalert") end prevalt = valendevent.offset(0x3324, "SD", "check10000")[/CODE] [color=#666600]In FSX should i activate something?[/color] Like what? What for?AND see in the text file were it said "fill in name of sound file" do i have to use the extension?No. ".wav" is assumed. you can include it if you really want to though.Pete
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 the other "problem" is: FSUIPC ELIMINATOR has stopped working and Wideclient needs to shut down? ======> this occurs when i plug in an external hard drive, use it and then plug it out ALL when Wideclient is running. Not that its major problem...but just find it strange that it does that
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 so basically this is it prevalt = -1 mark = 10000 / 3.28084 --10000 feet in metres function check10000(off, val) if (val >= mark) and (prevalt < mark) then sound.play("10000FTalert") elseif (val <= mark) and (prevalt > mark) then sound.play("10000FTalert") end prevalt = val end event.offset(0x0574, "SD", "check10000") SAVE IT AS LUA file in MODULES ...then just add into FSUIPC.ini [Auto] 1=Lua alter10000 and i'm good to go?
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 FSUIPC ELIMINATOR has stopped working and Wideclient needs to shut down? And what does the Log show? What is WideClient being used for at the time? ======> this occurs when i plug in an external hard drive, use it and then plug it out ALL when Wideclient is running. Not that its major problem...but just find it strange that it does that If that drive intended to be hot-swappable? Is there something on it which might be relevant to whatever you are having WideClient do? If the Wideclient log shows nothing wrong, check the Windows event log. It will tell you the module which crashed -- probably something to do with the network or at least hardware level drivers. Maybe the Windows hardware plug-and-play scanner messes up the network connection module when it is forced into action. Pete
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 so basically this is it No. See my last post. The original is for AMSL -- you wanted Altimeter, you said. And the filename of the Lua file must match of course, be it "alert10000.lua" or "alter10000". You could name it "typo.lua" if you want, but match the command to load it ... of course. and i'm good to go? Wouldn't it be rather quicker to try it rather than post all these queries on every point? I'm not going to test it for you. If it doesn't work THEN ask questions, or refer to the documentation. Pete
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 okay Pete sorry for the confusion...i'm testing it now will let you know thank you so much in advance
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 just tested it Pete didn't work i did everythng according you said ... made a .lua file ...saved it in modules folder ...entered he lines into .ini folder and the .wav file in fsx sound folder i atached a picture any idea?
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 just tested it Pete didn't work Use Lua logging to see what is happening. See the FSUIPC logging tab (Debug/Trace Lua option). i atached a picture What for? How can you expect me to read that minute fuzz? Please do NOT add screen pictures, they are almost always a complete waste of time as that one certainly is, more so that most. can YOU actually read anything there? Pete
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 BTW it works perfectly here, though I changed the wave file to "CabinAlert" as i don't have yours. So, I'm pretty sure that you are making a mistake. Pete
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 tought you could save the picture and zoom in.... the log says ....waiting for event....i took off and climed to 12000FT ,without result 117203 System time = 10/11/2012 17:04:49, Simulator time = 02:03:05 (01:03Z) 117203 LogOptions changed, now 80000000 00000001 174658 Sim stopped: average frame rate for last 48 secs = 13.0 fps 216326 LUA.0: Offset Change event: calling "check10000" in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\alert10000.lua" 216326 LUA.0: Waiting for an event in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\alert10000.lua" 234766 LUA.0: Offset Change event: calling "check10000" in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\alert10000.lua" . . . . . 383747 LUA.0: Waiting for an event in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\alert10000.lua" 383840 LUA.0: Offset Change event: calling "check10000" in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\alert10000.lua" 383840 Sim stopped: average frame rate for last 55 secs = 9.4 fps 383840 LUA.0: Waiting for an event in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\alert10000.lua" [Log closed by user request, and continued in new file] 404370 System time = 10/11/2012 17:09:36, Simulator time = 02:06:47 (01:06Z) 404370 *** FSUIPC log file being closed Average frame rate for running time of 231 secs = 11.6 fps G3D fix: Passes 19719, Null pointers 0, Bad pointers 0, Separate instances 0 Memory managed: 59 Allocs, 56 Freed ********* FSUIPC Log file closed *********** my lua file is: prevalt = -1 mark = 10000 function check10000(off, val) if (val >= mark) and (prevalt < mark) then sound.play("10000FTalert.wav") elseif (val <= mark) and (prevalt > mark) then sound.play("10000FTalert.wav") end prevalt = val end event.offset(0x3324, "SD", "check10000")
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 i used same cabin alert sound and it works also
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 216326 LUA.0: Offset Change event: calling "check10000" in "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\alert10000.lua" I see you allowed FS to install in the Protect Files area of the Windows folders. That means your "sound" folder will be write-protected. In order to put your WAV file in the REAL folder (the one FSUIPC can access) you need to run Explorer "as administrator". I suspect your sound file isn't there. Your logging looks wrong too. With the Debug/Trace option se and the exact same Lua program except with the WAV file name changed I get these entries: 40592 LUA.0: beginning "E:\FSX\Modules\Alert10000.lua" 40592 LUA.0: E:\FSX\Modules\Alert10000.lua:1 40607 LUA.0: Global: ipcPARAM = 0 40607 LUA.0: E:\FSX\Modules\Alert10000.lua:2 40623 LUA.0: Global: prevalt = -1 40639 LUA.0: E:\FSX\Modules\Alert10000.lua:11 40639 LUA.0: Global: mark = 10000 40654 LUA.0: E:\FSX\Modules\Alert10000.lua:4 40670 LUA.0: E:\FSX\Modules\Alert10000.lua:13 40685 LUA.0: Waiting for an event in "E:\FSX\Modules\Alert10000.lua" and then this for every altitude change it registers: 103070 LUA.0: Offset Change event: calling "check10000" in "E:\FSX\Modules\Alert10000.lua" 103070 LUA.0: E:\FSX\Modules\Alert10000.lua:5 103086 LUA.0: Local: val = 352 103101 LUA.0: E:\FSX\Modules\Alert10000.lua:7 103101 LUA.0: E:\FSX\Modules\Alert10000.lua:10 103117 LUA.0: E:\FSX\Modules\Alert10000.lua:11 103133 LUA.0: Global: prevalt = 352 You can also log the Sound actions by adding these lines to the INI file [general] section before starting FS: Debug=Please LogExtras=x20 Here's the result then as I pass 10000 climbing: 195282 LUA.0: Offset Change event: calling "check10000" in "E:\FSX\Modules\Alert10000.lua" 195282 LUA.0: E:\FSX\Modules\Alert10000.lua:5 195298 LUA.0: Local: val = 9998 195298 LUA.0: E:\FSX\Modules\Alert10000.lua:7 195314 LUA.0: E:\FSX\Modules\Alert10000.lua:10 195329 LUA.0: E:\FSX\Modules\Alert10000.lua:11 195329 LUA.0: Global: prevalt = 9998 195345 LUA.0: Offset Change event: calling "check10000" in "E:\FSX\Modules\Alert10000.lua" 195345 LUA.0: E:\FSX\Modules\Alert10000.lua:5 195360 LUA.0: Local: val = 10000 195360 LUA.0: E:\FSX\Modules\Alert10000.lua:6 195376 Sound: Id 1, PlayNow("CabinAlert") 195376 Sound: Id 1, PlayTheSound("E:\FSX\Sound\CabinAlert.wav") 195407 LUA.0: E:\FSX\Modules\Alert10000.lua:10 195423 LUA.0: E:\FSX\Modules\Alert10000.lua:11 195423 LUA.0: Global: prevalt = 10000 So, you need to cross-check everything. Pete
Pete Dowson Posted November 10, 2012 Report Posted November 10, 2012 You can put the WAVe file in a different folder, where Windows isn't getting in your way, and provide the complete path in the Play command, so, for example: sound.play("E:\\MySounds\\10000FTalert") Note that you must use \\ to represent one \ as \ is used as an escape to include special characters like \n for 2new line". Pete
Pieter Posted November 10, 2012 Author Report Posted November 10, 2012 its working OMG pete you the man thank you soooooooo much
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now