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

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. [Release] [GSC] Zombies Custom Powerup | Unlimited Ammo

[Release] [GSC] Zombies Custom Powerup | Unlimited Ammo

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
44 Posts 18 Posters 11.5k 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.
  • Ox_undefined Offline
    Ox_undefined Offline
    Ox_
    wrote on last edited by
    #3

    H3X1C said in [GSC] Zombies Custom Powerup | Unlimited Ammo:

    Nice work. If you want a challenge fix origins Easter egg with 4 people plus

    Never really did easter eggs with my friends, so doubt I'd want to bother.
    But well, what goes wrong with it?

    H3X1Cundefined 1 Reply Last reply
    0
    • H3X1Cundefined Offline
      H3X1Cundefined Offline
      H3X1C Plutonium Staff
      replied to Ox_ on last edited by
      #4

      Ox_ crashes the server 😂

      Ox_undefined 1 Reply Last reply
      0
      • Ox_undefined Offline
        Ox_undefined Offline
        Ox_
        replied to H3X1C on last edited by
        #5

        H3X1C said in [GSC] Zombies Custom Powerup | Unlimited Ammo:

        Ox_ crashes the server 😂

        Lol. At what point? What needs to be done to make it crash?
        Keep in mind that I don't know how the easter egg is done.

        1 Reply Last reply
        0
        • Jon_Trollstenundefined Offline
          Jon_Trollstenundefined Offline
          Jon_Trollsten
          wrote on last edited by
          #6

          Hmm... 🤔 maybe add death machine powerup?

          1 Reply Last reply
          0
          • frostyundefined Offline
            frostyundefined Offline
            frosty
            replied to Ox_ on last edited by
            #7

            Ox_ Thanks for sharing, this can be really useful. I'll keep my eye out for any servers with this feature

            1 Reply Last reply
            0
            • Xerxesundefined Offline
              Xerxesundefined Offline
              Xerxes Plutonium Staff
              replied to Ox_ on last edited by Xerxes
              #8

              Ox_ Nice share, if you change func_should_always_drop like this you should be able to control whether the perk is enabled or not from the server cfg, you probably also want to rename it at the same time.

              func_should_always_drop()
              {
                  if(is_true(getdvarintdefault("sv_perk_unlimited_ammo",1)))
                  {
              	    return 1;
                  }
                  return 0;
              }
              

              is_true needs #include common_scripts/utility; and getdvarintdefault needs #include maps/mp/_utility;

              You can do the same for the duration and replace wait 20; with wait getdvarintdefault("sv_perk_unlimited_ammo_duration",20);

              Or if you don't want to do that you can also change it to maps/mp/zombies/_zm_powerups::func_should_always_drop to use the original one and make your code a bit tidier.

              Ox_undefined 1 Reply Last reply
              0
              • Mr. Androidundefined Offline
                Mr. Androidundefined Offline
                Mr. Android Plutonium Admin
                wrote on last edited by
                #9

                Great thread OP 🙂 Can't wait for people to make full mods for Zombies.

                homuraundefined 1 Reply Last reply
                0
                • homuraundefined Offline
                  homuraundefined Offline
                  homura Banned
                  replied to Mr. Android on last edited by
                  #10

                  Mr. Android
                  Brings me back to Xbox 360 modding for WaW zombies.

                  1 Reply Last reply
                  0
                  • Ioofundefined Offline
                    Ioofundefined Offline
                    Ioof Contributor
                    wrote on last edited by Ioof
                    #11

                    Ox_
                    there is something i dont like about loops with wait
                    just a personal thing💆

                    turn_on_unlimited_ammo()
                    {
                    	level endon("game_ended");
                    	self endon("disonnect");
                    	self endon("end_unlimited_ammo");
                    
                            self setWeaponAmmoClip(self GetCurrentWeapon(), 150); //does it one time if you pick it up
                    
                    	for(;;)
                    	{
                                    self waittill ( "weapon_fired");
                    
                    		//simply set the current mag to be full on a loop
                    		self setWeaponAmmoClip(self GetCurrentWeapon(), 150);
                    	}
                    }
                    
                    1 Reply Last reply
                    0
                    • Ox_undefined Offline
                      Ox_undefined Offline
                      Ox_
                      replied to Xerxes on last edited by
                      #12

                      Xerxes said in [GSC] Zombies Custom Powerup | Unlimited Ammo:

                      Ox_ Nice share, if you change func_should_always_drop like this you should be able to control whether the perk is enabled or not from the server cfg, you probably also want to rename it at the same time.

                      func_should_always_drop()
                      {
                          if(is_true(getdvarintdefault("sv_perk_unlimited_ammo",1)))
                          {
                      	    return 1;
                          }
                          return 0;
                      }
                      

                      is_true needs #include common_scripts/utility; and getdvarintdefault needs #include maps/mp/_utility;

                      You can do the same for the duration and replace wait 20; with wait getdvarintdefault("sv_perk_unlimited_ammo_duration",20);

                      Or if you don't want to do that you can also change it to maps/mp/zombies/_zm_powerups::func_should_always_drop to use the original one and make your code a bit tidier.

                      I haven't ever done stuff with servers, just hosting normally games with my friends, but good info for anyone who might care.
                      And dunno why I didn't just use the original function, lol.

                      Enki said in [GSC] Zombies Custom Powerup | Unlimited Ammo:

                      Ox_
                      there is something i dont like about loops with wait
                      just a personal thing💆

                      turn_on_unlimited_ammo()
                      {
                      	level endon("game_ended");
                      	self endon("disonnect");
                      	self endon("end_unlimited_ammo");
                      
                              self setWeaponAmmoClip(self GetCurrentWeapon(), 150); //does it one time if you pick it up
                      
                      	for(;;)
                      	{
                                      self waittill ( "weapon_fired");
                      
                      		//simply set the current mag to be full on a loop
                      		self setWeaponAmmoClip(self GetCurrentWeapon(), 150);
                      	}
                      }
                      

                      Oh yeah, that's surely better.
                      Not sure why I haven't been doing that. Probably just something I picked up when I was a big noob and then it became a habit.

                      JezuzLizardundefined 1 Reply Last reply
                      0
                      • JezuzLizardundefined Offline
                        JezuzLizardundefined Offline
                        JezuzLizard Plutonium Staff
                        replied to Ox_ on last edited by
                        #13

                        Ox_ After some testing I've determined that in order for this mod to work you have to inject it at the lobby in Redacted. Which means as it is right now it won't work loaded as a mod on a Plutonium server. I'm guessing its both the include_powerup() and add_zombie_power() functions being ignored since the server thinks it has already loaded all powerups for the level. Is there some way to add powerups to the the level without injection at the lobby?

                        This is kinda weird though since adding weapons to the box works fine and its a similar methodology. Using

                        include_weapons()
                        {
                        	include_weapon( "beretta93r_upgraded_zm", 1 );
                        }
                        custom_add_weapons()
                        {
                        	add_zombie_weapon( "beretta93r_upgraded_zm", undefined, &"ZOMBIE_WEAPON_BERETTA93r", 1000, "", "", undefined );
                        }
                        

                        will put the upgraded b23r into the box on any map that has the b23r in its fast file.

                        Ox_undefined 1 Reply Last reply
                        0
                        • Ox_undefined Offline
                          Ox_undefined Offline
                          Ox_
                          replied to JezuzLizard on last edited by
                          #14

                          JezuzLizard said in [GSC] Zombies Custom Powerup | Unlimited Ammo:

                          Ox_ After some testing I've determined that in order for this mod to work you have to inject it at the lobby in Redacted. Which means as it is right now it won't work loaded as a mod on a Plutonium server. I'm guessing its both the include_powerup() and add_zombie_power() functions being ignored since the server thinks it has already loaded all powerups for the level. Is there some way to add powerups to the the level without injection at the lobby?

                          This is kinda weird though since adding weapons to the box works fine and its a similar methodology. Using

                          include_weapons()
                          {
                          	include_weapon( "beretta93r_upgraded_zm", 1 );
                          }
                          custom_add_weapons()
                          {
                          	add_zombie_weapon( "beretta93r_upgraded_zm", undefined, &"ZOMBIE_WEAPON_BERETTA93r", 1000, "", "", undefined );
                          }
                          

                          will put the upgraded b23r into the box on any map that has the b23r in its fast file.

                          Uh, I have only used this via Redacted when doing testing, and then via Steam when playing with my friends.
                          So I can't comment on what quirks hosting it via a Plutonium server brings. Sorry.

                          Maybe the Plutonium devs could offer some insight?

                          AndreasOmeirundefined 1 Reply Last reply
                          0
                          • AndreasOmeirundefined Offline
                            AndreasOmeirundefined Offline
                            AndreasOmeir
                            replied to Ox_ on last edited by
                            #15

                            Ox_ Excuse me, but I was wondering if there's a file as of now or in the future that contains this code for this phenomenal custom unlimited ammo power-up, and if it can or will be easily inserted into the BO2 folder. I'm not very familiar with coding, likely along with some others on this forum, so it would be of great help if you could address whether or not it will be released publicly, or if it is and I'm too stupid to understand where it is. I would very much enjoy using this power-up during games, and many others would too.

                            Ox_undefined 1 Reply Last reply
                            0
                            • Ox_undefined Offline
                              Ox_undefined Offline
                              Ox_
                              replied to AndreasOmeir on last edited by
                              #16

                              AndreasOmeir said in [GSC] Zombies Custom Powerup | Unlimited Ammo:

                              Ox_ Excuse me, but I was wondering if there's a file as of now or in the future that contains this code for this phenomenal custom unlimited ammo power-up, and if it can or will be easily inserted into the BO2 folder. I'm not very familiar with coding, likely along with some others on this forum, so it would be of great help if you could address whether or not it will be released publicly, or if it is and I'm too stupid to understand where it is. I would very much enjoy using this power-up during games, and many others would too.

                              I've edited & improved it now.
                              It will now work on all maps (didn't work on Buried and Origins before, luckily randomly decided to test those maps and saw it doesn't work)
                              And also added a download to a precompiled .gcs.

                              JezuzLizardundefined 1 Reply Last reply
                              0
                              • JezuzLizardundefined Offline
                                JezuzLizardundefined Offline
                                JezuzLizard Plutonium Staff
                                replied to Ox_ on last edited by
                                #17

                                Ox_ I tested your rewrite of the mod and it works on Plutonium dedicated servers now!

                                Ox_undefined 1 Reply Last reply
                                0
                                • Ox_undefined Offline
                                  Ox_undefined Offline
                                  Ox_
                                  replied to JezuzLizard on last edited by
                                  #18

                                  JezuzLizard said in [GSC] Zombies Custom Powerup | Unlimited Ammo:

                                  Ox_ I tested your rewrite of the mod and it works on Plutonium dedicated servers now!

                                  Don't think I really know what that means. Is there something special about that stuff? Did it not work before? Never even been on any servers.
                                  But anyway, glad to hear it's working.

                                  JezuzLizardundefined 1 Reply Last reply
                                  0
                                  • JezuzLizardundefined Offline
                                    JezuzLizardundefined Offline
                                    JezuzLizard Plutonium Staff
                                    replied to Ox_ on last edited by
                                    #19

                                    Ox_ Plutonium is a custom bo2 client that supports 8 player dedicated zombie servers on all maps. It doesn't support GSC injection and instead uses its own modloader similar to Redacted so dedicated servers can load custom GSC mods. The GSC modloader feature is relatively new so it seems to have some interesting behavior sometimes. Eg. your old code not working but your new code does for some reason that I'll look into at some point.

                                    I recommend you try Plutonium sometime since it has a more active playerbase than steam bo2, you can actually find games for all maps usually.

                                    Also, I used your mod as a base to add a few extra powerups in the game files as drops like, the bonus team points, perk bottle, and random weapon. So thanks for the new version again.

                                    Last thing, is it possible for a world at war nacht der untoten style powerup display for the infinite ammo powerup? I think it would it say Infinite Ammo: 20 and tick down from 20 at the bottom of the screen.

                                    Ox_undefined 1 Reply Last reply
                                    0
                                    • Ox_undefined Offline
                                      Ox_undefined Offline
                                      Ox_
                                      replied to JezuzLizard on last edited by
                                      #20

                                      JezuzLizard said in [GSC] Zombies Custom Powerup | Unlimited Ammo:

                                      Ox_ Plutonium is a custom bo2 client that supports 8 player dedicated zombie servers on all maps. It doesn't support GSC injection and instead uses its own modloader similar to Redacted so dedicated servers can load custom GSC mods. The GSC modloader feature is relatively new so it seems to have some interesting behavior sometimes. Eg. your old code not working but your new code does for some reason that I'll look into at some point.

                                      I recommend you try Plutonium sometime since it has a more active playerbase than steam bo2, you can actually find games for all maps usually.

                                      Also, I used your mod as a base to add a few extra powerups in the game files as drops like, the bonus team points, perk bottle, and random weapon. So thanks for the new version again.

                                      Last thing, is it possible for a world at war nacht der untoten style powerup display for the infinite ammo powerup? I think it would it say Infinite Ammo: 20 and tick down from 20 at the bottom of the screen.

                                      Yeah I know what Plutonium is/does, just didn't know what quirks are related to hosting a server and loading custom gsc, thanks.
                                      And about the old code not working, which map did you try? the old code didn't work in Buried & Origins, as described in the Original post. The delayed registering of the custom powerup pickup function fixed that.

                                      And cool that you added some stuff, maybe post it here if you want to share. Some other people might want to use them as well. Maybe I would use it as well next time I play zombies with my friends.

                                      And about having a countdown or whatever to indicate when the powerup ends.
                                      It most certainly is possible, but really cba right now at least. Already spend a few hrs trying to get the native style powerup hud to work via clientfields (as is done in the original game gsc), but every time I just errored out with client field mismatch error, and I have no idea why. So I lost motivation.

                                      The reason why I didn't at the very first go for drawing text on the screen, is because I don't remember from on top of my head how to draw 100% safe text. Been years and years since I properly did gsc (good old Xbox 360 RGH days). Would be super pissed if the game crashed due to an overflow on like round 40 or whatever.
                                      I guess like an iprintln would be safe to use. Looks maybe quite stupid though.
                                      If you want an iprintln solution, and don't know how to make it yourself, I can make it for you.

                                      JezuzLizardundefined 1 Reply Last reply
                                      0
                                      • Fryundefined Offline
                                        Fryundefined Offline
                                        Fry Plutonium Staff
                                        wrote on last edited by
                                        #21

                                        OP is your code on the main post the latest changes of the GSC? I have been thinking about merging this to RG server along with unlimited perks etc. I just wanted to make sure before I push it live.

                                        Ox_undefined 1 Reply Last reply
                                        0
                                        • Jon_Trollstenundefined Offline
                                          Jon_Trollstenundefined Offline
                                          Jon_Trollsten
                                          wrote on last edited by
                                          #22

                                          Tried improving the code, added ambient sound when powerup is active, and iprintin message about powerup being picked up and being ended. I also tried drawing a hud powerup icon but it doesn't work.
                                          I also removed zombie blood code because it wasn't working.

                                          #include maps\mp\_utility;
                                          #include common_scripts\utility;
                                          #include maps\mp\gametypes_zm\_hud_util;
                                          #include maps\mp\gametypes_zm\_hud_message;
                                          
                                          //important include
                                          #include maps\mp\zombies\_zm_powerups;
                                          
                                          init()
                                          {
                                          	level thread onPlayerConnect();
                                              precacheshader( "zom_icon_minigun" ); // tried precaching death machine icon for hud, didn't work for some reason
                                          	include_zombie_powerup("unlimited_ammo");
                                          	add_zombie_powerup("unlimited_ammo", "T6_WPN_AR_GALIL_WORLD", &"ZOMBIE_POWERUP_UNLIMITED_AMMO", ::func_should_always_drop, 0, 0, 0);
                                          	powerup_set_can_pick_up_in_last_stand("unlimited_ammo", 1);
                                          }
                                          
                                          onPlayerConnect()
                                          {
                                          	for(;;)
                                          	{
                                          		level waittill("connected", player);
                                          		player thread onPlayerSpawned();
                                          	}
                                          }
                                          
                                          onPlayerSpawned()
                                          {
                                          	self endon("disconnect");
                                          	level endon("game_ended");
                                          	for(;;)
                                          	{
                                          		self waittill("spawned_player");
                                          			//only run this when the host spawns in for the very first time
                                          			if(!isDefined(level.unlimited_ammo_first_spawn))
                                          			{
                                          				wait 2;
                                          				level._zombiemode_powerup_grab = ::custom_powerup_grab;
                                          				level.unlimited_ammo_first_spawn = "fortnite!fortnite!!";
                                          			}
                                          			
                                          	}
                                          }
                                          
                                          //fires when we grab any custom powerup
                                          custom_powerup_grab(s_powerup, e_player)
                                          {
                                          	if (s_powerup.powerup_name == "unlimited_ammo")
                                          		level thread unlimited_ammo_powerup(s_powerup, e_player);
                                          	    
                                          }
                                          
                                          unlimited_ammo_powerup(m_powerup, e_player)
                                          {
                                          	foreach(player in level.players)
                                          	{
                                          		//if powerup is already on, turn it off
                                          		player notify("end_unlimited_ammo");
                                                  //decided to use stinger from when you get ray gun from box
                                          		player playsound("mus_raygun_stinger");
                                          		player thread turn_on_unlimited_ammo();
                                          		player thread notify_unlimited_ammo_end();
                                          		player thread sfx_inf_ammo();
                                                          player thread ammo_hud_create();
                                          		player iprintln("^2Bottomless Clip!");  
                                          		wait 30;
                                          		player iprintln("^1Bottomless Clip has ended!");
                                          		player playsound("zmb_insta_kill_loop_off");
                                          
                                          	}
                                          	
                                          }
                                          
                                          sfx_inf_ammo()
                                          {
                                              level endon("game_ended");
                                          	self endon("disconnect");
                                          	self endon("end_unlimited_ammo");
                                          	inf_ammo_ent = spawn( "script_origin", ( 0, 0, 0 ) ); 
                                          	inf_ammo_ent playloopsound( "zmb_insta_kill_loop" );
                                          	wait 30;
                                          	inf_ammo_ent stoploopsound();
                                          	inf_ammo_ent destroy();
                                          
                                          }
                                          //my attempt at making a hud icon for it, as expected, it didn't work
                                          ammo_hud_create()
                                          {
                                          	self.ammo_icon = newclienthudelem( self );
                                          	self.ammo_icon.horzalign = "center";
                                          	self.ammo_icon.vertalign = "middle";
                                          	self.ammo_icon.x = -16;
                                          	self.ammo_icon.y = 16;
                                          	self.ammo_icon.alpha = 0;
                                          	width = 64;
                                          	height = 64;
                                          	self.ammo_icon setshader( "zom_icon_minigun", width, height );	
                                                  wait 30;
                                                  self.ammo_icon destroy();
                                          }
                                          
                                          turn_on_unlimited_ammo()
                                          {
                                          	level endon("game_ended");
                                          	self endon("disconnect");
                                          	self endon("end_unlimited_ammo");	
                                          
                                              self setWeaponAmmoClip(self GetCurrentWeapon(), 150);
                                          	
                                          	for(;;)
                                          	{
                                          	    self waittill ("weapon_fired");
                                          		//simply set the current mag to be full on a loop
                                          		self setWeaponAmmoClip(self GetCurrentWeapon(), 150);
                                          		wait .02;
                                          	}
                                          }
                                          
                                          notify_unlimited_ammo_end()
                                          {
                                          	level endon("game_ended");
                                          	self endon("disconnect");
                                          	self endon("end_unlimited_ammo");
                                          	//changed duration to 30 because why not 
                                          	wait 30;
                                          	self notify("end_unlimited_ammo");
                                          
                                          }
                                          
                                          
                                          
                                          1 Reply Last reply
                                          0

                                          • 1
                                          • 2
                                          • 3
                                          • Login

                                          • Don't have an account? Register

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