Project Zomboid

Project Zomboid

Spear Crafting Fix
27 comentarios
Coldsteel 31 JUL 2024 a las 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 JUL 2024 a las 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://steamproxy.com/sharedfiles/filedetails/?id=3300366479
Neidmare  [autor] 31 JUL 2024 a las 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 JUL 2024 a las 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  [autor] 31 JUL 2024 a las 7:09 
@Coldsteel Ah and the other thing is that my code replaces the vanilla method entirely
Neidmare  [autor] 31 JUL 2024 a las 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 JUL 2024 a las 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  [autor] 22 JUN 2024 a las 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 JUN 2024 a las 13:34 
mod dont work
Borris the Conqueror 10 MAY 2024 a las 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 MAY 2024 a las 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  [autor] 1 MAY 2024 a las 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 MAY 2024 a las 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 AGO 2023 a las 15:13 
@Neidmare - I'll stick to your mod then, it seems to work regardless of modded spears while SOBS doesn't.
Neidmare  [autor] 20 AGO 2023 a las 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 JUL 2023 a las 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  [autor] 6 MAY 2023 a las 11:23 
@pzhda'tan Its been a while since I've looked at the code, but theoretically any material should work.
pzhda'tan 6 MAY 2023 a las 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 a las 12:57 
Hi @Neidmare , can I use your code for my Weapon Modifiers mod ?
Nick Name 25 ENE 2023 a las 3:25 
oh yeah nvm i misunderstood
Neidmare  [autor] 24 ENE 2023 a las 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 ENE 2023 a las 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 ENE 2023 a las 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  [autor] 22 ENE 2023 a las 7:07 
@lnicdsxu What doesnt work? The mod?
lnicdsxu 22 ENE 2023 a las 6:10 
i am so sad that it does not work, or the spear will be the best weapon
mw00 20 ENE 2023 a las 3:18 
cant believe that Indie Stone couldnt get someone to fix this in all those years