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

Plutonium

  1. Home
  2. MW3 Modding Support & Discussion
  3. Adjust Scavenger to Emulate MW2 with GSC?

Adjust Scavenger to Emulate MW2 with GSC?

Scheduled Pinned Locked Moved MW3 Modding Support & Discussion
4 Posts 3 Posters 241 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.
  • Tifosi 92undefined Offline
    Tifosi 92undefined Offline
    Tifosi 92
    wrote on last edited by
    #1

    Hi there,

    Two years ago I used a GSC script (credit mostly to Resxt) to remove spawn protection and the visual effects of the MOAB for playing against bots.

    For some reason I don't understand, a side-effect of running this script was that Scavenger behaved as it did in MW2, and resupplied secondary weapons, lethals, and tacticals with each pickup. I haven't changed this script at all, but when running the game now, two years later, on an updated version of Plutonium, Scavenger works as it did in MW3, resupplying only the primary weapon.

    As a Javelin addict on MW2 who much preferred Scavenger's ability to resupply it, is there any way to restore this behavior with a GSC script? I did a search of the forums and found nothing. I've attached the script, which shouldn't have had any effect but somehow did.

    Thanks for the help.

    #include maps\mp\_utility;
    #include maps\mp\killstreaks\_nuke;
    
    Init()
    {
    	level.killstreakSpawnShield = 0;
    }
    
    main()
    {
    	replacefunc(maps\mp\killstreaks\_nuke::nukeVision, ::disableNukeVision); 
    	replacefunc(maps\mp\killstreaks\_nuke::nukeEffects, ::disableNukeEffects);
    }
    
    disableNukeVision()
    {
    
    }
    
    disableNukeEffects()
    {
    	level endon( "nuke_cancelled" );
    	setdvar( "ui_bomb_timer", 0 );
    	
    	foreach ( var_1 in level.players )
    	{
    		var_2 = anglestoforward( var_1.angles );
    		var_2 = ( var_2[0], var_2[1], 0 );
            	var_2 = vectornormalize( var_2 );
            	var_3 = 5000;
            	var_4 = spawn( "script_model", var_1.origin + var_2 * var_3 );
            	var_4 setmodel( "tag_origin" );
            	var_4.angles = ( 0, var_1.angles[1] + 180, 90 );
            	var_4 thread nukeEffect( var_1 );
        	}
    }
    
    1 Reply Last reply
    0
    • Resxtundefined Resxt moved this topic from MW3 Modding Releases & Resources on
    • Resxtundefined Offline
      Resxtundefined Offline
      Resxt Plutonium Staff
      wrote on last edited by Resxt
      #2

      Try this in the Init function

      level.scavenger_altmode = 1;
      level.scavenger_secondary = 1;
      

      If it doesn't work then monitoring the scavenger pickup and filling up the secondary's ammo might do the trick
      https://github.com/plutoniummod/iw5-scripts/blob/42f3db22261febd7180075842e250d2e0f3d0507/maps/mp/gametypes/_missions.gsc#L116

      1 Reply Last reply
      1
      • Tifosi 92undefined Offline
        Tifosi 92undefined Offline
        Tifosi 92
        wrote on last edited by Tifosi 92
        #3

        Resxt said in Adjust Scavenger to Emulate MW2 with GSC?:

        Try this in the Init function

        Thanks for the suggestion (and for moving the thread to the right forum; sorry about that). I tried adding that to the init function, but no luck. I also tried changing the "perk_scavengerMode" variable from 0 to 1 in the console but noticed no change. I'm not quite sure how to do what you're suggesting so I suppose I'll deal with it as is until someone with more coding experience than me decides to come up with a fix, haha.

        It would also resupply lethals and tacticals before, too. Really weird, because I know for certain I didn't have the expertise to write the code to do this, nor did I write a script for it, so it must have changed something else in the engine back then...

        Xplod_undefined 1 Reply Last reply
        0
        • Xplod_undefined Offline
          Xplod_undefined Offline
          Xplod_
          replied to Tifosi 92 on last edited by
          #4

          Tifosi 92 (Maybe it's late to reply this but I'll do it) I made a script to have the lethal and tactical grenades being ressuplied in MW3, so here is the script, it even ressuplies the launchers weapons in case you want it too.

          #include maps\mp\_utility;
          
          Init()
          {
              InitScavengerResupply();
          }
          
          InitScavengerResupply()
          {
              level thread OnPlayerConnect();
          }
          
          OnPlayerConnect()
          {
              for(;;)
              {
                  level waittill("connected", player);
          
                  player thread OnPlayerSpawned();
              }
          }
          
          OnPlayerSpawned()
          {
              self endon("disconnect");
              
              for(;;)
              {
                  self waittill("changed_kit");
          
                  // Check if the player has the Scavenger perk
                  if (self HasPerk("specialty_scavenger"))
                  {
                      self thread OnScavengerPickup();
                  }
              }
          }
          
          OnScavengerPickup()
          {
              self endon("disconnect");
              self endon("death");
          
              for (;;)
              {
                  self waittill("scavenger_pickup");
          
                  self GiveMaxAmmo();
          
                  if (self HasWeapon(self GetCurrentOffhand()))
                  {
                      self GiveMaxAmmo(self GetCurrentOffhand());
                  }
          
                  if (self GetWeaponAmmoStock("frag_grenade_mp") < 1)
                  {
                      self SetWeaponAmmoStock("frag_grenade_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("semtex_mp") < 1)
                  {
                      self SetWeaponAmmoStock("semtex_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("throwingknife_mp") < 1)
                  {
                      self SetWeaponAmmoStock("throwingknife_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("bouncingbetty_mp") < 1)
                  {
                      self SetWeaponAmmoStock("bouncingbetty_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("claymore_mp") < 1)
                  {
                      self SetWeaponAmmoStock("claymore_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("c4_mp") < 1)
                  {
                      self SetWeaponAmmoStock("c4_mp", 1);
                  }
                  if (self GetWeaponAmmoStock("flash_grenade_mp") < 1)
                  {
                      self SetWeaponAmmoStock("flash_grenade_mp", 1);
                  }
                  if (self GetWeaponAmmoStock("concussion_grenade_mp") < 1)
                  {
                      self SetWeaponAmmoStock("concussion_grenade_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("scrambler_mp") < 1)
                  {
                      self SetWeaponAmmoStock("scrambler_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("emp_grenade_mp") < 1)
                  {
                      self SetWeaponAmmoStock("emp_grenade_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("smoke_grenade_mp") < 1)
                  {
                      self SetWeaponAmmoStock("smoke_grenade_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("trophy_mp") < 1)
                  {
                      self SetWeaponAmmoStock("trophy_mp", 1);
                  }
          	if (self GetWeaponAmmoStock("portable_radar_mp") < 1)
                  {
                      self SetWeaponAmmoStock("portable_radar_mp", 1);
                  }
          
                  self thread ResupplyLaunchers();
              }
          }
          
          ResupplyLaunchers()
          {
              launchers = [
                  "m320_mp",
                  "rpg_mp",
                  "iw5_smaw_mp",
                  "stinger_mp",
                  "xm25_mp",
                  "javelin_mp"
              ];
          
              for (i = 0; i < launchers.size; i++)
              {
                  weapon = launchers[i];
          
                  if (self HasWeapon(weapon))
                  {
                      self GiveMaxAmmo(weapon);
                  }
              }
          }
          
          1 Reply Last reply
          0

          • Login

          • Don't have an account? Register

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