Project Zomboid

Project Zomboid

Subpar Survivors
SlightlyMadman  [developer] 14 Aug, 2021 @ 1:17pm
Brita's Ammo Compatibility
This is the ammo box discovery code:
if (bullets == "BB177") then return "BB177Box"
elseif (bullets == "Bullets22") then return "Bullets22Box"
elseif (bullets == "Bullets57") then return "Bullets57Box"
elseif (bullets == "Bullets380") then return "Bullets380Box"
elseif (bullets == "Bullets9mm") then return "Bullets9mmBox"
elseif (bullets == "Bullets38") then return "Bullets38Box"
elseif (bullets == "Bullets357") then return "Bullets357Box"
elseif (bullets == "Bullets45") then return "Bullets45Box"
elseif (bullets == "Bullets45LC") then return "Bullets45LCBox"
elseif (bullets == "Bullets44") then return "Bullets44Box"
elseif (bullets == "Bullets4570") then return "Bullets4570Box"

elseif (bullets == "410gShotgunShells")then return "410gShotgunShellsBox"
elseif (bullets == "20gShotgunShells") then return "20gShotgunShellsBox"
elseif (bullets == "ShotgunShells") then return "ShotgunShellsBox"
elseif (bullets == "10gShotgunShells") then return "10gShotgunShellsBox"
elseif (bullets == "4gShotgunShells") then return "4gShotgunShellsBox"

elseif (bullets == "223Bullets") then return "223Box"
elseif (bullets == "556Bullets") then return "556Box"
elseif (bullets == "762x39Bullets") then return "762x39Box"
elseif (bullets == "308Bullets") then return "308Box"
elseif (bullets == "762x51Bullets") then return "762x51Box"
elseif (bullets == "762x54rBullets") then return "762x54rBox"
elseif (bullets == "3006Bullets") then return "3006Box"
elseif (bullets == "50BMGBullets") then return "50BMGBox"

elseif (bullets == "Nails") then return "NailsBox" -- For Nailgun Mod
end

Is anything missing here?
< >
Showing 1-8 of 8 comments
CoolSensei 14 Aug, 2021 @ 2:16pm 
It would be amazing if this problem gets sorted. Don't know anything about code but if i can help by testing anything in-game, let me know.

Things i know that are broken:
1) Weapons that use a magazine make Superb Survivors get stuck in an infinite loop of removing magazine->Inserting magazine->remove magazine. I guess they check for available bullets, find none and then put the magazine back on. It works if you give them a fully loaded magazine and they shoot until its empty and then they swap to melee or do the infinite reload again.

2)Superb Survivors are not able to use/open ammo boxes from the Gunfighter/Britas. Giving them single bullets/ammo works, but is such a tedious process that its not really feasible to arm your survivors with loads of bullets.

From personal experience, since they are able to correctly use bullets from invetory then the only real problem lies with them not being able to utilize ammo boxes.
SlightlyMadman  [developer] 15 Aug, 2021 @ 7:47am 
The context menu command to offer them a box of the correct ammo type shows up properly, right? That would mean the above code is working and it's correctly figuring out the boxed ammo type, and the problem must be somewhere else.
SlightlyMadman  [developer] 15 Aug, 2021 @ 7:51am 
Do they say "Opening Box of 9mm" (or whatever ammo)?
infinet 16 Aug, 2021 @ 11:30am 
How can one give survivors magazines? Iam only able to give them Ammo Rounds or Ammo Boxes.

I noticed:

1.) If an ammo box is in the inventory of the npc and he empties his mag he will open the box and reload the mag ( no message that he will open the box )

2.) When npc empties the mag & has no ammo rounds / box he automatically switch to melee if melee weapon is in inventory.

3.) If survivor has one bullet in inventory & no ammo box & empties his mag in rifle he will load the one round into his rifle and get stuck into the loop which SodaSopa discribed.
If survivor has 2 bullets he will insert them into the mag and there is no loop.

4.) If the infinite loop happens the npcs generate with every loop a new magazine ( survior just spit about 100+ mags on the ground with the clear inventory order )
EDIT: At this point iam not sure when the dupe happens or how much magazines a survivor has in his inventory since there are about 1000+ mags on the ground now

5.) If you give NPC an empty gun and you offer him an ammo box the npc will not eject the mag and reload it ( he will only do that if you offer him the rounds -> infinite loop)
Last edited by infinet; 16 Aug, 2021 @ 12:06pm
CoolSensei 21 Aug, 2021 @ 2:01pm 
They do not say opening "9mm" ammo because they cant actually interact with ammo boxes, however, if you have given them ammo boxes, they do display in the survivor info/detail tab under what weapon they are using and the ammo type. So the game/mod recognizes that they currently have the ammo box on their inventory, but they are not using it at all.

The only way to give mags to survivors from what i've seen is to give them already on the weapon.
I've also noticed the infinite magazine dupe glitch and not sure whats causing it.
You said your survivors properly open ammo boxes from their inventory and actually reload the weapons?
SlightlyMadman  [developer] 22 Aug, 2021 @ 6:25pm 
Thank you for all the great info, SodaSopa! I've updated the mod and I think this is fixed now.
CoolSensei 23 Aug, 2021 @ 11:03am 
No problem! Glad i could help even a little bit. I deeply appreciate all of you modders that make the games we play x10 more fun! I'll hop in and check if it works first chance i get.
BigDaddy 25 Aug, 2021 @ 11:25am 
In addition, NPC's have issues firing full-auto firearms.
< >
Showing 1-8 of 8 comments
Per page: 1530 50