Titan 2 New user script support

Titan Two general support. Questions, firmware update, feature request.

Moderator: J2Kbr

Titan 2 New user script support

Postby Lifty » Thu Aug 15, 2019 4:57 pm

Hello. I purchased a titan 2 this week and extremely new to scripting. I’m trying to write a basic script for Xbox One but I’m struggling :icon_frown:
If anyone could give me a hand I’d appreciate it. My goal is when I press Button_7 I automatically run a combo. The combo is simple it’s just YY (Button_ 14) twice. If it helps it’s for the game Halo 5 and I’m trying to do the Grenade animation stop by using the change weapon double tap. Thanks in advance :smile0517:
User avatar
Lifty
Private First Class
Private First Class
 
Posts: 2
Joined: Tue Aug 13, 2019 12:23 am

Re: Titan 2 New user script support

Postby alanmcgregor » Thu Aug 15, 2019 8:31 pm

If you want to learn more about scripting, Scachi wrote this well explained basic guide:

viewforum.php?f=26

Now, I don't know if L1 (BUTTON_7) has a crucial action for the game, so you might don't want to override it.

For case like yours, what I prefer to do is: create a script that if you quick tap Y it will press Y two times, but if you press Y for a bit longer (250ms) you have regular Y action. What you think? this could work for you?
User avatar
alanmcgregor
Major
Major
 
Posts: 1026
Joined: Tue Mar 27, 2018 8:38 am

Re: Titan 2 New user script support

Postby Mad » Thu Aug 15, 2019 8:35 pm

Try this:
Code: Select all
main { 
 if(event_active(6)) combo_run(Cancel);
}
 
combo Cancel {
  set_val(13, 100.0);
  wait(40);
  wait(40);
  set_val(13, 100.0);
  wait(40);
}
ConsoleTuner Support Team || Discord
Mad
Lieutenant
Lieutenant
 
Posts: 397
Joined: Wed May 22, 2019 5:39 am

Re: Titan 2 New user script support

Postby alanmcgregor » Thu Aug 15, 2019 8:42 pm

This is the other option I commented earlier.

Code: Select all
#pragma METAINFO("Double Press", 1, 0, "alanmcgregor")
 
#define MaxTimePressed 200
#define TimeBeforeNextPress 100 // reduce this value for faster double Y tap
 
 
main {
    //If quick Tap for Double Y Press.  Press Y a bit longer for regular Y action
    if(event_release(BUTTON_14) && (time_active(BUTTON_14) <= MaxTimePressed)) {
        combo_run(cDoublePressY);
    }
}
 
combo cDoublePressY{
    wait(TimeBeforeNextPress);
    set_val(BUTTON_14, 100.0);
    wait(50);
}
User avatar
alanmcgregor
Major
Major
 
Posts: 1026
Joined: Tue Mar 27, 2018 8:38 am

Re: Titan 2 New user script support

Postby Lifty » Fri Aug 16, 2019 2:51 am

Thanks for the quick replies! The Button_7 is the throw grenade command and the Button_14 is the change weapon command.
Using your script alanmcgregor I changed the button_14 to button_7 because that is the action command. This works pretty well so that I can hold button_7 and the normal grenade throw animation occurs, and if I doubletap the button_7 the grenade animation stop occurs (which I want).

Is there a way I can only tap button_7 ONCE and I get the grenade animation stop response?

Thanks a bunch!


#pragma METAINFO("Double Press", 1, 0, "alanmcgregor")

#define MaxTimePressed 200
#define TimeBeforeNextPress 50 // reduce this value for faster double Y tap


main {
//If quick Tap for Double Y Press. Press Y a bit longer for regular Y action
if(event_release(BUTTON_7) && (time_active(BUTTON_7) <= MaxTimePressed)) {
combo_run(cDoublePressY);
}
}

combo cDoublePressY{
wait(TimeBeforeNextPress);
set_val(BUTTON_14, 100.0);
wait(50);
}
User avatar
Lifty
Private First Class
Private First Class
 
Posts: 2
Joined: Tue Aug 13, 2019 12:23 am


Return to Titan Two Device

Who is online

Users browsing this forum: No registered users and 11 guests