Jump to content

Warthog Joy_Slider1 Joy_Slider2 problem


Lange_666

Recommended Posts

When i don't run a script, the slider axis on the Throttle comes up as Joy_Slider1.

When i run a script, the slider axis on the Throttle comes up as Joy_Slider2.

If i enter DCS with no script running, it gives the name Joy_Slider1 to the slider axis. When i run a script after that, the slider has no assignment anymore and i have to re-assign the axis which then turns up as Joy_Slider2. This goes fine until i enter DCS again with no script running and then slider assignment is gone again and i must set it again, and again if i enter DCS later with a script.

I presume this comes from the fact that when running a script, the 2 devices are combined into 1 device.

I've looked through the script and it's files, made some changes to defines.tmh and hid.tmh removing every device i don't have keeping only the joystick and the throttle and by removing everything i could find regarding a slider number bigger then 1. No joy.

 

Question is: why is Joy_Slider1 replaced by Joy_Slider2 when the 2 devices are combined?

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

When you run a TARGET profile you are turning your included controllers into a virtual one. The Name of the Axis in that virtual controller will be whatever is defined in that profile you are running. You can have Joy_Slider1 or 2 or any other axis wherever you like them. Check your profile to see what you have assigned to what.

Assigning an axis without the profile working will not affect your axis assignments with the profile running. Because as far as windows and DCS are concerned they are not the same device. So if you want to make a axis assignment for your profile, you must do it with the profile running.

Link to comment
Share on other sites

So there still must be a JoySlider2 assignment somewhere in the profile then (one of the various files then)?

I already put a // in front of all i could find in all files except for 2 or 3 where i can't do that without running into compile errors.

One of them uses bits (0 or 1) to define which axis should be active on what device. Guess it's the hid.tmh file somewhere on the bottom.

I can't copy paste right now since i'm at work and can't download a hid.tmh file to look at (somehow they forgot to block the access to ED's forum but i can't access stuff like https://www.digitalcombatsimulator.com from work)

If i remember correctly it looks something like this:

//...................RZ SLD1 SLD2 SLD3 SLD4

Throttle........... 1,..1, .....1, ....0, ....0};

(i added the points to line up the selections).

As you can see, Slider2 is active but if i set that to 0 i get a compile error (can't remember which one either, will have to look at it when i'm at home).

 

I'm don't have real knowledge of the Target programming language, i learn as i go... which means not every explenation is clear or understandable to me (i do have (some) knowlegde of other programming languages like Siemens or Phoenix PLC's so in the end i will find my way around a bit in Target, but for now i'm still on the learning side...)

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

Script.

 

I did set everything back to original after messing around with it (and i had a backup made)...;)

I went there because in the profile i don't find anything that could be the problem.

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

Here's my axis mapping, from my AV8B script with an F18 grip:

 

//AXIS init        
   [b]MapAxis(&JoystickF18, JOYX, DX_X_AXIS);[/b]//initial default joy stick "X" 
       [b]SetSCurve(&JoystickF18, JOYX, 0, 0, 0, 0, 2);[/b]
   [b]MapAxis(&JoystickF18, JOYY, DX_Y_AXIS)[/b];//initialize default joy stick "Y" 
       [b]SetSCurve(&JoystickF18, JOYY, 0, 0, 0, 0, 2);[/b]
   
   //MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS);
   [b]MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS);[/b]
   
//*********Slew Stick acting as Mouse    
//    MapAxis(&Throttle, SCX, MOUSE_X_AXIS, AXIS_NORMAL, MAP_RELATIVE);
//        SetSCurve(&Throttle, SCX, 0, 10, 0, 0, -4);
//    MapAxis(&Throttle, SCY, MOUSE_Y_AXIS, AXIS_REVERSED, MAP_RELATIVE);
//        SetSCurve(&Throttle, SCY, 0, 10, 0, 0, -4);

//*********Slew Stick acting as independent AXIS.  NOT Mouse!!!  Used to setup control of A/C TDC        
   MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
       SetSCurve(&Throttle, SCX, 0, 5, 0, 3, 0);
   MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_REVERSED, MAP_ABSOLUTE);
       SetSCurve(&Throttle, SCY, 0, 5, 0, 3, 0);
   //TDC Slew Control on Throttle Mini Stick    
   //KeyAxis(&Throttle, SCX, 0, AXMAP2(3, ,0, ));
   //KeyAxis(&Throttle, SCY, 0, AXMAP2(3, ,0, ));    
       
   [b] MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS); [/b]       //    Assigned in game as Nozzle Control Lever

 

 

There's only one slider on the Throttle, I don't know where you seeing joy_slider_1 / 2 reported.

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

The Thrustmaster Combined Axis that DCS recognizes as Slider1 is the Axis Called "Throttle"

 

Program it as:

MapAxis(&Throttle, THR_FC, DX_THROTTLE_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

 

instead of:

MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

Link to comment
Share on other sites

There's only one slider on the Throttle, I don't know where you seeing joy_slider_1 / 2 reported.

Only if i run a script.

If i use the Warthog without a script running, i have Joy_Slider_1 in DCS.

If i run a script, DCS doesn't see the Joy_Slider_1 anymore (and removed it from its assignment). I have to re-assign that function again (Zoom in this case) and then it comes up as Joy_Slider_2.

 

 

@lxapper: I'll check that when i'm home.

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

The Thrustmaster Combined Axis that DCS recognizes as Slider1 is the Axis Called "Throttle"

 

Program it as:

MapAxis(&Throttle, THR_FC, DX_THROTTLE_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

 

instead of:

MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

This did the trick...:joystick: Earned a rep!

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

Lange_666, I've seen a few posts you made where you are modifying the stock .tmh files (target.tmh, hid.tmh, defines.tmh, and/or sys.tmh) to solve a problem with your script (not add a feature, but solve a problem). I fear you may be making things difficult on yourself. There is absolutely no reason to touch these files unless you are trying to add a feature that TARGET does not support (e.g. the 128 DX button mod). Even then, because you are new to TARGET, I would suggest sticking with unmodified .tmh files until you really need to add such features. Modifying the .tmh files to solve a problem will only make things worse.

 

TARGET is very powerful, which means the more complicated your script, the more likely you will create errors or issues. You have run into quite a few "advanced" issues in the last couple weeks, most of which are directly related to making things more complicated than needed. I certainly don't want to discourage you from trying complex scripts. At the rate you are going, by the end of the year, you will be a TARGET guru. But for now, simplicity might be your friend.

Link to comment
Share on other sites

Modifying the .tmh files to solve a problem will only make things worse.

Thanks for the heads-up Drakoz, i'm running stock .tmh files again since lxsapper came up with the solution for my Slider_1 / Slider_2 problem (except for the target.tmh where i // out all the devices i don't have, as this gives me a clean compile without the "USB HID device with hardware id xxxx cannot be found" errors. I do have an original backup...:))

I have a bit of programming knowledge albeit not in C (or it's derivates) and i'm learning as i go so when a problem shows up and can't find it, i quickly start to wander off the straight forward track which then leads sometimes to...:helpsmilie:

 

I do find that Thrustmaster could have done a bit better regarding it's script editor as it contains a few quirks i ran into which i find annoying. Anything better around that i could use as a replacement?

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

Rgr that, i'll correct that.

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

To exclude a device, use the Configure() command. Do one for each TM device you don't have. Here is the entire list. Just comment out the devices you want to use.

 

Configure(&Joystick, MODE_EXCLUDED);		// Exclude Warthog Joystick
//Configure(&Throttle, MODE_EXCLUDED);		// Exclude Warthog Throttle
Configure(&HCougar, MODE_EXCLUDED);		// Exclude Cougar Stick and Throttle
Configure(&T16000, MODE_EXCLUDED);		// Exclude T16000M Joystick (Right Hand)
Configure(&T16000L, MODE_EXCLUDED);		// Exclude T16000M Joystick (Left Hand)
Configure(&LMFD, MODE_EXCLUDED);		// Exclude Left MFD
Configure(&RMFD, MODE_EXCLUDED);		// Exclude Right MFD
//Configure(&TWCSThrottle, MODE_EXCLUDED);	// Exclude TWCS Throttle
Configure(&TFRPRudder, MODE_EXCLUDED);		// Exclude TFRP Rudder
Configure(&TFRPHARudder, MODE_EXCLUDED);	// Exclude TFRPHA Rudder
Configure(&JoystickF18, MODE_EXCLUDED);		// Exclude F18 Stick Handle

 

For a text editor, ya don't use the TARGET Script editor. Notepad++ is a much better choice. Set Notepad++ to think of .tmc, .ttm, and .tmh files as C files and it will color the text correctly. I recently started using Visual Studio Code (Microsoft's code editor, not their developer environment which is just Visual Studio). VS Code gives better control over multiple files, side by side views, etc. But it is a programmer's editor, so I wouldn't call it user friendly.

 

But the key point is the TARGET Script editor doesn't compile the file in the editor window. It compiles the file off the hard disk. So if you edit the file in an external editor like Notepad++ and save it, TARGET will compile your newly saved file. Just ignore the files that are opened in TARGET. A warning, though. I think, if you make an edit to the file in the TARGET Script editor, it will compile the file in TARGET, or at least give you a moment of confusion as it asks if you want to save the file or something like that. So make sure you don't accidentally make an edit there.

 

You can also compile and run the .tmc file using the TARGETGUI.exe if you use the -r command line option. It is the same compiler used by the TARGET GUI program, but the -r option bypasses the GUI and just brings the compiler and the console window which prints out the messages from TARGET, or your script.

Link to comment
Share on other sites

To exclude a device, use the Configure() command. Do one for each TM device you don't have. Here is the entire list. Just comment out the devices you want to use.

 

If i use the default target.tmh again and add the code above to my xxxxx.tmc and comment out those i use i still get this when compiling. It compiles fine just as before but always comes with devices not found. This is exactly the same as i would not use the "Configure" code.

 

Compile Succeeded.
Physical USB HID devices managed by script!
Currently plugged USB HID devices[2]:
1: "Throttle - HOTAS Warthog" - "USB\VID_044F&PID_0404&REV_0100"
2: "Joystick - HOTAS Warthog" - "USB\VID_044F&PID_0402&REV_0100"
USB HID device "Throttle - HOTAS Warthog"(USB\VID_044F&PID_0404\5&2B894F0D&0&4) selected
USB HID device "Joystick - HOTAS Warthog"(USB\VID_044F&PID_0402\5&2B894F0D&0&3) selected
USB HID device with hardware id "VID_044F&PID_0403" cannot be found
USB HID device with hardware id "VID_044F&PID_b351" cannot be found
USB HID device with hardware id "VID_044F&PID_b352" cannot be found
USB HID device with hardware id "VID_044F&PID_0400" cannot be found
USB HID device with hardware id "VID_044F&PID_B10A" cannot be found
USB HID device with hardware id "VID_044F&PID_B10B" cannot be found
USB HID device with hardware id "VID_044F&PID_B687" cannot be found
USB HID device with hardware id "VID_044F&PID_B679" cannot be found
USB HID device with hardware id "VID_044F&PID_B68F" cannot be found
Virtual HID devices managed by script!
Connecting virtual joystick...Done
Device name set to Thrustmaster Combined
Connecting virtual keyboard...Done
Connecting virtual mouse (absolute axes)...Done

The only way i found to remove the USB HID Device cannot be found messages while compiling is to comment out the alias instructions in the target.tmh. That's why i started tinkering with them in the first place.

 

Original target.tmh

[color=#1e90ff][b]alias[/b][/color] Throttle        = [color=#ff1493]"VID_044F&PID_0404"[/color], Joystick    = [color=#ff1493]"VID_044F&PID_0402"[/color];
[color=#1e90ff][b]alias[/b][/color] LMFD        = [color=#ff1493]"VID_044F&PID_b351"[/color], RMFD    = [color=#ff1493]"VID_044F&PID_b352"[/color];
[color=#1e90ff][b]alias[/b][/color] HCougar        = [color=#ff1493]"VID_044F&PID_0400"[/color], T16000    = [color=#ff1493]"VID_044F&PID_B10A"[/color];
[color=#1e90ff][b]alias[/b][/color] TWCSThrottle    = [color=#ff1493]"VID_044F&PID_B687"[/color], TFRPRudder    = [color=#ff1493]"VID_044F&PID_B679"[/color], T16000L    = [color=#ff1493]"VID_044F&PID_B10B"[/color];
[color=#1e90ff][b]alias[/b][/color] TFRPHARudder    = [color=#ff1493]"VID_044F&PID_B68F"[/color], JoystickF18    = [color=#ff1493]"VID_044F&PID_0403"[/color];

Gives the same above "cannot be found" messages, even with the Configure instructions added to my xxxxx.tmc. So what's the benefit of using it?

 

 

If i comment those out i don't use tand never will) in the target.tmh like this (BTW, light green is a bad colour...LOL):

[color=#1e90ff][b]alias[/b][/color] Throttle        = [color=#ff1493]"VID_044F&PID_0404"[/color], Joystick    = [color=#ff1493]"VID_044F&PID_0402"[/color];
[color=#32cd32]// alias LMFD        = "VID_044F&PID_b351", RMFD    = "VID_044F&PID_b352";[/color]
[color=#32cd32]// alias HCougar        = "VID_044F&PID_0400", T16000    = "VID_044F&PID_B10A";[/color]
[color=#32cd32]// alias TWCSThrottle    = "VID_044F&PID_B687", TFRPRudder    = "VID_044F&PID_B679", T16000L    = "VID_044F&PID_B10B";[/color]
[color=#32cd32]// alias TFRPHARudder    = "VID_044F&PID_B68F", JoystickF18    = "VID_044F&PID_0403";[/color]

The USB HID Device cannot be found stuff is gone when compiling.

 

Compile Succeeded.
Physical USB HID devices managed by script!
Currently plugged USB HID devices[2]:
1: "Throttle - HOTAS Warthog" - "USB\VID_044F&PID_0404&REV_0100"
2: "Joystick - HOTAS Warthog" - "USB\VID_044F&PID_0402&REV_0100"
USB HID device "Throttle - HOTAS Warthog"(USB\VID_044F&PID_0404\5&2B894F0D&0&4) selected
USB HID device "Joystick - HOTAS Warthog"(USB\VID_044F&PID_0402\5&2B894F0D&0&3) selected
Virtual HID devices managed by script!
Connecting virtual joystick...Done
Device name set to Thrustmaster Combined
Connecting virtual keyboard...Done
 Connecting virtual mouse (absolute axes)...Done

I just did this to remove the "cannot be found" messages because it bothered me and found it a nice solution ...

 

But if it makes no difference i can use the original target.tmh but then without the Configure lines to my xxxxxx.tmc files since the outcome is the same and just adds more code lines.

Or am i wrong somewhere (besides the fact that the .tmh files should be left alone).

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

You have to put the Configure() statements before the if(Init(&EventHandle)) return 1; line.

 

BTW, Configure() is actually intended to allow you to have a Thrustmaster device attached to your computer and Configure() will prevent that device from being a part of the Thrustmaster Combined setup created by TARGET. Hence it will remain as a normal DirectX controller. But many of us use Configure to get rid of the device not found messages in the TARGET console.

 

Now that you have some time with basic scripts, you might want to review the TARGET Script manual again. There is a lot of info there, but often you have to read it several times to understand it. Even now, I often look something up in the manual and I am reminded of something I forgot, or didn't quite understand previously.

Link to comment
Share on other sites

To exclude a device, use the Configure() command. Do one for each TM device you don't have. Here is the entire list. Just comment out the devices you want to use.

 

 

With the Configure() statement moved up above the if(Init(&EventHandle)) return 1; line as you said, all is fine now...:thumbup:

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...