[Fix Request] Halo MCC - Halo 2 Classic custom script

GPC2 script programming for Titan Two. Code examples, questions, requests.

[Fix Request] Halo MCC - Halo 2 Classic custom script

Postby Squidward » Fri Oct 05, 2018 5:38 pm

Hey guys. Last year I had someone take my existing Halo 2 Classic script from my T1 and convert it to T2. But ever since they fixed Halo MCC last month, none of my fire modes work. I'm sure it's just the timing that's the problem. I don't know scripting at all. I'm hoping that one of you can somehow fix this script for me.

What's currently happening is every single of my 4 fire modes and my doubleshot-melee don't fire out the combo right. For example, the first fire mode is 5 shot. What it'll do is fire the first 4 rounds, then stop firing with a long enough delay that I'll get killed. Something similar happens with all 4 fire modes. In the case of both XSV fire modes, it stops the reload too soon. I don't know how to fix it. But I'm sure that the script just needs to be adjusted.

Could one of you kind souls possibly, somehow fix it for me? I'll do as much testing and stuff as you need if you need it to be tested each time it's adjusted.

Here's the script:

Code: Select all
#pragma METAINFO("Halo 2 Classic Script", 1, 00, "Scachi")
 
/* --------------------------------------------------------------------------
 *  Halo 2 Classic
 * -------------------------------------------------------------------------- */

 
/*** shortdesc
<shortdesc>
Halo 2 Classic Custom Script<br>
<br>
<br>
Please report bugs/problems via consoletuners forum - click the DOC link to get to this scripts topic.<br><br>
 
Features:
<ul>
<li>Interactive configuration</li>
<li>Fiveshot</li>
<li>Doubleshot with melee</li>
<li>Rapid Fire (left & right)</li>
<li>Melee</li>
<li>Quick Reload</li>
</ul>
 
Notes: You'll find more information in the Interactive Configuration or click the DOC link.
</shortdesc>
***/

 
/*** keywords and docurl
<keywords>Halo 2, rapid fire, quick reload, doubleshot</keywords>
 
<docurl>https://www.consoletuner.com/forum/viewtopic.php?f=23&t=6910</docurl>
 
***/

 
/** Interactive configuration
<cfgdesc>
[Halo 2]
shortdesc    = <<<MULTILINE
Halo 2 Classic Custom Script<br>
MULTILINE
 
[Save changes]
byteoffset    = 100
bitsize        = 1
control        = checkbox
default        = 0
item            = Save changes
shortdesc   = If enabled, the script will save changes made in-game to any of the options below.
 
 
[Fiveshot]
byteoffset    = 0
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Fiveshot/Combos
shortdesc   = In-game on/off: <b>DPAD-Up + RT</b>
 
[Fiveshot Type]
byteoffset    = 1
bitsize        = 8
control        = combobox
default        = 0
item            = Fiveshot
item            = RRXYY
item            = XSV 261
item            = XSV 271
shortdesc   = Initial Fiveshot/Combo Mode<br>In-game cycle: <b>DPAD-Left + RT</b>
 
[Left Rapid Fire]
byteoffset    = 2
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Left Rapid Fire
shortdesc   = In-game on/off: <b>DPAD-Up + LT</b>
 
[Right Rapid Fire]
byteoffset    = 3
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Right Rapid Fire
shortdesc   = In-game on/off: <b>DPAD-Up + Y</b>
 
[Melee Mode]
byteoffset    = 4
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Melee Mode
shortdesc   = In-game on/off: <b>DPAD-Up + RB</b>
 
[Doubleshot Melee]
byteoffset    = 5
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Doubleshot Melee combo. Usage: Button A
shortdesc   = In-game on/off: <b>DPAD-Up + A</b>
 
 
[Fast Reload]
byteoffset    = 6
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Fast Reload
shortdesc   = In-game on/off: <b>DPAD-Up + B</b>
 
</cfgdesc>
 
**/

 
#include <xb1.gph>
 
#define FIVESHOT                             1
#define RRXYY                                2
#define XSV_261                              3
#define XSV_271                              4
 
// Button Layout                            - Universal Bump & Jump
#define B_RFIRE                              XB1_RT
#define B_LFIRE                              XB1_LT
#define B_WEAPON                             XB1_Y
#define B_RELOAD                             XB1_B
#define B_MELEE                              XB1_RB
#define B_CROUCH                             XB1_LS
#define B_JUMP                               XB1_LB
#define B_FLASHLIGHT                         XB1_RIGHT
#define B_A                                                XB1_A
 
// MOD1 Button
//define B_MOD1                               = XB1_RB;
 
// Enable/Disable MODs
#define RIGHT_RAPIDFIRE                      FALSE
#define LEFT_RAPIDFIRE                       FALSE
#define MOD1_ENABLED                         FALSE // ?? swaps Down & RB
//#define MOD2_ENABLED                         TRUE
#define DOUBLESHOTMELEE                      FALSE
#define MELEE_ENABLED                        FALSE
#define QUICK_RELOAD                         FALSE
 
// Set inital fire mode (FIVESHOT or RRXYY or XSV_261 or XSV_271)
uint8 FIRE_MODE = FIVESHOT;
 
// -----------------------------------------------------------------------------
//  The actual script starts from here. The code below does not need be changed.
// -----------------------------------------------------------------------------
#define MOD_TOGGLE                           XB1_UP // Individual MODs toogle
#define FIVESHOT_MODE_TOGGLE                 XB1_LEFT // Individual MODs toogle
 
bool RapidfireRight_OnOff = RIGHT_RAPIDFIRE;
bool RapidfireLeft_OnOff  = LEFT_RAPIDFIRE;
bool FireMode_OnOff       = FALSE;
//bool FlagDouble_Toogle    = FALSE;
bool QuickReload_OnOff      = QUICK_RELOAD;
bool Melee_OnOff              = MELEE_ENABLED;
bool DblShotMelee_OnOff      = DOUBLESHOTMELEE;
 
bool SAVE_CHANGES = FALSE;
 
// helper variables
uint8 iRumble=0;    // Rumble 1,2,3 or 4 times
uint8 iwait=0;    // wait value for overriding unnecessary waits
bool ICUpdate = FALSE; // if the interactive configuration window should get an update
uint32 ICULast = system_time(); // time tracker for last UI update
bool PMSaveNow = FALSE; // if the pmem should be written to the memory
uint32 PMSLast = system_time(); // time tracker for last PMEM Save operation
 
 
init {
    pmem_load();
    FireMode_OnOff = pmem_read(0);
    FIRE_MODE = pmem_read(1);
    FIRE_MODE++;
    RapidfireLeft_OnOff = pmem_read(2);
    RapidfireRight_OnOff = pmem_read(3);
    Melee_OnOff = pmem_read(4);
    DblShotMelee_OnOff = pmem_read(5);
    QuickReload_OnOff = pmem_read(6);
 
    SAVE_CHANGES = pmem_read(100);
}
 
main {
    // MOD 1 BUTTON
    if(MOD1_ENABLED) {
       swap(XB1_DOWN, XB1_RB);
    }
 
    // Rapidfire Right toggle
    if(get_val(MOD_TOGGLE) && event_active(B_WEAPON)) {
        RapidfireRight_OnOff = !RapidfireRight_OnOff;
         if (RapidfireRight_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(3,RapidfireRight_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
    // If rapidfire right is enabled
    if(!FireMode_OnOff && RapidfireRight_OnOff && get_val(B_RFIRE)) {
        combo_run(RapidfireRight);
    } else combo_stop(RapidfireRight);
 
 
    // Rapidfire Left toggle
    if(get_val(MOD_TOGGLE) && event_active(B_LFIRE)) {
        RapidfireLeft_OnOff = !RapidfireLeft_OnOff;
         if (RapidfireLeft_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(2,RapidfireLeft_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
    // If rapidfire left is enabled
    if(RapidfireLeft_OnOff && get_val(B_LFIRE)) {
        combo_run(RapidfireLeft);
    }
 
    // Fiveshot Master toggle
    if(get_val(MOD_TOGGLE) && event_active(B_RFIRE)) {
        FireMode_OnOff = !FireMode_OnOff;
         if (FireMode_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(0,FireMode_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
     // Fiveshot type toggle
     if (get_val(FIVESHOT_MODE_TOGGLE) && event_active(B_RFIRE)) {
        if ( FIRE_MODE < 4 ) FIRE_MODE++;
        else FIRE_MODE = 1;
        iRumble = FIRE_MODE;
        combo_run(cmbRumble);
        pmem_write(1,(FIRE_MODE-1));
        PMSaveNow = TRUE; ICUpdate = TRUE;
     }
 
    // If fiveshot is enabled
    if(FireMode_OnOff && get_val(B_RFIRE)) {
        if(FIRE_MODE == FIVESHOT) {
            combo_run(_FIVESHOT);
        } else
        if(FIRE_MODE == RRXYY) {
            combo_run(_RRXYY);
        } else
        if(FIRE_MODE == XSV_261) {
            combo_run(_XSV_261);
        }else
        if(FIRE_MODE == XSV_271) {
            combo_run(_XSV_271);
        }
    }
 
    // MOD 1 /FLAGCARRY
    //if(MOD1_ENABLED) {
        // Flagcarry toggle
        //if(get_val(XB1_UP) && event_active(XB1_DOWN)) {
        //    FlagDouble_Toogle = !FlagDouble_Toogle;
        //}
    //}
 
    // Melee enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_MELEE)) {
        Melee_OnOff = !Melee_OnOff;
         if (Melee_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(4,Melee_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
 
    // Melee
     if(Melee_OnOff) {
         if(get_val(B_MELEE)) {
            combo_run(Crouch);
            combo_run(BXB);
        }
     }
 
 
 
    // Quick Reload enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_RELOAD)) {
        QuickReload_OnOff = !QuickReload_OnOff;
         if (QuickReload_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(6,QuickReload_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
    // QUICK RELOAD
    if(QuickReload_OnOff) {
        if(event_release(B_RELOAD) && time_active(B_RELOAD) < 200) {
            combo_run(FastReload);
        }
    }
 
 
     // Doubleshot & melee enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_A)) {
        DblShotMelee_OnOff = !DblShotMelee_OnOff;
         if (DblShotMelee_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(5,DblShotMelee_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
    // Doubleshot with melee
    if(DblShotMelee_OnOff) {
        if(get_val(B_A)) {
            combo_run(RRBx);
        }
    }
 
    // Make sure user inputs does not interfere with the running combo
    if((_FIVESHOT) || (_RRXYY)  || (_XSV_261) || (_XSV_271)) {
        set_val(B_RFIRE, 0);
        set_val(B_LFIRE, 0);
        set_val(B_WEAPON, 0);
        set_val(B_RELOAD, 0);
        set_val(B_MELEE, 0);
        set_val(B_CROUCH, 0);
    }
 
     // write the pmem changes down
    PMSave();
    // Refresh interactive configuration window
    ICRefresh();
}
 
void swap(uint8 ida, uint8 idb) {
    fix32 val_ida = get_val(ida);
    set_val(ida, get_val(idb));
    set_val(idb, val_ida);
    return;
}
 
// Update the interactive configuration window, but not faster than every 1 second
void ICRefresh() {
    if (ICUpdate && ICULast < system_time()) {
        //printf("ic update");
        printf("GCMD:InteractiveConfiguration.Refresh");
        ICUpdate = FALSE;
        ICULast = system_time() + 1000;
    }
}
 
// Update the persistent memory, but not faster than every 10 seconds
void PMSave() {
    if (PMSaveNow && PMSLast < system_time()) {
        //printf("gespeichert");
        PMSaveNow = FALSE;
        PMSLast = system_time() + 10000;
        if (! SAVE_CHANGES) return; // don't save if checkbox is not checked
        pmem_save();
    }
}
 
combo RapidfireRight {
    set_val(B_RFIRE, 100);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(10);
    set_val(B_RFIRE, 0);
}
 
combo RapidfireLeft {
    set_val(B_LFIRE, 100);
    wait(30);
    set_val(B_LFIRE, 0);
    wait(10);
    set_val(B_LFIRE, 0);
}
 
combo _FIVESHOT {
    set_val(B_RFIRE, 100);
    wait(20); wait(70);
    set_val(B_RFIRE, 100);
    wait(20);
    set_val(B_RELOAD, 100);
    wait(20);
    wait(130);
    call(YY);
    wait(210);
}
 
combo _RRXYY {
    set_val(B_RFIRE, 100);
    wait(100); wait(45);
    set_val(B_RFIRE, 100);
    wait(60);
    set_val(B_RELOAD, 100);
    wait(60); wait(140);
    call(YY);
    wait(210);
}
 
//XSV 261 Timing
combo _XSV_261 {
    set_val(B_MELEE, 100);
    wait(11);
    set_val(B_MELEE, 0);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(311);
     set_val(B_RFIRE, 100);
    wait(90);
    set_val(B_RFIRE, 0);
    wait(60);
    set_val(B_RFIRE, 100);
    wait(40);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(20);
    set_val(B_RFIRE, 0);
    wait(261);
}
 
//XSV 271 Timing
combo _XSV_271 {
    set_val(B_MELEE, 100);
    wait(11);
    set_val(B_MELEE, 0);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(311);
     set_val(B_RFIRE, 100);
    wait(90);
    set_val(B_RFIRE, 0);
    wait(60);
    set_val(B_RFIRE, 100);
    wait(40);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(20);
    set_val(B_RFIRE, 0);
    wait(271);
}
 
combo YY {
    set_val(B_WEAPON, 100);
    wait(20); wait(20);
    set_val(B_WEAPON, 100);
    wait(20);
}
 
combo Crouch {
    set_val(XB1_LX, 0);
    set_val(XB1_LY, 0);
    set_val(B_CROUCH, 100);
}
 
combo BXB {
    set_val(B_MELEE, 100);
    wait(200); wait(50);
    set_val(B_RELOAD, 100);
    wait(50); wait(400);
    set_val(B_MELEE, 100);
    wait(50);
    set_val(B_MELEE, 100);
    wait(400);
}
 
combo FastReload {
    set_val(B_RELOAD, 100);
    wait(400); wait(600);
    set_val(B_MELEE, 100);
    wait(11); wait(11);
    set_val(B_RELOAD, 100);
}
 
combo RRBx {
    set_val(B_RFIRE, 100);
    wait(95);wait(50);
    set_val(B_RFIRE, 100);
    wait(47);
    set_val(B_MELEE, 100);
    wait(47);wait(140);
    set_val(B_RELOAD, 100);
    wait(47); wait(140);
    call(YY);
    wait(300);
}
 
combo cmbRumble {
    iwait=0;
    if ( iRumble == 4 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 3 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 2 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 1 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
}
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby J2Kbr » Tue Oct 09, 2018 5:46 pm

I've being tweaking the combo timing without success, spend at least 5 hours on that. The max I can get is 5 shots, but never 6 as before.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby Squidward » Tue Oct 09, 2018 10:08 pm

J2Kbr wrote:I've being tweaking the combo timing without success, spend at least 5 hours on that. The max I can get is 5 shots, but never 6 as before.


Do you think that you could modify the below script to have the updated fiveshot that you got working? I'll be happy enough with a perfectly-working fiveshot over nothing working at all.

Also, do you think you could swap out my "Doubleshot Melee" combo to just be a regular "BXR" combo that's activated with the same button combo? Since doubleshot isn't working anymore, it would be good if I could just switch over to the BXR.

Code: Select all
#pragma METAINFO("Halo 2 Classic Script", 1, 00, "Scachi")
 
/* --------------------------------------------------------------------------
 *  Halo 2 Classic
 * -------------------------------------------------------------------------- */

 
/*** shortdesc
<shortdesc>
Halo 2 Classic Custom Script<br>
<br>
<br>
Please report bugs/problems via consoletuners forum - click the DOC link to get to this scripts topic.<br><br>
 
Features:
<ul>
<li>Interactive configuration</li>
<li>Fiveshot</li>
<li>Doubleshot with melee</li>
<li>Rapid Fire (left & right)</li>
<li>Melee</li>
<li>Quick Reload</li>
</ul>
 
Notes: You'll find more information in the Interactive Configuration or click the DOC link.
</shortdesc>
***/

 
/*** keywords and docurl
<keywords>Halo 2, rapid fire, quick reload, doubleshot</keywords>
 
<docurl>https://www.consoletuner.com/forum/viewtopic.php?f=23&t=6910</docurl>
 
***/

 
/** Interactive configuration
<cfgdesc>
[Halo 2]
shortdesc    = <<<MULTILINE
Halo 2 Classic Custom Script<br>
MULTILINE
 
[Save changes]
byteoffset    = 100
bitsize        = 1
control        = checkbox
default        = 0
item            = Save changes
shortdesc   = If enabled, the script will save changes made in-game to any of the options below.
 
 
[Fiveshot]
byteoffset    = 0
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Fiveshot/Combos
shortdesc   = In-game on/off: <b>DPAD-Up + RT</b>
 
[Fiveshot Type]
byteoffset    = 1
bitsize        = 8
control        = combobox
default        = 0
item            = Fiveshot
item            = RRXYY
item            = XSV 261
item            = XSV 271
shortdesc   = Initial Fiveshot/Combo Mode<br>In-game cycle: <b>DPAD-Left + RT</b>
 
[Left Rapid Fire]
byteoffset    = 2
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Left Rapid Fire
shortdesc   = In-game on/off: <b>DPAD-Up + LT</b>
 
[Right Rapid Fire]
byteoffset    = 3
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Right Rapid Fire
shortdesc   = In-game on/off: <b>DPAD-Up + Y</b>
 
[Melee Mode]
byteoffset    = 4
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Melee Mode
shortdesc   = In-game on/off: <b>DPAD-Up + RB</b>
 
[Doubleshot Melee]
byteoffset    = 5
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Doubleshot Melee combo. Usage: Button A
shortdesc   = In-game on/off: <b>DPAD-Up + A</b>
 
 
[Fast Reload]
byteoffset    = 6
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Fast Reload
shortdesc   = In-game on/off: <b>DPAD-Up + B</b>
 
</cfgdesc>
 
**/

 
#include <xb1.gph>
 
#define FIVESHOT                             1
#define RRXYY                                2
#define XSV_261                              3
#define XSV_271                              4
 
// Button Layout                            - Universal Bump & Jump
#define B_RFIRE                              XB1_RT
#define B_LFIRE                              XB1_LT
#define B_WEAPON                             XB1_Y
#define B_RELOAD                             XB1_B
#define B_MELEE                              XB1_RB
#define B_CROUCH                             XB1_LS
#define B_JUMP                               XB1_LB
#define B_FLASHLIGHT                         XB1_RIGHT
#define B_A                                                XB1_A
 
// MOD1 Button
//define B_MOD1                               = XB1_RB;
 
// Enable/Disable MODs
#define RIGHT_RAPIDFIRE                      FALSE
#define LEFT_RAPIDFIRE                       FALSE
#define MOD1_ENABLED                         FALSE // ?? swaps Down & RB
//#define MOD2_ENABLED                         TRUE
#define DOUBLESHOTMELEE                      FALSE
#define MELEE_ENABLED                        FALSE
#define QUICK_RELOAD                         FALSE
 
// Set inital fire mode (FIVESHOT or RRXYY or XSV_261 or XSV_271)
uint8 FIRE_MODE = FIVESHOT;
 
// -----------------------------------------------------------------------------
//  The actual script starts from here. The code below does not need be changed.
// -----------------------------------------------------------------------------
#define MOD_TOGGLE                           XB1_UP // Individual MODs toogle
#define FIVESHOT_MODE_TOGGLE                 XB1_LEFT // Individual MODs toogle
 
bool RapidfireRight_OnOff = RIGHT_RAPIDFIRE;
bool RapidfireLeft_OnOff  = LEFT_RAPIDFIRE;
bool FireMode_OnOff       = FALSE;
//bool FlagDouble_Toogle    = FALSE;
bool QuickReload_OnOff      = QUICK_RELOAD;
bool Melee_OnOff              = MELEE_ENABLED;
bool DblShotMelee_OnOff      = DOUBLESHOTMELEE;
 
bool SAVE_CHANGES = FALSE;
 
// helper variables
uint8 iRumble=0;    // Rumble 1,2,3 or 4 times
uint8 iwait=0;    // wait value for overriding unnecessary waits
bool ICUpdate = FALSE; // if the interactive configuration window should get an update
uint32 ICULast = system_time(); // time tracker for last UI update
bool PMSaveNow = FALSE; // if the pmem should be written to the memory
uint32 PMSLast = system_time(); // time tracker for last PMEM Save operation
 
 
init {
    pmem_load();
    FireMode_OnOff = pmem_read(0);
    FIRE_MODE = pmem_read(1);
    FIRE_MODE++;
    RapidfireLeft_OnOff = pmem_read(2);
    RapidfireRight_OnOff = pmem_read(3);
    Melee_OnOff = pmem_read(4);
    DblShotMelee_OnOff = pmem_read(5);
    QuickReload_OnOff = pmem_read(6);
 
    SAVE_CHANGES = pmem_read(100);
}
 
main {
    // MOD 1 BUTTON
    if(MOD1_ENABLED) {
       swap(XB1_DOWN, XB1_RB);
    }
 
    // Rapidfire Right toggle
    if(get_val(MOD_TOGGLE) && event_active(B_WEAPON)) {
        RapidfireRight_OnOff = !RapidfireRight_OnOff;
         if (RapidfireRight_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(3,RapidfireRight_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
    // If rapidfire right is enabled
    if(!FireMode_OnOff && RapidfireRight_OnOff && get_val(B_RFIRE)) {
        combo_run(RapidfireRight);
    } else combo_stop(RapidfireRight);
 
 
    // Rapidfire Left toggle
    if(get_val(MOD_TOGGLE) && event_active(B_LFIRE)) {
        RapidfireLeft_OnOff = !RapidfireLeft_OnOff;
         if (RapidfireLeft_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(2,RapidfireLeft_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
    // If rapidfire left is enabled
    if(RapidfireLeft_OnOff && get_val(B_LFIRE)) {
        combo_run(RapidfireLeft);
    }
 
    // Fiveshot Master toggle
    if(get_val(MOD_TOGGLE) && event_active(B_RFIRE)) {
        FireMode_OnOff = !FireMode_OnOff;
         if (FireMode_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(0,FireMode_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
     // Fiveshot type toggle
     if (get_val(FIVESHOT_MODE_TOGGLE) && event_active(B_RFIRE)) {
        if ( FIRE_MODE < 4 ) FIRE_MODE++;
        else FIRE_MODE = 1;
        iRumble = FIRE_MODE;
        combo_run(cmbRumble);
        pmem_write(1,(FIRE_MODE-1));
        PMSaveNow = TRUE; ICUpdate = TRUE;
     }
 
    // If fiveshot is enabled
    if(FireMode_OnOff && get_val(B_RFIRE)) {
        if(FIRE_MODE == FIVESHOT) {
            combo_run(_FIVESHOT);
        } else
        if(FIRE_MODE == RRXYY) {
            combo_run(_RRXYY);
        } else
        if(FIRE_MODE == XSV_261) {
            combo_run(_XSV_261);
        }else
        if(FIRE_MODE == XSV_271) {
            combo_run(_XSV_271);
        }
    }
 
    // MOD 1 /FLAGCARRY
    //if(MOD1_ENABLED) {
        // Flagcarry toggle
        //if(get_val(XB1_UP) && event_active(XB1_DOWN)) {
        //    FlagDouble_Toogle = !FlagDouble_Toogle;
        //}
    //}
 
    // Melee enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_MELEE)) {
        Melee_OnOff = !Melee_OnOff;
         if (Melee_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(4,Melee_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
 
    // Melee
     if(Melee_OnOff) {
         if(get_val(B_MELEE)) {
            combo_run(Crouch);
            combo_run(BXB);
        }
     }
 
 
 
    // Quick Reload enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_RELOAD)) {
        QuickReload_OnOff = !QuickReload_OnOff;
         if (QuickReload_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(6,QuickReload_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
    // QUICK RELOAD
    if(QuickReload_OnOff) {
        if(event_release(B_RELOAD) && time_active(B_RELOAD) < 200) {
            combo_run(FastReload);
        }
    }
 
 
     // Doubleshot & melee enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_A)) {
        DblShotMelee_OnOff = !DblShotMelee_OnOff;
         if (DblShotMelee_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(5,DblShotMelee_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
    // Doubleshot with melee
    if(DblShotMelee_OnOff) {
        if(get_val(B_A)) {
            combo_run(RRBx);
        }
    }
 
    // Make sure user inputs does not interfere with the running combo
    if((_FIVESHOT) || (_RRXYY)  || (_XSV_261) || (_XSV_271)) {
        set_val(B_RFIRE, 0);
        set_val(B_LFIRE, 0);
        set_val(B_WEAPON, 0);
        set_val(B_RELOAD, 0);
        set_val(B_MELEE, 0);
        set_val(B_CROUCH, 0);
    }
 
     // write the pmem changes down
    PMSave();
    // Refresh interactive configuration window
    ICRefresh();
}
 
void swap(uint8 ida, uint8 idb) {
    fix32 val_ida = get_val(ida);
    set_val(ida, get_val(idb));
    set_val(idb, val_ida);
    return;
}
 
// Update the interactive configuration window, but not faster than every 1 second
void ICRefresh() {
    if (ICUpdate && ICULast < system_time()) {
        //printf("ic update");
        printf("GCMD:InteractiveConfiguration.Refresh");
        ICUpdate = FALSE;
        ICULast = system_time() + 1000;
    }
}
 
// Update the persistent memory, but not faster than every 10 seconds
void PMSave() {
    if (PMSaveNow && PMSLast < system_time()) {
        //printf("gespeichert");
        PMSaveNow = FALSE;
        PMSLast = system_time() + 10000;
        if (! SAVE_CHANGES) return; // don't save if checkbox is not checked
        pmem_save();
    }
}
 
combo RapidfireRight {
    set_val(B_RFIRE, 100);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(10);
    set_val(B_RFIRE, 0);
}
 
combo RapidfireLeft {
    set_val(B_LFIRE, 100);
    wait(30);
    set_val(B_LFIRE, 0);
    wait(10);
    set_val(B_LFIRE, 0);
}
 
combo _FIVESHOT {
    set_val(B_RFIRE, 100);
    wait(20); wait(70);
    set_val(B_RFIRE, 100);
    wait(20);
    set_val(B_RELOAD, 100);
    wait(20);
    wait(130);
    call(YY);
    wait(210);
}
 
combo _RRXYY {
    set_val(B_RFIRE, 100);
    wait(100); wait(45);
    set_val(B_RFIRE, 100);
    wait(60);
    set_val(B_RELOAD, 100);
    wait(60); wait(140);
    call(YY);
    wait(210);
}
 
//XSV 261 Timing
combo _XSV_261 {
    set_val(B_MELEE, 100);
    wait(11);
    set_val(B_MELEE, 0);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(311);
     set_val(B_RFIRE, 100);
    wait(90);
    set_val(B_RFIRE, 0);
    wait(60);
    set_val(B_RFIRE, 100);
    wait(40);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(20);
    set_val(B_RFIRE, 0);
    wait(261);
}
 
//XSV 271 Timing
combo _XSV_271 {
    set_val(B_MELEE, 100);
    wait(11);
    set_val(B_MELEE, 0);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(311);
     set_val(B_RFIRE, 100);
    wait(90);
    set_val(B_RFIRE, 0);
    wait(60);
    set_val(B_RFIRE, 100);
    wait(40);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(20);
    set_val(B_RFIRE, 0);
    wait(271);
}
 
combo YY {
    set_val(B_WEAPON, 100);
    wait(20); wait(20);
    set_val(B_WEAPON, 100);
    wait(20);
}
 
combo Crouch {
    set_val(XB1_LX, 0);
    set_val(XB1_LY, 0);
    set_val(B_CROUCH, 100);
}
 
combo BXB {
    set_val(B_MELEE, 100);
    wait(200); wait(50);
    set_val(B_RELOAD, 100);
    wait(50); wait(400);
    set_val(B_MELEE, 100);
    wait(50);
    set_val(B_MELEE, 100);
    wait(400);
}
 
combo FastReload {
    set_val(B_RELOAD, 100);
    wait(400); wait(600);
    set_val(B_MELEE, 100);
    wait(11); wait(11);
    set_val(B_RELOAD, 100);
}
 
combo RRBx {
    set_val(B_RFIRE, 100);
    wait(95);wait(50);
    set_val(B_RFIRE, 100);
    wait(47);
    set_val(B_MELEE, 100);
    wait(47);wait(140);
    set_val(B_RELOAD, 100);
    wait(47); wait(140);
    call(YY);
    wait(300);
}
 
combo cmbRumble {
    iwait=0;
    if ( iRumble == 4 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 3 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 2 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 1 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
}


I do have another question with regards to trying to get the Doubleshot (6 bullets) to work:

Would it be possible to get the right timing pulled off if we used the T2 and Gtuner IV to do input recording of a successful, in-game, manual doubleshot?

Because I can do a manual doubleshot once out of every 20 or so attempts. My idea was that if we can't figure out the right timing by trial and error, what if I recorded my controller input when doing a successful doubleshot and we just used that timing? Keep in mind that I haven't attempted a manual doubleshot in over a year and certainly not since they updated MCC. It would seem that the update to MCC is what broke these timings. I'm wondering if doubleshots have been broken across the board. I also wonder if it has to do with all matches have now been moved to dedicated servers rather than being host-based.

Please let me know if you're able to change my above script for me how I requested and what you think of my doubleshot timing idea.
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby J2Kbr » Wed Oct 10, 2018 7:50 am

Beak wrote:Would it be possible to get the right timing pulled off if we used the T2 and Gtuner IV to do input recording of a successful, in-game, manual doubleshot?

You can use the Macro Recorder for this purpose. With the Titan Two connected to the console and computer at the same time, open Gtuner IV and go to Device Monitor. There you will find a button labeled REC. Press it and perform the actions using the controller one time. Then save the macro file and open it in the macro editor. You can also attach here so we can check the timings. :smile0517:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby Squidward » Wed Oct 10, 2018 7:53 am

J2Kbr wrote:
Beak wrote:Would it be possible to get the right timing pulled off if we used the T2 and Gtuner IV to do input recording of a successful, in-game, manual doubleshot?

You can use the Macro Recorder for this purpose. With the Titan Two connected to the console and computer at the same time, open Gtuner IV and go to Device Monitor. There you will find a button labeled REC. Press it and perform the actions using the controller one time. Then save the macro file and open it in the macro editor. You can also attach here so we can check the timings. :smile0517:


Alright, I'll give this weekend at the latest. Thanks! :smile0517:
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby Squidward » Sat Oct 13, 2018 8:52 pm

J2Kbr wrote:
Beak wrote:Would it be possible to get the right timing pulled off if we used the T2 and Gtuner IV to do input recording of a successful, in-game, manual doubleshot?

You can use the Macro Recorder for this purpose. With the Titan Two connected to the console and computer at the same time, open Gtuner IV and go to Device Monitor. There you will find a button labeled REC. Press it and perform the actions using the controller one time. Then save the macro file and open it in the macro editor. You can also attach here so we can check the timings. :smile0517:


J2Kbr, I recorded myself doing a quadshot three different times. Each one is faster than the next. Some of the doubleshots are slow and the slower ones have a longer delay between the first three round burst and the second three round burst. Also there may be a longer delay between the first doubleshot and the YY and the second doubleshot. The one labeled as "faster" I think is the best one. I know that it should be easy for you, though, to shorten the delay between each burst in each doubleshot, as well as the end of the first doubleshot, the YY, and the beginning of the second doubleshot. Maybe even just use an existing YY loop that you already have. My YY was done manually and definitely needs to be shortened. Can you take my below script and replace the Doubleshot in there with the tweaked version of my input recording of my recorded doubleshots after you've made your final timing tweaks to it?

I have another favor to ask of you too. You said that you had gotten the fiveshot working. Does it work consistently? If so, can you also replace the fiveshot combo in my below script with your working fiveshot combo? I like to have the option to either use the fiveshot or quadshot.

Code: Select all
#pragma METAINFO("Halo 2 Classic Script", 1, 00, "Scachi")
 
/* --------------------------------------------------------------------------
 *  Halo 2 Classic
 * -------------------------------------------------------------------------- */

 
/*** shortdesc
<shortdesc>
Halo 2 Classic Custom Script<br>
<br>
<br>
Please report bugs/problems via consoletuners forum - click the DOC link to get to this scripts topic.<br><br>
 
Features:
<ul>
<li>Interactive configuration</li>
<li>Fiveshot</li>
<li>Doubleshot with melee</li>
<li>Rapid Fire (left & right)</li>
<li>Melee</li>
<li>Quick Reload</li>
</ul>
 
Notes: You'll find more information in the Interactive Configuration or click the DOC link.
</shortdesc>
***/

 
/*** keywords and docurl
<keywords>Halo 2, rapid fire, quick reload, doubleshot</keywords>
 
<docurl>https://www.consoletuner.com/forum/viewtopic.php?f=23&t=6910</docurl>
 
***/

 
/** Interactive configuration
<cfgdesc>
[Halo 2]
shortdesc    = <<<MULTILINE
Halo 2 Classic Custom Script<br>
MULTILINE
 
[Save changes]
byteoffset    = 100
bitsize        = 1
control        = checkbox
default        = 0
item            = Save changes
shortdesc   = If enabled, the script will save changes made in-game to any of the options below.
 
 
[Fiveshot]
byteoffset    = 0
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Fiveshot/Combos
shortdesc   = In-game on/off: <b>DPAD-Up + RT</b>
 
[Fiveshot Type]
byteoffset    = 1
bitsize        = 8
control        = combobox
default        = 0
item            = Fiveshot
item            = RRXYY
item            = XSV 261
item            = XSV 271
shortdesc   = Initial Fiveshot/Combo Mode<br>In-game cycle: <b>DPAD-Left + RT</b>
 
[Left Rapid Fire]
byteoffset    = 2
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Left Rapid Fire
shortdesc   = In-game on/off: <b>DPAD-Up + LT</b>
 
[Right Rapid Fire]
byteoffset    = 3
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Right Rapid Fire
shortdesc   = In-game on/off: <b>DPAD-Up + Y</b>
 
[Melee Mode]
byteoffset    = 4
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Melee Mode
shortdesc   = In-game on/off: <b>DPAD-Up + RB</b>
 
[Doubleshot Melee]
byteoffset    = 5
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Doubleshot Melee combo. Usage: Button A
shortdesc   = In-game on/off: <b>DPAD-Up + A</b>
 
 
[Fast Reload]
byteoffset    = 6
bitsize        = 1
control        = checkbox
default        = 0
item            = Enable Fast Reload
shortdesc   = In-game on/off: <b>DPAD-Up + B</b>
 
</cfgdesc>
 
**/

 
#include <xb1.gph>
 
#define FIVESHOT                             1
#define RRXYY                                2
#define XSV_261                              3
#define XSV_271                              4
 
// Button Layout                            - Universal Bump & Jump
#define B_RFIRE                              XB1_RT
#define B_LFIRE                              XB1_LT
#define B_WEAPON                             XB1_Y
#define B_RELOAD                             XB1_B
#define B_MELEE                              XB1_RB
#define B_CROUCH                             XB1_LS
#define B_JUMP                               XB1_LB
#define B_FLASHLIGHT                         XB1_RIGHT
#define B_A                                                XB1_A
 
// MOD1 Button
//define B_MOD1                               = XB1_RB;
 
// Enable/Disable MODs
#define RIGHT_RAPIDFIRE                      FALSE
#define LEFT_RAPIDFIRE                       FALSE
#define MOD1_ENABLED                         FALSE // ?? swaps Down & RB
//#define MOD2_ENABLED                         TRUE
#define DOUBLESHOTMELEE                      FALSE
#define MELEE_ENABLED                        FALSE
#define QUICK_RELOAD                         FALSE
 
// Set inital fire mode (FIVESHOT or RRXYY or XSV_261 or XSV_271)
uint8 FIRE_MODE = FIVESHOT;
 
// -----------------------------------------------------------------------------
//  The actual script starts from here. The code below does not need be changed.
// -----------------------------------------------------------------------------
#define MOD_TOGGLE                           XB1_UP // Individual MODs toogle
#define FIVESHOT_MODE_TOGGLE                 XB1_LEFT // Individual MODs toogle
 
bool RapidfireRight_OnOff = RIGHT_RAPIDFIRE;
bool RapidfireLeft_OnOff  = LEFT_RAPIDFIRE;
bool FireMode_OnOff       = FALSE;
//bool FlagDouble_Toogle    = FALSE;
bool QuickReload_OnOff      = QUICK_RELOAD;
bool Melee_OnOff              = MELEE_ENABLED;
bool DblShotMelee_OnOff      = DOUBLESHOTMELEE;
 
bool SAVE_CHANGES = FALSE;
 
// helper variables
uint8 iRumble=0;    // Rumble 1,2,3 or 4 times
uint8 iwait=0;    // wait value for overriding unnecessary waits
bool ICUpdate = FALSE; // if the interactive configuration window should get an update
uint32 ICULast = system_time(); // time tracker for last UI update
bool PMSaveNow = FALSE; // if the pmem should be written to the memory
uint32 PMSLast = system_time(); // time tracker for last PMEM Save operation
 
 
init {
    pmem_load();
    FireMode_OnOff = pmem_read(0);
    FIRE_MODE = pmem_read(1);
    FIRE_MODE++;
    RapidfireLeft_OnOff = pmem_read(2);
    RapidfireRight_OnOff = pmem_read(3);
    Melee_OnOff = pmem_read(4);
    DblShotMelee_OnOff = pmem_read(5);
    QuickReload_OnOff = pmem_read(6);
 
    SAVE_CHANGES = pmem_read(100);
}
 
main {
    // MOD 1 BUTTON
    if(MOD1_ENABLED) {
       swap(XB1_DOWN, XB1_RB);
    }
 
    // Rapidfire Right toggle
    if(get_val(MOD_TOGGLE) && event_active(B_WEAPON)) {
        RapidfireRight_OnOff = !RapidfireRight_OnOff;
         if (RapidfireRight_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(3,RapidfireRight_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
    // If rapidfire right is enabled
    if(!FireMode_OnOff && RapidfireRight_OnOff && get_val(B_RFIRE)) {
        combo_run(RapidfireRight);
    } else combo_stop(RapidfireRight);
 
 
    // Rapidfire Left toggle
    if(get_val(MOD_TOGGLE) && event_active(B_LFIRE)) {
        RapidfireLeft_OnOff = !RapidfireLeft_OnOff;
         if (RapidfireLeft_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(2,RapidfireLeft_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
    // If rapidfire left is enabled
    if(RapidfireLeft_OnOff && get_val(B_LFIRE)) {
        combo_run(RapidfireLeft);
    }
 
    // Fiveshot Master toggle
    if(get_val(MOD_TOGGLE) && event_active(B_RFIRE)) {
        FireMode_OnOff = !FireMode_OnOff;
         if (FireMode_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(0,FireMode_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
     // Fiveshot type toggle
     if (get_val(FIVESHOT_MODE_TOGGLE) && event_active(B_RFIRE)) {
        if ( FIRE_MODE < 4 ) FIRE_MODE++;
        else FIRE_MODE = 1;
        iRumble = FIRE_MODE;
        combo_run(cmbRumble);
        pmem_write(1,(FIRE_MODE-1));
        PMSaveNow = TRUE; ICUpdate = TRUE;
     }
 
    // If fiveshot is enabled
    if(FireMode_OnOff && get_val(B_RFIRE)) {
        if(FIRE_MODE == FIVESHOT) {
            combo_run(_FIVESHOT);
        } else
        if(FIRE_MODE == RRXYY) {
            combo_run(_RRXYY);
        } else
        if(FIRE_MODE == XSV_261) {
            combo_run(_XSV_261);
        }else
        if(FIRE_MODE == XSV_271) {
            combo_run(_XSV_271);
        }
    }
 
    // MOD 1 /FLAGCARRY
    //if(MOD1_ENABLED) {
        // Flagcarry toggle
        //if(get_val(XB1_UP) && event_active(XB1_DOWN)) {
        //    FlagDouble_Toogle = !FlagDouble_Toogle;
        //}
    //}
 
    // Melee enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_MELEE)) {
        Melee_OnOff = !Melee_OnOff;
         if (Melee_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(4,Melee_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
 
    // Melee
     if(Melee_OnOff) {
         if(get_val(B_MELEE)) {
            combo_run(Crouch);
            combo_run(BXB);
        }
     }
 
 
 
    // Quick Reload enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_RELOAD)) {
        QuickReload_OnOff = !QuickReload_OnOff;
         if (QuickReload_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(6,QuickReload_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
    // QUICK RELOAD
    if(QuickReload_OnOff) {
        if(event_release(B_RELOAD) && time_active(B_RELOAD) < 200) {
            combo_run(FastReload);
        }
    }
 
 
     // Doubleshot & melee enable/disable
    if(get_val(MOD_TOGGLE) && event_active(B_A)) {
        DblShotMelee_OnOff = !DblShotMelee_OnOff;
         if (DblShotMelee_OnOff) { iRumble = 2; combo_run(cmbRumble); }
         else { iRumble = 1; combo_run(cmbRumble); }
         pmem_write(5,DblShotMelee_OnOff);
         PMSaveNow = TRUE; ICUpdate = TRUE;
    }
 
    // Doubleshot with melee
    if(DblShotMelee_OnOff) {
        if(get_val(B_A)) {
            combo_run(RRBx);
        }
    }
 
    // Make sure user inputs does not interfere with the running combo
    if((_FIVESHOT) || (_RRXYY)  || (_XSV_261) || (_XSV_271)) {
        set_val(B_RFIRE, 0);
        set_val(B_LFIRE, 0);
        set_val(B_WEAPON, 0);
        set_val(B_RELOAD, 0);
        set_val(B_MELEE, 0);
        set_val(B_CROUCH, 0);
    }
 
     // write the pmem changes down
    PMSave();
    // Refresh interactive configuration window
    ICRefresh();
}
 
void swap(uint8 ida, uint8 idb) {
    fix32 val_ida = get_val(ida);
    set_val(ida, get_val(idb));
    set_val(idb, val_ida);
    return;
}
 
// Update the interactive configuration window, but not faster than every 1 second
void ICRefresh() {
    if (ICUpdate && ICULast < system_time()) {
        //printf("ic update");
        printf("GCMD:InteractiveConfiguration.Refresh");
        ICUpdate = FALSE;
        ICULast = system_time() + 1000;
    }
}
 
// Update the persistent memory, but not faster than every 10 seconds
void PMSave() {
    if (PMSaveNow && PMSLast < system_time()) {
        //printf("gespeichert");
        PMSaveNow = FALSE;
        PMSLast = system_time() + 10000;
        if (! SAVE_CHANGES) return; // don't save if checkbox is not checked
        pmem_save();
    }
}
 
combo RapidfireRight {
    set_val(B_RFIRE, 100);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(10);
    set_val(B_RFIRE, 0);
}
 
combo RapidfireLeft {
    set_val(B_LFIRE, 100);
    wait(30);
    set_val(B_LFIRE, 0);
    wait(10);
    set_val(B_LFIRE, 0);
}
 
combo _FIVESHOT {
    set_val(B_RFIRE, 100);
    wait(20); wait(70);
    set_val(B_RFIRE, 100);
    wait(20);
    set_val(B_RELOAD, 100);
    wait(20);
    wait(130);
    call(YY);
    wait(210);
}
 
combo _RRXYY {
    set_val(B_RFIRE, 100);
    wait(100); wait(45);
    set_val(B_RFIRE, 100);
    wait(60);
    set_val(B_RELOAD, 100);
    wait(60); wait(140);
    call(YY);
    wait(210);
}
 
//XSV 261 Timing
combo _XSV_261 {
    set_val(B_MELEE, 100);
    wait(11);
    set_val(B_MELEE, 0);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(311);
     set_val(B_RFIRE, 100);
    wait(90);
    set_val(B_RFIRE, 0);
    wait(60);
    set_val(B_RFIRE, 100);
    wait(40);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(20);
    set_val(B_RFIRE, 0);
    wait(261);
}
 
//XSV 271 Timing
combo _XSV_271 {
    set_val(B_MELEE, 100);
    wait(11);
    set_val(B_MELEE, 0);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(30);
    set_val(B_RFIRE, 0);
    wait(311);
     set_val(B_RFIRE, 100);
    wait(90);
    set_val(B_RFIRE, 0);
    wait(60);
    set_val(B_RFIRE, 100);
    wait(40);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 100);
    wait(90);
    set_val(B_RFIRE, 100);
    set_val(B_RELOAD, 0);
    wait(20);
    set_val(B_RFIRE, 0);
    wait(271);
}
 
combo YY {
    set_val(B_WEAPON, 100);
    wait(20); wait(20);
    set_val(B_WEAPON, 100);
    wait(20);
}
 
combo Crouch {
    set_val(XB1_LX, 0);
    set_val(XB1_LY, 0);
    set_val(B_CROUCH, 100);
}
 
combo BXB {
    set_val(B_MELEE, 100);
    wait(200); wait(50);
    set_val(B_RELOAD, 100);
    wait(50); wait(400);
    set_val(B_MELEE, 100);
    wait(50);
    set_val(B_MELEE, 100);
    wait(400);
}
 
combo FastReload {
    set_val(B_RELOAD, 100);
    wait(400); wait(600);
    set_val(B_MELEE, 100);
    wait(11); wait(11);
    set_val(B_RELOAD, 100);
}
 
combo RRBx {
    set_val(B_RFIRE, 100);
    wait(95);wait(50);
    set_val(B_RFIRE, 100);
    wait(47);
    set_val(B_MELEE, 100);
    wait(47);wait(140);
    set_val(B_RELOAD, 100);
    wait(47); wait(140);
    call(YY);
    wait(300);
}
 
combo cmbRumble {
    iwait=0;
    if ( iRumble == 4 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 3 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 2 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
 
    iwait=0;
    if ( iRumble == 1 ) {
        ffb_set(FFB_1, 100.0, 140);
        iwait=200;
        iRumble--;
    }
    wait(iwait);wait(0);
}


Here are my input recordings. I was able to still quadshot in matchmaking like I did in a custom game. For all three of these, I recorded them in a custom game.

Also of note, I use Universal Bump & Jump for my button layout.

Slower timing:
RRXYY-Doubleshot_slower-timing.gmk
(411 Bytes) Downloaded 208 times


Medium timing:
RRXYY-Doubleshot_medium-timing.gmk
(271 Bytes) Downloaded 239 times


Faster timing:
RRXYY-Doubleshot_faster-timing.gmk
(306 Bytes) Downloaded 273 times
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby Scachi » Mon Oct 15, 2018 10:01 am

I have uploaded version 1.01 of the "Halo 2 Classic Custom Script" to the Online Resource.

The RRXYY combo has some preset buttons now in the Interactive Configuration
Click on one of the buttons to set the timings to the one of your recordings and hit "Save and Run" after that to reload the script with the selected timings active:
halo2classicv101.jpg
halo2classicv101.jpg (61.16 KiB) Viewed 2549 times

You can adjust the different timings for all of the press and release times of the RRXYY combo manually too to test some different timings.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby Squidward » Mon Oct 15, 2018 6:03 pm

Scachi wrote:I have uploaded version 1.01 of the "Halo 2 Classic Custom Script" to the Online Resource.

The RRXYY combo has some preset buttons now in the Interactive Configuration
Click on one of the buttons to set the timings to the one of your recordings and hit "Save and Run" after that to reload the script with the selected timings active:
halo2classicv101.jpg

You can adjust the different timings for all of the press and release times of the RRXYY combo manually too to test some different timings.


Ok thank you! I'll give this a try!

Just to let you know, the mode isn't called fiveshot mode. It's called the firemode. Fiveshot is one of the firemodes. RRXYY (a.k.a. quadshot) is another firemode.
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby Squidward » Mon Oct 15, 2018 6:44 pm

Scachi wrote:I have uploaded version 1.01 of the "Halo 2 Classic Custom Script" to the Online Resource.

The RRXYY combo has some preset buttons now in the Interactive Configuration
Click on one of the buttons to set the timings to the one of your recordings and hit "Save and Run" after that to reload the script with the selected timings active:
halo2classicv101.jpg

You can adjust the different timings for all of the press and release times of the RRXYY combo manually too to test some different timings.


Ok, so I just played around with this for about 20 minutes. I don't really know which values are best to try to adjust so I was just changing the timings almost randomly and testing them, kind of as a trial and error. I saw some that did better than others but nothing I did worked consistently.

I even just tried each of my timings unmodified and even that wasn't perfect. For example, I set it to the faster timing, which is definitely better because it isn't as delayed. But even on that one, almost every magazine, anywhere between the third and sixth doubleshot will fail to fire and reload instead. This is enough to get me killed. Obviously, I only tested this in a custom game. I don't understand how I was able to record the quadshot without it stopping to reload mid-combo, but then when the timing gets implemented in the script, it's kind of buggy and sometimes stops to reload mid-combo.

I'm not really sure what to do at this point. I would say I definitely need J2Kbr's help on this.
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: [Fix Request] Halo MCC - Halo 2 Classic custom script

Postby Scachi » Mon Oct 15, 2018 7:34 pm

I have added a recording feature to the script version 1.02 maybe this will allow to set the timings to work correctly.

Select the rrxyy fire mode in the interactive configuration.

When you now hold down LS AND RS for 3 seconds the led will blink yellow.

Now do your RRXYY manually.
It will save the timing of each button press/release back to the Interactive Configuration.
You have to do the complete combo manually AND end the recording (after releasing the Y a second time) with R again.
The T2 LED will show the number of the step it is currently at:
1 : wait for fire press
2 : wait for fire release
3 : wait for fire press
4 : wait for fire release
5 : wait for reload press
6 : wait for reload release
7 : wait for weapon press
8 : wait for weapon release
9 : wait for weapon press
0. : wait for weapon release
1. : wait for fire press (this will save the time of the second weapon release timing ( 0. )

after 11 ( 1. ) it will write the times back to the Interactive Configuration and end the recording and set the T2 LED back and stops blinking yellow.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 102 guests