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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Modifying gun game rotation

Modifying gun game rotation

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
10 Posts 4 Posters 1.0k 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.
  • HasjBlokundefined Offline
    HasjBlokundefined Offline
    HasjBlok
    wrote on last edited by
    #1

    Hey everyone, I've done some googling and browsing on these forums but I can't find an answer to this!

    I would like to edit the gungame rotation to a custom one. How would I go about doing that?

    1 Reply Last reply
    0
    • Xerxesundefined Offline
      Xerxesundefined Offline
      Xerxes
      Plutonium Staff
      wrote on last edited by
      #2

      You would have to override the main function in maps/mp/gametypes/gun.gsc
      As you can see there is a switch between multiple pre-made lists so you could replace the main function and then define a 4th list and set gunSelection to 4.

      JezuzLizardundefined 1 Reply Last reply
      0
      • Xerxesundefined Xerxes

        You would have to override the main function in maps/mp/gametypes/gun.gsc
        As you can see there is a switch between multiple pre-made lists so you could replace the main function and then define a 4th list and set gunSelection to 4.

        JezuzLizardundefined Offline
        JezuzLizardundefined Offline
        JezuzLizard
        Plutonium Staff
        wrote on last edited by
        #3

        Xerxes
        replaceFunc() won't work for that situation though:
        https://plutonium.pw/docs/modding/gsc/new-scripting-features/#replacefunc-specifics

        HasjBlok
        A way to go about making a custom rotation would be to set gts gunSelection 4 in the server config so the default weapon progression doesn't get created.
        Then you'd make a custom script and put addguntoprogression() function calls in the main() of the custom script.

        Alternatively, you can just modify the gun.gsc itself, you can get a working version here: https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer/blob/master/Multiplayer Core/patch_mp/maps/mp/gametypes/gun.gsc

        It would go in storage/t6/maps/mp/gametypes once you've compiled it.

        HasjBlokundefined 1 Reply Last reply
        0
        • JezuzLizardundefined JezuzLizard

          Xerxes
          replaceFunc() won't work for that situation though:
          https://plutonium.pw/docs/modding/gsc/new-scripting-features/#replacefunc-specifics

          HasjBlok
          A way to go about making a custom rotation would be to set gts gunSelection 4 in the server config so the default weapon progression doesn't get created.
          Then you'd make a custom script and put addguntoprogression() function calls in the main() of the custom script.

          Alternatively, you can just modify the gun.gsc itself, you can get a working version here: https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer/blob/master/Multiplayer Core/patch_mp/maps/mp/gametypes/gun.gsc

          It would go in storage/t6/maps/mp/gametypes once you've compiled it.

          HasjBlokundefined Offline
          HasjBlokundefined Offline
          HasjBlok
          wrote on last edited by HasjBlok
          #4

          JezuzLizard So I tried the gun.gsc way but im running into a weird error.
          I do spawn with the correct first gun but when I kill someone it does not promote me to the next weapon. Even though the only code I changed was adding a third case after line 112. The only code I can find that might have something to do with it is the if statement on line 201.

          Kind of lost at the moment but at least the custom gun rotation itself has now been added (I think...)

          (Oh btw I did remove the if statement on line 41 as I made my new rotation gunlist 3.)

          HasjBlokundefined 1 Reply Last reply
          0
          • HasjBlokundefined HasjBlok

            JezuzLizard So I tried the gun.gsc way but im running into a weird error.
            I do spawn with the correct first gun but when I kill someone it does not promote me to the next weapon. Even though the only code I changed was adding a third case after line 112. The only code I can find that might have something to do with it is the if statement on line 201.

            Kind of lost at the moment but at least the custom gun rotation itself has now been added (I think...)

            (Oh btw I did remove the if statement on line 41 as I made my new rotation gunlist 3.)

            HasjBlokundefined Offline
            HasjBlokundefined Offline
            HasjBlok
            wrote on last edited by
            #5

            Then I tried to do it the other way:
            (I haven't scripted a bunch on bo2 yet so maybe I'm completely misunderstanding how this works)

            1. Set gts gunSelection to 4, meaning that the switch case never adds guns
            2. Create a custom script (The one from the docs + the addgun functions in the main() function)
            3. Compiled custom script and put it in t6r/scripts/mp as gungame_fix.gsc
            4. Restarted my servers

            The servers started succesfully but upon loading in the player would just not have a weapon.

            JezuzLizardundefined 1 Reply Last reply
            0
            • HasjBlokundefined HasjBlok

              Then I tried to do it the other way:
              (I haven't scripted a bunch on bo2 yet so maybe I'm completely misunderstanding how this works)

              1. Set gts gunSelection to 4, meaning that the switch case never adds guns
              2. Create a custom script (The one from the docs + the addgun functions in the main() function)
              3. Compiled custom script and put it in t6r/scripts/mp as gungame_fix.gsc
              4. Restarted my servers

              The servers started succesfully but upon loading in the player would just not have a weapon.

              JezuzLizardundefined Offline
              JezuzLizardundefined Offline
              JezuzLizard
              Plutonium Staff
              wrote on last edited by
              #6

              HasjBlok I'll have to look into it later to see what needs to be done for it to work then.

              HasjBlokundefined 1 Reply Last reply
              0
              • JezuzLizardundefined JezuzLizard

                HasjBlok I'll have to look into it later to see what needs to be done for it to work then.

                HasjBlokundefined Offline
                HasjBlokundefined Offline
                HasjBlok
                wrote on last edited by
                #7

                JezuzLizard Alright good luck! I'm surprised to see that nobody has made a handy gsc for this yet.

                JezuzLizardundefined 1 Reply Last reply
                0
                • HasjBlokundefined HasjBlok

                  JezuzLizard Alright good luck! I'm surprised to see that nobody has made a handy gsc for this yet.

                  JezuzLizardundefined Offline
                  JezuzLizardundefined Offline
                  JezuzLizard
                  Plutonium Staff
                  wrote on last edited by
                  #8

                  HasjBlok

                  #include maps/mp/gametypes/gun;
                  #include maps/mp/gametypes/_hud_util;
                  #include maps/mp/_utility;
                  #include common_scripts/utility;
                  
                  init()
                  {
                  	level.gunprogression = [];
                  	addguntoprogression( "knife_ballistic_mp" );
                  	addguntoprogression( "scar_mp" );
                  	addguntoprogression( "tar21_mp" );
                  	addguntoprogression( "an94_mp" );
                  	addguntoprogression( "type95_mp" );
                  	addguntoprogression( "xm8_mp" );
                  	addguntoprogression( "sig556_mp" );
                  	addguntoprogression( "sa58_mp" );
                  	addguntoprogression( "saritch_mp" );
                  	addguntoprogression( "hamr_mp" );
                  	addguntoprogression( "lsat_mp" );
                  	addguntoprogression( "qbb95_mp" );
                  	addguntoprogression( "mk48_mp" );
                  	addguntoprogression( "svu_mp" );
                  	addguntoprogression( "as50_mp" );
                  	addguntoprogression( "dsr50_mp" );
                  	addguntoprogression( "ballista_mp+is" );
                  	addguntoprogression( "usrpg_mp" );
                  	addguntoprogression( "crossbow_mp" );
                  	addguntoprogression( "knife_ballistic_mp" );
                  	level.gungamekillscore = maps/mp/gametypes/_rank::getscoreinfovalue( "kill_gun" );
                  	registerscorelimit( level.gunprogression.size * level.gungamekillscore, level.gunprogression.size * level.gungamekillscore );
                  	setdvar( "scr_xpscale", 0 );
                  	setdvar( "ui_weapon_tiers", level.gunprogression.size );
                  	makedvarserverinfo( "ui_weapon_tiers", level.gunprogression.size );
                  }
                  

                  If you don't get a weapon it's because the name isn't valid..

                  1 Reply Last reply
                  0
                  • HasjBlokundefined Offline
                    HasjBlokundefined Offline
                    HasjBlok
                    wrote on last edited by
                    #9

                    JezuzLizard Thank you so much this worked! I'm gonna try to look into making this process easier for future gungame enthousiasts.

                    1 Reply Last reply
                    0
                    • susbaka1987undefined Offline
                      susbaka1987undefined Offline
                      susbaka1987
                      wrote on last edited by
                      #10

                      hi
                      that not work its get me in error
                      can someone explain why

                      1 Reply Last reply
                      0
                      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
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Donate