Halo 2 Classic

Documentation, usage tips and configuration guides for Titan Two scripts and bytecodes published by the community users.

Halo 2 Classic

Postby Scachi » Sat Sep 09, 2017 2:14 pm

This is the "Halo 2 Classic Custom Script - misterpyrrhuloxia request" converted to Titan Two with modifications requested by Beak:

Features:
Interactive configuration
Fiveshot
Doubleshot with melee
Rapid Fire (left & right)
Melee
Quick Reload

Notes:
Everything is disabled by default.
Enable them with the in-game button combo or via the Interactive Configuration

Options:
Fiveshot: Enable/Disable with DPAD-Up + RT
Modes: Fiveshot / RRXYY / XSV_261 / XSV_271 <= Cycle through modes with DPAD-Left + RT

Rapid Fire Left: Enable/Disable with DPAD-Up + LT

Rapid Fire Right: Enable/Disable with DPAD-Up + Y

Melee Mode: Enable/Disable with DPAD-Up + RB

Doubleshot Melee: Enable/Disable with DPAD-Up + A

Fast Reload: Enable/Disable with DPAD-Up + B
Last edited by Scachi on Thu Jun 07, 2018 5:24 am, edited 1 time in total.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Halo 2 Classic

Postby Squidward » Fri Oct 06, 2017 5:10 pm

This works perfectly! Thank you so much!
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: Halo 2 Classic

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

Scachi wrote:This is the "Halo 2 Classic Custom Script - misterpyrrhuloxia request" converted to Titan Two with modifications requested by Beak:

Features:
Interactive configuration
Fiveshot
Doubleshot with melee
Rapid Fire (left & right)
Melee
Quick Reload

Notes:
Everything is disabled by default.
Enable them with the in-game button combo or via the Interactive Configuration

Options:
Fiveshot: Enable/Disable with DPAD-Up + RT
Modes: Fiveshot / RRXYY / XSV_261 / XSV_271 <= Cycle through modes with DPAD-Left + RT

Rapid Fire Left: Enable/Disable with DPAD-Up + LT

Rapid Fire Right: Enable/Disable with DPAD-Up + Y

Melee Mode: Enable/Disable with DPAD-Up + RB

Doubleshot Melee: Enable/Disable with DPAD-Up + A

Fast Reload: Enable/Disable with DPAD-Up + B


Hello! This script used to work great last year. Then I went a year without playing Halo MCC.

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.

What's currently happening is every single of my 4 fire modes 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 you be so kind as to 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 again:

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: Halo 2 Classic

Postby Scachi » Fri Oct 05, 2018 10:17 pm

I can't help you with that as I don't own a xbox / halo.

There are some posts about the fiveshot and that they can't get at working as good as it was before:
viewtopic.php?p=70574#p70574

The script with Interactive Configuration adjustment for the Fiveshot:Fiveshot timing and presets from j2kbr post and the old values in section "Fiveshot Timings" (below "Fiveshot Type").

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

 
/*** shortdesc
<shortdesc>
Halo 2 Classic Custom Script - based on T1 script made by misterpyrrhuloxia<br>
Titan Two conversion<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]
control   = info
shortdesc    = <<<MULTILINE
Halo 2 Classic Custom Script - based on T1 script made by misterpyrrhuloxia<br>
Titan Two Conversion
MULTILINE
 
[Save changes]
byteoffset    = 100
bitsize        = 1
bitoffset = 0
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
bitoffset = 0
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>
 
 
[Fiveshot Timings]
collapsible = 2
control     = info
shortdesc   = <<<MULTILINE
Time Adjustments for Fiveshot Combos
Presets:
MULTILINE
 
 
[Fiveshot Pre]
group     = true
color            = #008000
control   = config
item      = J2kbr Fiveshot . Fiveshot Timing : #01:00#0A:145A148200F01414
item      = Old Fiveshot . Fiveshot Timing : #01:00#0A:1446148200D21414
 
 
[Fiveshot Fiveshot Right Fire PRESS]
group       = true
byteoffset  = 10
bitsize     = 8                   
control     = spinbox
default     = 20
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <<<MULTILINE
 
<b>Fiveshot . Fiveshot</b> Fire Button Press Time
MULTILINE
 
[Fiveshot Fiveshot Right Fire RELEASE]
group       = true
byteoffset  = 11
bitsize     = 8                   
control     = spinbox
default     = 90
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot</b> Fire Button Release Time
 
[Fiveshot Fiveshot Reload PRESS]   
group       = true
byteoffset  = 12
bitsize     = 8       
control     = spinbox
default     = 20
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot</b> Reload Button Press Time
 
[Fiveshot Fiveshot Reload RELEASE]   
group       = true
byteoffset  = 13
bitsize     = 8       
control     = spinbox
default     = 130
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot</b> Reload Button Release Time
 
[Fiveshot Fiveshot Wait After YY]
group       = true
byteoffset  = 14
bitsize     = 16       
control     = spinbox
default     = 240
minimum     = 10
maximum     = 500
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot</b> Wait Time after YY call
 
[Fiveshot YY B_Weapon PRESS]
group       = true
byteoffset  = 16
bitsize     = 8       
control     = spinbox
default     = 20
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot/RRXYY : YY</b> B_Weapon Button Press Time
 
[Fiveshot YY B_Weapon RELEASE]       
group       = true
byteoffset  = 17
bitsize     = 8       
control     = spinbox
default     = 20
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot/RRXYY : YY</b> B_Weapon Button Release Time
 
 
[Left Rapid Fire]
byteoffset    = 2                   
bitsize        = 1                     
bitoffset = 0                     
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
bitoffset = 0
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
bitoffset = 0
control        = checkbox
default        = 0
item            = Enable Melee Mode
shortdesc   = In-game on/off: <b>DPAD-Up + RB</b>
 
[Doubleshot Melee]
byteoffset    = 5
bitsize        = 1
bitoffset = 0
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
bitoffset = 0
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;
 
// five shot timings                                 // j2kbr timings // v1.00 timings
uint8   FSHOT_RiFiPWait;    // right fire press wait  : wait(20);       wait(20);
uint8   FSHOT_RiFiRWait;    // right fire release wait: wait(90);       wait(70);
uint8   FSHOT_ReloadPWait;  // reload press wait      : wait(20);       wait(20);
uint8   FSHOT_ReloadRWait;  // reload release wait    : wait(130);      wait(130);
uint16  YYAwait;            // YY-Combo Wait after    : wait(240);      wait(210); // fiveshot & _RRXYY
 
// YY timings                     // same as old timings, no changes
uint8 YY_BWPWait;       //  B_Weapon press wait  : wait(20);           
uint8 YY_RWPWait;       //  B_Weapon release wait: wait(20);           
 
// 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);
 
  pmem_read(10,&FSHOT_RiFiPWait);
  pmem_read(11,&FSHOT_RiFiRWait)
  pmem_read(12,&FSHOT_ReloadPWait);
  pmem_read(13,&FSHOT_ReloadRWait);
  pmem_read(14,&YYAwait);    //uint16
 
  pmem_read(16,&YY_BWPWait);
  pmem_read(17,&YY_RWPWait);
 
 
 
 
 
    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(FSHOT_RiFiPWait);    // right fire press wait 
    wait(FSHOT_RiFiRWait);    // right fire release wait
    set_val(B_RFIRE, 100)
    wait(FSHOT_RiFiPWait);    // right fire press wait 
    set_val(B_RELOAD, 100);
    wait(FSHOT_ReloadPWait)// reload press wait     
    wait(FSHOT_ReloadRWait)// reload release wait   
    call(YY);                 // YY-Combo
    wait(YYAwait);            // YY-Combo Wait after   
}
 
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(YYAwait);            // YY-Combo Wait after   
}
 
//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(YY_BWPWait);       //  B_Weapon press wait 
    wait(YY_RWPWait);       //  B_Weapon release wait
    set_val(B_WEAPON, 100);
    wait(YY_BWPWait);       //  B_Weapon press wait 
}
 
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
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Halo 2 Classic

Postby Squidward » Fri Oct 05, 2018 11:20 pm

Scachi wrote:I can't help you with that as I don't own a xbox / halo.

There are some posts about the fiveshot and that they can't get at working as good as it was before:
viewtopic.php?p=70574#p70574

The script with Interactive Configuration adjustment for the Fiveshot:Fiveshot timing and presets from j2kbr post and the old values in section "Fiveshot Timings" (below "Fiveshot Type").

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

 
/*** shortdesc
<shortdesc>
Halo 2 Classic Custom Script - based on T1 script made by misterpyrrhuloxia<br>
Titan Two conversion<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]
control   = info
shortdesc    = <<<MULTILINE
Halo 2 Classic Custom Script - based on T1 script made by misterpyrrhuloxia<br>
Titan Two Conversion
MULTILINE
 
[Save changes]
byteoffset    = 100
bitsize        = 1
bitoffset = 0
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
bitoffset = 0
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>
 
 
[Fiveshot Timings]
collapsible = 2
control     = info
shortdesc   = <<<MULTILINE
Time Adjustments for Fiveshot Combos
Presets:
MULTILINE
 
 
[Fiveshot Pre]
group     = true
color            = #008000
control   = config
item      = J2kbr Fiveshot . Fiveshot Timing : #01:00#0A:145A148200F01414
item      = Old Fiveshot . Fiveshot Timing : #01:00#0A:1446148200D21414
 
 
[Fiveshot Fiveshot Right Fire PRESS]
group       = true
byteoffset  = 10
bitsize     = 8                   
control     = spinbox
default     = 20
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <<<MULTILINE
 
<b>Fiveshot . Fiveshot</b> Fire Button Press Time
MULTILINE
 
[Fiveshot Fiveshot Right Fire RELEASE]
group       = true
byteoffset  = 11
bitsize     = 8                   
control     = spinbox
default     = 90
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot</b> Fire Button Release Time
 
[Fiveshot Fiveshot Reload PRESS]   
group       = true
byteoffset  = 12
bitsize     = 8       
control     = spinbox
default     = 20
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot</b> Reload Button Press Time
 
[Fiveshot Fiveshot Reload RELEASE]   
group       = true
byteoffset  = 13
bitsize     = 8       
control     = spinbox
default     = 130
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot</b> Reload Button Release Time
 
[Fiveshot Fiveshot Wait After YY]
group       = true
byteoffset  = 14
bitsize     = 16       
control     = spinbox
default     = 240
minimum     = 10
maximum     = 500
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot</b> Wait Time after YY call
 
[Fiveshot YY B_Weapon PRESS]
group       = true
byteoffset  = 16
bitsize     = 8       
control     = spinbox
default     = 20
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot/RRXYY : YY</b> B_Weapon Button Press Time
 
[Fiveshot YY B_Weapon RELEASE]       
group       = true
byteoffset  = 17
bitsize     = 8       
control     = spinbox
default     = 20
minimum     = 10
maximum     = 250
step        = 1
shortdesc   = <b>Fiveshot . Fiveshot/RRXYY : YY</b> B_Weapon Button Release Time
 
 
[Left Rapid Fire]
byteoffset    = 2                   
bitsize        = 1                     
bitoffset = 0                     
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
bitoffset = 0
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
bitoffset = 0
control        = checkbox
default        = 0
item            = Enable Melee Mode
shortdesc   = In-game on/off: <b>DPAD-Up + RB</b>
 
[Doubleshot Melee]
byteoffset    = 5
bitsize        = 1
bitoffset = 0
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
bitoffset = 0
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;
 
// five shot timings                                 // j2kbr timings // v1.00 timings
uint8   FSHOT_RiFiPWait;    // right fire press wait  : wait(20);       wait(20);
uint8   FSHOT_RiFiRWait;    // right fire release wait: wait(90);       wait(70);
uint8   FSHOT_ReloadPWait;  // reload press wait      : wait(20);       wait(20);
uint8   FSHOT_ReloadRWait;  // reload release wait    : wait(130);      wait(130);
uint16  YYAwait;            // YY-Combo Wait after    : wait(240);      wait(210); // fiveshot & _RRXYY
 
// YY timings                     // same as old timings, no changes
uint8 YY_BWPWait;       //  B_Weapon press wait  : wait(20);           
uint8 YY_RWPWait;       //  B_Weapon release wait: wait(20);           
 
// 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);
 
  pmem_read(10,&FSHOT_RiFiPWait);
  pmem_read(11,&FSHOT_RiFiRWait)
  pmem_read(12,&FSHOT_ReloadPWait);
  pmem_read(13,&FSHOT_ReloadRWait);
  pmem_read(14,&YYAwait);    //uint16
 
  pmem_read(16,&YY_BWPWait);
  pmem_read(17,&YY_RWPWait);
 
 
 
 
 
    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(FSHOT_RiFiPWait);    // right fire press wait 
    wait(FSHOT_RiFiRWait);    // right fire release wait
    set_val(B_RFIRE, 100)
    wait(FSHOT_RiFiPWait);    // right fire press wait 
    set_val(B_RELOAD, 100);
    wait(FSHOT_ReloadPWait)// reload press wait     
    wait(FSHOT_ReloadRWait)// reload release wait   
    call(YY);                 // YY-Combo
    wait(YYAwait);            // YY-Combo Wait after   
}
 
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(YYAwait);            // YY-Combo Wait after   
}
 
//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(YY_BWPWait);       //  B_Weapon press wait 
    wait(YY_RWPWait);       //  B_Weapon release wait
    set_val(B_WEAPON, 100);
    wait(YY_BWPWait);       //  B_Weapon press wait 
}
 
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);
}
 


So are you saying that you added J2Kbr's modified 5 shot to the script but added a timing adjustment to the interactive configuration?
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: Halo 2 Classic

Postby Scachi » Sat Oct 06, 2018 4:51 am

Beak wrote:So are you saying that you added J2Kbr's modified 5 shot to the script but added a timing adjustment to the interactive configuration?

Yes, for you to be able to try different timings, for Fiveshot Type : Fiveshot only, by adjusting those values:
ic.png
ic.png (28.67 KiB) Viewed 2485 times

The default timings (when installing the script) are the one adjusted from j2kbr from the linked thread.
The Preset Button "Old Fiveshot" set the values to the timings of the old script.
The combo itself wasn't changed by j2kbr, just the timings. This is why I made them adjustable.
Adjust them a bit, hit "Save and Run" button and test it,.. repeat those steps, maybe you can find a timing that works for you.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Halo 2 Classic

Postby Squidward » Sat Oct 06, 2018 5:04 am

Scachi wrote:
Beak wrote:So are you saying that you added J2Kbr's modified 5 shot to the script but added a timing adjustment to the interactive configuration?

Yes, for you to be able to try different timings, for Fiveshot Type : Fiveshot only, by adjusting those values:
ic.png

The default timings (when installing the script) are the one adjusted from j2kbr from the linked thread.
The Preset Button "Old Fiveshot" set the values to the timings of the old script.
The combo itself wasn't changed by j2kbr, just the timings. This is why I made them adjustable.
Adjust them a bit, hit "Save and Run" button and test it,.. repeat those steps, maybe you can find a timing that works for you.


Thanks! I'll give it a try!
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm

Re: Halo 2 Classic

Postby Maniac_01 » Tue Jun 23, 2020 7:02 pm

Scachi wrote:This is the "Halo 2 Classic Custom Script - misterpyrrhuloxia request" converted to Titan Two with modifications requested by Beak:

Features:
Interactive configuration
Fiveshot
Doubleshot with melee
Rapid Fire (left & right)
Melee
Quick Reload

Notes:
Everything is disabled by default.
Enable them with the in-game button combo or via the Interactive Configuration

Options:
Fiveshot: Enable/Disable with DPAD-Up + RT
Modes: Fiveshot / RRXYY / XSV_261 / XSV_271 <= Cycle through modes with DPAD-Left + RT

Rapid Fire Left: Enable/Disable with DPAD-Up + LT

Rapid Fire Right: Enable/Disable with DPAD-Up + Y

Melee Mode: Enable/Disable with DPAD-Up + RB

Doubleshot Melee: Enable/Disable with DPAD-Up + A

Fast Reload: Enable/Disable with DPAD-Up + B



Hey, bro, I was wondering if it still works for the computer?
User avatar
Maniac_01
Private
Private
 
Posts: 1
Joined: Tue Jun 23, 2020 6:57 pm

Re: Halo 2 Classic

Postby Squidward » Thu Jul 02, 2020 7:30 am

Maniac_01 wrote:Hey, bro, I was wondering if it still works for the computer?


Sorry for replying so late. It does still work last I played a few months ago. I have not tested it on pc yet even though I have MCC on pc. One thing that has still not worked consistently ever since they moved all matches to dedicated servers is the double-shot and quad-shot. They work, but not consistently enough to not get killed every other fight because it stops firing mid-burst for no reason. I spent tons of time trying to figure it out but couldn't get it. The double-shot/quad-shot timings in my script were manually created by me using the input recorder while doing a flawless quad-shot. And even though the script is merely repeating that flawless quad-shot, it still doesn't perform like a script should for some reason.
User avatar
Squidward
Lieutenant
Lieutenant
 
Posts: 397
Joined: Tue Dec 23, 2014 4:39 pm


Return to User's Script Documentation

Who is online

Users browsing this forum: No registered users and 110 guests