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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 08:09 PM.


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