GoldenEye: Source Forums

  • November 27, 2024, 05:00:11 am
  • Welcome, Guest
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Extending weaponlist to 16, how?  (Read 14895 times)

0 Members and 1 Guest are viewing this topic.

Game_Master001

  • Agent
  • *
  • Posts: 15
  • Reputation Power: 0
  • Game_Master001 has no influence.
  • Offline Offline
Extending weaponlist to 16, how?
« on: March 18, 2023, 11:47:32 pm »

So, several years ago I was looking into this with the topic asking how to set up Arsenal into GunGame, but then things happened midway and I never returned to that, until now.

Well, getting Arsenal to go to lvl 16 is now no problem for me: in Arsenal.py, I just set maxLevel to 16, and increase the range at the comment "# Store all the current weaponset's weapons in a list for easy access." from 0, 8 to 0, 16 (I think this is what I missed back there, as now I properly get to lvls 9-16). To be completely safe, I also set the entry len(self.weaponList) < 7 to 15.

Yet while I get to lvl 9+ properly and also of course set up the Arsenal weaponlist properly, I find that it gives no weapon (just "None"). There still seems to be some limit somewhere that prevents the game from reading entries 8 to 15 in the Arsenal's weaponlist, but I can't find it in any of the files. Anyone knows where I can find this limit so I change it? The only thing I thought could be the issue was __init__.py in the same folder as Arsenal.py which has an entry with as range 0, 8, but I set it to 0, 16 as a test without improvement, so that's not it (I of course changed it back after I was done testing).
Logged

Entropy-Soldier

  • Managing Director
  • 00 Agent
  • ***
  • Posts: 506
  • Reputation Power: 372
  • Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!Entropy-Soldier is awe-inspiring!
  • Offline Offline
Re: Extending weaponlist to 16, how?
« Reply #1 on: March 19, 2023, 01:38:50 am »

Unfortunately you'll have to make your own system for arsenal loadouts if you want more than 8 slots. 

The GE:S weaponset system requires exactly 8 weapon slots, as it's used to spawn weapons around the map in deathmatch style gamemodes and each slot corresponds to a specific collection of weapon spawners.  That being said, gamemodes like Arsenal don't actually have to use it since they're not using map spawners.  You can set up your own text file parser for arbitrarily sized lists, or just hardcode a collection of sets into the gamemode itself. You'll of course not be able to see the weapons in the weaponset list popout, but you could possibly display them somewhere else.  This naturally requires modifying non-trivial sections of the Arsenal python file, but it should be a fairly straightforward exercise if you're interested in messing around with python.


Hope that helps!
Logged
"By reading this, you’ve done more than you can imagine." - Adrian

Game_Master001

  • Agent
  • *
  • Posts: 15
  • Reputation Power: 0
  • Game_Master001 has no influence.
  • Offline Offline
Re: Extending weaponlist to 16, how?
« Reply #2 on: March 19, 2023, 07:18:28 am »

Thanks! My Python skills are sadly non-existent, but I can make simple changes. What I tried was the following, but it only works half. As a test, I set a weaponlist of 9 levels consisting of the RCP90 for the first 7 rounds, the Magnum for round 8, and the Golden PP7 for round 9. It doesn't work during warm-up (gives everyone the KF7 and Slappers, which is according to the Arsenal weaponlist which I set to all KF7 to test my changes), which is 100% fine with me. During the game itself, the bots run around with the RCP90 showing I did something right, but I have no weapons whatsoever. How come? Here's the relevant part of Arsenal.py I edited

P.s. I know I removed the Slappers from this part of the code. That's intentional (I of course also tried with the original file with the Slappers, same problem):

    # Give player their level specific weapon and the slappers
    def ar_GivePlayerWeapons( self, player ):
        if not player or player.IsDead() or len(self.weaponList) < 8:
            return

        player.StripAllWeapons()

        lvl = self.ar_GetLevel( player )

        if lvl < 8:
            weap = "weapon_rcp90"
        if lvl == 8:
            weap = "weapon_cmag"
        if lvl == 9:
            weap = "weapon_golden_pp7"

        player.GiveNamedWeapon( weap, 800 ) # We use infinite ammo so who cares about exact ammo amounts

        player.WeaponSwitch( weap )
Logged
Pages: [1]   Go Up