Jump to content

Recommended Posts

Posted

Hi gang,

I wanted to ask here on this forum, as I know there are some knowledgeable folks here on Target scripting. I started learning the Script editor, and created a script for BOS that had been working ok, but now for whatever reason, the Throttle keeps dropping out whilst running the script.

 

Now it only drops out while the script is running and in virtual mode. If I stop the script and open device analyzer, or windows game control panel for that matter, the throttle is recognized and operating appropriately, so I would think there must be something in my script that is causing this...

 

I have copied and pasted my script below, I would sure appreciate it if someone much better than me at scripting would take a look and see if anything sticks out. Also I would mention, I tried adding both the AXIS_NORMAL and MAP_ABSOLUTE commands at the end of each axis line as well, and that did not seem to make any difference.

 

Thanks for any help on this,

 

include "target.tmh"

 

//program startup

int main()

{

if(Init(&EventHandle)) return 1; // declare the event handler, return on error

 

// BATTLE OF STALIGRAD TM WARTHOG PROFILE VERSION 2 BY DON B. ( DBURNE)

 

// Created for use with the TM Warthog, Track IR5, and CH Throttle Quadrant

//Water Radiators on Throttle slider, Mixture on Left Throttle- prop pitch, cowls, oil rad on CH Throtte Quadrant, all assigned in game.

 

// Updated 12/29 - Added camera zoom to pilot head zoom buttons, by mapping to same keys in sim ( Numpad + and - ).

// Updated 1/18/2014 - Added MAP Absolute to joystick throttles to hopefully solve problem with losing throttles during gameplay

 

SetKBRate(32, 50);

SetKBLayout(KB_ENG);

MapAxis(&Joystick, JOYX, DX_X_AXIS);

MapAxis(&Joystick, JOYY, DX_Y_AXIS);

MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS);

MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS);

MapAxis(&Throttle, SCX, DX_XROT_AXIS);

MapAxis(&Throttle, SCY, DX_YROT_AXIS);

MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS);

SetShiftButton(&Joystick, S4);

 

 

// Game

MapKeyIO(&Throttle, MSP, L_CTL+'e', 'm'); // I= Ejeck O=Map

MapKeyIO(&Joystick, H4P, PRNTSCRN, 'p'); // I=Screenshot O=Pause

 

 

// Weapons

MapKeyIO(&Joystick, TG1, L_ALT+SPC, R_ALT+SPC); // I=Fire Cannons O=Fire Machine Guns

MapKey(&Joystick, TG2, CHAIN(DOWN+ R_ALT, UP+ R_ALT, DOWN+SPC)); // Fire All Guns

MapKeyIO(&Joystick, S2,L_SHIFT+R_CTL+'N', PULSE+'b'); // I=Throw Bomb Mode Toggle O=Drop Bombs

 

// Plane

// Flaps mapped to Throttle 3 way flap switch - IMPORTANT, must be in middle position after toggling to prevent in game key conflict with shift and f being held without release.

MapKey(&Joystick, S3, '/'); // Toggle Wheelbrakes

MapKeyIO(&Joystick, H1U, R_CTL + UARROW, DXHATUP); // I=Pitch Trim Down O=POV Hat Up

MapKeyIO(&Joystick, H1D, R_CTL + DARROW, DXHATDOWN); // I= Pitch Trim Up O=POV Hat Down

MapKeyIO(&Joystick, H1L, L_CTL + 'z', DXHATLEFT); // I=Yaw Trim Left O=POV Hat Left

MapKeyIO(&Joystick, H1R, L_CTL + 'x', DXHATRIGHT); // I=Yaw Trim Right O=POV Hat Right

MapKeyIO(&Joystick, H2R, PULSE+R_CTL+'l', PULSE+R_SHIFT+'l'); // I= Landing Lights Toggle O= Nav Lights Toggle

MapKey(&Joystick, H2L, PULSE+'l'); // Toggle Cockpit Light

MapKeyIO(&Joystick, H4R, PULSE+L_SHIFT+'g', PULSE+'g'); // I=Tailwheel Lock Toggle O=Gear Toggle

 

MapKey(&Throttle, APPAT, CHAIN(DOWN+R_ALT, D(), DOWN+'c', D(), UP+'c', D(), UP+R_ALT)); // Canopy Toggle

MapKey(&Throttle, APALT, PULSE+R_CTL+'c'); // Canopy Remove

MapKey(&Throttle, FLAPU, CHAIN(DOWN+L_SHIFT, D(), DOWN+'f')); // Flaps Up

MapKey(&Throttle, FLAPM, CHAIN ( UP+'f', D(), UP+L_SHIFT )); // Flaps Neutral

MapKey(&Throttle, FLAPD, 'f'); // Flaps Down

 

 

// Camera

// Pilot Head Zoom and Camera Zoom map to same keys ( Numpad + and - in sim )

MapKeyIO(&Joystick, H2U, PULSE+L_ALT+F8, USB[87]); // I=Zoom Increase 'KP+' 0= Track IR Center

MapKeyIO(&Joystick, H2D, PULSE+L_ALT+F9, USB[86]); // I=Zoom Decrease 'KP-' 0= Track IR Pause

MapKey(&Joystick, H3U, SEQ(PULSE+F2, PULSE+F3, PULSE+F1)); // Toggle Ext Views

 

 

// Engine

MapKey(&Throttle, EORIGN, PULSE+'e'); // Engine Toggle

MapKey(&Throttle, LTB, L_SHIFT+'s'); // Supercharger Toggle

}

 

//event handler

int EventHandle(int type, alias o, int x)

{

DefaultMapping(&o, x);

 

//add event handling code here

}

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

Posted

Well an update, may have solved it.

I have both my throttle and joystick plugged into a powered USB2 hub.

 

So I tried unplugging the usb connector for the throttle, and plugging it back in to the same usb port on the powered hub. This resulted in the LED lights coming on ( had them set off normally). So the first thing I noticed, is the LED light would start blinking on and off. I opened up the game control panel and the joystick settings, and the led lights stayed on and it appeared to operate normally. Then I closed the applet, and the led lights as I moved the throttle would blink off and on - meaning, the throttle was dropping in and out. I ran the script, and sure enough the lights went out, and the throttle was not responding.

 

So, I shut the system down, unplugged the throttle from the powered hub, and plugged it into a USB2 port on the IO panel of my system. Started system back up, voila LED lights came on, and I checked it in both the windows game control panel and the TM Device Analyzer, with and without the script running, and it stayed recognized and working properly.

Just spent the last several minutes in a mission, and the throttle is working properly -no dropping out/blinking LED lights.

 

Well I guess if nothing else, have found a good use for having the lights on - can tell real quickly if the throttle drops out lol.

More time will tell, but looking pretty good right now. I guess for whatever reason my throttle did not like that usb port on the powered hub. Joystick is still plugged into the powered hub, however it has never exhibited the same problem.

 

Anyway though, if anyone sees anything in that script that looks strange certainly let me know.

 

Thanks,

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

Posted

Just out of curiosity ... what is the advantage of your script when compared to a simple mapping of functions and axes in the in-game Options->Controls settings?

Posted
Just out of curiosity ... what is the advantage of your script when compared to a simple mapping of functions and axes in the in-game Options->Controls settings?

 

Allows me much more flexibility in assigning commands to button presses, ablility to use a modifier, ability to adjust the keyboard rates, deazones and curves, etc... while keeping it outside of the sim in a profile.

Just my personal preference really.

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

Posted
And isn't the fact that half of the Warthog's buttons are unusable in anything but the A-10 ingame an important reason to use TARGET?

 

Good point.

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

Posted

I.e. all middle positions of the switches on the throttle don't work.

Windows 10 64bit, Intel i9-9900@5Ghz, 32 Gig RAM, MSI RTX 3080 TI, 2 TB SSD, 43" 2160p@1440p monitor.

Posted

So anyway I am curious,

 

Does anyone know when and why one would use the following two items

AXIS_NORMAL

MAP_ABSOLUTE

in the axis assignment line?

 

The Script Editor Manual is not real clear on this. My problem is obviously solved by changing to another USB port, have run it a lot today and the virtual throttle has not dropped out since.

 

Thanks,

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

Posted (edited)
How so?

For example, the flaps switch.

UP position activates button 22, DN position activates button 23. So in some game we can map these buttons to whatever commands.

But MVR is just off, it doesn't activate any button. So how can we tell DCS, for example, that MVR where no command is sent- has to activate some function?

The solution would be TARGET identifying that we turned off button 22 or button 23, and it means we are at MVR position and can send a keystroke for this state.

 

The A-10C module does have recognition of these switches on the Warthog, I guess ED really made it "plug and play". But other modules do not, also other games in general.

Edited by 69iAF~Mike
  • Recently Browsing   0 members

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