Jump to content
The simFlight Network Forums

cjois

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by cjois

  1. Pete, please help me with this a little bit. I am not sure i understand it. What is a "Reload" button? A button setup to force a scan? If this is indeed the case, let me try it. That will ease some of the pain. Of course, the power of being able to debug complex logic via an development environment where once can use callstacks, breakpoints, variables watches is always better, but i dont want to trouble you with more work. One way i thought you could provide your libraries without giving it away in full is provide user libraries containing only function call stubs in it. That way the compiler will have the function available and wont throw an error. Yes, full scale debugging wont be possible but one will at least know if the script compiles correctly. Just a thought... will think more about it tonite. On the other hand, please do help me with the "reload" you referred in your post. That should ease a lot of the pain. I am not using FSUIPC4 - i am on 3.9. As always, many thanks. Regards, CPJ
  2. Pete: You are absolutely right. The messages are the same. Perhaps the only reason I am even wanting to do this via an development environment is because some of my Lua programs are long and with complex logic. For example, i wrote my own EGT gauge simulation that i use to drive a phidgets servo. It works well. But to get that done I had to load and exit MSFS several times becuase of the number of errors that would creep or changes i would need to make. The reason for that being the case is that changes made to Lua scripts are not recognized by FSUIPC till it loads afresh. So i have to exit MSFS and reload each time i make a change. Thats why i wanted to do the compiles outside and ensure everything works before i even load them up the first time. Dummy libs will be a great help. regards, Jois
  3. Pete - Thanks. Here is my situation - I am trying to compile my lua scripts before i place them in the FS Modules directory so that i can check for syntax and logic correctness. However, the compiler - luac.exe - throws an error each time it encounters, for example, an ipc.macro() call - and I think i understand why - its because the ipc.macro() function is not a part of the core lua implementation. Its looking for the ipc libraries in this case. Hence my earlier question of where I could access them. I understand that for the runtime, those libraries are already included in your FSUIPC implementation and i dont need to do anything else to use them. Your help is much appreciated. regards, CPJ
  4. Have found much use for Lua programs. Have been creating them creating them using Notepad. Just got an standalone Development tool to help with creating them. Looking for the 3 libraries - ipc, event and logic - so that i could add their location to the tool's settings and the compiler is able to find them. Where can i find those libraries? Thanks in advance.
  5. Thank you Sir. Will watch for the announcement. But will also follow your instruction to put everything into a lua file. Indeed its a cleaner approach. Best regards, CPJ
  6. Pete: Aha! I saw that and knew it had something to do with this. But didnt have the light go on in my head as to how. I am smiling when i write this... didnt really mean missing it in the pdf... but more to mean that my brain doesnt seem to reading it right.... missing the point in my head! - like this :? In any case... i SEE IT NOW - coming across loud and clear, my dear friend. Someday i promise to impress you with my programming. :D Since you mention ipc.macro, i have a related quesiton. I am clear that one can call a macro from a lua script. But can we call a lua script from a macro. Tried it yesterday - didnt work. Here is the situation - I have a mouse macro in my MIP Macro file. It performs a Autobrake switch decrement 5 times to bring to RTO position. This works fine. At the end of the 5 calls to decrement the switch, i ADDED another line to call a lua script. The lua script is to turn on the Autobrake Disarm annunciator ON for 3 seconds. The same one you helped with me with yesterday MyLight.lua with the following code - ipc.writeUB(66C0, 1) ipc.sleep(3000) ipc.writeUB(66C0,0) The switch decrement worked but the call to the lua script didnt work. I know that macros can include both mouse macros and keyboard macros. Cant lua calls be a part of a macro? Here is the additional line i added to the macro - 3.6=CL2:R,1 Thanks in advance.
  7. Pete: I have read that document multiple times since yesterday. I re-read that section again now. I cant see where it speaks of the manner in which lua scripts are loaded. I am missing it. I will rephrase my question - Are lua scripts loaded on demand by FSUIPC - Example - a button press occurs and the button is tied to the lua script. OR Does FSUIPC load all lua scripts on startup? - In this case i wouldnt need to do anything extra to get my event monitor script running. All i meant to understand was your use of the term 'pre-loaded' in that post. Here is the entire script - -- This is a lua script to set Autobrake Disarm indicator based on Autobrake Switch Status and Brakes Control -- Autobrake Disarm Annunciator is tied to Offset 66C0 -- Brakes control is FS Control 65588 -- Autobrake Physical Switch is connected as Virtual Button 64,0 -- March 15, 2009 function BrakeApplied(controlnum,param) statusofvirtualbutton = ipc.testbutton(64,0) -- get the status of virtual button 64,0 -- If Autobrake Switch (64,0) - Autobrake 1 - is ON AND Brakes Applied Control 65588 is received -- then set Offset 66C0 to 1 if (controlnum == 65588) and (statusofvirtualbutton) then -- set offset 66C0 to 1 ipc.writeUB(0x66C0,1) end end -- Start monitoring event.control(65588, 256, "BrakeApplied") Best regards, CPJ
  8. Pete: I wrote up a small piece of code to perform event monitoring of the 'Brake Axis". Its basically - event.control(65588, 256, "BrakeApplied") [its only my second lua script, so hope I got that correct] Since this is an 'event monitor'-type script, I want this to be pre-loaded upon start up of FSUIPC. Was researching the forum to find out how and i came upon this where i see you mention the word 'preloaded'. How does one 'pre-load' a lua script? The previous ones i used were all triggered by a button-press or key press, so i picked them from the dropdown. But in this case i want it loaded when FSUIPC comes up and wait for a brake event to occur. Is this something that is automatically done - that when FSUIPC comes up, it reads all the .lua scripts in the Modules folder and loads them - or do i need to explicitly 'pre-load' scripts like this one? Best regards, CPJ
  9. Thanks Pete. Your work and insights are invaluable. Will try it out tonight and post my results here. P.S: Did some pretty good use of Compound Button programming over the past few weeks. Very happy with what i was able to achieve. Immensely grateful. Best regards, CPJ
  10. I am using one of the available FSUIPC offsets to light up an annunciator. I use a switch to set a value in that Offset. I want to keep that annunciator lit up for a small period of time (say 5 seconds). And then set the offset value back to 0 - thereby turning the annunciator off. The switch however continues to stay on. With FSUIPC's extensive facilities (I learn newer ways of using it each day i use it!) Is there a way to do this without resorting to writing a program? For example - say a timer facility within FSUIPC that i can use to reset the offset value? I can also see a situation where based on a timer, I can increment the value in an offset. Any suggestion would be much appreciated. Thanks in advance. Regards, CPJ
  11. Pete: Thanks for confirming that. I am looking at the add-on overhead. Since PMDG doesnt give out much about thier inner workings i posted here to see check on a couple of things - a) if I was using the wrong search terms and wondered if they were called something different. I guess not. b) Since APU EGT is not itself simulated in FS 2004, if there was a different way to extrapolate APU EGT by reading something that is actually simulated in FS. Guess not, once again. Appreciate your response. Have a great weekend. Best regards CPJ
  12. I use MSFS 2004. I did perform a search on the PDF titled "FSUIPC for programmers" and couldnt find any offsets for APU EGT, Duct Pressure, Cabin Climb. I did find the offsets you mention - 0318-0328 - in the "FSUIPC Offsets Status" document. However, I understood that to be specific to FSX only. Duct Pressure - its the gauge on right-side of the overhead on the 737 - just below cabin climate control panel. I guess these were never modeled in FS2004. Thanks Pete. Best regards, CPJ
  13. I was writing to check if there are offsets for APU EGT, Fuel Temp, Duct Pressure and Cabin Climb. I looked through the FSUIPC offset table in the SDK and couldnt find it. I guess I am searching using the wrong term - unless, of course, there arent any offsets for those entities. Any help will be appreciated. Thanks in advance. CPJ
  14. Pete: IT WORKED!!!! I cant tell you how grateful i am. This has nagged me all week at work, at home and late into the night. You have made my weekend. I sincerely hope i can return the favor some day. I tried with a paddle switch. I will try it with a 8 pos rotary selector for the autobrake later tonite. MANY THANKS. Best regards,
  15. Am trying it right now... will let you know. Depending on whether i specify one of the options in "Operation" - such as Set Bit or Set Value etc - it provides a field on the screen to accept the bit or value. Yes it also asks for whether its Byte, Word, LongWord, ShortInt, LongInt or Float64. Which one should I be using? I am very grateful for your help. Best regards,
  16. Pete: Thanks very much. First it asks for which offset. Then the Operation - it provides the following options - Decrement value Increment value Clear bit Set bit Set bit then reset Set value Set value then zero Toggle bit ------------------------------------ Also - before i setup this offset and operation in the sys3 utility, i have to setup the virtual button somewhere, right? Where do i do that? Is it in the FSUIPC INI file? Thanks once again. Best regards,
  17. I am trying to wire the 737 OHD. I have developed the mouse macros for doing so. I have also tested them with keyboard assignments. I want to use virtual buttons to call them from the interface card i use (SYS3 from FDS). I need help with 2 things - a) How does one set up virtual buttons? I understand that i can have upto 288 of them (more than enough for the OHD) and from what i have read my understanding is that these virtual buttons can be 'triggered' by writing to the 3340 FSUIPC Offset. I must confess that i am not completely clear on how to use the 3340 offset. b) How does one invoke these virtual buttons from an interface card utility? is it via writing to the 3340 offset? My interface card utility allows me to setup FSUIPC "writes" when a physical switch is wired to it and performs an action. Any help will be much appreciated. Thanks very much in advance. Best regards, CPJ
×
×
  • 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.