August 7, 20196 yr Hi all, This code what I wrote is all about getting an alarm to sound when the fuel reaches a certain value of emptiness, i.e. at 47 gallons. But it ain't working. It is not my intention to assign it to a button. It resides in the actions.lua file for the specific aircraft. The sound file resides in the fsx/sound folder: -- Fuel Alarm -- function Fuel_Alarm() if ipc.readLvar("A:FUEL_TOTAL_QUANTITY, gallons")==47 then alarmf=sound.play("BingoFuel") sound.adjust(alarmf, 100) end ipc.sleep(50) end So far, all my coding that I've assigned to button/switches are working so where have I gone wrong chaps? Thanks in advance, D P.S. If anyone has any idea why my landing lights work but do not illuminate the ground texture in FSX SE, I would love to know.
August 11, 20196 yr If you are not assigning your Fuel_Alarm function to a button or switch then how are you calling it? Chris. Christopher Bell.
August 12, 20196 yr The code looks good but again how are you calling it? might work better if you make it an LUA file and place it in the modules folder. Aircraft lights illuminated ground option checked in Fsx settings? Luke Pype
August 15, 20196 yr The function will only trigger when the fuel quantity is exactly 47. This is unlikely. Use <= instead. When developing functions in LINDA editor you can call them by right-clicking on the function name. You will see a notification in the top line as you do this. It is not necessary to assign functions to buttons to test it. Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
August 15, 20196 yr <=47 Does that mean “less than or equal to” 47 ? thanks Edited August 15, 20196 yr by MaDDogz Luke Pype
August 15, 20196 yr == equal to <= less than or equal to >= greater than or equal to ~= not equal to Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
August 19, 20196 yr Author Hi all, Sorry for the delay in saying thank you for your help. To answer ccb777, the code resides within a function triggered by a fuel pump switch. Fuel pump is switched on by a .lua function in the action file and then the 'fuel alarm' code sits in the same actions file. I thought the .lua would just keep running so the code would test the fuel level all the time. But it ain't working. However, at least now you guys think the code is good, I'll look elsewhere. Thanks all! D
August 19, 20196 yr Well , if it ain’t working then I certainly can’t help you as you have failed to state whether you made changes to the code, as stated above, or not. No time to ask twice...sorry. Luke Pype
August 20, 20196 yr Apologies for being a bit hot headed with last reply. using Linda tracer, does ("A:FUEL_TOTAL_QUANTITY, gallons") ever give a value of 47 or below? also I’m not sure on the (“A...........gallons”) have you tried removing the quote marks, so (A:.........gallons)? Luke Pype
August 24, 20196 yr Author Thanks for the clues guys, I'll have a look at these suggestions and see what happens. Don't worry MaDDogz, we all have our moments... Just ask my ex!
Archived
This topic is now archived and is closed to further replies.