Beginners Guide Scripting for TITAN ONE (BEAST07)

Welcome to beginners guide for scripting for TITAN ONE Easy to follow steps. NOTE: if you use keyboard and mouse send me a "PM" (BEAST07) to help add input translator. If you do not use keyboard and mouse just delete that section.
Version1.00
AuthorJ2Kbr
Publish DateTue, 1 Dec 2020 - 09:39
Last UpdateTue, 1 Dec 2020 - 09:39
Downloads74
RATE


1

0

Code: Select all
//DEFINE MEANS YOU CAN CHANGE THE NAME OF THE BUTTON, MAKE IT EASY WHEN SCRIPTING */
define HOME = XB1_XBOX;
define VIEW_reset  = XB1_VIEW;
define MENU_save = XB1_MENU;
define SPOT = XB1_RB;
define FIRE = XB1_RT;
define MELEE = XB1_RS;
define TACTICAL = XB1_LB;
define ADS = XB1_LT;
define SPRINT = XB1_LS;
define RX = XB1_RX;
define RY = XB1_RY;
define LX = XB1_LX;
define LY = XB1_LY;
define UP = XB1_UP;
define DOWN = XB1_DOWN;
define LEFT = XB1_LEFT;
define RIGHT = XB1_RIGHT;
define SW_WEAPON = XB1_Y;
define PRONE = XB1_B;
define JUMP = XB1_A;
define RELOAD = XB1_X;
define GYROX_PR1 = XB1_P1;
define GYROY_PR2 = XB1_P2;
define GYROZ_PL1 = XB1_P1;
define TOUCH_PL2 = XB1_P2;
 
//DATA NEED TO MAKE COLOURS */
data(1,
    2,0,0,0, //1 Blue
    0,2,0,0, //2 Red
    0,0,2,0, //3 Green
    0,0,0,2, //4 Pink
    2,0,2,0, //5 Cyan
    0,2,2,0, //6 Amber/Yellow
    2,2,2,2  //7 White
);
 
int RUN__SENS = -90; // EASY RUN SENS ADJUST IT HERE */
int SENS_ADJUST = TRUE; // TRUE MEANS YOU ARE PLAYING WITH SENS ADJUST BELOW*/
int ADS_SENS=100, GEN_SENS=100, HIP_SENS=100, ADS_FIRE_SENS=100,
//ALL SENS AT 100 MEANS IT THE SAME AS YOUR INGAME SENS */
//YOU CAN ADJUST ALL SENS, LOWER THE NUMBER THE SLOWER IT MOVES */
//YOU CAN OVERCLOCK SENS UP TO 150 MAX, IF YOU NEED MORE THEN ADJUST INGAME SENS*/
Use_sens, midpoint=50;
//DON'T ADJUST MIDPOINT IT WILL CHANGE SEN FUNCTION */
 
int hold_time=35; // RAPID FIRE HOLD TIME: IS HOW LONG BUTTON IS PRESS, YOU ADJUST IT HERE */
int rest_time=35; // RAPID FIRE REST TIME: IS HOW LONG BUTTON IS RELEASED, YOU ADJUST IT HERE */
 
int GamePlay =TRUE; // EVENT(MAIN SWITCH FOR GAME MODE AND COMBAT MODE LINE 104) */
int GameMode =TRUE; // SWITCH BETWEEN GAME MODE AND COMBAT MODE LINE 106*/
// NOTE:!GAMEMODE MEANS IN COMBAT MODE ( "!" MEAN MODE IS FALSE BUT YOU CAN STILL YOU IT TO ADD SCRIPTING) */
// USE CAN ALSO USE GAMEMODE AND !GAMEMODE AS PRIMARY WEAPON, SECONDARY WEAPON MODE*/
int ColorNumber;
 
// SCRIPT STARTS BELOW */
main {
    if(SENS_ADJUST){
        // RIGHT TRIGGER AND LEFT TRIGGER ADJUSTS RIGHT STICK SENS */
        if(get_val(FIRE) && get_val(ADS)) {
            Use_sens = ADS_FIRE_SENS; // YOU ADJUST ABOVE SCRIPT LINE 43 */
            sensitivity(RX, midpoint ,Use_sens);// YOU CAN CHANGE IT TO LX FOR LEFT STICK */
            sensitivity(RY, midpoint ,Use_sens);
        }
        // RIGHT TRIGGER AND NO LEFT TRIGGER ADJUSTS RIGHT STICK SENS */
        if(get_val(FIRE) && !get_val(ADS)) {
            Use_sens = HIP_SENS; // YOU ADJUST ABOVE SCRIPT LINE 43 */
            sensitivity(RX, midpoint ,Use_sens);
            sensitivity(RY, midpoint ,Use_sens);
        }
        // NO RIGHT TRIGGER AND NO LEFT TRIGGER MEANS NORMAL INGAME SEN */
        if(!get_val(FIRE) && !get_val(ADS)) {
            Use_sens = GEN_SENS; // YOU ADJUST ABOVE SCRIPT LINE 43 */
            sensitivity(RX, midpoint ,Use_sens);
            sensitivity(RY, midpoint ,Use_sens);
        }
        // NO RIGHT TRIGGER AND LEFT TRIGGER ADJUST RIGHT STICK SENS */
        if(!get_val(FIRE) && get_val(ADS)) {
            Use_sens = ADS_SENS; // YOU ADJUST ABOVE SCRIPT LINE 43 */
            sensitivity(RX, midpoint ,Use_sens);
            sensitivity(RY, midpoint ,Use_sens);
        }
    }
    // IF YOU GET BUTTONS STILL SHOWING INPUT IN GTUNER.(WORNOUT BUTTONS) */
    if(abs(get_val(ADS)) < 12.0 && abs(get_val(FIRE)) < 12.0){
        set_val(ADS,0.0);
        set_val(FIRE,0.0); // ZERO ADS AND FIRE BUITTONS*/
    }
 
    // START EVENT SWITCH BETWEEN GAME MODE & COMBAT MODE */
 
    if (GamePlay){
        if(event_press(SPRINT)){ // SPRINT IS LEFT THUMB STICK, PRESS ONES */
            GameMode = !GameMode;
        }
    }
    // SWITCH BETWEEN GAME MODE & COMBAT MODE */
 
    if(GameMode){ ColorLED(2);// LEDS SHOW WHICH MODE YOU ARE IN "2" IS BLUE*/
 
        // YOU ADD COMBO HERE IN GAME MODE*/
    }
    if(!GameMode){ ColorLED(4);// LEDS SHOW WHICH MODE YOU ARE IN "4" IS RED*/
 
        // I HAVE ADDED EASY RUN AND RAPID FIRE TO !GAMEMODE ( COMBAT MODE)*/
 
        if(get_val(LY)<=RUN__SENS && !get_val(ADS)) {
            combo_run (Easy_Run); // LEFTSTICK FORWARD AND NO LEFT TRIGGER EASY RUN IS WORKING */
        }
 
        // GUN SETTING */
        if(get_val(FIRE) && !get_val(ADS)) {// RIGHT TRIGGER WITH NO LEFT TRIGGER */
            set_val(FIRE,0.0);// MUST SET BUTTON TO ZERO OR COMBO WILL STILL SEE THE INPUT */
            combo_run (Rapid_Fire); // COMBO RAPID FIRE */
        }
    }// TWO "}" MEANS END OF !GAMEMODE SCRIPT */
    // NOTE: IF YOU HIGHLIGHT "}" IT WILL SHOW YOU WHERE YOUR SCRIPTING STARTS SCROLL UP SRCIPT TO SEE GREEN "{" */
 
    // END OF COMBAT MODE SCRIPT */
 
    // RESET DEFAULT MEANS IF YOU HAVE MORE THEN ONE EVENT RUN IT WILL RETURN THEM BACK TO DEFAULT */
    // SEE BELOW FUNCTION DEFAULT RESET */
    if(get_val(VIEW_reset) && get_ptime(VIEW_reset)>300){
        RESET_Defaults();
    }
}
 
// END OF SCRIPT */
 
// ALL COMBO'S */
// THERE ARE 2 WAYS TO US WAIT BY NUMBER OR BY int CODE BY NAME. */
// IF YOU NEED TO ADJUST THEM ALOT IT IS EASIER TO USE int CODE NAMES */
combo Easy_Run {
    set_val(SPRINT,100.0);
    wait(30);
    set_val(SPRINT,0.0);
    wait(30);
}
 
combo Rapid_Fire {
    set_val(FIRE,100.0);
    wait(hold_time);
    set_val(FIRE, 0.0);
    wait(rest_time);
}
 
// FUNCTION SECTION */
 
// RESET ALL EVENT TO DEFAULT */
function  RESET_Defaults () {
    GameMode =TRUE;
 
}
 
// FUNCTION COLOUR LEDS */
function ColorLED(Color) {
    ColorNumber=(Color*4)-3;
    set_led(LED_1,dbyte(ColorNumber));
    set_led(LED_2,dbyte(ColorNumber+1));
    set_led(LED_3,dbyte(ColorNumber+2));
    set_led(LED_4,dbyte(ColorNumber+3));
}