#mod_development
1 messages · Page 284 of 1
no
Not even for manual downloads ?
for manual downloads yeah i guess
LOG : General f:12649, t:1735541356597> -----------------------------------------
STACK TRACE
function: doLiteratureMenu -- file: ISInventoryPaneContextMenu.lua line # 1005 | Vanilla
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 738 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1459 | Vanilla
ERROR: General f:12649, t:1735541356598> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: attempted index: perk of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).
I get this error and cant read skill books
i'm not really keeping the main umbrella repo up to date at the moment
Also could you write a small description of Umbrella please ?
That's fine, I'll specify it's for manual download
anyone knows how to set up an entity?
I have
entity Metalworkbench
{
component UiConfig
{
xuiSkin = default,
entityStyle = ES_Metalworkbench,
DisplayName = Metal Workbench,
uiEnabled = true,
}
component CraftBench
{
Recipes = MetalWorkbench,
}
component SpriteConfig
{
face S
{
layer
{
row = crafted_02_0 crafted_02_1,
}
}
face E
{
layer
{
row = crafted_02_3,
row = crafted_02_2,
}
}
}
component CraftRecipe
{
timedAction = BuildWoodenStructureMedium,
time = 150,
tags = Blacksmithing,
inputs
{
item 1 [Base.BenchAnvil],
item 1 [Base.CrudeBenchVise],
item 1 tags[Hammer] mode:keep flags[MayDegradeLight],
item 1 tags[Saw] mode:keep flags[MayDegradeLight;Prop1],
item 6 [Base.Plank] flags[Prop2],
item 20 [Base.Nails],
}
}
}
Hiya, may I ask where you can find the values for getTextureName()?
but appears in miscellaneous and display name not working
Should be the files directly I believe
Where should I be looking? Trying to find a placed world object. Specifically the wall vault.
In the game files > ProjectZomboid > media > textures
Should be that
Thanks
Some texture files like icons are in texturespacks (.pack) however
What's the wall vault ?
That's a tile
So that's not going to be how you access it
afaik all tiles are in texture packs
And I doubt you can do getTextureName()
hey lads, ive got a question, im working on a map and i would like for canned foods and different items to spawn in certain counters on the map, does anyone know how to set this up?
holy crap, this got actve all of a sudden
This thing. Oh? What should I be using? getTextureName() worked for mailboxes in an example I'd seen (obj:getTextureName() == "street_decoration_01_11")
Umbrella is a collection of Lua type stubs for Project Zomboid's modding API. It tells your IDE about Zomboid's classes and functions in order to provide autocomplete and type checking. It can be used with any IDE that supports LuaCATS annotations, but is primarily designed for VSCode's Lua plugin.
Thank you !
New page about VSCode and notably Umbrella
Hey. So I am making a TV broadcast and I want a section to level up tracking or butchering (the new skills) where can I find the three letter code for them?
For example; Carpentry is CRP in the xml for the radio/TV
C:\Games\Steam\steamapps\common\ProjectZomboid\media\lua\client\RadioCom\ISRadioInteractions.lua
actually, new ones aren't here. you will need to add them to the table
Can we already make maps for B42 or do we need to wait for tilezed and worlded to get updated
@umbral raptor only a few of the new ones are defined such as
Interactions.POT = function(_player, _amount) doSkill(_player, _amount, getText("IGUI_perks_Pottery"), Perks.Pottery); end
Interactions.FKN = function(_player, _amount) doSkill(_player, _amount, getText("IGUI_perks_FlintKnapping"), Perks.FlintKnapping); end
Interactions.CRV = function(_player, _amount) doSkill(_player, _amount, getText("IGUI_perks_Carving"), Perks.Carving); end
You can start porting your map if you get a copy of the b42 tools. Theres a github wiith the source that you need to compile yourself
oh alr
no official tools are out yet
thanks for informing me 
Any good modding videos to watch to help with development?
Not really, however check the wiki page about Modding
ok ty. I know a good amount about lua so shouldnt be to bad
@crystal canyon Always nice to read chat history and see links to works.
what did I linK? Ive linked many things :v
Umbrella
Ah yeah 😄
thank you and thank albion!
@bronze yoke Did the silly events
:D
We all didn't know when 42 would come out but some projects prepared for that back as far as 2022.
Found this in the item definitions... I need to try a BOHEMOTH DETONATOR WARHAMMER run now.
Where can I find this info? Is there none for butchering?
look a bit further up on the messages. I left the file name that has that info
-- ["GloveBox"]
table.insert(VehicleDistributions["GloveBox"].items, "YOUR GLASSES");
table.insert(VehicleDistributions["GloveBox"].items, 0.1); <--- Your Chance
I got it, tyvm!
on to my fourth mod update of the day

b42 is cool
im not looking forward to trying to update the stuart little mod especially with the state the crafting system is in
yeah, I hope they iron it out quick. That was one of the most anticipated features other than basements
You might be able to add butchering using an event
Events.OnGameBoot.Add(function()
if Interactions then
Interactions.BUT = function(_player, _amount)
doSkill(_player, _amount, getText("IGUI_perks_Butchering"), Perks.Butchering)
end
else
print("Interactions table is not accessible.")
end
end)
the original event also runs on game boot
Events.OnGameBoot.Add(function() ISRadioInteractions:getInstance(); end);
Speaking of butchering, I found out why deer are so hard to find - they are TINY!
5 to 7 encumbrance per deer.
hahahaha
https://steamcommunity.com/sharedfiles/filedetails/?id=3343809645
this mod kinda had more realistic weights and yields than the B42 basegame
That's me hola
Average Kentucky deer
It has a more up to date version too
Can't drink from a bucket of blood like a savage
too big to drink?
Should let you drink but also cover your clothes in blood
thatd be cool lol
That's the more up to date mod
if college boys can guzzle beer kegs i should be able to pour blood into my mouth from a bucket like a frat-vampire
We know hunting/trapping is on the to-be-fixed list for B42, so it's not worth modding now unless it's a very easy mod.
Blood for the Blood GOD!!
Loved that mod, sneaking around the forest and shooting at everything that popped in my screen
Blood for the blood god! ...but not from a bucket, fancy glassware only.
Deer hunting in B42 is probably the only place where a rifle with scope makes sense... using a shotgun (even a +50% range one) made it very hard to get close enough to shoot.
Also, deer hunting looks near impossible to find deer unless you use the "show animal tracks" debug feature on the map... otherwise you just wander all over kentucky hoping to find a spawn location.
Right now I'm trying to modify a cistern trailer to have the new fluid container function
Finally, a way to handle bulk coffee deliveries
yeah lol
Deer spawns around here
And here
This is how I found where to look:
Those I found during normal gameplay
I found one in a sideroad just off the highway between Rosewood and echo creek, while grabbing a trailer from a crashed vehicle.
It startled and ran off... but that means that there is a deer spawning "circle" there
But that's a long way to go, and dense forest makes it had to get close enough to shoot
how can I delete vehicles in debug mode?
hmmm, it sorta works
but cant interact with it as a fluid container. I might be missing something
Fluid system feels half-done, that won't be helping.
Nice!
and is craftable
One step closer to DIY biodiesel!
yup
And the ultimate in redneck cocktails.
can I mutate a tile with a right click interaction?
great! My whole country has a general blackout.
I'm sure this has been asked a million times, but why won't my custom map show up in the spawn locations list? it's enabled in the mod menu and i followed all the steps and troubleshot for hours to no avail.
is it a custom location or a custom spawn map? B42?
@crystal canyon custom location, b42
i've tried with my own and custom maps i found online, none show up
copied the folder structure from daddy dirkie, modified for b42
put the maps folder in common
there seems to be an issue where it doesnt want to load maps from 42
common/media/maps
😄
Why "common" exists? Why not to put everything in 42? What is the idea?
For version control. Normally used for things like assets which are used across all versions
Definitely will be handy when B43 comes out
It probably won't see much use at the moment cause B41 doesn't use it, but in theory if you had 20 builds the common folder prevents duplication of assets which in turn would reduce your mod size
If you imagine a mod that support B42, B42.03, B42.1 and B43 having all your models and files that don't change in common saves a lot of duplication, you just need to put the files that need updating in the other folders.
Plus it's easier to manage - if you change a model you update it one place, not five.
Idea I just had: since animals have static spawn locations, we can mod in maps to find like this to give hunting locations.
...but after the hunting/trapping update since I'm don't want to spend hours making a list of locations and then find the whole system changed.
(that's a real hunting spot too, easy to get a shot in if the deer are on the road)
I'm a vegetarian in B42, I can never catch the things. Takes about 7 bullets to kill a pig
I think the dev's need to make animals weaker imo
or a mod to do it
is there a way to add an evolvedrecipe through lua?
shotgun for zombies and a .308 rifle with 8x scope for hunting
setting recipes for an item using :DoParam() doesn't work
I'd guess start here: https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/scripting/objects/EvolvedRecipe.html
declaration: package: zombie.scripting.objects, class: EvolvedRecipe
(link is for B42)
lots of get methods but I don't see a lot of set
yeah that's what i'm talking about
Won't work, spawns are different on different playthroughs.
anybody have any ideas on what to do about the game not loading a lua file? i've got three files in the proper folder structure, one main file (working fine) and the other two are "included" using the require function. one of the "included" files loads and works fine, but the other one does not show up in the Lua debugger in game
CRLF is funny, solved
but dont they have potential spawn locations even if the actual spawns differ by map? or does that mean that they can spawn in ANY forest area?
No idea, probably the former - set locatiosn but no every one will be active every game.
Might be able to do sometying programatically with https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/animals/AnimalZones.html
declaration: package: zombie.characters.animals, class: AnimalZones
anyone know how can I use a tile as a UI icon?
Make a copy of it with the name for the UI thingy?
I am trying to bring back biofuel mod from b41 by another modder for self-use. I know that this patch introduced new liquid system.
In the old mod, it required 25 units of water like so
recipe Make Biofuel From Potatos
{
Potato = 20,
Water = 25,
CanBeDoneFromFloor:true,
destroy EmptyPetrolCan,
Category:Cooking,
SkillRequired:Cooking=6,
Result:PetrolCan,
Time:1000.0,
}
I am trying to add water to the recipe like so
craftRecipe Make Biofuel From Cabbages
{
timedAction = MakingElectrical,
time = 80,
category = Cooking,
needToBeLearn = true,
autoLearn = Cooking:6,
skillRequired = Cooking:6,
tags = AnySurfaceCraft,
inputs {
item 20 tags[Cabbage],
item 25 tags[Water],
}
Would this work or is there any other way to use water object? Thank you
Please ignore timedAction = MakingElectrical as I will change it later to proper value
Ok it seems everything that I did was wrong but I checked other modders' work and corrected the script
module Base
{
craftRecipe Make Biofuel From Tomato{
timedAction = MixingBucket,
time = 80,
tags = AnySurfaceCraft,
category = Cooking,
skillRequired = Cooking:6,
OnCreate = Recipe.OnCreate.GetBottle,
inputs {
item 1 [Base.PetrolCan] flags[IsEmpty] mode:destroy,
item 1 [25:Base.Tomato],
item 1 [*],
-fluid 25.0 [Water],
}
outputs{
item 1 Base.PetrolCan,
}
}
}
now my issue is to get 25 liters of water. I already built a rainwater collector and filled it 30 liters of water. When I am next to it, it does not recognize, I think I need something looks for water sources nearby. Any ideas please? Thank you
Fluid system isn’t fully integrated yet
Oh I see 😦
Well I guess the workaround would be to set the water amount equal to something that can be used like 10 liter or 15 liter and now the recipe seems to work
yea that could work also. I am n00b when it comes to modding, any idea how I would do it?
also one thing I noticed is that even though there mode:destroy, my original empty petrolcan is not destroyed. Any idea why that might be?
module Base
{
craftRecipe Make Biofuel From Tomato{
timedAction = MixingBucket,
time = 80,
tags = AnySurfaceCraft,
category = Cooking,
skillRequired = Cooking:6,
OnCreate = Recipe.OnCreate.GetBottle,
inputs {
item 1 [Base.PetrolCan] flags[IsEmpty] mode:destroy,
item 1 [25:Base.Tomato],
item 1 [*],
-fluid 10.0 [Water],
}
outputs{
item 1 Base.PetrolCan,
}
}
}
My model uses a custom clothing location, and its position looks odd after equipping it. How can I adjust its position?
It’s a belt, and I want to keep the custom clothing position.
Hey @old ginkgo , have you found a solution? I am having the same issue
Is it weighted, or did you parent it with XML file to one of bones?
I'm trying to upgrade someone else's mod to B42, but I don't know if the author set it up. It worked fine in B41.
If it has weighted, how can I check?
Open xml file of clothing item
Nope, thats not it, it should be in media>clothing>clothinitems>thatitems xml file, Its name should be on item script " ClothingItem = SteamGirlHat," for example
Thats the one
It seems it's weighted, then you need to use blender to repositon it.
How do I use Blender? 
But being serious, It would take me a while to explain. If you never used blender, first get a basic knowledge before you try it. Watch some tutorials on basics + weight painting
Sorry, I'm still starting from scratch to study the code of this game.
I will take a look, thank you!
Guys I found why mode:destroy does not work!!
module Base
{
craftRecipe Make Biofuel From Tomato{
timedAction = MixingBucket,
time = 80,
tags = AnySurfaceCraft,
category = Cooking,
skillRequired = Cooking:6,
OnCreate = Recipe.OnCreate.GetBottle,
inputs {
item 1 [Base.PetrolCan] flags[IsEmpty] mode:destroy itemcount,
item 1 [25:Base.Tomato],
item 1 [*],
-fluid 10.0 [Water],
}
outputs{
item 1 Base.PetrolCan,
}
}
}
Basically from what I gathered, if you are using objects like battery, candle, propane lantern or pack of stuff (back of beer) you need to use itemcount next to mode:destroy and it destroys the item.
@old ginkgoIf you are still looking for solution please see my reply above, I do not know why we need it or what it does but it works 😄
Hey all, as my day job I program in C++ (used in UE5) but have never touched Lua before, any reccomended learning sources before I randomly pick one? Or just the modding section of the wiki I suppose?
Hi it is me again. Sorry for spamming here but now my issue is that I can still use full petrol can in my recipe even though the flag is set to isEmpty. Any idea why that might be? Thank you
Edit:
Found the solution. If you are using a fluidContainer and if it is in Input in a recipe it also needs to have a flag of ItemisFluid;IsEmpty and that fixes the issue. Actually there is a example_recipe in the game folder that explains recipes quite well. The location of the file is Steam\steamapps\common\ProjectZomboid\media\scripts\entities and the name is dbg_example_recipes
How can I get a radius action to play audio on use? a dance for example
Interesting! My issue was I was using a fluid container; and thus I went ahead and wrote my own recipe oncreate function to destroy it once my recipe was done. But good to know!
Yea that is a good way to do it as well. Glad that you figured it out 🙂
I suggest taking look at this file from that exists in original game folders. It explains new crafting recipe system well. That is how I learnt
https://steamcommunity.com/sharedfiles/filedetails/?id=3396981014
I got everything working locally functionality wise, uploaded to workshop, now it won't show in the mods list. i've compared mod.info to a load of other mods and can't see any reason why it wouldn't show
Is my bet
My bet is you did a mistake for the folder structure, as it's not the same as B41
This is my folder structure
i've thrown mod.info and poster.png everywhere as a test. it should only be in the 42 folder for fresh downloads
Can you show the folders above mods ?
That's just C:\Games\Steam\steamapps\workshop\content\108600\3396981014
BTW just in case I'm asking, do you have same mod ID both workshop folder and 3396981014?
i've removed it from the workshop folder just in case there was a conflict
I will download your mod and let me see if it's problem for me too.
thx
ah didn't realise that was still needed when it was version specific
yep it can be empty but it should be existed
Really ?
I've uploaded two mods already and they both needed common folder even i didn't put anything inside of folder.
so i guess
You are right, it's mandatory, I updated the wiki about it
sighs
spending 5 minutes resorting the files so they were actually organised per what needed to be version specific would have saved me about 2 hours faffing with this
you should come here earlier XD
i dunno, i had fun this morning porting the mod in the first place. first time playing with PZ modding, had to learn the old vs new way of recipes, translate the old ones, then track down why the functionality wasn't working, which was also my first play with LUA
actually pretty fun
then you have a potential to be a modder
it's same to me, always with pain but acutally, it's fun
I've always been a hacky scripter. have problem, find code that does something similar to what i want, hit the keyboard with my face until it does what i want
I suggest you check out https://pzwiki.net/wiki/Modding
I was digging around there a bit 🙂
👌
It's only been a viable page since I reworked it
So trying to push people to check the wiki more now that it's actually useful for modding
Still getting an error, but it's from the server-side LUA, which is currently irrelevant. i don't even know what that code is doing...
doesn't effect the SP functionality, so I'm just gonna go stove some zombie heads in for now
What's the error ?
Can't find any relevant error in there ?
bottom of the full page
function Drops(Item,SpawnMod,Table,Value)
if Round2(Value*SpawnMod) > 0 then
for i,v in pairs(Item) do
for i2,v2 in pairs(Table) do
table.insert(ProceduralDistributions.list[v2].items, v);
table.insert(ProceduralDistributions.list[v2].items, Round2(Value*SpawnMod));
end
end
end
end
items return nil
i've had a lot of things that used to return objects return nil; that was what i had to fix with thread consumption
i've no idea what that function does. without reverse engineering the whole code...i'll just ask the original author 🙂
when are containers populated with loot? cell load or first viewed?
when the chunk is loaded
how to fix items appearing gigantic when dropped on the ground? I saw the same happen in some mods from the workshop
I assumed reducing the scale in models_items.txt would work but it seem to be doing nothing
Why people keep asking for new features for a mod that is just basically a bug fix until stuff changes in the unstable
because people
same reason some ungrateful fuck was bitching about there being no animations in the bag throw mod, and telling the author that it's their problem
Is Dragging modified by fitness or strength? I can't seem to find where in the code it is
Thank you everybody. I finally published my first small mod to the workshop thanks to the info that I got from here 🙂
which mod are you referring to?
Just my simple fix for cleaning rags at the sink until it's all integrated
hey, where can you find the folder to change the lighting color for objects like streetlights? and what do you do from there?
Anybody know the new crafting system enough to assist me with a question.
I later realized that Blender refers to the software. I thought it was a property of the model.

My English is so bad that I didn't recognize what it was at first.
How would I go about connecting recipes between mods? So that Mod 1 has the recipe with an itemMapper and Mod 2 would only need to make an itemMapper that would be able to be used in the recipe from Mod 1?
If I understand the question then you could create a recipe with an identical name and the game would merge them. Unfortunately there's not a way to override recipes that I've found yet. Not sure I understood the question though.
I've tried that and it just creates multiple recipes with the same name
It is now 6:22PM the whole country is still in a general blackout. What a great fucking way to say good bye to 2024 and welcome 2025
if I add a clothing item to the lists of procedural loot distribution, do zombies start spawning with said item or do I have to do something else?
They added so many QoL with crafting but making that possible would be the biggest change
they start spawning with them
as long as it is configured correctly
alright, thank you
I did write a suggestion post about that idea but so far it's been ignored to my knowledge

how do you make it so that a created clothing is able to be used in character creation?
You have insert it into tables in lua>shared>definitions>ClothingSelectionDefinitions
Though you have to insert them in lua through separate file, because if you copy same thing, you will override it.
ooh so i'd have to do some table.insert stuff
yes
I just did that today, you might check out my new mod that does it.
https://steamcommunity.com/sharedfiles/filedetails/?id=3397182976 (shameless insert)
Yeah I saw that! and i was wondering how ya did it
Thank you
There is only one lua file there in shared, hard to miss it
I think you can pretty much reuse it.
I would appreciate checking out mod too 
ofcourse, i already gave it the like. I suppose i can award it too :)
No need, but i would for sure love for people to use it(the mod)
yay power back on!!!!
subscribed
B42 took out sweater/jackets for clothing selection. I don't want to define it on my mod in case they reimplement it. :(
is there anyway to reuse textures that already in game without making hardcoded path?
I need to get moodles icons and if new will be added it will get path too
haven't found anything that does this on modding wiki like getTexturePath
maybe getSharedTexture is what i searching?
You mean without making a copy of the texture in your mod with a different name?
i'd like to reuse them but even making a copy is good
That's what I've done, but when you're talking about two tiny icons it's not a big deal.
i mean i need all moodles icons
Just make your own copies, they won't use much space.
A lot of the texture stuff seems tied to object names, bu I will be honest I've not looked into overriding that
i mean i don't need to copy them all i need it's to get their path like on screenshot but i though there was more clever way to get their path without hardcoding it
i know for sure there same textures in MoodlesUI
Doesnt look like the moodle objects have any way to get the texture: https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/Moodles/package-summary.html
declaration: package: zombie.characters.Moodles
it's not Moodles it's MoodlesUI
declaration: package: zombie.ui, class: MoodlesUI
moodles are extremely hardcoded, don't expect anything like this
dawg
Can you get the texture path if you give a name?
most moodle methods are just giant switch statements lol
returning nil
Bianca mod does add custom slots for it
you could get the list of all moodle and then if the texture names (not paths) match...
Just hardcode the paths and worry about in in B43
iirc at least in b41 they were not actually consistently named
the problem is their name and texture is different
Hypothermia = Status_TemperatureLow
Endurance = Status_DifficultyBreathing
anyway i think i should then just remain hardcoded paths
i just wouldn't worry about it, they don't add new moodles often at all and it doesn't seem like it would be that much work to update if they did
At least they are all in english - it's fun modding a game and finding half the internal objects use spanish names.
That was the least of the issues modding Traveller's Rest, but at least it was in C#/Unity instead of half java blackbox
It's amazing Zomboid does so well with modding when so much is effectively locked out of being modded.
oh wait
local testtest = MoodlesUI.minusGreen
and it got texture
aand it doesn't work on other only on
minusGreen
minusRed
plusGreen
plusRed
only public static fields are exposed
where do lua files go, non vanilla ones that is
obv in lua but do they need to be in any of the subfolders
they must be in client, shared or server
dawg they even removed DefaultMoodles() where was listed all moodles textures as public Texture
has anyone used the attachment editor in the new build?
which makes the tool unsable at that point, breaks the UI
I’ve used it to pretty good success. Not at my PC so I can’t see the text doc what seems to be happening?
(I am trying to fix this orientation issue)
then the UI breaks when I get a player model in, then I can't assign a parent for the individual models
How can I make my mod appear on the 42 build? It doesn't appear on the list when I set the game to the unstable version
Why isn't this working? I'm trying to make TV broadcasts increase the new skills
There's a pinned comment with proper info, and my quick-and-dirty reddit guide:
https://www.reddit.com/r/projectzomboid/comments/1hgwccl/if_there_is_a_mod_you_absolutely_cant_live/
I'm just learning how to create models but I had to revert to 41 to be able to test it
if i want to change the definitions of a tile can i not just use this
TileDefinitions["xxxxxxxxx"] = {
xxxxxxx
}```
@old ginkgo Is there a way to extend/widen the whole sidebar? All my names are cut off. Not really liking this change
If I understood correctly, I need to move what was inside "media" to "42", is that right?
no, you move everything into 42
or copy, if you want the mod to still work in B41
eg: top level folder, has files left there for B41
42 and common have files for B42:
(you can shove it all into 42, using common is not realy helpful yet but will be once more versions of teh game need more mod changes)
You need at least poster into 42, rest can be in common
B41 will look in the top level, B42 will look in common, 42, 42.0, and 42.0.2 and use the most specific version of a file it finds.
42 can be empty, but then your mod will not have poster image when you go to mod manager ingame to select your mod.
I think map mods are also fussy and need some things to be in either 42 or common specifically...
things like that are bugs and might get fixed, but easy to work arond for now.
The only thing I wasn't able to do so far was the icon, I placed it at /textures/
I need to check the poster thing for my mods... I might need to redo that for the B42 versions. Not a big deal, but I've not aactualy checked to confirm teh poster shows on the mod selection screen.
I see why people are saying the second amendment store has too many zombies... this is just stopping near the entry.
Some idiot shot up my car with a shotgun while I was dealing with the horde!
so they really broke their own tool huh?
fml
left image is from 41, right is 42. The sidebar is jacked. No mods enabled.
Did you ever have any luck with this? I'm trying the same thing now specifically for B42 so I can aim guns on steam deck
Hello and Happy New Year!
Sorry to ask a very rudimentary question, but is it correct that Global ModData in multiplayer is shared on a per-client basis, so that if multiple clients (=people) are participating in MP, it is not shared between clients, but by multiple players within that client?
Or, in multiplayer, is Global ModData shared by all clients (all characters)?
global mod data is separate for each client and the server
local ui = EditAttachment:new(UI_BORDER_SPACING+1, UI_BORDER_SPACING+1, getTextManager():MeasureStringX(UIFont.Small, getText("IGUI_AttachmentEditor_RemoveFromScene"))+20, self.height - 100, self) --widest button in the panel is "REMOVE FROM SCENE"
why did they do this?
Thank you for your prompt response.
I was using this data as per-client data, but I suddenly had a question.
And I asked the question because I could not confirm it in multiplayer because I am developing a mod for B42.
Thanks, that's a relief!
If you use someone's code with their permission to create a new mod, are they able to retroactively take away that permission and DMCA you?
no
unless they specifically reserved the right to take away your permission it's indefinite
yep heres the change
Ah, alright
It makes no sense why they made it so narrow
oh my god I can FINALLY read all the data
What's that, an animator?
Got so much on the workshop side I got to do until I can finally update my mod with new hoodies and sweaters 
Happy new year from the middle of the atlantic!!
Really wish the PZ community would use CC licensing
spawns in build 42 are broken. Nobody will change my mind
remote cabins in the middle of the woods with hundreds of zombies?? give me a break!
Technically they are working, just with bad data
Overall I like it more than B41 with super crowded highways
that part Im happy with
Guys, Someone knows why i can't call function like screen shot?
function: console -- file: MyCar.lua line # 1 | MOD: Did I Have A Car?
LOG : General f:2585, t:1735709280760> Object tried to call nil in console
so the console don't wanna call my function?
type print(ZombRand(5)) is fine
type myCarDebug() returns error
actually, all functions inside of MyCar.lua returns same error when i tried to call.
i dont believe so
Is it possible to override a timed actions lua?
Without just completely replacing it in whatever calls it
try
getTexture()
sorry, forgot to specify, its for a script, not a lua function
show us the functions code
it depends on the actions code, when its triggered, and what your goals are
its best to avoid overwrite and go for hooks or clone the action
This is it, btw I created a new lua file with exactly same codes and it's working.
stupidly odd.
Unfortunately, it seems the grabbing corpses is deeply nested and would be even messier to try and change it.
I'm trying to get the dragging of corpses endurance costs to modified by Strength
But it looks like the Lua doesn't seem to change how much endurance is used, just how much calories you are burning
where did you get ZombRandBetween?7
also why is myCar global?
but if its working for you then great
gj
ofc myCar was local but i changed to them as global to see if it's working
ZombRandBetween is just there, in PZ
i just uploaded immediately what i was doing..
declaration: package: zombie.Lua, class: LuaManager, class: GlobalObject
i see
Can I get a fresh set of eyes and tell me what could be going on with this panel?
I'm getting error:
Callframe at: getComponent
function: render -- file: ISFluidBarrelPanel.lua line # 67 | MOD: Storage Barrels
Used ISEntityWindow.lua as base/inspiration
It's not liking your loop
print("Debug: Listing components attached to the entity:")
for i = 0, self.entity:componentSize() - 1 do
local component = self.entity:getComponentForIndex(i)
print("Component #" .. i .. ": " .. tostring(component:getComponentType()))
end```
Not sure if I need to call this one
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/entity/GameEntity.html#getComponent(zombie.entity.ComponentType)
declaration: package: zombie.entity, class: GameEntity
declaration: package: zombie.entity, class: Component
it is on an entity
found some interesting stuff
bot sure if these are old tho
google auth for servers? interesting
Hey, can anyone check if b42's hoodie hood not showing for anyone else? It not showing for me when I have no mods and fresh reinstall
Nevermind, i got it showing again. the save got messed up and stopped showing the hoods
@crystal canyon I'm not super familiar with how Lua does stuff, but does the component actually exist? I'm not sure if they could have a null entry in that list you are accessing at local component = self.entity:getComponentForIndex(i)
it does, i had run some debug before and got these components
LOG : Lua f:2230, t:1735651433080> ISXuiSkin -> ISXuiSkin -> could not find style for 'ISFluidBarrelPanel', style = '(default style)'...
LOG : Lua f:2232, t:1735651433105> Entity Components:
LOG : Lua f:2232, t:1735651433105> Component #0: SpriteConfig
LOG : Lua f:2232, t:1735651433106> Component #1: UiConfig
LOG : Lua f:2232, t:1735651433106> Component #2: FluidContainer
LOG : Lua f:2232, t:1735651433107> Component #3: CraftRecipe
LOG : Lua f:2232, t:1735651433107> Component #4: Script
Causing an error on the print (referencing my above statement)
so FluidContainer IS part of the components of the entity. Thats what i dont understand
I ran this on the code
-- Debug: Log all components on the entity
print("Entity Components:")
for i = 0, self.entity:componentSize() - 1 do
local component = self.entity:getComponentForIndex(i)
print(" Component #" .. i .. ": " .. tostring(component:getComponentType()))
end
So. What are the pitfalls of overwriting base files. I will always try and just expand instead of overwriting, but sometimes, that is impossible.
Other than:
- When IndieStone updates, it might cause crashes/break the mod
- If another mod overwrites it too
if the file is a rarely used file, what other drawbacks does anyone see?
I only see those 2
dying light weapon and clothing pack (i cant believe someone even has to say this) 🙏🏻 please
What's Dying Light? That a game?
do I use perform or stop for an action ending?
When you mean overwrite, are you talking Java or lua code?
If it's Java, those two are the only things I can see that are valid. If it's lua, why not just hook stuff if possible?
they did say "I will always try and just expand instead of overwriting, but sometimes, that is impossible"
Just like this file. Kinda hard for someone inexperienced to add to the Interactions table from an external file because it is local and not global. Someone inexperienced (like me) might just want to overwrite the file completely and add the missing info to the table on the mod
hmm yes stuff like that is impossible to work around without overwriting, but at least make it a global module if you overwrite it
well I guess other mods probably wont need to use it anyway?
yeah, unless another mod really needs that file, youre "safe" lol
maybe adding it on gameboot?
Events.OnGameBoot.Add(function()
if Interactions then
Interactions.BUT = function(_player, _amount)
doSkill(_player, _amount, getText("IGUI_perks_Butchering"), Perks.Butchering)
end
else
print("Interactions table is not accessible.")
end
end)
Interactions is local table too no?
yeah
but Im sure the devs will add the missing perks at some time in the future, so meh. Its not that important
Anyone know the diff between a Vehicle_X model and a Vehicle_X_NoRandom model?
How to find out the class of variable obj?
if obj and obj.getClass then
print("Class of obj:", obj:getClass())
else
would this work?
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/Lua/LuaManager.GlobalObject.html
Theres so much here >.<
declaration: package: zombie.Lua, class: LuaManager, class: GlobalObject
the ones I see here are getClassField getClassFieldVal and getClassFunction
whats the difference between the room defs found within the distro files and the other "empty" room defs. rooms that have a name but nothing associated with them in the files
Thought so too but it seems to Do sadly
Hehehe I just thought of something fun. A bag of devouring. I'll need to bastardise the trash can delete all function, and also add a timer (every hour maybe) so it's useless as a bag. Probably set WR to 0 too. Then I'll need to figure out how to add a right click>feed corpse option.
Allow it in a fanny pack slot, and you've got a portable trash can and corpse disposal. Short timed action and upper body fatigue from wrestling the corpse in. Yeah think that'll work.
Does it do anything or does it just eat corpses
How expensive is pcall()?
Eating corpses is main function I think, portable trash can secondary but that's niche as there's nothing stopping you from just dropping shit you don't want.
I find decorpsing areas tedious.
I guess it has more use now with the corpse sickness having a stronger effect
I think having more corpses in an area deteriorates respirator filters quicker too
Trying to get into second amendment, and with this many corpses on the floor my brand new filters died after less than an hour.
I'd consider it a mini cheat
RIP
F
Related: shooting through chain link fences is very janky
Happy new year everyone! 🥳
Does "addFluid" not work for modded fluids?
oh my god, 30 minutes down the drain and I realize I was trying to add it to the item itself and not the fluid container
😮
it doesn't even work so it doesn't really matter
it can't actually prevent errors
the only time it works is pcall(error) lol
in standard implementation lua it isn't terribly expensive so i'd probably expect it to be similar
is it possible to have B41 and B42 installed at the same time?
I do have them, with a caveat
I own PZ in both GOG and Steam. GOG version is in B41, steam B42
but i can't upload mods with the GOG Version or can i ?
its annoying that when uploading a mod from B41 it doesn't allow the B42 Tag
If I were in that situation, I would test the mod in b41 on the gog version, edit the mod, test again, etc then upload it using the steam version. Its weird because both versions of the game share the same data folder
so gotta be careful when loading saves. Alternatively you can specify a different folder using a startup option
any mods for dogs, cats and any other animal out yet?
It works
pcall(function()
print(x.x.x)
end);
print(123);
prints 123
It does not prevent red errors but it's ok because you can always mark your code as bad and drop till end of the game.
local is_fine = true
.....
if is_fine then
if not pcall(DangerFn) then
is_fine = false
end
end
Hi how do search all the items inside the containers worn? I already know how search my inventory by player:getInventory():getItems() but I don't know how to search for items in my bag, fanny pack, etc
I suggest looking at the code for proximity inventory
That mod looks at everythingin every container and shows it all in one list, so somewhere it will be iterating through all teh possibel containers of stuff
"Recurse" usually means that you search in all packs, bags etc
oh wait, worn container.s.. nevermind.
Turns out it's impossible to shoot a zombie that isn't moving.
Their idle animation makes them invulnerable to gunfire.
Was trying to work out why some of the aiming system jank was happening, and testing with "invisible" on makes it obvious
Is there any way to see if a context menu entry already exists, and if so... add a submenu to it? I am looking to consolidate my mods menus. Here is what I have tried:
function PW:showContext(playerObj, context, worldobjects)
if isAdmin() or isDebugEnabled() then
local mainMenu = nil
-- iterate through all options to try and find the main menu
for _, v in ipairs(context.options or {}) do
if v and v.name == mainName then
mainMenu = v
break
end
end
if not mainMenu then
-- there isn't one so create it
mainMenu = context:addOption(mainName, worldobjects, nil)
end
-- add the submenu
local sub = ISContextMenu:getNew(context)
sub:addOption(subName, worldobjects, function()
local player = playerObj and getSpecificPlayer(playerObj) or getPlayer()
PW.ui.admin.OnOpenPanel(player)
end)
context:addSubMenu(mainMenu, sub)
end
end
For syntax highlighting use ```lua instead of just ```
Is there a way to remove items that are supposed to be consumed in custome recipes, but are not? Made a recipe for emptying sacks of sand, dirt and gravel... but unsurprisingly these sacks are getting copied. Any way to fix that?
I wouldn't bother, that will be fixed in a future update
And how many more years of waiting would that be? xD
Anyway, would still need a way to get rid of them. kinda pain in the ass to travel to closest zombie (corpose) to deposit them.
I expect early next year when they resume work on B42
Has it been said it's something they're working on? That bug has been there for quite while
The duplication seems a lot worse in 42 to me
Well can always hope
Not sure if this will help, but its what I do to remove the training disks from Machines mod once used
local allRecipes = getAllRecipes()
local toRemove = {
["Train Electrical"] = true,
["Train FirstAid"] = true,
["Train MetalWorking"] = true,
["Train Mechanic"] = true,
["Train Tailoring"] = true,
["Train Cooking"] = true,
["Learn Engineering"] = true
}
for i = 0, allRecipes:size() - 1 do
local recipe = allRecipes:get(i)
if recipe:getModule() and recipe:getModule():getName() == "MCH" then
if toRemove[recipe:getName()] then
recipe:setRemoveResultItem(true)
end
end
end
Thanks, I'll give it a try.
Just need to make adjustments to work with recipes that cause items to dupe, or does it work as is for most items?
I suppose it depends on the reason for the dupe. If the recipe has a result property that you don't want, the above will work. If its just a bug, it probably won't
when i set an items' texture with item:getVisual():setTextureChoice(textureChoice), how do i make it reload the visual? Currently i can set the texture, but to get it to actually change, the item must be unequipped and re-equipped
What is currently the proper way to add loot to the tables in a non destructive way?
Before it was something like this as far as i know:
table.insert(ProceduralDistributions["list"]["GunStoreShelf"].items, "BCGRareWeapons.ReinforcedBaseballBat");
table.insert(ProceduralDistributions["list"]["GunStoreShelf"].items, 100.0);
(Talking about B42)
I don't think anything changed about inserting into loot tables.
I'm doing them exacly like in b41 and it works.
Oh i see, thanks.
Then probably the name of the table has changed or something
Could be, when i was doing clothing for general clothing, some wardrobes were changed, but some old ones were marked as equal to new ones, so it in theory should still work.
Ah, Deprecated 😄
local contextoptions = context:getMenuOptionNames()
for k, v in pairs(contextoptions) do
context:removeOptionByName(k)
end```
I do this to remove context options but you can just match k instead
Can someone point me in the direction of the drainable script please ❤️
What Drainable script is that?
B42 drainables are currently bugged and like to drain for no reason when you're not looking.
Yeah i am looking for the lines of code, that "define" what a drainable is
You mean a drainable item?
Yeah, not the delta function tho
All the vanilla items are in C:\Games\Steam\steamapps\common\ProjectZomboid\media\scripts\items
Drainables will have a "UseDelta" parameter
Which is how much gets used per "use" with a full item being 1.0
But where would be the amount's
Like how does the game determine how full a battery is
First , an important thing I think you're missing: when you put a battery in something that battery is gone
no more battery item, instead the item you put it in has it's drain level changed
Ahhhh
So would be causing items to drain on a save reload. The actual main inventory?
A bug in the java code.
Ahh so it's not going to a be a Lua thing then
I saw a fix, but... it was a "download this java file from this random site" and I was not willing to do that
Nah F that
My guess (based on symptoms only, and could be wrong) is something gets screwed up when objects get saved and reloaded.
For now I just play in debug and edit batteries back to full when they should be full.
Yeah i think i may have to do the same, well thank you for the talk, informative.
hey guys how do i get the capacity of an ItemInventory. getItemCapacity and getMaxCapacity all returns -1
What is ItemInventory?
i mean InventoryItem sorry
you mean capacity of a backpack for example ?
Or you mean it's weight ?
yes the capacity of a backpack but its in ItemInventory right now
It's InventoryItem:getCapacity()
If it's a backpack, then it will give a capacity
More specifically, it's a subclass of InventoryItem https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/inventory/types/InventoryContainer.html
declaration: package: zombie.inventory.types, class: InventoryContainer
omg I ddnt know its a subclass. thank you
At the top of the java doc, it tells you which subclass exist for a class
Wow peach got AuthenticZ updated was not really expecting that until stable. (Edit: Nevermind it just has a build 42 tag without being 42...)
How do you have the code detect if a item for example steak is rotten?
food:isRotten()
Happy new year everyone! Where to place the file for the icon of a new item?
in media/textures/ - keep in mind that whatever you give to the item's Icon = property will have Item_ added to the start of it when it looks for the texture
so Icon = MyItem looks for media/textures/Item_MyItem.png
on the topic of textures where are all the icons at? i look it that folder and i see a ton of them but i need to find all of them
specifically food items
most vanilla icons are stored in media/texturepacks/ you can extract them with TileZed from the modding tools (in your steam library if you own the game)
thanks i appreciate it
making a practice mod
adding raisins
I have a question that the tutorial I read didn't mention. How do I make my item appear in the world?
It is working but I want to set it to spawn in certain places
or maybe create a recipe with a magazine
lord this is frustraiting
i cant seem to find an extract option and when i try to open it, it just gives me this
ive tried messing with this pack veiwer but it doesnt seem to do anything related to what i need it to do yet
Is it technically possible to get the "HatCategory" of the Clothing XML files with lua?
I realized that the game turns Mohawk Hairs into mohawk flat if wearing a hat, makes sense to me and i don't want to delete it with fluffy hair. But i would like to make Bandanas and bandages not be affected by it.
I digged a bit but i havent found a reference about "HatCategory" in the lua code.
The Function i am talking about:
function ISWearClothing:complete()
if self:isAlreadyEquipped(self.item) then
return false;
end
-- kludge for knapsack sprayers
if self.item:hasTag("ReplacePrimary") then
if self.character:getPrimaryHandItem() then
self.character:removeFromHands(self.character:getPrimaryHandItem())
end
self.character:setPrimaryHandItem(self.item)
end
if (instanceof(self.item, "InventoryContainer") or self.item:hasTag("Wearable")) and self.item:canBeEquipped() ~= "" then
self.character:removeFromHands(self.item);
self.character:setWornItem(self.item:canBeEquipped(), self.item);
elseif self.item:getCategory() == "Clothing" then
if self.item:getBodyLocation() ~= "" then
self.character:setWornItem(self.item:getBodyLocation(), self.item);
-- here we handle flating the mohawk!
if self.character:getHumanVisual():getHairModel():contains("Mohawk") and (self.item:getBodyLocation() == "Hat" or self.item:getBodyLocation() == "FullHat") then
self.character:getHumanVisual():setHairModel("MohawkFlat");
self.character:resetModel();
end
end
end
return true;
end
found it. leaving intructions here for those who need it. To open .pack files install the mod manager open tilzed, open tilezed. in the bar up above go to tools>.pack files>packveiwer. On top the bar of packveiwer is the file button and its easy to figure it out from there!
Why PZ be renaming stuff...BedroomSideTable -> BedroomSidetable 
Hiya, what's the appropriate way to reference a newly created item or modify its values?
For example, the following code just uses the default values of result rather than the modified ones when adding extra to the player inventory.
fillet:setBaseHunger(hunger / filletAmount);
fillet:setHungChange(hunger / filletAmount);
fillet:setActualWeight((fish:getActualWeight() * 0.9) / filletAmount)
fillet:setWeight(result:getActualWeight());
fillet:setCustomWeight(true)
fillet:setCarbohydrates(fish:getCarbohydrates() / filletAmount);
fillet:setLipids(fish:getLipids() / filletAmount);
fillet:setProteins(fish:getProteins() / filletAmount);
fillet:setCalories(fish:getCalories() / filletAmount);
fillet:setCooked(fish:isCooked());
player:getInventory():AddItems(fillet, filletAmount);```
The point of this is to make it so larger fish result in more fillets and the values of the original fish are divided between them
But instead it just adds fillets with default values
I assume I need to create it then reference it. What's the right syntax there?
Oh, found
variable = inv:addItem
Will try that
That looks like it's fixed the issue although running into another now. I don't suppose anyone can tell what the issue with the second loop here is please? It's saying that i is an unused local
local fish = nil;
for i=0,items:size() - 1 do
if instanceof(items:get(i), "Food") then
fish = items:get(i);
break;
end
end
-- Get hunger. Loop. For every 15, make a fillet. If less than 15, turn the remainder into a fillet. Single fish with 8 hunger? One fillet. Fish with 90? 6 fillets.
-- Divide by 15, use math.floor. Make that amount + 1 fillets. Divide each value by the amount of fillets.
if fish then
local hunger = math.max(fish:getBaseHunger(), fish:getHungChange())
-- 1-14 hunger: 1 fillet, 15-29 hunger: 2 fillets, 30-44 hunger: 3 fillets, etc.
local filletAmount = math.abs(math.floor((hunger*100)/15))
player:Say("+ " .. filletAmount)
for i=0,filletAmount do
local fillet = player:getInventory():AddItem(result);
fillet:setBaseHunger(hunger / filletAmount);
fillet:setHungChange(hunger / filletAmount);
fillet:setActualWeight((fish:getActualWeight() * 0.9) / filletAmount)
fillet:setWeight(result:getActualWeight());
fillet:setCustomWeight(true)
fillet:setCarbohydrates(fish:getCarbohydrates() / filletAmount);
fillet:setLipids(fish:getLipids() / filletAmount);
fillet:setProteins(fish:getProteins() / filletAmount);
fillet:setCalories(fish:getCalories() / filletAmount);
fillet:setCooked(fish:isCooked());
end
end
end
CutFish_OnCreate = Recipe.OnCreate.CutFish```
Specific issues with for i=0,filletAmount do
This loop runs but only once, even if filletAmount is 2 or more
B42 ?
B41
Where does it error exactly ?
The loop at the end only runs once even if filletAmount is higher. I assume I'm screwing up Lua syntax although it looks like it matches what it's meant to be to my unaccustomed eyes.
Or, at least, it only spawns one item.
I'll throw in a say to check if it's running multiple times or just doing weird stuff with spawning
I suggest adding some prints to verify some of these values
you have a say for fillet amount, is it defintiely more than one then?
Yeah. Have been making sure it's more than 1
Currently throwing in a say for the i in the loop to check if it's running the loop multiple times and not spawning properly, or not running the loop multiple times
The loop runs properly. One more time than it should, actually. It's just the item spawning that I've messed up
yeah, in lua you should usually count from 1 (so for i = 1, etc)
otherwise it does an extra one
oh
it only happens once because you're not spawning a new item
you're just adding and editing the same result item to the player's inventory repeatedly
Fiddlesticks. Sorry, would have assumed that a local variable only lives within its loop.
local fillet = player:getInventory():AddItem("Base.WhateverTheFilletItemIsCalled")
Thank you very much.
And now I feel a little dumb cause that should have been clear that it was by reference
Thank you though
That's now workly perfectly; thank you
is there any way to programmatically modify the weight of a placeable object? attempting to set the weight based on another value
wasn't sure if it was possible with placeable objects. i can see its functional for fillable containers where they have a range of weight based on the contents but not completely understanding how that works or if it applies to what im trying to do
Does anyone have a list or documentation of the mod changes between b41 and b42 (besides the mod package structure)?
eg. BedroomSideTable -> BedroomSidetable
context: I'm writing a tool to help add b42 support to a mod by automating some tasks (creating 42 folder, modinfo, common) and using ast-grep to check for changes and apply fixes if possible.
one i can point you to is InventoryItemFactory.CreateItem -> instanceItem (global function)
Hey guys, I need some help if anyone has a chance, I'm so frustrated over this structure.. is this correct? .. ffs..
C:\Users\PCNAME\Zomboid\mods\Ashtray_Settings
├── media
│ ├── lua
│ │ ├── client
│ │ │ └── Ashtray-Settings-SandboxVars.lua
│ │ └── server
│ │ └── Ashtray-Settings-Logic.lua
├── mod.info
├── poster.png
My mod is literally just to adjust the needed amount of cigarettes... not sure why my server wont load this....
i wish i could help you a bit more because your mentioning of ast-grep solves a big issue for me 😅
for b41, this is correct
yeah im doing it for b41.
sweet thank you im happy to hear at least that's right
I'm looking in my servers log, and i see this error, what does it mean? WARN : Mod , 1735776075793> 711,796,087> ZomboidFileSystem.loadModAndRequired> required mod "Ashtray_Settings" not found
You're requiring a mod which doesn't have the modID Ashtray_Settings
In mod.info most likely
remove the require= line, not sure why you're getting the error you are but it's probably because of that
I think everything looks good here right? I can't think of what I might have done wrong.
10-4 I'll try that
You have another mod which requires that mod ?
not at all. I just wanted to make my own mod that allows users to adjust the smoking times. every 30 min irl time or 1 hour ect ect.
Thanks! I wanted to update some old (2+ years) mods I started writing but never finished, those depend on some other mods that haven't been updated. Figured I can try writing a tool to help others.
I should be pushing up my work later tonight and will link it here
I'll probably diff the Lua between b41 and b42 and cherry-pick it for changes that happened in the base game, then write a few rules to at least alert people of those changes (like BedroomSideTable and InventoryItemFactory.CreateItem).
I honestly thought it would have been okay to just leave it blank, I used the mod template's mod.info.
Alright I'll had some bit about it on the wiki
now I'm just looking into why my mod isn't populating the options into the sandboxvars.
yeah ill do a doubletake!
the male and female wardrobe distributions were also removed and replaced with the generic wardrobe
A couple generic freezer spawns were also removed and moved to more specific resteraunt named spawns.
I don’t have the list but I ran into a few when making distros for my mod.
Some counter tops were removed. Spiffo ones I think
@wild canopy were you able to resolve the script errors with the recipes in the upgradeable bags mod?
I'm going to port the old Item Tweaker API mod to B42, mainly because I want more modders to be aware they can change specific item parameters without replacing the entire item. I also want to add some different API interfaces, because I have the way Item Tweaker works. So my question is: what would you want from a API for tweaking items?
As far as I know everything is working now. Loot drops are rare on default though.
please don't
My personal preference is just have a function you call with TweakItem("itemname", "parameter", "value")
Why not?
that api does shit all and causes performance issues and incompatibilities
hahahahaha
it was a massive issue a couple years ago
When I crank the chance up, I get stuff spawning so they're in the tables, but I've not found any naturally in my latest platform
good to know, it did seem to have a convoluted way of doing things
item tweaker is *the* reason so many older modders are now resistant to using dependecnies
Ah, maybe i need to trigger a mod update from steam. Getting this
Is there a way to make the player unable to hear a specific sound? So if a mod adds constant screaming in the background or something, individual people can turn it off on their end?
Or is this impossible
Last updated 2015 
shockingly still works, and i'm sure by just moving folders it'd still work in b42 too
In that case I'll just make a new API - I find I keep wanting this myself and copy-pasting the same function into mutliple places
Just create your own framework if you want something for all your mods
What I really want is for modders to stop redefining entire items to change one value. 😂
Hmm not seen that myself. Can you do a test with just the upgrades mod loaded? Not seeing anything there that suggests incomparability but I'm not sure why else it'd be different for you than me
i usually just use raw doparam or write an itemtweaker-esque wrapper if i'm doing it a lot
the reason it came into such common usage is just because people didn't know they could easily do it without it
Hard to teach when so many existing mods do that so if you look for an example it probably has a copy of the item with one line changed
So I don't blame people - that's how I started with personal mods. It works and is easy, until two mods fight over an item.
local x = ScriptManager.instance:getItem(item)
if x then
x:DoParam(newparam)
print("NepTweaks: item updated: "..item.." "..newparam)
else
print("NepTweaks: unable to find item "..item)
end
end```
That's what I've been using
Can't even see what the actual cause is in your console. Not that I've got much experience.
i honestly genuinely think encouraging people to copy paste this kind of thing is all we need, it's not so complex that it needs to be a standalone dependency
i will say that those prints should be removed in production code though
at least the 'everything is okay' prints anyway
Agree, and I intend to make that clear in the mod - copy paste the copy to remove the dependency, it's a trivial API
I think people are afraid to look at how other mods do stuff
the prints are why itemtweaker causes performance issues, i remember a big server host found after removing item tweaker's print their server started up ten seconds faster
Definitely, this is from my personal tweaks mod so I don't care about some spam on startup
How often are they restarting their server?
I think we should violently attack people who do things like this.
I keep getting people complaining about bugs, I've tested my mod in every single context they've listed, it doesn't affect almost anything outside of custom independent functions, and I have no errors. Who knows what horrible things are going on in the other mods they use lol
the BIG issues with item tweaker that caused a lot of modders to move away from dependencies entirely were caused by some mods not just copy pasting the entire mod but then changing the api 😭 breaking literally every other mod that tried to use it
I've seen multiple B42 mods changing things they probably should not be touching for the sake of fixing bugs before TIS does, sounds like a disaster since people use hundreds of mods at a time
That will always be the case - best you can do is make your mod as robust as possible and tell peopel to move it to the bottom of the load order.
god i hope they revert the load order changes
prefix/postfix function addons are also much better than replacing entire functions, even if replacing an entire function to edit one line in teh middle is often much easier.
I can't rmember how it used to work - what changed in the load order?
basically lua files now actually respect load order
My clean rag mod overwrites the base lua, but I really don't care
in b41 lua files from all mods just load alphabetically, in b42 they load per-mod in load order
Sounds like a good thing? As long as "require path/to/file" stuff works.
it's a bad thing because now load order is up to the user instead of the mod developer
They need to add a mandatory load after/before like how RW does if load order matters
if it made sense for my file to load as early as possible i'd just give it a name that would alphabetically sort it early, now i have to rely on the user to sort it earliest
Rimworld is IMO the pinnacle of good design for modding.
But would probably require rewriting their ingame mod manager
they do actually have this in b42, you can specify mods to force to load before/after yours if they're enabled
usually...but boy does Ludeon make some weird performance choices
but that requires me to know and list every single mod i need to load before/after
indeed, perfoamnce mods ae always needed for that reason
I would kill for a java equivalent of harmony
Just add them as you find issues.
it doesn't really change anything from the user perspective because nearly everyone thought it worked this way anyway, it's just frustrating for developers now having less tools than before (and i'm not confident they actually changed this on purpose lol)
Cataloging all 1000 B42 mods, sounds alright to me
You only need to specify before/after when it matters, so add it when a problem is found - don't go test everything yourself.
an example of something affected by this is one of my mods reimplements the entire event system for performance as well as extending api, it *must* run before any event handlers are added or it cannot catch those handlers and they'll be invisible to the api
Debating if I should update spoon's mods. Since they stated its up for grabs and they are done modding
Wait for someone to post "this mods breaks when mod X is installed"
@crystal canyon if you can send me your mod list, I'll look at it tomorrow.
Atleast the stuff that didn't get put in the base game
before i could do this by just prefixing my filename with !!!!, now it's literally impossible for me to guarantee it
But now you're not fighting with teh guy who prefixed his filenames with !!!!!
that's fine, he knew what he was doing
Pretty sure most of my 41 mods have been update/have equivaletns except for all the maps and KI5 vehicles
They should include a priority in the modinfo if the load order is kept
Honestly I think the mod order could be good to help resolve conflicts or for patching, though in its current state nah
to me, b41 was the ideal state where load order rarely actually mattered and was mostly in the control of the mod author
in b42 it matters a lot more and (despite the new tools like forced load sequence of specific mods) we have less tools to deal with it
Looking at client/OptionScreens/ModSelector, the "autoSort" just sorts based on modId comparison
I mean it's not really your fault. Up to the users
Wouldn't everyone just set their priority to 99999?
Yeah, tooling is a big thing - the debug tooling is still rough too...
Just set yours to 99999+1, duh
if there's anything good to come out of this though, it probably will encourage people to use requires more, and hopefully modules too
It's not like they are having to Wrye bash your stuff with another mod to get them to play nice
"If your mod is getting overwritten set priorty to 2147483647 to fix this"
Maybe priority isn't the right option, but a basic 0-10 with 5 being standard, 0 being "load first", 10 being "load last".
You can't control what other mod authors do, I'm not sure of the moderation around mods.
Im verifying files from steam. Will try with no other mods
Thanks
the amount of b41 mods that say 'you MUST put this as late in your load order as possible' despite that not doing anything at all for 99% of mods indicates to me that people will just always set it to whatever gives the most priority
gotta start breaking shins
"Load after other mods that also change <thing>" would be much better advice - that's what I say for mods where order matters (not anything in Zomboid, but happens in some of the things I made for Stalker 2 or Pacific Drive because Unreal engine mods without proper modding tools are just complete replacements of files in the .paks)
strangely, mod load order in zomboid sometimes has an impact on hevily modded scenarios. I got to over 1k mods loaded at same time in b41 one time. was running alright, no major errors or broken things. I used the auto sort in the 41 mod manager and everything was broken lol
I cut down the number of mods I have by grabbing the code/changes from trivial mods and putting them in my own personal tweaks mod.
shit, now something broke everything
?
I once made a typo in a lua file and that one missing quote deleted every piece of clothing and broken every vehicle in the world.
im attempting to make a movable object with dynamic weight based on a different value in Lua, but coming up with nothing. my research has led me to setup a set of items in a script with varying weights but setting the CustomItem property changes it to a random radio item (specifically Radio.TvWideScreen)
does the CustomItem property only work with the radio object?
Argh too much debug spam to open on my phone. I think you've got more problems than just my mod 🙂
thing is that is not letting me disable mods
this was after verifying files tru steam
a mod I downloaded must be breaking somethig without it being loaded
Can you delete the load order file? Don't know how pz handles it if that goes
oh right
Hey guys, if i want my mod to add it's setting into the SandboxVars.lua for people's server is there another file I have to create in order to do that? or will that automatically happen when my server downloads the mod I created to adjust vanilla values?
That might be
I deleted nearly everything from Zomboid user folder
ERROR: Mod f:0, t:1735783561481> ChooseGameInfo.readModInfoAux > invalid versionMin: invalid game version "42"
about to perform a search
found it
name=MontyPythonTV
id=MontyPythonTV
description=Enjoy the best of Monty Python skits and music!
poster=preview.png
icon=icon.png
pack=MontyPythonTV
versionMin=42
A worthy mod
looking at the comments of the mod, it is indeed the culprit
I'm going to bed. Let me know if you're still seeing errors from the upgrades mod once you're sorted out
I do. Only dynamic backpack upgrade loaded
Mmmmmm
and many others like this
you go to bed. Ill check the code and share fixes with you through PM
Thanks
This is my first foray into both pz modding and lua, so I'd be surprised if I've not ballsed something up
someone should make a map with realistic brands like mcdonalds and nike etc
versionMin ...
I've ran into this before, its usually something missing/wrong in the recipe script
yep, already commented the fix in the mod page 😄
ohh so quick XD
first thing I noticed right away is the recipe names
craftRecipe Make Cloth Straps Upgrade
They cant have spaces in B42
You will need to setup a translation key to get it showing right for any language now
@wild canopy lastly, to solve the issue of the recipe consuming your worn fanny pack, use the flag isNotWorn
Where would that flag go?
Guys, how to import animation files into zomboid?
Think the spaces were the root cause of the issue you were seeing?
https://discord.com/channels/908422782554107904/1270065980030058549
this may be able to help you. i'm not animator tho.. i don't understand anything in that post 🤣
wasn't the only issue, CanBeDoneFromFloor is not working correctly and giving errors on 42
testing my changes and will send you the fixed script
Awesome, thanks
witha sort of changelog so you can see what was causing issues
I just got into modding project zomboids so this is all still very new to me but I was wondering what's the proper way of storing data for a specific player that is carried over even after the game is closed, I'm pretty sure it has something to do with Moddata but I don't really know what that does or how it works.
Would you be able to send that changelog to me as well? I'm working on a tool to help convert b41 mods and it might serve as a general linter/checker for mods
sure
globalModData or (player)ModData.
I usually don't make mod using globalModData, however global will work with your world while objectModData work with specific objects(items, character, etc..) . i could be wrong with this.
getPlayer():getModData() -- Object(player)'s mod data
getItem():getModData() -- Object(item)'s mod data
anything like this
Another multiple victims from MontyPythonTV 😬
at least my comment is helping others already XD
btw guys you may know "missing dashboard" issue with wrong recipe code, anyone figured out how to find the mod causing the issue?
because log just says it's vanilla, I've been looking for clue but no luck.
function: onSwitchVehicleSeat -- file: ISVehicleDashboard.lua line # 622 | Vanilla
could this be a recipe that causing the issue?
ERROR: General f:0, t:1735785036863> FluidContainerScript.load > Sanitizing container name 'Large Bucket', name may not contain whitespaces.
LOG : General f:0, t:1735785037016> Load Scripts: Recipe, loadMode = Init
ERROR: General f:0, t:1735785037017> Recipe.Load > Could not assign [key]: 'Result' : 'HearingAid'.
ERROR: General f:0, t:1735785037018> Recipe.Load > Could not assign [key]: 'Time' : '100.0'.
ERROR: General f:0, t:1735785037018> Recipe.Load > Could not assign [key]: 'Category' : 'Health'.
ERROR: General f:0, t:1735785037018> Recipe.Load > Could not assign [key]: 'SkillRequired' : 'Doctor=6;Electricity=2'.
ERROR: General f:0, t:1735785037019> Recipe.Load > Could not assign [key]: 'CanBeDoneFromFloor' : 'true'.
ERROR: General f:0, t:1735785037019> Recipe.Load > Could not assign [key]: 'NoBrokenItems' : 'true'.
ERROR: General f:0, t:1735785037019> Recipe.Load > Could not assign [key]: 'NeedToBeLearn' : 'true'.
yes
I don't have any mods that causing the issue, so it's hard to figure out with Only Console.txt
thats 100% one or all of those recipes causing the dashboard issue
Sorry for bothering you, can i find mod name in console or I should search one by one?
HearingAid the mod that adds this item
ho HUGE thank you
that recipe is completely broken
Was working on a practice mod and i lost all motivation til i start scrambling on the bike mod again
The bike must be made
I'm trying to be clever and get detachable gun magazines to work.
Well they're working real fine with a simple function, but the daggum things won't update unless I manually unequip/re-equip 'em 😄
what is the detachable gun magazines?
For my gun mod I want the gun mags to visually go away when a magazine is ejected.
I saw how Hyzo did it, that was really clever.
I thought I'd do it with just one function, and it's working. But I can't get the model to update in real time.
ah i understood 🙂
Wonder if its possible to mod a hydraulic car stacker for garages
My collection keeps growing
Is there some sort of list for all the possible Events? Guessworking isn't all that fun 😄
Holy mother of goodness that is amazing
I have everything I can Bookmarked for ease of access lmao
Lmaooooooo that worked perfectly.... Except that now it's in reverse. 😂 Inserting a mag makes the mag disappear and ejecting it makes it appear fml
Hello! so I wanted to make the PZ Discord integration to send in game roleplay chats such as /say messages to Discord too, I use a mod that alters how chat works so I edited it abit to add the following lines (I copied that from "general" channel's code which sends /all messages to Discord)
It actually worked but I can't figure out how to make this actually look like "rubyd115 says, "just testing.."" or even just like rubyd115: /SAY: just testing..
Maybe it's actually pretty easy or impossible but I have 0 experience with coding stuff so got no idea 😅
Can someone help out please?
if you want the first option (username says, etc), you'll have to modify the ServerSend.Command function as I assume that takes the player object, gets the name, and then appends the message after that
but if the second option works fine enough, you can use message = "/" .. args.type .. ":" .. args.message
that should output it as rubyd115: /say: just testing,,
ServerSend.Command(player, 'DiscordMessage', {
message = "says, " .. args.message,
})
If args.message contains "We are being surrounded!", the resulting message sent will be:
says, We are being surrounded!
do keep in mind that the beginning of the message will still be Username: with the colon
Yeahh that should work fine enough until I decide and try to figure out editing that function
Thanks a lot!
heya guys
hallo
i have a problem with a UI mod that im making
can anyone help me to solve this problem?
function CostomWuroPanel:onClickItem(atm)
print("hi",atm)
end```
so.. my problem is this
i have this scrolinglistbox
and when i click on the added names of lists
i want it to send the name of item that i clicked to the param. of CostomWuroPanel:OnClickItem(atm)
so i can use it to do other function such as addItem to inventory
problem is = i dun know how to
since (god knows why) setOnMouseDownFunction(self.onClickItem) is written this way not clickItem()
I might also have to toss my function in here at some point but I'll let you people help ^ first.
Because currently my no magazine updates perfectly on OnEquipPrimary only.
Adding it to the PressReloadButton Event makes it A) happen instantly and B) in reverse.
I'll take a break and come back later with my almost functioning function. 😄
at where?
print("item ", name())
oh wait let me see your code rq
quickly, meaning of closure is something like It's a function. it's not table, not string or not number.
sorry, im at my work now so replies will be late
local translated_name = list:get(i-1):getDisplayName()
btw translated_name works for UI only
-- it doesn't work for non-English strings:
print(translated_name);
-- it will be something like "???? ??????" in console
nope... still nothing
which isn't suprising because getName()and get DisplayName() both produce string type output
do you still get closure even after changed var to local?
yea
well lua self.scrollingList:setOnMouseDownFunction(self, self.onClickItem);
when i go and see the scrollinglistBox.lua
to see how that setonmousedownfunction works
function ISScrollingListBox:setOnMouseDownFunction(target, onmousedown)
self.onmousedown = onmousedown;
self.target = target;
end```
looks like it's not passing any param other than self, and the function
so.. it's impossible to pass the info of what's being pressed.
so each of these "lists" are considered as its own instances
though.. there must b a way to have its name stored somewhere...
setOnMouseDownFunction just defines what the function its gonna run is
the parameters for onMouseDown are in ISScrollingListBox:onMouseDown
here's where it gets run in onMouseDown
so your onClickItem function needs two parameters
How do I create a valid mod.info file for a local mod I'm testing without the workshop? Was looking at the pins and apparently the ID entry now requires a WorkshopID, but I don't have one.
local workshop mods don't require a workshopID, just an ID you come up with
Hmmmm ok, I just have the ID of "ClothingTest" yet whenever I check it in the game it says "Mod is missing mod.info file"
Alright, I have it in the common folder, where else should it go?
First one in: workshop/yourmodname/contents/mods/yourmodname
The other one in 42
Ok thanks!
Allrighty I've got a fresh cup 'o joe and I'm getting ready to either give up and do the no magazine thing the long way around, OR get this function functional.
function NoMagazine(wielder, weapon)
if weapon == nil then return end
if not weapon:IsWeapon() or not weapon:isRanged() then return; end
local scriptItem = weapon:getScriptItem()
local WeaponSprite = scriptItem:getWeaponSprite()
local AK47 = "Base.AK47"
if AK47 then
if not weapon:isContainsClip() then
WeaponSprite = WeaponSprite .. "_NoMagazine"
else
WeaponSprite = WeaponSprite .. "_HasMagazine"
end
end
weapon:setWeaponSprite(WeaponSprite)
end
Events.OnEquipPrimary.Add(NoMagazine);
Events.OnGameStart.Add(function()
local player = getPlayer()
NoMagazine(player, player:getPrimaryHandItem())
end)```
So that script works, in a way. It updates the weapon model but only when equipping it.
I'd like to have it update the model when the ContainsClip turns one way or the other instead.
ah was it about icon(sprite)?
No, it's about the weapon model itself changing from a model that has a magazine in it to the model that doesn't have the mag
ugh i thought meaning of sprite is 2d icon. 😛 my bad english
@ornate sand you can use ```lua [your code] ```
my hair api replaces that function already so i can check and see if its possible to fix it
A sprite is pretty much a 2d icon! You arent far off
But to confuse us all, weaponsprite actually goes to get a 3D model lol
Wait, what? lmao
what does isContainsClip return? a boolean? not too familiar with PZ's lua api just yet so im not sure if thats a function you've made or not
declaration: package: zombie.inventory.types, class: HandWeapon
yeap boolean
I am a complete newb to lua too so I have no idea how to answer that.
But the function "works". As in it does replace the weapon model, but only after equipping it.
What I'm looking to make it do is to replace the weapon model as soon as the magazine is ejected/inserted
what does it do now when removing/adding a magazine?
I'm not sure what you want. You can save any info in item object.
local item = list:get(i-1)
local translated_name = item:getDisplayName()
local data = {
item = item,
whatever_you_want = 123,
}
self.scrollingList:addItem(translated_name, data)
Visually nothing, but if I eject a magazine and then unequip/re-equip the weapon, then the model changes to the one without the mag.
And the same happens when inserting a mag. Nothing while equipped, but after unequip/re-equip the mag shows up.
This makes no sense:
local AK47 = "Base.AK47"
if AK47 then
You can safely replace it with:
local AK47 = "Base.AK47"
if true then
Cool 😄
is this the right way to add multiple flags to a recipe input?
item 1 [Base.Bag_FannyPackBack;Base.Bag_FannyPackFront;DynamicBackpacks.UpgradeCapacityCloth;DynamicBackpacks.UpgradeCapacityJean] mode:destroy flags[IsNotWorn;IsEmptyContainer],
potential problem i'm seeing is that it'd work fine for fannypacks, but as the upgrades aren't containers themselves, they might fail the check
I guess I could try overwriting the IsEjectMagazine and IsInsertMagazine somehow before I totally give up and do the whole thing the really long way around
rewritten a bit
local AK47 = "Base.AK47"
function NoMagazine(wielder, weapon)
-- Need to be sure that it's an item
if not weapon then
return
end
-- This is an unnecessary check, because we check below if it's AK47
if not weapon:IsWeapon() or not weapon:isRanged() then
return
end
-- Need to be sure that it's AK47
if weapon:getFullType() ~= AK47 then
return
end
-- Now it's AK47 for sure.
local scriptItem = weapon:getScriptItem()
local WeaponSprite = scriptItem:getWeaponSprite()
if not weapon:isContainsClip() then
WeaponSprite = WeaponSprite .. "_NoMagazine"
else
WeaponSprite = WeaponSprite .. "_HasMagazine"
end
weapon:setWeaponSprite(WeaponSprite)
end
You can hook function like this
require "ISUI/ISInventoryPaneContextMenu"
local vanillaPaneContextMenu = ISInventoryPaneContextMenu.createMenu
ISInventoryPaneContextMenu.createMenu = function(player, isInPlayerInventory, items, x, y, origin)
vanillaPaneContextMenu(player, isInPlayerInventory, items, x, y) -- Load original function first
if isWeapon and instanceof(isWeapon, "HandWeapon") then -- and I will edit this point from original function
local playersp = getSpecificPlayer(0)
local playerNumber = playersp:getPlayerNum()
local playerInventory = getPlayerInventory(playerNumber)
...
So you can edit specific point of the original function without overwrite whole file
btw, how can i color my code like yours in discord?
```lua - with no space
Genius you are.
I must be doing something wrong here, I have this mod.info file in both the main mod directory and the 42.0 folder yet the game keeps saying "Your mod doesn't have a mod.info file"
name=Clothing Test
id=ClothingTest
description=Test for creating a mod.
author=Paddlefruit
poster=poster.png
versionMin=42.0.1
is it an actual .info file? because re-naming a .txt file isn't enough.
Yup, mod.info
projectzomboid/Workshop/ClothingTest/Contents/mods/ClothingTest
Is this a correct file structure?
noooonononono.
Users/yourusername/zomboid/workshop
mod updated. thanks @crystal canyon. Also found a flag for IsEmptyContainer so it won't eat fanny packs that contain items now.
where do you see/set what loot tables an item exists in?
ah got it
Stupid question for mod makers.... would it be possible to have a train model that drives on the tracks? and have buildable tracks?
Yes
Is there a mod that already does this?
But it's a ton of work.
I see all the train tracks all over the PZ map, but no like train vehicle or anything related to it
I'm surprised noone has made a train for like a Server or something? (like load up a train full of people crash into a barricade shoot the hell out of the fort?)
Because all trains were cancelled due to the zombie apocalypse. 🙂
Steam locomotives can burn anything?
Trying to make a simple mod that adds just some pants as of now (not adding a mesh or anything, just a texture), heres the xml code I have for the item
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel>skinned\clothes\bob_trousers</m_MaleModel>
<m_FemaleModel>skinned\clothes\kate_trousers</m_FemaleModel>
<m_GUID>e3e4b0cd-9adb-4b10-8a5a-8da2dcde21f7</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_AttachBone></m_AttachBone>
<m_Masks>14</m_Masks>
<m_Masks>15</m_Masks>
<m_Masks>7</m_Masks>
<m_Masks>9</m_Masks>
<textureChoices>clothes\trousers_mesh\trousers_yasogami</textureChoices>
</clothingItem>
Like i've seen giant Tiger Tank crashing and breaking stuff, i'm like... where da train at? so i can ram a gate or something... :?
I'm just sayin, ders alot of trees still in the apocalypse... XD
Right now this item uses the jeans model and texture even though im pointing to my own texture, and theoretically shouldnt use a model at all
Is your GUID unique?
Should be, used a generator for it
Hmm, I do remember getting a headache and a half adding my military "fannypacks" into the game. Hard to say exactly what's missing/wrong
module Base
{
item Trousers_Yasogami
{
DisplayName = Yasogami Pants,
DisplayCategory = Clothing,
Type = Clothing,
Icon = Trousers_White,
BloodLocation = Trousers,
BodyLocation = Pants,
ClothingItem = Trousers,
FabricType = Cotton,
Insulation = 0.50,
WindResistance = 0.40,
WorldStaticModel = Trousers_Ground,
Tags = RipClothingCotton,
}
}
Yeah let me tinker around a bit, its good practice for getting used to PZs item systems at least
Oh, for one. My packs don't have any masks entries?
Hmmm ill try deleting them
That didn't seem to do it, maybe deleting the first two lines relating to an actual 3d model might help
Hmmmmmm 
Or copypaste those models, rename 'em (both file and in the script), and try to use your texture on them?
So I figured that you don't delete those two lines entirely, you just delete the 'skinned\clothes\bob_trousers' in between
Now I think I just have to fix the texture pointer
New superhero dropped. Checkerman
He is here to save Checktucky
quick question is there a way to make an item invisible in the inventory or that they cant drop it
Welp I'll go throw some more **** at the new AnimSets and stop trying to make this nomagazine thing happen. Just for variety of headache, you know?
Its good to diversify
not really but i think you can give item back to player when they are not in their inventory.
time to stop working on this dang mod and play for a bit
Hey guys, I'm looking to create a mod that allows users to change the smoking logic in b41, such as the SmokingFrequency,CravingIntesnity, Stressreleif, WithdrawIntensity, ect ect I'd like for the mod to populate into the SandboxVars.lua, do I have to make a scrip in the media folder structure to populate this? or will it automatically pick up when my mod is created? all it would do is pull vanilla values to be able edited for smoking logic. Please @ me
you would need to create a sandbox script it goes in media/sandbox-options.txt
you would need to put the options in the script
kinda like
VERSION = 1,
option mysmokingmod.SmokingFrequency
{
type = double,
min = 0, max = 100,
default = 1.0,
page = mysmokingmod,
translation = mysmokingmod_SmokingFrequency,
}
there are various types for the options:
enum
boolean
double
integrer
string
then you need to call these sandbox vars in your lua code
declaration: package: zombie, class: SandboxOptions
Cool, Thank you spongie!
crafting threads seems to max at 100, is it possible to bypass that?
You mean the slider for how many of something you want to craft?
I assume that can be changed in the UI files
Finally got the ejecting magazines to work like I want them to but now I got the aim=crash bug 😂
🎶 99 little bugs in the code, 99 little bugs
Take one down, patch it around
42981 little bugs in the code🎶
yes. i will try your suggestion
For me, validating the game files fixed that.
Yeah no I think it was just B42 unstable trying to scare me off. It happened once, I didn't change anything and it hasn't happened since.
Can't get rid of me that easy gosh darnit!
Does the ScriptManager run all of its parsing and loading OnGameBoot or OnInitWorld?
It happened constantly for me
First time I went to Guns Unlimited is was deserted inside. I picked up an M14, hit aim, crash. Load back in, the place was full of the normal number of zombies and I was in the very middle.
OnBoot
Thanks! I'm trying to figure out how to inject new parts into vehicle scripts without overwriting the original to be compatible with other mods.
Can someone explain to me how to get a custom animation to work? I've made an xml file pointing to the correct animation file in anims_X and tell the code to play it with self.setActionAnim but my character just throws their arms in the air when the action plays instead of the animation. Error I get is "WARNING: did not find node with condition 'PerformingAction = TestAnim' in player/actions/" in the console
Hi all, is the modding tutorial on the forum is still update?
I'm not sure what the function does exactly but contextually it sounds like itlol. Vehicles don't have a AddPart() method anywhere so I'm trying to use the FileReader and FileWriter to append my parts to the .txt files and reload the scripts
You mean alter the game's script files?
Yes
That sounds like a realy bad idea; if anything goes wrong uninistalling the mod won't fix the files.
Can't disable it either, because the vanilla files are no longer vanilla
Or are you only editing the .txt files in your mod?
Whats the typical flow for adding in content to ensure it doesn't conflict with other mods? If everything goes in MyModule {} zone then it won't overwrite the base files correct? I'm trying to add dome lights to vehicles dynamically without giving a bunch of custom vehicle.txt scripts with domelights because then there would just be a spawn pool with cars with dome lights and cars without yea?
Typical flow: have idea, look at what is needed to make it happen, find the Java API lacks what is needed, give up on idea. 😂
LOL
im so close
Already had to give up swapping shaders in and out for window glow
For something like a dome light, I'd expect to see it on modded vehicles and not retrofitted to vanilla.
Edit Java API 🗿
You could look at how the "make armor for vaniila cars" mod works, but I can't rmember the name.
Well it doesn't have a model, and it lacks a real world 3D part. I've got everything plugged in perfecty to the vanilla vehicle creation flow, but in my current implementation if I want every vehicle to have a domelight then I need to manually add the parts the scripts and then I guess collobarate with anyone who wants them in their custom car mods. Maybe its not such a big deal
Dome light API for vehicle modders?
Hello everyone
Hello!
Need a Parts API for me first 😂
Are there any LUA script provided to customize the sandbox options ? I see that the lua ServerSettingsScreen.lua can be modified to add my own options but I have some error because it relies on the class SandboxOptions that I don't have any control on it. Do you know guys how to create sandbox options easily ? Or should it be done manually without relying on current API ?
Add sandbox options to your mod?
Yes I want to add sandbox options to let players customize the mod
sandbox-options.txt in the media folder
there is getSandBoxFileWriter, getSandboxOptions, and getSandBoxPresets?
Don't find it
Subscribe to that mod, go to C:\Games\Steam\steamapps\workshop\content\108600\3396742825\ to see the downloaded files
Sandbox Options:
option NepHeadlightsNeverDie.HeadlightsEnable
{
type = boolean, default = true,
page = NepHeadlightsNeverDie, translation = NEPHLHeadlightsEnable,
}
option NepHeadlightsNeverDie.HeadlightsMinCondition
{
type = integer, min = 1, max = 100, default = 50,
page = NepHeadlightsNeverDie, translation = NEPHLHeadlightsMinCondition,
}
option NepHeadlightsNeverDie.DebugMode
{
type = boolean, default = false,
page = NepHeadlightsNeverDie, translation = NEPHLDebugMode,
}```
use in lua script:
local targetcondition = SandboxVars.NepHeadlightsNeverDie.HeadlightsMinCondition or 50
And there's a translation file to give everything names and tooltips in the sandbox options
Thanks will look at it
Really easy to do.
There is also ModOptions, which I have not played with but puts settings here:
Interesting if options can be tailored in-game
https://steamcommunity.com/sharedfiles/filedetails/?id=3386860561 looks like the place for more info
Yeah It seems, I'll look how it works because I don't see any logic behind
