How to set up toggle switches (a tutorial) - Page 38 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 10-16-2017, 11:58 AM   #371
LeCuvier
Member
 
Join Date: May 2013
Location: South of France
Posts: 990
Default Radiator Flaps

@vortexringstate: I have tried to create a OPEN/CLOSED command. This does not work as the command does not work with "down" and "up" at all. It requires a 3-state switch input ON/OFF/ON with spring return to OFF.
__________________
LeCuvier
Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5
LeCuvier is offline   Reply With Quote
Old 11-03-2017, 02:21 PM   #372
Baz000
Member
 
Join Date: May 2015
Posts: 535
Default

How would you use target to do what is done with the .lua code editing? I prefer using a gui instead of hundreds of lines of code.
Baz000 is offline   Reply With Quote
Old 11-03-2017, 03:22 PM   #373
majapahit
Member
 
Join Date: Jul 2009
Posts: 924
Default

Quote:
Originally Posted by Baz000 View Post
How would you use target to do what is done with the .lua code editing? I prefer using a gui instead of hundreds of lines of code.
Use TARGET TARGETGUI.exe to set up you commands per button per the manual.

Create 'new',
use 'basic' otherwise you'll have those 5x 'shifted' states unless you want that,
assign which controllers you want to use,
assign Axis (leave default),
assign commands to buttons by double click the button and then
type 'Event Name'
(f.i. 'gear up AND down' which would involve not just 'Pulse', but rather both a 'Press' and a 'Release)
Add Event and Save Event which then shows up in the right column 3. of events
'SAVE' (bottom left) this script TARGETGUI script so it is actually a file for safekeeping
'RUN CONFIGURATION' to test the script
when OK (save again if you forgot)
do
VIEW SCRIPT this is the TARGETScriptEditor.exe version of the commands file
(you need to learn the TARGETScriptEditor syntax which is much quicker)

you now have 3 options
1 - always load though the TargetGUI and "Run Configuration"
2 - or, run the script translation created by 'VIEW SCRIPT' with TARGETScriptEditor
3 - or, you run the script translation created by 'VIEW SCRIPT' a .tmc file that is a definitions batch as a command line with TargetGUI

simple what? (yep Thrustmaster did a horrible job)

So to set up a KA-50 script, you
- test an define starting with TargetGUI (and save f.i. as <KA-50.fcf>)
- then you create a .tmc file by 'VIEW SCRIPT' that you can run with TARGETScriptEditor (and saved as <KA-50.tmc>
- then when all is tested and running nicely you can run the .tmc <KA-50.tmc> as a command line with TargetGUI in for instance a setup batch file, as in my KA-50_setup.bat that loads my trackIR etc and has the line

rundll32 shell32.dll,ShellExec_RunDLL "k:\Program Files (x86)\Thrustmaster\TARGET\x64\TARGETGUI.exe" -r "i:\TEKST\My Games\DCS\TMTARGET_profiles\KA-50.tmc"

after you have learned the syntax of the .tmc file, that's a lot quicker.
__________________
Autopilot panel | Headtracker | TM HOTAS | G920 HOTAS | Throttle Quadrants | 8600K | GTX 1080 | 16GB RAM| Win 10 x64 | Voicerecognition | 40" 1080p TV | 2x 24" 1080p side monitors | 24" 1080p touchscreen | VR googles
majapahit is offline   Reply With Quote
Old 11-05-2017, 11:25 AM   #374
The LT
Member
 
The LT's Avatar
 
Join Date: Jan 2013
Location: Moscow, Russian Federation
Posts: 419
Send a message via ICQ to The LT
Default

Quote:
Originally Posted by Baz000 View Post
How would you use target to do what is done with the .lua code editing? I prefer using a gui instead of hundreds of lines of code.
Well, that's too bad for you, as it is much easier to fix the code instead of fumbling around with a crappy GUI.
__________________
My controls & seat
Spoiler:
Main controls: , BRD-N v4 Flightstick (Kreml C5 controller), TM Warthog Throttle (Kreml F3 controller), BRD-F2 Restyling Bf-109 Pedals w. damper, TrackIR5, Gametrix KW-908 (integrated into RAV4 seat)

Stick grips:

Thrustmaster Warthog
Thrustmaster Cougar (x2)
Thrustmaster F-16 FLCS
BRD KG13

Standby controls:
BRD-M2 Mi-8 Pedals (Ruddermaster controller)
BRD-N v3 Flightstick w. exch. grip upgrade (Kreml C5 controller)
Thrustmaster Cougar Throttle

Pilot seat
The LT is offline   Reply With Quote
Old 11-05-2017, 01:17 PM   #375
LeCuvier
Member
 
Join Date: May 2013
Location: South of France
Posts: 990
Default

Quote:
Originally Posted by The LT View Post
Well, that's too bad for you, as it is much easier to fix the code instead of fumbling around with a crappy GUI.
I have used TARGET and I didn't find it crappy. You can do things with TARGET that you cannot do with .lua editing, e.g. generating a sequence of commands with one pushbutton press.
However, when I started using TrackIR and now had two pieces of software that had to work alongside with DCS World, I had rather frequent malfunctions. So my love for TARGET cooled somwhat. Nowadys I use the VIRPIL T-50 joystick and TARGET doesn't work with that. So TARGET isn't even an option any more.
I understand there are other programs that are conceptually similar to TARGET and work with most HOTAS devices; but I have come to the conclusion that any solution requiring multiple pieces of software to inter-operate has a relatively high potential for failure.
__________________
LeCuvier
Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5
LeCuvier is offline   Reply With Quote
Old 11-05-2017, 01:32 PM   #376
majapahit
Member
 
Join Date: Jul 2009
Posts: 924
Default

Quote:
Originally Posted by LeCuvier View Post
However, when I started using TrackIR and now had two pieces of software that had to work alongside with DCS World, I had rather frequent malfunctions.
My experience with additional software and plenty of USB devices, the USB assignments f**k up.

I use
JoyIDs to check the ID of the joystick,
USBDeview to clean out the USB assignments and start over,

I've notices with many USB devices you can only use a certain sequence of ports or things go haywire, which is trial and error and then never change a successful way of assignments sequence.

I have a TMWH and a Logitech g940 together, Trackir and a MCPCombo, and a assortment of keyboard pads, race wheels etc. Windows 7 x64

When I would attach my G940 (FFB) to another USB port, things won't work.

I tried Win10 when it was introduced, what bad USB management that was, Win 8.1 better but not so stable USB management as slower Win 7. I'll try Win 10 again when I upgrade to a new motherboard, and hopefully it has improved.
__________________
Autopilot panel | Headtracker | TM HOTAS | G920 HOTAS | Throttle Quadrants | 8600K | GTX 1080 | 16GB RAM| Win 10 x64 | Voicerecognition | 40" 1080p TV | 2x 24" 1080p side monitors | 24" 1080p touchscreen | VR googles
majapahit is offline   Reply With Quote
Old 11-18-2017, 09:07 AM   #377
Axelerator
Senior Member
 
Axelerator's Avatar
 
Join Date: Jul 2014
Location: France
Posts: 1,055
Default

Just stumbled on this thread. 5 & 1/2 years later is there anyway I can setup toggles in the UI without having to do it manually like the OP explained? Thanks!
Axelerator is offline   Reply With Quote
Old 11-18-2017, 10:25 AM   #378
majapahit
Member
 
Join Date: Jul 2009
Posts: 924
Default

Quote:
Originally Posted by Axelerator View Post
Just stumbled on this thread. 5 & 1/2 years later is there anyway I can setup toggles in the UI without having to do it manually like the OP explained? Thanks!
I discovered the hack that adds 128 (or 68 ) additional DX definitions to the standard TARGET profile, normally its limited to DX 32 which is way to few for TMWH,
so your 'virtual TMWH' runs out of UI assignments at the throttle pretty quickly (button 6 or something),

adding DX128 makes all/most TMWH 'positions' (also 'OFF") accessible through the UI

So, you load a target .tmc profile with the additional DX assignments,

"C:\Program Files (x86)\Thrustmaster\TARGET\scripts\targetdx128.tmh"

edit the .tmc header

"include "targetdx128.tmh" // (use expanded targetdx128.tmh instead of target.tmh - default Thrustmaster function code)

have targetdx128.tmh in your target script path
<"c:\Program Files (x86)\Thrustmaster\TARGET\scripts">

et voila
many more TMWH ON/OFF accessible through the normal DCS config UI

(still takes some effort though till you've figured this out)

find the thread of the original poster about this, hidden deep, but its still confusing (but I use it though)
Attached Files
File Type: zip target dx128 128 DX BUTTONS.zip (9.8 KB, 55 views)
__________________
Autopilot panel | Headtracker | TM HOTAS | G920 HOTAS | Throttle Quadrants | 8600K | GTX 1080 | 16GB RAM| Win 10 x64 | Voicerecognition | 40" 1080p TV | 2x 24" 1080p side monitors | 24" 1080p touchscreen | VR googles
majapahit is offline   Reply With Quote
Old 12-28-2017, 12:11 PM   #379
Morpheus
Member
 
Morpheus's Avatar
 
Join Date: Dec 2010
Location: France
Posts: 403
Default

I read all the topic to find solution for what I want to do without success. I have a Leobodnar card (BBI 32) and I want to simulate the action on the switch cover in my L-39. I Have a switch cover https://cdn.manomano.fr/couvercle-de-protection-tru-components-1587853-rouge-transparent-tc-r17-10b-1-pcs-T-2009294-5154240_1.jpg
I have a switch (on) off (on). (momentary on/off/monetary on) http://media.rs-online.com/t_large/F2519269-01.jpg
I want DCS accept the release action when I open the cover but DCS doesn't see it, it only accept off ==> on but not on ==> off.
Lines in default keyboard lua of L-39C are

Spoiler:
{combos = {{key = 'End', reformers = {'RCtrl'}}}, down = electric_commands.L39C_Command_EngineStopSwCover_EXT, cockpit_device_id = devices.ELEC_INTERFACE, value_down = -1.0, name = _('Engine Stop Switch Cover - OPEN/CLOSE'), category = {_('Engine'), _('Left Console')}},
{ down = electric_commands.L39C_Command_EngineStopSwCover_EXT, cockpit_device_id = devices.ELEC_INTERFACE, value_down = 1.0, name = _('Engine Stop Switch Cover - OPEN'), category = {_('Engine'), _('Left Console')}},
{ down = electric_commands.L39C_Command_EngineStopSwCover_EXT, cockpit_device_id = devices.ELEC_INTERFACE, value_down = 0.0, name = _('Engine Stop Switch Cover - CLOSE'), category = {_('Engine'), _('Left Console')}},


I didn't find how to make DCS see switch goes from on to off when I open the cover and I want to make the same for Turbo switch cover

Is it possible and if yes ...... how can I make it ?
++Morpheus
__________________

Breitling By Jetesons Flight Lead
Morpheus is offline   Reply With Quote
Old 12-28-2017, 01:46 PM   #380
LeCuvier
Member
 
Join Date: May 2013
Location: South of France
Posts: 990
Default

Quote:
Originally Posted by Morpheus View Post
I read all the topic to find solution for what I want to do without success. I have a Leobodnar card (BBI 32) and I want to simulate the action on the switch cover in my L-39...
I didn't find how to make DCS see switch goes from on to off when I open the cover and I want to make the same for Turbo switch cover

Is it possible and if yes ...... how can I make it ?
++Morpheus
I'm not totally sure I understand your intended switch combination. The easiest solution would be if the switch cover produced a maintained ON/OFF signal.
Also I'm not sure why you refer to the default.lua under "keyboard". I believe that your Bodnar board is seen by the game as a joystick-like device. In that case you should modify the default.lua under "Joystick".
So for a maintained cover switch you should add just one line to the default.lua under joystick:
Code:
{down = electric_commands.L39C_Command_EngineStopSwCover_EXT, up = electric_commands.L39C_Command_EngineStopSwCover_EXT, cockpit_device_id = devices.ELEC_INTERFACE, value_down = 1.0, value_up = 0.0, name = _('Engine Stop Switch Cover 2-Pos OPEN/CLOSE'), category = {_('Engine'), _('Left Console')}},
This code assumes that the contact closes when you open the cover and stays closed until you close the cover.
If your contact operation is reversed then simply swap the "value-up"/"value_down so that they read "value_down = 0.0, value_up = 1.0".
Make sure you have ticked the parameter "Synchronize Cockpit controls with HOTAS Controls at Mission Start" under Options --> Miscellaneous.
Now if your cover switch is momentary ON1/OFF/ON2 then you don't need to customize anything. Just bind the "Open" side of your switch to "Engine Stop Switch Cover - OPEN" and the "Close" side of your switch to "Engine Stop Switch Cover - CLOSE".

If I have totally understood you, please PM me and we can have a conversation via Skype or telephone (I live in the Provence and I speak French)
__________________
LeCuvier
Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5
LeCuvier is offline   Reply With Quote
Reply

Tags
controls, lua, tm warthog, toggle switches, tutorials

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 05:36 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.