Project Zomboid

Project Zomboid

Spear Crafting Fix
27 kommentarer
Coldsteel 31. juli 2024 kl. 17:02 
I don't mean to be rude or anything. I did it as a proof that it's possible and it works. Ideally I'd want you to take the whole thing and put it into your mod, it would reach more people that way. BTW the SOMW part is identical to the normal code, it's just SOMW has an additional separate pair of these functions specifically for spears crafted out of planks.
Coldsteel 31. juli 2024 kl. 15:13 
I didn't use your code, and I didn't override anything. Which is how I'm not having issues with SOMW and WeaponModifiers compatibility.

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3300366479
Neidmare  [ophavsmand] 31. juli 2024 kl. 9:10 
@Coldsteel Sure, feel free to re-use the code. I think the other mod also replaces the original method though, so depending on load order it might not work.
Coldsteel 31. juli 2024 kl. 7:17 
@Neidmare well you can remake it such that it doesn't needs to entirely replace it. Since you overwrite the durability value anyway, you can let the original code finish before running your own.

I'm making mod that fixes a different spear issue and I can always just throw in a fixed version of your code in there too.
Neidmare  [ophavsmand] 31. juli 2024 kl. 7:09 
@Coldsteel Ah and the other thing is that my code replaces the vanilla method entirely
Neidmare  [ophavsmand] 31. juli 2024 kl. 7:04 
@Coldsteel IIRC, the load order of the mods is not fixed. If the other mod gets loaded later, it will overwrite my method.
Coldsteel 31. juli 2024 kl. 6:00 
@Neidmare I haven't looked at your code but this sort of issue is normally remedied by daisy chaining the calls instead of overwriting them.

local originalFunction = Recipe.OnCreate.UpgradeSpear
function Recipe.OnCreate.UpgradeSpear(...)
originalFunction(...)
your_code(...)
end
Neidmare  [ophavsmand] 22. juni 2024 kl. 0:41 
@cortex3973 I had a look at weapon modifiers. We overwrite the same method in the code. Not possible to make them compatible unfortunately.
Rezonaise 21. juni 2024 kl. 13:34 
mod dont work
Borris the Conqueror 10. maj 2024 kl. 17:04 
Cortex is indeed correct, mod doesn't work now and i too have Weapon Modifiers v1.1.3 installed as well
cortex3973 6. maj 2024 kl. 15:25 
@Neidmare Hey, sorry for taking so long to answer, I forgot to check notifications. Following your comment, I did some thorough testing and found the incompatible mod. It is called ‘Weapon Modifiers v1.1.3’. The load order is irrelevant; while that mod keeps working, yours stops. Sadly, it is one of my favorite mods, as is your mod. Please consider making a patch for it if possible.
Neidmare  [ophavsmand] 1. maj 2024 kl. 10:47 
@cortex3973 Just tested it myself, works. Spear has full durability.

Can you double check that the mod is enabled? When you add it to an existing savegame, you have to go though Load Game -> Click savegame -> Bottom right 'more' -> top left 'choose mods'
cortex3973 1. maj 2024 kl. 10:40 
doesn't work, i crafted a spear with brand new screw driver and new spear and the durability was about 40%
Kras 20. aug. 2023 kl. 15:13 
@Neidmare - I'll stick to your mod then, it seems to work regardless of modded spears while SOBS doesn't.
Neidmare  [ophavsmand] 20. aug. 2023 kl. 13:09 
@Kras I dont think so. We overwrite the same basegame methods.
The issue that this mod fixes might not be present with SOBS, have not tried it tho.
Night Fox 8. juli 2023 kl. 20:20 
In the base game when you reclaim a broken item from a spear the spear has full durability still but this mod changes that
Neidmare  [ophavsmand] 6. maj 2023 kl. 11:23 
@pzhda'tan Its been a while since I've looked at the code, but theoretically any material should work.
pzhda'tan 6. maj 2023 kl. 9:06 
"It should work with all other mods that add spears with attachments, as long as they are using the same methods as the base game."
Does this imply only duct taped attachments from other mods are compatible? Or leather strip/twine/rope also works?
Champy 13. mar. 2023 kl. 12:57 
Hi @Neidmare , can I use your code for my Weapon Modifiers mod ?
Nick Name 25. jan. 2023 kl. 3:25 
oh yeah nvm i misunderstood
Neidmare  [ophavsmand] 24. jan. 2023 kl. 14:28 
@Nick Name When you craft a spear from a plank or branch, the durability of the crafted spear depends on your carpentry skill.

When you attach a weapon to that spear, the durability only depends on the durability of the used materials, i.e. the weapon and the spear.
Nick Name 24. jan. 2023 kl. 13:56 
Ok just to clear this up, the final durability depends on your own carpentry skill. it is very possible to get a max durability spear. you'll just need to raise your carpentry a bit
MyNameis_Mati 24. jan. 2023 kl. 7:52 
@Neidmare hello, i sent you a friend request, can you accept it? I can ask you something about LUA for a mod of mine
Neidmare  [ophavsmand] 22. jan. 2023 kl. 7:07 
@lnicdsxu What doesnt work? The mod?
lnicdsxu 22. jan. 2023 kl. 6:10 
i am so sad that it does not work, or the spear will be the best weapon
mw00 20. jan. 2023 kl. 3:18 
cant believe that Indie Stone couldnt get someone to fix this in all those years