#mod_development
1 messages Β· Page 174 of 1
oh, did you reload the file (as opposed to a full lua reload) before this happened?
@bronze yoke that could have been it! The problem DID go away when I closed the game. π€
if you a hook a function and then reload the file, it hooks it again, stacking upon itself
Yup. That's it!
that's one of the main reasons i stick to full lua reloads
Is there an easier way to do a full reload without going back to the main menu?
no
it only takes my pc about five or so seconds to load back in so it's never really bothered me
even if you could reload midgame it'd still be prone to some of the same issues
and vanilla lua is not equipped to deal with those issues so it'd be catastrophic
I'm willing to bet you also have to reload a lot less than I do. Most of what I'm doing is banging sticks together and hoping magic will come out. I'm still doing a lot of guesswork.
I think i'll be logging off shortly. But before I head off I'd like to ask, does anyone know why my game doesn't know what variable ATM is?
local ATM = AnthroTraitsMain;
...
local OriginalEatPerform = ISEatFoodAction.perform;
ISEatFoodAction.perform = function(self)
-- code to run before the original
OriginalEatPerform(self);
-- code to run after the original
ATM.DoVoreModifier(self.character, self.item, self.percentage)
end
where does AnthroTraitsMain come from? is it global?
This is a new bug after making it a module
AnthroTraitsMain = {};
...
AnthroTraitsMain.DoVoreModifier = function(character, foodEaten, foodPercentEaten)
...
return AnthroTraitsMain
but does this file require that file?
Just confirmed my inventory IS in the title of the window instead of the content. :/
actually if it's not local it shouldn't be (but if it's not local there's not much purpose to using the module pattern)
I'd like to code in lua more properly, so I def don't want it to be local and actually understand this module pattern
the module pattern is basically turning every file into its own environment, which you can then choose to pull into another file by requiring it into a variable
so you keep all (or most of) your functions and variables in a local table, and return that table at the end of the file
then if you need that file in another, you require that file and put it into a variable so you can use that table
Should I be doing that for my function hooks? I thought the purpose of them was to be sort of global
function hooks should be global, or you're not actually hooking anything
also. for the require this is what was messing me up before I chose to make everything modules. Is this enough?
local ATM = require(AnthroTraitsMain);
or do i have to guess the folder path I should be looking for the file in?
so this issue is happening in my new AnthroTraitsFunctionHooks.lua file. It's the only one referencing other files rn
you do need to point to the file (the path after lua/client/ or whichever folder it's in)

e.g. lua/shared/myMod/myModule.lua would be pulled in with local myModule = require("myMod/myModule")
is the path relative? or whenever you require does it start from the same place?
it always starts from the same place
okay, thats really really useful to know
...
albion, would you (or anyone else who's knowledgeable in lua) be interested in taking a look at my repo at some point? I'd like to make sure that my mod structure isn't strange. Like this perhaps borked setup of the module pattern I have set up
sure, i can take a look tomorrow if you'd like
also, really weird, this
AnthroTraitsMainCreationMethods = {}
...
AnthroTraitsMainCreationMethods.refundSelectedAffectedTraits = function()
...
AnthroTraitsMainCreationMethods.sortTraits = function()
...
return AnthroTraitsMainCreationMethods;
works with this
--media/client/AnthroTraitsFunctionHooks.lua
local oldSOSMD = SandboxOptionsScreen.onOptionMouseDown
SandboxOptionsScreen.onOptionMouseDown = function(...)
ATC.refundSelectedAffectedTraits();
oldSOSMD(...);
ATC.sortTraits();
end
that would be really nice, and super appreciated
if your modules are currently global then the difference might just be load order or something
I'm calling it. Good night you two! Thanks to both of you for being so incredibly helpful today!
gn!
gn to you both too. i sleep
good night to all the lurkers too. I know you're out there >.>
can anyone make a very simple mod for me
how do i override a mod items
ive set the load order for AFTER and it still doesnt work
should be...
Mod items 'Base.' or another?
Your override full item parameter or not?
Maybe try adjuster or itemtweaker?
your mod ID name alphabetically after other mod ID name?
The sun is coming up and I regret everything
local TestFramework = require("TestFramework/TestFramework")
local TestUtils = require("TestFramework/TestUtils")
if not TestFramework then return end
TestFramework.RegisterModule("Mod Name", "Test Group", function ()
local Tests = {}
Tests.testName = function ()
TestUtils.assert(true)
end
Tests.anotherTestName = function ()
TestUtils.fail("This test should fail.")
end
Tests.testPlayerDies = function ()
local player = getSpecificPlayer(0)
player:Kill(player)
TestUtils.assert(player:isDead())
end
return Tests
end)
so my mod makes the player talk, how do i make the chat appear above their head for other players in multiplayer? not nessesarily in the chat box but at least overhead.
right now i'm using Player:Say() but i'm wondering if i should be using something else
Try processGeneralMessage(text)
i will, thanks.
Does anyone know if it's plausible to apply nametags to zombies like players have?
good morning everyone
I scaled it in blender so I'm going to see if it works
okay it's still invisible
Did you center the object?
In blender make sure the origin of the 3D model is at the center.
I am surprised by xml animations (AnimSets) being loaded (and reloaded at modification time) by a dedicated server LOG : General , 1687446652160> 265?615?934> DebugFileWatcher Hit. AnimSets: C:\Users\MyLogin\Zomboid\mods\InfectedPlayer\media\AnimSets\player\idle\IdleInfected.xml LOG : General , 1687446653161> 265?616?934> Refreshing AnimSets. ERROR: Animation , 1687446655176> 265?618?950> AdvancedAnimator.SetState> State not found: idle WARN : Animation , 1687446655177> 265?618?950> AnimationSet.GetState> AnimState not found: idle
With ISUIElement and their drawText functions we should be able to do that
Is there any method to get the type of a zombie from IsoZombie ? For example AuthenticCharcoal defined here.```lua
ZombiesZoneDefinition.AnthraxBurned = {
AuthenticCharcoal = {
name="AuthenticCharcoal",
chance=90,
},
}
look for the outfit name
probably for sync since so many things are tied to anims
thanks
I have a question. I'm making an M1 Garand mod and i'm making 3006 rounds to add. but on the box of ammo is where i'm having an issue. I've made the model and icon, it shows up in game but i cannot open the box of ammo
look for "open <something>" recipe under txt files
Thank you!!!
What's the way to change boredom ? I am confused with stats.Boredom, stats.boredom, stats.idleboredom. the first seems out of reach and the two laters have no effect on the moodle.
I'm even more confused with Game character update modifying idleboredom. I must be messing badly
Moodle is overriding stats.Boredom from BodyDamage.boredomLevel and then using stats.Boredom.
I want to remove AnimSet/player/strafe/MyAnim.xml from a mod I already published. Can I just remove it or should I empty it instead but leave the file for users to get a smooth update ?
empty it
the issue with steam not deleting removed files is not lua specific or anything
Good afternoon.
This explains a lot
Guys, i have a problem with facelock realisation for cars...
I can't figure out how to refer to the car so that the character only looks at it while performing the action.
I do not understand what you want. In what is it so different from Vanilla you do not wanna use waitToStart ?
AnimActions are cool, you can apply them so only the upperbody is impacted while the lower body is not.
But with Strafe, the lower body is twisted. How can I remove this twist or compensate it in the AnimAction ? (by AnimAction, I mean the animation started from a lua timed action)
i want lock faceposition on car (or part car), but hidden comment-code not work, work only for windows and doors, i do work-around for this
like RMB shouldnt work when anim play
faceThisObject faces IsoObject instances. but the parts (mounted on vehicles) are not isoObject instances, they are visual stuff on the Vehicle IsoObject
vanila work fine
no, vanilla faces the vehicle
you can face the vehicle too, by using the same waitToStart funciton
only in waitToStart?
What is the difference, in fact? 
this will make you turn before the action is started and after that you will remain in that direction until a movement occures. but movements wil likely deactivate the action so it is ok
waitToStart is an added step until it returns false
action time is not counsumed
update is not yet called
start is not yet called
hmm
should I somehow predefine this separately for the transport (I'm talking about waitToStart, because another work fine...)
I do not understand
i mean situation with door and windows work fine without waitToStart
If i do waitToStart, it's break script? (should i do work-around for vechicles, or just paste all "Update" stuff in "waitToStart"?)
The new thursdoid seems big for us!
Aiteron has been making improvements to our sandbox menu, mod menu general mod settings. Our sandbox settings panels had become so vast and unwieldy that they needed a redesign β now with an added search function, simplification in some areas to make things less impenetrable to noobs, and some βadvanced settingsβ for the long-term survivors amongst us. We will also be improving the server settings interface, simplifying the addition of mods, unifying settings, making it easier to add modded sandbox settings etc.
plus the entirety of the vending machine / all machine UIs
I'm very temped to ask Aiteron if they can speak a little more on this
Idea for a mod
two people can lift an object together - halfing the weight if they both agree to lift and stay nearby!
Does anyone have any detail on why you can't replace the existing soundbanks using mods? I was looking at this mod and apparently the Soundworks update changed things: https://steamcommunity.com/sharedfiles/filedetails/?id=2718650240
local function adjustFoodNotPicky(item)
-- Cancel out any negative effects
if ((item:getUnhappyChange() > 0) and (item:getType() == "Base.DogfoodOpen")) then
item:setUnhappyChange(- 10)
end
if ((item:getBoredomChange() > 0) and (item:getType() == "Base.DogfoodOpen")) then
item:setBoredomChange(- 10)
end
end```
This code isn't working if I add the `and item:getType() == "Base.DogfoodOpen"` but it seems to work without it. What's going on? This is supposed to make ONLY dog food give happiness.
Hello lads, what's the way to override multiple vanilla recipes with the SAME name?
you need to use lua to disable them
the script method of overriding them doesn't work for multiple
happy days
i'm pretty good with LUA
yet i'm pretty bad with the API
(started modding PZ very recently)
what should i look for?
ScriptManager has an arraylist of recipes
so i guess recipe = nil
i think you'd need to set the recipe to hidden or something
i don't know if just removing it from the list would work, that'd be pretty convenient if it did but i've never seen people go about it that way
may i ask you if you know where i could find an example script? even a mod or something the API isn't too explanatory at points
(untested)```lua
local recipeToRemove = "Recipe Name"
local recipes = ScriptManager.instance:getAllRecipes()
for i = 0, recipes:size()-1 do
local recipe = recipes:get(i)
if recipe:getName() == recipeToRemove then
recipe:setIsHidden(true)
end
end
going nil isn't usually the best way to go with LUA, might create conflicts with other mods especially on vanilla content (from my modding experience)
it's pretty rare for a mod to directly reference recipes like this, and when you directly reference content that isn't from your own mod you should write your script to handle if it doesn't exist imo
server or shared, doesn't matter
correct me if i'm wrong
client folder - client only script
shared - both client and server
server - server only
that would make sense wouldn't it
does
client - client only script
shared - both client and server
server - both client and server
wasn't sure about shared tho

if was only a hook for both or the same working environment
guess i'll give it a try
all share the same environment, the only difference is whether the client files get ran or not
Is someone know how to set pain in lua ? Cause setPain(30) didnt work
hey can someone tell me if I am doing this wrong
Nothing wrong there I can see
the model is just not there
Is the orange dot in the correct point in blender?
The dot shows the origin of the object, it should be positioned at the exact bottom center of your object.
If it looks something like this, your models probably offset in-game
Had an item in Susceptible 20m east of where it should be because of that
I'm trying to make a cookie box and I think its underground
unless I have the wrong model directory
Food Items are WorldItems
right?
WorldItem is the type for 3D items you can see on the floor.
They can hold a reference to any InventoryItem type.
alright so how would I do it? for the floor model?
You've already done it right as far as I can tell from the scripts you've posted.
Which is why I suspected an offset issue with the model
this is the offset
A baked offset in the fbx file itself
where do I find the offset in blender
Its visualized by the orange dot, like the screenshots I showed
got it
The dot is the true origin of the model
it didnt do anything
set the location to 0,0,0 in blender
The model should be resting on the floor, if its not, you need to adjust it and apply the location so that its resting on the floor with the location set as 0,0,0
okay progress it worked but its large
Notloc I haven't been around much but saw your inventory mod released here. congrats on that man, seriously such an undertaking. kudos!
I put it in mod support but i dont think it was the correct chat for it
Yo im incredibly new to modding and trying to make a simple trait mod where the character gains 2 beginner books at the start of the game
My code isnt working tho can someone help
show us the error
you need to put the code to add the item on an event
you just put it out in the open instead of in a function, so it just runs when the lua loads, before there is ever a player
it's also not clear where bag comes from? and addItemOnServer isn't necessary for player inventories, you can just use AddItem
They probably need to take a look at how Lua functions in PZ with events.
This potentially seems more like a structural / a fundamentals issue.
I forgot how to do something how do I select a certain part of a model and just paint on that
because I keep painting something I don't want to
People will help with this issue in #modeling
no one is there but okay
Be patient.
still waiting...
okay thanks cuh 
still wating...
complaining won't get you a faster response
Your question isn't even Zomboid related, just Youtube blender tutorials
I looked it up and nothing shows
Nobody is obligated to help you here. You're not building goodwill by being impatient and demanding answers, and you're not even asking in the right channel. Ask specific questions and people may help, but don't just ask questions that have the appearance of being able to be answered in less than a minute.
Worst case scenario? Look up a texturing tutorial on youtube.
Right click + Block
π
alright, whatever don't help me I don't care anymore I was even thinking to myself when I first thought about making mods "I don't think anyone wants to help they will just keep to themselves" and I was right so whatever man
I goddamn knew this was a stupid idea
I would try youtube since it would be faster for you
That's not true. Other people recieve help in here regularly. Make your questions concise, specific, and clear and people will be much more likely to help you.
you phrase questions like "either my model is under the ground or not working, here is the thing", and there's zero context for people to help you. You're putting more burden on your potential helpers by making them try to figure out context and what you even mean, instead of letting them focus on your issue.
There is a reason I spend 5+ minutes typing a question in here.
Is there a way to open IsoPlayer or IsoGameCharacter inventory as a container like on the worldmap when you approach a crate?
https://projectzomboid.com/modding/zombie/characters/IsoGameCharacter.html#getInventory()
Yeah whatever man, I'm giving up modding like I said it was a stupid idea for me to try something I was interested in
I for one will be happy to try to help where I can if you can put what I said into practice.
Been watching for awhile. Your guilt-tripping will not work here.
the guilt trip is not working
yeah also it's 100% manipulation that you're trying so
We don't often interact with the modders here outside of the main chats, but they've been a wholesome and inclusive community here willing to step up and help each other when they can.
You make things difficult for everyone, even in main chat, by being vague and curt in your questions and 'why does this not work'. Then getting hostile and dismissive to people who tried to bother and are unsure of what you are asking.
jit trippin in the zomboid server ?!?!
To be frank, you need to have a clearly defined goal of what you are trying to do when you go into modding, its like working on your own car.
If you ain't got a goal nor even a set out a simple task to do, you ain't gonna get anything done.
and the best way to learn is to look at existing mods
that being said, the only stupid idea is that you repeat the same actions and expected a different result.
you need to hook ISReadABook:new(), check for the trait and multiply the time
So I know it's probably less than ideal to shill your own mod as a template... but what about shilling someone elses for them? I know a certain someone who has written a full featured literacy mod that might be a great resource for learning more about the mechanics behind reading.
Im listening π
also is there anyway to look at the vanilla trait code? cuz this is just me adding fast reader into a larger trait
that trait is luckily implemented in lua so you can see it in the function i mentioned
i don't quite remember how the version currently on the workshop worked but my working build is actually kind of an annoying resource for new modders, things are abstracted quite a bit from what you'd need to pull that off due to the size of the mod
i really need to get that out sometime, the version on the workshop is about nine months behind
it's barely even the same mod
Can you still power level the skill through magazines? π π
i don't remember if i changed the xp values for those, but the skill gain is rebalanced overall
the biggest change is the addition of vhs tapes that give you a literacy xp multiplier, so i reduced the base xp gain a bunch to compensate
aight ima come back in 5 years when i have a degree in comp sci and understand lua
I took a $13 course on Udemy. It'll cover a ton of the basics, but there's still a lot going on in PZ that I just don't understand yet.
thank you very much for the help
This dang game. I've spent the last 3 days trying to figure out why my character can dig with the default ISShovelGroundCursor.GetEmptyItem function, but when I intercept it to print to the console and return it can't queue the shovel action. It wasn't working 15 minutes ago. The guy has just been idling there. I tab back in and on a whim try to dig again. He digs no problem. I bet if I restart the game it'll be broken again. I tell you man, ghosts.
LOL
actions queued?
@lone nest I'm not sure what your question is. What's up?
Well - as far as I can tell, most of the in-game actions work in a queue system, so First-In-First-Out.
it's possible your actionsqueue got overloaded to a point where it was busy doing other crap/getting stuck before finally getting to the shovel action.
That's how I understand it as well. However I'm getting bugged action, cleared queue ISShovelGround and can't figure out why
As far as I'm aware, there's just the one dig action happening
care to share your code?
I'm not asking the game to do anything differently besides hijacking the getemptyitems function to print a statement and then returning.
sure! Lemme get it all set up.
that sounds like you're not passing an argument it wants
(since you are returning the original i assume that's not it)
there are some ... oddities in my observations because the actions can be queued/updated on a tick-basis... so it's pretty easy to miss/pile-on actions into the queue.
I have this override function where I will need to (in the future) alter a few values
local old_SGC_GetEmptyItem = ISShovelGroundCursor.GetEmptyItem
ISShovelGroundCursor.GetEmptyItem = function(playerObj, groundType)
print("attempting to intercept SGC.GetEmptyItem")
local oldValue = old_SGC_GetEmptyItem(playerObj, groundType)
return oldValue
end
I'm hijacking this completely untouched function from the basegame here
function ISShovelGroundCursor.GetEmptyItem(playerObj, groundType)
local playerInv = playerObj:getInventory()
local fullType
if groundType == "dirt" then
fullType = "Base.Dirtbag"
elseif groundType == "gravel" then
fullType = "Base.Gravelbag"
elseif groundType == "sand" then
fullType = "Base.Sandbag"
end
local item = playerInv:getBestEvalArgRecurse(predicateTypeNotFull, comparatorMostFull, fullType)
if not item then
item = playerInv:getFirstEvalRecurse(predicateEmpty)
end
return fullType,item
end
all I've been able to determine so far is that item comes back nil
this means isValid is returnning false before action starts usually
^
oh, it might be because it has two return values but you only grab one
but I've been staring at this for 3 days so I'd be happy for someone to tell me I'm dumb and made a silly mistake
try```lua
local fullType, item = old_SGC_GetEmptyItem(playerObj, groundType)
return fullType, item
if you don't need to run code after the original you can also just return old_SGC_GetEmptyItem(playerObj, groundType)
mhm, yeah it also looks like fullType could be nil?
i've actually never run into that since multiple returns are rare, that's a fun one
oh yeah, I just create a table in those cases...
as I say daily, I'm digging way above my paygrade
sanity is slipping π haven't actually been able to play PZ because I wanted to finish this first
was supposed to be quick. 20 minutes in and out tops.
Ohhh.. I know why I thought oldValue would just... work. I've been following this template and incorrectly assumed Albion's oldValue was getting back the exact parameters the function it was running was sending...
This whole time I've been thinking "oldValue can't just hold Fulltype and item, right? But that's basically what her code is doing."
if you wanted a reusable template that's safe with this sort of thing, you could do (pseudo)```lua
local oldReturn = {originalFunction(params)}
return unpack(oldReturn)
#function_parameters ~= #function_returns
Oh I'll recognize multiple returns in the future. I recognized it here... just didn't put the pieces together... This is why I like to really struggle with something before I ask for help. I'll NEVER make this mistake again.
believe me i would have made that mistake too
I need to play around with .unpack. I've seen it around before and it would have been super useful here.
Thank you all for the help!
I've been staring at this for so long... what mod was I writing? π€
is there a way of detecting if a player is inside of a city?
like if the foraging zone is urban?
definitely not all maps
i was just playing in a map that had an urban area as deep forest, which means loot will not respawn there naturally
how do you detect the foraging zone?
i can make it work for what i'm trying to do
albion, you still up? i have no idea personally, but i am certain it can be done
i actually don't know π
the new foraging is lua so it might just be a function call there
aight, i'll go look for it. thanks
sorry i couldn't help, good luck!
how do i add a button to the admin panel? does anyone have an example bit of code i could look at? I have never edited the ui in pz
local function getZoneType(_x, _y)
local zones = getWorld():getMetaGrid():getZonesAt(_x, _y, 0);
if zones then
for i = zones:size(),1,-1 do
local zone = zones:get(i-1);
if zone then
if forageSystem.zoneDefs[zone:getType()] then
return zone:getType();
end;
end;
end;
end;
return "Unknown";
end```
this looks promising
okay so I want to take this and add a context option to it function ISMiniScoreboardUI:doPlayerListContextMenu(player, x,y) local playerNum = self.admin:getPlayerNum() local context = ISContextMenu.get(playerNum, x + self:getAbsoluteX(), y + self:getAbsoluteY()); context:addOption(getText("UI_Scoreboard_Teleport"), self, ISMiniScoreboardUI.onCommand, player, "TELEPORT"); context:addOption(getText("UI_Scoreboard_TeleportToYou"), self, ISMiniScoreboardUI.onCommand, player, "TELEPORTTOYOU"); context:addOption(getText("UI_Scoreboard_Invisible"), self, ISMiniScoreboardUI.onCommand, player, "INVISIBLE"); context:addOption(getText("UI_Scoreboard_GodMod"), self, ISMiniScoreboardUI.onCommand, player, "GODMOD"); context:addOption("Check Stats", self, ISMiniScoreboardUI.onCommand, player, "STATS"); end
i am assuming overwriting ISMiniScoreboardUI.lua is super bad practice?
super bad practice
hook the function instead:```lua
local orig_doContextMenu = ISMiniScoreboardUI.doPlayerListContextMenu
function ISMiniScoreboardUI:doPlayerListContextMenu(player, x, y)
-- do your own stuff before
orig_doContextMenu(self, player, x, y)
-- do your own stuff after
end
it's annoying because in this case the context menu isn't easily accessible (usually the context menu is passed as an argument you can intercept), but there are functions for getting existing context menus
so the line orig_doContextMenu gets the main context menu?
sorry if i am misunderstanding
that calls the original version of the function - since that function doesn't return the context menu or have it passed in you need to find your own way of getting the context menu it creates
i was helping braven with something like this the other day so i might be able to find it easily
oh nice, braven makes some good stuff
basically what this code is doing, is it grabs the vanilla function and then overwrites it with a version that calls the vanilla function - so you can add stuff before or after it, without overwriting the whole function
it might be as easy as local context = getPlayerContextMenu(player:getPlayerNum())?
i'm going to try to add an item to the targeted player's inventory from the mini scoreboard, i might be able to figure it out now that you've helped me out
i don't think this isright, but i think it will look like this context:addOption("Add Starter Kit 1", self, ISMiniScoreboardUI.onCommand, player, "additems(SSKits.SKit1, 1)");
maybe like context:addOption("Add Starter Kit 1", self, ISMiniScoreboardUI.onCommand, player, player:getInventory():AddItems(SSKits.SKit1, 1));
this is going to be harder to test than other stuff i have done since it requires a second player
luckily i own a second copy lol
you can actually test on a single copy in non-steam mode
okay so definitely writing it wrong so far, the new context option didn't even show
maybe context:addOption("Add Starter Kit 1", self, ISMiniScoreboardUI.onCommand, player, "GiveSKit1"); and then where would i define GiveSKit1?
i feel like i'm only a little over my head, but i still am not getting why my new context option isn't showing up
@crystal oar for when you're ready to test in multiplayer https://pzwiki.net/wiki/Testing_Mods_in_Multiplayer
oh i just loaded up pz on my other computer and copied the mod over
That works too π
thank you for the link!
You're welcome! I wrote it and I'm dying to get feedback from anyone who uses it. π I'm sure there might be faster or better ways to do it.
well having only read it and not tried it, my sleep deprived brain still made sense of it, so that's a plus
I'll take it hahah
so i am stumped why this context option isn't showing up on the miniscoreboard rightclick
i tried adding a second copy of check stats copied verbatim from the context menu context:addOption("Check Stats", self, ISMiniScoreboardUI.onCommand, player, "STATS"); and i only see one copy of check stats. any ideas? local orig_doContextMenu = ISMiniScoreboardUI.doPlayerListContextMenu function ISMiniScoreboardUI:doPlayerListContextMenu(player, x, y) -- do your own stuff before orig_doContextMenu(self, player, x, y) -- do your own stuff after context:addOption("Check Stats", self, ISMiniScoreboardUI.onCommand, player, "STATS"); context:addOption("Check Stats", self, ISMiniScoreboardUI.onCommand, player, "STATS"); context:addOption("Check Stats", self, ISMiniScoreboardUI.onCommand, player, "STATS"); context:addOption("Add Starter Kit 1", self, ISMiniScoreboardUI.onCommand, player, "GiveSKit1"); end
context is local
try just overwrite func
okay
so much closer now, thank you
function ISMiniScoreboardUI:doPlayerListContextMenu(player, x, y)
local context = ISContextMenu.get(playerNum, x + self:getAbsoluteX(), y + self:getAbsoluteY());
-- do your own stuff before
orig_doContextMenu(self, player, x, y)
-- do your own stuff after
context:addOption("Add Starter Kit 1", self, SKitsMiniScoreboardUI.onCommand, player, "GiveSKit1");
end
function SKitsMiniScoreboardUI:onCommand(player, command)
if command == "GiveSKit1" then
SendCommandToServer("/additem \"" .. player.displayName .. "\" SSKits.SKit1\"");
end
end
``` is what i have now, no luck so far, but now it throws an error so progress
i'm sleepy but i bet it has to do with the escape characters in the second part
ISMiniScoreboardUI is a global right?
function SKitsMiniScoreboardUI:onCommand(player, command) is making it sad
getting closer i think
and there it is
ughhhhhh.
Discarding an item via foraging doesnt set its timed action to Finished.
its a 0 time action so i understand the oversight but still.
trying to detect when the player has completed a foraging action is such a pain in the ass because of it
best solution i've found is to check and see if the current time is 0. most of the time regular timed actions skip over 0 by some small amount, occasionally it'll be 0 for one frame though. which causes a double proc of whatever effect is supposed to happen.
i think i'm just gonna leave it like that because i can't find anything else.
okay so now i have the problem when i use function ISMiniScoreboardUI:onCommand(player, command) i seem to have overwritten it so the default options don't work, but my new ones do
and probably fixed it SKitMiniScoreboardUI = ISPanel:derive("ISMiniScoreboardUI"); local orig_doContextMenu = ISMiniScoreboardUI.doPlayerListContextMenu function ISMiniScoreboardUI:doPlayerListContextMenu(player, x, y) local playerNum = self.admin:getPlayerNum() local context = ISContextMenu.get(playerNum, x + self:getAbsoluteX(), y + self:getAbsoluteY()); -- do your own stuff before orig_doContextMenu(self, player, x, y) -- do your own stuff after context:addOption("Add Starter Kit 1", self, SKitMiniScoreboardUI.onCommand, player, "GiveSKit1"); end function SKitMiniScoreboardUI:onCommand(player, command) if command == "GiveSKit1" then SendCommandToServer("/additem \"" .. player.displayName .. "\" SSKits.SKit1\""); end end
what are you trying to do? i havn't been reading thus far
trying to add a context option to the mini scoreboard to add an item to the targeted player's inventory
i think it's working and not overwriting the other options now
just successfully did old mini scoreboard stuff and new mini scoreboard stuff
cool, i haven't messed around too much with overriding vanilla functions.
so you got your foraging thing working but proccing twice?
foraging is my favorite system as a player for sure
sorta,
its a chance that it triggers twice when doing the "pick up" option.
most of the time the TimedAction has its CurrentTime at something other than 0 when you call it. unless its the Discard action. which activates instantly and only lets the timed action exist for 1 frame. the current time is always 0 for that
timed actions are supposed to have a :finished() function that you can use to tell if the action was completed or not but the Discard function doesnt set it
so i had to get creative
could you check to see if the player's inventory changed during the action? or is that like using a hammer to drive screws?
theoretically yes, but it would cause a ton of unnecessary CPU usage tracking the players inventory that often.
i could slow it down, but it doesnt solve the problem of trying to figure out when the player does the discard action.
you can see the ISForageAction but without the :finished() setting being set you'd have to watch the players inventory until the action is stalled. which you can only detect by watching the CurrentTime anyway.
since TimedActions have a whooping 6 variables you can read. with 2 of those being related to the hand model
its more an issue with TimedActions being really hard to get info from.
the only things you can pull from it are
Finished
Current Time
Current Delta
Primary and Secondary Hand Items
Primary and Secondary Hand Models
and as far as i know you cant detect player actions in any other way
ah wow, that does sound tricky
i've had to pull shinanagains all over the place to make some of my stuff work lmao
i honestly enjoy it, good problem solving game
another issue i'm having is i can't figure out how to make the Player:Say() command appear for other players in multiplayer
does it default to a range of 0 or something?
theres a varient of the say() function that lets you input a range, but in order to use it i would have to also input what text color will be used. and i cant find where the players unique color is stored (or if i can even pull it)
i might have found it actually
supposedly Player:getInf() returns a ColorInfo value
nice
in hindsight i really didnt look at all. theres litteraly a Player:getSpeakColour() function
can you make a recipe name be defined in the sandbox vars?
probably not, but i'm not sure.
most additions happen before sandbox settings can be set. so unless theres a way to update the recipe when the world starts i dont think so
how do translations for recipe names work? are they also done at the same time?
oh i could use the Tooltip: to perhaps have the functionality i need
thanks, i have very little experience in general but most of my mods have been vanilla items to vanilla items through recipes
just trying to polish one of my mods up nice
nice, most of my experience has been with traits and things that involve the player info directly
i see some tooltips have variables, makes me hopeful Tooltip_RemoveCurtains = "Gives one %1.",
is there a way to make loot respawn in areas other than urban, farmland, and trailer park?
i just saw Everyone is Organized, so tempted to put that on my server lol we have people who take disorganized since you can get organized free through ETW but then they dump stuff all over the place until they get it
we had that same problem on our world. 3 of the 4 of us have organized and the last guy keeps having to throw books on the floor
as i was making it i realised i should probably give it a decent name and image since its probably a common problem
:P
it also gives everyone nutritionist as well because that was another trait that they wanted
it's nice to have, and unless you are pvping or rping no reason not to have it
ye
Sorry about last night guys I was really tired and pissed because I couldn't get the mod working
Is someone know how to set pain in lua ?
up to you but I use cheat menu it should have a option to set pain
sorry nevermind I just checked
in lua
check excrementum
they have stuff if u not go pee, u take pain in bodypart
how to i create a color?
like if i wanted to set the color of a shirt to something, you call :setColor(Color) but how do you create the color that you use in the function?
You can use player:getStats():getPain() and player:getStats():setPain() where player is an IsoPlayer object. For body parts you can use getPain() on a body part to get the pain level specific to that body part, but you can't set its pain level directly. It's determined by the type of wound that it has + whatever its additionalPain variable is set to
hey people! I don't know if this is the right forum to share it but I was currently developing one of my first mods and I'm pretty excited to share it with you guys, reading your Q&A helped me to do so, enjoy! feedback is very welcome! π https://steamcommunity.com/sharedfiles/filedetails/?id=2988022249
Oh heck. You did what I was thinking about doing later on this year.
Nice.
I want to be able to emulate x86 ASM in the computers in PZ.
hahah sorry mate! was not my intention to steal your projects π
Steal? This is not what I'm saying.
This helps if anything. (Providing an API)
just kidding π
I'm glad this exists.
i was trying to start a micro "game engine" inside PZ, just to expand the games/apps catalog
ANSI support when?
@uneven spindle I want to be able to do things like this in your terminal:
xD
I don't know if vanilla font supports some special characters, should investigate it
and I don't know if we can add custom fonts either
AngelCodeFont is a mod from the community? or its the name of a font inside the game?
any idea is welcome π
No. It's a font format and implemented in PZ. You can access this as it is exposed. You can't draw custom UI fonts using the conventional draw methods, however you can call AngelCodeFont objects explicitly.
oh cool, didnt know about that
Roughly no one does. I know because I did the dive to get there.
One of the many hidden gems.
thanks !! I will take a look
Anyone familiar with what "AngleFalloff = TRUE " is for? Its only on vanila shotguns but im not sure whats the point of this.
Hello everyone, I ask for your precious help!
In the sandbox settings I would like to show only some of the option lists if a particular other mod is installed (ie Raven Creek).
For example:
Mod XYZ is installed:
the options dropdown contains : OPT1, OPT2, OPT3,OPT4
Mod XYZ is NOT installed:
the options dropdown contains : OPT3,OPT4
how can i manipulate the sandox gui for this purpose?
Thanks in advance
You'd need to rewrite a lot of staff from what I know.
Is there a good thread anywhere out there outlining how to start developing mods?
if getActivatedMods():contains("Mod ID from mod.info") then
may be...
https://github.com/asledgehammer/Umbrella <-- Try using this too when you get to a point where you have a working project.
This is a mapping of typings for Project Zomboid's API.
It'll help a ton.
using :prerender() on sandbox gui maybe?
yes, i can check if a mod is installed easily but the real problem is hack the sandbox option list
if you want to take a look
The game has a few, slightly different, UI it uses to show and edit the sandbox options, these are:
SandboxOptionsScreen: UI used when starting a new save in SP - SOLO - New Game - Sandbox Options
ServerSettingsScreen: UI with all server settings - Manage Server Settings
ISServerSandboxOptionsUI: opened from admin settings? and the change sandbox mods
The settings for the sandbox UI are generated and stored in a local SettingsTable table in ServerSettingsScreen.lua. Access to this UI is intentionally limited.
The other two UI use the command ServerSettingsScreen.getSandboxSettingsTable() to get a copy of the Sandbox table with settings for the ui.
Sounds like a daunting job, but I'll take a look at it
Thank you so much!
hmm interesting, is there already a mod interfacing all that ? growing teeth
FacePosition not fixable :D don't work(
you have these == part checks but part is not defined?
not sure
this is stuff defined lockpick_object like "door" or "window", but some trouble with vehicle part, idk why it not work and face position not lock...
Hello, dumb question, how do i add a custom icon to a new item i made? This is what i've done
Item MyItem
{
...
icon = MyItem
...
}
In my mod folder media/textures/MyItem.png
Yet the icon is not showing
icon should be without the Item_ prefix
Nope
but the filename should have it
icon = Myitem
you need to check what return parameter are. the problem is on the use of return and (maybe) on the way you could retrieve the right vehicle (I'm not sure about that) Maybe a good teacher like Albion can help better than me or check online for "return parameter of function" this will help for lua and for most languages anyway
Oh BTW kERHUS your lockpick mod is sweet AF
not my, it's Aiteron's, i just made fixes and another stuff
yh i know but your version is much better
thanks :P
It would be awesome if "ZombiesDontAttack" parameter was working to prevent a character from being attacked by zombies (I use invisible for that purpose but it has downsides). From a larger perspective there could be a "faction" matrix describing factions interactions. With each character being in one "faction". Or (harder to make): With each character having an individual ponderation of each "faction". So that it could be done to alter how a specific zombie /npc instance interacts with other characters.
Hey not sure if I need to post here or in #modeling but I'm very new to modding, I'm wondering if it's possible to have an item which increase the player model's size?
i don't think so
Authentic Peach has clothes for fat people, from what I remember.
I meant more like make a player model be 5x bigger but maybe I can take a look at that one and see if it could be applied in other ways
ty
I'm trying to change a value on all zombies within a 10 square block of a single point. Can anyone recommend any good shortcuts?
I was going to try:
starting square,
offsetting by -5,-5
then loop with: IsoGridSquare.GetSquare
getZombie(),
do the thing;
then iterating X until it hits 10 then interating Y until the total count is 100
If there isn't a zombie in the square is that likely to throw an error? I figure if so i'd need to check to see if a Zombie is present.
as long as you check that the getZombie() call didn't return nil it should be fine
ok cool - is there a more elegant way?
this is pretty much how i'd do it
i'm not sure if getZombie() will account for dense hordes though?
ooo. Good point.
you might need to loop through square:getMovingObjects() and check if each one is a zombie - but at that point that is a lot of loops, might be more performant to just loop through the zombie list and check their location?
Ahh, that - that's it
thank you, i think that's better. IE make a list of 100 locations with a focal point, then pull the full list, loop and run an if location match is true then do the thing?
it might be better to just calculate the two corners of the area (x-5, y-5 and x+5, y+5) and then check if the zombie's x and y are >= the first and <= the second
glad to help π
Hi, When I play the following animation (started from a timed action with self:setActionAnim('InfectionBack') it is sometimes played very slow, sometime played nearly instantly. Should I reset some time parameter ? <?xml version="1.0" encoding="utf-8"?> <animNode> <m_Name>InfectionBack</m_Name> <m_SpeedScale>0.80</m_SpeedScale> <m_AnimName>Bob_HitDeath_WalkBwdAim</m_AnimName> <m_deferredBoneAxis>Y</m_deferredBoneAxis> <m_BlendTime>0.10</m_BlendTime> <m_Conditions> <m_Name>PerformingAction</m_Name> <m_Type>STRING</m_Type> <m_StringValue>InfectionBack</m_StringValue> </m_Conditions> <m_Events> <m_EventName>DeathAnimEnd</m_EventName> <m_TimePc>0.85</m_TimePc> <m_ParameterValue></m_ParameterValue> </m_Events> <m_SubStateBoneWeights> <boneName>Dummy01</boneName> </m_SubStateBoneWeights> <m_SubStateBoneWeights> <boneName>Translation_Data</boneName> </m_SubStateBoneWeights> </animNode>
do you mean the speed changes or it doesn't play fully?
From what I can see this has a fixed speed value and not a variable.
sometimes the speed seems very slow (as if the speed was 0.4, which was a value I set earlier for tests, but removed since). sometimes it is nearly instant, so I do not even know if it is player with very high speed or not played (next anim starts in the end position of this one).
I switch to another anim when DeathAnimEnd event is received by the TimedAction. Should I reset the time value ?
hm, I am not very familiar with animations. I can recommend using the animation monitor debug tool.
It monitors player 0 by default.
I do π
nice π
It's an awesome tool
Apologies for interrupting.
Is it currently possible to add a second chat tab, similar to the admin tab?
The animation is changed 13ms after the animation is started. animation change is due to receiving the DeathAnimEnd event.
no worries. I have no answer though
i don't know the method myself but i've heard that it is possible but actually insanely annoying for how simple it sounds
worked with <m_SyncTrackingEnabled>true</m_SyncTrackingEnabled> <m_EarlyBlendOut>false</m_EarlyBlendOut>
Iβve been playing around with sound files - does anyone know why itβs possible to replace the jump scare sounds but not other sound files? Iβve been trying to replace the music that plays when you start playing the game (when the this is how you died is on screen).
what are you replacing? most sounds are loaded from FMOD soundbanks
the loose files in media/sounds/ do... nothing afaik
Anyone knows what code is preventing Timed actions to start when the player is running ?
Well, Iβm trying to update the files in media/scripts. The jumpscare mods - when Iβve looked into them - they are adding to /media/scripts and replacing the sound event with a path so that it can play a custom sound. Iβm trying to work out what is and isnβt covered by doing that. Iβve seen that most music replacement mods ask the user to manually update the bank files - I was just wondering what is covered by that - if anyone knew.
that should work, it might be possible that music doesn't go through scripts since it's all dynamic now? but i think i've seen that it does
there's a lot of mods that change the death music that don't need you to swap soundbanks, maybe they could help?
but if people are swapping the soundbanks, i don't think they would do something that requires that manual installation if they didn't have to
Ahh. Great. Iβll look there.
Yeah. I was hoping the banks would be more for in game dynamic stuff and that the title would be static/event based. Thanks for the death music tip, Iβll check that out.
i've extracted the banks to look through the music before and i saw the 'this is how you died' music was split into like ten different tracks for some reason
yes I did. and stop on aim and stop on walk. The action can start when walking or aiming, but not when running / sprinting (it is waiting and activated when run is stopped)
local o = {}
setmetatable(o, self)
self.__index = self
o.character = character;
o.stopOnWalk = false;
o.stopOnRun = false;
o.stopOnAim = false;
o.isInvalid = false;
o.maxTime = -1;
return o
end```
item MandoDB_AdrenalinFlask
{
Weight = 0.8,
DisplayCategory = FirstAid,
Type = Drainable,
UseDelta = 0.1,
UseWhileEquipped = FALSE,
Icon = mandodb_AdrenalinFlask_01,
DisplayName = Flacon d'AdrΓ©naline,
DisplayCategory = FirstAid,
ReplaceOnDeplete = MandoDB_SterilisedSyringe,
WorldStaticModel = mandodb_adrenalinbottle_01,
StaticModel = mandodb_adrenalinbottle_01,
}
is someone know why my item is not drainable ?
hello, would this code be viable to halve the book spawn rates?
-- Halves the spawn rate of skillbooks in the game
for allocation, _ in pairs(ProceduralDistributions.list) do
if ProceduralDistributions.list[allocation].items then
for i, book in pairs(ProceduralDistributions.list[allocation].items) do
if type(book) == "string" and library[book] then
ProceduralDistributions.list[allocation].items[i+1]=ProceduralDistributions.list[allocation].items[i+1]/2
end
end
end
end
(library[book] is the array of the books i want reduced ingame)
how do you ensure a sound is played on all nearby client when the source is an IsoGameCharacter ?
You can look at function ReplaceItemInDistribution in server\Items\SuburbsDistributions.lua
It would give you a hint how to handle everything properly, tho I am not saying your code is wrong.
You will probably want to run this into Events.OnPostDistributionMerge
hello βΌοΈ
is there a known fix for mods that hook onto Events.OnFillInventoryObjectContextMenu and whose code prevents "Craft Sheet Rope" from concluding, and "Rip Clothing" from existing at all?
Just to make sure, are you trying to remove those two options from the context menu?
no, it's a side effect of my function when hooked which should not do that
Mhmm, so it is your code that seems to do that right?
probably, but i've been following and copying away the basic way of appending menu options to a specific item
can you show your code or part of it at least, so we can take a look?
pristineBookMenu.doMenu = function(player, context, items)
for i,v in ipairs(items) do
local item = v
if not instanceof(item, "InventoryItem") then
item = v.items[1]
end
if item:getType() == "PristineBook" then
context:addOption("Partake in wave.", item, pristineBookMenu.onAccept)
context:addOption("I'm good...", item, pristineBookMenu.onDecline)
break
end
end
end
pristineBookMenu.onAccept = function(item, player)
local playerObj = getSpecificPlayer(player)
playerObj:getInventory():Remove(item);
sendClientCommand(playerObj, "Funmod", "Accepted", {})
end
pristineBookMenu.onDecline = function(item, player)
local playerObj = getSpecificPlayer(player)
playerObj:getInventory():Remove(item);
sendClientCommand(playerObj, "Funmod", "Denied", {})
end
Events.OnFillInventoryObjectContextMenu.Add(pristineBookMenu.doMenu);
that's it up there
Did you try commenting that code block and retrying in game?
So far i don't see any reason this would remove the Rip Clothing and Craft sheet rope options from the inventory context menu
rippable items now throw errors to the lua vm π¬
Post that error if possible
It's hard to wrap my head around what could possibly be wrong here, what did you comment out?
all of it
does quitting and reloading (where Reloading Lua occurs) count?
module AddOnItems
{
imports {
Base
}
item PristineBook
{
Weight = 0.5,
Type = Literature,
DisplayCategory = Literature,
DisplayName = Wave Invite,
UnhappyChange = -100,
StressChange = -100,
BoredomChange = -100,
Icon = Book,
CanBeWrite = true,
OnCreate = AddOnItems.OnCreatePristineBook,
}
sound BookAccept
{
category = EHE: Main,
loop = false,
is3D = true,
clip {
file = media/music/success.ogg,
distanceMax = 650,
reverbFactor = 0.1,
volume = 0.7,
}
}
}
does that look any wrong?
Looks good
So we can patch exposed public java methods .. That's good to know! Thanx @fast galleon https://steamcommunity.com/sharedfiles/filedetails/?id=2960089295
still no idea about what's wrong π
The error is vanilla also it is trying to getTexture of an item but that item is nil.
Try creating a new solo game.
Try to find what item in the inventory would be causing that or what mod by disabling or commenting out codes.
try to only enable your mod and no other while developping/testing it just to make sure the error doesn't come from elsewhere. You can test with other mods later when you fixed your error.
this whole time i have been testing with only my mod enabled
sure enough I did, and this happens instantly when right clicking my socks
What are the other lua scripts you have created?
Anything related to context menu or items/inventory?
well i added my item to the distribution system, this works correctly, otherwise nothing related
Your mod doesn't seem to be the cause, can you try again without any mod at all?
Just to make sure
Good evening.
Do you open the game files to check the source? If so did you modify anything by accident and saved?
i do and i've been dreading that specific situation
You could try to validate your game files on steam
does that proceed without nuking any of my data
It will just validate each file to make sure nothing has changed, if it changed it will replace that file by the one from official release.
Your mods and save are not in the steam directory so you are fine.
Just woke up from a small nap.
Just arrived from long hot day at work
Is hot in Texas.
I need to hijack my brain so I can continue working on my Rosetta Workbench app.
It will also tell you how many file were invalid and replaced after, just so you know it may have been that which caused the error.
Also i think you can make the game directory read-only in VSCode to make sure you dont save/overwrite any of these files.
That exact situation happened to me like 2 week ago lol
π€© awesome, what does that mod do?
going to try and launch without the mod enabled π₯
it did reacquire one file!
aaand vanilla behavior works, but not when the mod is enabled
same error too
aand again resuming after a break presents me with the context menu where "Rip clothing" is missing
this #mod_development message seems related, and talks about a similar issue and cause
and this #pz_b42_chat message is the issue i get with my own mod
and worst of all, if i comment out just about anything, the issue still persists
Hi ! Immersive Medicine is my favourite mod, and maybe some people's too. So I've decided to bring some new content to this one! My aim is to provide stable gameplay for doctors, whether in roleplay, pvp or pve! For the moment, a few items have been added, and a few nerfs too, but don't hesitate to suggest ideas!
- Adding Adrenaline (With Craft and more !)
- Nerfing (Hemostop, Erythro)
- Adding mooorrreee medicine items soon !!!
https://steamcommunity.com/sharedfiles/filedetails/?id=2993088982
@fast galleon Any cue on what I'm doing wrong ? The Override.patchClassMetaMethod function is called without error (it is yours). the log return SayShout 1 override and return SayShout 2 override appear. when I shout, vanilla text appears on the head and print ('SayShout '..tostring(isoGameCharacter)..' '..tostring(shoutStr)) never pops in the logs.
am I allowed to ask for help or is everyone going to turn on me
meh half the modding community blocked me
I offered help man
oh lol
okay you are the only one on the server that does not hate me
just ask your question instead of being all bitter
I think everyone will know the question
so the item is not giving me the option to place so there is no model I keep looking back and forth to see the directory I made sure stuff was captial I'm probably just missing something I also looked at my old mod that works and nothing is snapping together
when overriding exposed methods with multiple arguments, make sure to preserve the exact arguments passed to the function. Even just adding nils can change which method is called and the result.
How do you do the override?
Just noticed, can you try with other class, e.g. IsoPlayer?
patchClassMetaMethod(IsoPlayer.class,"Callout",function(Callout)
return function(...)
local args = {...}
if args[2] == nil or args[1]:isCanShout() then
args[1]:playSound(args[1]:isSneaking() and "zxCalloutSneakWhistle" or "zxCalloutGetOverHere")
end
return Callout(...)
end
end)
I think this was the latest one after bug fixing
Also, in order for this to work the function needs to be called from Lua. Calls from java to the function aren't intercepted.
@deft plaza I'm assuming you're able to spawn the cookie into your inventory at least? I can't spot the problem from here but I know what I'd be checking first if it was my item.
- are commas at the end of every line required? There are a few lines without commas such as BoredomChange and StressChange.
- are /* */ valid comments?
the comments are valid, but the missing commas are probably the solution
i missed those
I swear if I find one more bug in my code because I mispelled duffel as duffle. 
scratch that. I found several more. /facepalm
in one of my non-zomboid projects last night i had this lovely moment
so i definitely feel that
actually just found it mispelled in vanilla too.

Oh. Apparently both are valid. https://thecontentauthority.com/blog/duffel-vs-duffle Can we just throw away American English? We had our chance. It's bad.
LOOL
Does anyone have good guides on getting started worh modding?
I wanna make a few simple mods
Thank you ! that must be the reason.
hey, are there any tutorials on how to mod in armor and melee weapons?
could someone familiar with lua help me with fixing some codes? would be great if we can just do it via discord (no talking required, mic can stay muted by all mean), i can stream the text editor and we can walk thru it real quick.
go
ZedScript extension on vscode
Should be somewhat more helpful
YUP, just saw the event in the suburb file, that's what i really wanted to know, knew the code worked, yet wasn't sure if it needed an event to fire it
KUDOS!
What is the Base. ID of the medkit?
DEVELOPING ALL BR RIO DE JANEIRO THEMATIC SERVER MODS
Hello! How can i set background color of ISUIElement ? By default it has background alpha-chanel < 1. But i want to set solid black color
UPD: solution is parent['backgroundColor'].a = 1
Oh shit I remember your server I was the guy who talked to you ab it good to see your working on it still
CARIOCA DETECTADO
man
icl
i dont like modding
i find it fun
but its ruined games for me
i dont play them anymore
sΓ©loco
π yep, i found some models, and learn about to do my own...
so i got some bases to learn how
how to find all my installed mods?
if you're looking for the files look in steamapps/workshop/content/108600/
subscribed itens
Hi all, working on a simple mod to change what type of zombie revives from a player that dies while infected based on fitness level. I feel like this should work, but no joy. Any insight would be appreciated. Thanks!
if player:getBodyDamage():IsInfected() then
local fitnessLevel = player:getPerkLevel(Perks.Fitness)
if fitnessLevel <= 4 then
body:getModData().zombieType = "shambler"
elseif fitnessLevel >= 6 and fitnessLevel <= 7 then
body:getModData().zombieType = "fastShambler"
elseif fitnessLevel >= 8 then
body:getModData().zombieType = "sprinter"
end
end
end)```
there is no OnCreateDeadBody event
guys
local zs = getCell():getZombieList() -- getWorld():getCell():getZombieList()
local sz = zs:size()
local z = zs:get(i):isOnFire()
for i = 0, sz - 1, z = true do
-- func to change speed to zombie
end
end
Events.EveryOneMinute.Add(zReDontSetZombiesOnFire)```
xD
help plz
xD
A: Whats the question?
B: Use better variable names, thats hard to understand for such a short bit of code.
local z = zs:get(i):isOnFire()
i is undefined
for i = 0, sz - 1, z = true do can you increment based on a boolean? That z = true is blowing my mind if so. I mean mathmatically it makes sense. You either increment by 1 or you don't. I've just never considered doing an operation like that.
hey can we talk in dms?
Oh I didn't notice that in the loop, I have no clue if that works...
Also doesn't really make sense how its written here.
no way
@red tiger about your zed script is it possible for you to add something that checks if its right?
Btw just got on VSC couple of commas missing lol but nothing that wouldnt make it work
Yea, doesn't lua pre-generate a list of all the numbers when you start a loop anyways?
Or maybe thats only for ipairs()
a couple of commas missing would make it not work
oh sorry I mean the model
anyways sorry for the thing that happened a couple of nights ago
local ZedList = getCell():getZombieList() -- getWorld():getCell():getZombieList()
local SizeZedList = ZedList:size()
local OneZed = ZedList:get(i) -- :isOnFire()
for i = 0, SizeZedList - 1, do
if OneZed:IsOnFire then
-- func to change speed to zombie
end
end
end
Events.EveryOneMinute.Add(zReDontSetZombiesOnFire) ```
A: Whats the question?
- How to change zombie speed, cant find func
nice!
What was the issue
commas lol
just got to resize it and change the texture
Hi! Someone knows how to get IsoDirections of BaseVehicle ? Maybe need to make some conversions?
Ah
I'm assuming the answer is either "no." or "whatever you're doing, it's not worth it." but is there a way to build a table that contains the name of all clothing bags available to a specific PZ client? I would prefer not to hardcode the list in case someone is using other bag mods.
loop through the script manager's item list, check each item's type etc to see if it fits your conditions, and then add it to a table
And while I'm on the topic, I've been scanning this: https://zomboid-javadoc.com/41.78/zombie/inventory/types/Clothing.html which states the only "name" I can get from a piece of clothing is what I assume is the display name. If I have a duffel bag and getName() on it, I'll get "Duffel Bag". Is it possible to get the true item name instead of the display name such that I would get "Base.Bag_DuffelBag"?
I didn't know about ScriptManager. Thank you!!
the internal name of an item is usually referred to as type
including the 'Base.' module is fullType usually
Albion you're a cotdanged magician πββοΈ
on the Item objects you get from the script manager (which are basically item templates as opposed to item instances InventoryItem and subclasses), it's just called name iirc
it's almost time to release the mod
man I thought that was gonna be easy
thank you guys
I have a hard time finding where the IsoZombie instance is "choosing" its target. I was expecting a sort of (potential targets) loop with distance comparison. Do you have any cue on this ? Is this in a specific state of their state machine ?
should be in the IsoZombie class, look for target variable and use of WorldSound π€
yeah, no loop on that part (updateinternal / spotted).
there is a loop for all sounds respondToSounds?, for spotted I don't remember exact function.
spotted can be from the player check?
RespondToSound looks like an intersting thing for sure
Just finally released the mod
damnit you're right, from TestZombieSpotPlayer. Thats another use for your java override code 
Oh, no it's called from java
Is there a way to display text above characters, similarly to the halo, but indefinitely / toggleable, and publicly (visible for all players)?
Additionally, is there a good example / documentation on how to make custom UI elements (such as message boxes, inventories, etc...)
And, third question, how does one save mod data persistently in a save file? For example saving some state information for the world, or players.
i'm not sure if you're using 'mod data' as a general term but the answer is literally 'use moddata'
most objects have a moddata table attached to them and there's also global moddata
General term, yeah. Wasn't aware moddata was a thing.
Is there a good example for this somewhere?
for object moddata you just call object:getModData(), which returns a lua table that saves (aside from types that inherently can't be saved, but you shouldn't really run into that)
for global mod data i like this guide https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How to use global modData.md
Thanks!
I assume object moddata is a table that's shared by all mods? And applies to any PZ objects? (Tiles/zombies/players/items/etc...)
yeah, it's shared, most objects should have it but you can always check the api reference page for that object if you're unsure
Gotcha, thanks!
Any clue about questions 1 & 2 by any chance? π
for 1 no, you might be able to hack something together with ui but there isn't anything provided like that
for 2, basically all i know about ui in this game is that it's an absolute nightmare
Hm, fair enough
i've messed with it a little and it's *very* manual
Is there a performant way to check if other players are nearby / visible to your character?
some people like to scan the nearby squares for players but just looping through the player list and checking distance is probably a lot faster in most cases
Hm, I need to ensure they're visible though / within line of sight.
i think there's actually a method for that, i think i used that in one of my mods
And preferably not constantly checking the player list. That feels performance-heavy
I assume there might be some kind of event for showing an entity / character tbh?
Maybe an event for showing a player's name that I can hook into?
you are very optimistic about events π
Hey, I try 
it depends on your intended range, but if it was 10x10 that's 100 squares which is already the player limit (and no server actually goes that high from what i hear) so i think checking the playerlist will usually be faster - granted you don't need to calculate distance for them so it's not exactly a 1:1 cpu cost
and i imagine it would probably be a lot larger than 10x10
oh, also, if it's on the client, other clients don't actually get added to the player list until they've been in your loaded area for the first time that session for security reasons
public boolean CanSee(IsoMovingObject var1) {
return LosUtil.lineClear(this.getCell(), (int)this.getX(), (int)this.getY(), (int)this.getZ(), (int)var1.getX(), (int)var1.getY(), (int)var1.getZ(), false) != LosUtil.TestResults.Blocked;
}
IsoGameCharacter.CanSee
You can loop client players and check if the source player CanSee the other and break if needed to stop the loop if you need and it fit your situation.
also LosUtil class is exposed in case you would want to test custom coordinates. Tho I'm not sure we can use it because of LosUtil.TestResults not being accessible I think.
wow. that's the most authentic looking link and website i've ever seen π
Hello, I have a question about item sprite.
When I make item mod, I need to write a script mesh and texutre. Is there a way to replace PNG Image with sprite? I Also attach an image that will help.
how do you change the color of an item?
like a shirt or hoodie
i found setColor() but that doesnt change the 3D model, only the color of the icon
For changing the color, you would have to alter the texture
even for the clothes that can normally get random colors?
You meanthat you want items to have 3d model when you place it on ground, or look like these on right screenshot?
I want to make a 2D image like right screenshot
I remember that once i put my model name wrong it did something smilar, have you tried simply not putting any item sprite/static model? If game can't find it it uses Icon so you could try with that?
Hi! How can i temporary remove/hide snow from IsoGridSquare ?
Hello, everyone! I made a mode abou spawn items in different cases,
but they spawn not by 1 but by 2. Why?
require "Items/ProceduralDistributions"
require "Items/ItemPicker"
table.insert(ProceduralDistributions["list"]["BathroomCabinet"].items, "Base.Trousers_Fireman");
table.insert(ProceduralDistributions["list"]["BathroomCabinet"].items, 100);
Depends on the roll amount for the certain list
If you put 100 there is a good chance when the game rolls for items spawning it will spawn your item again after another
should I bet 50?
Put something lower than 100 but no guarantee
any number below 100?
Probably
ok
hello guys,does anyone know how to solve it or an idea? is it possible to give a trait of another mod?
I'm creating custom professions using framework profession. i created the musician profession and trying to give the musician trait from Spoon mod, i managed to make him give the trait, using the Entertain Yourself mod as a requirement but he is duplicating the trait in the creation menu and it is not being free.
professions usually give a copy of the original trait that doesn't show up in the list
so that it can be free
so it's probably free... i will check this
in the debug it presents an error referring to an expression in the original code aimed at giving a free trait, so I understand that as it is a trait that is not in the base it cannot "read" that this trait is being given.
take a look at shared/3ProfessionTraits.lua in the profession framework. all the examples in there take a existing trait, and turn it into a free profession only trait
(technically, it creates a second profession version of the trait, then on new game it replaces the second profession version with the original)
hmm, read here I think this will serve very well, I will test. Thanks.
alright guys I need a certain code
when I kill a zombie its gonna give me either 2 moodlets or none random chance
is there anywhere I can refer too
I think if I can do this this will be a big mod
wouldnt it be linked to ISOPLAYER
they use the same thing for the npc and player data
whats the mod
Hello, does anyone understand how I could replicate the SRU vest from the Expanded Helicopter Events mod? I'm working on a clothing mod and when I want my vest to be able to be worn and used as a "container" for things, it doesn't give me the option and I get an error (and the item is deleted). I don't know if my script is wrong or something, I've tried using other mods, but I haven't been able to get it to work. I would appreciate if someone can clarify the situation for me.
wouldnt you have to make it a ''backpack''
but just have the model be a vest
is0player?
I found it but I can't read it
how do i pass variables to a tooltip?
yeah i think
i would ask somone more experianced with this shit
alright
You may check how Mechanics UI does it. ISVehicleMechanics.lua
thanks
so i just need to set the tooltip in lua as opposed to in the item block itself it looks like?
this seems complicated
so i start by making a new tooltip handler maybe?
MyToolTipThing = ISPanel:derive("ISToolTip");
also not sure once i get the lua setup how to get the recipes to show the tooltips i made in lua
is there something like an OnMouseOver event or something i can use in the recipe block?
to go execute my code that sets the tooltip?
i think ISBaseElement has all the ui elements methods that are getting called also yes there is an OnMouseOver call for an ui element
so can i slap an OnMouseOver in the recipe block?
yes with MyToolTipThing:onMouseOver()
nice, i think i can make this happen then
I've already tried it and the error keeps popping up, although doing so "takes away" the option to equip a backpack
OnMouseOver or onMouseOver?
also i just see OnMouseDown OnMouseMove and OnMouseUp in the documentation
maybe i should just use OnConnected?
ooh OnFillInventoryObjectContextMenu looks promising
Hey! i love the no damage from trees mod if i haven't already gotten to tell you
Ah thank you π
i felt like i was living in Evil Dead or something with violent trees before that
DayZ mod
i don't see an OnMouseOver there
Trees ate people in DayZ mod
ouch
Physics engine glitch
can i just make like function onGameLoaded() setRecipeTooltip("MyRecipe", "This is my custom recipe tooltip.") end or do i need some global to hold it like MyToolTipHandler:onGameLoaded()
with some like lua to back it up
local recipe = RecipeManager.getRecipe(recipeName)
if recipe then
recipe:setTooltip(tooltip)
else
print("Recipe not found: " .. recipeName)
end
end```
Does anyone know why this error occurs and how to fix it?
i think if you search for appworkshop_108600.acf and delete it you can fix that
i am having trouble with the line Events.OnGameLoaded.Add(StarterKitsGameLoaded), any thouughts?
where can I find this file?
for me it's S:\Steam\steamapps\workshop
which would be best practice to use if i want to update tooltips for the player when they load in?
ongamestart is when you load in, not really sure how that's relevant to tooltips though
Maybe it help Events.OnCreateUI
It didn't help
k and you only have pz installed in one spot?
this might help https://theindiestone.com/forums/index.php?/topic/37047-unable-to-upload-new-mod-to-steam-workshop-failed-to-update-workshop-item-result2/
I'm unable to upload my new mod "Playable Arcade Machines Grapeseed" to the steam workshop. The error I get is "failed to update workshop item, result=2" The result in my workshop is an empty mod with no content. This is my 3rd mod. I've successfully uploaded my other two mods in the past. I even...
No, there's some other problem. My files are called normally
I'll try to reboot π
the only time i couldn't upload i forget what result code i was getting but deleting all those appworkshop_108600.acf helped me out. you might have more than one if you have pz in more than one spot
i've had mysterious workshop issues until i restart steam before
it might also just actually be steam
Rebooting didn't help. I'll try it tomorrow. Thank you all π
yeah other people are having the same error
Yes, steam also says that it cannot synchronize cloud saves. probably something broke
my workshop page looks like this so it's fair to say it's struggling
Then I will announce my mod with a preview π
It seems all cases are tested. Should work well. I'll upload it tomorrow
congrats!
Where i can find some docs or description of sandbox-options.txt ?
Thanks! Couldn't find
do i need a semicolon at the end of this? Events.OnGameStart.Add(StarterKitsGameLoaded);
no, you don't need semicolons ever
there is no difference
they're a style choice
But I don 't see the point of using ; in lua
ah well something about that line makes my server not start up right now lol, i'm stumped
see the logs
i see like LOG : General , 1687733779367> 0> SERVER: process-status@terminated but no error or stack trace
is it start if you disable you mod?
it was starting right before i fixed that line to use an event that actually exists
i worry that i am using an event that triggers before sandbox vars are loaded
gamestart is well after they are
okay, hmmm
it seems unusual for you to be able to stop your server from launching
usually it should just move on when it reaches an error
and i am making all of this client side, maybe it needs to be shared or server?
a file that isn't even running on the server is crashing the server? π€¨
if it's tooltip stuff then it should be client only
i'll just try again later, maybe steam not working is giving me trouble connecting
try to launch server without steam. Or coop server
i am launching coop server, it say is trying steam connection and authorizing with steam tho
This is without steam. Place at E:\SteamLibrary\steamapps\common\ProjectZomboid and run
well that got me in the game, gonna wait until steam is acting less wonky to even try to update this on the workshop tho
I do. My sanity.
on Events.OnPlayerUpdate vs. Events.OnRenderTick...
I am assuming Events.OnPlayerUpdate runs ONLY when the game isn't paused.
Is that assumption correct?
yes, but i'm not sure that's untrue of onrendertick
Yeah, I'm trying to figure out if its better to run some functions during OnRenderTick or OnPlayerUpdate.
OnRenderTick can become ridiculously taxing
OnTickEvenPaused
i would expect onplayerupdate to be more taxing
Hm...
it also fires every tick, just potentially multiple times
unless your code specifically relates to players there isn't really a reason to use it over ontick
and even then, ontick looping through the player list would probably be faster...? haven't thought about it before
trying to figuring out what's more efficient :x
looking at the NPC code and looking for alternatives to OnRenderTick
also, trying to avoid nested loops scanning squares for objects.
I think, it's possibly quicker to get a list of zombies in a cell and scanning that list if a zombie can be seen
over say
scanning 30x30 squares.
it is much much faster
then again, I don't know how big a "cell" is and how many zombies in the worst case can be in said cell.
guess it's time for an experiment
there's actually a cap in multiplayer, not sure what the cap is but in singleplayer i was stress testing some zombie code and only managed to draw a horde of <300
if true, that's perfect, because it's still cheaper than scanning 30x30 squares.
absolutely, scanning squares should be a last resort
Hello there, is there a way to get the shape of a vehicle in lua ? Alternatively is there a way to know is a x,y,z position is within a vehicle or not ?
BaseVehicle:isInBounds(x, y)
local recipe = RecipeManager.getRecipe(recipeName) -- Retrieve the recipe by its name
if recipe then
recipe:setTooltip(tooltip) -- Set the tooltip for the recipe
else
print("Recipe not found: " .. recipeName)
end
end
-- Function to call after the game has fully loaded
function StarterKitsGameLoaded()
setRecipeTooltip("Choose Kit 1", SandboxVars.StarterKits.Kit1Name)
end
Events.OnGameStart.Add(StarterKitsGameLoaded)
this is giving me trouble when it tries to execute setRecipeTooltip("Choose Kit 1", SandboxVars.StarterKits.Kit1Name) any ideas what i'm doing wrong?
Is there a way to know if a player collides with something, if it is a vehicle or not ?
what does the trouble look like ?
Object tried to call nil in setRecipeTooltip at KahluaUtil.fail line:82.
you can try OnObjectCollide and check if one is a player and one is a vehicle but idk if vehicles will even fire that
since they use the physics engine
Thanx, I'll try
RecipeManager.getRecipe doesn't exist
huh, thanks chatgpt lol. is there a function to get a recipe?
i thought it might be ai generated
that's why you were getting made up events too i bet
yes indeed
i don't recommend ai for modding, it just makes stuff up
it's been super helpful for doing regex since i don't know regex
recipes don't have a setTooltip so i don't know if this helps, but ScriptManager.instance:getRecipe(name)
yeah, it should be more helpful for more general programming things, but when it comes to zomboid it only knows the rough structure
zomboid ai programming 
for setting tooltips i see stuff like the isvehiclemechanics uses local tooltip = ISToolTip:new(); tooltip:initialise(); tooltip:setVisible(false); tooltip.description = ISVehicleMechanics.bhs .. " " .. getText("Tooltip_craft_Needs") .. ": <LINE> " .. tirePump:getDisplayName() .. " 0/1";
which has a lot of semicolons, i thought i didn't need those. those are just for style?
ya, TIS has a lot of java programmers, and java uses semicolons
so function setRecipeTooltip(recipeName, tooltip) local recipe = ScriptManager.instance:getRecipe(recipeName) -- Retrieve the recipe by its name if recipe then print("Recipe found!") else print("Recipe not found: " .. recipeName) end end isn't finding the recipes at all, step one is getting this to work. Is ScriptManager a global?
is there a way to add a keybind without using ModOption ?
if you want it to be configurable not really
albion can you tell me more about ScriptManager.instance:getRecipe()? or can you tell me if it looks like i am using it right?
getScriptManager():getRecipe(recipeName)
they are the same
ah it's not finding any of my recipes
also does anyone here know if i can specify the -cachedir= from the startserver64.bat?
ya i'm getting LOG : General , 1687749143587> 0> [StarterKits] Recipe not found: Choose Kit 1 when running function setRecipeTooltip(recipeName, tooltip) local recipe = getScriptManager():getRecipe(recipeName) -- Retrieve the recipe by its name if recipe then print("Recipe found! " .. recipeName) else print("Recipe not found: " .. recipeName) end end
i'll be hard pressed to edit the recipe's tooltip if i can't find the recipe
LOG : General , 1687749778355> 0> [StarterKits] Recipe found! Make Stake so it is working, just not on my new recipes
any ideas why that might be?
setRecipeTooltip("Choose Kit 1", SandboxVars.StarterKits.Kit1Name)```
probably need the module name
inside or outside the quote?
inside
thanks again
LOG : General , 1687750127787> 0> [StarterKits] Recipe found! StarterKits.Choose Kit 1 yep that was it
What is a lua?
Oh my dear lord I cannot
what do you need help with?
I'm trying to add around three traits about the boykisser meme for pride month
That make you less or more likely to be targetted by gendered zomboids
it's for charity so I'm very interested in seeing it become reality
ah i see, i have no experience with traits and getting info from zombies. i'm sure someone here might, if you have the cash to commission a mod team orbit might do it
orbit fell apart
from my experience i'd say that traits affecting who zombies target probably aren't possible
WHAT!? i did not know that
aww, well I'll come up with some substitute.. they could always do nothing
making traits that do nothing should be fairly easy i should think
adding a trait is one line of code
so now that i can find my recipes i am trying to set tooltip using function setRecipeTooltip(recipeName, starterKitTooltip) local recipe = getScriptManager():getRecipe(recipeName) -- Retrieve the recipe by its name if recipe then print("Recipe found! " .. recipeName) local tooltip = ISToolTip:new() tooltip:initialise() tooltip:setVisible(true) tooltip.setName = starterKitTooltip recipe.toolTip = tooltip else print("Recipe not found: " .. recipeName) end end but it doesn't like recipe.toolTip = tooltip as far as i can tell
it might not have an attribute toolTip, that might be the problem
it was option.toolTip in isvehiclemecanics that i am borrowing the snippet from
that's for context menus
i don't think recipe objects store their tooltip
it's probably generated live
not sure how to proceed if i'm trying to make a tooltip from a sandbox var now
maybe make a new thingy like StarterKitToolTip = ISPanel:derive("ISToolTip"); and then make setName parse the tooltip for those recipes differently?
function ISToolTip:setName(name)
if name=="Open Kit 1"
then
name=SandboxVars.StarterKits.Kit1Name
end
elseif name=="Open Kit 2"
then
name=SandboxVars.StarterKits.Kit2Name
end
elseif name=="Open Kit 3"
then
name=SandboxVars.StarterKits.Kit3Name
end
elseif name=="Open Kit 4"
then
name=SandboxVars.StarterKits.Kit4Name
end
elseif name=="Open Kit 5"
then
name=SandboxVars.StarterKits.Kit5Name
end
elseif name=="Open Kit 6"
then
name=SandboxVars.StarterKits.Kit6Name
end
elseif name=="Open Kit 7"
then
name=SandboxVars.StarterKits.Kit7Name
end
elseif name=="Open Kit 8"
then
name=SandboxVars.StarterKits.Kit8Name
end
elseif name=="Open Kit 9"
then
name=SandboxVars.StarterKits.Kit9Name
end
elseif name=="Open Kit 10"
then
name=SandboxVars.StarterKits.Kit10Name
end
else
self.name = name;
end
end```
maybe?
time to find out
Sorry to inconvenience everyone but what the heck does this mean
require('NPCs/MainCreationMethods');
local function initMagDrillsTrait()
local MagDrills = TraitFactory.addTrait("MagDrills", getText("UI_trait_MagDrills"), 2, getText("UI_traitdesc_MagDrills"), false, false);
MagDrills:addXPBoost(Perks.Reloading, 3)
endEvents.OnGameBoot.Add(initMagDrillsTrait);
It's a lua for a different mod
@severe zenith this might get you started https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How to make a custom trait.md What you're looking at is a function that injects a new trait into the game called MagDrills. By taking the trait the player gets an xp multiplier of 3 for their reloading skill. The trait gets added when the game boots (which happens before you hit the main screen) with the event call Events.OnGameBoot.Add(initMagDrillsTrait);
is there a way to run code when an item enters a player's inventory? maybe i'll just put the kit contents to chat instead of changing the tooltip
Youd have to make a new tooltip panel that is hooked into the inventorypage and that renders together with the vanilla tooltip
Would a trait that costs nothing be +0 or -0?
ooh that's a good question, is it a positive or negative trait?
I suppose kissing boys is a positive trait
then +0 right? it's late here i might be wrong
speaking of, i am going to try to sleep even tho i didn't get this done tonight
i'm not sure if i can manage this but i will try in the morning
thank you mate
It can technically be whatever you want it to be but I think it typically defaults to a positive trait?
I'm blanking, how do I publish this mod privately so I can test it? I got it
omg my mod is on the front page
lot of people wishing for it to work in MP. i'd probably work on that if i were still actively playing the game. but i think i know how to do it if i were to try
i could even possibly remove dependence on changing the shutoff date at all through this
maybe in build 42 i'll give it a shot along with my other mods
is the Time: based off frames? so like 120 is 4 seconds?
48 time is 1 second
ok thanks
Is anyone able to confirm how the following assignment works? I'm assuming oldItem is assigned to the first non-false non-nil result? I'm not really sure what to call this kind of assignment so I don't even know where to start googling for an answer. π
local oldItem = ccp.listboxTrait:removeItem(label)
or ccp.listboxBadTrait:removeItem(label)
or traitIsPurchased and ccp.listboxTraitSelected:removeItem(label)
from PIL: "The operator or returns its first argument if it is not false; otherwise, it returns its second argument" I assume this behavior extends to it's third, fourth, etc argument if necessary? That's how this code works?
πββοΈ Thank you!
I am a bit wary of the and use there, it could be best to add parenthesis.
Yeah my next question was going to be order of operations when you throw and in the mix
my answer to that question is 'my ide highlights the arguments when i mouse over the operator' x3
i think the execution order is just left to right
until brackets are involved of course
I figured as much. It should theoretically never see the and unless the first two arguments fail
i think i checked that the and was good, i was going over that code the other night to add some more features
I SWEAR to you I'm not digging around in there any more. I just remembered seeing this assignment and had need of something similar.
my recommendation is if the usage of or/and like this comes off as difficult to read, then don't use it - doing things in one statement like that is supposed to make the code cleaner, not messier
it probably shouldn't have been used there as the logic became more complex (and isn't anymore as the assignment wasn't useful in my latest version)
the and doesn't even serve a purpose there, come to think of it
it's only true if it's in the last list, and it's only in the last list if it wasn't in the other two, which is already the only condition in which that statement is reached
I'm normally completely in favor of more lines instead of compressing things down, but I have this function and it just made sense to me to do it this way. (I haven't confirmed if this actually works yet. I don't think it does)
local dod_IsDirtBag = function(item)
name = item:getType()
return string.find(name, "dirt") or string.find(name,"gravel") or string.find(name,"sand")
end
oh absolutely, there's no confusion there
it looks like it should work to me, though keep in mind the return value isn't a boolean
for some reason my one recipe isnt working 
yeah that's what I need so I'm back in the lab now. π
what is the goal of your changes?
you can just add a ~= nil to the end to get a bool (maybe with brackets, i don't have my ide to guide me)
