Guide / Tutorial Get your Basic TARGET Script - PIPs and Curves here.

Oh dear...well, if you are invested in your macro, then the only way to sort this is to do the fllowing;

You can bypass the joystick altogether in the script by adding...

Configure(&Joystick, MODE_EXCLUDED);

Then remove...

Configure(&Throttle, MODE_FILTERED);

Then... create a MapKey statement for every button you need to use (why not all of them?) plus a MapAxis statement for any Throttle axis you use.

Examples:

MapKey(&Throttle, BSF, DX8); // Throttle Boat Switch-Forward sends 'Joy_8' to ED
MapKey(&Throttle, BSF, 'a'); // sends 'a' to ED

MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS);

...you may need to either create MapKey statements which match your binds in the game, or, re bind everything after you create your MapKeys etc.

Happy to help more if you get stuck.

Cheers
Clicker
 
Last edited:
I am trying to combine the toe brakes into one axis. When I run the script I get the correct indication of which brake is pressed and a correct value for the AxisVal command, I do not get an output to the device analyzer though.

C-like:
include "target.tmh"

//program startup
int main()
{
    if(Init(&EventHandle)) return 1; // declare the event handler, return on error
    
    //add initialization code here
    //FreeProcInstance();
    Configure(&TWCSThrottle, MODE_FILTERED);
    Configure(&T16000, MODE_FILTERED);
    
    //MapAxis(&TWCSThrottle,TCSRIGHT,DX_Y_AXIS);
    MapAxis(&T16000, JOYX, DX_X_AXIS);
}

//event handler
int EventHandle(int type, alias o, int x) {
    int TCSCOMBO, Differential_Toe;

    //Map the MODE_FILTERED TFRP through Target; we can Trim, set deadzones, J/Scurves, etc.
    //X axis = Differential combined toe brakes, rest at center
    //Y axis = Both toe brakes pressed at same time, rest at 0
    //Z axis = rudder (as default)
    if (&o == &TWCSThrottle) {
        printf("THROTTLE\x0a");     
        GetAxisData(&o, x);
        if(x == TCSLEFT | x == TCSRIGHT) {
            if (x == TCSLEFT) printf("LEFT\x0a");
            if (x == TCSRIGHT) printf("RIGHT\x0a");
            axdata.locked = 1;
            Differential_Toe = -TWCSThrottle[TCSRIGHT]/2 + TWCSThrottle[TCSLEFT]/2;
            GameOutput (&o, TCSRIGHT, AxisVal(Differential_Toe, &axdata));
            printf("%d\x0a", AxisVal(Differential_Toe, &axdata));
            
            if (TWCSThrottle[TCSLEFT] < TWCSThrottle[TCSRIGHT]) TCSCOMBO = TWCSThrottle[TCSRIGHT];
            else TCSCOMBO = TWCSThrottle[TCSLEFT];
            GameOutput (&o, TCSLEFT, AxisVal(-TCSCOMBO, &axdata));
        }
        if(!axdata.locked & !axdata.relative) GameOutput(&o, x, AxisVal(o[x], &axdata));
    }
    
    else DefaultMapping(&o, x);
}
 
Hi @CraigWells ,

When you say you get the right indication, I assume you mean you get "Left" or "Right" printed to the Target Console?
If so, then the script is working fine.

I would not worry too much about the analyzer as I have had issues with it since upgrading to Win10.

Hope this helps.

Clicker
 
Last edited:
I got it!
The GameOutput command was not giving me an..... output.
I did get it to work like this.

C-like:
int EventHandle(int type, alias o, int x)
{
    int TCSCOMBO, Differential_Toe;
    
    if (&o == &TWCSThrottle)
        {
            GetAxisData(&o,x);
            if (x == TCSLEFT| x == TCSRIGHT)
                {   
                    axdata.locked = 1;
                    Differential_Toe = -TWCSThrottle[TCSRIGHT]/2 + TWCSThrottle[TCSLEFT]/2;
                    DXAxis(DX_ZROT_AXIS, AxisVal(Differential_Toe, &axdata));
                }
            else DefaultMapping(&o,x);
        }
    else DefaultMapping(&o, x);
 
Back
Top Bottom