Project Zomboid

Project Zomboid

188 ratings
Multi Hit Limiter
2
3
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
173.232 KB
18 May, 2023 @ 6:37pm
20 Jan, 2024 @ 12:57am
7 Change Notes ( view )

Subscribe to download
Multi Hit Limiter

Description
Allows multi hit configuration in sandbox settings. Multi hit can be limited by weapon categories, range, skill level, and allowed or disallowed on a per-item type basis overriding other settings. Additionally, the max hit count of weapons can be capped.

Changes made to items on world load are logged to console.txt. Logging also includes item IDs, which can be useful for adding to the whitelist/blacklists.

Safe to add/remove mid-game. Should be compatible with all mods and multiplayer. Requires weapon multi hit to be enabled in sandbox settings to have any effect; firearms are unaffected.

ATTENTION: JAVA MODDING REQUIRED FOR SHOVE CHANGES!
(Optional)
Due to how multi hit works in Zomboid's Java code, this mod requires manual installation of a Java mod component in order to work properly with changes made to shoving.

If you have used this mod in the past and found it didn't work as well as you expected, this is probably why, as despite the best of my efforts it was impossible to fix this with normal (lua) modding! As such, I've learned how to decompile and recompile the Java code in order to provide a fix and hopefully make sure every part of this mod works as expected.

To install the Java mod provided, you must go to the Steam Workshop mod's folder and find the "zombie" folder, and copy it to your Project Zomboid installation folder. If a more detailed explanation is needed, rather than repeat what others have explained before, I recommend taking a look at the excellent video provided by another author of a different Java mod, Dynamic Body Shape, which shows how it's done (it's the same process for all Java mods).

Note that installing the Java component is optional and only needed for shoving, but it's not required for the changes to weapons to work; there shouldn't be any errors without it installed. See also: caveats.

Default Settings
The default sandbox settings, pictured in the screenshot, are meant to show the minimum this mod can do, and only limit multi hit by weapon range.

The default whitelist setting includes the item type Base.BareHands used by the game for shoving as an example of one way this mod can be configured, as it is possible to e.g disable multi hit on everything except shoving.

The default blacklist setting contains Base.Nightstick, given as a subjective example of a type of item one may potentially want to exclude from having multi hit, due to it being a short blunt weapon with a longer range than one might expect from its appearance (1.2), at least in my opinion. Weapon ranges of vanilla weapons are listed on the PZWiki[pzwiki.net].

Caveats
If you have the mod configured to prevent or cap shove multi hit and notice that you can shove more targets than expected, and you haven't installed the Java mod component, this is unfortunately expected behaviour as it is impossible to fix without Java modding.

In addition, when holding a weapon without multi hit while shove multi hit is on, it may show multiple targets highlighted (if melee highlighting is enabled) as if you could attack them with your weapon too; this is normal and shouldn't actually allow the weapon to hit multiple targets, only shoving.

Note that in multiplayer, if you change sandbox settings after players have already started, there is a vanilla bug[theindiestone.com] not part of this mod that can cause your changes not to take effect for players, because sandbox settings are saved locally and not overwritten properly when changed, requiring players to manually delete map_sand.bin from their server save folder. This isn't a fault of this or any other mod and affects vanilla sandbox settings as well, and is mentioned here for the sake of completeness in case it helps anyone.

Workshop ID: 2977607164
Mod ID: MultiHitLimiter
Popular Discussions View All (1)
1
1 Jun, 2023 @ 12:19pm
Translations
Sowilo
65 Comments
Construct 3 Mar @ 1:00pm 
@sowilo Is this getting updated for b42? sorry if my comment is annoying, but the game is basically unplayable for me without this mod
Harkyun 9 Jan @ 8:35pm 
Please update this
Sheogorath 1 Jan @ 8:50pm 
Please update this mod bro:memento:
Xyrkzes 20 Dec, 2024 @ 8:58pm 
I really hope this mod gets updated because infinite multihit is too strong but fighting more than 2 zombies at once is atrocious without it.
Strelok 15 Aug, 2024 @ 2:51pm 
This mod is necessary to make multi hit more realistic.
cznorton2 31 Jul, 2024 @ 6:01pm 
will this mod get updated
Javaugh 26 Feb, 2024 @ 11:38pm 
Tried it, it works. Remember to enable vanilla setting for multihit on.
aquelarrefox 23 Jan, 2024 @ 12:28pm 
i think a good configuration is set 3 in skill requereriments, turn off spears and a whitelist for vanilla:
Base.GuitarAcoustic,Base.BarBell,Base.BaseballBat,Base.Broom,Base.CanoePadel,Base.CanoePadelX2,Base.GuitarElectricBassBlack,Base.GuitarElectricBassBlue,Base.GuitarElectricBassRed,Base.GuitarElectricBlack,Base.GuitarElectricBlue,Base.GuitarElectricRed,Base.GardenHoe,Base.Golfclub,Base.HockeyStick,Base.IceHockeyStick,Base.Keytar,Base.LaCrosseStick,Base.LeafRake,Base.Plank,Base.Poolcue,Base.Rake,Base.Saxophone,Base.Shovel,Base.Shovel2,Base.SnowShovel,Base.BaseballBatNails,Base.PlankNail,Base.LeadPipe,Base.MetalBar,Base.MetalPipe,Base.PickAxeHandle,Base.PickAxeHandleSpiked,Base.Banjo
is it comma separed in the list like i wrote?
✪ Tax 20 Jan, 2024 @ 4:04am 
Two questions:
1. Does the "range requiered" refer to the minimum range needed to multi-hit-shove, or the maximum range at which a zombies can be multi-hit/shoved?
In other words, with the 1.21 setting, can I multi-X zeds who are basically reaching for my neck already?

2. What setting do I turn on/off to enable multi-shove only and no multihit? I don't see it in the preview menu
nyhr213 19 Jan, 2024 @ 10:58pm 
Hello, @Sowilo can you please add me? I'd like to talk about making the mods compatible, but more importantly about the java fix