Flashing orange when weapon swap

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

Flashing orange when weapon swap

Postby Conso » Mon May 02, 2022 2:45 pm

Hi

playing on PS5 with Titan2, Xim Apex, PS4 Controller first slot and HoriPAD mini second slot (workaround for timeout), I have problems when I swap weapon, sometimes the color change to orange and not to green or red for primary or secondary weapon.

I do not find any issue in the script, this works fine and as I mentoined, it is not always.

Does anyone have an idea ?
User avatar
Conso
Sergeant
Sergeant
 
Posts: 7
Joined: Thu Mar 31, 2022 4:20 pm

Re: Flashing orange when weapon swap

Postby Scachi » Mon May 02, 2022 3:35 pm

You should mention the script you are using and the game you are playing.
If you are using my Division 2 script Orange is for special weapon. That happens on the long hold of the weapon change button.
Each weapon slot has specific anti recoil settings. Only orange has none as when I created the script there was no special weapon available that needed anti recoil for special.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Flashing orange when weapon swap

Postby Conso » Mon May 02, 2022 4:33 pm

Division 1 with a converted CM script.

Code: Select all
#pragma METAINFO("Script3.gpc", 1, 0, "Buffy's GPC Converter v0.28r6")
#include <titanone.gph>
 
 
#define _ot_i _ot_i2
const uint8 _ot_i2[42] = {
    BUTTON_1BUTTON_2BUTTON_3BUTTON_4BUTTON_5BUTTON_6,
    BUTTON_7BUTTON_8BUTTON_9STICK_1_X, STICK_1_Y, STICK_2_X,
    STICK_2_Y, BUTTON_10, BUTTON_11, BUTTON_12, BUTTON_13, BUTTON_14,
    BUTTON_15, BUTTON_16, BUTTON_17, ACCEL_1_X, ACCEL_1_Y, ACCEL_1_Z,
    GYRO_1_XGYRO_1_YGYRO_1_ZPADDLE_1, POINT_1_X, POINT_1_Y,
    PADDLE_2, PADDLE_3, PADDLE_4, ACCEL_2_X, ACCEL_2_Y, ACCEL_2_Z,
    0, 0, BUTTON_18, BUTTON_19, BUTTON_20, BUTTON_21,
};
//
//___________________________________________________OPTIONS START______________________________________________________//
//______________________________________________________________________________________________________________________//
//  ____ _  _ ____ ____ ____ ____    _   _ ____ _  _ ____    ____ ___  ___ _ ____ _  _ ____
//  |    |__| |  | |  | [__  |___     \_/  |  | |  | |__/    |  | |__]  |  | |  | |\ | [__ 
//  |___ |  | |__| |__| ___] |___      |   |__| |__| |  \    |__| |     |  | |__| | \| ___]   
//----------------------------------------------------------------------------------------------------------------------//
//                                    PRIMARY WEAPON (or GREEN light):
//        Choose your primary weapon, only one value can be TRUE! (If no values are TRUE, you can play with any weapon)
//    SMG
// Use with 5% or 6% Rate of Fire more !
// Use with 5% or 6% Rate of Fire more !
// Use with 5% or 6% Rate of Fire more !
//----------------------------------------------------------------------------------------------------------------------//
//                                    SECONDARY WEAPON (or RED light):
//        Choose your secondary weapon, only one value can be TRUE! (If no values are TRUE, you can play with any weapon)
//    SMG
// Use with 5% or 6% Rate of Fire more !
// Use with 5% or 6% Rate of Fire more !
// Use with 5% or 6% Rate of Fire more !
//----------------------------------------------------------------------------------------------------------------------//
//                                    Pistol setting (YELLOW light):
// RapidFire for Pistol
// Range: 1 to 25 RPS (Round/s)
//----------------------------------------------------------------------------------------------------------------------//
//                                    AutoRun setting:
//        Work better when in game option "Press to Sprint" is turned OFF
// TRUE = AutoTun ON  // FALSE = AutoRun TRUE
//----------------------------------------------------------------------------------------------------------------------//
//                                    Parkour setting:
//        Hold D Pad DOWN and press PS4 Circle or Xbox B to activate, do it again to desactivate
// TRUE = Parkour ON  // FALSE = Parkour TRUE
//----------------------------------------------------------------------------------------------------------------------//
//                                    Strafe setting:
//        Double tap PS4 Circle or Xbox B to Strafe, double tap again to stop Strafe
//        Work better when in game option "Press to Sprint" is turned OFF
// TRUE = Strafe ON // FALSE = Strafe TRUE
//----------------------------------------------------------------------------------------------------------------------//
//                                    Swap Triggers setting:
// FALSE = shoot and aim with R2/L2 // TRUE = shoot and aim with R1/L1
//----------------------------------------------------------------------------------------------------------------------//
//                                    Inverted Axis setting:
//        If you play with inverted axis, set TRUE, in game option "Invert Y axis" MUST BE OFF!
// Set TRUE for Right Y axis inverted, esle set FALSE
//----------------------------------------------------------------------------------------------------------------------//
//                                    AutoMark/Mark Targets setting:
// FALSE = AutoMark OFF // TRUE = AutoMark ON
//----------------------------------------------------------------------------------------------------------------------//
//                                  Double Heal setting (Disable by befaut):
//     Hold D-Pad DOWN and press the button YOU assign just below to enable / disable
//     If enable, tap the button YOU assign just below to take MedKit then Heal Skill
// set L_SKILL or R_SKILL
//----------------------------------------------------------------------------------------------------------------------//
//                                    Fast MedKit setting:
//        Press PS4 Circle or Xbox B while aiming, fireing or both to take a medkit very fast
// TRUE = Fast Medkit ON  // FALSE = Fast Medkit TRUE
//----------------------------------------------------------------------------------------------------------------------//
//                                    Fake Lone Star setting:
//        Double tap PS4 square or Xbox X to reload then switch weapon
// TRUE = Fake Lone Star ON  // FALSE = Fake Lone Star OFF
//----------------------------------------------------------------------------------------------------------------------//
//                                    Classified 6p Striker (30% stability) settings:
// TRUE if you run 6 pieces Striker, else FALSE
//______________________________________________________________________________________________________________________//
//___________________________________________________OPTIONS END________________________________________________________//
//______________________________________________________________________________________________________________________//
// PS4 R1 / Xbox RB
// PS4 R2 / Xbox RT
// PS4 R3 / Xbox RS
// PS4 L1 / Xbox LB
// PS4 L2 / Xbox LT
// PS4 L3 / Xbox LS
// PS4 RX / Xbox RX
// PS4 RY / Xbox RY
// PS4 LX / Xbox LX
// PS4 LY / Xbox LY
// PS4 UP / Xbox UP
// PS4 DOWN / Xbox DOWN
// PS4 LEFT / Xbox LEFT
// PS4 RIGHT / Xbox RIGHT
// PS4 Triangle / Xbox Y
// PS4 Circle / Xbox B
// PS4 Cross / Xbox A
// PS4 Square / Xbox X
//1. Blue
//2. Red
//3. Lime/Green
//4. Fuchsia/Pink
//5. SkyBlue
//6. Yellow
//7. White
// For Enable/Disable ALL FEATURES (BLUE light if all features are disable)
// For AntiRecoil combo
// For AntiRecoil combo
// For AntiRecoil combo
// For AntiRecoil combo
// For AntiRecoil combo
// For AntiRecoil combo
// For AntiRecoil combo
// For Double Tap
// For Double Tap
// For Switch weapon
// For Sidearm / Pistol
// For RapidFire
// For RapidFire
// For device color
// For Parkour
// For Strafe
// For Double Heal
// For Snipers
// For Snipers
// For Snipers
// For MDR
// For MDR
// For Shotgun combo
// For Shotgun combo
// For Shotgun combo
//_______________________________________________________________________________________________________________________//
//  _  _ ____ _ _  _    ____ ___ ____ ____ ___
//  |\/| |__| | |\ |    [__   |  |__| |__/  | 
//  |  | |  | | | \|    ___]  |  |  | |  \  |
// main start
//Switch Weapons + Panic Button
//_______________________________________________________________________________________________________________________//
//  ____ ___  ___ _ ____ _  _ ____
//  |  | |__]  |  | |  | |\ | [__ 
//  |__| |     |  | |__| | \| ___]
//Swap Triggers
//Script Enable/Disable mode (Script enable by defaut)
//Hold D pad DOWN and press PS4 Cross or Xbox A to enable or disable ALL FEATURES BELOW
// Script Enable start
//Double Tap
//AutoRun (Work better when in game option "Press to Sprint" is turned OFF)
// Press sensitive = 75
//Parkour
//If Parkour_onoff is TRUE, hold D pad DOWN and press PS4 Circle or Xbox B to enable, double tap again to disable
// Press sensitive = 70
//Strafe
//Double tap PS4 Circle or Xbox B to Strafe, double tap again to stop Strafe
//Work better with AutoRun and when in game option "Press to Sprint" is turned OFF
// Double tap speed (discrease value to have to double tap faster to enable / disable)
//Hair Trigger (always enable)
//Inverted Axis
// AutoMark (Mark Targets)
//Double Heal (Disable by befaut)
//Hold D-Pad DOWN and press the button YOU assign in settings to enable / disable
//If enable, tap the button YOU assign in settings to take MedKit then Heal Skill
//Fast MedKit
//Take a MedKit very fast while aiming, fireing or both with PS4 Circle or Xbox B
//Fake Lone Star
// Double tap speed (discrease value to have to double tap faster to reload then switch)
//_______________________________________________________________________________________________________________________//
//  ____ _ ___  ____ ____ ____ _  _      /    ___  _ ____ ___ ____ _   
//  [__  | |  \ |___ |__| |__/ |\/|     /     |__] | [__   |  |  | |   
//  ___] | |__/ |___ |  | |  \ |  |    /      |    | ___]  |  |__| |___     color blue
// Switch to side arm
// Double tap speed (discrease value to have to double tap faster to switch to side arm)
// Pistol start
// Pistol AntiRecoil
// Pistol end
//_______________________________________________________________________________________________________________________//
// NOT Pistol start
//_______________________________________________________________________________________________________________________//
// ___  ____ _ _  _ ____ ____ _   _    _ _ _ ____ ____ ___  ____ _  _
// |__] |__/ | |\/| |__| |__/  \_/     | | | |___ |__| |__] |  | |\ |
// |    |  \ | |  | |  | |  \   |      |_|_| |___ |  | |    |__| | \|    color green
//----------------------------------------------------- All SMG ---------------------------------------------------------//
// Any SMG on
// Any SMG off
//----------------------------------------------------- House part ------------------------------------------------------//
// House TRUE start
// Change this value to compensate horizontal recoil        (0 - 100)
// Change this value to compensate horizontal recoil        (0 - 100)
// Burst before antirecoil
// Recoil (NOT Striker value, Striker value)
// +600
// Recoil (NOT Striker value, Striker value)
// +600
// Recoil (NOT Striker value, Striker value)
// +800
// Recoil (NOT Striker value, Striker value)
// +800
// Recoil (NOT Striker value, Striker value)
// House TRUE end
//----------------------------------------------------- MP5 part --------------------------------------------------------//
// MP5 TRUE start
// Change this value to compensate horizontal recoil        (0 - 100)
// Change this value to compensate horizontal recoil        (0 - 100)
// Burst before antirecoil
// Recoil (NOT Striker value, Striker value)
// +850
// Recoil (NOT Striker value, Striker value)
// +850
// Recoil (NOT Striker value, Striker value)
// +1000
// Recoil (NOT Striker value, Striker value)
// +1000
// Recoil (NOT Striker value, Striker value)
// MP5 TRUE end
//----------------------------------------------------- Midas part ------------------------------------------------------//
// Midas TURE start
// Change this value to compensate horizontal recoil        (0 - 100)
// Change this value to compensate horizontal recoil        (0 - 100)
// Burst before antirecoil
// Recoil (NOT Striker value, Striker value)
// +850
// Recoil (NOT Striker value, Striker value)
// +1000
// Recoil (NOT Striker value, Striker value)
// +1000
// Recoil (NOT Striker value, Striker value)
// +1250
// Recoil (NOT Striker value, Striker value)
// Midas TRUE end
//PRIMARY end
//_______________________________________________________________________________________________________________________//
// ____ ____ ____ ____ _  _ ___  ____ ____ _   _    _ _ _ ____ ____ ___  ____ _  _
// [__  |___ |    |  | |\ | |  \ |__| |__/  \_/     | | | |___ |__| |__] |  | |\ |
// ___] |___ |___ |__| | \| |__/ |  | |  \   |      |_|_| |___ |  | |    |__| | \|    color red
//----------------------------------------------------- All SMG ---------------------------------------------------------//
// Any SMG on
// Any SMG off
//----------------------------------------------------- House part ------------------------------------------------------//
// House TURE start
// Change this value to compensate horizontal recoil        (0 - 100)
// Change this value to compensate horizontal recoil        (0 - 100)
// Burst before antirecoil
// Recoil (NOT Striker value, Striker value)
// +600
// Recoil (NOT Striker value, Striker value)
// +600
// Recoil (NOT Striker value, Striker value)
// +800
// Recoil (NOT Striker value, Striker value)
// +800
// Recoil (NOT Striker value, Striker value)
// House TRUE end
//----------------------------------------------------- MP5 part --------------------------------------------------------//
// MP5 TRUE start
// Change this value to compensate horizontal recoil        (0 - 100)
// Change this value to compensate horizontal recoil        (0 - 100)
// Burst before antirecoil
// Recoil (NOT Striker value, Striker value)
// +850
// Recoil (NOT Striker value, Striker value)
// +850
// Recoil (NOT Striker value, Striker value)
// +1000
// Recoil (NOT Striker value, Striker value)
// +1000
// Recoil (NOT Striker value, Striker value)
// MP5 TRUE end
//----------------------------------------------------- Midas part ------------------------------------------------------//
// Midas TURE start
// Change this value to compensate horizontal recoil        (0 - 100)
// Change this value to compensate horizontal recoil        (0 - 100)
// Burst before antirecoil
// Recoil (NOT Striker value, Striker value)
// +850
// Recoil (NOT Striker value, Striker value)
// +1000
// Recoil (NOT Striker value, Striker value)
// +1000
// Recoil (NOT Striker value, Striker value)
// +1250
// Recoil (NOT Striker value, Striker value)
// Midas TRUE end
//SECONDARY end
//_______________________________________________________________________________________________________________________//
// NOT Pistol end
//_______________________________________________________________________________________________________________________//
// Script Enable end
// COLOR INDICATION
//main end 
//  _  _ ____ _ _  _    ____ _  _ ___ 
//  |\/| |__| | |\ |    |___ |\ | |  \
//  |  | |  | | | \|    |___ | \| |__/
//_______________________________________________________________________________________________________________________//
//  ____ ____ _  _ ___  ____    ____ ____ ____ ___ _ ____ _  _
//  |    |  | |\/| |__] |  |    [__  |___ |     |  | |  | |\ |
//  |___ |__| |  | |__] |__|    ___] |___ |___  |  | |__| | \|
//----------------------------------------------------- Weapons combos -------------------------------------------------//
// RAPIDFIRE FOR PISTOL
//----------------------------------------------------- Features combos -------------------------------------------------//
// Run straight, right, straight, left
// Time to run straight
// Time to run to the right
// Time to run straight
// Time to run to the left
//_______________________________________________________________________________________________________________________//
//  ____ ____ _  _ ____ ___ _ ____ _  _ ____
//  |___ |  | |\ | |     |  | |  | |\ | [__ 
//  |    |__| | \| |___  |  | |__| | \| ___]
//_______________________________________________________________________________________________________________________//
//_______________________________________________________________________________________________________________________//
//_______________________________________________________________________________________________________________________//
// COLOR LED function
//end
 
define R_SKILL = 3;
define FIRE_BTN = 4;
define R_Stick = 5;
define L_SKILL = 6;
define ADS_BTN = 7;
define L_Stick = 8;
define R_X = 9;
define R_Y = 10;
define L_X = 11;
define L_Y = 12;
define D_UP = 13;
define D_DOWN = 14;
define D_LEFT = 15;
define D_RIGHT = 16;
define Switch_button = 17;
define CLIMB_BTN = 18;
define COVER_BTN = 19;
define RELOAD_BTN = 20;
define Blue = 1;
define Red = 2;
define Green = 3;
define Pink = 4;
define SkyBlue = 5;
define Yellow = 6;
define White = 7;
#define __LAST_COMBO__ c_AntiRecoil
#define _VM_BTN_COUNT_ 42
#define DISABLE_VM_ // delete underscore to disable VM mode
#ifndef DISABLE_VM
#define VM_TIME 10
#define vm_tctrl(time) ___vm_time___ = (((10+ time) < 0) ? 0 : (10+ time))
#define wait(a) wait(vm_tctrl_wait(a));
#else
#define VM_TIME 0
#endif
 
data(1,
2, 0, 0, 0,
0, 2, 0, 0,
0, 0, 2, 0,
0, 0, 0, 2,
2, 0, 2, 0,
0, 2, 2, 0,
2, 2, 2, 2
);
 
int House_onoff = TRUE;
int MP5_onoff = FALSE;
int Midas_onoff = FALSE;
int House_2_onoff = FALSE;
int MP5_2_onoff = TRUE;
int Midas_2_onoff = FALSE;
int RATE_OF_FIRE = 13;
int AutoRun_onoff = TRUE;
int Parkour_onoff = TRUE;
int Strafe_onoff = FALSE;
int R1L1_onoff = FALSE;
int Axis_inverted = FALSE;
int AutoMark_onoff = FALSE;
int Heal_BTN = R_SKILL;
int Fast_Medkit_onoff = TRUE;
int Reload_Switch_onoff = TRUE;
int Striker_onoff = FALSE;
int Script_onoff;
int ANTI_RECOIL;
int ANTI_RECOIL_LEFT;
int ANTI_RECOIL_RIGHT;
int AR_Release = 90;
int anti_recoil;
int anti_recoil_left;
int anti_recoil_right;
int BTN_Tap;
int Timer;
int Switch;
int Pistol_onoff = FALSE;
int hold_time;
int rest_time;
int Col_ind;
int Parkour;
int Loop;
int Heal_onoff;
int scoped;
int S_Time1;
int S_Time2;
int AR_Time_1;
int AR_Time_2;
int SG_Time1;
int SG_Time2;
int SG_Time3;
uint8 __COMBO_RUN__[8];
int8 __io_vals__[_VM_BTN_COUNT_];
uint8 __io_val_events__[_VM_BTN_COUNT_];
uint32 __vm_run_time__ = 0;
uint8 __run_vm__ = 1,  ___vm_time___ = VM_TIME,  ___i____i;
 
main {
    if(__run_vm__) {
        if (_event_press(Switch_button) || _event_release(D_UP) && get_ptime(D_UP) > 55) {
            Switch =! Switch;
            Pistol_onoff = FALSE;
        }
        if (R1L1_onoff) {
            swap(3, 4);
            swap(6, 7);
        }
        if (get_val(D_DOWN) && _event_press(COVER_BTN)) {
            Script_onoff =! Script_onoff;
        }
        if (!Script_onoff) {
            if (Timer > 0) {
                Timer = Timer-get_rtime();
                if (Timer <= 0) BTN_Tap = FALSE;
            }
            if (AutoRun_onoff) {
                if (!combo_running(c_Strafe_v2) && !get_val(ADS_BTN) && get_val(L_Y) < -75) {
                    set_val(L_Stick, 100);
                }
            }
            if (Parkour_onoff) {
                if (get_val(D_DOWN) && _event_press(CLIMB_BTN)) {
                    Parkour =! Parkour;
                }
                if (Parkour) {
                    if (!combo_running(c_Strafe_v2) && !get_val(ADS_BTN) && get_val(L_Y) < -70) {
                        combo_run(c_AutoClimb);
                    }
                }
            }
            if (Strafe_onoff) {
                if (_event_press(CLIMB_BTN)) {
                    if (f_Double_Tap(175)) {
                        Loop =! Loop;
                    }
                }
                if (Loop) {
                    combo_run(c_Strafe_v2);
                }
                else {
                    combo_stop(c_Strafe_v2);
                }
            }
            if (get_val(FIRE_BTN) > 0) {
                set_val(FIRE_BTN, 100);
            }
            if (get_val(ADS_BTN) > 0) {
                set_val(ADS_BTN, 100);
            }
            if (Axis_inverted) {
                set_val(R_Y, inv(get_val(R_Y)));
            }
            if (AutoMark_onoff) {
                if (get_val(ADS_BTN)) {
                    combo_run(c_MarkTargets);
                }
            }
            if (get_val(D_DOWN) && _event_press(Heal_BTN)) {
                Heal_onoff =! Heal_onoff;
            }
            if (Heal_onoff) {
                if (_event_press(Heal_BTN)) {
                    set_val(Heal_BTN, 0);
                    combo_run(c_Heal);
                }
            }
            if (Fast_Medkit_onoff) {
                if ((get_val(ADS_BTN) || get_val(FIRE_BTN)) && _event_press(CLIMB_BTN)) {
                    combo_run(c_MedKit);
                }
            }
            if (Reload_Switch_onoff) {
                if (_event_press(RELOAD_BTN)) {
                    if (f_Double_Tap(250)) {
                        combo_run(c_Reload);
                        Switch =! Switch;
                    }
                }
            }
            if (_event_press(Switch_button)) {
                if (f_Double_Tap(200)) {
                    Pistol_onoff = TRUE;
                    Switch =! Switch;
                }
            }
            if (Pistol_onoff) {
                ANTI_RECOIL = 30;
                if (get_val(FIRE_BTN)) {
                    combo_run(c_AntiRecoil);
                    combo_run(c_RAPID_FIRE);
                }
                else if (_event_release(FIRE_BTN)) {
                    combo_stop(c_AntiRecoil);
                    combo_stop(c_RAPID_FIRE);
                }
                hold_time = 500 / RATE_OF_FIRE;
                rest_time = hold_time-20;
                if (rest_time < 0) rest_time = 0;
            }
            if (!Pistol_onoff) {
                if (!Switch) {
                    if (House_onoff|| MP5_onoff|| Midas_onoff) {
                        if (get_val(FIRE_BTN)) {
                            ANTI_RECOIL = 0;
                            combo_run(c_AntiRecoil);
                        }
                        else if (_event_release(FIRE_BTN)) {
                            combo_stop(c_AntiRecoil);
                        }
                    }
                    if (House_onoff) {
                        ANTI_RECOIL_LEFT = 0;
                        ANTI_RECOIL_RIGHT = 0;
                        if (get_val(FIRE_BTN)) {
                            if (get_ptime(FIRE_BTN) >= 150) {
                                f_Recoil(20, 15);
                            }
                            if (get_ptime(FIRE_BTN) >= 750) {
                                f_Recoil(30, 25);
                            }
                            if (get_ptime(FIRE_BTN) >= 1350) {
                                f_Recoil(40, 30);
                            }
                            if (get_ptime(FIRE_BTN) >= 2150) {
                                f_Recoil(55, 31);
                            }
                            if (get_ptime(FIRE_BTN) >= 2950) {
                                f_Recoil(65, 39);
                            }
                        }
                    }
                    if (MP5_onoff) {
                        ANTI_RECOIL_LEFT = 0;
                        ANTI_RECOIL_RIGHT = 0;
                        if (get_val(FIRE_BTN)) {
                            if (get_ptime(FIRE_BTN) >= 150) {
                                f_Recoil(12, 7);
                            }
                            if (get_ptime(FIRE_BTN) >= 1000) {
                                f_Recoil(22, 12);
                            }
                            if (get_ptime(FIRE_BTN) >= 1850) {
                                f_Recoil(30, 19);
                            }
                            if (get_ptime(FIRE_BTN) >= 2850) {
                                f_Recoil(40, 26);
                            }
                            if (get_ptime(FIRE_BTN) >= 3850) {
                                f_Recoil(50, 32);
                            }
                        }
                    }
                    if (Midas_onoff) {
                        ANTI_RECOIL_LEFT = 0;
                        ANTI_RECOIL_RIGHT = 0;
                        if (get_val(FIRE_BTN)) {
                            if (get_ptime(FIRE_BTN) >= 150) {
                                f_Recoil(5, 5);
                            }
                            if (get_ptime(FIRE_BTN) >= 1000) {
                                f_Recoil(12, 8);
                            }
                            if (get_ptime(FIRE_BTN) >= 2000) {
                                f_Recoil(17, 12);
                            }
                            if (get_ptime(FIRE_BTN) >= 3000) {
                                f_Recoil(22, 15);
                            }
                            if (get_ptime(FIRE_BTN) >= 4250) {
                                f_Recoil(28, 18);
                            }
                        }
                    }
                }
                if (Switch) {
                    if (House_2_onoff|| MP5_2_onoff|| Midas_2_onoff) {
                        if (get_val(FIRE_BTN)) {
                            ANTI_RECOIL = 0;
                            combo_run(c_AntiRecoil);
                        }
                        else if (_event_release(FIRE_BTN)) {
                            combo_stop(c_AntiRecoil);
                        }
                    }
                    if (House_2_onoff) {
                        ANTI_RECOIL_LEFT = 0;
                        ANTI_RECOIL_RIGHT = 0;
                        if (get_val(FIRE_BTN)) {
                            if (get_ptime(FIRE_BTN) >= 150) {
                                f_Recoil(14, 10);
                            }
                            if (get_ptime(FIRE_BTN) >= 750) {
                                f_Recoil(24, 17);
                            }
                            if (get_ptime(FIRE_BTN) >= 1350) {
                                f_Recoil(34, 24);
                            }
                            if (get_ptime(FIRE_BTN) >= 2150) {
                                f_Recoil(46, 31);
                            }
                            if (get_ptime(FIRE_BTN) >= 2950) {
                                f_Recoil(58, 39);
                            }
                        }
                    }
                    if (MP5_2_onoff) {
                        ANTI_RECOIL_LEFT = 0;
                        ANTI_RECOIL_RIGHT = 0;
                        if (get_val(FIRE_BTN)) {
                            if (get_ptime(FIRE_BTN) >= 150) {
                                f_Recoil(12, 7);
                            }
                            if (get_ptime(FIRE_BTN) >= 1000) {
                                f_Recoil(22, 12);
                            }
                            if (get_ptime(FIRE_BTN) >= 1850) {
                                f_Recoil(30, 19);
                            }
                            if (get_ptime(FIRE_BTN) >= 2850) {
                                f_Recoil(40, 26);
                            }
                            if (get_ptime(FIRE_BTN) >= 3850) {
                                f_Recoil(50, 32);
                            }
                        }
                    }
                    if (Midas_2_onoff) {
                        ANTI_RECOIL_LEFT = 0;
                        ANTI_RECOIL_RIGHT = 0;
                        if (get_val(FIRE_BTN)) {
                            if (get_ptime(FIRE_BTN) >= 150) {
                                f_Recoil(5, 5);
                            }
                            if (get_ptime(FIRE_BTN) >= 1000) {
                                f_Recoil(12, 8);
                            }
                            if (get_ptime(FIRE_BTN) >= 2000) {
                                f_Recoil(17, 12);
                            }
                            if (get_ptime(FIRE_BTN) >= 3000) {
                                f_Recoil(22, 15);
                            }
                            if (get_ptime(FIRE_BTN) >= 4250) {
                                f_Recoil(28, 18);
                            }
                        }
                    }
                }
            }
            if (abs(get_val(R_Y)) > AR_Release|| abs(get_val(R_X)) > 100) {
                combo_stop(c_AntiRecoil);
            }
        }
        if (Script_onoff) f_colourled(Blue);
        else if (!Switch) f_colourled(Green);
        else  f_colourled(Red);
        if (Pistol_onoff) f_colourled(Yellow);
    }
}
 
combo c_RAPID_FIRE {
    set_val(FIRE_BTN, 100);
    wait(hold_time);
    set_val(FIRE_BTN, 0);
    wait(rest_time);
    set_val(FIRE_BTN, 0);
}
 
combo c_AutoClimb {
    set_val(CLIMB_BTN, 100);
    wait(500);
    wait(200);
}
 
combo c_Strafe_v2 {
    set_val(L_Y,  -100);
    set_val(L_Stick, 100);
    wait(250);
    set_val(L_X, 100);
    set_val(L_Y, 50);
    wait(750);
    set_val(L_Y,  -100);
    set_val(L_Stick, 100);
    wait(250);
    set_val(L_X,  -100);
    set_val(L_Y, 50);
    wait(750);
}
 
combo c_MarkTargets {
    set_val(D_UP, 100);
    wait(50);
    set_val(D_UP, 0);
    wait(1000);
}
 
combo c_Heal {
    set_val(FIRE_BTN, 0);
    set_val(D_RIGHT, 100);
    wait(15);
    set_val(FIRE_BTN, 0);
    set_val(Heal_BTN, 100);
    wait(15);
}
 
combo c_MedKit {
    set_val(FIRE_BTN, 0);
    set_val(D_RIGHT, 100);
    wait(15);
    set_val(FIRE_BTN, 0);
    wait(15);
}
 
combo c_Reload {
    set_val(RELOAD_BTN, 100);
    wait(15);
    set_val(Switch_button, 0);
    wait(700);
    set_val(Switch_button, 100);
    wait(15);
}
 
combo c_AntiRecoil {
    anti_recoil = get_val(R_Y) + ANTI_RECOIL;
    if (anti_recoil > 100) anti_recoil = 100;
    set_val(R_Y, anti_recoil);
    anti_recoil_left = get_val(R_X)  -ANTI_RECOIL_LEFT;
    if (anti_recoil_left > 100) anti_recoil_left = 100;
    set_val(R_X, anti_recoil_left);
    anti_recoil_right = get_val(R_X) + ANTI_RECOIL_RIGHT;
    if (anti_recoil_right > 100) anti_recoil_right = 100;
    set_val(R_X, anti_recoil_right);
}
 
 
function f_Recoil(val1, val2) {
    if (!Striker_onoff) {
        ANTI_RECOIL = val1;
    }
    if (Striker_onoff) {
        ANTI_RECOIL = val2;
    }
}
 
function f_Double_Tap(Time) {
    if (BTN_Tap) {
        return TRUE;
    }
    BTN_Tap = TRUE;
    Timer = Time;
    return FALSE;
}
 
function f_colourled(Colour) {
    Col_ind = (Colour * 4)  -3;
    set_led(LED_1, dbyte(Col_ind));
    set_led(LED_2, dbyte(Col_ind+ 1));
    set_led(LED_3, dbyte(Col_ind+ 2));
    set_led(LED_4, dbyte(Col_ind+ 3));
}
 
 
main {
    if(__run_vm__) {
        __run_vm__ = system_time() >= (__vm_run_time__+ ___vm_time___);
        if(__run_vm__) __vm_run_time__ = system_time();
        else {
            memset( & __io_vals__[0]0,  _VM_BTN_COUNT_);
            memset( & __io_val_events__[0]0,  _VM_BTN_COUNT_);
            for(___i____i = 0; ___i____i < _VM_BTN_COUNT_; ++ ___i____i) {
                if(get_val(___i____i)) __io_vals__[___i____i] = get_val(___i____i);
                if(get_val( ++ ___i____i)) __io_vals__[___i____i] = get_val(___i____i);
            }
            #ifdef __LAST_COMBO__
            for(___i____i = 0; ___i____i < sizeof(__COMBO_RUN__); ++ ___i____i) {
                if(__LAST_COMBO__[(___i____i * 3) + ___i____i]) {
                    __LAST_COMBO__[(___i____i * 3) + ___i____i] = 0;
                    __COMBO_RUN__[___i____i] = 1;
                }
            }
            #endif
        }
    }
    else {
        ___i____i = 0;
        do {
            if(__io_vals__[___i____i]) set_val(___i____i,    __io_vals__[___i____i]);
            if(event_press(___i____i)) __io_val_events__[___i____i] = 1;
            if(event_release(___i____i)) __io_val_events__[___i____i] = 3;
            if(__io_vals__[ ++ ___i____i]) set_val(___i____i,    __io_vals__[___i____i]);
            if(event_press(___i____i)) __io_val_events__[___i____i] = 1;
            if(event_release(___i____i)) __io_val_events__[___i____i] = 3;
        } while( ++ ___i____i < _VM_BTN_COUNT_);
        if(system_time() >= (__vm_run_time__+ ___vm_time___)) {
            __run_vm__ = 1; __vm_run_time__ = system_time();
            #ifdef __LAST_COMBO__
            for(___i____i = 0; ___i____i < sizeof(__COMBO_RUN__); ++ ___i____i) {
                if(__COMBO_RUN__[___i____i]) {
                    __LAST_COMBO__[(___i____i * 3) + ___i____i] = 1;
                    __COMBO_RUN__[___i____i] = 0;
                }
            }
            #endif
        }
    }
}
 
 
int vm_tctrl_wait(int num) {
    return ___vm_time___ ? ((num / ___vm_time___) + ((num % ___vm_time___) ? 1 : 0)) : num;
}
 
bool _event_press(uint8 io) {
    return event_press(io) || __io_val_events__[io] == 1;
}
 
bool _event_release(uint8 io) {
    return event_release(io) || __io_val_events__[io] == 3;
}
User avatar
Conso
Sergeant
Sergeant
 
Posts: 7
Joined: Thu Mar 31, 2022 4:20 pm

Re: Flashing orange when weapon swap

Postby Conso » Tue May 03, 2022 5:25 pm

Can anyone help me pls and take a look on the script in the previous post ??

I always use triangle button on PS5 for weapon swap.

When I switch between weapons slowly everything is ok (time between switching weapons is about 1.5-2sec)
T2 switches light from green to red or vice versa, thats fine so far.

When I switch between weapons within 1 sek (not double tap) a orange light on T2 is flashing like a broken neon tube. In fact it changes back to primary or secondary weapon, but of course without right norecoil settings.

When double tap, it switch correctly to pistol and T2 light is also orange, but constantly light, no flashing one.


I have no idea what I am doing wrong :icon_frown:
User avatar
Conso
Sergeant
Sergeant
 
Posts: 7
Joined: Thu Mar 31, 2022 4:20 pm


Return to Titan Two Device

Who is online

Users browsing this forum: No registered users and 80 guests