Jump to content
The simFlight Network Forums

Steve Johnson

Members
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Steve Johnson

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi. When I used math.floor(30.0000) as a test, it returned 30. As soon I replaced the number with my variable it would only return to a double floating point 64 type. Your function worked perfectly. Thank you very much for you help. Regards Steve
  2. Thanks for your reply. I will try this out at the weekend. Regards Steve
  3. Hi Peter, my Lua programming has hit a wall. I have installed a home made GEN AMP stepper instrument which operates from an offset. I can easily set it up to work from an FSX offset 2888. However I am using an add on for the aircraft which gives a much more accurate reading and simulates much more of the electrical system. I know how to read from the add on programs local variables in Lua and to write to a custom offset. I can read from from the add on program and write it to custom offset using ipc.writeDBL and display it to the screen through FSUIPC. i.e. 30.0000. The problem I have is that I have used all of the custom offset range right through to 66FF and I only have one offset available. The value range represented by the internal variable I am reading from is only 0 - 30, but it is stored in a floating point 64 type variable which uses 8 bytes or 8 offsets. My question is, is there a way to extract the value and convert it to one byte with the value been within that range (no need for fractions)? My plan B was to manually convert by writing ipc.readDBL(0x2888,myVariable) If myVariable = 30.0000 Then myVariable = 30 ipc.writeUB (0x66D4,myVariable) but this did not work :( Any help would be greatly appreciated. Regards Steve
  4. Hi Pete, I have applied the interim update and it is now working fine, Thanks for your help.
  5. Hi Pete, I have been trying to play a 2 second wav from a Lua script (it's for the stall test switch) and I am getting an error with the ipc.debug program on the line where I have used the sound.play. I have searched through the pdf manuals with the keyword sound but I have not been able to find anything. This is the code that is causing the problem, sound.play("c:\\sounds\\stall.wav") ipc.sleep(3000) The wav file is at this location: C:\sounds\stall.wav ipc.debug writes this to the log file: 2940448 *** LUA Error: ...es\Microsoft Flight Simulator X\Modules\MW_Panel.lua:29: attempt to index global 'sound' (a nil value) 2940448 LUA: ended "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\MW_Panel.lua" 2940448 System time = 23/03/2011 20:07:31, Simulator time = 20:07:47 (20:07Z) ********* LUA execution terminated: Log Closed ********* As always, any help would be very much appreciated
  6. Hi Pete, Thanks for the information. The aircraft is a King Air 300. Steve
  7. Hi Pete, I have a problem with my sim aircraft where the toe brakes or parking brake do not hold the aircraft, sometimes even at idle with a strong wind. I would like to implement a Lua script which does the following, If the parking brake is on save the current brake parameters to a variable Change the brake parameters to the maximum possible braking If the parking brake is off Restore the brake parameters from the stored variable Any help would be greatly appreciated Steve
  8. Hi Pete, I have now done everything I wanted to do with a Lua script. When a light on the master warning panel is triggered, the “master warning” lights up. I can reset the master warning which remains off unless the panel is triggered again. I understand now that I can write to L:VARS without the need for custom xml gauges. I am delighted with this result. The ipc debug script that you have included with your plug-in examples came in very useful for a Lua beginner. I am very grateful for FSUIPC. THANK YOU Steve
  9. Hi Pete, I was using the custom gauge just as a test. I am using an add-on aircraft that does not allow certain critical switches to be operated in the VC cabin by FS or offsets. I got around this by using some custom gauges. What I am trying to do now is quite different. There is a master xml file which seems to be the core program for the aircraft. I can see how the program logic is controlling the pressure system, caution lights etc. I want to be able to communicate between this code and an offset. There are L:vars used in the code but I do not know if these can be accessed by FSUIPC or a lua script? Thanks
  10. Is it possible to call a Lua script from an XML file? Thanks
  11. Hi Pete, I am trying to change the value in offset 66C0, so that I can make a LED switch off or on when it's value changes. Using InterfaceIT(flightdecksolutions input\output board controller) I can make a LED light up when programmed to trigger on the value 66C0 = 0, Data type - byte. I am trying to change the offset's value when a switch is pressed. I have used a switch which has a custom gauge that is already performing a different operation on a key press. I have simply added the ipc.write command a line below my other instruction which is an L:Var variable change . I have used the FSUIPC logging facility to monitor the offset and I can see that the value is not changing. This is the line I have added to the XML file, ipc.writeUB(0x66C0, 1) Any help would be very much appreciated Thanks, Steve
  12. Hi Pete Thanks for your replies. I have been reading up on the Lua programming language and it is very impressive, I understand now that it is the fastest scripting language used in the gaming industry. I will do as you have suggested and see if I can knock together a script. I have got some of my leds working via a rather crude method of setting a test offset value when a switch is turned on and then using the same test offset value to activate or deactivate a led. How do the user offsets work, all I have seen so far are the program offsets. Is there a range where we can assign offsets ourselves? Thanks
  13. Hi Pete, In InterfaceIT, I can select the LED I want to control and then I select the FSUIPC offset where it allows me to select the offset and a value o bit. For example, I have a LED which switches off when the FUEL press is no longer zero. To do this I selected the offset for Fuel Press and then VALUE OFF 0. It is very limited for logic. LUAs seems the best way to go. I did read your manuals but I have not grasped the potential with LUAs. Just reading another post here, I understand there are already some LUA scripts available in the FSUIPC addon? In my previous post, where I said programmed, I shoud l have said assigned. Regards Steve
  14. Hi Pete, Thanks for your prompt reply. I am sorry for being ambiguos. Yes I am using FSX SP2. "Interface IT" is a program that comes with the input\output interface cards from flightdecksolutions. The program allows you to manipulate FSX via different methods, SimConnect, send key strokes, FSUIPC offsets, SimAvionics, PMS etc. For controlling the physical switches I have connected to the interface board (FDS SYS 64\128) I have used SimConnect and FSUIPC offsets. I have also programmed some offsets with your FSUIPC addon in FSX and then sent the appropriate keystroke from the interfaceIT program. With my set up I can only control the LEDS with FSUIPC offsets. The program monitors the status of an offset and then switches the LED on or off accordingly. So my questions are actually for FSUIPC.
  15. Hi Pete, I am building a King air 350 cabin and I have already used your FSUIPC interface to resolve many switch and LED actions. At the moment I am close to finishing the warning annunciators and I am down to the last two LEDS which I am stuck on. The first one is the Cabin_Alt. This should trigger at and beyond 12500 ft. I have found the offset 0318, Pressurisation cabin altitude at present. I presume that by setting InterfaceIT to trigger on the value 12500, that the led will flicker on and off as the cabin pressure increases to 12501. I could use a range say 12500 to 35 000 but I am not sure how to do this. The other LED is the Cabin_Dif. I would like it to trigger when greater than 144 \ 6.6, but I do not how to go about this either. Any help would be greatly appreciated. Regards Steve
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.