-MadCat- Posted December 29, 2012 Posted December 29, 2012 Hey everyone, as the search function didn't yield sufficient answers to my problem, I try to ask this way. Inspired by this thread: http://forums.eagle.ru/showthread.php?p=1428587#post1428587 I started creating stateful button commands for BS2 to better suit the Warthog's throttle switches. So far everything worked out flawlessly and I created stateful commands for the Dust/Ice protection system, the burst lenght and the laser Standby/Off switches. However the Fuel Cut-Off levers are giving me a headache. This is the code I tried to implement into the keyboard.lua. {down = 3009, cockpit_device_id = 4, value_down = 0.0, name = "Cut-Off Valve Left Engine Close", category = "Ins Engines start-up control panel and levers"}, As with all the previous codes I implemented, the new command shows up in the designated options and I can assign a button to it. Now comes the annoying part. It works and lets me move the Cut-Off lever up, however on the next press, the lever goes down again, so the effect is exactly the same as if I'd assign a button to the normal "left engine cut-off valve" command, hence the purpose of a stateful command is not fulfilled. I rewrote the code now several times, tried several .lua files to implement it into, all with the same result that the newly assigned command still actuates the lever both ways. Altering the value_down = # also shows no effect, I even tried "0.5" to no avail. In addition to that, here are the parts from the clickabledata.lua and the devices.lua, where I got the values from. elements["EMERGENCY-BRAKE ENGINE-LEFT-PTR"] = { class = {class_type.TUMB, class_type.TUMB}, hint = LOCALIZE("Left engine cut-off valve"), device = devices.ENGINE_INTERFACE, action = {device_commands.Button_9,device_commands.Button_9}, arg = {554,554}, arg_value = {direction*1.0,-direction*1.0}, arg_lim = {{0.0, 1.0},{0.0, 1.0}}, updatable = true, use_OBB = true} devices["ENGINE_INTERFACE"] = 4 Maybe one of you guys knows what I'm doing wrong. I'd be thankful for everyone trying to help. Thanks so far, greetings MadCat Link -> Stateful button commands for many DCS modules
BigfootMSR Posted December 30, 2012 Posted December 30, 2012 Im not sure I follow what you are trying to do.... you only want to assign the button to the up position and so it wont ever do anything when pressed again except make sure its in the up position? If that is the case, I don't think its quite possible to do the way you want with every switch and lever in the game. Somebody with more expertise may know better however. DCS: A10C Warthog JTAC coordinate entry training mission http://www.digitalcombatsimulator.com/en/files/99424/ DCS: Blackshark 2 interactive training missions http://forums.eagle.ru/showthread.php?t=84612
-MadCat- Posted December 30, 2012 Author Posted December 30, 2012 Hey Bigfoot! Yes, that's what I want to do, create a command that only puts the lever in the up position. The next step would be to create another command to put the lever in the down position, and repeat that for the right cut-off valve too. So at the end I'd have 2 commands for each lever that only moves it ONE way at a given button press. So far it worked perfectly fine for burst length, anti dust/ice, laser ranger, gun auto tracking/gunsight, landing gear up/down, rotor anti ice and the search light. It only is the cut-off levers that refuse to let me set a distinct up or down position. Link -> Stateful button commands for many DCS modules
BigfootMSR Posted December 31, 2012 Posted December 31, 2012 Unfortunately, it does not appear to be possible with the way the cut off is handled by the game. Those levers appear to be handled much like the autopilot channels, you press them once to turn on and once again to turn off. They do not have a distinct off position per say that can be assigned as a different value unlike most of the toggle switches in the pit. The other switches you mentioned are switches and handled differently by the game and thus can be assigned a specific up, left, right, whatever. At the moment its not possible to modify the .lua code to create your own types of control movements. If this was the case, many A-10 pit builders would jump at the chance to have the canopy switch work correctly including myself. The only other thing I could suggest would be to try sending a message to Speed or Grimes here on the forums. They do a lot work with the .lua codes in the game and may know of a way to make your wish come true. Sorry I cant be of any more help. DCS: A10C Warthog JTAC coordinate entry training mission http://www.digitalcombatsimulator.com/en/files/99424/ DCS: Blackshark 2 interactive training missions http://forums.eagle.ru/showthread.php?t=84612
tietze Posted January 31, 2013 Posted January 31, 2013 Hi, I've tried to create a bug-report for this. Please fix the KA-50 bugs :-) Black Shark: Controller profile & setup, TrackIR profile, pit. Warthog HOTAS: Lubing the stick and extending the stick. Posts on howto customize switches in DCS & . Must-have mods for DCS World and KA-50 (mostly JSGME). Casual couch pilot, watching capped.tv...
Puddlemonkey Posted January 31, 2013 Posted January 31, 2013 Not sure if this helps but I use: {combos = {{key = "JOY_BTN18"}, }, down = 3009, up = 3009, cockpit_device_id = 4, value_down = 0, value_up = 1, name = "Cut-off valve left engine on", category = "Ins Engines start-up control panel and levers"}, This works for me, using a toggle switch. However, there is one drawback and that is that the position the switch needs to be in is different, depending on whether it is a hot or cold start in the mission.
Tiogar Posted January 31, 2013 Posted January 31, 2013 I'm still setting up my P51-D Commands. I found this post from Spy Guy very helpful. Maybe something in there for you? http://forums.eagle.ru/showthread.php?t=89226&highlight=lua+joystick
tietze Posted January 31, 2013 Posted January 31, 2013 Not sure if this helps but I use: {combos = {{key = "JOY_BTN18"}, }, down = 3009, up = 3009, cockpit_device_id = 4, value_down = 0, value_up = 1, name = "Cut-off valve left engine on", category = "Ins Engines start-up control panel and levers"}, Yep, it works if you remember to sync the HOTAS of course! I think I'll go with BTN31-32 for the moment :-) @Tiogar: yes it certainly is! Please fix the KA-50 bugs :-) Black Shark: Controller profile & setup, TrackIR profile, pit. Warthog HOTAS: Lubing the stick and extending the stick. Posts on howto customize switches in DCS & . Must-have mods for DCS World and KA-50 (mostly JSGME). Casual couch pilot, watching capped.tv...
Recommended Posts