Jump to content
The simFlight Network Forums

spokes2112

Members
  • Posts

    320
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by spokes2112

  1. Pat, You're welcome, and.. Happy New Year to you too. Roman
  2. The entry for steering angle is in the aircraft.cfg file under [contact_points] , then for the center wheel entry it is the 8th number in CSV values. Normally the center wheel can be found easily by finding the only non-zero entry in the 8th value. Ref - http://msdn.microsoft.com/en-us/library/cc526949.aspx#mozTocId836373
  3. Pete, Finally got it... A fresh day with fresh brain cells helped. Was writing to zero to the correct slot. I reckon lua cleaned itself up before the write could be made. Thank You, Roman function cleanup() if addr ~= 0 then -- KEEP FROM CONTINUNING IF AN ADDRESS WAS NEVER SUPPLIED IE FOUND NO SLOT ipc.writeUD(addr, 0x0) -- WRITE ZERO TO THE SLOT ADDRESS end end -- event.terminate("cleanup") -- ORIGINAL, ONLY 55 MSECS TO GET STUFF DONE, FUNCTION CALLED, NOT ENOUGH TIME TO WRITE BEFORE EXIT event.sim(FLIGHTLOAD, "cleanup") -- WORKS PERFECTLY event.sim(AIRCRAFTCHANGE, "cleanup") -- WORKS PERFECTLY 1974115 LUA.0: Terminate event: calling "cleanup" in "G:\FSX\Modules\SHRS CFGR8R_3.lua" 1974115 LUA.0: G:\FSX\Modules\SHRS CFGR8R_3.lua:66 = ipc.writeUD(addr, 0x0) -- WRITE ZERO TO THE SLOT ADDRESS WAS CALLED BUT NEVER WORKED
  4. Pete, I gave the add-on menu a go and it works! Kinda tough for me but I be happy camper! I have one problem though, it is killing the menu when needed. ( See the 3rd lua under the function cleanup() ) It's really not that big of a deal except when I change from one of our own aircraft to another one of our own. The menu doubles up until the timer on the first menu entry runs out. Really not that bad, would like to do better. I was thinking of using the next set back of "user memory" slots ( as used in the # 2 lua ) to store the slot address and check if it is our entry on reload then continue to use if it is. ( sounds right? ) Also if you have a few minutes could you check my #3 to make sure I did all the checking etc.. needed and nothing being done really bad? Kinda scared (LOL) because i would like to release it to our users. Hope you do not mind but I posted all three of the .lua(s) to give you an idea of the whole package I am trying to create. The main concentration is on #3. My project head honcho has always wanted to have these functions but I am incapable of C/C++. Believe me, I tried a couple of dozen tries to do a "Hello World" . Maybe in a few years LOL. Also the requirement for our package is the free version of FSUIPC, this is the best i can do and will be released as a User Contribution for our aircraft package with no official but rather private support. Lua 1 - Provides the end user of keyboard / joystick activation of our configuration program. It also acts as a slave to #s 2 & 3. Lua 2 - Provides Automation. Lua 3 - "The" menu. Any combination of them could be used depending on preferences. And again, trivial and just an idea... It has to do with the console debugging window. If the console window is opened but minimized when FSX is closed the FSUIPC.ini gets written with values like - ConsoleWindow=-32000,-32000,-31840,-31973 . Was wondering if there is not too much of a deal maybe do something, if caught, make it something like - ConsoleWindow=0,0,500,500 ? When FSX is restarted it is impossible to get the window back without closing FSX again and editing FSUIPC.ini manually. Again trivial, I keep hitting myself in the face every time I do it. Pretty swollen at this point LOL! :mrgreen: (Really like seeing what FSUIPC is doing on FSX start :razz: ) Again Thank - You as always, None of the below could've been done without your help. Programming stuff in FS = #1 Hobby, Flying in FS when everything works = #2 Hobby Roman #1 --[[ SHRS CFGR8R_1.lua - This lua file provides the ability to assign a keyboard key or a joystick button (or both) to start the configurator. This lua file is a "one shot", meaning it is only run when commanded to and it exits itself. It is commanded to run after being setup in the FSUIPC dialog under the "Keys Presses" tab or "Buttons + Switches" tab for either the keyboard or joystick (or both). Once run it starts the F-111 configurator. ]] -- SET DISPLAY TIME IN SECONDS ( 0 = NO SHOW, WHOLE NUMERS ONLY ) local disptim = 2 -- END SETTINGS function display(path, disp, func) ipc.setowndisplay("SHRS F-111 Configurator", 41, 3, 18, 0) if func == 1 then if disptim >= 1 then ipc.display(disp, 1, disptim) end else if disptim >= 1 then ipc.display(disp, 1, disptim) end ipc.sleep(250) local handle, error = ext.runif(path) if handle == 0 then if error == -1 then if disptim >= 1 then ipc.display("ALREADY RUNNING!", 1, disptim) end else if disptim >= 1 then ipc.display("MALFUNCTION! = " .. error, 1, disptim) end end end end ipc.sleep(disptim * 1001) ipc.exit() end local eggs = "SHRS F-111 Aardvark" .. "\\" .. "SHRS F-111 Configurator.exe" local airf = ipc.readSTR(0x3C00,256) local unused, length = string.find(airf, "\Airplanes", 1, true) if length < 1 then display("OOPS", "ERROR FINDING PATH!", 1) end local path = string.sub(airf, 1, length + 1) path = path .. eggs display(path, "STARTING........", 0) ipc.exit() #2 --[[ SHRS CFGR8R_2.lua - This lua file adds automation. It is a "one shot" like above except it is only run when FSX if first started or when there is an aircraft change, it also exits itself. When FSX is first started and if the saved flight or flight selection loads the SHRS F-111 (any sub model) the configurator will run. Also, when there is an aircraft change from anything other than the SHRS F-111 to the SHRS F-111 (any sub model) the configurator will run. The configurator will not start automatically when changing between SHRS F-111 models as it may have been commanded for an aircraft change by the configurator itself or the F-111 was configured as a "Default Release". Therefore the configurator is not necessary. (MAY CHANGE AND HAVE THE CONFIGURATOR WRITE A BIT TO SHOW THAT IT HAS INDEED COMMANDED THE AIRCRAFT CHANGE) Auto run under [Auto] in FSUIPC.ini NOTE - SHRS CFGR8R_1.lua is required in the modules folder although it does not need (optional) to be configured for keyboard or joystick usage. ]] local mem = 0x66FF -- UNUSED "USER" MEMORY SLOT IN FSUIPC, IN THIS CASE THE ENDING BYTE OF TOTAL AREA, POSSIBLY PREVENTING CONFLICTS FROM OTHER USERS local airf = ipc.readSTR(0x3C00,256) local past = ipc.readUB(mem) local starting, ending = string.find(airf, "\SHRS F-111 Aardvark", 1, true) if (starting == nil) or (ending == nil) then starting = 1 ending = 1 end local string = string.sub(airf, starting, ending) if string == "SHRS F-111 Aardvark" and past == 0 then ipc.writeUB(mem, 1) ipc.macro("Lua SHRS CFGR8R_1") else if string ~= "SHRS F-111 Aardvark" then ipc.writeUB(mem, 0) end end ipc.exit() #3 --[[ SHRS CFGR8R_3.lua - This lua file adds a menu for the starting the configurator in the "Add-ons" menu of FSX. It can be set to show the menu at all times ( handy when using "Force Reload via Current Flight ) or to show always. If "show always" or the SHRS F-111 is selected under the setting "F-111 only" it is always running (very sparse usage), otherwise under the setting "F-111 only" and in another non F-111 aircraft it exits immediately and will restart and check again on an aircraft change. Auto run under [Auto] in FSUIPC.ini NOTE - SHRS CFGR8R_1.lua is required in the modules folder although it does not need (optional) to be configured for keyboard or joystick usage. ]] -- SHOW ONLY FOR F-111 OR ALWAYS local showme = 0 -- Show only for F-111 = 0, Show always = 1 -- END SETTINGS -- PREVENT NIL ERRORS local addr = 0 local time = 0 local slot = 0 local time = 0 -- ACTIVATE BASED ON THE ABOVE USER SETTINGS IF F-111 ONLY if showme == 0 then local airf = ipc.readSTR(0x3C00,256) local starting, ending = string.find(airf, "\SHRS F-111 Aardvark", 1, true) if (starting == nil) or (ending == nil) then -- PREVENT NIL ERRORS IF NOT OUR F-111 AIRCRAFT, RETURNS ROOT FSX DRIVE LETTER starting = 1 ending = 1 end local string = string.sub(airf, starting, ending) if string == "SHRS F-111 Aardvark" then showme = 1 else ipc.exit() end end -- DO THE ADD MENU WORK if showme == 1 then for i = 0x3210, 0x32D0, 0x4 do local data = ipc.readUD(i) if data == 0 then addr = i -- ipc.display(slot .. " " .. addr, 1, 3) -- CHECK PROPER SLOT AND ADDRESS ipc.writeUD(addr, 0x0000ffff) ipc.writeSTR(0x2FE1, "&SHRS F-111 Configurator ...") ipc.writeUB(0x2FE0, slot) break end slot = slot + 1 end end -- REFRESH THE ADD ON MENU AND CHECK FOR MENU SELECTED function refresh() if showme == 1 then local trigr = ipc.readUB(addr + 0x3) if trigr == 1 then ipc.writeUB(addr + 0x3, 0) ipc.macro("Lua SHRS CFGR8R_1") end time = time + 1 if time == 10 then time = 0 ipc.writeUD(addr, 0x0000ffff) end end end -- PREVENT DOUBLING UP ON THE MENU AND GENERAL SWEEPING function cleanup() if addr ~= 0 then -- KEEP FROM CONTINUNING IF AN ADDRESS WAS NEVER SUPPLIED ipc.writeUD(addr, 0x00000000) -- WRITE ZERO TO THE TIMER AT SLOT ADDRESS -- ipc.writeSTR(0x2FE1, "0") -- WRITE ZEROS TO THE ADD ONS OFFSET, PROBABLY NOT GOOD -- ipc.writeUB(0x2FE0, 0) -- WRITE ZEROS TO THE ADD ONS OFFSET, PROBABLY NOT GOOD event.cancel("refresh") -- ANOTHER TRY TO GET RID OF THE MENU, ON AIRCRAFT CHANGE, WHEN NOT REQUESTED ipc.sleep(1000) -- CANT GET THE ABOVE TO WORK, MAYBE MORE TIME?, PROBABLY DOESN'T WORK AS LUA IS BEING KILLED end end event.terminate("cleanup") event.timer(1000, "refresh")
  5. Pete, I forgot to add, it's trivial and I may be wrong. On pg. 13 of FSUIPC Lua Library.pdf should "isrunning()" be "ext.isrunning()" ? Thanks, Roman - Lua is fun :mrgreen:
  6. Pete, WORKS GREAT! Thank You. Now that they are in a byte (bite LOL :rolleyes: ) size chunk all the string manipulation I need can be / is done. (Below) A couple more questions if I may? 1. I can test this, just wondered if you know off the top if the following works - If the data in an .air file is changed but the name of the .air file is not, then the aircraft is reloaded by .flt file or by the command "reload user aircraft", does the new data in the .air file get read? 2. This may be beyond my knowledge but, can the "add menu" facilities at offset 0x2FE0 be done with Lua? If it can I just may give it a try. Thanks again, Happy Holidays, -- SET DISPLAY TIME IN SECONDS ( 0 = NO SHOW ) local disptim = 2 -- END SETTINGS -- RUN, DISPLAY and END function display(path, disp, func) ipc.setowndisplay("SHRS F-111", 41, 3, 18, 0) if func == 1 then ipc.display(disp, 1, disptim) else ipc.display(disp, 1, disptim) ipc.sleep(250) local handle, error = ext.runif(path) if handle == 0 then if error == -1 then ipc.display("ALREADY RUNNING", 1, disptim) else ipc.display("MALFUNCTION " .. error, 1, disptim) end end end ipc.sleep(disptim * 1001) ipc.exit() end -- ADD TO PATH local eggs = "SHRS F-111 Aardvark" .. string.char(92) .. "SHRS F-111 Configurator.exe" -- GET .AIR FILE PATH local airf = ipc.readSTR(0x3C00,256) -- GET LENGTHS local unused, length = string.find(airf, "\Airplanes", 1, true) -- CHECK FOR NULL PATH if length < 1 then display("OOPS", "ERROR FINDING PATH", 1) end -- MAKE THE FULL STRING AND SEND local path = string.sub(airf, 1, length + 1) -- add trailing "\" path = path .. eggs display(path, "STARTING CONFIGURATOR", 0) -- JUST IN CASE ipc.exit()
  7. Pete, Thanks for the insight! While I do not have time left today to try, will do tomorrow morning for sure and get back to you. And silly me, I totally forgot that all chars have a byte representation. :wacko:
  8. Hi Pete, Hope you had a nice holiday / vacation.. I am working on a lua file where I need to substring/concatenate a string to the path from either 0x3C00 (.air) or 0x3E00 (fs path). Almost all the string functions I have found on the net seem to not work. I am assuming it has to do with the padding. For instance path .. string -- does not work string .. path -- does work cutting off the end ( - string.len) I am assuming the console window and ipc.display automatically removes the padding prior to displaying - or something.. Am I at a 256 byte limit for manipulation? Really Stumped here. I've tried a whole bunch of trim functions - Here and Here none work and many fail. Just thought of this as I'm typing - Instead of getting the whole 256 bytes from the offsets can I just get 100, 75 or 50 to give me some headroom? Thanks -- SET DISPLAY TIME IN SECONDS ( 0 = NO SHOW ) local disptim = 3.00 -- END SETTINGS -- GET AIR FILE PATH path = ipc.readSTR(0x3C00,256) length = string.len(path) -- TRIM PADDING TRIES newpath = string.gsub(path, "%s$", "") --newpath = string.gsub(path, "0$", "0") newlength = string.len(newpath) -- ALWAYS 256! display = newlength .. "\n" .. newpath ipc.setowndisplay("TEST STRINGS", 0, 3, 50, 15) ipc.display(display, 1, disptim) ipc.sleep(disptim * 1000) ipc.exit()
  9. I do not have P3D2 yet... Just browsing forums to get a heads up prior to purchasing and found this, it may help. http://www.prepar3d.com/forum-5/?mingleforumaction=viewtopic&t=3855 5th post down from top. I would caution on copying over the complete contents of the folder maybe just try the .key file.
  10. It looks like version 1 would work correctly by correcting one spelling error, function RUN_update(time) dot=ipc.readLvar("L:AB_AP_ALT_Mode") ipc.writreUB(0x66CC, dot) -- change to write end event.timer(100,"RUN_update")
  11. Sorry guy's, Copied/pasted right from post 1 and never really looked at punctuation. :oops: Didn't want to hijack this thread either, just glad it is all working for you now. Roman
  12. Graham, maybe this can help, or, seriously screw things up. function ApuToggle() MyData = ipc.readUB(0x940F) if Logic.And(MyData, 0x20) == 1 then --// Bit 5 = 100000 binary, 32 decimal, 20 hexadecimal --//stop apu else --//start apu end end Then all you need is some event to call the function ApuToggle() Hope this can help, keep plugging at it :smile: Roman
  13. Pete, No need to delve into it, unless it intrigues you :mrgreen: . Afterall this is for FS9. Roman
  14. Pete, Thank you for the nudge! :razz: I am getting length data from 'rd and 'rdf' returns from com.openhid unit 0 & 1 so things 'may' (ha) be looking good. Just have to read it to see what's there. (Thanks) Never dealt with Com before ( communications ? ) so its a learning experience.. This will be a fun afternoon LOL! Below is just the relevant part of the HidScanner.log with some comments that I assume.. It seems to fit the functions of the mouse. Thanks again - For everything! Roman Device at "\\?\hid#vid_045e&pid_075c&col01#6&38988418&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}" Vendor=045E, Product=075C (Version 4.48) Manufacturer= Microsoft Product= Microsoft® SideWindersion 4.48) Serial Number= Device is a mouse Usage Page: 1 Input Report Byte Length: 10 Output Report Byte Length: 0 Feature Report Byte Length: 0 Number of Link Collection Nodes: 4 Number of Input Button Caps: 1 Number of InputValue Caps: 4 Number of InputData Indices: 9 Number of Output Button Caps: 0 Number of Output Value Caps: 0 Number of Output Data Indices: 0 Number of Feature Button Caps: 0 Number of Feature Value Caps: 0 Number of Feature Data Indices: 0 Buttons range 1 -> 5 at indices 0 -> 4 Value Y at index 5, range -32767 -> 32767, using 16 bits <!-- Laser X/Y??? --> Value X at index 6, range -32767 -> 32767, using 16 bits <!-- Laser X/Y??? --> Value Wh at index 7, range -32767 -> 32767, using 16 bits <!-- Laser X/Y??? --> Value Wh at index 8, range -32767 -> 32767, using 16 bits <!-- Laser X/Y??? --> ************************************************************************** Device at "\\?\hid#vid_045e&pid_075c&col02#6&38988418&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}" Vendor=045E, Product=075C (Version 4.48) Manufacturer= Microsoft Product= Microsoft® SideWindersion 4.48) Serial Number= Usage Page: C Input Report Byte Length: 5 Output Report Byte Length: 0 Feature Report Byte Length: 13 Number of Link Collection Nodes: 4 Number of Input Button Caps: 3 Number of InputValue Caps: 6 Number of InputData Indices: 1286 Number of Output Button Caps: 0 Number of Output Value Caps: 0 Number of Output Data Indices: 0 Number of Feature Button Caps: 1 Number of Feature Value Caps: 13 Number of Feature Data Indices: 14 Value 0x25 at index 1280, range 0 -> 4, using 8 bits <!-- Button --> Value 0x26 at index 1281, range 0 -> 65535, using 16 bits <!-- Button? --> Value 0x28 at index 1282, range 0 -> 255, using 8 bits <!-- Button --> Value 0x27 at index 1283, range 0 -> 255, using 8 bits <!-- Button --> Value 0x29 at index 1284, range 0 -> 7, using 3 bits <!-- Button? --> Value U/RX at index 1285, range 0 -> 255, using 8 bits <!-- Mousewheel -->
  15. Hi Pete, I started making a "mouselook" type Lua file for FS9 and it works quite well except 2 more functions I have trouble with. I am making this so my joystick will perform the same between FSX and FS9, in FSX my primary hat is trim along with 2 alternate look functions, In FS9 the primary hat is pan with the same 2 alternate look functions. While in FS9 I keep tagging the spacebar for mouselook and just go "UGGH!" :mad: The part I will have trouble with is (assuming) getting the mouse middle button & mouse wheel ( Reset and Zoom) through the Com library since it is not available through the Event library.. I am afraid using the Com library may be a step too far for me. I have tried the .ini settings Debug=Please and LogExtras=512 and using FSX for the development because of the console debug window but I cannot seem to get any data from the mouse. When using a logging file all I get is Vendor/Product data etc.. with none of the actual passing hardware data being shown. MMM??? So I guess a few questions - Is this even possible? If so, can you give me nudge in the right direction? I have a feeling it has to do with com.openhid initreport ?? Below is the Lua I have so far. Thanks in advanced, Having fun w/ Lua! Roman -- FS9 Mouselook.Lua -- Use HidScanner.exe to get Vendor, Product and Unit for mouse wheel and middle button Vendor = 0x045E Product = 0x075C Unit = 0 initial = 0 delta_move = 200 --[[ PAN_DOWN 65735 PAN_LEFT 65671 PAN_LEFT_DOWN 65855 PAN_LEFT_UP 65854 PAN_RESET 65875 PAN_RESET_COCKPIT 66415 PAN_RIGHT 65672 PAN_RIGHT_DOWN 65857 PAN_RIGHT_UP 65856 PAN_TILT_LEFT 65873 PAN_TILT_RIGHT 65874 PAN_UP 65734 ]] function activated() -- middle mouse button = reset view / reset initial -- mousewheel = zoom in/out -- L/R = pan L/R -- F/B = pan up/down newx, newy, xr, yr, xp, yp = mouse.getpos() -- PAN RIGHT / UP if newx > (initialx + delta_move) and newy < (initialy - delta_move) then ipc.control(65856) end -- PAN RIGHT if newx > (initialx + delta_move) and (math.abs(initialy - newy) < delta_move) then ipc.control(65672) end -- PAN RIGHT / DOWN if newx > (initialx + delta_move) and newy > (initialy + delta_move) then ipc.control(65857) end --PAN LEFT / UP if newx < (initialx - delta_move) and newy < (initialy - delta_move) then ipc.control(65854) end --PAN LEFT if newx < (initialx - delta_move) and (math.abs(initialy - newy) < delta_move) then ipc.control(65671) end --PAN LEFT / DOWN if newx < (initialx - delta_move) and newy > (initialy + delta_move) then ipc.control(65855) end --PAN DOWN if newy > (initialy + delta_move) and (math.abs(initialx - newx) < delta_move) then ipc.control(65735) end --PAN UP if newy < (initialy - delta_move) and (math.abs(initialx - newx) < delta_move) then ipc.control(65734) end end function activate() if initial == 0 then -- GET MOUSE CURRENT POSITION initialx, initialy, xr, yr, xp, yp = mouse.getpos() -- GET HID INFO FOR MID BUTTON / WHEEL handle, rd, rdf, wr, initreport = com.openhid(Vendor, Product, Unit, 0) initial = 1 end ipc.writeSTR(0x3380, handle .. rd .. rdf .. wr .. initreport) ipc.writeSW(0x32FA, 10) activated() end function reset() initial = 0 end -- spacebar = 32,8 down | downarrow = 40,8 | leftarrow = start lua | rightarrow = kill lua -- event.key(40, 8, 5, "activate") event.key(40, 8, 5, "activate") event.key(40, 8, 2, "reset")
  16. Hi Pete, NEVER MIND ... Ha Ha .. Read the manual LOL!! "The function is also executed initially, when the plugin is first run, in order to initialise things. This saves using an explicit call to do the same." Your code is soooo much more elegant! :mrgreen: Have a great weekend, Roman P.S. Maybe a typo in the code? event.offset(ox0BFD, "UB", "anti_skid") -- Red, oh ex .. Would this work? event.offset(0x0BFD, "UB", "anti_skid") -- Red, zero ex .. __________________________________________________________________________________________________ IIRC in one particular situation (donot remember which one) when the aircraft was changed the anti-skid was toggled off and then the Lua was loaded afterwards. In this case would the lua file not work? RE- http://forum.avsim.net/topic/416919-way-to-turn-on-anti-skid-by-default/#entry2764391 function anti_skid() ipc.writeUB(0x0BFD, 1) end event.offset(ox0BFD, "UB", "anti_skid")
  17. Pete, It works a charm! :smile: It was.. A LONG time ago here in the forum.. (I Used the search function first) I Believe it was just too early since the release of FSX though to go further. I ended up with this - no fuss, it just works and always will.. function anti_skid() status = ipc.readSB(0x0BFD) if status ~= 1 then ipc.control(66720) end end event.timer(3000, "anti_skid") This little project was based on this http://forum.avsim.net/topic/416919-way-to-turn-on-anti-skid-by-default/ , yes a xml gauge would've worked but installing it into every aircraft would be pain.. Thanks again, You Da Man! Roman
  18. Pete, WOW! Thank You so much! I have been using the stock A321 for testing. Note the VC does NOT reflect anti-skid but the 2d "Gear Panel" does. (Shift-6) I have tested it on alot of aircraft with a xml gauge and it commands / returns / actually works during testing. Roman
  19. Pete, I have searched in vain in the offset status doc to see if there was an offset to use for the status of the anti-lock brake system.. I am writing a LUA script so that a user of a gamepad would have the antiskid on at all times for all aircraft in all situations. Anti skid always returns to off on any aircraft load/reload. The following is the best working LUA so far -- (loaded via [Auto]) -- TOGGLE ANTI SKID BRAKES function anti_skid() ipc.control(66720) end -- CALL THE FUNCTION ON INITIAL FSX LOADING OR AN AIRCRAFT CHANGE anti_skid() -- CALL THE FUNCTION FOR, FLIGHT RESET OR AN AIRCRAFT RELOAD COMMAND event.control(66512 , "anti_skid") -- Reload Aircraft event.control(65591 , "anti_skid") -- Situation Reset The above covers most of the bases except for - - Selecting the exact same aircraft from the select aircraft menu - Selecting any flight, or reselecting the same flight, that has the same aircraft. - A crash reset ?? (Did not test) In each of the above cases Anti-Skid is turned off via FSX. Would I like to do is something like - -- TOGGLE ANTI SKID BRAKES function anti_skid() status = ipc.read(ANTI-SKID STATUS) if status ~= 1 then ipc.control(66720) end end -- CALL THE FUNCTION ON INTIAL FSX LOADING OR AN AIRCRAFT CHANGE anti_skid() -- CALL THE FUNCTION FOR, FLIGHT RESET OR AN AIRCRAFT RELOAD COMMAND event.control(66512 , "anti_skid") -- Reload Aircraft event.control(65591 , "anti_skid") -- Situation Reset event.sim(FLIGHTLOAD, "anti_skid") -- Any flight load OR - even better to cover all the bases function anti_skid() status = ipc.read(ANTI-SKID STATUS) if status ~= 1 then ipc.control(66720) end end event.timer(3000, "anti_skid") Just wondering if the offset is available and just maybe not in the document? The variable is available for both XML and, from I gather C type/Simconnect gauges too. Roman
  20. Andy, The knob is used for calculating the true airspeed by adjusting OAT in the temp window at the top of instrument. FSX uses the stock commands for this and they are available through FSUIPC. ( not tested but in FSX controls.pdf ) Command Control TRUE_AIRSPEED_CAL_DEC 65886 TRUE_AIRSPEED_CAL_INC 65885 EDIT - at first i looked at the FS9 gauge code and assumed it would be the same for FSX - NOPE that is a problem with assuming.. :smile: FSX no longer has the TRUE_AIRSPEED_CAL in it's own controls dropdown, nor does it respond to FSUIPC keys input for the above controls.. Below is a modded "Airspeed Indicator.xml" which gets rid of the gauge only (G:Var1) and replaces it with a local (L:True_Aspd_Cal, number). Not sure, but it may pick up on a mouse macro or at least a lua script. EDIT Again - Sorry to hi-jack this thread, but I needed something similar and went on with testing in the Baron. Below the replacement gauge xml are the 2 macros to make it work.. Tested.. You should be able to control the true airspeed adjustment now via hardware - if really necessary. Just this testing helped me out on figuring something for the future. Roman <Gauge Name="Airspeed Indicator" Version="1.0"> <Image Name="Airspeed_Background.bmp" /> <Element> <Position X="0" Y="0" /> <MaskImage Name="Airspeed_Background.bmp"> <Axis X="48" Y="49" /> </MaskImage> <Image Name="Airspeed_TAS.bmp" DegreesPointsTo="-1"> <Axis X="42" Y="37" /> </Image> <Rotate> <Value>(L:True_Aspd_Cal, number) dgrd 2 * </Value> </Rotate> </Element> <Element> <Position X="0" Y="0" /> <MaskImage Name="Airspeed_Background.bmp"> <Axis X="45" Y="14" /> </MaskImage> <Image Name="Airspeed_INHG.bmp"> <Axis X="132" Y="1" /> </Image> <Shift> <Value>(L:True_Aspd_Cal, number) dgrd 2 * </Value> <Scale X="50" /> </Shift> </Element> <Element> <Position X="46" Y="48" /> <Image Name="Airspeed_Needle.bmp" PointsTo="East"> <Axis X="15" Y="4" /> </Image> <Rotate> <Value Minimum="0" Maximum="260">(A:Airspeed select indicated or true,knots)</Value> <Failures> <GAUGE_AIRSPEED Action="Freeze" /> </Failures> <Nonlinearity> <Item Value="0" X="46" Y="10" /> <Item Value="40" X="60" Y="11" /> <Item Value="50" X="70" Y="17" /> <Item Value="60" X="74" Y="20" /> <Item Value="80" X="85" Y="39" /> <Item Value="130" X="62" Y="84" /> <Item Value="160" X="32" Y="77" /> <Item Value="190" X="17" Y="59" /> <Item Value="200" X="11" Y="52" /> <Item Value="260" X="28" Y="15" /> </Nonlinearity> <Delay DegreesPerSecond="180" /> </Rotate> </Element> <Element> <Position X="77" Y="80" /> <Image Name="Airspeed_Knob.bmp"> <Axis X="8.5" Y="9" /> </Image> <Rotate> <Value>(L:True_Aspd_Cal, number) dgrd </Value> </Rotate> </Element> <Mouse> <Help ID="HELPID_GAUGE_AIRSPEED" /> <Tooltip ID="TOOLTIPTEXT_AIRSPEED_KNOTS" MetricID="TOOLTIPTEXT_AIRSPEED_KILOS" /> <Area Left="68" Right="86" Top="71" Bottom="88"> <Help ID="HELPID_GAUGE_TAS_CALIBRATION" /> <Area Right="9"> <Cursor Type="DownArrow" /> <Click Repeat="Yes">(L:True_Aspd_Cal, number) 1 - 30 /-/ max d (>L:True_Aspd_Cal, number)</Click> </Area> <Area Left="9"> <Cursor Type="UpArrow" /> <Click Repeat="Yes">(L:True_Aspd_Cal, number) 1 + 30 min d (>L:True_Aspd_Cal, number)</Click> </Area> </Area> </Mouse> </Gauge> "ASPD_CAL_DEC.mcro" [Macros] 1=L:True_Aspd_Cal=Dec,-30 And finally "ASPD_CAL_INC.mcro" [Macros] 1=L:True_Aspd_Cal=Inc,30
  21. Concour,, Thanks Pete!
  22. Hi, This topic has really piqued my interest and as such did some experimentation to see if I could get this LUA multi-axis to work on a joystick without a toggle state such as provided on the Saitek. Success! What I tried to accomplish since my joystick does not have mixture or prop controls is to toggle a state where the throttle axis would go from throttle --> mixture-->props and return. References - original post for instructions - http://forum.simflig...te/#entry435414 clever switching - pg 25, FSUIPC for Advanced Users.pdf direct to FSUIPC calibration - pg 35, FSUIPC for Advanced Users.pdf The first thing I did was modify the LUA file since the offset for "clever switching" used that same offset, I just used the next available one. function applyaxis(val) cntrl = ipc.readUD(0x66c4) ipc.control(cntrl,val) end event.param("applyaxis") [/CODE] The button coding had to be hand made. ( not through FSUIPC UI ) Here are just the relevant section enties w/ notes. [CODE] [Buttons] 86=P0,10,Cx510066C0,x00020001 ;Clever Switching toggle on button #10 down 87=B66C0=0 U0,10,Cx030066C4,x0000FA68 ;On button #10 up, Clever Switching=0, use direct to cal. axis throttle (64104=0xFA68) 88=B66C0=1 U0,10,Cx030066C4,x0000FA6A ;On button #10 up, Clever Switching=1, use direct to cal. axis mixture (64106=0xFA6A) 89=B66C0=2 U0,10,Cx030066C4,x0000FA69 ;On button #10 up, Clever Switching=2, use direct to cal. axis propellor (64105=0xFA69) [LuaFiles] 3=multiaxis [Auto] 1=Lua multiaxis [Axes] 2=0Z,256,F,L3:V,0,0,0 ;Throttle axis [JoystickCalibration] Throttle=-16384,16383/8 Mixture=-16384,16383 PropPitch=-16384,16383 [Monitor] ;This section is just to show me what mode Im in, broadcasted to the title bar. Display=4 Monitor0=0,66C0,0,0 [/CODE] @Pete - I cannot thank you enough for some of the absolutely ingenious things that can be done with FSUIPC! This little LUA file just made my $60 T-Flight Hotas stick into one worth $150!! LOL! Thanks again, Regards, Roman Edit - was just thinking about this and wondered - Is there a way to have 2 or more conditions on a button press? IE (pseudo logic) 87=B66C0=0 [i][b]and engine is recip or turboprop[/b][/i] U0,10,Cx030066C4,x0000FA68 This way I could setup another set of axis' for a jet only (spoilers and ??)
  23. Pete, All I can say is THANK-YOU! THANK-YOU! THANK-YOU! :grin: Using the new logging facilities has made my life so much easier. I was on hiatus for quite a few months and coming back to the project i've been working on (~1year) was difficult at first. For instance finding an L:Var that does one particular function but i had forgot the name. I would have to look though many gauges to find it and relearn it's function. Now, just click some switch or knobs etc.. While the console and the LUA L:Vars is running and VOILA! There's the name i'm looking for and can see what it's doing. Been working through the gauges fixing/reworking & getting the TODO list done like an animal! :blink: D'Loading "R" right now :razz: My sincere Thanks, Regards, Roman
  24. Pete Was on Hiatus from FS from 8/12 - 12/12 last update was probably spring of '12 ! :cry: Thanks again Roman
×
×
  • 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.