#1
|
|||
|
|||
Ammo for regular weapons.
Hello,
I was bothered by the fact that the game stops giving you ammo for the WWI weapons once you finish Chapter 5, so I decided to open up the game files and see if I could change this. I managed to fix the problem by making every level after Chapter 5 start the player with every weapon (except those unlocked by challenges) and have the vampiric weapon ammo packs give ammo for the regular weapons too. Vampiric machinegun ammo gives ammo for the minigun, regular machinegun and vampiric submachinegun. Vampiric shotgun ammo also gives shells for the regular shotgun. Huge vampiric ammo cache gives ammunition for every single weapon. This all works fine, however, if the player has max ammo for a vampiric weapon then it won't be picked up even if he doesn't have full ammo for a normal weapon. For example, if I have 550 bullets for the vampiric submachinegun (the max for that weapon) and 50 for the minigun (I believe the max for it is 500 bullets) then the ammo won't be picked up no matter what. The only way to fix it is by wasting a bullet of the vampiric weapon then the ammo will be picked up and added to both types of weapons. I'm going to assume that this has something to do with a line of coding in the ammo files (this one is for the submachinegun ammo): Code:
o.Mesh = "Vampgun_ammo" o.Pack = "VampSMGammo.dat" o.Scale = 0.003 o.DisabledInVoosh = true o.RespawnTime = 15 o.AmmoAdd = 50 o.s_SubClass ={} o.takeDistance = 1.8 o.SaveAfterTake = true --============================================================================ function o:OnInitTemplate() self.CubeMap = nil self.DetailMap = nil self.NormalMap = nil self.Destroy = nil self.Impulse = nil self:ReplaceFunction("_Synchronize","Synchronize") self:ReplaceFunction("Synchronize","nil") end --============================================================================ function Ammo_VampGun:OnCreateEntity() ENTITY.EnableNetworkSynchronization(self._Entity) end --============================================================================ function Ammo_VampGun:OnTake(player) if player.Ammo.VampGun < player.s_SubClass.MaxAmmo.VampGun then self.TakeFX(player._Entity, self.AmmoAdd) GObjects:ToKill(self) else return false end end --============================================================================ function Ammo_VampGun:TakeFX(pe,add) local player = EntityToObject[pe] if player then player.Ammo.VampGun = player.Ammo.VampGun + add player.Ammo.MiniGun = player.Ammo.MiniGun + add player.Ammo.Mp18 = player.Ammo.Mp18 + add player:CheckMaxAmmo() if player == Player then player:PickupFX() end end Templates["Ammo_VampGun.CItem"]:SndEnt("pickup",pe) end Network:RegisterMethod("Ammo_VampGun.TakeFX", NCallOn.ServerAndAllClients, NMode.Reliable, "eu") --============================================================================ Code:
function Ammo_VampGun:OnTake(player) if player.Ammo.VampGun < player.s_SubClass.MaxAmmo.VampGun then self.TakeFX(player._Entity, self.AmmoAdd) GObjects:ToKill(self) else return false end end Thanks in advance. |
|
|