Jump to content

SparkyOV

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by SparkyOV

  1. Hooray! Good luck! PM me if you have further questions.
  2. From my understanding, yes.
  3. You tell export.lua what to *send*. The export.lua that I posted *listens* for everything. The button ID for Master Caution should be 3001 ("Button_1" from clickabledata.lua): elements["PNT-BTN-UFC-MASTWARN"] = {class = {class_type.BTN}, hint = _("Master Caution Light"), device = devices.SYS_CONTROLLER, action = {device_commands.Button_1}, stop_action = {device_commands.Button_1}, arg = {403}, arg_value = {1.0}, arg_lim = {{0.0, 1.0}}, use_release_message = {false} } Also, you must send the "0.0" as well...otherwise it would be like you pressing the button and never releasing it. If that doesn't work, I will have to dig up my code since when I originally did this, it was pre-DCS:World.
  4. "%.1f" is a Lua string format. It determines how a number will be presented. I.e. the "f" means a floating-point number and the ".1" means one digit after the decimal. E.g. given a number like 3.14159265359, "%.1f" would produce "3.1" and "%.4f" would produce "3.1416". See if this helps: http://www.lua.org/pil/20.html
  5. No no...that was a specific example of how to directly control a toggle using "performClickableAction". The export.lua that I attached earlier is the generic way to toggle any switch via a UDP packet.
  6. I don't remember where it comes from (I read it in another post when I was researching this) but you are correct: 3000 + 14 = 3014. Edit: this is where I read it (from Gadroc): http://forums.eagle.ru/showpost.php?p=1349672&postcount=42
  7. Ah, ok. Please re-read my other post. I explain where to find the codes for switches. Basically you will send a UDP packet back to the sim in the form of: C[device ID],[button ID],[value] E.g. if you wanted to "press and release" the FUNC button on the UFC, you would send: C8,3013,1.0 C8,3013,0.0 E.g. to toggle TGP to ON, you would send: C7,3004,1.0 TGP OFF would be: C7,3004,-1.0
  8. I'm not sure I follow your question... are you asking if you can turn on a warning light? To my knowledge, no...you cannot do that. Gauges and indicator lights are read-only.
  9. Glad to be of help and good luck!
  10. Attached. It is essentially Gadroc's version with only some minor things changed. I.e. I only send the Master Caution light from the main panel. Export.lua
  11. Try this one: http://bansky.net/echotool/
  12. I never got the log file working either. I just wrote a simple UDP listener that dumped what it received to the console.
  13. Those annunciator values come from "DCS World\Mods\aircrafts\A-10C\Cockpit\Scripts\mainpanel_init.lua" snippet: caution_lamp(404,SystemsSignals.flag_MASTER_WARNING_STUB) -- MASTER WARNING caution_lamp(480,SystemsSignals.flag_ENG_START_CYCLE) -- CAUTION LIGHT PANEL caution_lamp(481,SystemsSignals.flag_L_HYD_PRESS) -- CAUTION LIGHT PANEL caution_lamp(482,SystemsSignals.flag_R_HYD_PRESS) -- CAUTION LIGHT PANEL caution_lamp(483,SystemsSignals.flag_GUN_UNSAFE) -- CAUTION LIGHT PANEL caution_lamp(484,SystemsSignals.flag_ANTISKID) -- CAUTION LIGHT PANEL caution_lamp(485,SystemsSignals.flag_L_HYD_RES) -- CAUTION LIGHT PANEL caution_lamp(486,SystemsSignals.flag_R_HYD_RES) -- CAUTION LIGHT PANELIn the Export.lua, there is an array at the beginning where you define which events you're interested in: gArguments = {[404]="%.1f"}The ProcessMainPanel() function will only execute the SendData() function if the event is listed in that array.
  14. See Gadroc's Export.lua which is what was the key for my understanding how it all works. Also, see my post on a little bit more detail on how to address each switch in sim. Basically, you will have an app that listens on a UDP port for values from the sim sent by the Export.lua script and can act accordingly (e.g. turn on a master caution light). Then conversely, the script listens for UDP packets in a specific format that will press a button or flip a switch. This last bit is from memory so it may not be 100% accurate: For your specific case of the Master Caution, Export.lua will send you a stream of packets indicating the state of the light (blinking on and off). Something like this: 404=1 404=0 404=1 404=0 etc. (there are some other bits in the string you receive but I can't remember the exact format now). To press the Master Caution button and cancel the warning, you would send UDP packets back to the sim in the form of: C24,3001,1.0 C24,3001,0.0 The Export lua parses that and presses (the 1.0) then releases (the 0.0) the MC button by executing the performClickableAction() function.
  15. Not sure if this belongs in the DCSW or the DCS:A10 bug forum... When in the F2 view, the camera seems to slowly meander around. Here's an example (AP on ALT/HDG, sped up to 10x speed). 1.1.1.1 didn't behave this way...just curious if it's a new feature. Maybe to simulate the view being from a chase plane?
  16. Get the device where the switch you want to manipulate resides. In this case for GUN/PAC switch is on the AHCP. So in [your DCS folder]\Scripts\Aircrafts\A-10C\Cockpit\devices.lua find the line: devices["AHCP"] = counter()--7 Note the number "7" at the end. That is the device ID of the AHCP. Then in [your DCS folder]\Scripts\Aircrafts\A-10C\Cockpit\clickabledata.lua find the AHCP section and then locate the line for the GUNPAC switch: elements["PNT-TMB-AHCP-GUNPAC"] = {class = {class_type.TUMB,class_type.TUMB}, hint = _("Gun Arm Mode"), device = devices.AHCP, action = {device_commands.Button_2,device_commands.Button_2}, arg = {376,376}, arg_value = {0.1,-0.1}, arg_lim = {{0.0, 0.2},{0.0, 0.2}} } Note the "action" line "Button_2". The ID of the button is 3000 + the "2" so 3002. The arg_value = {0.1, -0.1}, arg_lim={{0.0,0.2},{0.0,0.2}} means to add 0.1 up to a limit of 0.2 for each left click or subtract 0.1 down to a limit of 0.0 for each right click. In your Export.lua, to set the button position you do the following: --get the device... ahcp = GetDevice(7) --the AHCP device ID --set which switch to manipulate gunpac_switch = 3002 --the GUN/PAC switch ID --set the position you want switch_pos_down = 0.0 --switch down for GUNARM switch_pos_mid = 0.1 --switch middle for SAFE switch_pos_up = 0.2 --switch up for GUN/PAC --perform the actual "click" up to GUN/PAC ahcp:performClickableAction(gunpac_switch, switch_pos_up) --or safe... ahcp:performClickableAction(gunpac_switch, switch_pos_mid) --or down for GUNARM... ahcp:performClickableAction(gunpac_switch, switch_pos_down)See Gadroc's Export.lua which really was really the key to my understanding after much searching. Also see Export 101 from the ED wiki. It's geared more towards BS but the principles are the same.
  17. It's not a fluke. TIR software does not differentiate between devices. I made a post on the Natural Point forums but got no reply. I use the default DX mode of the Warthog (i.e. no TARGET profile). Quoting my own post on their forum:
×
×
  • Create New...