Project Zomboid

Project Zomboid

Vest + Overalls [ B41 /42 ]
dtoxic 8 Jan, 2023 @ 7:22am
Suggestion
you should avoid using *.txt to change parameters,it will usually lead to conflicts with other mods and load order will be important,instead do it with script execution in *.lua that way you avoid conflicts with other mods that modify the same item,maybe that's why hazmat suit wont work for you

example

local item = ScriptManager.instance:getItem("Boilersuit") ---replace as needed
if item then
item:DoParam("BodyLocation = Dress")
end
Last edited by dtoxic; 8 Jan, 2023 @ 7:25am
< >
Showing 1-15 of 16 comments
assface  [developer] 8 Jan, 2023 @ 8:16am 
Thank you,
im new to this, thats why i dont know how to write a script ^^
ill try this later
dtoxic 8 Jan, 2023 @ 8:44am 
no worries,have fun
assface  [developer] 8 Jan, 2023 @ 10:00am 
hey maybe u can help again, this works fine but its not possible to wear jackets now like previously
how do i allow jackets?
dtoxic 8 Jan, 2023 @ 10:05am 
move your script to media\lua\client folder and name it to something else other then script.lua

FullSuitHead i dont think this will work,but first try moving your script to a proper location and try again

Client Folder is for Singleplayer and those who join a server while Server folder is for both and takes precedence over the client folder
assface  [developer] 8 Jan, 2023 @ 10:23am 
i did change it and now i get an error while starting the game,
hazmat and coveralls with vests works fine but no jackets and no spiffo suit with vest
i also change getItem to getItemTypeForClothingItem wouldnt this change all types from these to be a dress?

`function: vestjumpsuit.lua -- file: vestjumpsuit.lua line # 3 | MOD: Vest + Overalls
java.lang.RuntimeException: Object tried to call nil in vestjumpsuit.lua
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:564)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:510)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:342)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:264)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:392)
at zombie.core.Core.ResetLua(Core.java:4170)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at se.krka.kahlua.integration.expose.caller.MethodCaller.call(MethodCaller.java:62)
at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:198)
at se.krka.kahlua.integration.expose.MultiLuaJavaInvoker.call(MultiLuaJavaInvoker.java:60)
at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
at zombie.ui.UIElement.onMouseUp(UIElement.java:1228)
at zombie.ui.UIElement.onMouseUp(UIElement.java:1183)
at zombie.ui.UIElement.onMouseUp(UIElement.java:1183)
at zombie.ui.UIManager.update(UIManager.java:816)
at zombie.GameWindow.logic(GameWindow.java:262)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:765)
at zombie.GameWindow.run_ez(GameWindow.java:667)
at zombie.GameWindow.mainThread(GameWindow.java:495)
at java.base/java.lang.Thread.run(Unknown Source)
`
assface  [developer] 8 Jan, 2023 @ 10:28am 
ok the stacktrace error is gone but still no jackets and no spiffo suit
dtoxic 8 Jan, 2023 @ 10:37am 
ok let;s get to the basics,first remove everything then,using the example i sent you,all those lines are for 1 item only if for an example 1 item has more variations you have to put them also in new lines...and so on for every item.... let's say "Boilersuit" has 2 variation defined in items_*txt "Boilersuit1" and "boilersuit2" you have to put both so that jackets will work....don know of the top of my head what names are used in "clothing_suits.txt"

Example Prisoner suit has 2 variations so both have to be defined

also i dont think you can use this trick for every clothing clothing item,not sure about that

local item = ScriptManager.instance:getItem("Boilersuit_Prisoner")
if item then
item:DoParam("BodyLocation = Dress")
end
local item = ScriptManager.instance:getItem("Boilersuit_PrisonerKhaki")
if item then
item:DoParam("BodyLocation = Dress")
end
assface  [developer] 8 Jan, 2023 @ 11:08am 
thanks this worked
dtoxic 8 Jan, 2023 @ 11:11am 
There you go,also always keep a backup copy of PZ and only modify and test the one you don't use for gameplay,enable debug mode for that one and off you go into the modding scene

Use a program Winmerge to compare folders and files easily see the differences between similar files,easy to spot errors and so on and above all else use Notepad++ :)

Have fun and happy modding
vsnegupal 21 Feb, 2023 @ 6:07pm 
hey dtoxic don't steal my code BRUH
vsnegupal 21 Feb, 2023 @ 6:08pm 
what a nice Suggestion
dtoxic 22 Feb, 2023 @ 2:38am 
Apologies @vsnegupal i did not steal anything,i have my own code witch is similar to yours...i merely used your code as an example on how it;s done correctly since i was not on my gaming pc and wanted to provide an example quickly and could not access my own scripts...sorry for not mention your mod
vsnegupal 25 Feb, 2023 @ 6:07am 
yea
alice vest + bulletproof vest, when? :GDHard:
assface  [developer] 26 Mar @ 1:38pm 
i think that would look kinda goofy :ws_smileyface:
< >
Showing 1-15 of 16 comments
Per page: 1530 50