Converting Script to Titan One

Gtuner Pro general support. Operation, questions, updates, feature request.

Moderator: The_Rabid_Taco

Converting Script to Titan One

Postby what a chach » Sun Feb 10, 2019 6:30 pm

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.
User avatar
what a chach
Sergeant
Sergeant
 
Posts: 6
Joined: Sun Feb 10, 2019 6:27 pm

Re: Converting Script to Titan One

Postby J2Kbr » Mon Feb 11, 2019 8:25 am

We can help fix the compiling errors if you post the script code here. Thanks
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 17121
Joined: Tue Mar 18, 2014 1:39 pm

Re: Converting Script to Titan One

Postby vivekg » Wed Mar 13, 2019 5:45 pm

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);
  }
 
 
}
 
User avatar
vivekg
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Sun Feb 17, 2019 6:32 pm

Re: Converting Script to Titan One

Postby J2Kbr » Thu Mar 14, 2019 6:54 am

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.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 17121
Joined: Tue Mar 18, 2014 1:39 pm

Re: Converting Script to Titan One

Postby vivekg » Thu Mar 14, 2019 1:03 pm

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.
User avatar
vivekg
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Sun Feb 17, 2019 6:32 pm

Re: Converting Script to Titan One

Postby vivekg » Thu Mar 14, 2019 6:44 pm

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?
User avatar
vivekg
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Sun Feb 17, 2019 6:32 pm

Re: Converting Script to Titan One

Postby J2Kbr » Sat Mar 16, 2019 12:01 pm

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
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 17121
Joined: Tue Mar 18, 2014 1:39 pm

Re: Converting Script to Titan One

Postby vivekg » Sat Mar 16, 2019 4:16 pm

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.
User avatar
vivekg
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Sun Feb 17, 2019 6:32 pm

Re: Converting Script to Titan One

Postby J2Kbr » Sun Mar 17, 2019 9:10 am

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.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 17121
Joined: Tue Mar 18, 2014 1:39 pm

Re: Converting Script to Titan One

Postby vivekg » Sun Mar 17, 2019 2:37 pm

Cheers, I'll test it out & get back to you.
User avatar
vivekg
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Sun Feb 17, 2019 6:32 pm

Next

Return to Gtuner Pro Support (Titan One)

Who is online

Users browsing this forum: Jourian and 0 guests