Skip to content
  • 0 Unread 0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [ZM] Attempting to change box weapon checks

[ZM] Attempting to change box weapon checks

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
2 Posts 2 Posters 443 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Killerbroundefined Offline
    Killerbroundefined Offline
    Killerbro
    wrote on last edited by
    #1

    So before the latest update I used a script that replaced _zm_magicbox.gsc (forum.plutonium.pw/topic/2648/release-zombies-no-weapon-limits-for-mystery-box), but after the update that obviously won't work anymore. I attempted a fix myself using my limited gsc knowledge by replacing the classes in _zm_magicbox.gsc with the slightly edited versions from the earlier script.

    #include maps/mp/zombies/_zm_stats;
    #include maps/mp/_demo;
    #include maps/mp/zombies/_zm_audio;
    #include maps/mp/zombies/_zm_score;
    #include maps/mp/zombies/_zm_pers_upgrades_functions;
    #include maps/mp/zombies/_zm_audio_announcer;
    #include maps/mp/zombies/_zm_unitrigger;
    #include maps/mp/zombies/_zm_weapons;
    #include maps/mp/zombies/_zm_utility;
    #include maps/mp/_utility;
    #include common_scripts/utility;
    #include maps/mp/zombies/_zm_magicbox_lock;
    
    init()
    {
        level thread onPlayerConnect();
        level.treasure_chest_canplayerreceiveweapon = scripts/zm/boxRNG::boxRNG;
        level.treasure_chest_chooseweightedrandomweapon = scripts/zm/boxRNG::chestTest;
    }
    
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill("connected", player);
        }
    }
    
    boxRNG( player, weapon, pap_triggers )
    {
    	if ( !get_is_in_box( weapon ) )
    	{
    		return 0;
    	}
    	return 1;
    }
    
    chestTest( player )
    {
    	keys = array_randomize( getarraykeys( level.zombie_weapons ) );
    	if ( isDefined( level.customrandomweaponweights ) )
    	{
    		keys = player [[ level.customrandomweaponweights ]]( keys );
    	}
    	/*
    /#
    	forced_weapon = getDvar( "scr_force_weapon" );
    	if ( forced_weapon != "" && isDefined( level.zombie_weapons[ forced_weapon ] ) )
    	{
    		arrayinsert( keys, forced_weapon, 0 );
    #/
    	}
    	*/
    	pap_triggers = getentarray( "specialty_weapupgrade", "script_noteworthy" );
    	for ( i = 0; i < keys.size; i++ )
    	{
    		if ( treasure_chest_canplayerreceiveweapon( player, keys[ i ], pap_triggers ) )
    		{
    			return keys[ i ];
    		}
    	}
    	return keys[ 0 ];
    }
    

    If it's clear that this is definitely incorrect, please say so lol. I'd appreciate any and all advice here.

    1 Reply Last reply
    0
    • jxbrtsundefined Offline
      jxbrtsundefined Offline
      jxbrts
      wrote on last edited by
      #2

      Hey Killerbro Did you end up testing this? If so, does it work?

      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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