#mod_development
1 messages · Page 252 of 1
My bad 😭
it's just you cant see the icon because the game error'd so early into the loading (I think?)
you can see in that ss the stack trace and the mod that's causing the error whicih is Skizot's riding mower
ye there's usually an icon so you can kinda understand what they do
Ok
well a problem for the person who created the mod since you don't want errors in your code, but it's not your mod
Yeah
Ok I'm loading into my test world rn
Ok finally loading in lmfao
God please just work 😭
Yeah
Back to only 32/32
you mean there is literally only 32 recipes
Yes
There should be like 800
But I can't even rip sheets
It's messing it up so bad
And I only have this mod enabled, along with mod manager and a cheat menu, but when I disable the mod it works fine
hmm
try removing module base from your scripts
like not remove
but change it to your mod id
So in your recipe and item scripts
there is module Base at the start
Base is the vanilla game, so you're defining (creating) your items in the vanilla game module instead of your own mod's module
this shouldnt be that much of an issue in reality, but I've had some past issues with module base so just change it to see if anything else changes, if not you can change it back
your mod id that's in your mod.info
yes
There doesn't need to be a comma after that right?
no
Ok Opening pz back up
oh btw you shouldn't need to restart pz every time you make a change since in debug mode, if you click "Reset Lua" down the bottom right of the screen in the main menu, it will reload all your mods!
😭
Dude
That would have been nice to know
Tysm for telling me that lol
Well shit
It didn't work
Still 32/32
ok now it's time to share the console.txt in dms because I have no idea
Ok
Like I've seen this happen due to syntax errors in the item script but yours has none that I can see
someone pls help this person I have no idea why it's causing vanilla recipes to vanish
it's literally a scooby doo mystery
literally the only code inside of my mod
Im having an issue where when my mod is installed and you are playing with it you are locked at 25/32 crafting recipes.
you cant even rip sheets lmfao
the actual item you can craft
it works fine aswell
just the whole crafting got deleted
Is myrecipes the name of the file in the mod? I see recipes.txt in the screenshot, so my assumption would be that it's overriding the vanilla file
Referring to these screenshots
good catch
how tf did you even notice that
I made a deal with the devil to trade social skills for attention to detail
I suggested this so I got them to change the filename of it just in case
well I assumed they changed it after I mentioned it but yeah no difference
their mod is quite literally just the bare minimum and nothing else with an item script and a recipe script with each both containing only one entry
Have they isolated it to either file? i.e., tried with the content of the recipe file cleared out to confirm that's the cause
I remember someone else running into a similar issue months back but unfortunately idr what it ultimately was
I suggested that as an option, idk if they actually did it
I swear I suggested literally everything I could think of
syntax on the scripts are good, mod structure is good, not overriding any vanilla game files, only happens when their mod is enabled (no other mods except ModManager too), tried different saves, nothing in console.txt
maybe they just need to verify game files
Guh! Still no luck
Whose code are you looking at?
Oh this? @grizzled fulcrum
yes
Can I see a zip of this whole mod?
@analog breach
Boy is this taking a while
troubleshooting, file type was wrong for spawning
and didnt replace a "mod_name" bit
uh oh
hmmmmmmmmmmmmmm
lag on startup, crashed on first world load
something is happening
Explain
Sorry guys I just woke up
@tranquil kindle I was using the pipe bomb as a basis for the mod. So I could change the values of it
@thick karma yeah, you still on?
It's not solved yet.
I'll try changing the name on both.
Yo
Getting on my PC rn
I just woke up
So @tranquil kindle said the problem was the .txt file name but I believe I've already tried that. (Excuse me for being slow on this I just started modding like 1-2 days ago)
Your recipes txt file is named same as vanila recipes.txt file which overrides vanila file
So that makes vanila file non existent if you load this mod
I changed it to itemrecipe.txt
Piddysmansion ?
k12recipes or something that you can guarantee noone will use
Ok I changed it to "duckpipebombcrafting.txt"
Just so both mods don't cancel eachothers out
Is that fine?
Anything that is not vanila is fine.
model name was also wrong, testing another world
Lmfao if this works I think I'm going to cry
Thats why some people put their nickname or mod id before name. For example bit braven does BB_Items or whatever,
Ahh I see
I make The last of guns mod, so its TLOG, so when i have my recipes i do TLOG_Recipes
Nik I have spent like 4-5 hours doing random stuff trying to fix this 😭 if this works I will be so mad
Makes about enough sense. Just nothing can override vanilla?
Usually the most obvious things can be missed
It depends on what you want your mod to be.
But in this case you don't really wanna get rid of vanila recipes don't you
Unless 
No
Definitely not lol
@tranquil kindle
I have the recipes back
But now I don't see my item
Oh wait silly me
I didn't confirm the mod 😂
Ok
When I load in I now have more crafting recipes
But not all of them
Still missing so many
It maybe cheat menu interfering. I'll try disabling that really quick
It looks like I have modded recipes even though I have no mods except for mine?
Why you think thats the case
I think maybe because one of the names of my files interferes with a mod file?
I don't have any enabled though
Yeah I'm still only at 25/32
i wonder if it because i have a texture folder?
i mean i really dont know
Why do you have both module Base and imports base?
by pek?
No not pek
someone was helping me last night
Pek told me do module Base, but then i was told that it interferes with vanilla so i switched it.
I only do module Base 
tbh i really dont even know what the imports base is
my recipe still showed up ingame without it
just remove imports base, but aside from that i doubt anything else is wrong
and it was just as broken
Create new save maybe
what about the item_duckbomb
both
i have multiple now 😭
Please tell me your name of txt file which rubberducky item is does not override any vanila files
The .txt file where the item stats are?
yes
It's K12_items.txt
changed name in files for all files
is it possible for me to just send you a .zip or something?
Did you intend to make custom tab just for your item? If not you should change recipe> Category:Category:Engineer, instead of Engineering. Also remove item_duckbumb from recipe above "recipe Ducttape pipebomb to rubberducky"
There is nothing else that can be wrong that i can thing of right now.
You said this issue is caused by something in my mod overriding vanilla recipes?
It was overriding, because it shared name of vanila file
But thats not longer the case
Only other thing I could think of is that right next to the media folder, I have textures.
But that's only a png of the item icon
Im not even sure if my codes saving right?
Im not sure why you would have textures outside of texture folder, but that shouldn't do anything
I changed it to engineer
It is in a folder
I changed the category to engineer, but it's still showing engineerING?
I just want to make sure, you're not actually subscribed to your mod on steam too?

was i using
the old code from what i uploaded?
is that why nothing was changing?
That is most likely the case
If you don't get it sorted, do this and ping me.
Ok sounds good thank you burry.
Nik, do you think I should delete the steam workshop folder for when I subscribed to it?
For some reason I thought it would be easier with being subscribed to it 😭
Nah. Just have to remember that steam workshop subscribed mods have priority over local files
So when you work on your mod, you have to unsub from your on steam.
Oh nyo
Now I'm missing the texture for the duck bomb
Which is minor ig
But everything is in the game
So improvement
Then you won't have conflicts between versions
Dude I wish I would have known this 😭
oh my god nik
what is your steam
ur getting all my steam points lmfao
Yeah, but my memory is not that great and i could forgot about it. But thats also possibility
ive been working on this for too long
my preference is to use a separate cache directory for development
i disable the workshop too
the texture isnt showing in game smh
that way you won't get consistency errors when joining servers with an unreleased update, and you don't need to unsubscribe or anything while developing
Check if its actually there. I do tend to randomly ctrl z and sometimes because of that i do move my textures/models back into their previous location
Yeah it's there but the texture isn't.
I accidentally deleted it
But I restored it
And now it's not working
The name of the texture is duckbomb.png
For the icon id for the actual item I had just duckbomb
I'm gonna try adding the .png lol
For icon texture you need to name it Item_Youriconname
and then in item.txt file put just Youriconname
ok
Totally fair. To each their own. Changing name of mod (in addition to id) helps for me because I see it a lot during an update ("Kimono X" vs "Kimono" on my modlist).
It's still not working smh
For the icon texture it's named Item_duckbomb.png
For the .txt file I have duckbomb
Am I missing the Item_?
Png is file type
But name isnt?
No when I go to remove .png it's giving me the unstable error
You know what, zip it and send it to me and we will see
The only issue is missing icon?
i got it
Do you have that icon in texture folder?
Is it a size issue? Like is your png to many pixels
my png is 32x32
you did not add i"tem" to Duckbomb.png
Ok nvm
it should be Item_Duckbomb
😭🙏
i thought i did
maybe im not cut out for modding man
It's not working still
why wont the little guy work
imma try adding item_duckbomb to the .txt
maybe that will work 🤷♂️
That wont
Well
What the fuck
What is going on
Ok
So the crafting works
But now I can't even spawn the item in the game
And when I craft it
I get an error
What did you do
I legit don't know
I didn't mess with any of the code except for display name
It's now not even an item ig
Hi there. I'm trying to create a mod that replaces the zombie growl noises, and to do so without just editing the soundpack. I have a script file that seems like it should set the sounds up correctly, but it doesn't.
I'm perfectly happy doing this with lua if necessary, but I'm not sure how to hook into the game to make it happen.
I can see by doing some searching that many people have asked this exact question, but I'm having trouble finding concrete information
file name schemes are case sensitive
the blackouts crew is cooking

I should have mentioned i have it all fixed. I just need to figure out how to update my preexisting workshop file.
you just do the same way as uploading as long as the mod.info uses the same workshop id
and it will ask if you want to update the mod
also updating the mod doesnt change the workshop.txt file, so if you made any changes to it, copy it from steam and paste it into the editor
i have lost workshop descriptions too many times
Additionally, it doesn't help that the growl sounds aren't logged in the debugger, like a bunch of other sounds are :)
have you seen any other mods that do replace zombie sounds without requiring the user to replace the file?
the bgm and zombie sound mods are always the ones i see that require user action to install
I see a lot of those as well. I feel like I saw someone claiming that it can actually be done without editing the files directly during one of my searches around here, but I lost it along the way.
Here's a message from a few years ago that provides some good leads
Additionally, is there anything that describes in details how the script blocks work? I see that sound clip blocks can have event fields and file fields, but I get the feeling they don't interact but instead describe different sources, and I'd love to see something describe the various schema for these blocks
https://pzwiki.net/wiki/Scripts_guide/Sound_Script_Guide
check if this has what you need
event means it triggers an fmod event instead of directly playing a sound
basically just patching over the old sound scripts for the new sound engine
I DID IT
unless you're replacing the soundbank entirely mods can't create events so they're not much use
I just had to name the sound as the same names used by the vanilla scripts
Thanks for your help everybody <3
congrats on figuring it out!
@bronze yoke What if you just made a mod shut down without saving and required people to run routine saving and made everyone quit before you triggered the exit without saving?
Would that be possible using system agnostic Lua commands?
probably?
🤔 now I have an urge to fish around in the Javadoc about this
earlier versions did just quit without saving, just the data loss was too annoying
Can't you just delay the quit for X minutes after kicking everyone?
Or will it not routinely save after everyone is gone?
i'm not sure because kicking everyone is pretty much the same as saving
Right so why so much data loss? So confused
everyone's chunks unload and therefore get saved, maybe things like gametime and global mod data get data loss though
Hmmm
I am trying to write code that lets me add a delayed broacast message to the in-game radio and I don't know what is wrong. Could someone have a look at my code?
radioScript:AddBroadcast(bc, true);
channel:AddRadioScript(radioScript);```
For the full file:
I found out what I had to do. I had added the broadcast to the list of broadcasts, but had yet to set it as the active broadcast.
I also set the radioscript name and ID to not always be the same as if they are the same you cannot properly set the active script.
#mod_support message @bronze yoke When you said this, were you suggesting that /quit (the "admin command") is a perfectly safe and effective way of saving and shutting down server?
as far as i know
So is there something wrong with SendCommandToServer("/quit")?
I mean it just claimed to work when I called it, but I am new to this being an issue.
It said server shutdown safely, map and player data saved.
you'd need an admin to send it
Just posted my 3rd original mod in which I learned a lot from this server with modeling and coding. Thanks a lot, I hope you enjoy it
https://steamcommunity.com/sharedfiles/filedetails/?id=3296810121
finally...
almost done
Is it floating?
it was in that screenshot, its been fixed
So all you would need is to set one client admin for a frame and then send that right? Is that not a fairly viable solution for some reason that is not obvious to my peanut brain?
Because if UUD is not working as expected and that admin command IS safe, I might take a crack at an updated version
It doesn't seem that bad
it seems like a bad idea
To give someone admin for a frame you mean?
yeah
I see.
does anyone know how to make the vehicle type heavy duty?
Would they have to become god?
And thus lose damage and such?
Or could they be made a non-god admin without healing them
Or are you just concerned about what someone might pull off in the frame they have available?
not sure, that's the vanilla behaviour but it might be part of the command rather than part of becoming admin
yeah
Hmm
it's a vulnerability that i think most servers that would use a mod like this wouldn't want
i'm not sure you can really do it 'for a frame' either
Perhaps autoadmin could be an optional feature?
And the default behavior could require an admin to be online?
you'd have to admin them, then have them send the command, and have them still be admin when the command arrives
Does setAdmin get permission from server to work?
the server will absolutely check permissions on its end before running any command
otherwise all hacked clients have to do is say 'ban everyone' and the server just trusts it? 😅
I'm aware the server would want to check the player's admin state, but when and how is my question
I was thinking as soon as you call setAdmin a command might go out to the server that will inevitably make you admin
And if I immediately call a command requiring admin after that
Would server not be aware that I am admin in time?
that's relying on them arriving in order which isn't guaranteed
Fair
and a command that can make you an admin might be an even bigger vulnerability
Well I mean that already exists, I would just be calling it, to be clear.
i'm unsure if there's actually any way to guaranteed unadmin them and have the command go through when doing this
since you can't really catch the command arriving to my knowledge, and lua will probably stop running once the command goes through
Why would you need to unadmin them..?
That happens automatically when server closes?
People don't stay admin between sessions right?
aren't admins saved to a database?
there's a field for it in the player database, i assume admining midgame will update that
Not to my knowledge. When I admin mid-game and then quit and rejoin, I am no longer admin
In fact I am unaware of how exactly to make a normal player permanent admin
Only way I know of to be admin immediately at login is to login to server as admin
Afaik...
hmm, well sounds like you have more experience with it than i do
I'll test again now for giggles
Just made myself admin...
Closing, reopening...
Jeopardy noises...
No longer admin
Yeah Idk if this is just like clientside global mod data though
Works for you and not for me lol
But afaik this is how it's worked as long as I've played
And it's kind of been annoying in the past but could be convenient in theory here
i actually don't see this permissions field anymore so i guess i misremembered it
is admining actually that annoying...? that seems like a massive pain for big dedis
I think some probably have workarounds in place but yeah vanilla as far as I know this is it
Maybe some auto-admin mods or somethin that keep a database of their admins' names.
For some reason my mod doesn't appear on the recent page in the workshop, like a shadowban. Which is pretty rare since I haven't heard of that on steam ever, I also checked the community guideline for the workshop.
The file is on public, it has the mod id and eveything uploaded correctly, any guess?
I also tried uploading it again
version=1
id=3296852138
title=More Jackets
description=Adds 6 new pieces of clothing and original icons, including:
description=-Canvas Jacket
description=-Denim Vest
description=-Punk Jacket
description=-Racer Jacket
description=-Tactical Jacket
description=-Pocket Hoodie
description=
description=Expect to find them in their contextful places, like bars, army bedrooms, gym lockers, wardrobes, and on full clothed zomboids! Enjoy.
description=
description=Credits to Spongie for the opened jackets models, and BongoRaccoon32 for teaching and helping me with the original models.
tags=Build 41;Clothing/Armor;Items;Realistic;Textures
visibility=public
hey! does anyone know how to change a modded vehicles vehicle type?
man i hope you figure it out. you have been working on this for days now. when you finally finish it, whats the name gonna be so i can check it out?
it will be "franklin cabover"
ight bet.
Is anyone on that could help me?
everything works with my mod, ii could even upload it to steam but just the mod doesnt show up in game
i messed it up while tinkering with it to be able to upload it to steam.
hey does anyone know if there is a code in Lua for resetting progress of a perk? I dont see anything on the perks profile
also can perks go past level 10?
most of it is making it look good now, having a catistrophic error tho
What even is this dawg😭
another issue.....
still floating... and the big hole
Outplayed - The ultimate capture app for gamers. While playing, it automatically captures your best moments and biggest plays. When the match is over, relive your best (and not so best) moments by watching them in the match timeline.
Outplayed - The ultimate capture app for gamers. While playing, it automatically captures your best moments and biggest plays. When the match is over, relive your best (and not so best) moments by watching them in the match timeline.
i should maybe take a break until tommorrow.....
Hey guys just a general question, is learning lua for modding worth it?
hows this look?
Yes. If you plan on doing literally anything else besides editing item/recipe definitions, translations or textures then you will need to know it to be able to 'extensively' mod the game.
Has anyone developed a sprinter zone mod? Or a mod where you can create zones and customize the zeds in there?
I love you
ive got a list of errors that is slowly getting smaller
ok.
and where do i even start with learning lua?
Youtube?
Is it possible to get player information? Like for example:
player:getHealth() or
player:getStats():getHunger()
player:getStats():getThirst()
This is official manual for Lua. It is lots of words and not a lot of images, but it teaches you Lua pretty good. You can also use YouTube as well although I can't guarantee the quality of information as it depends on each video. You could probably use a combo of both to get the best amount of knowledge.
programming in lua is a pretty digestible rundown of lua too https://www.lua.org/pil/contents.html
a lot of people try to just learn from looking at other mods and that does help but if you don't read up on how the language works you'll miss a lot of basic understanding
oh wait yeah thats how I learned it
well I read both but I thought pil was the manual initially
I made a update for the CRM mod, and added the rick grimes backpack from the series
@pine patio
Hello!
I am the author of of Handlebar's Cured Meat. (my personal venture to learning coding through making simple, but vanilla friendly mods)
https://steamcommunity.com/sharedfiles/filedetails/?id=3266738501
I've recently had some help to add in additional conditions that maintain the diversity of fish filets via function.
Works perfect in Solo, however in a Multiplayer server food immediately vanishes once I place it in my inventory after being cured. It is not a mod conflict as I have run it as the only mod and it is reproduceable every time.
Any ideas or suggestions?
The function is located within lua\server.
could you post the code?
Yes. I'll post the function, the recipe and items are unremarkable
And a sample of items.txt
item HNDLBR_PrepFish
{
DisplayName = Prepped Fish,
DisplayCategory = Food,
Type = Food,
Weight = 0.35,
Icon = HNDLBRPrepFish,
FoodType = Fish,
IsCookable = TRUE,
DangerousUncooked = TRUE,
OnCooked = MamaCookbook_HNDLBR_CookMeat,
MinutesToCook = 300,
MinutesToBurn = 360,
DaysFresh = 1,
DaysTotallyRotten = 3,
HungerChange = -15,
ThirstChange = 5,
Carbohydrates = 0,
Proteins = 18,
Lipids = 1,
Calories = 205,
WorldStaticModel = HNDLBRPrepFish_Ground,
Tags = FishMeat,
}
item HNDLBR_CuredFish
{
DisplayName = Cured Fish,
DisplayCategory = Food,
Type = Food,
Weight = 0.28,
Icon = HNDLBRCuredFish,
FoodType = Fish,
DaysFresh = 14,
DaysTotallyRotten = 60,
HungerChange = -15,
ThirstChange = 5,
Carbohydrates = 0,
Proteins = 18,
Lipids = 1,
Calories = 180,
WorldStaticModel = HNDLBRCuredFish_Ground,
Tags = FishMeat,
EvolvedRecipe = Pizza:20;Stew:20;Stir fry Griddle Pan:20;Stir fry:20;Sandwich:10;Sandwich Baguette:10;Salad:10;Roasted Vegetables:20;PastaPot:20;PastaPan:20;RicePot:20;RicePan:20;Taco:20;Burrito:20;Omelette:10;Soup:20,
}```
and a recipe snippet
{
keep [Recipe.GetItemTypes.SharpKnife]/[Recipe.GetItemTypes.Saw]/Axe/HandAxe/AxeStone/WoodAxe/MeatCleaver,
FishFillet,
Salt/HNDLBR_ContainerSalt;2,
Result :HNDLBR_PrepFish,
OnCreate :MamaCookbook_HNDLBR_CureMeat,
Time :250,
Category :Cooking,
OnGiveXP :Recipe.OnGiveXP.Cooking3,
AnimNode :Craft,
}```
I don't think items or recipe are it, as it worked fine before the function.
is it after cooking that the issue occurs?
So the process goes.
Prep food - ok
Place in Oven - ok
Meat is cooked and can sit in oven - ok (i can leave it indefinitely no issues.)
Move meat to inventory - it vanishes instantly or within .5 second.
hmm, my concern is that OnCooked might get called on the client, which means the items it creates aren't 'real'
there's a function to work around that but if it's getting called on the client it might create an opposite issue where an item gets created by every client in range?
i'm loading into a debug server to check if that is actually the case
Ok. I appreciate your help!
yeah, it runs on the client...
you can do```lua
-- when adding the new
local container = theMeat:getContainer()
local cookedMeat = container:AddItem(cookedMeatType)
container:addItemOnServer(cookedMeat)
-- when removing the old
container:Remove(theMeat)
container:removeItemOnServer(theMeat)
if it runs on the client, then the function is probably going to run on each client in range, and you'll end up with that many copies of the item...
Ok. Hmmm. Perhaps I'm going about it the wrong way using a function.
Do you know of another way ti preserve an items data(calories, weight, nutrition levels etc) other than using a function.
I'm not sure how the game currently handles making filets from different size fish, then maintaining that through the cooking process.
I suppose I need to dig some more.
i think the fillets are made similarly to how you do it, but if i remember right i don't think cooked fillets are a different item, so they don't hit this pitfall
if instanceof(sourceItem, "Food") then
return sourceItem:getActualWeight() > 1.0
end
return true
end
function Recipe.OnCreate.CutFillet(items, result, player)
local fillet = nil
for i=0,items:size() - 1 do
if items:get(i):getType() == "FishFillet" then
fillet = items:get(i)
break
end
end
if fillet then
local hunger = math.max(fillet:getBaseHunger(), fillet:getHungChange())
fillet:setBaseHunger(hunger * 0.5)
fillet:setHungChange(fillet:getBaseHunger())
fillet:setActualWeight(fillet:getActualWeight() * 0.5)
result:setBaseHunger(fillet:getBaseHunger())
result:setHungChange(fillet:getBaseHunger())
result:setActualWeight(fillet:getActualWeight())
result:setWeight(result:getActualWeight())
result:setCustomWeight(true)
result:setCarbohydrates(fillet:getCarbohydrates());
result:setLipids(fillet:getLipids());
result:setProteins(fillet:getProteins());
result:setCalories(fillet:getCalories());
end
end```
I found this.
is there a way to adjust the volume on a gridsquare playSound command? example: getSquare():playSound("LightSwitch") I would imagine this sound is added to the ambient sound?
https://outplayed.tv/media/KxGNWK
clip from testing my mod this morning (its been fixed)
its so funny
Outplayed - The ultimate capture app for gamers. While playing, it automatically captures your best moments and biggest plays. When the match is over, relive your best (and not so best) moments by watching them in the match timeline.
Good night folks!
Has anyone found a way to modify the Intro Background?
I know you can change the text on it through the UI_EN, and you can change the image on the Main Menu, but I haven't been able to find a way to change the Intro Background itself, would really appreciate some help with that if someone knows.
what's the best way to get the overall lighting color of the square the player is standing on?
Excuse me, I would like to develop a mod for a game that requires writing some Lua scripts. Where can I find the development documentation and APIs
thanks every one
https://www.lua.org/manual/5.4/manual.html
This is official manual for Lua. It is lots of words and not a lot of images, but it teaches you Lua pretty good. You can also use YouTube as well although I can't guarantee the quality of information as it depends on each video. You could probably use a combo of both to get the best amount of knowledge.
Also my general copy paste advice for Lua stuff that will save your brain:
Get Microsoft's Visual Studio Code which is an epic text editor for scripting languages like Lua: https://code.visualstudio.com/
In VSCode, get the extensions:
Lua LSP (https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
Umbrella (read install guide here: https://github.com/asledgehammer/Umbrella?tab=readme-ov-file#addon-manager-vscode-only)
The rest of extensions are personal preferences like themes are.
Read pinned messages in mod_development
Have fun (boom)
Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.
A collection of LuaCAT typings for Project Zomboid's API - asledgehammer/Umbrella
thanks very much
I was wrong to suggest the manual as the first material to read, use PIL instead of the manual like albion mentioned (https://www.lua.org/pil/1.html), when I wrote this I kinda forgot that PIL existed
I mean still read the manual but I'd only recommend reading it like well after you've understood Lua's concepts.
.
Thanks
I am curious if people in the modding space are even slightly open to the idea of multiple developers on projects. Considering most of the mod developers I have seen don't use github or any version management software, I assume it doesn't cross people's minds.
Yeah, Chuck, actually. You can join the modding server if you're interested in such projects. https://discord.com/channels/136501320340209664/1125248330595848192
I am actually already in it, I didn't know people posted stuff like asking for collaborators though
Check the project channel
I see, so there are people that post this stuff. I was just curious and sadly don't have time to contribute to much of anything including my own mods which is a bit annoying honestly
I myself have a group working on TLOU related mods, tho we mostly do things on your own sides but at least we can share knowledge and ideas
I myself don't have much time for group work
I've been trying to will the Community Projects idea off the ground, but I really should start putting in work lol.
The concept for this is to pool together small fixes/tweaks that don't really warrant their own mod. Also more drastic changes to the vanilla Lua in places where it's written poorly for mod compatibility.
That aside, the community projects has a Steam account associated with it to handle uploads - and with Steam's recent change to collaborators being able to upload - you can actually let the account handle uploads from github for a project you maybe don't have time for.
PZNS (Project Zomboid NPC Spawning Framework) did this
The main idea is ape together strong
As something like full fledge NPCs would take years of fulltime work lol
but also I see with every new wave of modders people reinvent the same utility functions and tricks
I was wondering how people go about that since you need the 2FA seed to use account and upload to workshop, but I guess you could have a separate account without 2FA as a contributor (I think that's only way considering you can't get 2FA seed from steam mobile authenticator anymore)
I have the account name and password hashed on github
2fa is a one time check
So I just turned it off/on 😅
Only issue was when the ToS got updated
To clarify you need 2fa to post new workshop items
You don't need it to update
But yeah, aside from the fact you can't share secrets on github - it's a pretty smooth process
could even be worked off a fork - as I'm sure people wouldn't routinely change ownership over
ayeeeee
Ok!
Is it possible to change an items fresh time after it's cooked?
Like say a burger raw would be rotten in a day, but cooked burger would last 5 days? (Just a generic example)
i do have a couple thoughts about that
a) if it's allowed, you could use an oncooked function to set the food's age to a negative number - if it's allowed because it might be that it'll refuse to save a negative number and reset or going negative might disable aging entirely
b) if not, make the food's fresh time the cooked one, set its age up when it spawns, and set it to zero when it's cooked
actually, don't jars need to be cooked to work? have you looked at how they do it?
oh, you can just set the maximum age directly apparently!
I have not. Still trying to figure out the issue maintaining fish weight. So I'm going to use the same item, rather than creating a new one, but I want it's fresh time to increase once it is cooked
use an OnCooked function that calls:
local age = food:getAge() / food:getOffAgeMax()
food:setOffAgeMax(newDaysToRot)
food:setOffAge(newDaysFresh)
food:setAge(newDaysToRot * age)
i didn't suggest that before because items don't usually save properties like that, but that's how the jars of vegetables do it
Ah. So I can just add that. This may be the silver bullet I needed!
Hey.. How can I make a sound repetable?
I have a sandbox option which is a string
page = DZ_Speech_Page1,
type = string, default = The sun is up!,
translation = DZ_Speech_Daylight_Interval0, valueTranslation = DZ_Speech_Daylight_Interval0,
}```
Is there a way for me to make the default string look at the language translation for its value instead? I have tried to prefix it with `Sandbox_` but that did not work
I think you should set loop to true like this
Any idea what I'm doing wrong, not seeming to be called when item is Cooked
Function
local aged = curedMeat:getAge() / curedMeat:getOffAgeMax();
curedMeat:setOffAgeMax(60);
curedMeat:setOffAge(30);
curedMeat:setAge(1);
end```
Item
``` item HNDLBR_PrepFish
{
DisplayName = Cureddd Fish,
DisplayCategory = Food,
Type = Food,
Weight = 0.35,
Icon = HNDLBRPrepFish,
FoodType = Fish,
IsCookable = TRUE,
DangerousUncooked = TRUE,
/*** ReplaceOnCooked = HNDLBR_CuredFish, ***/
MinutesToCook = 300,
MinutesToBurn = 360,
OnCooked = Recipe.OnCooked.CuredMeat,
DaysFresh = 1,
DaysTotallyRotten = 3,
HungerChange = -15,
ThirstChange = 5,
Carbohydrates = 0,
Proteins = 18,
Lipids = 1,
Calories = 205,
WorldStaticModel = HNDLBRPrepFish_Ground,
Tags = FishMeat,
}
```
OnCooked functions can't be in tables, it doesn't look for them properly
try something like Recipe_OnCooked_CuredMeat instead
is there a way to force the overlay to update on a container?
I tried this but it just errored out... updateOverlaySprite(IsoObject obj)
Huzzah, worked. Cheers
I only need to put in loop = true? 🙂
I think so
there are alot of unused textures
6 unused vehicle textures!
7 actually
8!!
9!!!!!!!!!!!
current list of errors with my mod
inters and exits from the car via the framerails
weird red stuff
weird pink stuff
weird blue stuff
lighting is odd
headlight texture doesnt work
and the glass doesnt change
Does anyone know how i can i use ISInventoryTransferAction to transfert item from a cell's floor to the player inv ?
Where ?
I noticed a built-in lua script in "media\lua\shared\keyBinding.lua" that only has a table with keybinds names and values. is that where the game stores and keeps track of binds? modifying the keybinds in the pause menu then printing the object doesn't seem to change it, is this how we can access and modify keybinds at run-time?
this is the code I'm using to print the "Forward" bind:
local KEY_2 = 3
local function OnKeyPressed(key)
if key == KEY_2 then
for k,v in pairs(keyBinding) do
if keyBinding[k].value == "Forward" then
print("Forward Key: ", keyBinding[k].key)
end
end
end
end
Hello all,
after several months of mod development (public and private), I've come to wonder about creating a tooltip framework.
Too often I see an ISTooltip:render “hook”, which leads to hooks of hooks of hooks, and so on.
Whereas if render() were coded to support a “customTooltip” modData for each item, there'd be no need to hook this render function every time : everything would be done in an item's modData.
What do you think about that idea ?
i got a question
if i make clothing piece
with multiple possible textures it can spawn with
and i select said clothing piece whilst creating a character for a new game
and while scrolling for the texture i want on it
is it possible to make so that each texture in the character creator will show up as the name i intended for it instead of just being type 1,2,3,4,5 etc etc
but instead for example: Private, PFC, Specialist, CPL, SGT, Staff SGT etc
This is due ALSO to the knowledge being inside a damn discord which makes hell to find knowledge as discord is a closed platform with an horrible search.
Great to chat, horrible for massive communities that want to knowledge share. I will never stop crying the "death" of the indie stone forums (https://theindiestone.com/forums/index.php?/forum/45-pz-modding/)
Anyway, it's a good idea and I think it would be great to have a sort of "unofficial community patch" a la Skyrim has in which multiple people contribute to fix/improve things that are usually considered "essential mods"
However, I don't know how much it will clash with the classic "modders' ego". I for one would love if more people would contribute to my mod. The main reason I stopped working on it actively (beside waiting for b42) is because I just don't have proper knowledge of PZ apis and inner working as other modders have and don't have motivation to go indiana jhones and dig them out of discord seach or chase people around the discord
There's a few tools that open up the API somewhat
I haven't run into an ego issue yet, at least when it comes to the community repo, it's mostly people just not having the time/motivation to work on an ambiguous project of QoL fixes.
I've considered reaching out to consolidate / reimplements fixes around the workshop, but I'm kind of wary of that.
Oh yeah, I was talking more in the general sense. Modding is usually a passion project for people and with that comes a sense of belonging usually. It's not unheard that people who makes mod take... decisions based on ego rather than the good of the community using a mod. Until now I have not encountered ego-driven modders as well for PZ
All this does is hardcode define some keybinds for quick testing in development of Lua scripts, this is not a substitute to access keybinds in the game. As you can see from the Lua below, it sets a static keycode for each bind, it does not get the binds from the game that the user has set.
bind = {};
bind.value = "Forward";
bind.key = 17;
table.insert(keyBinding, bind);
bind = {};
bind.value = "Backward";
bind.key = 31;
table.insert(keyBinding, bind);
You should be able to do this to get certain keybinds live in-game
local forward_bind = getCore():getKey("Forward") -- Gets 17 by default
local is_forward = isKeyDown(forward_bind) -- True on Key Down, False on Key Up
local foward_pressed = isKeyPressed(forward_bind) -- False on Key Down, True on Key Up (but only after Key Down)
Hey all, I'm new to this server and new to modding. I'm hoping to get some help on beginner stuff. If I want to make a mod that will change what zeds do how would I go about doing that, with out changing the base zombies. In Java I believe that would be overloading.
[...] change what zeds do
[...] with out changing the base zombies
You will need to elaborate a bit more I am afraid
So I want to keep basic zombies the same, but I also want to add a mod that will allow some of them to behave differently, i.e. slow the player down when in a certain radius to that specific zombie.
Oh that makes sense. So it's more of a hardcodded "default" binds. Thanks!
sorry, forgot to hit reply to answer that.
There's a framework in production for this
you are talking about adding new features to the game altogether I am afraid. It's not something that simple. I would start with thinking how you can add those effects to the game. Getting to add them to the zombies might not be that complicated
gotcha. Is that sort of thing something I would be able to do to items, for instance, shoes that make you move faster.
ill check this out. ty!
Does anyone of a mod that degrades tools when being used as tools?
like scissors have a chance of losing durability when you rip leather or jeans?
or hammers when you build something
or saws when you saw logs
etc
Cause I feel after you find your 1st hammer, saw, screwdriver, scissor you don't need a 2nd one
Unless you use them for combat
hey is mod.info require="XXXX" patchable? example: i want to patch mod to remove library dependency
I'm sure you have a slight chance of doing it using some file trickery but honestly I don't think it's worth it considering the unexpected results that removing a dependency gives.
No
well, only way i come up with was to add empty mod with same mod id as that removed dependency. but its more like moving problem somewhere else rather than solution.
Hmm
Usually is never a good idea doing that
yea. so uploading modified version without dependency makes more sense than patch
can someone please fact check me on this, I'm still new to modding zomboid and this is what I concluded based on my research:
-IsoGridSquare represents one tile in the game
-IsoChunk represents a chunk which is 10x10 tiles (not often used as far as I can tell)
-IsoCell represents one big square of 300x300 tiles (30x30 chunks)
but then what about the player cell? the one in white when looking at the zombie population window which is about 2 thirds of the size of a cell and causes zombies outside to become simulated, what class is it and how can I access it (size, start/end position etc...)?
Yes
the player is cell is just Cell
I believe
I assume this dependency is for some reason not needed(?)
it seams to return a IsoCell object, is it different than the IsoCell retrieved by other functins?
Hmm
Give me a sec
IsoCell is the player cell
Not sure if you can access the 300x300 cell
But I'm pretty sure they aren't IsoCell
(was the other way around)
hmm.. that's confusing. for example IsoGridSquare which represents one tile as far as I can tell has a function getCell() that returns a IsoCell object, is it different than the player?
I appreciate your help this is really confusing lol
I didn't knew getCell was a thing for other stuff too
So I guess they are IsoCell either way
But IsoCell of player is centered on the player
So it's a mobile cell
@sour island is that right ?
yeah that's my theory so far but I have no way to confirm it on my own, I'm guessing IsoCell of the player is unique in that its size is different and it doesn't snap to the grid
player IsoCell is player centered but tile cells are not tile centered ? Or are they tile centered too ?
What you could do is, access IsoCell of 2 different tiles in the same 300x300 cell
And see if it's the same
im trying to split fancyhandwork from brutalhandwork, because fancy breaking animations and i still want offhand attack for only cure, only for situations when somebody without proestetic can attack, so i dont rly care for bad sync of that attack. but fancy conflicts with stuff like playing music from lifestyle
The term cell is used in two different places to mean 1. the cell of a map which is 300x300 and the loaded cell
ooh that's a lead
Yeah I know but both are IsoCell ?
Or is the 300x300 cell not an IsoCell
IsoCell I think is the loaded one
er
declaration: package: zombie.iso, class: IsoGridSquare
yeah it seems tiles and chunks both return an IsoCell object
You can getCell on tiles
getCell returns an IsoCell*
getCell returns the cell you're currently in yes
but squares in that cell might not be loaded
That's your loaded cell, centered on player you're talking about ?
I meant to say IsoGridSquare:getCell() and IsoChunk:getCell() both are a thing and both return a IsoCell
Yes ik, but rectifying to not add to the confusion
Cell in this case is the x300 area - but it gets weird
I would honestly need to refresh my memory before giving advice
So the 300x300 cells (tile:getCell()) and the player:getCell() are both IsoCell ?
yea
but they always have a home cell
In MP can be less
though the player cell is smaller, not sure how much but visually it appears about 2 thirds of a regular world cell
Player IsoCell in MP is smaller
75x75 iirc
it's probably 50x50 then
In solo it's bigger
I remember doing tests with ehe and the maximum a square could be found was 75 tiles away
the white rectangle is basically what I'm trying to access
I'll continue to throw things at the wall until I figure something out, if you guys have any ideas please let me know
Which white rectangle
Around player ? Or the grid ?
the one around the player, the smaller one not the grid
You do player:getCell() for that one
okay I'll try that
getCell returns the home cell iirc
wdym the home cell ?
isoChunk is the radius around the player
iso chunk is 10x10 in size, I tested that by printing its size in lua
I use getCell to access zombie objects around a player
Yeah it's stupid
I'm not sure if you can access size and limits from lua. The cell scales with resolution among other things.
Same terms makes it confusing asf
It's also why it's confusing to have getCell() for tiles
well tiles are in a cell
Yeah but it's not the same type of cell ?
I doubt the size of chunks and cells change with zoom level, the number of visible tiles does but the size should remain the same
the cell I'm talking about as home cell is the xyz cell
Or is getCell() the cell around player
Well for player it is
player:getCell() outputs IsoCell
It's the loaded area of the player
And I can ASSURE you it's in fact the player loaded cell
That's where all the confusion comes from
I'll defer to you as I haven't messed with it in months
everytime I try to learn something new about zomboid modding I end up spending days researching and diving into rabbit holes XD I wish there were official documentations for everything
a) cell only, not chunks
b) resolution, not zoom
by printing the width and height of both the player cell player:getCell() and the cell returned by a tile IsoGridSquare:getCell() I seem to get the same results
print("Player cell (IsoCell):")
local player_cell = getPlayer():getCell() -- IsoCell
print("Width:" .. tostring(player_cell:getWidthInTiles()))
print("Height:" .. tostring(player_cell:getHeightInTiles()))
local square = getPlayer():getCurrentSquare() -- IsoGridSquare
print("Player tile cell (IsoCell):")
local tile_cell = square:getCell() -- IsoCell
print("Width:" .. tostring(tile_cell:getWidthInTiles()))
print("Height:" .. tostring(tile_cell:getHeightInTiles()))
result:
Player cell (IsoCell):
Width:170
Height:170
Player tile cell (IsoCell):
Width:170
Height:170
I didn't even know there is a cell with size 170x170 😵💫
Does anyone know how to fix this issue?
Lua cell is not same as map cell
Lua only fetches what's visible to the player, which is dependent on their screen resolution iirc
okay so the exposed API doesn't allow access to the big 300x300 cells if I understand you?
@dawn portal
IsoChunkMap CalcChunkWidth, that calculates the area loaded for player afaik.
ooh I didn't notice this class before. this is starting to make sense, I now understand what you were trying to say before about the screen resolution affecting the player cell size
300x300 is just the size of a map cell. Has nothing to do with the loaded area of a player
yeah I'm saying do we not have access to those map cells? and instead IsoCell only represents the player area, because in that case I'm confused about how many classes including tiles have a getCell function
Some of that is legacy code.
Map cells are mainly used when a new chunk is loaded for first time.
cute proots
Thank you!
I with the blue one was just a tad darker, it would fit my sona better
Could you please explain what the if isClient() then return end placeholder is used for in server files?
it stops the file running on the client
misleadingly files in the server folder will run on the client
Try repairing it. If the red goes away it’s because of the damage overlay code or something by repair it I mean the vehicle spawn section
IsoCell is a singleton, it contains the entire currently loaded area around the player (or up to four splitscreen players, or on the server it will contain the area around every single player), there is only ever one and all functions that return a cell return the same one - getCell() functions existing on different kinds of objects is just a legacy thing from when there actually was more than one cell and objects belonged to different ones, now they all do exactly the same thing
IsoChunks are 10x10 square areas, the game saves and loads in chunks so a chunk will never be half loaded
IsoGridSquares are single tile areas (though they can and almost always do contain multiple tile objects so it's not exactly accurate to call them tiles)
the 300x300 'map cells' don't really exist in any major way at runtime, they're used for some meta simulation stuff (e.g. zombies migrating in unloaded areas) but you can't really get at them with lua and you wouldn't really be able to do much interesting with them anyway
sorry to dump paragraphs on you but i see persistent misinformation about these 😓
Ooooo you could be right I didn’t think of that
I haven’t don’t the damage overlays yet…
Yeh seems to be pulling a default texture from one of those it looks like
Gonna test that now…
yup, rust and damage textures missing causes it
thanks so many!!!!!!
how do i make a recipe give skill xp, and how do i lock a recipe behind a skill level?
https://pzwiki.net/wiki/Scripts_guide/Recipe_Script_Guide
You can use these two properties: SkillRequired, OnGiveXP.
OnGiveXP needs a function name that gives the xp to player, you can use an existing one or create a custom one.
duuuude thank you so much this is immensely helpful! I spent days searching for this kind of information. I'm writting my own modding guide that will grow and expand as I learn more, it might take months or years before it's finished but this is definetly going into it! thanks again!
Is it possible that the command square:AddTileObject(tree) creates a tree in single-player mode but stops working on the server? However, the attempt to remove objects with square:removeAllButFloor(square) works on both the client and server sides.
server/Farming
local square = self:getSquare()
if IsoTree and IsoTree.new then
removeAllButFloor(square)
-- FIXME: by default "e_americanholly_1_3" get current tree sprite getSprite(sprite)
local tree = IsoTree.new(square, "e_americanholly_1_3")
square:AddTileObject(tree)
end
I just double-checked, and it turns out the tree only appears after restarting the server. That is, the LuaObject removal and square clearing happen immediately, but the tree is added only after a server restart. Does anyone know if there's a way to trigger the IsoTree object recalculation method without negatively impacting performance
this needs to be pinned
if you're adding it on the server clients won't know about it until they reload that chunk (perhaps by reconnecting), try calling square:transmitAddObjectToSquare(tree, tree:getObjectIndex()) after adding the object
Thank you for your help. I'll try that now. If you don't mind, I have one more question: To change the number of logs obtained, do I just need to use this?
tree:LogYield = 1
no, you can't write to fields (and reading from them is pretty complicated), i'm not sure there's any way to change that value
I wonder why there's no getters and setters for stuff like that
by the way, maybe :transmitCompleteItemToClients() would work here?? I'll give it a try, and if it works, I'll let you know.
furry zombie config tool is coming along nicely
frickin sparkledogs, man
picked a random eyewatering color for the meme - 10 minutes later, lo and behold
XD))
:transmitCompleteItemToClients()
This option worked, thank you for telling me in which direction to look for the answer!!!
so, question
if i have a large standalone map, is it possible to make multiple lootable maps that uncover different parts of the map?
i dont think you can do that because the lootable map just references the worldmap.xml
it should be. It's how it's done in vanilla.
The most ingenious solution is the simplest solution
also speaking of scrolling through game files
i scrubbed through Distributions.lua, and i cant manage to find the name of the loot pool for bags, like satchels and backpacks and such. does anyone know what theyre called?
it should just be the bag's type
I assume the type is like Base.Bag_Satchel or something
or Base.Satchel
I made a mod about zombie loot and there are all the backpacks there, zombies already in the form of a finished object if necessary
this is in Distributions.lua, right?
https://steamcommunity.com/sharedfiles/filedetails/?l=english&id=3248602631
u can use code from here
Can anyone explain how to make a lua script make the player character play an existing animation? Can't find it by googling around.
look for a zombiid dance mod))
What kind of animation?
Depends what type of action we're talking about here
I'm not sure yet which default one will fit, gonna have to look around. But a short uninteruptable one-time animation.
Any easy way to trigger an animation like that for testing?
there is a command that launches the selected animation on the selected character, look at the dance mod, if I remember correctly, there is also such an approach through the radial menu, also look at the meditation mod, the same logic is there.
u can check Fitness & Workout Overhaul too and more more other mods with chr animation))))
I'll go digging then, thanks for the tip!
good luck
...
Tell us wtf your animation is
And in which conditions it triggers
It doesn't trigger the same based on what and when you want it to trigger
Either crafting, emote, attacking etc
Everything is different
Yes
i just cant find it there, unless control F is broken
if you have it set to match the specific word, it wont show because it isn't just the word "Satchel"
It starts raining, the player character stand still and gets visibly irritated. the way a sim would
aA is the match case, the [_] is the match word
Alright so what you need to do is:
- Check AnimSets, it controls the speed of your animation and triggers the animation based on conditions. Such a condition to trigger animations is usually variables
- the variable that defines your animation can be given to the player at any time with a simple command
player:setVariable("yourVariable",true)which activates your animation (if other conditions if any are respected) and disabled withplayer:setVariable("yourVariable",false)
So what you want to do is:
- give this variable to the player when he's under the rain
- remove it when he's not
a simpler way to just play an animation can be to put them into a timed action (like eating, crafting, etc)
but that will interrupt things like combat and other timed actions
Ah, animations aren't triggered manually, but automatically by something outside of your own script. Do I understand correctly?
Unless you create a timed action for them?
You still need to trigger it sort of the same way
No ?
I'm not familiar with how timed actions trigger animations ngl
... no ?
You can trigger animations by setting a variable in your AnimSets to true
I understand now, thanks!
you just call a function with the name of an animation
uh
let me check an example
setActionAnim
public void setActionAnim(String string) {
this.setAnimVariable("PerformingAction", string);
this.chr.setVariable("IsPerformingAnAction", true);
if (Core.bDebug) {
this.chr.advancedAnimator.printDebugCharacterActions(string);
}
}
Yeah so that's setVariable
Basically
i'd expect everything to be setvariable, that's how the animation system works
Hey, this is kinda unrelated to the whole animation debacle that is happening above but if there is anyone who prefers IDEA over say VSCode for Lua mods, is there a main reason apart from personal preference? I'd assume maybe it is more 'powerful' than vscode because it's an IDE and not just a text editor, but I am unsure where the pros and cons lie as I do not use it myself. I am thinking about giving it a whirl but the only downside that I dislike is IntelliJ's font renderer breaks a lot of fonts 😦
so intellij was a completely ridiculous choice for a pretty long time considering it hasn't supported lua for about two years
* I do not use it for Lua I mean
but as of last month it does support lua again, and while it's a liiittle worse than vscode's, it's fine
i personally like jetbrains ides a lot, i think that's a big part of what brings a lot of people to it
I do prefer them too, especially like for C++ like I mean sure VS has gotten a lot better but it's still slow as bricks and not cross platform
i'm personally a little split on whether to switch over to idea myself now, i used it way back when it did sort of support lua (much worse than what we have now though) and while the new lua plugin is a bit rough to use (no in-ide configuration is the most obvious complaint from me) it is fully featured
i think being able to look at the java in a java-specific ide is a noteworthy benefit
in general i find its code searching functions faster/more reliable than vscode's
yes I agree it's like 100x better
my vscode workspace can take up to 30 seconds for searches
to be fair all my mods are in the workspace including the vanilla game luas but stiill
yeah i dont have that enabled
rip idk how its not finding it
i think the big downside here is that you'll be using a less popular option that will be less supported by the community, but if you find it more comfortable i think it's a pretty valid option these days
(and there's a bunch of older modders who still use it because they haven't updated it in over two years when it still worked for lua so you won't be totally alone)
ill give it a test drive for a couple days of modding time and see if I can find any benefits
Although one thing I will say I noticed from just opening my mods workspace is it analysed it way quicker and the intellisense feels immediate
not sure if thats placebo or just the higher amount of resources IDEA uses that vscode does not
oh yes definitely!! i don't have all my mods in one workspace like you do and even then vscode can take quite a bit just to process umbrella, idea feels snappier with that
let me know how you find it, i'm using jetbrains for literally everything else i work on so i'm sort of itching for an excuse to switch back
ok 🐙
its been a while since i made mods i totally forgot how to make models samller in the code i need help lol 😭
you want to dynamically change it?
I think you can change model scale in it's model script definition, but it is set once
i figured it out, i had to mess with export settings in which is weird as i never had to do that before
you can set scale in the model script
you can do it in your modelling software too though
I think intellij is just not the one for lua LOL
god I hate discord's image collage stuff its so ugly
The suggestions thing is so bad, I am unsure if it's linked with the language server or if it's IDEA itself but holy problems. No suggestions, duplicate suggestions, and even completely wrong suggestions lol
But on Java, I've never ever had this issue so I will assume it's the lsp
On top of this, it flags random variables as null (lua doesn't even have null), says some variables are unused while using it literally the next line, highlighting sometimes not working but definitely never works in autocomplete/hover.
As much as I like it's robustness, it just can't perform well enough to be close to good even on smaller projects. But, this becomes worse the more projects you have and the more libraries/dependencies you include as then it really has no idea.
vscode does it really well despite being "only a text editor" as some other people like to criticise it for.
eugh, what a shame
I think it's partly the extension being buggy and partly the fact that the ide didn't have the design of lua in mind at all when developing
the lua addon is built for a generic language server api that jetbrains don't support, so the intellij version goes through some kind of emulator instead, i imagine a lot of these issues are coming up from that
the glimmer of hope here is that jetbrains are actually developing an ide that natively supports that api
but i suppose it'll be another while 😔
Ya
Trying to remove all shotguns/handguns etc. from spawning on zeds on their backs or in the holster:
-- Weapon(s) Attached to Zeds
AttachedWeaponDefinitions.handgunHolster.chance = 0
AttachedWeaponDefinitions.shotgunPolice.chance = 0
AttachedWeaponDefinitions.assaultRifleOnBack.chance = 0
AttachedWeaponDefinitions.huntingRifleOnBack.chance = 0
AttachedWeaponDefinitions.attachedWeaponCustomOutfit.PrivateMilitia.chance = 0
AttachedWeaponDefinitions.attachedWeaponCustomOutfit.Police.chance = 0
AttachedWeaponDefinitions.attachedWeaponCustomOutfit.PoliceState.chance = 0
AttachedWeaponDefinitions.attachedWeaponCustomOutfit.PoliceRiot.chance = 0
Called on Events.OnPostDistributionMerge, but it's not working. Any ideas?
You think its possibile to code a anticlear-lag for safehouse zones?
what do you mean exactly?
if you're concerned about lag spikes when a lot of stuff is happening on the same frame simply because there were a lot of stuff, you can code a routine that feeds in stuff one item per frame. The normal code consumes all items in a loop, and it takes as long as it takes. You just add a break statement at the end of the loop body, so each frame it processes one item at a time, which is a pretty light load. But it takes a few seconds to complete, as opposed to completing instantly (in game time).
Its more like “i dont want clear lag to affect safehouse zones”
Still a cool idea tho
So
Clear a zone
Doesnt clear the same zone if there is a safehouse
I created a clothing mod for my server but when users are patching holes in the clothes they disappear, how can i fix this?
I really hope that TIS chooses to distance themselves from Kahlua2 over time. If they could get their serialization data code out of Kahlua2 and abstract it into a utility or library and interface the rest of the calls to the Events manager for Lua they could eventually go with something like LuaJ which would greatly help with performance slowdown with interops.
It would have to be a multi-staged process. I'm not sure this would be an item of interest / opportunity this late in development though. =/
You'd need to write an abstraction between Kahlua and code execution and then swap out Kahlua when that time comes.
KahluaTable is really most of the library's integration into the codebase. It'd be cool to see what would be done though if this were ever considered by the dev team.
Kahlua is ultimately the strongest option for both familiarity and security as the sandbox is very strong to keep Lua modders out of trouble. LuaJ or other options would need to also have that option or the ability to apply itself through little work to be a possible solution. This is just conjecture / thoughts I thought I'd throw here after a few hundred hours working in the Java bytecode for the past couple months.
Besides Map-related solutions, Kahlua is IMO one of the top 3 main factors behind UPS limits and slowdowns in the game.
kahlua is just a bad implementation of Lua, it works the same as regular lua, but some of its functionality is buggy and/or slow so you avoid it. So "familiarity" is not an argument in its favor in context of modders. Lua itself allows you to simply set relevant system functions to nil and they will not be accessible from scripts, for the means of providing sandboxing, so that's not an argument in its favor either.
the one and only reason to use kahlua is because they chose it to begin with, and the code already exists. For any other implementation of Lua, they'd need to rewrite the entire interfacing code.
or write a 1:1 interfacing library, which is probably even more work due to debugging load
from managerial sandpoint this issue is very low priority. Occasional lag spikes in heavily modded with low quality code games does not detract from their sales.
the strongest argument against "wasting time" replacing kahlua with any other implementation which will by default be a huge upgrade, is that a small handful of players and a couple thousand zombies at a time is not the amount of CPU processing that causes performance issues unless you write exceptionally inefficient code, and at that point having that same code run 5x faster will hardly help - simply installing another mod like that will undo all gains. The core issue there is that the particular modder(s) didn't care or knew how to optimize anything, which is why a trivial task of updating a few hundred entities per frame can even cause frame drops at all. Which is to say, it's nothing to do with kahlua being slow. Complaining about it would be like complaining that chopping trees is too hard and it would be way easier if you had a chainsaw, when you're using the flat side of the axe to hit the trees and you intend to use the flat side of the chainsaw to do it too. It's the gamedev version of buying a more powerful PC to solve performance issues of poorly written code.
or at least that's my perspective on the matter as someone who's been making their own games as a hobby since 2005, and at one point have been doing it professionally
More specifically. Kahlua is about 10x slower than C Lua, and 100x slower than LuaJIT, which runs at speeds close to C++. I figure LuaJ splits the difference. If you use kahlua, it's more or less equivalent of using C but on a 40 MHz CPU. That's more or less 5 millions lines of code per second. If you run into performance issues, it's because you execute more than half a million operations per frame. Clearly the source of the problem is not that it takes too long to execute each individual instruction.
You're doing it at the wrong stage. You want to do it before the distributions are merged. I think I just do this in on game boot but honestly just anywhere before that event is fine. Alternatively you can call a func in ItemPicker. I think it's ItemPicker.reset() and it will reprocess the distributions table although that is kinda wasteful.
You've restated my concerns and the focus of beta is optimization so that perspective and context is explained. It's not complaining. I don't understand that perspective on my statement. Modders have little to no example for coding in Lua standards as the game's codebase doesn't do this.
I agree. When I was performance debugging it was lighting (LightingJNI.dll iirc), then something else, but kahlua was pretty close to the top like you mention 😦
Its not the modders' fault.
Interoperability is poor performance
Going between Java and JNI is also time taken.
kahlua is slow, that is a fact. LuaJ would've been leaps and bounds better, that is also a fact.
This is not the kind of game that requires such massive amounts of computation that this becomes an issue. It becomes an issue when someone loads the game with massive amounts of computation, which didn't actually need to run. Making the entire thing run faster does not remedy the problem (running code that doesn't needs to run), it just masks it for a bit longer.
Java modding would slightly potentially fix these issues, so long as it is supported by steam workshop
Like I am not sure how you would implement that, but how difficult would it be to load a .java file into your game externally?
Surely it'd be similar to loading your own game's java files
Boidin in style
not at all. The issue is that there needs to be a modloaded coded which would provide relevant hooks.
If you squint hard enough, executing .jar files is like executing .lua files.
But it's possible, im just not sure as to how much work it would be that's why I'm not definitive on it
well the python thing already exists and it's basically an alt version of java modding system
i think someone said there were java modloaders for pz too
if all else fails you can just build against the original jars and use mixins to hook into original code, but that approach has all sorts of issues. I'm not an expert but I'm pretty sure 99% of labor in supporting modloader is rewriting mixin definitions each time a new build is released.
so it's kind of a chiken and egg problem. In order for modloaders to exist, there needs to be demand for modloaders. And there's no demand for modloaders which don't exist.
PZ devs might have poisoned the well by opting for Lua modding instead of Java modding
this is no minecraft but there's still hundreds of thoudsands of players
Yes, especially now when if they were to adopt java modding over Lua, all the mods would stop working which would make heavily modded servers out of action for a long while.
I guess you could use both but at that point it's too complex, even more so than just using one or other
I don't think it's too complex at all. NMS has modding in both Lua and C# and it's completely fine, everyone has a great time.
does C# has a good JIT yet?
actually curious. Last I remember Unity was spearheading development of one by making their own weird version which you had to jump through hoops to even use, but that was a good while ago.
well nevermind apparently that guy's blocked me. Somehow I can still reply to his posts.
Hey I’m wondering if anyone is able to help me figure out why the damage texture doesn’t work on my vehicle mod? I’m just a bit confused
Thiis is what I do
So I'm the sole Java Modder who has spent the last decade modding PZ to improve the moddability of PZ
I'm giving my thoughts on the subject after spending a few thousand hours in the codebase over that time.
Java modding optimizations is honestly worth it IMO. Adding tools as well.
The python support is something I plan to release in BETA tomorrow.
The project is called Pythoid.
is Pythoid going to be the same as Pipewrench or is it an interface for Java modding via Python?
I doubt it'd be the latter since I don't even think that's possible but I'd ask anyway
it's java modding via python
jython basically compiles python to the jvm
It'll be fun.
https://steamcommunity.com/sharedfiles/filedetails/?id=3299623560
Enjoy 1992 classic Trance/Rave/Dance hits 😉
Is there a server for finding artists to commission for Zomboid art?
You could always try in the modding Discord
I had no idea this existed, thank you kindly!
does anyone know what does instantiate() do in UI elements? it seems common to see something like
element:initialise()
element:instantiate()
...
are both of them needed? some mods only use initialise while other use both, is instantiate a legacy thing? or is it only used with some elements like buttons?
I tried making ui elements both with and without instantiate() and they work in both cases, is it safe to just not use instantiate ever?
From what I remember there are checks to verify if it's "initialised", meaning you would probably not need it unless you want to perform post initialisation actions.
I see.. looking in the lia files it seems many function including addToUIManager and addChild call instantiate anyway so I guess I don't really have to call it myself...
instantiate hooks up the java object
It's weird that we have 2 functions for initialization though
initialize i think calls createchildren and that kind of stuff
Thanks for the clarification
in general don't worry about it. You need to call initialize when you're creating loose GUI objects but if you add them as children then that's not needed
Yeah i was confused by how some modsonly call one function while otherscall both
I’m looking to hire mod developers. Must speak English, have a portfolio, and be dedicated.
Dm me please!
there's a modder clan in the workshop
team orbit?
they exploded violently a long time ago
Exploded?!?
Basically
Reformed to be less of a "clan" in https://discord.com/channels/136501320340209664/1125248330595848192
o
Can anyone explain to me how modData works and how I can save variable's values even after opening and closing the game? Make the variables persistent over login in and out
not sure about saving but generally speaking ModData is just a lua table. You can put whatever you want in it. Internally it's a kahlua table class instance so there's no penalty for using it, it's exactly just a regular lua table
i think i recall from source code that it saves automatically
how can I use it for storing my variables? im having a lot of trouble with it
i've never used it but you should be able to simply treat it like persistent Lua table. Unless you use it on zombies, in which case it should be actively avoided since zombie instances reuse it without resetting and it's never saved or loaded.
what I want to do is sorta of a each player has a "favorite weapon", so I need every player to have one specific weapon to their name, which I need to always be saved up, so even if I log out and log in, I should know which weapon that player has favorited
kinda of
player:getModData().myMod_favoriteWeapon = thegun
ok let me try using it like this
also does PZ prevents mod ID collisions?
no
well then prefixing your variables with mod ID is not a sure way to avoid data collisions either
well it is because everything explodes if you have the same modid anyway
because it selects which mods to load by their ids, it's a problem if two mods have the same id
huh i suppose, i do rememer having severe issues if i simultaneously had a local mod and a workshop mod
it will mostly only load one specific folder's mod but it's not 100% accurate with it
(pz didn't show that i had a local install so that was a dog and a half to figure out)
and it's a problem when the server says 'load mod ModId' and you have two and it decides to pick the other one
that's why everyone gets so mad about modpacks, it completely fucks over the users as soon as they get out of date
wdym
modpacks pack a bunch of mods into one workshop item, players subscribe to the modpack, original mod gets updated, modpack doesn't, players try to join a server using the original mod, checksum fails because it loads the modpack version
oh i see. It didn't occur to me think people were doing it this way.
i mean besides the implications of uploading someone else's mods on the same platform, it also seems backwards since collections exist
the main reason is public servers like doing it so they don't have to restart when mods update to let people join
riiight. Steam's idea of version control is to not have one.
but a lot of modpacks are made by Some Guy for their listen server with 3 friends and that i can't really decipher
any modders / mappers open for commission? 🙂
I'm the one who commissioned and funded
- True Actions Act 1 and 2
- Zuper Karts
- Autotsar Tuning Atelier Bus
- Autotsar Tuning Atelier Jaap Wrungel
If you are please DM me
If anyone could help me fix the last few issues with my mod it would be greatly appreciated!!!!!!!!
inters and exits from the car via the frame rails,
headlight texture doesnt work,
the glass doesnt change,
Damage texture doesn’t work
I just do mod_data[constants.MOD_ID].my_variable = "eaaghesbghesng" and no collision with anything 😄
o wait ur talking about mods having same mod id nvm
Hello
I wanna make a mod that changes the level up sound to the mission complete sound from Far Cry 5
But I have no clue how to make mods
you can modify the mod that changes level up sound to Respect+ from GTA SA
Ok,but uh...
How do I do that?
I never modded a game before
I do have some small coding knowlage from a little game I am making in gamemaker,but no clue when it comes to modding
Check the files of mods that change the level up sound
You'll realize it's very easy to do
Ok but uh...
How do I check said files?
-# sorry for asking a lot of questions, I just dont know what I am doin 
In your Steam workshop content folder which is where Steam stores workshop content like game mods:
Default location is C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\<modid>
This is how I feel every time I type here tbh!!!!
Asking questions is how you get answers!
Good evening, I have a question and I haven't been able to find the answer until now.
How do I do this function in lua, or what line of code do I put so that when the player performs crafting, he receives a little fatigue.
so that if he does it several times he gets tired?
Currently this function means that crafting gives XP to the player, but I also wanted this fatigue to come along with the XP. How do I do this?
When im using context:addOption() my action is being applied to when I right click an item instead of when I left click the option I made, how do I fix this?
Yeah!!!! Most of my questions have been answered so far!
atm im using it like this:
context:addOption(getText("UI_translate"), playerObj , actionFunction(), item)
with Events.OnFillInventoryObjectContextMenu.Add()
context:addOption(getText("UI_translate"), playerObj , actionFunction, item)
when you write actionFunction() that calls the function and passes the return value (probably nil), you want to pass the function itself
what do you mean with pass the function itself?
When you write functionName() (with parentheses), you are invoking the function, which transforms the function into its return value by running it.
functionName is a reference to the function itself.
You need to pass functionName
ah I see, thanks
so I have to take the parentheses off to not make it the return value of the function
thanks
Correct
What is the image referencing?
I already figured out, but thanks anyway :)
nice
I'm not a modder, but I need help modifying an NPC mod.
I want to modify the walktype of a Bandit NPC that I add in a mod called 'Bandits', and the mod's lua file that I can find has modifiers for the local walkType = "".
I've noticed that there are modifiers like “Run” “Walk” “SneakWalk” “Limp” and so on, and the NPCs that are set to “Run” are sprinting instead of running, so I want to reset their speed to something reasonable, and I'd like to know all the modifiers for these walktypes, is there a Doc for this?
I double-checked and the “Run” modifier seems to be working fine, but if you have a modifier wiki, please point me to it.
Is there a mod that prohibits attaching the machete to the spear so that players stop exploiting the infinite machete bug?
wrong channel; the correct solution is to fix the recipe such that it doesn't duplicates machetes, not ban it
or do you mean infinite durability?
If i assign moddata to a world object like a gnome does that need to me transmitted after? i assign the moddata just fine but if i leave the area and come back it no longer has the moddata.
so im assuming i need to transmit that or do it server side?
i think for online mode you need to do transmit data either way since (i think) it only transmits the whole object automatically when it enters the client cell
e.g. i've had issues with turning corpses to skeletons being registered as skeletons on the server, but the client would only see the change if the chunk was unloaded and reloaded
and do i need to pick up that transmit somehow like with global moddata?
i wouldn't know, i've never used moddata
ah kk. ive used a bit of global moddata but never used moddata by assigning it to a world object
i just honsetly need to figure out how the hell to make tiles XD. making a teleport mod and everythings done except for i have no method to only show the teleporter to the player when they are in the right zone. so was gonna apply moddata to a gnome and use that as a teleporter XD. but the simpler way would be to make my own tile object that players cant get ahold of
you could simply run that code on the client, it will only be visible to that client
yaeh but i need to setup the gnome to have moddata so when a player right clicks on it it checks if that particular gnome is set up to be a teleporter by checking its moddata. if i assign the moddata then leave the area and come back that gnome no longer has the moddata
which is why i came here to ask if it needed to be transmitted
well either way i cooked up a mod that transfers the number of weapon repair to the spear when you craft it, and transfers number of spear repairs to the weapon when you reclaim it. I'll edit the metadata and upload it soon.
Hello, does this prohibit players from making the machete's infinite durability?
wdym "infinite durability"? When you reclaim machete from spear, its durability is set to the same as of the spear.
Is there a mod to change this?
(sorry, google translate)
original game only resets repair counter, durability is not reset
so i don't understand what do you mean by "infinite durability"
if you mean that you can attach 10x repaired machete to a spear and then reclaim it with "never repaired" then I made a mod that fixes it
Yes, the durability is not reset, but the glue can easily repair the machete on the spear, characterizing it as an exploit
I see. Not sure how that would be fixed.
I discovered that if you have a machete with more than 0% of durability and you repaired it at least one time. if you combine it with a spear and then remove the machete from the spear.it will be a new machete with the last durability but you can repair it 50% of durability again 'cause it reset ...
Well this new mod will fix this issue, since it will remember each time you repaired it. So this specific exploit will not exist.
There is a concession though that reclaimed spear shaft itself will be reset to "never repaired".
Thanks! Will you share this mod with the public?
Yes. Give me a few minutes. Throwing together the code was trivial but I need to make images and description and everything.
Ok, thankyou!
Hang on a sec. There's a bit of a bug.
What channel is this? Can you create mods for free?
Nevermind, there is no bug. It was just the game effects kicking in after repairing a machete 20 times
I think that my Python mapping of PZ's API is about good enough to release as a BETA today.
Here's all the classes mapped in zombie.characters package (Not sub-packages):
Can you let me know when it's ready?
it's "open beta" for now. It's public but unlisted so you need a link to install it. Report back if it works properly or has issues. If all goes well I'll set it to public.
Helped out the author to get this wrapped up as they had some issues come up.
https://steamcommunity.com/sharedfiles/filedetails/?id=3289537326
Yet another add-on for Game Night, "Americana" (a reskinned Carcassonne) - unfortunately it was hidden/unlisted this whole time. So would appreciate any thumbs up. 🫂 ❤️
