Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. Grief Custom Games unified fixes

Grief Custom Games unified fixes

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
1 Posts 1 Posters 670 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined Offline
    undefined Offline
    Nakero
    wrote on May 11, 2024, 9:59 PM last edited by Nakero May 21, 2024, 8:38 PM
    #1

    This is a script you can install to fix many things about zombies Grief custom games, it fixes the team distribution, it allows to instantly change team midgame and disables knife lunge.
    To install it just copy and paste all this code on a .txt and change the name to: Grief_CustomGames_unified.gsc (changing the extension of the file to .gsc) and put the file on the scripts folder: f16cad90-7474-4e31-9d78-aac925bc3ab5-image.png

    You can also download the file here:
    https://drive.google.com/file/d/1trdYjkX5QwVsF1xhnd0uAN4TuwTvolPu/view?usp=sharing
    and put the file on that folder

    // Grief Custom Games Patch Unified
    // Made by Nakero (Nakero77)
    
    
    // Inspired by JezuzLizard and Jbleezy scripts
    
    #include maps\mp\_utility;
    #include common_scripts\utility;
    #include maps\mp\zombies\_zm_utility;
    #include maps\mp\gametypes_zm\_hud_util;
    #include maps\mp\gametypes_zm\_hud_message;
    #include maps\mp\zombies\_zm;
    
    
    main()
    {
    	replaceFunc(maps\mp\gametypes_zm\_zm_gametype::menu_onmenuresponse, scripts\zm\Grief_CustomGames_unified::menu_onmenuresponse);
    	setDvar( "ui_gametype_team_change" , 1);
    	setgametypesetting("allowInGameTeamChange", 1);
    	//setgametypesetting("startRound", 20); // uncomment this line to set round 20 automatic no matter what round you choose on the pre-game lobby
    
    }
    
    init()
    {
        if ( getDvar( "g_gametype" ) == "zgrief" )
        {
            level thread on_player_connect();
            if ( getDvarInt( "zombies_minplayers" ) < 1 || getDvarInt( "zombies_minplayers" ) == "" )
            {
                setDvar( "zombies_minplayers", 1 );
            }
        }
    }
    
    on_player_connect()
    {
        while ( 1 )
        {
        	level waittill( "connected", player );
           	player set_team();
    	player setClientDvar( "aim_automelee_enabled", 0 ); // comment this line to enable again the knife lunge
        }
    }
    
    
    menu_onmenuresponse()
    {
        self endon( "disconnect" );
    
        for (;;)
        {
            self waittill( "menuresponse", menu, response );
    
            if ( response == "back" )
            {
                self closemenu();
                self closeingamemenu();
    
                if ( level.console )
                {
                    if ( menu == game["menu_changeclass"] || menu == game["menu_changeclass_offline"] || menu == game["menu_team"] || menu == game["menu_controls"] )
                    {
                        if ( self.pers["team"] == "allies" )
                            self openmenu( game["menu_class"] );
    
                        if ( self.pers["team"] == "axis" )
                            self openmenu( game["menu_class"] );
                    }
                }
    
                continue;
            }
    
            if ( menu == game["menu_team"] )
            {
    			self closemenu();
                self closeingamemenu();
    			self thread do_team_change();
    			continue;
            }
    
            if ( response == "changeclass_marines" )
            {
                self closemenu();
                self closeingamemenu();
                self openmenu( game["menu_changeclass_allies"] );
                continue;
            }
    
            if ( response == "changeclass_opfor" )
            {
                self closemenu();
                self closeingamemenu();
                self openmenu( game["menu_changeclass_axis"] );
                continue;
            }
    
            if ( response == "changeclass_wager" )
            {
                self closemenu();
                self closeingamemenu();
                self openmenu( game["menu_changeclass_wager"] );
                continue;
            }
    
            if ( response == "changeclass_custom" )
            {
                self closemenu();
                self closeingamemenu();
                self openmenu( game["menu_changeclass_custom"] );
                continue;
            }
    
            if ( response == "changeclass_barebones" )
            {
                self closemenu();
                self closeingamemenu();
                self openmenu( game["menu_changeclass_barebones"] );
                continue;
            }
    
            if ( response == "changeclass_marines_splitscreen" )
                self openmenu( "changeclass_marines_splitscreen" );
    
            if ( response == "changeclass_opfor_splitscreen" )
                self openmenu( "changeclass_opfor_splitscreen" );
    
            if ( response == "endgame" )
            {
                if ( self issplitscreen() )
                {
                    level.skipvote = 1;
    
                    if ( !( isdefined( level.gameended ) && level.gameended ) )
                    {
                        self maps\mp\zombies\_zm_laststand::add_weighted_down();
                        self maps\mp\zombies\_zm_stats::increment_client_stat( "deaths" );
                        self maps\mp\zombies\_zm_stats::increment_player_stat( "deaths" );
                        self maps\mp\zombies\_zm_pers_upgrades_functions::pers_upgrade_jugg_player_death_stat();
                        level.host_ended_game = 1;
                        maps\mp\zombies\_zm_game_module::freeze_players( 1 );
                        level notify( "end_game" );
                    }
                }
    
                continue;
            }
    
            if ( response == "restart_level_zm" )
            {
                self maps\mp\zombies\_zm_laststand::add_weighted_down();
                self maps\mp\zombies\_zm_stats::increment_client_stat( "deaths" );
                self maps\mp\zombies\_zm_stats::increment_player_stat( "deaths" );
                self maps\mp\zombies\_zm_pers_upgrades_functions::pers_upgrade_jugg_player_death_stat();
                missionfailed();
            }
    
            if ( response == "killserverpc" )
            {
                level thread maps\mp\gametypes_zm\_globallogic::killserverpc();
                continue;
            }
    
            if ( response == "endround" )
            {
                if ( !( isdefined( level.gameended ) && level.gameended ) )
                {
                    self maps\mp\gametypes_zm\_globallogic::gamehistoryplayerquit();
                    self maps\mp\zombies\_zm_laststand::add_weighted_down();
                    self closemenu();
                    self closeingamemenu();
                    level.host_ended_game = 1;
                    maps\mp\zombies\_zm_game_module::freeze_players( 1 );
                    level notify( "end_game" );
                }
    
                continue;
            }
    
            if ( menu == game["menu_team"] && level.allow_teamchange == "1" )
            {
                switch ( response )
                {
                    case "allies":
                        self [[ level.allies ]]();
                        break;
                    case "axis":
                        self [[ level.teammenu ]]( response );
                        break;
                    case "autoassign":
                        self [[ level.autoassign ]]( 1 );
                        break;
                    case "spectator":
                        self [[ level.spectator ]]();
                        break;
                }
    
                continue;
            }
    
            if ( menu == game["menu_changeclass"] || menu == game["menu_changeclass_offline"] || menu == game["menu_changeclass_wager"] || menu == game["menu_changeclass_custom"] || menu == game["menu_changeclass_barebones"] )
            {
                self closemenu();
                self closeingamemenu();
    
                if ( level.rankedmatch && issubstr( response, "custom" ) )
                {
    
                }
    
                self.selectedclass = 1;
                self [[ level.class ]]( response );
            }
        }
    }
    
    do_team_change()
    {
    
    	set_team( getotherteam( self.pers["team"] ) );
    
    	if ( !flag( "initial_blackscreen_passed" ) )
    	{
    		self [[ level.spawnplayer ]]();
    	}
    }
    
    
    
    
    
    set_team(team)
    {
        if(team == "just_joined")
        {
            teamplayersallies = countplayers("allies");
            teamplayersaxis = countplayers("axis");
            if(teamplayersallies > teamplayersaxis && !level.isresetting_grief)
            {
                self.team = "axis";
                self.sessionteam = "axis";
                self.pers["team"] = "axis";
                self._encounters_team = "A";
            }
            else if(teamplayersallies < teamplayersaxis && !level.isresetting_grief)
            {
                self.team = "allies";
                self.sessionteam = "allies";
                self.pers["team"] = "allies";
                self._encounters_team = "B";
            }
            else
            {
                self.team = "allies";
                self.sessionteam = "allies";
                self.pers["team"] = "allies";
                self._encounters_team = "B";
            }
        } else 
        {
            if ( team == "axis" )
            {
                self.team = "axis";
                self.sessionteam = "axis";
                self.pers["team"] = "axis";
                self._encounters_team = "A";
                self.characterindex = 0;
            }
            else
            {
                self.team = "allies";
                self.sessionteam = "allies";
                self.pers["team"] = "allies";
                self._encounters_team = "B";
                self.characterindex = 1;
            }
    	self [[ level.givecustomcharacters ]]();
        }
    }
    
    
    // Amateur coder, I just unified and adapted many functions from other codes to make Grief Custom Games more enjoyable
    
    1 Reply Last reply
    1

    1/1

    May 11, 2024, 9:59 PM

    • Login

    • Don't have an account? Register

    • Login or register to search.
    1 / 1
    • First post
      1/1
      Last post
    0
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Donate