Page 1 of 2

Converting Script to Titan One

PostPosted: Sun Feb 10, 2019 6:30 pm
by what a chach
Hello all

I know very little about programming just some basic python. How would I find and get rid of the errors I get when I try to load a script onto the titan. I want to use the apex legends script that someone made but I get build errors.

Re: Converting Script to Titan One

PostPosted: Mon Feb 11, 2019 8:25 am
by J2Kbr
We can help fix the compiling errors if you post the script code here. Thanks

Re: Converting Script to Titan One

PostPosted: Wed Mar 13, 2019 5:45 pm
by vivekg
Hi Everyone, I'm not that proficient with scripting.

I need help as I'm not sure if the "int's or main is workable.

I've created this script to play Mass Effect on XB1 using a PS4 Controller.

I'm happy with the remapping HOWEVER I want to create a script to toggle:

1) ADS TOGGLE using my remapped config from XB1_LT to PS4_SQUARE

2) Powers TOGGLE using my remapped config from XB1_RB to PS4_L2

Code: Select all
 
 
remap XB1_X -> PS4_DOWN;
remap XB1_RIGHT -> PS4_OPTIONS;
remap XB1_Y -> PS4_R1;
remap XB1_RT -> PS4_L1; //Fire
remap XB1_LT -> PS4_SQUARE; //Aim
remap XB1_LB -> PS4_R2; //Weapons
remap XB1_RB -> PS4_L2; //Powers
 
int rt_hold = FALSE;
int AIM = XB1_X;
int POWERS = XB1_LT;
 
main {
 
  if(event_press(XB1_X)){
    rt_hold = !rt_hold;
  }
  if(rt_hold){
    set_val(XB1_LT, 100);
  }else if(!rt_hold){
    set_val(XB1_LT, 0);
  }
 
   if(event_press(XB1_LT)){
    rt_hold = !rt_hold;
  }
  if(rt_hold){
    set_val(XB1_RB, 100);
  }else if(!rt_hold){
    set_val(XB1_RB, 0);
  }
 
 
}
 

Re: Converting Script to Titan One

PostPosted: Thu Mar 14, 2019 6:54 am
by J2Kbr
Please checked the changes I made in your script:
Code: Select all
remap XB1_X      -> PS4_DOWN;
remap XB1_RIGHT  -> PS4_OPTIONS;
remap XB1_Y      -> PS4_R1;
remap XB1_RT     -> PS4_L1;     // Fire
remap XB1_LT     -> PS4_SQUARE; // Aim
remap XB1_LB     -> PS4_R2;     // Weapons
remap XB1_RB     -> PS4_L2;     // Powers
 
int ads_toggle    = FALSE;
int powers_toggle = FALSE;
 
main {
    if(event_press(PS4_SQUARE)) {
        ads_toggle = !ads_toggle;
    }
    if(ads_toggle) {
        set_val(PS4_SQUARE, 100);
    } else {
        set_val(PS4_SQUARE, 0);
    }
 
    if(event_press(PS4_L2)) {
        powers_toggle = !powers_toggle;
    }
    if(powers_toggle) {
        set_val(PS4_L2, 100);
    } else {
        set_val(PS4_L2, 0);
    }
}
 

Note that, with the Titan One, the remap is applied AFTER the main routine, as such the script should be coded with the actual buttons you are pressing on the controller. Here SQUARE to aim and L2 for powers.

Re: Converting Script to Titan One

PostPosted: Thu Mar 14, 2019 1:03 pm
by vivekg
Awesome, thank you. Can't wait to check it out in action

Yeah, that's what confused me. But you've taught me something new.

Re: Converting Script to Titan One

PostPosted: Thu Mar 14, 2019 6:44 pm
by vivekg
It's still toggling both L2+R1 commands on one button ->> PS4_L2 <<- like a combo.

I've decided to unmap ->> PS4_L2 & PS4_R1 <<- first, then do the remapping, main and hopefully done. Would that work?

Re: Converting Script to Titan One

PostPosted: Sat Mar 16, 2019 12:01 pm
by J2Kbr
Based in your feedback I believe the remapping is not correct. Please provide the button mapping list you want, so I can fix the script. something like:

L2 to activate L1
L1 to activate L2
R2 to activate SQUARE
SQUARE to activate TRIANGLE
TRIANGLE to activate R2
...

Thank you

Re: Converting Script to Titan One

PostPosted: Sat Mar 16, 2019 4:16 pm
by vivekg
Thank you for your reply & assistance.

Yes, I agree. Scripting is very particular initially, so I'm learning from mistakes.

Below is a clear idea of what button mapping assistance I need:

BUTTONS

PS4_R1 ---> to activate ---> PS4_SQUARE (Reload/Swap)

PS4_R2 ---> to activate ---> PS4_L1 (Weapon Wheel)

PS4_L1 ---> to activate ---> PS4_R2 (Fire)

*TOGGLE PLEASE*
PS4_L2 ---> to activate ---> PS4_R1 (Power Wheel)

*TOGGLE PLEASE*
PS4_SQUARE ---> to activate ---> PS4_L2 (Aim/ADS)

PS4_DOWN ---> to activate ---> PS4_SQUARE (Main Power)

PS4_RIGHT ---> to activate ---> PS4_OPTIONS

PS4_TOUCHY SWIPE UP ---> to activate ---> PS4_RIGHT

PS4_TOUCHY SWIPE DOWN --> to activate ---> PS4_LEFT

I appreciate your time & effort.

Re: Converting Script to Titan One

PostPosted: Sun Mar 17, 2019 9:10 am
by J2Kbr
Thank you, here is the script with working remapping.
Code: Select all
remap PS4_R1      -> PS4_SQUARE; // (Reload/Swap)
remap PS4_SQUARE  -> PS4_L2;     // (Aim/ADS)     TOGGLE
remap PS4_L2      -> PS4_R1;     // (Power Wheel) TOGGLE
remap PS4_R2      -> PS4_L1;     // (Weapon Wheel)
remap PS4_L1      -> PS4_R2;     // (Fire)
remap PS4_RIGHT   -> PS4_OPTIONS;
remap PS4_OPTIONS -> PS4_RIGHT;
 
int ads_toggle    = FALSE;
int powers_toggle = FALSE;
 
main {
    if(event_press(PS4_SQUARE)) {
        ads_toggle = !ads_toggle;
    }
    if(ads_toggle) {
        set_val(PS4_SQUARE, 100);
    } else {
        set_val(PS4_SQUARE, 0);
    }
 
    if(event_press(PS4_L2)) {
        powers_toggle = !powers_toggle;
    }
    if(powers_toggle) {
        set_val(PS4_L2, 100);
    } else {
        set_val(PS4_L2, 0);
    }
}
 

Please note "PS4_DOWN ---> to activate ---> PS4_SQUARE (Main Power)" was not included because PS4_SQUARE is already in use for Reload/Swap. The touch swipes were also not added yet. Please check/test the remapping and toggle functions, with everything good we proceed to add the swipe detection and mapping.

Re: Converting Script to Titan One

PostPosted: Sun Mar 17, 2019 2:37 pm
by vivekg
Cheers, I'll test it out & get back to you.