Jump to content

Script form Target compile and run but it doesn't work


pabletesoy

Recommended Posts

Hello,

 

I have a problem with a script that has been working right and since a few days it fails. The script is compiled and executed, but then, in the event tester, it doesn,t hardly ever do nothing, and and if it works it ends up failing..

 

I attach it and an image of its functions, in case anyone can help me.

 

 

 

 

Thanks

su25TSCRP.zip


Edited by pabletesoy
Link to comment
Share on other sites

I don,t know if it is a good idea, but I directly paste here the script, may be better than download the files...

include "target.tmh"

int main()

{

Configure(&HCougar, MODE_EXCLUDED);

Configure(&JoystickF18, MODE_EXCLUDED);

Configure(&T16000, MODE_EXCLUDED);

Configure(&T16000L, MODE_EXCLUDED);

Configure(&LMFD, MODE_EXCLUDED);

Configure(&RMFD, MODE_EXCLUDED);

Configure(&TFRPRudder, MODE_EXCLUDED);

Configure(&TWCSThrottle, MODE_EXCLUDED);

Configure(&TFRPHARudder, MODE_EXCLUDED);

if(Init(&EventHandle)) return 1;

SetKBRate(32, 50);

SetKBLayout(KB_ENG);

SetShiftButton(&Joystick, S4, &Throttle, SPDF, BSB, 0);

MapKeyIOUMD(&Joystick, TG1, 0, PULSE+SPC, 0, PULSE+SPC, 0, PULSE+SPC);

MapKeyIOUMD(&Joystick, S2, 0, 0, 'w', 'w', 0, TEMPO( PULSE+L_ALT+'w', R_SHIFT+'o', 400));

MapKeyIOUMD(&Joystick, S3, 0, 0, PULSE+R_CTL+ENT, TEMPO( R_CTL+F12, R_SHIFT+R_CTL+F12, 300), 0, 0);

MapKey(&Joystick, S1, TEMPO( SEQ( PULSE+'=', PULSE+'-'), 'o', 400));

MapKeyIOUMD(&Joystick, TG2, PULSE+'t', SPC, PULSE+'t', SPC, PULSE+'t', SPC);

MapKeyIOUMD(&Joystick, H2U, 0, 0, 0, TEMPO( PULSE+'1', R_CTL+'h', 600), 0, PULSE+'v');

MapKeyIOUMD(&Joystick, H2R, 0, 0, 0, TEMPO( PULSE+R_SHIFT+R_CTL+']', R_SHIFT+R_CTL+'h', 500), 0, PULSE+L_CTL+SPC);

MapKeyIOUMD(&Joystick, H2D, 0, 0, 0, TEMPO( SEQ( PULSE+'6', PULSE+'7'), '8', 500), 0, PULSE+'c');

MapKeyIOUMD(&Joystick, H2L, 0, 0, 0, TEMPO( PULSE+R_SHIFT+R_CTL+'[', R_SHIFT+R_ALT+'h', 300), 0, PULSE+'d');

MapKeyIOUMD(&Joystick, H3U, PULSE+F1, USB[85], PULSE+F1, USB[85], PULSE+F1, USB[85]);

MapKeyIOUMD(&Joystick, H3R, SEQ( PULSE+F6, PULSE+L_CTL+F6, PULSE+F1), SEQ( PULSE+F10, PULSE+F1), SEQ( PULSE+F6, PULSE+L_CTL+F6, PULSE+F1), SEQ( PULSE+F10, PULSE+F1), SEQ( PULSE+F6, PULSE+L_CTL+F6, PULSE+F1), SEQ( PULSE+F10, PULSE+F1));

MapKeyIOUMD(&Joystick, H3D, PULSE+F7, USB[84], PULSE+F7, USB[84], PULSE+F7, USB[84]);

MapKeyIOUMD(&Joystick, H3L, PULSE+F12, SEQ( PULSE+L_CTL+F2, PULSE+F3, PULSE+F1), PULSE+F12, SEQ( PULSE+L_CTL+F2, PULSE+F3, PULSE+F1), PULSE+F12, SEQ( PULSE+L_CTL+F2, PULSE+F3, PULSE+F1));

MapKeyIOUMD(&Joystick, H1U, 0, R_SHIFT+DARROW, 0, R_SHIFT+DARROW, 0, R_SHIFT+DARROW);

MapKeyIOUMD(&Joystick, H1D, 0, R_SHIFT+UARROW, 0, R_SHIFT+UARROW, 0, R_SHIFT+UARROW);

MapKeyIOUMD(&Joystick, H1L, R_CTL+'z', R_SHIFT+LARROW, R_CTL+'z', R_SHIFT+LARROW, R_CTL+'z', R_SHIFT+LARROW);

MapKeyIOUMD(&Joystick, H1R, R_CTL+'x', R_SHIFT+RARROW, R_CTL+'x', R_SHIFT+RARROW, R_CTL+'x', R_SHIFT+RARROW);

MapKey(&Joystick, H4U, 'j');

MapKey(&Joystick, H4R, 's');

MapKey(&Joystick, H4L, 'n');

MapKey(&Joystick, H4D, 'y');

MapKey(&Joystick, H4P, '9');

MapAxis(&Joystick, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

SetSCurve(&Joystick, JOYX, 0, 0, 0, 0, 0);

MapAxis(&Joystick, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

SetSCurve(&Joystick, JOYY, 0, 0, 0, 0, 0);

MapKeyIOUMD(&Throttle, SC, 0, 0, L_ALT+'a', L_ALT+'a', 0, TEMPO( PULSE+ENT, PULSE+BSP, 300));

MapKeyIOUMD(&Throttle, MSP, L_ALT+'a', L_ALT+'a', L_ALT+'a', L_ALT+'a', L_ALT+'a', L_ALT+'a');

MapKey(&Throttle, MSU, TEMPO( SEQ( L_ALT+'1', L_ALT+'9'), SEQ( L_ALT+'6', L_ALT+'9'), 600));

MapKeyIOUMD(&Throttle, MSR, SEQ( PULSE+L_ALT+'2', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'2', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'2', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'2', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'2', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'2', PULSE+L_ALT+'9'));

MapKeyIOUMD(&Throttle, MSD, SEQ( PULSE+L_ALT+'3', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'3', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'3', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'3', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'3', PULSE+L_ALT+'9'), SEQ( PULSE+L_ALT+'3', PULSE+L_ALT+'9'));

MapKey(&Throttle, MSL, TEMPO( SEQ( L_ALT+'5', L_ALT+'9'), SEQ( L_ALT+'4', L_ALT+'9'), 600));

MapKeyIOUMD(&Throttle, SPDF, PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b');

MapKeyIOUMD(&Throttle, SPDB, PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b', PULSE+L_SHIFT+'b');

MapKeyIOUMD(&Throttle, BSB, LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED1));

MapKeyIOUMD(&Throttle, CHF, 0, 0, 0, PULSE+L_SHIFT+'g', 0, PULSE+INS);

MapKeyIOUMD(&Throttle, CHB, 0, 0, 0, PULSE+L_CTL+'g', 0, PULSE+DEL);

MapKey(&Throttle, PSF, CHAIN( PULSE+L_ALT+'r', D(), PULSE+L_ALT+'r', D(), PULSE+L_ALT+'r'));

MapKey(&Throttle, PSB, CHAIN( PULSE+L_CTL+'w', D(), PULSE+L_CTL+'w', D(), PULSE+L_CTL+'w', D(), PULSE+L_CTL+'w'));

MapKeyIOUMD(&Throttle, LTB, PULSE+'p', PULSE+'p', PULSE+'p', PULSE+'p', PULSE+'p', PULSE+'p');

MapKey(&Throttle, EFLNORM, PULSE+L_CTL+'c');

MapKey(&Throttle, EFRNORM, CHAIN( DOWN+'i', D(), DOWN+R_CTL+'o'));

MapKeyR(&Throttle, EFRNORM, CHAIN( D(300), UP+'i', D(), UP+R_CTL+'o', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED5)));

MapKey(&Throttle, EFROVER, CHAIN( DOWN+'i', D(), DOWN+R_CTL+'o'));

MapKeyR(&Throttle, EFROVER, CHAIN( D(300), UP+'i', D(), UP+R_CTL+'o', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED5)));

MapKey(&Throttle, APPAT, CHAIN( DOWN+'m', D(), DOWN+L_SHIFT+'e'));

MapKeyR(&Throttle, APPAT, CHAIN( D(300), UP+'m', D(), UP+L_SHIFT+'e', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4)));

MapKey(&Throttle, APAH, CHAIN( DOWN+'m', D(), DOWN+L_SHIFT+'e'));

MapKeyR(&Throttle, APAH, CHAIN( D(300), UP+'m', D(), UP+L_SHIFT+'e', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED4)));

MapKey(&Throttle, APALT, CHAIN( DOWN+'m', D(), DOWN+L_SHIFT+'e'));

MapKeyR(&Throttle, APALT, CHAIN( D(300), UP+'m', D(), UP+L_SHIFT+'e', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4)));

MapKeyIOUMD(&Throttle, EOLMOTOR, PULSE+R_ALT+END, PULSE+R_ALT+END, PULSE+R_ALT+END, PULSE+R_ALT+END, PULSE+R_ALT+END, PULSE+R_ALT+END);

MapKeyIOUMD(&Throttle, EORMOTOR, PULSE+R_CTL+END, PULSE+R_CTL+END, PULSE+R_CTL+END, PULSE+R_CTL+END, PULSE+R_CTL+END, PULSE+R_CTL+END);

MapKeyIOUMD(&Throttle, APUON, CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED0)));

MapKeyRIOUMD(&Throttle, APUON, CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'));

MapKey(&Throttle, LDGH, TEMPO ('m', 'l', 300));

MapKeyIOUMD(&Throttle, FLAPU, PULSE+'f', PULSE+'f', PULSE+'f', PULSE+'f', PULSE+'f', PULSE+'f');

MapKeyIOUMD(&Throttle, FLAPD, PULSE+L_SHIFT+'f', PULSE+L_SHIFT+'f', PULSE+L_SHIFT+'f', PULSE+L_SHIFT+'f', PULSE+L_SHIFT+'f', PULSE+L_SHIFT+'f');

MapKeyIOUMD(&Throttle, EACON, DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c');

MapKeyRIOUMD(&Throttle, EACON, CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'));

MapKeyIOUMD(&Throttle, RDRNRM, DOWN+L_CTL+'v', DOWN+L_CTL+'v', DOWN+L_CTL+'v', DOWN+L_CTL+'v', DOWN+L_CTL+'v', DOWN+L_CTL+'v');

MapKeyRIOUMD(&Throttle, RDRNRM, CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'));

MapKeyIOUMD(&Throttle, EOLIGN, PULSE+R_CTL+'l', PULSE+R_CTL+'l', PULSE+R_CTL+'l', PULSE+R_CTL+'l', PULSE+R_CTL+'l', PULSE+R_CTL+'l');

MapKeyIOUMD(&Throttle, EORIGN, 0, 0, PULSE+R_ALT+'l', PULSE+R_ALT+'l', 0, 0);

MapKey(&Throttle, EFLOVER, PULSE+L_CTL+'c');

MapKeyIOUMD(&Throttle, APUOFF, CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED0)), CHAIN( DOWN+R_SHIFT+'l', D(), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED0)));

MapKeyRIOUMD(&Throttle, APUOFF, CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'), CHAIN( D(300), UP+R_SHIFT+'l'));

MapKeyIOUMD(&Throttle, EACOFF, DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c', DOWN+L_SHIFT+'c');

MapKeyRIOUMD(&Throttle, EACOFF, CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'), CHAIN( D(300), UP+L_SHIFT+'c'));

MapKeyIOUMD(&Throttle, RDRDIS, DOWN+L_CTL+'v', DOWN+L_CTL+'v', DOWN+L_CTL+'v', DOWN+L_CTL+'v', DOWN+L_CTL+'v', DOWN+L_CTL+'v');

MapKeyRIOUMD(&Throttle, RDRDIS, CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'), CHAIN( D(300), UP+L_CTL+'v'));

MapKeyIOUMD(&Throttle, APDIS, PULSE+R_SHIFT+'n', CHAIN( PULSE+L_CTL+'e', PULSE+L_CTL+'e', PULSE+L_CTL+'e'), PULSE+R_SHIFT+'n', CHAIN( PULSE+L_CTL+'e', PULSE+L_CTL+'e', PULSE+L_CTL+'e'), PULSE+R_SHIFT+'n', CHAIN( PULSE+L_CTL+'e', PULSE+L_CTL+'e', PULSE+L_CTL+'e'));

MapKeyIOUMD(&Throttle, EOLNORM, PULSE+R_ALT+HOME, PULSE+R_ALT+HOME, PULSE+R_ALT+HOME, PULSE+R_ALT+HOME, PULSE+R_ALT+HOME, PULSE+R_ALT+HOME);

MapKeyIOUMD(&Throttle, EORNORM, PULSE+R_CTL+HOME, PULSE+R_CTL+HOME, PULSE+R_CTL+HOME, PULSE+R_CTL+HOME, PULSE+R_CTL+HOME, PULSE+R_CTL+HOME);

MapKeyIOUMD(&Throttle, FLAPM, PULSE+'f', PULSE+'f', PULSE+'f', PULSE+'f', PULSE+'f', PULSE+'f');

MapKeyIOUMD(&Throttle, SPDM, PULSE+L_CTL+'b', PULSE+L_CTL+'b', PULSE+L_CTL+'b', PULSE+L_CTL+'b', PULSE+L_CTL+'b', PULSE+L_CTL+'b');

MapKeyIOUMD(&Throttle, BSM, LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1));

MapKeyIOUMD(&Throttle, CSU, 0, 0, TEMPO( R_SHIFT+'k', R_SHIFT+'0', 600), TEMPO( R_SHIFT+'k', R_SHIFT+'0', 600), R_CTL+UARROW, R_CTL+UARROW);

MapKeyIOUMD(&Throttle, CSD, 0, 0, TEMPO( R_CTL+'k', R_SHIFT+'9', 600), TEMPO( R_CTL+'k', R_SHIFT+'9', 600), R_CTL+DARROW, R_CTL+DARROW);

MapKeyIOUMD(&Throttle, CSR, 0, 0, PULSE+']', PULSE+']', R_CTL+RARROW, R_CTL+RARROW);

MapKeyIOUMD(&Throttle, CSL, 0, 0, PULSE+'[', PULSE+'[', R_CTL+LARROW, R_CTL+LARROW);

KeyAxis(&Throttle, THR_LEFT, 'iu', AXMAP2( LIST( 0, 80 ), LED(&Throttle, LED_INTENSITY, 43), LED(&Throttle, LED_INTENSITY, 255) ));

KeyAxis(&Throttle, THR_LEFT, 'ou', AXMAP2( LIST( 0, 80 ), LED(&Throttle, LED_INTENSITY, 43), LED(&Throttle, LED_INTENSITY, 255) ));

KeyAxis(&Throttle, THR_LEFT, 'im', AXMAP2( LIST( 0, 80 ), LED(&Throttle, LED_INTENSITY, 43), LED(&Throttle, LED_INTENSITY, 255) ));

KeyAxis(&Throttle, THR_LEFT, 'om', AXMAP2( LIST( 0, 80 ), LED(&Throttle, LED_INTENSITY, 43), LED(&Throttle, LED_INTENSITY, 255) ));

KeyAxis(&Throttle, THR_LEFT, 'id', AXMAP2( LIST( 0, 80 ), LED(&Throttle, LED_INTENSITY, 43), LED(&Throttle, LED_INTENSITY, 255) ));

KeyAxis(&Throttle, THR_LEFT, 'od', AXMAP2( LIST( 0, 80 ), LED(&Throttle, LED_INTENSITY, 43), LED(&Throttle, LED_INTENSITY, 255) ));

MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

SetSCurve(&Throttle, SCX, 50, 100, 50, 32, -10);

MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

SetSCurve(&Throttle, SCY, 49, 0, 50, -32, -10);

MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

SetSCurve(&Throttle, THR_RIGHT, 0, 0, 0, 0, 0);

MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

SetSCurve(&Throttle, THR_LEFT, 0, 0, 0, 0, 0);

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

SetSCurve(&Throttle, THR_FC, 0, 0, 0, 0, 0);

 

}

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

{

DefaultMapping(&o, x);

}

Link to comment
Share on other sites

More extranger things...sometimes, when the script run, the event tester recognizes the actions but, inside DCS, some buttons (they are usually the same always) stop working. When I test that buttons inside the contros window of the plane they are workin! This is very very strange...

I have another scrip from another plane and it seems to work perfectly.

Link to comment
Share on other sites

Seems to work fine in my Event Tester but some stuff is weird (imo).

SpeedBrakeForward is used as U layer but each time you set the U layer active or deactivate (by pressing SPDF or setting it back to SPDM) it also generates stuff on it's own, an action you maybe don't want to happen at that point.

 

The entire script is quite messy to be honest.

No comments anywhere.

Every button action on the same line when layers are used makes it hard to read.

No macro's which again makes it harder to read (but keeps the lines smaller)

IOUMD layers for example are setup in various ways.

For the D layer, the BoatSwitchBack (BSB) is used which also sets a LED1 when active so you know when you're in that layer. But something similar is not done when the U layer is used.

etc...

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

Yes, it is very messy. It is my first script and I did from Target UI.

 

I should learn to use macros...

 

 

Layer U is not used, so it has no LEDs assigned. I don't understand "layer U generates stuff on it's own", what do you mean?

Do you think that if I clean it will solve the problem? the faisl are very extranges...I don't know if the problem is on the script, windows, usb, dcs...

Link to comment
Share on other sites

The U layer is used, it's your SPDF key on the Throttle that acts as U layer.

 

SetShiftButton(&Joystick, S4, &Throttle, SPDF, BSB);

 

 

Besides that, your SPDF has also an action on it's own, which activates also if you use the U layer.

 

Why using layers if it's not needed:

MapKeyIOUMD(&Throttle, MSP, L_ALT+'a', L_ALT+'a', L_ALT+'a', L_ALT+'a', L_ALT+'a', L_ALT+'a');

 

Is the same as:

 

MapKey(&Throttle, MSP, L_ALT+'a'); (no layer so it works all the time)

 

 

Writing a comment after an action makes you don't have to look up what the action stands for:

 

MapKey(&Throttle, MSP, L_ALT+'a'); // MikeSwitch Press: L_ALT+a (<-- you should write here what L_ALT+a does or use a macro that describes it all together.

 

 

 

 

Just makes things easy to read and to debug.

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

I,m going to try to put order here and clean the script.

 

 

 

I whant the S4 button as modifier (IO) and the DSB+M+F swich buttons as layers. I write this:

 

 

 

SetShiftButton(&Joystick, S4, &Throttle, BSB, BSF); //LAYERS

MapKeyIOUMD(&Joystick, S1, 'U', 'U', 'M', 'M', 'D', 'D'); //to test it

 

 

what´s wrong?

Link to comment
Share on other sites

Nothing.

Just for I layer (S4) i would use not the same output as for the O layer.

In your case you can leave out the IO like this:

 

 

MapKeyUMD(&Joystick, S1, 'U', 'M', 'D'); //to test it

To make things more readable you can also put each layer on a different line:

//Engine Operator LT/RT

MapKeyIOUMD(&Throttle, EOLIGN,

PULSE+Show_Pilot_Body,// (IU)

PULSE+Control_Stick_HIDE_SHOW,// (OU)

0,// (IM)

PULSE+ScratchPad,// (OM)

0,// (ID)

0);// (OD)

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

: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...