

SparkyOV
Members-
Posts
18 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Hooray! Good luck! PM me if you have further questions.
-
From my understanding, yes.
-
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.
-
"%.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
-
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.
-
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
-
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
-
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.
-
Glad to be of help and good luck!
-
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
-
Try this one: http://bansky.net/echotool/
-
I never got the log file working either. I just wrote a simple UDP listener that dumped what it received to the console.
-
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.
-
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.
-
F2 external view "wobble"...bug or feature in 1.1.2.1?
SparkyOV replied to SparkyOV's topic in View System
Got it. Thanks!