Jump to content
The simFlight Network Forums

EmileBax

Members
  • Posts

    6
  • Joined

  • Last visited

About EmileBax

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

Profile Information

  • Location
    Auckland, New Zealand
  • Interests
    FS2002, flight simulation in general, commercial aviation

EmileBax's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Er ... you mean you were only setting it the once, in the same plug-in? EB: Sorry, I didn't make that clear. The key I used for testing sent an ipcPARAM value of 0 to the plug-in. I interpreted the failure to work as being caused by ipcPARAM having a value of 0 as initialised, so no change being detected.. Yes, that's one way. But possibly easier altogether, if you only need up to 256 values, would be to use LuaToggle with flag numbers 0-256 and event.flag to provide the number -- instead of ipcPARAM. Since a toggle is ALWAYS a change, you need not assign anything to the release. EB: Thanks for that suggestion, I will put that in place. There's no point in compiling it as it is only loaded the once (I assume you are loading it via the [AUTO] facility in the INI file, or possibly from ipcREADY.lua?). Any event-based Lua plug-in stays resident once loaded unless it terminates itself or uses event.cancel to remove all outstanding event detection. EB: Ah thanks. Yes it is loaded from the [AUTO] section in the profile INI for the aircraft. Cheers, Emile.
  2. Hi Pete, Thanks ever so much for your quick response. But would you believe that I have found the problem ?! I had overlooked that (as stated in the FSUIPC Lua Library document, so no excuse :oops:) the event.param facility will call the function only when it detects an externally generated change in the ipcPARAM variable for the plug-in. And the way I tested it yesterday, did not effect a change in ipcPARAM (it kept it at 0 as that was the value I initially used for the test key) so nothing happened ! I changed the values that my keys throw at the plug-in, which fixed that issue. The only problem left, was the situation where two consecutive identical key presses would be required, e.g. when entering the code for my home airport NZAA in the Route page. The first A would work but not the second, unless I entered a different letter (e.g. NZAB), then pressed CLR to get rid of the B and then entered the second A. Too cumbersome, but I found a way around it. For each key command I added another LuaValue FS Control when the key is released, with a value that represents a dummy change in ipcPARAM but has no effect in the function. This works like a charm :). It may be worth compiling the plug-in so that it loads just that little bit faster because it is now loaded twice for each key press, but that's for another day. Sorry to have bothered you unnecessarily - it's getting close to Christmas and I do need a decent holiday :roll: Wishing you & yours a Merry Christmas and all the best for the coming year. Cheers, Emile.
  3. I want to use keyboard commands to operate the CDU of the PMDG 777 via a Lua plug-in. Via FSUIPC, each key command executes the LuaValue control for this plug-in but with a different parameter. The parameter values range from 0 to 68. The Lua plug-in called by the LuaValue control contains a function like this (with thanks to Günter Steiner for the source) : function PMDG777CDU() local CDUStartVar if ipc.readUB("66C4") == 0 then CDUStartVar = 328 else CDUStartVar = 401 end ipc.control(PMDGBaseVariable + CDUStartVar + ipcPARAM, 1) end The function is called by : event.param("PMDG777CDU") But when I press a CDU key command, nothing happens. When using ipcDebug, I notice in the log that the event is not triggered. So what am I doing wrong ? I do not like asking for help as I prefer to figure things out for myself, but at times I'm stuck and this is one of them. Any help would be much appreciated, thanks. Regards, Emile Bax Auckland New Zealand.
  4. Hi Peter, Works like a charm ! In fact I've managed to build a little test function to help me understand the logic behind it but the main thing is that I can now do what I wanted to do. You are very right as far as keeping on learning, regardless of age, goes. If I lived close enough I'd treat you to a pint or two. But since I live about as far away from the UK as possible, a very big THANK YOU :grin: will have to do. Regards, Emile.
  5. Hi Peter, Is there a Lua library function or other way with which I can test the status of one specific bit in a FSX offset ? I have looked through the FSUIPC document "FSUIPC Lua Library.pdf" as well as searched your forum and could not find what I wanted, though of course I may have overlooked something. Reason for asking : I have written a simple Lua plug-in which contains amongst others a function that writes ipc control 66239 to toggle the aircraft beacon on or off. The function is called by an event (toggle of a flag). I want execution of this function to be conditional upon the status of the beacon (i.e. bit 1 in offset 0D0C). With all other external aircraft lights off, 0D0C returns the values 0 and 2 for beacon off and on respectively, and my function works if I test for 0D0C=2. However the returned value of 0D0C for beacon on will not be =2 if other external lights are also on. That's why I would like to read the value of bit 1 (as well as a few other bits such as those for the strobe and landing lights). I only started working with Lua less than two years ago and at my age (60), learning new things doesn't come as easy as it used to so please bear with me if my question is a bit basic. Many thanks in advance for any hints, and for your invaluable creation FSUIPC. Regards, Emile.
×
×
  • 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.