-
Posts
320 -
Joined
-
Last visited
-
Days Won
17
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by spokes2112
-
Whoah!! This may be much tougher than thought. The actual AP panel gauge is in XML but is compiled in SimPropBinary. (*.spb) Inside this .spb are XML style calls to a macro eg. @MacroName, which are slightly exposed, and in some cases, very, very important! Also, there are XML style "C" calls to an external Carenado module eg. (C:<module name>:<variable>) Attempting to use L:Var macros or direct FS Controls, in most of the cases, will be overridden by the autopilot gauge itself. About the only thing I can think of doing for a hardware interface is to transpose the exposed code from the spb to a xml gauge then accept L:Vars thru FSUIPC L:Var macros as the trigger instead of a mouse gesture. Trying a few things out.. Roman
-
Been looking at this one, off & on with the morning coffee π This one may take a little more than just a L:Var Macro, either a support XML gauge w/ L:Var Macro -or- Lua should do it. The thing about VS hold in flight sim ( since FS2002 ) is that the supplied VS Hold commands never worked. Designers have been using altitude hold and background logic to make their own & separate the actual ALT hold from VS hold in this logic. BTW - It seems all those L:Vars have nothing to do with the actual control of the VS hold in this aircraft, more so that they are there as an interface between the C++ AP gauge and the animation/displays in the VC. Here's what should ( seems reasonable ) be done to have a hardware interface for the VS hold mode. Note, at the time of engagement the "current" VS is put into the command AP_VS_VAR_SET_ENGLISH. Roman
-
In the 850xp this L:Var has 3 values : 0 = Batt 2, 1 = Normal, 2 = Batt 1 Using 2 buttons, the left click can be : #=L:ASD_SWITCH_ISOLATE_850XP=Inc,2 then the right click can be : #=L:ASD_SWITCH_ISOLATE_850XP=Dec,0 Save a button! π π Just make 1 button cyclic : #=L:ASD_SWITCH_ISOLATE_850XP=Cyc,2 Ref - Pg. 43 FSUIPC for Advanced Users.pdf Hope this helps, Roman
-
Doubts after 2 weeks of FSUIPC & LUA scripting
spokes2112 replied to Federico's topic in FSUIPC Support Pete Dowson Modules
event.offsetmask ... missed that one too π’ -
Doubts after 2 weeks of FSUIPC & LUA scripting
spokes2112 replied to Federico's topic in FSUIPC Support Pete Dowson Modules
0x0D0C is a 16 bit word if you want to get all the lights. 2 function examples below, "getTaxiLights1" is run by the timer, "getTaxiLights2" is run on first load & anytime there is a change at offset 0x0D0C. The last is the preferable method. function getTaxiLights1(time) tL = ipc.readUW(0x0D0C) tL = logic.And(tL, 8) -- Taxi lights are on bit 3, therefore the mask is 8 if tL == 8 then -- Taxi Lights are on else -- Taxi Lights are off end end function getTaxiLights2(offset, value) value = logic.And(value, 8) -- Taxi lights are on bit 3, therefore the mask is 8 if value == 8 then -- Taxi Lights are on else -- Taxi Lights are off end end event.timer(2000, "getTaxiLights1") -- call function #1 every 2 seconds event.offset(0x0D0C, "UW", "getTaxiLights2") -- call function #2 whenever 0x0D0C changes, also on first load Hope this helps, Roman -
VAS Log tape readout numbers
spokes2112 replied to Donet's topic in FSUIPC Support Pete Dowson Modules
Perhaps the "log tape" means logging to title bar or to a "green line" display. In any case the VAS number is in kilobytes - 024C Available FS memory in kilobytes (updated every 10 seconds) That is.. If 024C is used. Other memory outputs ( from FSUIPC# Offsets Status.pdf ) 0258 Memory currently assigned to FSUIPC4 (including WideServer) This is in Bytes. 0290 Maximum available FS contiguous memory block in kilobytes (updated every 10 seconds). Roman -
Cannot get IPC.ASK to work
spokes2112 replied to Emile B.'s topic in FSUIPC Support Pete Dowson Modules
No clue on this one. Perhaps the errors below fail the whole lua. IIRC the ipc.ask() returns a string so you could do this 1 of 2 ways - 1) Put this line under ipc.ask() and change your comparison signs in the then following line from = to == & you should be good the rest of the way : doors = tonumber(doors) -or- 2) Change the following 2 lines to first, test against a string & correct the comparison signs, and second, to convert to number for ipc.setbits if doors == "1" or doors == "2" or doors == "3" then -- check input is valid ipc.setbitsUB(0x3367, tonumber(doors)) Hope this helps, Roman -
Was thinking of this too, perhaps easier than lua? While not using throttle position exactly, it relies on the "effect" of throttle position --> speed. Assign the axis to both Rudder & Nose Wheel Steering and then use the .ini parameters MaxSteerSpeed=<speed> and optionally RudderBlendLowest=<speed>. ( In advanced users .pdf ) Roman
-
Issues with joynames after removing device
spokes2112 replied to Pilot1801's topic in FSUIPC Support Pete Dowson Modules
Just an idea I've read about, I have no experience. Have you tried reflashing the Bodnar boards using alternatively named .bin files? On this page at the Bodnar site, it states : " The serial number is unaffected by any firmware change however each renamed device is given a new ProductID (PID). " With 2 of the same boards with 2 unique ProductIDs and 2 unique serial numbers maybe Windows wont get so confused. The link above is also referenced in each of the BUO836X product pages in the "Product Downloads" tab. Again, just an idea. Roman -
Pete, Just some early morning theory with the coffee )) I think it's because FSUIPC picks up the first 32 buttons, correct? In this line * all * the buttons are picked up but we only need the ones * not * picked up by FSUIPC to be placed into the VJ offsets. buttons[1], buttons[2], buttons[3], buttons[4], buttons[5], buttons[6], buttons[7], buttons[8] = com.GetHidButtons(dev, CurrentData) So with that, if true, "i" should equal 2 starting the loop. Again just a theory, you 2 are the masters! π
-
Pete, In the demo, i = 2 to begin with, skipping the first 32 buttons picked up by FSUIPC, therefore ipc.writeUD(0x3340 + ((i-1) * 4), buttons["eye"]) -- "eye" = i, the forum picks it up as italic formatting will yield 0x3344 as the first address used. No biggy, excellent demo lua! Never looked at it before.. Now what can I do with it here? lol Roman
-
Morrispe, Using the HIDDemo as is for both devices will never work. It is a demo to prove that 256 buttons can be programmed to ONE joystick. By using the same lua for both the ALPHA & the BRAVO, they will write to the same address space reserved for virtual joysticks. (0x3344 thru 0x3363. The first joystick slot 0x3340, Joy #64, was not used in this lua ) Attached are 2 luas : 1 for the ALPHA, 1 for the BRAVO. ALPHA buttons greater than 32 will be on joystick #64 with 32 additional buttons provided. (0x3340) BRAVO buttons greater than 32 will be on joystick #65 with 32 additional buttons provided. (0x3344) Neither of these have been tested at all, can't think of a way to spoof FSUIPC into thinking my only controller (<32 buttons) can also be copied as Joy#64 and/or Joy#65 at the same time. Perhaps not enough coffee yet? β ha... Hope these may help you. ( have high confidence they will work right from the start ) Roman EDIT - found a way to test and there were 2 syntax errors in each, now corrected. Both work as intended. hidAlphaButtons.lua hidBravoButtons.lua
-
Can I get away with this?
spokes2112 replied to spokes2112's topic in FSUIPC Support Pete Dowson Modules
Thanks for the help! That was it. Roman function b(flag) ipc.display("TEST", 1) end function c(flag) event.cancel("b") -- if the only one active, worked up to flag 1 event.cancel("b") -- if added then it worked thru flag 2 event.cancel("b") -- added the 3rd, worked on all end event.flag(1, "b") -- test event.flag(2, "b") -- test event.flag(3, "b") -- test event.flag(4, "c") -- turn off- 8 replies
-
- lua events
- cancel
-
(and 1 more)
Tagged with:
-
Can I get away with this?
spokes2112 replied to spokes2112's topic in FSUIPC Support Pete Dowson Modules
Pete, Thanks so much for taking a peek at it. I guess what I will do is make 2 versions, the one above & another using the "switch" style, of which I have already started but it is just a huge mess! The one above is so much more elegant. If that one has inherent bugs I will have a fallback. On last question if I may - I have 2 listeners with different offsets, pointing to the same function : event.offset(0x0001, "UB", "GoHere") event.offset(0x0002, "UB", "GoHere") Will the following cancel both? event.cancel("GoHere") I am assuming it does, hope so. Thanks again and.. To you & John - Merry Christmas π P.S. FSUIPC Lua Library, pg 23, the title page of the events library, 3rd paragraph - "The function name provided as a string in the Lua event function calls can now be functions in tables." This gave me a clue, then it was off to that interweb thingy and search for examples in arrays. I believe a table is an array, it is how it is accessed which is different. Similar to JS.. (could be way off on this)- 8 replies
-
- lua events
- cancel
-
(and 1 more)
Tagged with:
-
Hi Pete, Wondering if you could take a quick look at this lua test script. It works but I am little worried because I cannot test a final version, for another sim in which i dont have and... In the final version there will be only 5 or 6 "x" arrays, but there will be around 15 - 20 filled indexes in each. ( haven't got that far yet ) What I am trying to do is monitor the same offset (a few of them) but direct the function call to somewhere else, cancel the other function calls, all based on a selector knob. Am I treading on thin ice here? Thanks in advance, Roman function s(offset, value) ipc.display("it worked for function 1 (s), the val = " .. tostring(ipc.readUB(0x4211)) .. ", index = " .. tostring(ipc.readUB(0x4210)), 2) end function t(offset, value) ipc.display("it worked for function 2 (t), the val = ".. tostring(ipc.readUB(0x4211)) .. ", index = " .. tostring(ipc.readUB(0x4210)), 2) end -- function a(flag), an old test function a(offset, value) cmds = { function() event.offset(0x4211, "UB", "s") end, function() event.cancel("s") end, function() event.offset(0x4211, "UB", "t") end, function() event.cancel("t") end } if value == 0 then x = {1, 0, 0, 1} -- s is on, t is off elseif value == 1 then x = {0, 1, 1, 0} -- s is off, t is on elseif value == 2 then x = {0, 1, 0, 1} -- both off elseif value == 3 then x = {1, 0, 0, 1} -- s is on, t is off elseif value == 4 then x = {0, 1, 0, 1} -- both off elseif value == 5 then x = {0, 1, 1, 0} -- s is off, t is on elseif value == 6 then x = {1, 0, 0, 1} -- s is on, t is off else -- 7 x = {0, 1, 0, 1} -- both off end for i = 1, #x do if x[i] == 1 then cmds[i]() end end end function b(flag) ipc.writeUB(0x4211, (ipc.readUB(0x4211) + 1)) end function c(flag) ipc.writeUB(0x4211, 0) end -- event.flag(1, "a") -- toggle, turn listener on/off (an old test - successful) event.offset(0x4210, "UB", "a") -- controlled by Offset Byte Cyclic Increment, offset = 4210, param = 1/7 event.flag(2, "b") -- increase val offset event.flag(3, "c") -- clear val offset
- 8 replies
-
- lua events
- cancel
-
(and 1 more)
Tagged with:
-
IIRC, AP_VS_HOLD has never worked, dating back to FS2002. ( using XML ) Even looked at the advanced users PDF looking for a special (controls 1930 - 1945) FSUIPC VS_HOLD control provided by Pete, no luck there. Roman
-
"Smoother" braking when only a button is available.
spokes2112 replied to spokes2112's topic in User Contributions
No, I cannot confirm it works in P3Dv5. I do not own it. I can, however, confirm that the offset & control used is the same in FSUIPC v6, therefore it should work.- 26 replies
-
lua Do not log, a tool for the advanced user's toolbox
spokes2112 replied to spokes2112's topic in User Contributions
π Just for kicks I even tried it in v4, ofc it didn't work. Good Idea! No worries, even if the proposed feature doesn't make it down to v4. I can only imagine what you 2 are going through. Get something, or a bunch of things working only to have P3D and/or MSFS getting updated. For now I am sticking to FSX until MSFS matures - a lot! I like tinkering, gauge coding etc.. The following quote from FSDeveloper reflect my thoughts : ----------------------------------------------------------------------------------------------------------------------- I don't have MSFS but at a friends place I looked at some of their panel code and did some monitoring.. WOW! A command flooding mess! Perhaps they have some kind of internals that allow it with better results than the FSX based sims. As you may know, in FSX based sims, door exits, engine select, (both via keyboard) altitudes stuck @ +/- 1000 increments etc.. are all signs of a flooding panel system. Your older .dlls do a fine job in misc settings, for the end user, to allow this flooding to happen and still have a usable sim. π No worries! In my extended family we have 2 Romy's (Roman's) & 1 Ray (Ramon).. During family events there is a lot of - "Who are you talking to/about?" π Roman ( or is it Romy? or Ramon? lol ) -
lua Do not log, a tool for the advanced user's toolbox
spokes2112 posted a topic in User Contributions
This was done just to see if it could be made to work. ( too much coffee β, insomnia & boredom also contributed ) For the advanced FSUIPC user, gauge programmer, cockpit builder, lua tweaker etc.., a problem arises, at times, where the aircraft designer has code that constantly fires commands into the sim. πππ When it comes time to do some logging, for instance, to see what control is being fired, on user input, is tough to find in the FSUIPC console window. The [General] "DontLogThese=" entry in the FSUIPC.ini does a fine job of blocking these. Of course, you could do a text log of the Events (non-axis controls), open the log and find the offending controls and then build up an entry for "DontLogThese=". This lua does it automatically and appends to a text file, appending it so you can have a library of the offending aircraft. An output example of my testing : NOTES : axis pan heading 66504 axis pan pitch 66503 mouse look toggle 66734 misc maddog 70646 --------------------------------------------- Fly The Maddog X MD-82 - North Central N760NC [General] DontLogThese=66557,66556,66523,66479,66478,66466,66463,66442,66239,65962,65836,65833,65832,65709,65708,65707, PMDG DC-6B PMDG House (N6PM | 2017) [General] DontLogThese=66818,66659,66508,66073,66060,65786, P-51D civ 'Providence Permittin' [General] DontLogThese=66508,66507,65764, Lockheed Constellation L049, C69 [General] DontLogThese=66507,65922,65921,65920,65919, 666 F-16D AK375 F [General] DontLogThese=66707,66073,66065,66057,66031, When needed : 1) Assign a temporary key to run the lua (as you named it) 2) Run it with the aircraft loaded, keeping your hands off of any controls ( axis or other ) 3) When its done, it will report so, making, or appending, a file named "NoLogReport.txt" in the modules folder (or wherever FSUIPC is installed) 4) Copy the aircraft's report and paste in to the FSUIPC.ini [General] section, replacing the line if already there. 5) In the FSUIPC UI, go to the Axis Assignment tab and click on Reload All Assignments. Done, the offending controls are now blocked. This was only tested in FSX, I would imagine it would still work from FS9 thru P3Dv4+. The lua : -- USER SETTINGS local startCtrl = 65537 -- THE STARTING CONTROL NUMBER TO BE SCANNED local endCtrl = 68309 -- THE ENDING CONTROL NUMBER TO BE SCANNED local runTime = 3 -- RUN THE CONTROL RECORDER FOR HOW MANY SECONDS, >= 2 (NOT REALLY LEGIT, THERE IS A "LOT" OF BACKED UP FUNCTION CALLS!) -- END USER SETTINGS local cntrlsOut = {} local doesContain = 0 local acftTitle = ipc.readSTR(0x3D00, 256) acftTitle = acftTitle:gsub('%z','') local outString = "\n\n" .. acftTitle .. "\n[General]\nDontLogThese=" function logControl(controlnum, param) doesContain = 0 for _, value in pairs(cntrlsOut) do if value == controlnum then doesContain = 1 end end if doesContain == 0 then table.insert(cntrlsOut, 1, controlnum) end end function countDown(timer) if runTime == 0 then file = assert(io.open("NoLogReport.txt","a+")) for i = 1, #cntrlsOut, 1 do outString = outString .. cntrlsOut[i] .. "," end file:write(outString) file:close() ipc.display("Modules\\NoLogReport.txt was created", 1) ipc.sleep(1000) -- !!! OPTION, OPEN UP THE REPORT.TXT AND FSUIPC.INI -- !!! UNCOMMENT & CHANGE THE PATHS OF YOUR PREFERRED EDITOR AND OUTPUT FILE(S) -- handle1, error1 = ext.runif("E:/Notepad++/notepad++.exe","G:/FSX/Modules/NoLogReport.txt") -- handle2, error2 = ext.runif("E:/Notepad++/notepad++.exe","G:/FSX/Modules/FSUIPC4.ini") -- !!! UNCOMMENT IF THE ABOVE DOES NOT WORK, PROVIDES ERROR DISPLAY -- ipc.display(handle1 .. error1 .. "\n" .. handle2 .. error2, 0, 5) -- ipc.sleep(5000) ipc.exit() end runTime = runTime - 1 end for i = startCtrl, endCtrl, 1 do event.control(i, "logControl") end event.timer(1000, "countDown") Roman -
A2A yoke button programming need help
spokes2112 replied to Chucky55's topic in FSUIPC Support Pete Dowson Modules
@alioth Arturo, Wow - Very nice setup! Specially using the real instruments / avionics.. A big thank you for listing the L:Vars, saved a bunch of time. π @Chucky55 Chuck, All set and tested - attached. Just place the .lua in the modules folder then get it running by using [Auto] in the FSUIPC.ini. (preferably best using separate profile files & activate it there) Start the sim and begin assigning buttons as needed using the reference chart. Hope this works well for you, Roman PA24AP.lua -
A2A yoke button programming need help
spokes2112 replied to Chucky55's topic in FSUIPC Support Pete Dowson Modules
Charles, A2A uses custom AP coding via L:Vars. You will need to use a handmade .mcro file or .lua to get these controls to work. Would be happy to help, a perfect morning coffee project. π β Are there any other controls that you need? They would go in the same file if needed. Roman -
Clearing variable sent to Lua function
spokes2112 replied to Luke Kolin's topic in FSUIPC Support Pete Dowson Modules
Luke, It seems you would like one particular button to call a function w/ repeat. An option is to use event.flag(flag #, function name) in the lua, then in the button assignment, use LuaToggle <lua name> with a param of the flag#, repeat on. When passed to the function, the flag number gets sent too, perhaps can be used similar to the param being sent using event.param. I use flags / LuaToggle a lot when multiple user interfaces need to use the same function in some fashion - very handy. Roman -
Trim Stops Responding - Vendor Querying FSUIPC
spokes2112 replied to craig_read's topic in FSUIPC Support Pete Dowson Modules
@John Dowson, Maybe this will help, I am talking FSX here but it still may apply. When I am doing some serious gauge programming and I need to test it I use "Reload User Aircraft". Each time this happens, Simconnect considers this a reconnect. After about 20 of these reloads Simconnect dies completely, never to work again until the sim is restarted. During these test runs I have no other things using simconnect, WX, traffic etc.. This anomaly has been confirmed over at FSDeveloper. ( Discussion, An improvement in the same thread) I can only imagine that with PMDG, a weather program, possibly a traffic program, sode etc.. all connected, at some time Simconnect would have to restart due to something borking it. After 7-10 hours multiple SC restarts seems plausible. Roman -
An alternate "AutoSave" for FSUIPCv4.xx
spokes2112 replied to spokes2112's topic in User Contributions
Hi @ram123, Let's give this one last try. This new version is based on the premise that the FSUIPC file saving worked fine, your #1 file was always created. It was my file handling, always having the newest file named #1, then others in order, that was causing all the issues. The "KISS" principle was applied and all of my file handling was removed. πIf Aerosoft did it correctly then you will have all the matching .FMS files in C:\documents\Aerosoft\Airbus. πMuch less code! It should have a lesser effect on your sim. πNo more file handling - This means the file name suffix doesn't necessarily mean it is the newest. Files go in order from 0 --> 1 --> 2 --> max # --> 0 etc.. If the saved flight is loaded from the FSX UI then the newest will always be at the top, then, in order of the time saved. If the flight is loaded from the optional FSUIPC interface then you would have to use windows sorting to find the newest. ( via Date Modified ) πThe command : "Delete ALL auto saved flights" was removed. ( no more file handling ) Attached with your settings already applied - again, fingers crossed. Roman LuaAutoSave.lua- 11 replies
-
- 1
-
-
- p3d 1 thru 3
- fsx
-
(and 1 more)
Tagged with:
-
An alternate "AutoSave" for FSUIPCv4.xx
spokes2112 replied to spokes2112's topic in User Contributions
Hi, Here are 2 full versions, attached, for testing. - Please try the (Auto) version first - Both are set up with your settings, ready to go - Perhaps you should set up a keyboard key to restart the lua so you can test both, "on the go" - The (Manual) version requires the setup path in the user settings. It is also setup for you - easy replacement. I think what is happening is the use of "\" in the path. In lua this character is a string escape, special. What I have done, in the (Auto) version is to replace the "\" with "\\" in the path string. The original (May28th) - Why it works for me & not you has me so confused! π Fingers crossed! π Roman AutoSave (Auto).zip AutoSave (Manual).zip- 11 replies
-
- p3d 1 thru 3
- fsx
-
(and 1 more)
Tagged with: