Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > NecroVisioN > Mods

Mods NecroVisioN MODs and other improvements

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2009, 04:11 AM
GUInterface GUInterface is offline
Approved Member
 
Join Date: Jul 2009
Posts: 4
Default 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")
--============================================================================
Am I correct in assuming it's something to do with this line?

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
I'm not too good at programming, so I'd appreciate it if someone lent me a hand.

Thanks in advance.
Reply With Quote
  #2  
Old 08-08-2009, 08:17 AM
Gniarf Gniarf is offline
Approved Member
 
Join Date: Mar 2009
Posts: 180
Default

Quote:
Originally Posted by GUInterface View Post
I believe the max for it is 500 bullets
It's 300, including those already loaded in your current weapon.
Quote:
Originally Posted by GUInterface View Post
Am I correct in assuming it's something to do with this line?

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
Yes
Quote:
Originally Posted by GUInterface View Post
I'm not too good at programming, so I'd appreciate it if someone lent me a hand.
replace
Code:
if player.Ammo.VampGun < player.s_SubClass.MaxAmmo.VampGun
by
Code:
if (player.Ammo.VampGun < player.s_SubClass.MaxAmmo.VampGun) or (player.Ammo.MiniGun < player.s_SubClass.MaxAmmo.MiniGun) or (player.Ammo.Mp18 < player.s_SubClass.MaxAmmo.Mp18) then
note: I don't mind helping, but due to current state of surgery technology (especially anti-rejection treatments) I'm NOT going to lend you my hand.
(Oh but I can fetch you one from the nearby cemetery)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:34 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.