Jump to content

Possible to change Axis Scales on the fly?


Recommended Posts

Posted

I was wanting to get a button or switch to change axis scales on the fly, handy for when wobbbling everywhere during AAR.

 

Within the SetSCurve command the last digit input can alter the scale so I was trying to write a command then use an EXEC to run it so as I could change the axis scale but so far no joy, TARGET compiles fine but just ignores the command.

 

Any TARGET wizards out there able to enlighten me? For example when I press a button or activate a switch the virtual axis/axes would be limited to 25 or 50% range. The physical joystick 100% range would limit the input into the game of 25 or 50% of the axes range?

Posted (edited)

What about a 100% input range but with a less steeper curve?

A bit the same as on the F-16 when you open the refuel door and your stick input is reduced to make more precise manouvres while refueling (just don't forget to close the refuel door after refueling or dogfighting won't go well.

 

The (OU), (IU), (OM), (IM), etc.... refer to the state of the IO and UMD switches, S3 for IO and Pinky for UMD, so OU = S3 Out Pinky Up, IM = S3 In Pinky Middle etc... 

The LEDs are added to know in which state the input curve is.

LED 2 is curve 1, LED 4 is curve 2, no LED is normal input (i use LED 1 and 5 to see in which state the Pinky switch is in but that is not part of the code below).

Setup is on button S1

 

// Button S1: 
// HOTAS_Master_Mode_Control_Button
// NWS AR DISC + MSL Missile Step button
// TrackIR or VR commands
// (OD): TrackIR Reset or VR_Center - (OU): TrackIR On/Off) - (IM): Change stick axis behaviour
MapKeyIOUMD(&Joystick, S1,
0// (IU): Not used
SEQ( // (OU) Change Stick Axis behaviour - open the sequence
        CHAIN(
            EXEC( // curve 1 reduced input
                "SetSCurve(&Joystick, JOYX, 0, 0, 0, 2, 0); SetSCurve(&Joystick, JOYY, 0, 0, 0, 2, 0);"
            ),
            LED(&Throttle, LED_ONOFF, LED_CURRENT+LED2),
            LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4)
            ),
        CHAIN(
            EXEC( // curve 2 even more reduced input
                "SetSCurve(&Joystick, JOYX, 0, 0, 0, 4, 0); SetSCurve(&Joystick, JOYY, 0, 0, 0, 4, 0);"
            ),
            LED(&Throttle, LED_ONOFF, LED_CURRENT+LED4),
            LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2)
            ),
        CHAIN(
            EXEC( // reset to normal stick input
                "SetSCurve(&Joystick, JOYX, 0, 0, 0 ,0, 0); SetSCurve(&Joystick, JOYY, 0, 0, 0 ,0, 0);"
            ),
            LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2),
            LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4)
        )),        //close the Sequence
F1_HUD_only_view_switch, // (IM): Toggle Cockpit View ON/OFF
NWS_A_R_DISC_MSL_STEP_Button, // (OM): DX3: NWS + Air Refuel Disconnect + Missile Step same missile type + long press: Switch different missiles
PULSE+TrackIR_On_Off, // (ID)
PULSE+TrackIR_Center); // (OD) or VR_Center when in VR

Edited by Lange_666

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 pedals, TrackIR4, Rift-S, Elgato Streamdeck XL.

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

Posted (edited)

I'll certainly give that a try many thanks @Lange_666

 

EDIT: Just put in the code but changed it a little mainly to change the axis scale rather than the curve, but both would work fine I guess, just what I wanted to do.

 

So I changed the

 

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

to

SetSCurve(&Joystick, JOYX, 0, 0, 0, 0, -2); SetSCurve(&Joystick, JOYY, 0, 0, 0, 0, -4)

 

That gave me Virtual axes of

25% Y (12.5% either side of the 50% center)

50% X (25% either side of the 50% center)

For 100% physical stick movement.

 

It works a treat!!!

 

Still gotta experiment what's going to work best, but that's great thank you so much

Edited by Weegie
Posted

Personally i prefer a flatter curve instead of smaller one because with a smaller one you still have the same high input values.  

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 pedals, TrackIR4, Rift-S, Elgato Streamdeck XL.

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

  • 2 months later...
Posted

Never used the GUI so i can't answer.

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 pedals, TrackIR4, Rift-S, Elgato Streamdeck XL.

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

Posted
16 hours ago, Redlinebuzz said:

Could this be used with a profile that was created using the GUI ? Thanks.

It can't be used directly from the GUI AFAIK, as the GUI doesn't have built in commands to do that.

 

You can limit the axis throw or set curves within the GUI as I remember but you can't change them on the fly

 

What you can do though is take the profile that the GUI has generated and import it into the Editor, it will give you whole lot script

 

Then paste the lines of code to add in that function

 

The GUI generates 2 files for a profile made with the GUI,  *.fcf and *.tmc. What you want is the *.tmc and load that in the editor then add the code

 

Here is a very long line of code, as an example that can be pasted in, writen for a Hog Stick and Throttle, what it does is Toggles the X&Y axes from 100% to 50%.

 

When it's in the 50% mode LED 5 (the bottom LED) will light on your Throttle.

 

The mode is activated by S3 the button on the joystick behind the Paddle

 

MapKey (&Joystick, S3, SEQ(CHAIN( EXEC("SetSCurve(&Joystick, JOYX, 0, 0, 0, 0, -2); SetSCurve(&Joystick, JOYY, 0, 0, 0, 0, -2);"), LED(&Throttle, LED_ONOFF, LED_CURRENT+LED5)),CHAIN( EXEC("SetSCurve(&Joystick, JOYX, 0, 0, 0, 0, 0); SetSCurve(&Joystick, JOYY, 0, 0, 0, 0, 0);"), LED(&Throttle, LED_ONOFF, LED_CURRENT-LED5))));//TOGGLE Axes Y=50% X=50%/Y=100% X=100%

 

It's pretty easy to do even if you know nothing about scripting with the editor.

  • Like 1
Posted (edited)

The GUI sucks. It's tedious and doesn't really explore the capabilities of what the software is able to do. 🙂

You'll be much better off taking the time to learn the script editor.

Edited by Svend_Dellepude

[sIGPIC][/sIGPIC]

Win10 64, Asus Maximus VIII Formula, i5 6600K, Geforce 980 GTX Ti, 32 GB Ram, Samsung EVO SSD.

  • Recently Browsing   0 members

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