#mod_development
1 messages · Page 214 of 1
...\ProjectZomboid\media\lua\client\Items, there's a SpawnItems.lua file
prior coding knowledge would suggest that the Recurse function is meant to be used when the function has to be called multiple times in succession
thats what i was thinking may solve an issue i've been having with the former
What file did you see the functions in?
Examples of how they're used in vanilla usage might help
In theory, the difference would be that getItemFromTypeRecurse is recursive whereas getItemFromType is not. It's true that the former is recursive, but the latter also can be recursive if you pass in true for the last argument (in either the 3- or 5-argument overload)
The vanilla code exclusively uses getItemFromType; looks like the "recurse" one is dead code (maybe outdated, maybe just never used)
("recursive" in this case meaning "calling itself", which in this context means it'll call itself for inventory containers within the inventory, like bags)
thanks. i noticed it wasn't in the vanilla code at all but i've noticed that with some functions that i've used before. This did make me go through the itemcontainer.lua and see functions i didn't know exist that i built in my mod code though
Sorry I don't know more about it, @true nova . Thanks for providing more insight @frank elbow
is there an equivalent to table.unpack that i can use? as it doesn't seem to work
just unpack(t)
i thought that but it's giving me the error : not enough arguments at the line math.floor(unpack(t))
am i wrong in thinking this should return the smallest value in the table?
God, I'm still doing all the bytecod research for Java and decompiling and recompiling PZ.
I want to try getting that Storm mod running.
math.floor takes a single number argument and returns that number without the decimal component
e.g. floor(5.6) returns 5
nooo i was having a brainfart on that and just copied it from somewhere else always in my own way. thank you
it doesnt print anything, or say something (in the event) nvm ty
what keybind to go to debug log?
I cant exit this shi
Hey there, i've been trying to figure this out aswell. Exact same issue, where other mods use file = media/sounds/thingy/file.wav for various sound types, but can't get it to work. Any updates on this?
I've been doing some lurking through the discord and i see quite a lot of complaints how it's impossible to edit sound HouseAlarm unlike all the other sound files. Feels like i hit a landmine when picking which sound file i should try to edit for a first-time PZ modder.
Hello! Tell me, if I change the title/name of the mod in the workshop.txt and mod.info files, will critical errors appear on the server? I don’t change the ID or anything else, just the title/name.
Theoretically, as long as you don't touch the mod/addon ID everything should be fine. It would make sense that the game checks for a mod ID rather than the name.
I'd ask someone else to confirm, though.
I also assume that it should work like this, but I decided to play it safe and ask the question here. I didn’t want to cause a wipe))
You could probably deactivate house alarms overall and add your own chances for alarms to trigger when entering a house that plays a custom song
Deactivating house alarms is already a thing in the game too
Like coding my own non-hardcoded house alarm script from scratch?
Hello! I'm trying to find a way to allow washing machines to wash dirty rags and leather/denim strips, any advice ? I can't find any lua code for this.
yup
The main issue I see is finding out if the building the player came in is a house or another type of inside zone
pain
wdym pain ?
It's easily doable
Like I said the only issue is making sure it's a house you are inside
I literally have no idea where to even begin with making custom house alarm code
Only thing i know is how to mess with the .bank files and the few sound script .txt files
actually
I could just replace the house alarm sound from the .bank file itself, but that brings me to another question
actually^2, addons can't touch .bank files so one would have to apply the thing manually
So outside of personal use, that's not really an option
It's doable
People can manually install files
But like I said
You don't even have to :)
I mean, yeah, but that's a crappy bandaid fix.
teach me your ways, coder man
This mod adds a playable sound and I checked the files out of curiosity
It's not a .bank file
In fact, it's very easy
hmmmm
give me a sec I'll tell you what to look for
The sounds in .ogg:
ShoutSound\media\sound
The scripts to define the sounds and their characteristics:
ShoutSound\media\scripts
The code:
ShoutSound\media\lua\client
The code that plays the sound
line#14
patchClassMetaMethod(zombie.characters.IsoPlayer.class,"Callout",function(Callout)
return function(...)
local args = {...}
if args[2] == nil or args[1]:isCanShout() then
local dist = 2
local gender = ""
local loudness = ""
local pl = args[1]
local VoiceKind = ""
if pl:isSneaking()
then
loudness = "whisper"
dist = 5
else
loudness = "shout"
dist = 40
end
if pl:getDescriptor():isFemale()
then
gender = "female"
else
gender = "male"
end
VoiceKind = tostring(loudness.."_"..gender)
getSoundManager():PlayWorldSound(VoiceKind, pl:getSquare(), 0, 0, 0, false);
addSound(pl, pl:getX(), pl:getY(), pl:getZ(), dist, 0)
end
return Callout(...)
end
end)
And the part that interested you
getSoundManager():PlayWorldSound(VoiceKind, pl:getSquare(), 0, 0, 0, false);
addSound(pl, pl:getX(), pl:getY(), pl:getZ(), dist, 0)
Also I'm not coder, in fact I have barely any knowledge in it
My ways of doing it is reverse engineering
You can find the code to detect when the player is in a building and if it's an already explored building in Cordyceps Spore Zones*
I wonder how the original zomboid house alarm code looks like
Actually sry nvm
It's not Susceptible
It's Cordyceps Spore Zone
Making an addon for both made me mix them up
No idea
You could probably find it in fact
Tho I wouldn't suggest rewriting it
As far as i'm concerned, i'd need some way for the game to tell if a player enters or disturbs a building that's rigged with a house alarm
CordycepsSporeZones\media\lua\shared
Are you not reading what I'm typing ?
I literally gave you the answer and mods that use codes to do those functions
Go check them out
Still downloading everything
Those two mods I sent have everything you need to know about for:
-knowing if a player is in a building
-knowing if that building is newly explored
-playing sounds
Then go learn about ZombRand() to test chances to play an alarm
CSZ even has code that utilize it, everything is in it
Sadly I don't know much about how servers handle stuff so I have no idea what your issue is
Does the bird excrement actually moves from the bird feeder inventory and then disappears ? Or does it tp back in the bird feeder maybe ?
Idk much about inventory neither rip
Just answering so your message doesn't fall in the void, this tend to happen too much. If you never get an answer maybe try asking in the modding community too
Welp that's weird, I hope someone who knows a bit more about this is able to tell you more
Maybe linked to the way your item is created in the bird feeder ?
You could maybe also find a mod that does such a transformation like the composters
Not too sure I know any sadly, maybe fish farms
What did you use to create it ? You found the file with the code for the composter ?
What did you base yourself on*
Do you guys not decompile the game?
Do you need it ?
No, but it's part of the modding guides.
If you don't need to go deep in the java files, don't
It lets you see how they hook everything together.
I believe it's best if you don't touch much to the java part
I'm on the opposite end. I've been java modding the game for myself.
Yeah it does but haven't taken the time to do it myself
Right now I'm trying to get Storm up and running again-
It's an API to modify the java files through injection like Forge in Minecraft
right
But because everyone's been so against modifying the java files I guess the original devs abandoned it like, a year ago.
Same, I've been rushing hard at learning Java for this reason though.
3 weeks actually
Lua isn't too hard thankfully. Java is the annoying one.
So far I've just been taking the game apart and putting it back together again in my environment.
One of the big issues so far has been matching bytecode.
Anyways one of the reasons you want to decompile the game is so that you can build an event library.
wdym ?
Which API tools like Umbrella or one of the other decompilers give you.
A library of all the game's definitions which are the 'what this do'.
A lot of devs have documented them. Hold on, let me hop on my PC.
You wanna get on call and share notes?
uh no ? I can't really do that rn
IDE ?
IDE works. I kinda use both.
both what ?
VSCode.
Some guides and mod devs were saying that the .lua Emmycode can be kinda buggy on IDE for modding PZ.
what's that ?
Emmycode is the .lua plugin for IDE that helps you see the definitions easier.
Wait are you just looking at it raw?
Like I'm ngl to you I don't know shit in programming bro so you're speaking chinese to me
yes
Yeah nah, I get that. I literally started two weeks ago and I hit the books on this shit for PZ super fucking hard.
So PZ's interfaces most people hook into is .lua 5.1.
Right?
that's basically what I work with
idk
That's VSCode not IDE.
guess I understood wrong what IDE meant then
So, VSCode is an interface to look at the code easier. So is IDE for the most part.
thought IDE meant a type of program nvm then
Yeah fuck no I wasn't wrong with it
integrated development environment
You are, but I was meaning the program.
I thought you were using Intellij IDE.
People would probably call it Intellij then lmao
Not IDE to not missunderstand each others
Fair, fair. I just got up I fucked up. lmao
np
Like I said I'm about two weeks in too so I've been cramming everything all at once.
Bro it's been so fucking hard though.
Like I've barely touched my mods.
Just because I've had to do that much studying for stupid shit I wanna do so few other modders are doing.
My god take some vacations 
But like, why that need to touch the java ?
You don't' but if you hook into the Java you can do way more than with ,lua.
Do you need to do that for your mod idea ?
I can add my own bodyparts, I can add my own weather easier, I can change events around and make new ones.
I can directly fix bugs in the game's code as well.
Can you even download it from the Workshop ?
No, that's why I'm fixing Storm.
Storm allows me to inject my fixes or changes instead of repackaging the game.
That gets around me distributing theirs free.
It's just like Minecraft's Forge.
Okay but like, did you have prior coding experience before ? Because it sounds like you know a fuck ton for no reasons
No, I have adderall and have been doing this every day for 15 hours a day for two weeks.
No breaks.
Take a break ?
No, I'm having fuckloads of fun. lol
I'm super fucking excited to see what I could do with it.
Well, gl
Because like, imagine the crazy shit modders can do with .lua and java modding.
Anyways, a library of definitions.
It'll let you click on code you don't know the meaning of and pulls it up in a built in library that tells you what it is and what it hooks into.
that sure sounds interesting
what's that ?
Umbrella is a collection of EmmyLua typings for Project Zomboid's API. This includes:
Candle: The exposed Java API typings.
PZLuaStubs: The Lua API typings.
PZEventStubs: The Events API typings.
Why the fuck is that not pinned in this fucking channel I swear to god
Why even bother make such stuff if new modders can't find it
Yeah no shit.
Dude I had to google around for days for a bunch of shit like this.
This is a huge help for us either way.
I'd have no idea what the fuck I was looking at in the code if I didn't have it.
Well I'll try to install it and see exactly how it works
You gotta install it as a library into your existing workspace.
Install the lua server plugin for VSCode.
Then go to settings for it.
Yeah I'm reading through it
And under extension settings once you got umbrella installed, add umbrella as a library, yeah.
I mean, I already guessed that code was terribly written
Where do I do that exactly ?
Already got it installed
Extension settings
Yeah I'm in it
@ext:sumneko.lua library
Up there in the searchbar at the top, just search for library. It'll filter a lot of shit out
Only got two
Alright that works.
What do I add ?
the zip downloaded from github ?
Unzip it somewhere and see if it has-
Candle Events and Lua in there just to double check.
If so and they're full of shit, put it anywhere and then link to the unzipped folder in VSCode
You're gonna have to do the commands to download it the other way. That doesn't work.
Github is weird.
Open Git CMD on your computer
This is how a lot of github repositories let you download stuff.
Download it and it adds like, git CMD, Git Bash, and one other I forget.
Which links up to their website.
Yeah didn't download it on this computer, I need to do it but I barely even use it
Should take a second
Yeah, no worries.
I had the same problem when I was trying to get umbrella and other stuff.
You're just getting fast tracked by me who had to spend ages doing it. lmfao
How do I open git cmd ?
yea kind of
should just be a program you can pull up on windows now
Doesn't appear
Did you install it or just download the file?
I installed github desktop yes
np
Okay then it's probably not set up as start menu stuff yet.
classic windows bullshit
It'll be in either program files or program files x86
Yep program files
C:\Program Files\Git
Then it should be git-cmd
the .exe
There's no git folder
The only thing I have is in appdata/local/GitHubDesktop
We bring the awesome Git VCS to Windows
Oh fuck off
They have it some other weird ass place.
Apparently that's some Git UI and not the git downloader program they built under a completely different web url
Uninstall that, my bad.
Okay cool
what now ?
Hold on making sure I'm correct. Now we have to clone the repository.
Here.
This is apparently how you download things from git. The way we think is logical to do it is not.
I just want to download a fucking extension library, why do I need to hack the fucking NASA
Instead you have to literally get their cmd interface to direct pull from their site's banks. LMFAO
I know that's why it took me ages to figure this shit out.
Because it's dumbly overcomplicated.
so in git cmd "git clone https://github.com/asledgehammer/Umbrella.git"
Didn't download the files either
Now you got this folder right
yea
Once you got the cd command
git submodule update --init --remote
Then it should update the folder
god damn
Yeah just downloading zip has fucked up for me.
Got it
There.
Now it's a library holy shit
Now you can just toss it somewhere and plug it into VSCode to use as a library
Then most stuff should have definitions.
package index
Whatever doesn't-
This is an index of everything.
I don't know why this isn't linked either.
Alright it works thx
I guess it's easier than going through the shitty wiki to understand stuff lmao
You can have the decompiled game as a second library.
Just to see where the .lua stuff hooks into the .java stuff more closely
And yeah this saves me a lot of headache.
Alright well thanks a lot I guess
I'd recommend also downloading a bunch of mods and putting them in a folder to use as examples for coding.
So you can see how other modders have done it.
I already do that
Oh sweet.
I actually went through the entire workshop one day-
Grabbed around a thousand or so.
Like I said, I reverse engineer everything
Same, that's how I've been learning on the .lua end.
I already use more than a hundred mods and I already know a lot of example to work from
What I've been doing for fun is updating old mods then slapping them together in my huge crafting overhaul.
You have an idea what the unknown means ? I think it means that it doesn't know what the result will be but eh
local visual = zombie:getItemVisuals()
print("Start of visual update for this zombie")
print(visual)
print(visual:size())
for i = 1, visual:size() do
local item = visual:get(i-1)
if item:getItemType() == 'Base:Hat_Fungi' then
print("Hat_Fungi found")
print(item)
print(item:getItemType())
break
elseif true then
end
print("Didn't break for loop")
end
print("Done")
A part I'm working on
Nothing too fancy for now
Yeah, not sure. I'd have to research it.
It works, just I'm curious what the unknown means
I'm disassembling on the crafting end for the moment.
So if I come across it and figure shit out, I'll let you know.
👌
I mean you gave me a big one but a good one lol
I just don't understand why this shit is not in the pinned commands
You honestly have to dig through so much shit it's insane.
@bronze yoke hey sorry to ping you, do you have an idea why your Umbrella thing isn't pinned in the messages ?
https://github.com/asledgehammer/Umbrella
But like it exists, why isn't it shared ?
No idea. I had to find everything by googling and looking through PZ githubs.
A lot of people just threw their projects on github and you can go ogle their code.
I went through so much research to find what things do too, never found anything mentioning these kind of tools
Coding is nice and all but getting into it is just pure pain
I learned how to code in Python and Matlab in the last three years but nothing like this kind of stuff
It's that moment where I would have loved to get programing courses to understand better how people share stuff, how to handle things or just even better: fucking vocabulary
It sure helps but for some stuff you still have to dig deeper, I am a software enginner and I happen to use Lua at work and I'm still trying to find some stuff like the washing machine code
Yeah, decompiling was where I went forward.
That is the next step for me, I just need to find some time
Do you want a decompile with documentation already on github?
You just gotta git bash it though.
It's just a fast track to take apart the game.
I'll probably go with decompiling locally so I can prepare some script to decompile every time the game updates
This is it. lmao
For the most part the game is really friendly to modders, I'm very pleased with their approach to recipes and events.
It is a really fun way to spend some time
I'm looking at the recipe script guide on the wiki and i'm trying to use Override:true, in my recipe so the vanilla recipe doesn't show up as well, but it still pops up next to my custom recipe when i right click the item. Am I using the override wrong? How do i replace vanilla recipes with my own custom tweaks?
Still can't find a way
Tried all files that could work but none of them have info on it
Check the messages I sent under his mod
It's also actually extremely easy to make in fact
At least making the zombies not move is easy
I'd say it's doable in ... 10 lines of code ?
I have super limited coding knowledge but yea i can't image it'd be do bad
Lua 😩
Lua isn't the issue here in fact
The issue is fucking animations and how they work lol
we just don't really use pins in this channel, there's too many resources for discord's 50 pin limit + pins are annoying to navigate, it's on the wiki page instead
oh that makes sense
Didn't knew thx for the clarification
btw, you don't need to do all the git stuff anymore, you can just download the zip under releases
too many people found it too confusing 😅
I tried downloading it
I've had the itch for zomboids to turn into weeping angel like "only move when you're not looking" for a year after the sprinting mod had a bug for me where it was exactly that
But it didn't dowload the files
and I just haven't been able to replicate
download from releases, not from the code button
Yeah I'm trying to find where it is but github is a fucking pain I swear
Worse interface ever
Ah so you download like the zip basically ?
I see alright
Good to know
@somber sinew
ayo
You don't need all the git cmd thing
it's a lot easier to use git if you're familiar with it because then it'll update itself (i think the version in releases is actually a couple minor changes out of date)
👌
You can download umbrella from the release page directly
Oh.
I didn't see the releases. lmfao
i've been meaning to change the instructions to mention it
Anyways right now I'm trying to rerig that Storm API for java modding again.
I'll see if I can't bully it enough.
There is a trigger for inside buildings I used in a mod, I will post it here, I can probably do that but it will work inside any type of building not just houses
That's the only issue I can see happening is entering a garage and the alarm going off
Or any other type of no alarm building
Is there an elegant way to run code whenever sandbox options are changed?
doesn't seem to be an event for it, which is surprising
somebody was working on an event for it, i don't remember if that was released
I see, thanks! I'll search the chat and check if I can dig it up
I'm trying to get all of the thread in the player inventory and get a use count with
local inventory = getSpecificPlayer(player):getInventory()
local threadItems = inventory:getAllTypeRecurse("Base.Thread")
local threadUses = 0
if inventory:containsTypeRecurse("Base.Thread")then
for _, item in pairs(threadItems)do
threadUses = threadUses + item:getDrainableUsesInt()
end
end
The game gives an error saying threadItems is not a table. Is there something i'm doing wrong?
Hey quick question, does anyone know where the default vanilla traits/occupations are located in the game files? Trying to find the lumberjacks unique trait axeman to model off of.
getAllTypeRecurse returns an arraylist, not a table
omg i should know this ive used it already. thanks
This really helped, I got the washing machines working for cleaning dirty rags/bandages. It only works if the player plumbed the machine itself, some restriction for the global object system, but for my mod it is actually a wanted behavior.
No kidding. It lets you dig into the game's guts.
Yeah, without decompiling the java, modding takes ages, and you're stuck with trying to remix what others have done.
I remember guessing what classes logically make sense to include what I was looking for and Ctrl+Fing around as at the time I was opening one class at a time.
I am making a mod that changes parts of the UI including the Main Menu. I have everything else worked out as far as what files to work with, but where do i find the source for the actual game name at the title screen? i cant seem to find that
ProjectZomboid/media/lua/shared/NPC's/MainCreationMethods.lua i think
Thanks so much, that was it.
Sorry to perhaps be a little annoying, but does anyone happen to know where the traits are defined in the vanilla game code? I see they're referenced in ProjectZomboid/media/lua/shared/NPC's/MainCreationMethods.lua but I can't seem to find the code that makes up those traits.
Could be possible they are defined in the java
But I have no idea
Ah shoot, guess that’ll be my next thing to start looking into haha. Thanks.
Decompiler. Still works.
If anyone wants to know also- zulu17.30.15-ca-jdk17.0.1-win_x64
This is the JDK Azul Distribution that they're using for PZ.
Direct download.
Thank you as well. 
can anyone point me at some documentation about how to set up (any) IDE to play nicely with PZ modding? Getting LUA to recognise the native methods of Java for type hinting etc is the hope.
download from releases and you can point your ide/your lua plugin to it as a library
thanks, I'll give that a shot
much appreciated
looks very promising, you're a gem 💎
yeah, exactly what I was looking for and hoping existed. Worked a charm
glad to help!
how would I edit a zombie's model?
like how do I change a certains zombie model ingame?
example, the only cure mod changes your character midgame when u cut ur arm off
sorry, one more question - is anyone aware of the right way to spawn a movable tile object like a counter?
have (finally) figured out that they're all actually one base item you can spawn in via:
getSpecificPlayer(0):getInventory():AddItem("Moveables.Moveable");
but tweaking the referenced specifics is eluding me
got it - for anyone else chasing it:
getSpecificPlayer(0):getInventory():AddItem("Moveables.Moveable"):ReadFromWorldSprite("vegetation_indoor_01_7")
Tfw you've been working on a mod for months and check the workshop and someone else just published the same thing... 
Remarkably similar feeling to getting fired lol
post yours too anyway, no harm in options for people
maybe theirs is horribly broken and yours is working superbly
Lol yeah I'm still gonna publish, but his is tight. The code is impressive, he's definitely seasoned.
My mod is basically a spiritual successor to more builds, but I'm still learning, so the plan was to go ahead and use the context menu, but make a pop-out window for the build 42 rebuild. His already uses a window.
https://steamcommunity.com/sharedfiles/filedetails/?id=3067798182
Some of my systems are a little better imo, and I give the user complete control over crafting costs, Xp gain, and structure health, (plus a ton of other options) but the fact that he uses a window makes my improvements pale in comparison in my eyes.
I'll just have to do better.
How can I get an item from the environment or storage, not just from the character's inventory?
You might have a look at the blacksmith menu, it has a function that gets items from nearby containers iirc. Or maybe take a look at the item searching mods and see how they do it?
One of the vets around here may know how to do it off the cuff tho. I'm a habitual reverse-engineer lol
What are you trying to accomplish/what do you mean by "getting an item"?
@patent holly here is the code, I need it to get the welding mask not only from the player's inventory, but also from the environment and from the container too
if self.character:getInventory():getFirstTypeRecurse("WeldingMask") then
local mask = self.character:getInventory():getFirstTypeRecurse("WeldingMask")
if not self.character:isEquippedClothing(mask) then
ISInventoryPaneContextMenu.wearItem(mask, self.character:getPlayerNum())
end
end
Ah Okay, just wanted to clarify whether you were making changes to the item or just retrieving it. I wanna say the blacksmith menu has a list builder for items in nearby containers, I'm afk rn but I think that's where I saw it. Blacksmith has its own folder in the lua/client.
ok, thanks for the tip
Np. hope it helps.
code is impressive
probably 50k lines of code that will be hard to maintain, and probably could be reduced much less if I was thinking of modularizing more
he's definitely seasoned
this is actually my first piece of code that works correctly lol
First time I tried to continue More Builds, but generating that tree of thousands of items at each right click made it impossible to play. The project is open souce on github, feel free to make improvements. Those systems you mentioned sound really interesting.
Hi, i'm new to lua so in the process of picking up the syntax. I'm trying to override ISButton.onMouseUp so as to inject a checked state behaviour. ( Terrible i know, normally I would normally extend ISButton but even that was a headache. ) Anway, i get the below error, as though the context of the onMouseUp method and self is somehow not itself. It can't even print out its own title field. What i'm i doing wrong.
local original_ISButton_onMouseUp = ISButton.onMouseUp
function ISButton:onMouseUp(x,y)
original_ISButton_onMouseUp(self, x, y)
self.toggleSelectedState(self)
end
function ISButton:toggleSelectedState()
print("ZZTopChecked pressed: " .. self.title )
-- print("ZZTopChecked canToggle: " .. toString(self.canToggle) )
-- if self.canToggle == true then
-- self.isChecked = not self.isChecked
-- print("ZZTopChecked " .. self.title )
-- print("ZZTopChecked " .. tostring(self.isChecked) )
-- else
-- print("ZZTopChecked cannot toggle " .. self.title )
-- end
end
I get the error below.
-----------------------------------------
function: toggleSelectedState -- file: ZZTopCheckBtn.lua line # 16 | MOD: ZZTop Filter
function: onMouseUp -- file: ZZTopCheckBtn.lua line # 12 | MOD: ZZTop Filter.
[20-01-24 15:54:10.870] ERROR: General , 1705766050870> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in toggleSelectedState at KahluaUtil.fail line:82..
[20-01-24 15:54:10.870] ERROR: General , 1705766050870> DebugLogStream.printException> Stack trace:.
[20-01-24 15:54:10.871] LOG : General , 1705766050871> -----------------------------------------
STACK TRACE
-----------------------------------------
When you call a method on an object, you don't need to explicitly pass self as an argument. It is automatically passed as the first argument. So, you should call self:toggleSelectedState() instead of self.toggleSelectedState(self).
local original_ISButton_onMouseUp = ISButton.onMouseUp
function ISButton:onMouseUp(x, y)
original_ISButton_onMouseUp(self, x, y)
self:toggleSelectedState()
end
i'll double check, but i had that originally. in fact, the toggleSelectedState() method was added as a stab in the dark, i.e. even printing self.title in the onMouseUp override failed with the same message.
i'll double check.
hmm, that might have worked, i've been chasing my tail because thats what i started with. sigh.
@coarse sinew Thanks. all working. So it was caused by a spelling mistake, toString rather than tostring. Need my eyes tested.
very simple toggle state.
require "ISUI/ISButton"
function ISButton:enableToggle(canToggle, state)
self.canToggle = canToggle or false
self.isChecked = state or false
end
local original_ISButton_onMouseUp = ISButton.onMouseUp
function ISButton:onMouseUp(x,y)
if self.canToggle == true then
self.isChecked = not self.isChecked
end
original_ISButton_onMouseUp(self, x, y)
end
local original_ISButton_render = ISButton.render
function ISButton:render()
if self.canToggle == true then
if self.isChecked then
self.textColor = {r=1.0, g=0.0, b=0.0, a=1.0};
else
self.textColor = {r=1.0, g=1.0, b=1.0, a=1.0};
end
end
original_ISButton_render(self)
end
Building Menu looks awesome.
i totally know how to code, just do... uhh turns out, i lied, idk what or how
So, i've written a filter mod, removes all items from the inventory pane depending on what filter options you check. The issue I'm having is working out which item field is best to use to perform specific filtering by category. For example logging the following...
local itemCat = item:getDisplayCategory()
local itemType = item:getType()
Both of these seem to log very granular named categories and types. I was hoping for a field with a high level category, like Food, Weapon, Ammo, Clothing.
But it seems that the types and categories are a lot more varied, making a simple filter a bit of a pain.
item: type: LitE type: MagazineCrossword3.
item: type: LitS type: BookMetalWelding1.
item: type: ClothAcc type: Belt2.
item: type: ClothBack type: Bag_Schoolbag.
item: type: ClothBody type: Tshirt_PoloStripedTINT.
item: type: ClothFeet type: Shoes_Random.
item: type: ClothFeet type: Socks_Ankle.
item: type: ClothLeg type: Shorts_ShortDenim.
item: type: Cont type: KeyRing.
Is there another item property with simpler naming? Or a definitive list I can reference?
I figure due to the variety of types and categories, i'm going to have to match on something like string.find(categoryOrType, "Cloth") or string.find(categoryOrType, "Lit")
Any ideas?
Are you testing your mod in isolation, or with other mods? I believe getDisplayCategory, in vanilla, tends to have the sorts of categories you've described (“Food” for food, “Clothing” for clothing, etc.). If you're using a mod that changes/expands display categories, though, those may be different
If you search “ClothLeg” in the vanilla code there aren't results, so I'm assuming something else is active
i have a couple of better mods wich switch up the categories. I think i'm going to use instanceOf(item, "Food") as it looks like thats about as high level i can get without being messed up by other mods changing labels etc.
Type in items case is their module.type
It's more of an ID
You have category and display category
That's about it
You can try to get their class type - I forget what that's called - but that would get you clothing, food, weapon, item
thanks, i think i'm ok with matching using the instanceOf() prop. Can always adjust it later if need be.
I'm trying to make a simple mod where you dismantle vhs tapes for a single piece of electrical scrap but i cannot figure out why it isnt working (ps this is my first mod and i've basically learned everything by looking at other mods's files)
module DismantleVHSTapes
}
recipe Dismantle VHS Tapes
{
destroy VHS/VHS_Retail/VHS_Home,
keep [Recipe.GetItemTypes.Screwdriver],
Result:ElectronicsScrap,
Sound:Screwdriver,
Time:20,
OnTest:Recipe.OnTest.DismantleElectronics,
OnGiveXP:Recipe.OnGiveXP.DismantleElectronics,
OnCreate:Recipe.OnCreate.ElectronicsScrap,
Category:Electrical,
AnimNode:Disassemble,
Prop1:Screwdriver,
Prop2:Source=1,
Second line bracket is wrong
following this tutorial: https://github.com/Konijima/PZ-Libraries
I'm at step C: Decompiling,
When running the setupWorkspace script, I'm given the following error:
3:20:44 PM: Executing 'setGameDirectory'...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'zombie-hg'.
> Could not create task ':updateZomboidLua'.
> Could not create task ':zomboidVersion'.
> 'org.gradle.api.tasks.JavaExec io.pzstorm.capsid.zomboid.task.ZomboidVersionTask.setMain(java.lang.String)'
i don't recommend following this tutorial, it's very old
what are you trying to do? do you want the decompiled java or the lua libraries?
im going to need both. Im building an automated hunger games mod to go with the Hunger Games PVP map
Do you have a newer tutorial?
Yea, this one seems super old. I'm not a Java developer, so this will be my first Java project. I can't find JDK 17.0.3 anywhere 😛
you can decompile with beautiful java https://github.com/quarantin/beautiful-java and you can use umbrella for lua libraries https://github.com/asledgehammer/Umbrella/releases
λ fetzmanjaro zombie-hk → ./BeautifulJava
- Checking Zomboid version...
ERROR: java interpreter not found.
INTELLIJ=/usr/share/idea
ZOMBOID=~/.local/share/Steam/steamapps/common/ProjectZomboid
which version java is it looking for?
@bronze yoke
i have no idea, it just worked for me
ehh, it's the way my IntelliJ AUR package installs onto the system... I can't find the install directory that beautifuljava is looking for.
#
# Check for java command
#
JAVA="$(grep -i ^java "${CONFIG}" | cut -f2 -d= | xargs | sed "s|^~|${HOME}|")"
if ! [ -f "${JAVA}" ]; then
JAVA="${INTELLIJ}/jbr/bin/java"
if ! [ -f "${JAVA}" ]; then
JAVA="${INTELLIJ}/jbr/Contents/Home/bin/java"
if ! [ -f "${JAVA}" ]; then
config_error "ERROR: java interpreter not found."
fi
fi
fi
it's looking for ${INTELLIJ}/jbr/Contents/Home/bin/java,
I'm giving it the path to the executable.
INTELLIJ=/usr/share/idea
im using intellij-idea-community-edition AUR package. Any idea where the correct IntelliJ folder would be then?
which OS are you using @bronze yoke ? Don't think beautiful will work on arch
i'm on windows
I was coming in to ask for exactly what both of you posted, lol
Loading single player games takes far too long and I had gone to copy a save from one computer to another only to find that it still wasn't done after 20 minutes
that isnt exactly what im talking about but
IMO, the map bins should not be separate files. It is absolutely terribly for filesystems and makes loading games take an enternity so I'm considering modding the game to better manage how it stores data
IMO, you should learn how to TAR
zip or tar your files before transferring... transfer takes 2 seconds.
you cant FTP thousands of singular files like that.
Well yes, I just wasn't expecting there to be 50,000 individual single files in the save folder
I stopped the folder transfer to archive them, but the fact that it even exists like that is absolutely ridiculous
it's really not, its just chunked data
so, since you're making your new mod
how do you expect to iterate across one file?
everything being read from one file? You just going to iterate up and down the file until you find what you need or what?
for chunked games like this... even minecraft... the data is chunked in one way or another
I'm considering using a compressed filesystem potentially.
you're just seeing it raw on your filesystem... but seperate files actually keep it super optimized
I'm not super convinced that all of these things need to be separate files in the first place, especially if they're fixed size
But, it would probably be better to not start out with the idea of reinventing the wheel when I already don't know much about the structure of the objects
https://steamcommunity.com/sharedfiles/filedetails/?id=3143789174
it would be nice if someone appreciated my work and left a rating
The "destroy VHS?"
If you think 50k is much, this is from a server
{
recipe Dismantle VHS Tapes
}
Destroy VHS/VHS_Retail/VHS_Home,
keep [Recipe.GetItemTypes.Screwdriver],
Like this?
module YOURMODULEHERE
{
recipe YOUR RECIPE HERE
{
...YOUR RECIPE...
}
}
module DismantleVHSTapes
{
recipe Dismantle VHS Tapes
{
Destroy VHS/VHS_Retail/VHS_Home,
keep [Recipe.GetItemTypes.Screwdriver],
Result:ElectronicsScrap,
Sound:Screwdriver,
Time:20,
OnTest:Recipe.OnTest.DismantleElectronics,
OnGiveXP:Recipe.OnGiveXP.DismantleElectronics,
OnCreate:Recipe.OnCreate.ElectronicsScrap,
Category:Electrical,
AnimNode:Disassemble,
Prop1:Screwdriver,
Prop2:Source=1,
}
Should be fixed right?
idk if you have to but usually I import base
its sometimes not necessary
Allright fixed thanks! (chances are it wont worked since i just winged the lua file but oh well)
it looks fine, should work
Actually what's the point of importing base ?
My mod still says unnamed mod no idea how to change it
what's your modinfo file like ?
Name= Dismantle VHS Tapes
id=DismantleVHS
description=Yeah..just dismantle VHS tapes...
poster=poster.png
modversion=1.0
pzversion=41.78.16
Not sure what's wrong with it
The space after Name= ?
Nah i just changed that to see if maybe that was the problem
same thing
i have my mod.info file with a capital M
maybe that?
That's my mod's info file
id=TLOU_Bloater2
name=The Last of Us Infected - Overhaul 2
description=Makes the experience of The Last of Us Infected even better by adding small features that improve on the mod. Readds the Bloater model from Monkey TLOU Enhanced Experience to the Bloater infected of the TLOU Infected mod by drenindok.
poster=poster.png
authors=SirDoggyJvla
icon=icon.png
tags=Build 41
versionMin=41.0
require=TLOU_Infected
might be the capitalization
Your issue is probably the capital leter on name
Put name not Name
What's the format of your mod info file too ?
mod.info ?
a .info file
Yeah right
it gives me all the other information so i have no idea whats happening
if you're referencing any base items, then you will want to import base
I see
So if I just reference new items with item, it wouldn't be necessary ? Unless it's possible to call other items in it
you also don't need to import base if you just reference them as Base.Whatever instead of Whatever
hmm
anyone knows if there is a lua code to spawn a specific type of zombie in the x, y coordinates I want?
most spawn functions I see are for hordes or non specific places like Room spawn
I don't know personally but I do know that the cheat menu mods have a zombie brush tool
The functions they use might be useful to you
Yeah i know about that, but I want something like that in a Lua code
so I can spawn a specific zombie like that tool in a specific place
addZombiesInOutfit(x, y, z, nbZ, outfit, percentFemale)
thanks!!
dont worry, thanks anyways!!
Outfit exemple:
require 'Definitions/HairOutfitDefinitions'
local bmOutfitStaticDef = { outfit = "BloodyMary", haircut = "Rachel:100", beard = "None:100", haircutColor = "0.98,0.81,0.01:100" }
table.insert(HairOutfitDefinitions.haircutOutfitDefinition, bmOutfitStaticDef)
I will test that out right now, thank you so much
and you need to create the xml stuff if you use your own outfit and not a vanilla one
I have that already, I will try
Sorry to interject, but I don't suppose anyone knows how to trigger a player to start crafting a specific recipe via Lua?
have tried a few things like player:getKnownRecipes()["SomeRecipeName"].craft() but to no avail, and can't seem to find any similar behavior searching through existing mods or via googling
hoping somebody more familiar with the recipe system backend might have some ideas
I thought remove grass / remove bush etc might have had a similar call, but they're not using a recipe but manually controlling anim states etc which seems overkill for my purposes versus just triggering an existing recipe craft
look into lua/client/TimedActions. it may be ISCraftAction.lua
look at ISCraftingUI.lua under lua/client/ISUI that's where you'll see how it must be called
thanks - looks like via the RecipeManager might be the go based on those - much appreciated!
happy to help
wouldnt it be cool if the devs or modders made a working train? it would be cool to have like a moving fortress. but to offset it make it so that like fuel gets burned like crazy and its loud as fuck attracting zombies in like a 300 tile radius while its running.
also maybe have it so that the rails sometimes need to be maintained and to work on the locomotive itself you need lvl 10 mechanics and level 6-8 metalworking and maybe even a high level electronics.
i think working near and with trains and train carriages all the time been doing something to me lol
I never worked with trains but I have something like that in mind too.
Because trains are fucking cool
While I don't know the pricing, I suggest you propose your services in #modeling or the PZ modding Discord
I'm writing a mod to allow washer machines to wash dirty rags/leather and denim strips/bandages, here is what I found so far:
- Currently the washing machine code is handled mostly on the Java side, more specifically by the classes
IsoClothingWasherandClothingWasherLogic - The associated Lua events only accounts for: turning the machine on and off (
Commands.clothingWasher.toggle) and setting the machine mode for the dryer/washer combo (Commands.comboWasherDryer.setMode).
My current approach:
I'm using the SGlobalObjectSystem to monitor active washing machines every 10 minutes and replace any of those items for their clean variant. There is a limitation where it can only track washing machines that were picked up and re-installed/plumbed by a player (which is no a big problem for me).
It works perfectly in single player however I can't find a way to sync the washing machine container properly on MP. If I log out and back in the washing machine contents were updated successfully.
Anyone knows how to sync the contents of a container that was updated only server-side by a global system ?
don't suppose anyone has any insights into why
local recipe = ScriptManager.instance:getRecipe("SomeAwesomeMod.Some Special Recipe")
would be falling over and failing to retrieve the recipe reference? I've checked the same line of code for default recipes and it works, and reviewed it against other mods that also generate recipe references in this same way.
- The recipe is defined and valid (and can be crafted via the crafting menu)
- The name of the recipe matches the recipe declaration and is unique
or is there some better way of just getting a reference to a specific recipe?
Is there any method to get using in recipe items or keep items? Default recipes
Not sure I follow? The recipe is using both OnCreate: and OnCanPerform: functions but they're essentially stubbed right now. The recipe works if you craft it. Lookup via recipe items wouldn't be ideal for my use case but could possibly work well
very minor question
how do you make custom shirts with custom images on them (not custom models, just the base game shirts with custom textures)
I want to make a mod that adds a lot of t-shirts to the game with a lot of silly images on them
figured it out - I thought the namespace reference it was using was the one from the modID, but it's actually using whatever you declared in module around the recipes (obvious in retrospect) which weren't a 1:1 match
I can't tell if I'm going crazy or not, but getPlayer():getBodyDamage():setOverallBodyHealth(0.5) should set the players HP to 50%, but whenever the code executes it shows the injured moodle for a fraction of a second, then immediately disappears.
Godmode is 100% off, because setting the overall body health in the general debugger lets me change it and it behaves as expected..
Are there any alternatives to setting the overall body health, or am I just tired & tea deprived..?
the overall health is just an average of the bodypart health
as soon as the next tick starts it recalculates it and your change is lost
The only problem I'm running into in my head with that then, is if I wanted to do 25% of the players HP in damage I can't just iterate through each BodyPart and BodyPart:AddDamage(0.25) because each body part contributes a different amount to the overall health (Right Hand at 0 HP loses ~10% overall health, while Lower Torso at 0 loses near 40%)
Overall body health here is at 50% but the body parts are everywhere from 70% to 96% :/
i wonder if AddGeneralHealth with a negative value would work
ahh, ReduceGeneralHealth
i knew there was something like it but i kept looking for stuff like AddGeneralDamage 😅
Seems to have done the trick, much thanks as usual Albion!
I really wish the Javadoc had descriptions for a lot of these functions, I swear half my headaches come from not 100% understanding which functions can do what I'm looking for
eventually we'll do something like that
Is there anyway to check if a vehicle is towing?
if i wanted to add a vanilla item to the loot distribution, would it be correct to identify it as "Base.Object" in table.insert?
for example, like table.insert(ProceduralDistributions.list["SurvivalGear'].items, "Base.Dungarees"?
yeah
sick thank you
a couple vanilla script files don't actually use the base module, off the top of my head there's camping, farming, radio
but base should cover most
yeah, i haven't ever encountered any clothing that isn't base
How can I get item from container and can I get item from floor and container together, floor, this is also a container, right?
Hello everyone. I resently new about modding and I wanna make my own mod. So I read documents about modding in PZ wiki.net, also analysed other mods and tried to figure out how to make these things. But I couldn't figure it out. Can you guys tell me how to start modding, and also about basic modding tips? I really wanna make one myself!!
Wiki is the right place. You can also start with this video: https://www.youtube.com/watch?v=N6tZujOPnDw
This tutorial video will show you how to make a simple drink in Project Zomboid. I will go into the steps involved from start to finish. Read more below.
0:00 intro
1:08 Start
1:44 Searching for images to use in game
2:30 Searching for the Sound Effect
3:06 Creating mod file directory
3:54 Creating mod.info
4:34 Creating a poster
7:14 Adding ne...
Think of something that you wanna make, then see if there is mod like that on workshop, if its there, or even similiar, just reverse engineer it and see how its done. It pretty much depends on what kind of mod you wanna make, is it new item with custom model, a recipes, or even some fancy new functions for existing items with the help of lua.
This is the way.
Hi, How do i force a standard component like UIButton to redraw itself?
never mind, btn:update() works just fine.
anyone here who works with sounds can tell me how the game determines the material of a fence being climbed? theres only one in the sounds_object script that goes for any fence regardless
Looks like it might be handled by tiledefinitions_noiseworks.patch.tiles (tile properties in the media folder)
I'm not sure if that particular tile pack is still the one being used by the game tho. But it's definitely linked to the tile property of FenceTypeHigh/Low and the Material
oh damn. thanks anyway
Anyone else making Jurassic Park related mods?
What was the goal?
im trying to make a simple mod by overlaying a vanilla sound with another sound. im doing everything through scripting so im not sure how to edit the tile properties and integrating that into my mod
Ah, I see. I'm only my aware of the system because of working with tiles and building mechanics, so I don't think I'll be much help, sorry.
Most of the mod's I see make changes to those sorts of sounds are manually installed soundbank replacements, but I have no idea if it's strictly necessary.
You can set tile properties with PropertyContainer.Set. For example:
local props = manager:getSprite("sprite"):getProperties();
props:Set("container", "crate");
props:Set("ContainerCapacity", "50");
props:Set(IsoFlagType.container);
But for some reason you can't set/unset some properties 
Lol I almost tagged you because of your IsoFlagType replacer but I wasn't sure it would apply
I'm still stuck on this, if anyone has any advice on how to refresh the container contents from a server-side script please let me know.
is there any resource for understanding item/itemContainer manipulation for singleplayer/client/server ?
the code im using seems to be working just fine when testing alone in a hosted steam world, but i do get an error for both the add and remove item from server calls, even tho it seems to work
error:
ERROR: addToItemRemoveSendBuffer
pseudo remove item code:
itemContainer:Remove(theItem);
if (isClient() and not isServer()) then
itemContainer:removeItemOnServer(theItem);
Asking for resources about modding is kind of a dream lol
please just a crumb of knowledge
I believe the removeItemOnServer already checks if the call is done from the client on the Java code:
public void removeItemOnServer(InventoryItem var1) {
if (GameClient.bClient) {
if (this.containingItem != null && this.containingItem.getWorldItem() != null) {
GameClient.instance.addToItemRemoveSendBuffer(this.containingItem.getWorldItem(), this, var1);
} else {
GameClient.instance.addToItemRemoveSendBuffer(this.parent, this, var1);
}
}
}
Make sure you are passing an instance of InventoryItem as argument.
Sry just trolling but I don't know sadly :/
ok so i supposed i can remove my if statement for the client, but i dont think that will get rid of the error
i should test with another client, because it might work fine as is, i just want to have no errors if possible
Depending on what you are trying to do you can probably used the timed action ISGrabItemAction or ISInventoryTransferAction
im specifically managing housekey loot on corpse spawn for TooManyHousekeys mod, trying to understand the basics before a bigger mod
I am having a lot of trouble myself trying to refresh a container after I add/remove items from a server side script. I might not be able to help much.
But as far as I can see doing this type of chages on the client side should have a lot more support.
Basically those timed actions are used for the game code itself for looting/trading/transfering items.
I think those are probably what you need.
yes im using a client script that operates onZombieDeath and some other data stuff in onZombieUpdate
all this inventory stuff is for the corpse inventory on death, player isnt directly involved, i dont think i should be using actions
but before trying to use the removeItemOnServer/addItemOnServer, all the item code only worked in singleplayer
Same with me singleplayer was really easy.
How are you finding the key before passing it as argument for removeItemOnServer ?
I haven't modded in a while, the "items" file is extremely long, is it possible I could make a folder for each category of items in there? (EDIT: yes, it worked fine)
It has "Katanas" and "Hammers" or whatever, could I have an "Items" folder then txt files in each of those for each type
Also if I were to do that would any existing saves be messed up, or since the item IDs will stay the same it'll be fine
theItem = itemContainer:FindAndReturn(itemStringName)
and the item name needs the "Base." prefix in this case
also, im not sure, but i think theres a chance of "theItem" being an array or something list-y, if there is multiple results of that kind, but im not sure i may be wrong
(if it is the case, you might want some kind of type_of check or whatever the correct syntax is)
This should be returning the correct item type for the removeItemOnServer as far as I can tell
yea yea, im pretty sure everything functions, just havent checked with multiple clients, and i would love to get rid of the error
maybe ill let the error be idk
Does this code work to make a meal upset the player when consumed? AngerChange = 45,
wait, should i be doing itemContainer:removeItemOnServer instead of itemContainer:Remove in the client case?
cause right now i always do itemContainer:Remove, and then try to do itemContainer:removeItemOnServer after that if its a client
i see code from searching this thread:
if isClient() then
item:getContainer():removeItemOnServer(item);
end
item:getContainer():DoRemoveItem(item)
this might be the correct way, ill try it now
I'm sorry if I'm being bothersome, I'm trying to develop my first mod, it's just for fun. The idea is that when eating this culinary recipe, the character gets angry.
{
DisplayCategory = Food,
HungerChange = -15,
Weight = 1,
Type = Food,
DaysFresh = 5,
DaysTotallyRotten = 7,
UnhappyChange = 32,
FatigueChange = 15,
AngerChange = 21,
DisplayName = Tazón de Materia Fecal,
Icon = PoopBowl,
Carbohydrates = 77.56,
Proteins = 16.04,
Lipids = 12.58,
Calories = 498,
ReplaceOnUse = Bowl,
StaticModel = Bowl,
EatType = Bowl,
DangerousUncooked = TRUE
WorldStaticModel = BowlSoup_Ground,
}```
I have no idea
you arent bothering anyone, i havent messed with making items, you could try looking for another item's code that affects the mood to see how
maybe look at vanilla bug items
I think the code that makes the character angry is: UnhappyChange."
i dont see a way to create the item on the client without adding it to the container, so i think the server line is supposed to run after the regular line
i think im doing it right so im just going to ignore the error
for now anyway
which one?
For setting they need to be a value that exists in a tiledef file. Otherwise you may need to add them during load like this #mod_development message .
with the OnAddMessage lua event... how can I figure out which player sent the message?
Or... how would I go about creating custom commands or chat commands?
declaration: package: zombie.chat, class: ChatMessage
You can override methods in ISChat (namely, onCommandEntered) to check for your custom command. I recommend calling the original function if it's not your command, to avoid breaking other mods extending chat/breaking the chat altogether
how do I change a zombie's model? like cut their arm off
how do you set roughness and height for a texture? or is it only possible to use base color?
Does anyone know if Mackus103, the developer of MoreBrews, is on this discord?
So, i renamed my mod, and then activated it again. When i reloaded an existing game with 'continue' the mod wouldn't load.
Is there a specific call back or call i need to make for my mod to become active during an existing game?
I can't for the life of me work out why my mod wouldn't load. It override the ISInvemtoryPane.createChildren() method to add a new row of buttons. And it works with a new game, but not a previous game.
(Standard check like if you call customer service and get asked it you've tried turning it off and on again) Are you sure the mod's enabled for the specific save and not just in the main menu? If it is, any stack trace errors? If you put a print call does it run?
i just went back and checked, it was indeed not enabled for the previous save.
:d
i assumed that when enabling a mod on the main menu, it was just active for the game.
lol.
turn it off and on again.
Does anyone know what type of variable categories is on a weapon? I'm trying to modify some categories on some weapons but I've only succeeded in adding additional categories to the weapons.
(I don't know ^ btw)
No worries - I'm so unfamiliar with lua lol
Hmhmhm what have you tried? I might have an idea after seeing it.
Here, the properties are not setting.
https://github.com/eI1on/pz-building-menu/blob/e9dc5054cb48e09278662e088458d1a1b4d6d73f/addons/Building_Menu_DaddyDirkie_Addon/Contents/mods/BuildingMenuDaddyDirkieAddon/media/lua/shared/BuildingMenu_DaddyDirkiePatches.lua#L30-L34
But for the vanilla tiles I can set properties. https://github.com/eI1on/pz-building-menu/blob/e9dc5054cb48e09278662e088458d1a1b4d6d73f/Contents/mods/BuildingMenu/media/lua/shared/BM_TilesPatches.lua#L24-L26
based this off of another mod I saw, although it seems to handle integers a lot better than strings
Testing in game with 1000 xp multiplier, you get both long blunt and axe skill when using any of the shovels.
Haven't found a mod that just does this already, otherwise I'd copy that code instead haha.
It does work for other variables correctly, such as damage, range, and other numeric variables
Ah, getting the script item template that item instances are based on, and then doing DoParam. I don't know of another way of editing them. Maybe there just so happens to be another method in the online java documentation for the script item class.
declaration: package: zombie.scripting.objects, class: Item
I think it probably takes a Kahlua array, not a Lua table. There's some method for creating those. Lua tables are made like someTable = {}. Kahlua arrays might be made like someArray = something.something()
If I have a mod which only needs two tiles made, do I HAVE to put them into a tilepack? Can you just use files to make tiles?
The references I see tile wise seem to always reference tiles inside a tile pack
I suppose, you kind of need a pack so you can define all the attributes, like is it solid and such
Well that was fun. Made an inventory filter mod
https://steamcommunity.com/sharedfiles/filedetails/?id=3145199627
https://github.com/emileswain/zomboid_es_inventory_filter/tree/main
Being made redundant gives me time to feck around. Lua is definitely an eye opener, now back to playing the game.
Has anyone experimented with changing zombie animations and re-importing? I was able to extract the idle animation but lack blender knowledge to change it to something else.
yup
But importing the base animations is kind of pain ngl
Has anyone made a .X converter tool?
the solution I've found is to use fragmotion
Then you just need to export the animation in .fbx when you're done
You can also follow this guide:
https://steamcommunity.com/sharedfiles/filedetails/?id=3035712003&searchtext=how+to+create+animation
This guide also has templates with good bones and IK links
does anyone have any suggestions for where to look for placing fences or furniture?
which class should I look in?
Trying to build a fence around a coordinate basically.
is there really anyway to "build" the map with the lua? Or does that need to be done with the mapbuilder and loaded as a map?
yes
ProjectZomboid\media\lua\server\BuildingObjects
ISBuildingObject.lua
or ProjectZomboid\media\lua\client\BuildingObjects\ISUI\ISBuildMenu.lua
those will be your entry points
Its important to know, that Map Structures are special, have special rooms and rules, etc. They also have far less performance implications as PZ prebakes their lighting and stuff.
okay ty
Where can I find the modding tools to create new Zomboid challenges from the vanilla one
i might dabble with animations soon, can i send friend request?
Im trying to understand why in some cases when using my custom ui menu, the buttons are not interactable. Sometimes it works, sometimes it wont detect mouse on the buttons.
I've been thinking it has something to do with needing to somehow manage joypadData or joyfocus? But it seems all of that is primarily for controller usage
Anyone know if there's a built in way to compare player's locations in MP? I think one of my old mods is running into an issue where the person is out of range of the other person to have an actual XYZ
Asking before I reinvent the wheel
mostly it's just to rely on the server for stuff like that if you can
It's for proximity invites
💀
Going to make a command loop call to pull the locations
should work
what proximity are you using that should catch players out of range 😨
Honestly not sure why it breaks - created weird issues
The load in range is like 300 right?
Seems like the issue was my fault / something to do with the logic gate
require "ISUI/UserPanel/ISFactionAddPlayerUI"
local util = require "ProximityInvites - utility"
local ISFactionAddPlayerUI_populateList = ISFactionAddPlayerUI.populateList
function ISFactionAddPlayerUI:populateList()
ISFactionAddPlayerUI_populateList(self)
if self.changeOwnership then return end
for i=1, self.playerList:size() do
local item = self.playerList.items[i]
local playerA, playerB = self.player, getPlayerFromUsername(item.username)
--if not playerB then print("WARNING: proximityInvite can't find: "..item.username) end
if not item or not item.username or not playerB or (not util.validPlayerToPlayerDistance(playerA, playerB) ) then
item.tooltip = (item.tooltip and item.tooltip.." " or "") .. getText("IGUI_outOfRange")
end
end
end
```This is what I'm changing it to
The viable range is now whatever the loading distance would be - which I think is either 150 or 300
to my knowledge it's basically the isocell size, so for me at least around a ~110 square radius
Also worth noting, there's a sandbox option to limit it further
I had it checking for true cases - so I think it was causing issues
Like people couldn't invite people even when in range - and the player list seem to have alot of dead entries
like the size for it made no sense
which class is best for creating your own menus with text & buttons?
ISPanelJoypad.
Several examples based on vanilla available in Wookiee Gamepad Support
how do you change a zombie's settings? such as turning off biting system
So; I made my first mod. Got everything working (just a simple item)
However, after further trying to add more to the mod I seem to have broke something. My Icon no longer works for the item. Is there any reason this could be?
I have a large problem, my mod is basic, just quality of life with recipes, but there are so many errors that I was surprised, I'm not missing commas, brackets or something, the worst thing is that it marks everything Vanilla... All for today.. If anyone experienced something similar, help would be helpful.
My list of fkups is as so… print(boolVariable) breaks must use print (tostring(boolVariable))
Spelling mistakes, especially capitals like toString rather than tostring.
Using “ . “ Rather than : by accident.
FYI I haven’t currently set up IntelliJ yet to support intellisence and corrections etc.
So My understanding is Icon = testimage,
testimage.png Is placed in textures
is it possible to make it so that a custom-made item (acts same way as a spice) can be added multiple times to a beverage?
apparently I can add it only once to a beverage before the option to add it again is gone. What I want to achieve is add it a maximum of 3 times
Afraid i'm a beginner too with lua and zombie modding, and haven't yet experimented with applying custom textures. What I would say is that without any reference to what your code looks like, or what the error is, its going to be very hard for people to give much advice for your specific issue.
Because I haven't yet setup debug mode, i also referenced the logs from my c:/users/name/Zomboid/Logs folder and something that caught me out is that the logs will be saved in a new file every couple of hours, as such, when checking logs I would sometimes be looking at the wrong [date]-[time]_DebugLog.txt file. I really should have made the effort to turn debug mode on.
One thing you might try is if your writing lua scripts, then add in some print("here") statements to see where your code is/isn't executing.
I'm trying to make a food item that lets you take one bar each from a pack of five rations after opening it, and when all five portions are taken from the package, it will be deleted (I don't want to bother making an empty one as litter, even if for realism). Where do you think I should go from here?
I'd assume it's something like this but that would be cluttered
UseDelta = 0.2,
DisappearOnUse = TRUE,```
try this
not sure if it'll work for food
are we able to place unbreakable fences?
Is there a list anywhere of all the sounds available in the game?
also for sprites would be nice
i unpacked the .pack files but a lot of sounds seem to be hidden somewhere else
looking specifically for building/crafting sounds
This code creates an unbreakable wall at the player's coordinates, depending on what you want to do with it you can adapt it.
local player = getPlayer()
local x, y, z = player:getX(), player:getY(), player:getZ();
print(x, " ", y, " ", z)
local cell = getWorld():getCell();
local square = cell:getGridSquare(x, y, z);
local wall = IsoThumpable.new(cell, square, "walls_exterior_house_01_16", false, {})
wall:setName("Wall")
wall:setIsThumpable(false)
square:AddSpecialObject(wall);
wall:transmitCompleteItemToServer();
But there is a mod to make tiles placed with Brush Tool unbreakable: https://steamcommunity.com/sharedfiles/filedetails/?id=3025189998
In that Brushtools you can also see all the tilepacks you have activated in the current world. To see the cheats you need to activate the debug mode.
in ProjectZomboid\media\sound\banks\Desktop there are .bank files, you need to unpack those
yes, i unpacked them. the crafting sounds dont appear to be in there
i was wondering if anyone knew of any other sound banks not in that folder
@viral halo see Icon =
This is very similar to the code I'm running. I'm not home else I'd show
did I accidentally get on the same wavelength with him?
I haven't tested it before adding the delta, I guess it works with food items
https://cdn.discordapp.com/attachments/810274688941031455/1199396939301662901/choko_aji_rashii_yo.mp4?ex=65c26472&is=65afef72&hm=e8686d02c78271ab4cc37c67ffd7853309fd1d19a6b6a1111dde3836aa44e58a&
but now I'm having a problem with adding models since it just seems to break items now
one time I couldn't spawn a closed package, then I couldn't open it 'cause the opened version is missing
https://theindiestone.com/forums/index.php?/topic/12204-how-to-change-the-texture-and-name-of-a-item/ this post describes some steps to changing an icon that may help. Note the last post, and that you need to name new icons specifically with the prefix “Item_…” I.e “Item_newicon.png” but in the code you only put “newicon.png” .
I didn’t check the date on that post so it might be out of date.
Yeah, your item is missing the icon as well. Mine WAS working 100%. But unsure what caused the break.
If you fix it lmk?
I'm gonna be home in a handful of hours and gonna test to see if the code actually works like it should still and see if it's just missing icons.
nah, I just didn't make them earlier
Oh okay, mine are made. Was working, and broke 😐 I guess we are having different issues
lmao you broke all your tiles
I don't have that problem yet
Tell me please where can I get list of all animmask?
anim mask ?
I figured it out, don't pay attention
Reason: Bad word usage
Howdy! This is probibly asked a lot but I am trying to mod hunger, nutrition, calories, the ammount you can eat etc. I'm having trouble finding which variables or stats actually control all that. There are a few other things I would like to mod but that's the first on the list. IF someone can direct me to a list somewhere that would be very appreciated.
hi peoples can someone help me make a mod i can only model sadly D:
This probably is all handled by the Java
You probably looked in the lua codes if I had to guess, but I don't think you'll find it there
Something like that yeah. I know just enough code to fumble about with it. But mostly I am looking for ways to tweak the max character stats, if that makes sense.
I've been downloading peoples mods for various things and trying to figure out how they do X,Y, and etc XD
That's the best way to learn rn
Maybe you could look at the mods that show your stats in a UI
That... is a great idea actually
so i already made one helmet
Thanks! I'll do that 🙂
where can I find a list of the world objects available in the game to spawn? like walls_exterior_house_01_0 etc? I'm specifically looking for the big ass fences with barb wire on the top
there's multiple models for each way it's facing etc. etc. just dunno where to find all these files
If you know where it is in the world, load up a game in debug. grab the brush tool and copy the item, I believe it will give you the texture.
You could always search through the brush as well and look for the item you want.
fencing_01_48 through 53
or fencing_01_88 through 92
the first is the green bar fence and the second is the modular stuff at the military blockade
I made a program that spits out all the info I need about items in the world. You can see the output log with the tile and textures
Does anyone know how generators indoors poison the air/damage the player? I have yet to find the code for it.
ur a hero
Alright, Finally home. Tried to load my mod up and my game freezes.
Am I missing something stupid here? If so what is it. This is my first mod I've tried to do, so just kinda learning as I go.
Two relevant parts of the code: IsoGameCharacter.updateInternal actually handles doing the damage, based on the isToxic method of IsoBuilding (i.e., by checking whether the current building is "toxic"). The toxicity flag is set in IsoGenerator.update based on the expected conditions (on & indoors)
Is that the full code? If so you're missing a closing bracket
Thanks; I see that. Also Found my icon issue out
Didn't realize you have to name the "textures" with Item_Name
Hello, I want to get a list of farming objects, but either I'm looking for them in the wrong place or I'm looking for them incorrectly. Please, experienced coders, tell me what I should do.
`For tests I use TimedActions:
require "TimedActions/ISBaseTimedAction"
function isSHFeveryTenMinutes()
for key, value in pairs(CFarmingSystem) do
print(" Key:", key, ", Value:", value)
end
end
Events.EveryTenMinutes.Add(isSHFeveryTenMinutes);`
does anyone know how IsoThumpables setName() works?
When creating the wall, I've used setName("prison") before adding it to the square.
When getting the thumpable wall later with square.getThumpableWall(true), and then getName()... it's showing "Wall" as the name.
A work around might be looking for the texture or spriteName(), or maybe try objectName()?
You could always moddata a variable if you need something personal and that can be transmitted multiplayer too.
I did a thing
https://youtu.be/fBXSlMIrL60?si=x8YNyH747lWytbqs
Subscribe today!
https://steamcommunity.com/sharedfiles/filedetails/?id=3146046428
Music by George Streicher
www.georgestreicher.com
TV Assets by Tyler Casey
https://cinepacks.store/
was able to get it... was a logic error on my end. thanks
Does anyone know a way to easily get IsoObjects around a player or around a coordinate? Or maybe, a table of all IsoObjects within a cell?
Otherwise, I'm iterating through all possible "close" x,y coords around my target coordinate and checking them for IsoObjects. I feel like their may be a better, more-performant way to do this though
this inconsistency has me fit to murder someone
i love the zomboid api so much
calling nil for the past two hours
don't tempt me
square:transmitRemoveItemFromSquare(obj);
thumpable:transmitCompleteItemToClients();
more inconsistenicies for u
not to be confused with
square.transmitRemoveItemFromSquareOnServer(obj);
square:transmitRemoveItemFromSquare(obj);
is for clients, so why not... ToClients???!!
on one hand i sympathise with devs building on a project over a decade old
on the other hand
i want justice
swift justice
yeaaa
im building here because green grass
a lot of mods can be made
the mods out rn are honestly meh
but, it's really understandable. The API is fucking ass.
fair, i think that's a priority for upcoming builds
project zomboid is more on the level of GTA V's Five M
remember reading something about wanting to move to that kind of platform accessibility
superj a nky
api is actually really hard to mod on
anything super advanced is going to cause hella server lag
not trying to be a hater in the PZ chat or anything myb
but, you're right. this game's api is really difficult to mod with
high level Lua api question I wanted a sanity check on: Is it fair to say you would never want to bind events in a file that may be required by another file? Since then the hooks would be bound once when loaded and again when the other file requires it? Or does Pz somehow avoid this from happening?
you're misunderstanding what require does, require only runs the file if it hasn't already been run
require is less 'run this file now' and more 'ensure this file has already loaded before continuing'
if you're using the return value of the file that's cached after the file runs
Does anyone know where to find background moodle mechanics and how to edit them properly?
Doesn't it allow you to use functions in the file you require when they are local ...?
no
it might let you access a single local variable if the file returns that variable
but require doesn't directly expose locals
Hi guys,
What do three Boolean values represent?
if the first boolean is true, then the Event.AddXP(value) function will be triggered, it's correct?
getPlayer():getXp():AddXP(Perks.Cooking, amount, true, false, false)
thank you.
What's the point of local functions then ?
They are “local to” the file, as in you can use them within that file. You can also return things as file-level (or “module”) returns, to make those available
i.e.,
local function onlyUsedHere()
-- some specific thing that only this file needs
end
local function exported()
-- something that files that require this might use
end
return { exported = exported }
This is a contrived example to illustrate the point. You can also write it as a member of a table from the start, which is neater & what I prefer:
local module = {}
function module.exported()
-- available in files that require this
end
return module
To clarify how those are accessed, if the above code is in file module.lua:
local module = require 'module'
module.exported()
First one is as you said, if true it'll trigger AddXP. Second one is for whether XP boosts (from skills & multipliers) should be applied. Third one controls whether sendAddXp is called (if it's a player on the client). In the documentation these are named callLua, doXPBoost, and remote
" In the documentation these are named callLua, doXPBoost, and remote "
Thank you very much. Can you provide me with the link to the document where this is written?
public void AddXP(PerkFactory.Perks type,
int amount,
boolean callLua,
boolean addGlobalXp) ```
and here https://zomboid-javadoc.com/41.78/zombie/characters/IsoGameCharacter.XP.html#AddXP(zombie.characters.skills.PerkFactory.Perk,float,boolean,boolean,boolean)
``` AddXP
public void AddXP(PerkFactory.Perk perk,
float float1,
boolean boolean1,
boolean boolean2,
boolean boolean3) ```
Javadoc Project Zomboid Modding API declaration: package: zombie.characters, class: IsoGameCharacter, class: XP
I believe projectzomboid.com/modding is the most up-to-date source: https://projectzomboid.com/modding/zombie/characters/IsoGameCharacter.XP.html#AddXP(zombie.characters.skills.PerkFactory.Perk,float,boolean,boolean,boolean) (Although that very well may be incorrect; unsure where exactly zomboid-javadoc is in comparison)
declaration: package: zombie.characters, class: IsoGameCharacter, class: XP
Hello. I am a beginner mod and I would need advice on how to correctly write a link to a trait in another mod. I would need a certain trait to be locked when Trait is selected. However, the locked trait is found in a different mod. And how to correctly write the link to the trait. I am attaching the current picture. Thanks for help.
Is there a guide on font sizing? I was looking at the ISInventoryPane/Page classes and they have some scaling multipliers and if statements to pick font size for the inventory text. Wasn't sure if someones covered the approach to picking a font size for UI text/button labels etc in a guide. I.e. when to use different font sizes etc etc.
this is the code in ISInventoryPane.lua . I'm wondering what zoom values to pass?
...
local font = getCore():getOptionInventoryFont()
if font == "Large" then
o.font = UIFont.Large
elseif font == "Small" then
o.font = UIFont.Small
else
o.font = UIFont.Medium
end
if zoom > 1.5 then
o.font = UIFont.Large;
end
o.fontHgt = getTextManager():getFontFromEnum(o.font):getLineHeight()
o.itemHgt = math.ceil(math.max(18, o.fontHgt) * o.zoom)
o.texScale = math.min(32, (o.itemHgt - 2)) / 32
...
where can I find the game speed state in a singleplayer save file?
Also, where do devs find it easiest to save there working files? Given I can there is at least 2 locations to put mods? I’m currently inclined to move my wip files into the initial user/zomboid/workshop/mod-I’d/Content folder. But obviously I’d need to deploy a base mod first. Which leaves the user/zomboid/mods folder for initial development. But then also means having to copy changes everytime. Bit of a headache tbh.
For WIP, use git. When you're ready to move it to the workshop folder, you can just pull your main branch
that also lets you rollback changes
Hmm not sure I got those directories right, but I think you know what I mean.
Yeah I use git already. I was just confused by the fact you can start mods in multiple different locations.
wdym by copying changes? i would not recommend having copies of the mod in more than one location zomboid might load
https://theindiestone.com/forums/index.php?/topic/70371-transmitting-and-requesting-moddata-problem/
could someone maybe check my problem cause i ran out of ideas...
Hi, im trying to save bank account data as global moddata per player. My problem is that when im withdrawing money every second time data is updated. local function buttonClick(button, args) writeLog(ATM.GetLogName(), "debug0.0 - " .. ATM.Data.Account.money); num = tonumber(ui["amount"]:getValue(...
Whoops, tried to edit my comment and deleted it. I are smort. This is finding what I'm looking for on the current floor, but I need to check one floor down. Any help is appreciated as I'm still learning.
function ISPlumbHelperCursor2:isValid(square)
local objects = square:getObjects()
for index=0, objects:size()-1 do
local object = objects:get(index)
if object:hasModData() and object:getModData().canBeWaterPiped then
return true
end
end
return false
end
u can try cell:getGridSquare(x, y, z-1) using coords of ur known square
get cell with player:getCell() i think is the func
I was messing around with Chatgtp to help me with some coding.
I want to make a dialog box appear after the player dies and show all the wounds they have on each body part.
When I run it though, nothing happens. If someone wants to take a look and tell me what I'm doing wrong, it will be appreciated XD
im new to lua... been transpiling from typescript but
i would assign your dialog...
local dialog = ISDialog.initialise(self)
I can try that
i guess? idk, think you may need to initialize it with some required parameters.
Also,
thanks 😄
youll need to do
dialog:addToUIManager();
this is what will spawn it on the UI
I will try this out later XD
since it is undocumented
best thing u can do is download mods from workshop that do something similar to what youre doing
and you can view the lua for them in your workshop folder 🙂
dialogs and stuff u can easily copy and paste from there.
chatgpt isnt trained on any of these lua files. shes pretty unhelpful with PZ modding
gives you completely wrong code
this is typescript, but what was able to spawn something
const modal = new ISModalDialog(0, 0, 100, 100, "Hunger Games", true, "", "", null, "Hunger Games", "");
modal.addToUIManager();
i want to try to train an AI model on project zomboid codebase & some good mods, would be sick
That would 🙂
https://github.com/asledgehammer/Umbrella
use this to see types
just put it in your vscode project directory
... creating new function even not connected with vehicle make new horizontals ...
i menage to make MIRROR texture 😂
and is Live mirror move vehicle or self and object on it moving along with players xD just not sure how i make it correctly ... tooo many code ahead and now how to flip it 180' xD
how can I translate text from .tiles file? I need to translate dismantle item`s name, that consides in .tiles file
Indeed, it would take a fair bit to get good zomboid specific solutions. Might be ok for lua syntax checking.
You can probably get quite far just by writing a decent prompt. 1st step though would be to source the zomboid lua and Java manuals. Feeding them into chatGPT in chunks. There should be a chatGPT plug-in for that, but I find them a bit ropey. Something I would say however is that Zomboid devs might not want there code uploaded, so you’d have to ask if they are ok with that.
Reason: Bad word usage
Good afternoon guys, I'm trying to create a mod to change the wallpaper to one from the menu and I don't know where to start
You know Braven’s ScreecherZ mod that makes sprinters scream? Well I would love it, for nothing other than my own personal amusement, for someone to give me basic instructions on how to replace ALL zombie screams and growls in their entirety with Daniel Larson’s screaming.
You can look at the code in the mod you've mentioned to determine how it was done. Since you'd like to do essentially the same thing but applied more generally, it'll likely have a similar structure & just fewer conditions
Is it possible to get moving objects (zeds) via server side script? I'm trying to count zombies in the building.
On client side it is rather easy.
Got it! May be able to do it better, but this worked
function ISPlumbHelperCursor2:isValid(square)
local xa, ya, za = self:getSquare2Pos(square)
local squareA = getCell():getGridSquare(xa, ya, za)
if not squareA then return false end
local objects = squareA:getObjects()
for index=0, objects:size()-1 do
local object = objects:get(index)
if object:hasModData() and object:getModData().canBeWaterPiped then
return true
end
end
return false
end
function ISPlumbHelperCursor2:getSquare2Pos(square)
local x = square:getX()
local y = square:getY()
local z = square:getZ()-1
return x, y, z
end
Thanks for pointing me in the right direction!
I was having weird errors before, so now that it's working I can probably integrate the second function into the first, right?
Yep, nice.
function ISPlumbHelperCursor2:isValid(square)
local x,y,z = square:getX(),square:getY(),square:getZ()-1
local squareA = getCell():getGridSquare(x, y, z)
if not squareA then return false end
local objects = squareA:getObjects()
for index=0, objects:size()-1 do
local object = objects:get(index)
if object:hasModData() and object:getModData().canBeWaterPiped then
return true
end
end
return false
end
You wizard!
How did you manage that feat of dark magic
Magicians never tell their own secrets

🥲
Is there any way to have sandbox options as floats? i only ever see integers
ah nevermind found it out
no, I mean a text file with .tiles, like something_tiledef.tiles, which, as far as I understand, stores data about a specific tile, but if in Lua I would write getText(), then here is a simple UTF-8 file and getText() does not work, and direct translation of the name doesn’t work either
Good evening everyone!
I'm struggling with a problem I can't quite figure out. I want to (basically), Access a specific player's Map/minimap, add a marker (the round one), and maybe an "annotation". Could someone point me in the right direction in the documentation?
It's not for a friend, it's for me.
( And BTW, the PZ community is the most kind-hearted I've ever known. 😚)
Are you trying to access the client player's map or another player's?
The player map, precisely.
Thanks a lot, i'd like to see this. 
so, you can get the player's map by simply using ISWorldMap_instance
This is initialised only after the player opens the map for the first time in his session, so when using it you probably want to do
if not ISWorldMap_instance then return end depending on your exact use, or simply manually initialise it (check ISWorldMap.ShowWorldMap line 860)
I haven't really messed with the symbols/annotations before but I'll try to find it for you in a min!
You can do it by drawing on their map using a servercommand
I did something that draws a polygon around a predefined area using scaled annotation symbols. I imagine you could do the same with onservercommand event and executing it for specific players
I get the idea. But i mis-explained myself. It's fort drawing a "house" marker on the map, a a certain point in time, for exemple. ( SP games )
no luck on my side unfortunately getting exactly what you need but found getSymbolsAPI() in vanilla script. Maybe running a more thorough search around that can help you. Also lect's solution could be easier! Good luck :)
Javadoc Project Zomboid Modding API declaration: package: zombie.worldMap, class: UIWorldMapV1
I'll work on that, thanks @hollow current for the help. 
It should be easier for SP games I think if you can set a flag for it to activate.

Could someone inform me how a weapon mod recognizes the mesh and texture being used? I've currently gotten all of the relevant stats written and apparently working (such as damage, crit, range, sound, etc...), but the weapon doesn't show up in my hand, and when placed showed with the missing textures. Clearly, It's got the mesh in there somewhere. But getting that mesh and most important texture to show is an issue. Thanks in advance for any help.
anyone knows where the bandit/punk (from the zombie stories) outfits code is located at?
Anyone knows if it is possible to change the time for recipes in Lua ?
My idea is to change only the time it takes for a player to craft some existing recipes.
it is possible, for what i know.
Is there a way to simulate a slow\heavy loaded server in a local environment?
Host, allocate barely enough ram to run the server maybe ?
And add loads of zombies maybe
Set huge amounts of buildings in fire
that could actually work
You might be able to do it using scriptmanager
I think I'm getting closer, here is what I tried so far:
function ChangeRecipes()
local recipes = getAllRecipes()
for i=0,recipes:size()-1 do
local recipe = recipes:get(i)
print(recipe:getName())
if recipe:getName() == "Rip Clothing" then
print("Changing Rip Clothing time from " .. recipe["TimeToMake"] .. " to 10")
recipe["TimeToMake"] = 10
end
end
end
Events.OnGameStart.Add(ChangeRecipes)
I can use the getName() normally but I always receive null when trying to access the Float property TimeToMake, I also tried recipe.TimeToMake
There is no setter for that property unfortunately
Thanks I'm gonna look into it
I found this which was exactly what I was looking for to simulate a pretty shitty connection to a server. May be useful to someone else:
https://github.com/jagt/clumsy
thats not going to work
I think you can also lower the process priority on your O.S. to mimic a overloaded server
also that, yeah, but I mostly wanted to test network performance more than anything else
if i wanted to have a container that checks it's contents and changes their properties over a certain amount of time i'd have to use Events.Ontick right?
EveryOneMinute would be better, OnTick seems excessive for something like that
if you need precise timestamps, then OnTick would be the better choice, yeah
thanks . nothing precise needed i figured every tick was excessive
Checks the other Events, you can use EveryOneMinute, EveryTenMinutes, EveryHours and EveryDays
the less you check stuff, especially if you need to check multiple items, the better
local recipe = ScriptManager.instance:getRecipe("Rip Clothing")
if recipe then
recipe:TimeToMake(10)
end```
i think something like this if you're just targeting that one recipe
I tried but it also didn't work, I'm not sure it is possible. As far as I can tell the loop I had returns the same object and also getAllRecipes() comes from the ScriptManager. The problem is the Recipe class itself, it has setters for most properties, but not for TimeToMake, Heat and some others.
My first approach was to simply override the Base recipe, but there are 6 recipes called Rip Clothing and override only works for one of them...
maybe setIsHidden and setNeedToBeLearn in your for loop to disable and hide them
and make your recipe named something slightly different
Good idea, I can read the time so I can easily find the vanilla ones!
Yep, that worked. Thanks!
anyone knows the location of the code for the outfits for the random zombie stories?
Trying to allow ISMaps to have "pages" to simulate books/pamphlets, anyone got a clue as to why it won't allow addTexture() to work?
No errors to speak of
hey can anyone help? ive been looking for the code (i think its called functions?) for the zombie outfits that are used in some randomized stories, but i cant find the files. pls help
how do you get the loot pool of foraging in a specific area?
The error was me, I was trying to draw the texture using floats but the input is out of 255, so I was using an alpha of 1/255. 😞
i think forageSystem.generateLootTable in forageSystem.lua is where you will want to look
i thought alpha was 0-1 for textures, TIL
It is on draw textures
Maps have an addTexture
There's a few cases where 255 is used
Not sure if there's a correlation
Sucks when something small like this burns my night lol
But it is what it is
the outfits ? It's set up in clothing.xml
Another day, another question. How do you add a random event to the game?
I'm looking at https://steamcommunity.com/sharedfiles/filedetails/?id=3133667399&searchtext=nuclear and (trying) to make an event based off of it.
Thanks! I'm still learning LUA. I'll look around and see if I can find the events list.

