Re: Convert Titan1 scripts to Titan2 the easy way
Posted: Tue Jan 08, 2019 6:27 am
Converted using the back compatibility header file:
- Code: Select all
#include <titanone.gph>
//------------------------------------------------|
// \ \ \ \ \ ___ _ __\ \ ,_\ __ __ _ |
// \ \ \ \ \ / __`\/\`'__\ \ \/ /'__`\/\ \/'\ |
// \ \ \_/ \/\ \L\ \ \ \/ \ \ \_/\ __/\/> </ |
// \ `\___/\ \____/\ \_\ \ \__\ \____\/\_/\_\ |
// `\/__/ \/___/ \/_/ \/__/\/____/\//\/_/ |
//------------------------------------------------|
//DEFINITIONS
define ANTI_RECOIL = 20; // change this value to compensate vertical recoil (0 - 100)
define ANTI_RECOIL_LEFT = 0; // change this value to compensate to the left (0 - 100)
define ANTI_RECOIL_RIGHT = 0; // change this value to compensate to the right (0 - 100)
//INITIALIZATION
int Dead_Zone_Up = -10 ;
int Dead_Zone_Down = 10 ;
int Dead_Zone_Left = -10 ;
int Dead_Zone_Right = 10 ;
int Recoil_Down = 28;
int Recoil_Up = -28;
int Recoil_Delay = 17;
int Recoil_Release;
int Vertical;
int value = 33;
int value2 = -33;
int delay = 11;
int crouch_shot_onoff = FALSE;
int rf = FALSE;
int rf2 = FALSE;
int rf3 = FALSE;
int Aim_BTN;
int Shoot_BTN;
int RX;
int RY;
int Crouch_BTN;
int LeanLeft;
int LeanRight;
int Switch;
int LX;
int LY;
int Left;
int Up;
init { //-BUTTON LAYOUT-\\
if(get_console() == PIO_PS4){ Aim_BTN = PS4_L2; Shoot_BTN = PS4_R2; RX = PS4_RX; RY = PS4_RY; Crouch_BTN = PS4_CIRCLE; LeanLeft = PS4_L3; LeanRight = PS4_R3; Switch = PS4_TRIANGLE; LX = PS4_LX; LY = PS4_LY; Left = PS4_LEFT; Up = PS4_UP;
}else{
Aim_BTN = XB1_LT; Shoot_BTN = XB1_RT; RX = XB1_RX; RY = XB1_RY; Crouch_BTN = XB1_B; LeanLeft = XB1_LS; LeanRight = XB1_RS; Switch = XB1_Y; LX = XB1_LX; LY = XB1_LY; Left = XB1_LEFT; Up = XB1_UP;
}
Recoil_Release = Recoil_Down + 1; // Anti-Recoil Release Value (For Positive Number) // Anti-Recoil
}
//MAIN SCRIPT
main {
//AimAssist
if(get_val(Shoot_BTN) && get_val(Aim_BTN)) {
combo_run(RT_C);
}
if(get_val(RX) < value2 || get_val(RX) > value || get_val(RY) < value2 || get_val(RY) > value
|| get_val(RX) < value2 || get_val(RX) > value || get_val(RY) < value2 || get_val(RY) > value) {
combo_stop(RT_C);
}
//FastLean
if (get_val(Aim_BTN) && event_press(LeanLeft)) combo_run(LeanLeft_Combo);
if(combo_running(LeanLeft)) {set_val(LeanLeft, 0);}
if (get_val(Aim_BTN) && event_press(LeanRight)) combo_run(LeanRight_Combo);
if(combo_running(LeanRight)) set_val(LeanRight, 0);
//RapidFire
if(event_press(Left)) { // Rapid Fire Secondary
rf = FALSE;
rf2 = TRUE;
rf3 = FALSE;
}
if(event_press(Up)) { // Rapid Fire Both
rf = TRUE;
rf2 = FALSE;
}
if (rf) {
if (get_val(Shoot_BTN))
combo_run(rapidfire);
}
if (rf2) {
if (event_press(Switch))
rf3 = !rf3;
}
if (rf3) {
if (get_val(Shoot_BTN))
combo_run(rapidfire);
}
//CrouchShot
if (get_val(Aim_BTN) && event_press(Left)) {
crouch_shot_onoff = !crouch_shot_onoff;
}
if (crouch_shot_onoff) {
if (get_val(Shoot_BTN))
combo_run(Crouch_Shot);
}
//AntiRecoil
if (get_val(Shoot_BTN))
combo_run(Anti_Recoil1);
combo_run(Dead_Zone);
}
//COMBOS
combo Crouch_Shot { //CrouchShot
set_val(Crouch_BTN, 100);
wait(80);
wait(60);
}
combo LeanRight_Combo {//FastLeanRight
set_val(LeanLeft, 100);
wait(40);
set_val(LeanRight, 100);
set_val(LeanLeft, 100);
wait(90);
set_val(LeanRight, 100);
set_val(LeanLeft, 0);
wait(10);
set_val(LeanRight, 0);
}
combo LeanLeft_Combo {//FastLeanLeft
set_val(LeanRight, 100);
wait(40);
set_val(LeanLeft, 100);
set_val(LeanRight, 100);
wait(90);
set_val(LeanLeft, 100);
set_val(LeanRight, 0);
wait(10);
set_val(LeanLeft, 0);
}
combo rapidfire { // Rapid Fire
set_val(Shoot_BTN,100);
wait(17);
set_val(Shoot_BTN,0);
wait(17);
}
combo RT_C {
set_val(RY, -32);
wait(delay);
set_val(RX, 32);
set_val(RY, 22);
wait(delay) ;
set_val(RY, 22);
wait(delay) ;
set_val(RX, -32);
set_val(RY, 22);
wait(delay);
}
combo Dead_Zone { // Anti-Recoil
set_val(RX,Dead_Zone_Vertical(RX,Dead_Zone_Right,Dead_Zone_Left));
set_val(RY,Dead_Zone_Vertical(RY,Dead_Zone_Down,Dead_Zone_Up));
set_val(LX,Dead_Zone_Vertical(LX,Dead_Zone_Right,Dead_Zone_Left));
set_val(LY,Dead_Zone_Vertical(LY,Dead_Zone_Down,Dead_Zone_Up));
}
combo Anti_Recoil1 { //Don't touch this combo pls
set_val(RY,Anti_Recoil_Vertical(RY,Recoil_Down)); // Down
wait(Recoil_Delay);
set_val(RY,Anti_Recoil_Vertical(RY,Recoil_Up)); // Up
wait(Recoil_Delay);
}
function Anti_Recoil_Vertical(f_axis,f_val) { // Return Anti-Recoil Value Or Controller Value If Above Release // Anti-Recoil
Vertical = get_val(f_axis);
if(abs(Vertical) < Recoil_Release)
return f_val + Vertical;
return Vertical; }
function Dead_Zone_Vertical(f_axis,f_pv,f_nv) { // Return zero if between postive & negative limits // Anti-Recoil
if(get_val(f_axis) < f_pv && get_val(f_axis) > f_nv)
return 0;
return get_val(f_axis); }