#mod_development
1 messages · Page 169 of 1
Your x file should also have an animation nme which should be the same with the file name
Meaning you can rename x files
Im pretty sure its the same for fbx
I replied to the wrong msg
I ment to reply to this one
What I was trying to do was test adding an emote, but as a placeholder I was trying to use Bob_EmoteClap. I tried renaming it so it wouldn't conflict with the existing emote, but I I don't really know what I'm doing but somehow in my trial and error something broke and now Clap doesn't work even with a fresh install and no mods enabled or anything.
My girlfriend's the animator so I'd have to ask her about any animation stuff. I was going to have her try to do a custom animation, but I was just trying to get things to work with a default animation for the time being
I fixed it. It was a problem with the animation name inside the X file. Clap was labeled as Clap02 for some reason, which I never changed it to. No clue why it was like that, no clue why validating or reinstalling didn't get the correct file 
But thank you for your help
What is the best way to sort an ArrayList in Khalua?
Thats what i was saying you have to change the name cuz you cannot rename anim x files
Goodjob
#1070858800501891172 message
@mellow frigate
What do you mean new spawn system interesting
Hello there! How is the development of mods going?
Going great . Me personally
Figured out how to add zed animation without overwrite
Just need to figure out how to prevent them from stopping before doing attacks
Have any idea sir?
Don't have. I didn't worked with zombie anims)
I'm trying to describe how I play an animation effect on players and zombies. Please correct me if there's a better way or I am wrong 🙂
function IsoObject:AttachAnim(ObjectName, AnimName, NumFrames, frameIncrease, OffsetX, OffsetY, Looping, FinishHoldFrameIndex, DeleteWhenFinished, zBias, TintMod) end
In PZ 41.78 you can easily add an animation effect to an IsoGameCharacter which will play by itself.
Drawbacks: this seems like legacy code and next parts don't work
- DeleteWhenFinished, doesn't remove the attached anim
- zBias and FinishHoldFrameIndex seem to be unused
- transmitUpdatedSpriteToServer will not transmit this attached anim
There might be a way to make transmitUpdatedSpriteToServer work, but the frameIncrease will not be synced.
surprisingly, this part doesn't work for tiles
Ah weird
I think the animation was added, but nothing was visible.
Not worked with this func, so can't help
you can check console.txt but it's 17
https://steamcommunity.com/workshop/filedetails/discussion/2986578314/3812906855249791467/ interface is detailed here
@tame mulch Is there a way to make a camera follow another player in MP ? (a camera from a client following a player from another client, in lua). Spectator function would be a must for Battle Royale mod.
I think no. I tried some time ago do custom camera
ok, thanx. I have not even understood how the camera was following the player's Zombie after infected death.
I might be looking for comms. Not sure yet.
closest thing would be setting the observer player invisible and updating it's coords in a tick event (say, EveryOneMinute) to the target player's coordinates
the reason you can't just whip a camera over there is because those chunks aren't loaded to the observer client until the observer client ... loads them lol
nice, thanx for the good idea. The chunk load latency is not a problem in "spectator mod", and I just did it in Portal Gun mod. But with your solution I'll need to inhibit all actions of the ghost player too.
a quick and dirty solution would be having the observer sit on ground every time that event fires
I like it 😄 food for tests and we'll see
but ultimately, it would require one of the javadevs like aiteron to implement dynamic chunk loading for players who aren't near them... which would be fundamentally changing how chunks are loaded from my understanding
the REAL solution is bribing aiteron with ten bitcoin to implement the features you want

brute force teleport until it loads works great if we can accept the temporary artifact
if you make an observer mod that can load two sets of chunks on two parts of the map at once, github that thang i wanna read it lol
@tame mulch, how much do you want for removing !GameClient.bClient condition to IsoCamera.SetCharacterToFollow ? 
There is no need to keep previous chunks set.
as aiteron's secretary i can confirm the request will cost 10 bitcoin
How much does that make in Spiffo emoticon currency ? 
tbf it'll likely just exception due to not finding the character, since the character isnt loaded if you arent near them
I'll go with the invisible inhibited sitting duck
have you tried out IsoDummyCameraCharacter?
it doesn't really look likely that it would work to me but it did seem to be for that rough purpose
No, not being referenced anywhere while IsoCamera is was a no-go.
it changes camCharacter or something
the cam thingy is overriden everywhere 😦
don't know what that does but some (unused, very old, and clearly not finished) tis code tries to use it to control the camera
You're right I should give it a try then
it's in the turn based thingy if you've come across it before
Excuse me
I have some questions
See that mod
It has a recipe to Carve Baseball Bats, that doesn't really convince me
Could I remove it if I deleted
{
Log,
keep FlintKnife/ButterKnife/HuntingKnife/KitchenKnife,
SkillRequired : Woodwork=4,
Result : BaseballBat,
Time : 1000,
CanBeDoneFromFloor : True,
Category : Survivalist,
}```
from \workshop\content\108600\1969674962\mods\PrimitiveSurvival\media\scripts\module_PrimitiveSurvival.txt ?
Yea, but you would temper with files which if you play on a server that uses that mod will not let you in, alternatively you can just not use the recipe and ignore it
Where are the files to see the internal IDs of the objects?
gimme a script and I'll narrate it for you with my crisp blue yeti
I might take you up on that. Not sure yet. Could write the script this week.
Umbrella is a game-changer for all modders.
I will be the first to sing your praises if I can follow your tutorial
But yeah seriously, I love helping out the community and giving back, so if you really want me to do some narration for you (or maybe I can record and edit the video for you?) I will. Feel free to DM me if you're interested in pursuing that further
Noted. Thanks for offering a hand. My projects are usually done all alone.
I don't have any team.
Yet my org github account has amased like 40 repositories haha.
Hi Aiteron! It's going well, I just published my first mod at 3 am this morning. I know staff are really busy and its the weekend, but as a new modder I really appreciate you popping your head in here! Even for a little
do you think I could ask you a couple questions that haven't been able to be answered here? qwq
you must have like 200% more hours of testing than actual playtime of PZ hahaha
Funnily I don't open PZ.
and 800% more hours of writing tools than testing
My stuiff is entirely outside the need to open PZ to develop.
Literally this.
probably ~100-150 hours of that is me having the game open, sleeping, testing, moving around, keeping the console up while I code
It's not an exaggeration either.
If you could see my non-steam hours it'd be around 10K.
With dev time? ~15-16k
I don't think that anyone expects you to put as much time.
My tools are for reducing that.
....i really should look into umbrella, huh?
I thought it wasn't fully released yet or something
Yes. You should. Albion, Omar, and my typings will solve so much work for you.
we really do need better exposure don't we 😅
albion, you worked on umbrella too?
I'm focusing on Rosetta ATM so people can contribute their own documentation to it.
i wrote one of its modules
pog
is this to prevent the 2398423089402 reuploads of mods in portuguese?
It's documentation for the API, not in-game translations.
oh nevermind haha, i misunderstood you the other day when you were talking about it
the game already has great translation support, it's just users choosing not to use it
This was my original attempt at the same solution for custom documentation, but for PipeWrench.
I'm doing the same thing for Rosetta. It'll be much easier.
that ui is attractive
I still have nightmares about bootstrap from college
Bootstrap is perfect for utility UI.
I also work with a corporate bootstrap package for my job.
We're almost at the point where we could make up for the lack of documentation for modding the game which will be great.
I might also contribute my own documentation at a certain pace once things are implemented.
anyone know if there's a way to mod the intro text when a game is loading? I absolutely must change one of the lines because it gets a song i hate stuck in my head every time. I found the file, but it's not lua just a text file and adding my own copy in my mod at the same path doesn't seem to work. shared\Translate\EN\UI_EN.txt
Only through overriding the texture pack containing the images as it is rendered images. (IIRC)
I've seen it done that way.
@faint jewel Didn't you do something like this in the past?
Yeah that's the file.
it's not images, it's text. i found the file and i can edit the text in my local install but i'm not sure how to override it in a mod
samef older in the mod?
I’m looking to change the infection values of bites, lowering it from 100% to 50%. Does anyone know where this file would be located?
@fathom dust
ah thanks, i was doing it wrong
my hero
Hello im working on my mod and i got the recipe to properly create the protein shake the issue is when I drink it it stays in the players inventory and dose not get replaced on use with an empty waterbottle any ideas on what could be causing this error?
Try:
ReplaceOnUse = Base.WaterBottleEmpty,
Hello there, when a character is dead, it stops refreshing the field of view. Thats perfectly normal but I would like to refresh the field of view (whole screen) anyway when dead. Any idea where I should look for ?
I've done that--there's no real way to mod that value since it's in java (IIRC), what I had to do was remove the infection based on a chance variable, like so:
local rolledInfectionChance = ZombRand(1, 100);
if getDebug()
then
print("Rolled " .. rolledInfectionChance)
end
if bodypart:bitten()
then
if biteInfectionChance <= rolledInfectionChance
then
bodypart:SetInfected(false);
player:getBodyDamage():setInfected(false);
player:getBodyDamage():setInfectionMortalityDuration(-1);
player:getBodyDamage():setInfectionTime(-1);
player:getBodyDamage():setInfectionLevel(0);
player:getBodyDamage():setInfectionGrowthRate(0);
if getDebug()
then
print("Infection defense successful.");
end
return false;
else
if getDebug()
then
print("Infection defense UNSUCCESSFUL. DIE WELL!");
end
return true;
end
What you mean - refresh?
this is part of a function that returns a true or false when the player's infected stat is true.
once dead, I teleport my player, but the screen becomes full black (except UI and my own name)
Hmmm. For what purpose you teleport player?
local function ATPlayerDamageTick(player)
local playerData = player:getModData().ATPlayerData;
if player:getBodyDamage():isInfected() == true and playerData.trulyInfected == false
then
if getDebug()
then
print("Handle Infection about to be triggered");
end
playerData.trulyInfected = HandleInfection(player);
end
Spectator mode for Battle Royale mod
What about idea do player invisible, stop any move/action and teleport after death?
this is already done and working but I got no visual anymore
respawn player first
ty so much that did the trick
If I do that: my character is not invisible (at least to admins) and it opens doors
What about trick that work for players swim in boat mod? It do player skin invisible
open doors? How?
that's very strange, but on MP, when I teleport a player to another player that is moving, somthing opens closed door in between
I do not understand it, but it is clearly not me
this does not happens when teleporting a dead player
but the dead player is teleported (can be seen on map)
Strange. Maybe MP sync stuff strange behaviour because teleport
What about do player sit on ground and teleport after?
I guess too. That's why keeping the death guy dead is so tempting
here is the run run in both cases (dead and not dead) local x = struct.targetObj:getX() local y = struct.targetObj:getY() local z = struct.targetObj:getZ() BattleRoyale.teleport(struct.playerObj,x,y,z) struct.playerObj:setCanSeeAll(true); struct.playerObj:setNoClip(true); struct.playerObj:setInvisible(true); struct.playerObj:setBlockMovement(true); struct.playerObj:setSitOnGround(true);
OnTick
maybe black screen because darkening the screen like when you sleep?
well if I die, my screen does not darken, it darkens after the teleport. so I doubt but I do not know.
I think it because game don't want load new areas after death. I think need try do something for stop open doors after teleport
Interesting, thanx
Try set some empty endless action for player when before teleport
this will either be cancelled by escape key or prevent exiting the game.
You can consume key press
or try set player in endless training + invisible skin
I'm mourning the teleported death player 😄
Any cue on how to hide player's shadow ?
no
What determines the time for a DeepWound to stay on a character?
setScratchTime(), setCutTime(), and setFractureTime() all specify a time for the respective wound to stay, but deep wounds are just created via p:getBodyDamage():getBodyPart(BodyPartType.Foot_R).generateDeepWound()?
https://imgur.com/a/qnhPBK6
random zombie attack variants
awesome

Like this?
I need models to make this seemless tho
Try teleport to z-1
Z=Z-1
Bellow 0
Its buggy but it removes the shadow
anyone know if there's a way to set the mods folder to a custom directory?
By default they're loaded from root/workshop or root/mods
but I want to be able to load them from C:../steamapps/common/Project Zomboid Modding Tools/ just for the sake of convenience.
you can move the entire user directory but i don't think you can just move the mods folders
you could symlink instead
if you're on windows, delete the mods folder (back up anything in there first of course), open command prompt in the zomboid folder, and type mklink /J mods "C:../steamapps/common/Project Zomboid Modding Tools/" (replacing that with the full directory of course)
I'm working on making a certain emote reduce stress, and I'm wondering if there's a way to trigger a function on playing a certain emote. I'm struggling to find one.
I saw this somewhere...
I think I figured it out but now I need to find a way to reduce stress for the duration of the emote. This should be the very last thing before my mod is done.
uh, I think in the run/movement animations file, there's a DamageFromTrees thing--idk where that gets triggered, but that might be close to what you need
like a timed action...?
or slap all the happiness gain on after it's completed
I wasn't sure if I could use TimedAction stuff on emotes but I can give it a try. As always I don't really know what I'm doing and it's a lot of trial and error and spaghetti code 
you might need to hook the function that plays the emote
This does?
I have a suggestion for a mod: "Walking With The Dead", this would mimic the idea of putting "Walker/Zombie" guts on your character to mask your body scent and make you look like a "Walker/Zombie" so you can walk with or through hordes of the dead safely
If anyone has any tips on how to make that let me know 🙂
there's already a couple mods that do exactly that
Wait fr?
What are the names?
I think like "zombie camouflage" or something like that
I just searched that and I cannot find it
Thank you
how do I open an .x file in blender?
No way...
I didn't knew swimming could already be a thing
That might not be good for performance...
Four days ago Albion wrote some code that** allows the creation of Trait Cost as a sandbox variable**. I'm not kidding when I say I've spent over 10 hours trying to figure out how it works. I've spent a lot of that time making sure I understand metatables, metamethods, etc. However I just can't seem to wrap my head around what's being done here.
Albion linked to the two files that handle this functionality here: #mod_development message
I've spent four days trying to wrap my head around just 8 lines of it. I've commented what I think is going on in those 8 lines. **If anyone is willing can you tell me how wrong my comments are and possibly explain what these lines ARE doing? **
-----------------------------------------------------
--traits.lua
-----------------------------------------------------
--allow Trait.class to inherit from metatable?
--or is it the other way around and metatable inherits from Trait.class?
local metatable = __classmetatables[Trait.class].__index
--old_getCost is never called anywhere else (other than to recursively
--call metatable.getCost again) so what is it holding on to here?
--once "Carrier" is found it'll just be an integer but we never use it
--is this just a keep-alive until the script eventually gets to the right trait?
--and once we find the right trait, traitcode.lua can do its thing?
local old_getCost = metatable.getCost
--dot syntax means self is not implicit,
--however when I change to colon syntax
--self doesn't seem to be passed implicitly
--meaning I can't do "metatable:getCost = function()" instead
--why doesn't colon syntax work here?
metatable.getCost = function(self)
if self:getType() == "Carrier" then
return -SandboxVars.ZContagion.CarrierCost
end
--keep recursively calling this function
--until we find "Carrier"?
return old_getCost(self)
end
TraitFactory.overwriteDef = TraitFactory.overwriteDef or {}
--TraitFactory.overwriteDef["Underweight"] = TraitFactory.overwriteDef["Underweight"] or {}
--TraitFactory.overwriteDef["Underweight"].cost = 8
TraitFactory.addTrait = function(...)
local args = {...}
local def = TraitFactory.overwriteDef[args[1]]
if def ~= nil then
if def.obsolete then
return Trait.new("","",0,"",false,false)
end
for i,v in ipairs({"id","name","cost","description","prof","removeInMP"}) do
if def[v] ~= nil then args[i] = def[v] end
end
end
return addTrait(unpack(args))
end
This might need a better knowledge of PZ to insert sandbox values. So you can skip it.
Poltergeist I'm trying to make sure I understand what I'm reading. This doesn't appear to have anything to do with Albion's code, but is instead another way to overwrite traits.
--extend overwriteDef so that it can also pass back an empty table?
--I haven't been able to find overwriteDef in any zomboid, lua, or java docs
TraitFactory.overwriteDef = TraitFactory.overwriteDef or {}
TraitFactory.addTrait = function(...)
--load all trait parameters into args
local args = {...}
--def equals the id of the trait to overwrite
local def = TraitFactory.overwriteDef[args[1]]
--if def isn't empty
if def ~= nil then
--I can't find obsolete in any docs either
if def.obsolete then
--create a new blank trait? Or delete the existing trait?
return Trait.new("","",0,"",false,false)
end
for i,v in ipairs({"id","name","cost","description","prof","removeInMP"}) do
--if dev[v] has a new value, overwrite that arg
if def[v] ~= nil then args[i] = def[v] end
end
end
--create a new trait with the new (or old and persisting) args
return addTrait(unpack(args))
end
This might need a better knowledge of PZ
I think that's what I'm most interested in digging into. I'm crawling the java docs but I'm not familiar enough with java to really understand what I'm looking at. I'll be the first to admit I'm punching WAY over my weight class with this code. The wiki has a very detailed table of contents, but so many of the linked pages are blank. I spent most of my 10 hours just trying to figure out the data structure of TraitFactory so I have a better understanding of what I'm trying to manipulate.
I'm going to stop barking up this tree until a later date when I have a better understanding of what I'm looking at. I appreciate the help though!
its the same code as fastmove
the admin cheat
its vanilla function basically
Just released a nicely sized content/fix update to Authentic Z. If you have any questions or bug reports, feel free to reach out to me.
function metatable:getCost() should work, just make sure to keep passing self to the old function
fixed
return old_getCost(self)
this makes a tail call to the old function, meaning it will return the cost of the trait as set in the java object
what is the passive skill group called? it doesn't seem to be called "Passive". Trying to add a new skill to it.
have you tried passiv? I will check in a moment.
Passiv worked, thanks. Any idea why it's missing an e?
Devs are not all native English speakers.
ah np
I'm trying to start a new skill at level 5 like Strength and Fitness, but I'm having trouble finding where to hook that in. I went looking for a player created event but the closest I found, OnCreatePlayer, is called on each save game load not just when the character is first created.
I think I have a snippet that is mostly functional.
Add default levels
local ProfessionLevels = { base = 5, engineer = 6, professor = 6}
local function doProfLevels()
local professions = ProfessionFactory.getProfessions()
for i = 1, professions:size() do
local profession = professions:get(i - 1)
local type = profession:getType()
local level = ProfessionLevels[type]
if not level then level = ProfessionLevels.base end
profession:addXPBoost(Perks.Reading,level)
end
end
Profession Hook
local original_doprofessions = BaseGameCharacterDetails.DoProfessions -- copy the original
BaseGameCharacterDetails.DoProfessions = function()
original_doprofessions() -- call the original
-- now do the stuff
end
Events.OnGameBoot.Remove(original_doprofessions)
Events.OnGameBoot.Add(BaseGameCharacterDetails.DoProfessions)
There might need to be something to change text descriptions.
So that adds an xp boost to all professions to effectively make it a common boost for all characters, right?
Yes
What about when choosing "no profession"?
That's also a profession
Ah ok that makes sense, just an empty one by default i guess
If you have issues, you can check Albion's literacy mod.
Thanks, i'll give it a go
Wait, I don't remember if she starts from 5 or 0.
There was another literacy mod on steam that did that.
nice, it worked
There's a little exploit in my mod, and if I can't fix it it's not a huge deal, it's just a little immersion breaking so I thought I would ask in case there's a solution. I have a timed action set to reduce stress, and if you climb through/over something while the action is going the action continues but the animation stops. I was wondering if there's a way to make it stop the action if the animation stops or after climbing. I have it set to stop when running and aiming and that works but you can still climb and not cancel. 
I often read a book while climbing sheet rope and don't see a problem here 😅
Like I said it's not the end of the world, but just figured it would make the mod seem better if I could patch it out 
Does the animation trigger some event when finished? Timed Actions have an OnAnimEvent function that is called where you should check the event name and parameter.
Action:animEvent(event,param)
This is called with a number of different Events, there should be one when you change animations. When that happens, do self:forceStop()
I'm not entirely sure. I kinda fudged things so upon doing an emote it starts a timed action, and both the emote and action loop until interrupted. It's not that it's broken like it won't stop after a certain amount of time, I just want it to interrupt when the animation is interrupted so I don't know about needing to do self:forceStop. I think your idea with the Action:animEvent(event,param) might help
I can't find any sort of animation event on finishing or anything. I'm not sure what to do 
what exactly problem with anims?
I'm trying to make a timed action that's looping, and make it interrupted when starting another timed action, or when the animation is interrupted.
I'm pretty new to modding and this is my first mod so my knowledge is very basic 
Like the timed action thing has a thing for stoponWalk,OnRun and OnAim, but I don't know about any other conditions. I'm trying to make it stop when interrupted other ways.
action:stop() not work?
Not to my knowledge, so I'm probably doing something wrong or not understanding something
What does the mod do
setPlayerMouse(nil) seems to do the job for creating a default main IsoPlayer.
Seems Player is Mouse works.
Final goal is the spectate mode
Current goal is the creation of a new IsoPlayer to replace the dead one.
Isnt there a constructore for IsoPlayer?
I cannot call the construction by myself, it needs to replace the result of getPlayer()
Adds zed attack variations
Scratch, swipe , hook
-----------------------------------------------------
--traits.lua
-----------------------------------------------------
--save the Trait class's metatable into a variable, so that i don't have to write all of this every time i access it
local metatable = __classmetatables[Trait.class].__index
--save the original getCost function into a variable - the cached value does not get overwritten when i overwrite getCost, so this is a permanent pointer to the vanilla function
local old_getCost = metatable.getCost
--you can use colon annotation here with implicit self, but i prefer to define my functions backwards ( name = function() instead of function name() ) which doesn't allow for that
metatable.getCost = function(self)
if self:getType() == "Carrier" then
-- if it's the trait we want, return the custom value
return -SandboxVars.ZContagion.CarrierCost
end
-- if we didn't want to alter the return value because it wasn't the trait we were interested in, just run the vanilla function instead
return old_getCost(self)
end
Hello, I'm not familiar with weapon mods. Do you know if burst mode has been done already?
brita has it
oh sick
Hello, question for the lua experts: how can I manipulate the non declared variable clickedPlayer from ISWorldObjectContextMenu.lua ? is it a local by default ?
This file has a lot of global variables, you can change them from any file.
thanx, I must be doing bad stuff on the rest of my code then.
https://steamcommunity.com/sharedfiles/filedetails/?id=2987075070
Bro just released a PZ Mod for adding variable breathing dependent upon exhaustion level, feedback and thoughts are welcome!
Quick question, how do yo do translations? I know about the files and folders, but everytime I type in another language with different characters(chinese, russian) it all appears as "?????" ingame
is there any program I should use to write in the text files that has special characters or what
check what encoding use text file for specific language in game. Like for Russian used encoding "Windows-1251"
yeah, that it's a good start
is there a way to make custom emotes
Hello! I have a question, I am new to modding and have basic lua knowledge and i'm trying to make a new beverage recipe. I want to pour my beverage into a mug, but I don't seem to understand how I will do it since there are multiple verations of a mug (red, cyan, spiffo), do I just make multiple recipes? Is there any other way to make it more efficient?
ayo lads , small question, how hard is it to make a simple retexture mod, just making a specific car have a texture i want
@tame mulch @fast galleon I made spectating function for Battle Royale mod that satisfies me on a local MP server. Now I'll see if it goes smooth on a real server. Anyway, thanx a lot for your advices.
It's not hard)
anyone know what causes this?
if you have gun mods and you want to add to it
3 round burst mode
and / or bayonet you can require my mod and modify your weapon scripts
just follow the instruction and your guns will have these functions
they are ment as API for modders
https://steamcommunity.com/sharedfiles/filedetails/?id=2987956438
https://steamcommunity.com/sharedfiles/filedetails/?id=2987772344
When naming client script files does the file name matter ? ie; modname_OnEat.lua / sdfsdfsdf_OnEat.lua
When it comes to weapon item categories (i.e. ShortBlunt, Improvised, etc.) is there an extra step to creating new ones? Or is it as simple as me deciding to name a new category and attach it to an item?
So for example, if I wanted to add the category "Random" to a butter knife, I just change "Categories = ShortBlade," to "Categories = Random;ShortBlade,", and that category now exists? Or do I have to add "Random" somewhere in the Lua code so that the game recognizes it?
i can't even find a single reference to the word 'improvised' in code, so i think so
Hay guys so ive been on a really weird side quest recently and ended up building an Xml parser because I'm too lazy to look at xml code - it basically extracts your xml file extractrapolates it to a data table and let's you alter the values while remembering the default states and allows you to export a new xml with the same format as the original. It also allows you to extract the schema of the imported xml with comments replacing the default values If you want. I was wondering if this would be useful for anyone else and if so is there any features you'd like? The last thing I was planning was a GUID generator
i thought they said they are full rn?
Anyone have insight as to what might cause light to be cast upon the opposite side of the vehicle like this? I thought it might be normals but they're correct.
Hi, if I call isoPlayer:transmitModData() isoPlayer:transmitUpdatedSprite() from the client where isoPlayer matches getPlayer(). Will the server spread those info to all other clients ?
player mod data is transmitted automatically, transmitmoddata doesn't do anything
Good to know
Thank you
If I call setScratchTime(1) on a BodyPart object, what time frame does 1 actually imply? I thought it was hours or something, but the wound remained from 6:50pm to 11:00 pm, or about 4 hours 10 minutes..?
Wow
Link pls
I'm currently trying to figure out how to put it on github lol it's still a wip tho
I do not read on other clients what I write localy in the moddata of getPlayer()
it might have some delay or something, i don't know exactly how it is synchronised but iirc transmit does not work because the co-ordinate system it uses is not compatible with players
try transmit and if i'm not mistaken there should be a warning in the server console
i see that this is not how one of my mods seems to work so i might have been mistaken
As far as i remember player modData is never transmitted
Its local to the player object but also seems to be saved on the server when the player is saved. Tho not accessible on the server.
i see for one of my mods i sent data to the server and then added it to player moddata from there, so that seems correct
and that data was then readable on the client?
idk, i just needed it on the server
i would assume no if player moddata isn't usually synchronised anyway
If anyone wants to try and play and break my anthro traits mod, send me a DM!
My friend set up a server for me, and getting other modder's eyes on it would be really nice
template : https://drive.google.com/file/d/1r9xq3BYkRt07078kmwMMxQlpHsmJLhLu/view?usp=sharing
other tutorial that has the link to wordzed and I didn't copy and paste it here cuz I'm lazy:
https://www.youtube.com/watch?v=iv7N7gmowWU
the thing I plugged at the end shamelessly:
https://azakaela.itch.io/dragons-destiny-ost
can someone help me with this silly problem, so i made my 1st 3d model in blender, a simple mask, i added it into the game, and it works, but it's not exactly where i want it to be, i tried moving it a bit higher in blender but it stays in the same spot in game so idk what's the problem xd
try asking in #modeling
not something i know anything about but you'll probably get a faster response there
oh ok thx
i figured it out heh
my lovely good fellows
Could anyone direct me to a right path
in trying to figure out a way to
alter the required item to "pick up" certain movable items
for example, to pick up a sink one might need a wrench
but I want to change the requirement to maybe "item.X"
instead of Base.Wrench
is there any easy way to do so using TileZed or LUA?
preferably TileZed since.. lua seem too complicated....
unless there's a simple mod that i can take a look at its code
I installed Brita and arsenal mod, but that option does same thing as auto. What am I missing?
Events.OnFillWorldObjectContextMenu.Add(funciton(player, context, worldobjects, test)
if not canBeWaterPiped then return end
if test == true then return true; end
local name = getMoveableDisplayName(canBeWaterPiped) or "";
local option = context:addOptionOnTop(getText("ContextMenu_PlumbItem", name), worldobjects, ISWorldObjectContextMenu.onPlumbItem2, player, canBeWaterPiped);
if not playerInv:containsTypeEvalRecurse("ItemX", predicateNotBroken) then
option.notAvailable = true;
local tooltip = ISWorldObjectContextMenu.addToolTip()
tooltip:setName(getText("ContextMenu_PlumbItem", name));
local usedItem = InventoryItemFactory.CreateItem("Base.ItemX");
tooltip.description = getText("Tooltip_NeedWrench", usedItem:getName());
option.toolTip = tooltip;
end
end)
ISWorldObjectContextMenu.onPlumbItem2= function(worldobjects, player, itemToPipe)
local playerObj = getSpecificPlayer(player)
local wrench = playerObj:getInventory():getFirstTypeEvalRecurse("ItemX", predicateNotBroken);
ISWorldObjectContextMenu.equip(playerObj, playerObj:getPrimaryHandItem(), wrench, true)
ISTimedActionQueue.add(ISPlumbItem:new(playerObj, itemToPipe, wrench, 100));
end
discord code formattion is awesome
hardcore?
try zed doesnt stop when doing claw attacks
Was wondering if, somehow, it'd be possible to remove a job from the selection menu. Like, if I wanted to remove burger flipper as an option.
playerObj:getInventory():getFirstTypeEvalRecurse("ItemX", predicateNotBroken);
ISWorldObjectContextMenu.equip(playerObj, playerObj:getPrimaryHandItem(), wrench, true)
ISTimedActionQueue.add(ISPlumbItem:new(playerObj, itemToPipe, wrench, 100));
end
is playerobj:getPrimaryHandItem() , wrench , true should changed into "ItemX" too??
thank you for the reponse by the way
as u want, it's just name of variable from here
local wrench = playerObj:getInventory():getFirstTypeEvalRecurse("ItemX", predicateNotBroken);
It's possible
Possible for someone without any experience modding?
Sorry, I'm new in modding. How can I set the text of a SheetPaper?
i see i see thank you, ill try it and see if i can make it to work
How would I create a sound event in the future with a variable amount of time? OnEvent every ten minutes check whether the duration has been reached or some other way?
Why I can access modData only for some players ? I ran this in debug on a server with 35 active players:
local players = getOnlinePlayers();
for i = 0, players:size() - 1 do
local player = players:get(i);
local favouriteWeapon = nil;
local swing = 0;
local m = player:getModData()
for iPData,vPData in pairs(m) do
for index in string.gmatch(iPData, "^Fav:(.+)") do
if vPData > swing then
favouriteWeapon = index;
swing = vPData;
print(player:getUsername() .." - "..favouriteWeapon)
end
end
end
end
And I get this because I'm close to them, but when I'm near other players it doesn't print.
LOG : General , 1686580180167> 4,123,747,162> Elyon - Red Toy Lightsaber
LOG : General , 1686580180168> 4,123,747,162> Ahriman - C.R.T.K Kukri Machete
LOG : General , 1686580180168> 4,123,747,163> LennyTheLight - Fiskar Curved Machete
https://www.youtube.com/shorts/EGvxJ5qWYH0
Weapon mod when?
I'm seeing some of the server lua is doing:
for playerIndex=0,getNumActivePlayers()-1 do
local playerObj = getSpecificPlayer(playerIndex)
getOnlinePlayers def appears to be client side
anyone know ab this
no, getOnlinePlayers is correct
getSpecificPlayer will never return anything on the server
we even don't know what is that. what do u want to hear in return
what u did/how u did/where u did
u just sent image with a thing that cannot be defined by itself
absolutely no info
Daily reminder that Umbrella is now available to provide your modding experience with IntelliSense for PZ's API.
https://github.com/asledgehammer/Umbrella
Is there anyway to get a list of item components? For example the components that went into a stir fry
if you're talking about the stir fry recipe, look for stir fry evolve recipe
More I want to see the components of an already created dish
I'd like to change these two weight numbers from 20 to 5, to practically reduce the weight of zombie corpses to 5. I'm not really good at modding, but this seems like a simple fix. Is there a rattail to this? Will changing these values summon the enderdragon on me? 
hopefully easy question.
can I alter a .lua file by just opening it in notepad ++, making the change, and saving it.
or do .lua have a specific way to make changes?
yes
local extraItems = inventoryItem:getExtraItems()
for j = 0, extraItems:size()-1 do
local extraItem = extraItems:get(j)
--print ("ISInventoryPage extra item "..j.." = "..tostring(extraItem or "nil"))
end
end```
How do I make a certain amount of water or any type of liquid for crafting. I don't know how to word it, but like I want to pour a certain amount of my beverage, but I don't know how to add the amount it has.
Some sleuthing:
a modder cerca 2017: "N.B. there is some problem with the function getOnlinePlayers(), sometime you'll see only players in your area until someone kills a zombie. Sometime you'll see all players."
I also read it will return empty for non admin accounts from 2022 due to hackers wiping servers
your client only knows about characters you've been near that session because of that hacking issue
The character holds it wrong and I think its the code
Sorry, I'm new in modding. How can I set the text of a SheetPaper?
Anybody know of a function or event for when a vehicle is damaged by a zombie
wonedering this too
Technically the car doesn't get damaged, the parts are. Nonetheless, there is no event to detect damage on those. No car collision event or anything
anyone know if this is possible btw?
We need to make a list of all the events and stuff we want to be added to the game.
OnVehicleCollision (vehicle, collided object, force)
OnVehiclePartDamaged (part, damage)
There are some existing events that should have parameters that don't. Which would make the event more relevant.
I'm more interested in fixing misnomers in the Event callback parameters than adding needed ones.
I mean, there need to be a list of (to add, to edit, to remove)
That's a good way to go about it, yeah..
Do that.
The codebase is only as good as the maintenance.
We build mods, we are in touch with the game code everyday and we face many walls that stop us from going forward in our creation. Those moments, need to be documented and eventually looked at by TIS when they have a chance.
Sometime the fix would be as easy as just triggering an event here and there
For example the OnSafehouseChanged event doesn't have a param, so we don't know which safehouse changed, nor what changed into it.
That one would be easy to fix like 200%. And triggering events where there has none would open alot of new possibilities.
Hi! This is a part of a code that I'm doing that adds a menu and subcontext menus to the police bulletproof vest and for other vests in the future:
a = nil
for _, item in ipairs(items) do
if (item:getFullType() == "Base.Vest_BulletPolice") then
a = item
break
end
end
When throwing my global variable a into this function:
local function changeLocation()
local item = ScriptManager.instance:getItem(a)
if item then
item:DoParam("BodyLocation = TorsoExtraVest")
ISTimedActionQueue.add(ISWearClothing:new(player, a, 30))
end
end
The game breaks. My global variable a seems to work in the timed action function but doesn't seem to be accepted in ScriptManager.instance:getItem(a)
Using ScriptManager.instance:getItem("Base.Vest_BulletPolice") works fine.
Anyone know how to deal with this? Can I extract just this "Base.Vest_BulletPolice" from my variable with a function?
a:getFullType()
i think you could also do a:getScriptItem() instead of using the script manager
thanks, a:getScriptItem() worked fine!
I see that WornItem is exposed, in java\Lua\LuaManager.java => this.setExposed(WornItem.class);
Is this the correct way to initalize it from lua?
local item = WornItem:new(bodyLocation, invIem)
should be **.**new
Ah 🤦♂️
Thank you 🙏
Java objects requires .new(..). Lua pseudo-classes requires :new(..).
I'm trying to create a drink mod as a POC for a question that someone else asked a few days ago, however I'm having some issues. I'm following this guide: https://pzwiki.net/wiki/Scripts_guide/Evolved_Recipe_Script_Guide however actually getting the recipe up and running has been troublesome. Currently the recipe works, but the context menu item looks like the attached picture. Anyone have any ideas why the item name is borked?
My recipe is as follows https://gist.github.com/danielewartwelch/1a327f87ad5b21f73489106de729614b
Did you create a translation file for ContextMenu?
That'll do it. Thank you!
😄
I knew it was something dumb
Using getText("ContextMenu_EvolvedRecipe_BepisSyrup") will return that string ContextMenu_EvolvedRecipe_BepisSyrup if it's not found.
So you create a lua/shared/Translate/EN/ContextMenu_EN.txt to translate it, and on next game reload it will be visibly correct.
Follow up question. The whole mod falls apart if I don't include
module Base
{
imports
{
Base
}
...recipes and items here...
}
however I see other mods using
module NameOfMod{...}
I can't determine where I need to use Base and where I need to use the name of my own mod/filename. I also can't find anything in the wiki about modules. Is there a rule of thumb when you should use one verses the other? and why do I need to name the module Base and then also import Base?!
For Items and Recipes you can use your own module name but stuff like sounds and models I usually use Base, the rule is if it doesn't work use Base. lol
For Items you can actually see them sorted in the admin item menu.
lol pretty solid rule I suppose
Sometimes there is no rules
Yeah using debug was the only way I could confirm my item files were actually loading in for several hours yesterday B[
Dammit. I just figured out why the mod I was following doesn't need the translation files. They're using (nonevolved?) recipes. I guess static recipes don't need to be translated.
Thank you @thin hornet! You rock!
Hey modders, just throwing that idea here because im not sure it exist already and i think it would be a cool (ofc not essential) feature. In DayZ we can wear military boots that have a slot for a knife, do you think it would be possible to do that aswell in PZ ? Add a knife (short blade) slot to Military Boots ?
Non-evolved recipes use their entry / id names if there is no translation
That is possible
Guys, is there a mod that makes you forget the discovered map once your character dies? So the next character does not inherit the knowledge of the world map. Thanks!
Oh that's cool ! Well if someone want to make that feature real that would be great !
also i was thinking to that : to add a new recipe (or even better a totaly new item) to build some rain collectors. The goal is to give an alternative to garbage bags to build them
i dont know what material could be used tho
Also @nimble spoke takes commission projects too
Since he answered first you should consider hiring him
Oh i was just throwing the idea like that, i wont go as far as paying someone to make it real
For questions about mods use
#mod_support
Mod development
Is a channel for developing mods
Hey y'all, i have a kahlua inheritance question.
I have a function that knocks down players as well as zombies, because they both have isoGameCharacter as a base. Knocking down zombies is fine since they have ":setBumpStaggered", but a player does not.
Do functions from parent classes have to be specifically exposed in child classes?
no, players should have it from what i can see
then I have no idea why this part of the function is erroring out in multiplayer
elseif instanceof(collidee, "IsoPlayer") and ((collider:getCoopPVP() == true and collidee:getCoopPVP() == true) or collidee.isZombie())
then
collidee:setBumpStaggered(true);
collidee:setKnockedDown(true);
collider:getStats():setEndurance(collider:getStats():getEndurance() - knockdownEndCost)
collider:setBumpType("");
collider:setBumpStaggered(false);
collider:setBumpFall(false);
end
it's a good ol' line 642: tried to call nil. It happened when a player who was not me tried to knock me over
oh. 642 is the second line
worse comes to worst, is there a way to cast a child as its parent in lua explicitly?
no, there is no casting
why 2 and not 3 dots 
You like to break people.

You could refer to my beartrap mod
It has both zed and player staggers
If you like
i'll take a look! thank you
So, has anyone developed a tool or otherwise figured out how to decrypt / deserialise the data column of the player database?
Specifically through external means, rather than a mod.
They use Sqlite i believe
Thank Tchernobill this is exactly what I needed 🙂
Aww yis bepis
Hey guys, does reverting a mod in the workshop to a previous version make the version of the mod match a previous version?
I updated my mod on the workshop and now I have no access to a server I could have rebooted if I did
i'm a bit confused on the wording of this, but the answer to the question i think you're asking is yes
Question for the map modders/people using Raven Creek. It's recommended by Raven Creek author to turn off random house events becaues it can cause bugs on the map. But i seriously miss that feature. What do you guys do? keep that setting off? you set it on ?
Hmm. I gave it a try and the server still says I have a different version
oh well
if the later version had new files they would not have been deleted, which would change the checksum and stop you from connecting
can I write data to an INI file in the PZ directory?
(I know its unlikely but I can pray)
not the workshop folder but the game directory
you can write to either your mod's directory or Zomboid/Lua/
i don't recommend ever writing to your mod directory though
can I write to say
zomboid/textfile.bla bla
no, has to be in the Lua folder
Hey, I'm making a true music mod using the provided tutorial, but when I attempt to actually publish it, it tells me that Its missing a mod.info file, but i have it.
if anyone could help that would be great
i renamed the file and restarted my game but it's still giving me the prompt
you have file extensions hidden, it might be calling itself mod.info.txt
on windows 10 you can unhide them by going to the view tab and then ticking file name extensions
thank you so fucking much
is it possible to write to the saves/sandbox folder? and read it from a mod function?
no
Hmm... alright
Trying to figure out what can be saved and loaded... without using modfile writer/filewriter.
https://projectzomboid.com/modding/zombie/characters/IsoPlayer.html#SaveFileName
Dang, I hope there's a better way
generally, if you need save-specific data, just use moddata, if you don't, use the Lua filewriter
Yeah, I tried, but apparently IsoPlayer data isn't saved in the moddata for some reason.
it can't save objects, if you need to do that you need to save whatever data you need to reconstruct that object
Hmmm... what a pain, OK thanks
IsoPlayer is a pain with all the inherited properties. Then I need to account for bodyparts, moodles, and location. 
Don't worry. We're all suffering here.
Sometimes you have to code while drinking to get the job done.
That's how I coded PipeWrench. :D
sometimes? 😄 good evening
I mean, if you can count the number of inherited properties on IsoPlayer you'll understand.
I may need to rethink my life and plans.

what r u tryna do?
working out a modding plan for npcs.
hey does anyone have any advice on a model having attachments that are tiny?? I have one gun in a 3 gun mod im working on and I can't finish it because the one rifle has this issue with the attachments. it's also affecting the muzzle flash. scale modifier does not change it. gun is properly sized.
Doable
so I've been working on a bit of a concept
really interesting
it uses a mix of reshade and a mod which adjusts climate settings
essentially
still getting a proof of concept but
based on whats happening in game it adjusts some things (wind intensity, precipitation etc) to be more cinematic and then it writes different reshade settings to a preset file stored in the zomboid/lua directory
I'm really hoping I can get this working
hard part is the ui masking
anyway wish me luck
The power turbingnon and off has an effect delay
I understand what youre trying to do
You want the player to get the broadcast feed
No matter where the player is
Its not going to work without power unless maybe theres a paramater you can change on the tv object
Or maybe create a version of that which consunes battery maybe
and I've had some rly good visual results mixing climate + reshade settings so just hoping i'll be able it to work seamlessly
I dont know much abt this as i havent modded anything tv related
But theoretically this is all doable
Is it client side only or is it global?
In any case
Looks good imho
U doubt you can fo this without overwritting texture
Idk i might be wrong
I'm hoping I can do it clientside
I just started actually scripting it
so you could use it on servers
idk if zomboid allows for that even
but yea I'll report back in a few hours
zomboid does not allow for that
But if u can transfer a tvs properties to a different sprite and able to play with its params (like requires power)
Then the feasibility is looking good
So i would suggest figuring out these stuff using debug
And if you fail then feasibility isnt looking good
Its just writing to a text file?
Why wouldnt that be allowed?
if you need to load a mod at all zomboid won't let you do that
client mods must match the server
I have a mod which let players like choose to hide some stuff, how could I go about saving that information so that they don't to hide it everytime they play?
I mean I could just use some JSON file, but does PZ have something built it?
depends what you're trying to hide
if it's save file specific, use moddata, if it isn't, write a file
Some recent mods I worked on if you all care to check them out...
Dumb Ways to Die Death Music: https://steamcommunity.com/sharedfiles/filedetails/?id=2988459014
Fix Melee Context Menu popping up at the worst times: https://steamcommunity.com/sharedfiles/filedetails/?id=2986816238
Updated Two Weapons On Back + Modded Bags: https://steamcommunity.com/sharedfiles/filedetails/?id=2984969258
I haven't programmed in years, but I love Project Zomboid soooo much that I couldn't help but to break back into it! ♥
Currently working on a Custom Professions + Traits mod (TBD) as well as a Custom Zombie Behavior mod.
And more to come! 
Project Zomboid #1
If you wanted to keep it Lore Friendly, there used to be handheld TVs back in the 80s and 90s. Wealthy businessmen in suits would travel with them so they wouldn't miss a sports game or the news. Those ran on batteries.
You might even want to check out the GPS mod for texture and UI presentation ideas.
Teens react to the Sony Watchman -- a portable TV from the 80s. Watch to see their reactions to this old tech from decades before they were born.
Watch more reactions to old technology here: https://reactmedia.co/3Fk2CjN
Content Featured:
Commercial
https://www.youtube.com/watch?v=s_CMlHbB5Y4&ab_channel=tvdays
80s commercials
https://www.youtu...
[Modder] Request for Modification
I am creating this thread to provide modders with an opportunity to share their ideas for modifications that can benefit the modding community and unlock new possibilities. This is not about requesting TIS to add new features to the game, but rather to request TIS to add or modify specific elements in the Java code that are necessary or missing for mods to operate more efficiently.
In this thread we can discuss together about posted suggestions.
Once a suggestion is supported by the community, we can create a forum post and tag @tame mulch to request a review.
While this does not guarantee that TIS will adopt the modification, it certainly helps to organize our ideas in a clear and understandable manner, increasing the likelihood of being taken seriously and demonstrating the needs for such modification.
Here is a model request that can be used to accurately describe your idea for the desired modification.
**Title:** [Your Idea/Suggestion]
**Introduction:**
*Introduce yourself briefly and state your motivation for sharing your idea or suggestion.*
**Problem Statement:**
*Identify the problem and explain why the current system is inadequate.*
**Solution Overview:**
*Provide an overview of your modification idea and its benefits.*
**Step-by-Step Implementation:**
*Outline the sequential steps to implement your modification.*
**Step 1:** [Description and instructions]
**Step 2:** [Description and instructions]
**Step 3:** [Description and instructions]
**Supporting Evidence:**
*Present relevant evidence or data supporting the feasibility and effectiveness of your modification.*
**Conclusion:**
*Summarize your idea, emphasize its potential benefits, and encourage feedback.*
You may also post your suggestions on the forum:
https://theindiestone.com/forums/index.php?/topic/23315-the-modders-wishlist/
So I recently been poking around and speaking to modders on a fairly regular basis (shoutout to the workshop_modding channel on Discord) and recently it feels like I been finding out about certain issues, or wishes more through happenstance than actually seeing it brought up elsewhere. So this th...
[Modder] Request for Modification
@thin hornet
Would you mind to include this forum link I'm not sure what their preferred media is.
https://theindiestone.com/forums/index.php?/topic/23315-the-modders-wishlist/
So I recently been poking around and speaking to modders on a fairly regular basis (shoutout to the workshop_modding channel on Discord) and recently it feels like I been finding out about certain issues, or wishes more through happenstance than actually seeing it brought up elsewhere. So this th...
The thread is intended for us to discuss and enhance ideas, while also gauging their popularity among the community.
It sure has to be posted on the forum once it is well written.
Btw, @ _colonelpanic (anonymous) has a lot of work done for collision events, I'm not sure if he ever posted it though.
Does anyone know if this is a modpack? I can't read chinese
https://steamcommunity.com/sharedfiles/filedetails/?id=2216172287&searchtext=transmog
Nevermind, apparently it's just a translation mod
For some reason my food items texture and icon is missing?
Model script
{
model StrawberryKompot_Ground
{
mesh = WorldItems/JarFood,
texture = JarStrawberryKompot,
scale = 0.5,
}
}```
newitem script
```module Base
{
imports
{
Base
}
item KompotStrawberry
{
DisplayCategory = Food,
Type = Food,
DisplayName = Strawberry Kompot,
Icon = SKompot,
Weight = 0.5,
DaysFresh = 60,
DaysTotallyRotten = 365,
StaticModel = CanClosed,
WorldStaticModel = StrawberryKompot_Ground,
}
} ```
I'm sure the textures are in place too.
Where and how did you name your icon file, is it also 32*32
I put my icon into my mods textures folder
and the icon is 32*32
what is the name of the file
and also make sure to restart the game to see the icon if you didnt already
The icons name is SKompot like in the script
I'd rather mod them in myself and distribute the modified bytecode as an enhancer / QoL mod.
The only features I did that were eventually brought into the game were not ones I asked to be and the ones I did that were very important were ignored.
I understand
I'm hoping that we can do this as a community so that the impact is greater.
Also in the form, there is a field to demonstrate how to do the said modification. So I'm expecting that we do our research in the source to determine the feasibility of said modification.
Don't worry. I've done several of these on my own, actually for multiple games. I haven't seen this be effective here.
You're better off writing a flavor of PZ with adjustments.
Not sure what you mean here. To patch the said class myself? And propose it?
Yeah. If they say no you still have something to work with.
That's what modding is.
Well that's what old-school modding is.
Well in the case of pz, modding is really limited to lua. I'm not hot to the idea of java mods just cause of the maintenance required and way of distributing it.
Letting you know that you might be wasting good energy that could be applied without waiting on the game to implement it.
That's it, really.
Ah yeah totally understand, well let's try. Also I got enough energy right now.
fixed the icon but the texture is still missing
Great, changed the name of a texture file and in the script, then this happens
item is not found
how am I suppose to fix this?
probably an error in your item script is stopping it from being read
or your recipe points to the wrong name or something
Is there some guide to recompile java PZ ?
How can I redirect the logs to another file than console.txt on a client ?
There's no guide AFAIK. I know a clean method and have used it for over 10 years.
When you feel like it and got the time, a guide for the noobs would be welcome 😄
Yeah I've mentioned possibly doing this several times in the past.
Does anybody know how to set the text on a item of type SheetPaper2.
item:addPage(index, text)
how would i go about making a trait
Does anyone know, how does the Lua engine handle coroutines? I'm not familiar with Kahlua but I know both Lua and Java. Like if I do IO stuff I'm worried about freezing the game. If I put like a sleep(100) in a coroutine does that freeze the whole world?
coroutine is more like sequencing tasks, not executing them asynchronously IIRC.
Basically breaking down a task into segments and executing them then yielding for the remainder of the tick.
Thank you. You cannot imagine how many days I spent searching for this. You make my day.👍
yeah, there is no multithreading available to us
anyone got a template for traits

it depends on what kind of trait you wanna make
weapon traits for skills
so like a trait that gi
ves
+4 blade
That's easy. Do you know how to create a mod?
Here's the line of code you want then:
local AT_Hooves = TraitFactory.addTrait("AT_Hooves", getText("UI_trait_AT_Hooves"), 4, getText("UI_trait_AT_Hooves_desc"), false);
AT_Hooves:addXPBoost(Perks.Sprinting, 1);
AT_Hooves:addXPBoost(Perks.Nimble, 1);
TTF.Add("AT_Hooves", "Anthro,Hooves");
local traitName = TraitFactory.addTrait("traitName", getText("UI_trait_traitName "), 4, getText("UI_trait_traitName_desc"), false);
traitName:addXPBoost(Perks.Sprinting, 1);
traitName:addXPBoost(Perks.Nimble, 1);
formatting of the traitfactory line is (traitName, string of player-readable name, cost, string of description, bound to a profession only true/false) the last one would be like night owl or nutritionist
oh makes sense
ignore the TTF thing that's part of a framework i made
ah alright
you'll also want to ideally use getText for the name and description like I did. If you do that, you'll need a ModName/media/lua/shared/Translate/EN/UI_EN.txt
stick require("NPCs/MainCreationMethods"); at the beginning of the script you're using to declare new trait(s), and make sure you have a symbol for it in the UI in modName/media/ui/traits
other than that I think that's it. If you wanna do something more complicated that add skill levels though, that'll be... def harder haha
requiring vanilla files isn't necessary
they always load first no matter what, and none of them return anything
huh. good to know!
when you see mods doing this it's either because they're copying from vanilla, which does need to ensure its own load order, they copied from other mods that do it, or just as a way of indicating 'see this other file'
Hello, I am trying to find a way where I can somehow transfers a player zombie model (I think it's a clothing) into a dummy NPC, does anyone know something? (Sorry I have to repost, I posted it in the wrong channel)
which folder?
Dislaik used multithreading in Dogs mod
I'm not sure what you mean by "a player zombie model", maybe Transmog mod is doing what you're looking for
I am basically looking for a command line where if the setting is true, it will convert a zombie Data into a temporary NPC dummy
NPC dummies are not available directly in Vanilla. Most NPC mods use createSurvivor function. This comes with some troubles and no MP compatibility. Some other mods use Mannequins. This comes with some other troubles. Clothings can be transferred from Zombies (IsoZombie) to Players (IsoPlayer), but most other things cannot. I'm not aware of anyone using IsoZombie for other things that menace.
Hm.. Do you have any idea how I can transfer the clothings from IsoZombie to IsoPlayer?
look for getWornsItems() method on each
Alright thanks, Does it also works for zombie players?
if you're talking about dead players that became Zombie, yes.
Alright cool thanks
How would I export 3d models from in game?
I plan on re-texturing some models lol
Like applying some gun skins
most models would be in media/models_x
also for modeling questions go to #modeling
Yeah, I know that, but how the heck do I get the .x's in blender / whatever editing thing?
you would have to convert x to fbx with some tools
which #modeling will be able to answer more easily
alr, whenever i get on my main pc, will do so
also there are alot of fbx models too, i think tis was moving away from .x
i’ve never been able to get fbx’s working ingame
Looks like it doesn't really work
@drifting ore if you use blender version 79b it has a native .x exporter. you can use whatever version of blender to make model, export as fxb, import in 79b and then export as .x. it has worked for me with a bunch of models
Okay I'm still pretty new at this but, where in the game files is the code the game uses to check if the player is indoors?
my plan is to write a mod wherein a player who is outside and not wearing a gas mask will slowly take damage over time.
but I don't know where to find the bits of code to steal to put it together
(I also dont know where the script would need to be put in order for it to work, or what script to add the call for the mod to)
@timber spindle I'd suggest getting the player's location using playerObj:getCurrentSquare(). You can then ask the square if it is located outside using square:isOutside()
perfect that's exactly what I need
Anyone know why this is blowing up at string.find
TetrisItemData._calculateMoveableStackability = function(item)
local name = tostring(item:getDisplayName()) or ""
local a = string.find(name, "(")
local b = string.find(name, "/")
local c = string.find(name, ")")
local isPackaged = a and b and c and a < b and b < c
if isPackaged then
return 2
end
return 1
end
what is the error?
kahlua didn't like that
oh!
it's interpreting your brackets as part of a POSIX capture pattern
try "%("
Yep that was it!
Can someone help me with a texture issue? in blender the model shows as fully textured, however in game the texture is broken
Dont forget to name the icons
With
Item_
But ln the script dont write that
Hello everyone I am developing a mod related to the sale of cars on one of the servers. I ran into a problem: "vehicle:getId" issues duplicate IDs. This happens when the old transport that has already been issued an ID is "not loaded", but we will spawn a new one. Is this a normal situation or have I messed up something? I need a clear way to identify the car. Maybe I should use vehicle:getKeyId() or something else? I will be glad of any advice. Thank you in advance.
are you using getID or getId ? unfortunatley they are not the same
getId
if you need a definite persistent way to identify a vehicle getSqlId() is definitely unique and persistent
i had thought (or hoped) Id was persistent but i guess not
Thank you very much. Is there any way to get "BaseVehicle" using getSqlId()?
i think you'd have to resort to looping through the vehicle list until the matching sqlid
Hmm, how can i get list of all vehicles on the server?
getCell():getVehicles()
I'm going to try it. Thank you
alright, question here because apparently the devs have done this in an incredibly questionable way, is there any way to add (n) ammo via script? that is, (n), not (n*5).
idk why the heck they put base counts on what should have been singular ammo like that instead of calling plurality later
container:AddItems("Base.Whatever", 1)
it makes sense with how the loot system works, but it is unintuitive basically everywhere else
I tried testing this, via ingame commands (unless those are different), but it returns (n*5) ammo 🥲
if that doesn't work you could create it with InventoryItemFactory and then add it to the container
i feel like there was a simple way to do it though
After restarting my local server, all the sqlids got mixed up. It doesn't work. I'll try using keyId tomorrow
that seems crazy, the sqlid is the id it uses in the database
if that isn't persistent then i'd have to say vehicles do not have a persistent id
and you'd have to store your own id in moddata or something
I know. But we have what we have.
A good idea. I'll try it tomorrow
What do you think about using keyId? I don't think they should change
probably not, i don't know whether or not one will be generated if the car spawns without a key though
I spawned cars through the admin interface, all of them had a keyId. But I'm not sure about the cars in the world and about the permanence of this ID. And what is getMechanicalID?
I didn't find any description
keyid must always be generated, otherwise the code i'm looking at would crash
i think mechanical id is the whole sports/utility/whatever the normal one is thing
so it is not unique?
Great, then I'll try to use it, what about unique and persistent?
hmm, no actually
it's literally a random number, but it is not unique
uh
it's loaded by the vehicle load function so it is probably persistent
and i imagine it would cause pretty big issues if it wasn't unique
Sounds reasonable. Thanks for the help. I'm going to get some sleep 
I'm not exactly sure how this would look, my understanding of PZ code and how it works has started only today lol
local item = InventoryItemFactory.CreateItem("Base.Whatever")
container:AddItem(item)
does that bypass inheriting the stupid base count property, so I end up with 1 bullet and not 5
again I really wish I knew why they did this
it should
awesome.
it's convenient because the spawn system would have to be set up to spawn item in multiples instead
i probably wouldn't do it that way myself but i do get it
i don't think the game tends to spawn items outside of the loot system very often
yeah
Does the health panel have to be updated after an injury is dealt to an IsoPlayer object for it to show on the character part of the UI?
Wounds/injuries can be caused via setScratched(), setCut(), etc, but the characters model in the health tab isn't updating
If an injury is caused by the lua console though it updates the health panel??
@sleek hull by any chance are you in debug mode with godmode on? It took me a few hours to figure that out a few weeks ago.
Debug mode yes, godmode is off in the first screenshot though
I can give it a try without debug too maybe?
No I don't think that will make a difference.
Body parts should be updated every ticks
^ my next thought, is the game paused?
function ISHealthPanel:update()
...
self:updateBodyPartList()
is called
Testing on dedicated
Where do you run the code that set a body part
I have it set in a table OnGameStart
I have it roll to see if an injury should occur, if it should it determines the injuryType (scratch, cut, deepWound, or deepShardWound)
Then the would does actually get applied in it's respective function here
OnGameStart is too early to get the player I believe
The player is not yet "connected"
I'm currently working on a total burns mod and I'm using Events.OnNewGame
@sleek hull One way I use to init a mod is using OnTick
local function init()
Events.OnTick.Remove(init)
-- do init code
-- will only run once at the first tick ever
-- now you know the player exist
end
Events.OnTick.Add(init)
Tho caching the player like this local player = getPlayer() will only store the reference of your first local player (not splitscreen friendly), when he/she dies and respawn in a new character that reference will be nil.
im tryying to make a true music mod but when i try to publish it it says "your mod is missing mod.info" even tho its there
@alpine quarry really quickly does this conversation answer your question? #mod_development message
Good point on the player dying, the player object is refreshed in checkCollision though
Im trying to see if maybe it's just an issue with how I'm causing the wound in my doScratch()/doCut() etc functions, because causing an injury immediately from the bodyParts table seems to work and update the ui properly
Oh wait I might also just be dumb, I'm going on a limb here to say that setScratchTime() and the related functions for other wounds determines the visibilty in the health window?
probably, i'm not sure just setting the wound to true is enough for a 'real' wound
actually the wound image fades with the wound time
so if it hasn't been set it's zero so the image will be invisible
Im thiking this exactly
I have it set to an injuryTime of 1 by default and thats what I've been testing with. Im just now realizing that a light wound is like, 7-10
well check inside ISHealthPanel.onCheatCurrentPlayer = function(bodyPart, action, player)
it contains all the examples of injuries and how to set/unset it
no
That is a very useful tip, thank you
Anyone else have a checklist of reasons why mod.info can't be found? I just remembered seeing that conversation yesterday but I'm not sure how else to help.
probably just incorrect file structure
if the file is named correctly then it must be in the wrong place
workshop/modname/
Is the file in "ModNameHere" \ Contents \ mods \ "ModNameHere"?
This was the issue, completely forgot about this. I set the woundTime to 10 instead of one and they're now visible
i forgor to make a modname file in the mods folder
It be like that sometimes
glad it's working now!
Question, is the woundTime for cuts/scratches/deep wounds/fractures measured as in game hours or a real time unit?
it looks like it's a different time unit for every wound
Time unit as in minutes/hours/days, or as in the range of in game hours they can take?
The wiki specifies injury severity/length by in game hours so I figured this would be the case for all of them
as in 10 scratch time and 10 deep wound time are not the same
Odd, guess I'll just have to base my default ranges on what vanilla injuries follow
i'm not really sure how the wiki calculates this, personally i have not experienced injuries healing as fast as it claims
but i also haven't played in a while so my recollection might be faulty
In fairness I've never exactly timed it, it more just happens as a "and I'm removing my bandage and oh the wound is gone" type of scenario
yeah, and i usually play with slow healer so i've probably just accepted that my wounds take forever to heal and it feels much longer than it really is
Hi, I’m new to modding and has watch videos and tutorials online about simple item and recipe mod, however, I am having a hard time writing and learning mod that requires a lot of advance lua. I have coding background, but not understanding where to start for advance lua related to pz, anyone know where should I start? (I was reading codes for RV interior and even I have a rough understanding what’s going on, I have no idea where are all the code coming from, any pz code documentation?) thanks🫡
most of the documentation is here https://projectzomboid.com/modding/
you can get intellisense with this project https://github.com/asledgehammer/Umbrella
Thanks! 🫡
OMG this looks very promising. Greatly appreciated
I keep getting an error and I have no idea why. I have been trying to work around it for a while. I can more provide code if needed. The error is Exception thrown java.lang.RuntimeException: __add not defined for operands in init at KahluaUtil.fail line:82. I'm trying to do local player = getSpecificPlayer(0) player:getTraits():add("Trait") in my .init function and it just does not like it. It has worked in my other files' functions. Any help would be appreciated 
add : before add
Sorry, I have that in my code, I just didn't copy paste it directly, I was trying to shorten it and made a mistake.
we can't help u with code error if u send not actual code
BipolarCore = {}
BipolarCore.init= function ()
local player = getSpecificPlayer(0)
if not player or not player:HasTrait("Bipolar") then
return
end
local positives = {
"BipolarMania",
"NeedsLessSleep",
}
local negatives = {
"BipolarDepression",
"NeedsMoreSleep",
}
local isBipolarEffect = player:HasTrait("BipolarDepression") or player:HasTrait("BipolarMania")
local isInDepression = player:HasTrait("BipolarDepression")
local isInMania = player:HasTrait("BipolarMania")
local starting_chance = player:HasTrait("BipolarDepression") and 80 or player:HasTrait("BipolarMania") and 80 or 60
local chance_of_Bipolar = starting_chance + 0
local roll = ZombRand(100) + 1
local BipolarEffect = roll <= chance_of_Bipolar
if BipolarEffect and not player:HasTrait("BipolarDepression") or player:HasTrait ("BipolarMania") then
player:getTraits():add("BipolarDepression")
player:getTraits():add("NeedsMoreSleep")
else
player:getTraits():remove("BipolarMania")
player:getTraits():remove("NeedsLessSleep")
player:getTraits():remove("BipolarDepression")
player:getTraits():remove("NeedsMoreSleep")
end
local starting_chance = player:HasTrait("BipolarDepression") and 45 or player:HasTrait("BipolarMania") and 45
local chance_of_Moodswing = starting_chance + 0
local roll = ZombRand(100) + 1
local BipolarMoodswing = roll <= chance_of_Moodswing
if BipolarMoodswing then
print('isInDepression: '..tostring(isInDepression))
print('isInMania: '..tostring(isInMania))
ApplyPositiveOrNegativeTraitsGivenACondition(isInDepression, positives, negatives)
player:Say(player:HasTrait("BipolarDepression") and "I feel terrible" or player:HasTrait("BipolarMania") and "I feel Unstoppable" or not player:HasTrait("BipolarDepression") or player:HasTrait("BipolarDepression") and "I feel fine")
end
end
ProfessionFramework.addTrait('Bipolar', {
name = "UI_trait_Bipolar",
description = "UI_trait_Bipolardesc",
icon = "trait_Bipolar",
cost = -7,
exclude = {
"NeedsLessSleep",
"NeedsMoreSleep",
},
OnNewGame = function(player, square, profession)
BipolarCore.init()
end,
OnGameStart = function(trait)
-- add a new event to trigger every day
Events.EveryDays.Add(function()
BipolarCore.init()
end)
end
})
ProfessionFramework.addTrait('BipolarMania', {
name = "UI_trait_BipolarMania",
description = "UI_trait_BipolarManiadesc",
icon = "trait_BipolarMania",
cost = 0,
profession = true,
exclude = {
},
})
ProfessionFramework.addTrait('BipolarDepression', {
name = "UI_trait_BipolarDepression",
description = "UI_trait_BipolarDepressiondesc",
icon = "trait_BipolarDepression",
cost = 0,
profession = true,
exclude = {
},
})```
I just didn't want to post a massive wall of spaghetti code 
I'm looking at some existing (functional) code
local trait = TraitFactory.getTrait("Carrier")
local ccp = MainScreen.instance.charCreationProfession
local olditem = ccp.listboxTraitSelected:removeItem(label)
I've determined removeItem() is not lua, but is accessed from java? I'm not really sure how to describe what removeItem() is... ANYWAY, I'm trying to add another line before the trait is removed so I can determine if the trait was in a specific list
local trait_is_purchased = ccp.listboxTraitSelected:hasItem(label)
But this always spits back the following error: Object tried to call nil in setSandboxVars. **Does PZ not expose hasItem() the same way it exposes removeItem()? Or am I just doing something super wrong?
**
is it the { after the exclude at the bottom maybe?
exclude = {
},
--same as
exclude = {},
it's lua, u can no thing about tabulation at all
u can even do
ProfessionFramework.addTrait(
'BipolarDepression',
{
name
= "UI_trait_BipolarDepression",
description =
"UI_trait_BipolarDepressiondesc"
,
icon = "trait_BipolarDepression",
cost = 0
,
profession = true,
exclude =
{}
,
})
and it will be valid
this is full code? error on 82 line but in code only 82 lines
yeah I know I'm a bit tired might of misread it
I actually deleted some lines to condense things to send here. Line 82 is actually ProfessionFramework.addTrait('BipolarDepression', {
I just deleted blank space lines
I added the spaces back in if it's less confusing
I don't know. I know I'm a very inexperienced coder and I don't know what I'm doing, but my other lua files work with the same sorta format and this one doesn't. I don't know where the __add error is coming from
problem not with player:getTraits():add(...)
cos error says __add but not just add
__add is meta method for sum
like x + y
so here is x is metatable then this one must have __add meta method
smth goes wrong when u adding new traits
Okay, thank you, I'll try to add the traits without ProfessionFramework like normal. That might fix it. ProfessionFramework has caused a few problems for me but I'm using it for a some other reasons.
I could be WAY off, but https://github.com/demiurgeQuantified/PZEventStubs/blob/main/Events.lua lists the Event.EveryDays structure as follows:
---Fires at 0:00 every in-game day.
Events.EveryDays = {
---@param func function
Add = function(func) end,
---@param func function
Remove = function(func) end,
}
and you appear to be doing
BipolarCore.init()
end)```
Can anyone determine if both are valid?
are u sure u using new version of profession framework?
there's two versions on workshop
old and new
I'm not sure, someone else technically did that bit. I'm working on someone else's mod with their permission.
Yes, I have the new one
first one is just a documentation so not actual valid code
second one is valid
Is it possible to save all yhe fence locations in the vanilla world
Then use that data for 10yrs later to revive all the fence
Sounds like its painful to code
If you can do this we might send you the project(commission)
For more info contact us
sounds like creating of table with all existed fence textures 
but not sure, mb there's some function to determinate that some object is actual fence
Nah just check the sprite
And you have to note which way its facing too otherwise you will construct it the wrong way
yea, Ik each object have different texture with different name depends on place direction
I can't figure out why it isn't recognizing the two traits, whether I add them with TraitFactory or ProfessionFramework. I'll keep trying to solve it. I appreciate your help, but I'm confused why the game isn't recognizing the traits while it recognizes my other ones. 
is it possible to edit vehicle stats like max speed, acceleration or fuel consumption on runtime?
Hey :) maybe it's can help https://steamcommunity.com/sharedfiles/filedetails/?id=2721945297&searchtext=Driving+skill
Thank you
Wym revive exactly?
Like put it back
10yr later removes the fences?
Yes
Ive spoken with dane and he gave permission
Pao will do the project eventually
then instead of reviving maybe patch the part of the mod that removes them so that it doesnt remove them anymore?
Its a map mod
Good morning.
Hello there, When I kill my local character with myPlayer:Kill(nil), I have (half the times) following errors ```attempted index: isAnyVisible of non-table: null
LOG : General , 1686752545194> 77?156?899> -----------------------------------------
STACK TRACE
function: updateTooltip -- file: ISInventoryPane.lua line # 833 | Vanilla
function: update -- file: ISInventoryPane.lua line # 1668 | Vanilla
ERROR: General , 1686752545195> 77?156?900> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: isAnyVisible of non-table: null at KahluaThread.tableget line:1689.
Do you have any idea how I should prevent the inventory panel to update while the player is not available ?
the OnPlayerDeath event should do that 🤔
Half-baked generic handling of all 2 items recipes via drag and drop (reload is custom handler, which is why the mag makes it back to its original spot)
Getting the result items back to their original spot is a bit more challanging than I thought it would be without duplicating a bunch of code.
The recipe action also only accepts a single item as input, so if you have 2 batteries and 2 flashlights, I can't guarentee what battery is going in what flashlight...
Not possible through the items id to somehow track what item goes in what item?
Very good addition QoL
i enjoy this mod but i didnt add it cause my friend didnt like it
due to no double click to transfer
There, was on my mind already anyways
small bump to a question I asked last night #mod_development message. Does anyone know if we have access to hasItem()?
if it's ui it's lua, so they wouldn't really have any way of stopping you
Yea taking a look, the listbox is lua
Its derived from an ISScrollingListBox. Created inside of CharacterCreationProfession.lua
No has item function in ISScrollingListBox
😦 In the future how can I determine what functions are available to what objects?
🙇♂️ thanks!
Thank you! I think I have what I need now.
I didn't realize the installed game was THIS exposed...
only lua yeah, for the java side you would need to decompile to have more info on the internal functioning of the game. On the other hand you can also use Umbrella to get full intellisense of what is available in both lua and java. pzstudio offer a structure for making your mods and includes umbrella by default.
I'm using umbrella! I just don't have much experience with intellisense so I don't naturally think to rely on it. I come from a background of QA and I'm trying to integrate with this community to get my dev chops up to speed. 🙂
Lets just say I have several gaps in my development sense that I'm trying to correct
Sorry what does QA mean ?
quality assurance
oh
test planning, bug tracking, documentation, etc
So you have Umbrella installed into your project with VSCode right?
Then if you have the lua extention for vscode installed it should load the intellisense automatically.
yes. it's all there. my brain just doesn't see the suggestions 😦
Then when you start typing a filtered list will appear
ah great you are set
the thing at the end of the line is the return type, so you know what that method or property returns.
oh wonderful!
When you do getPlayer(): you would get all the method available to the IsoPlayer object.
Including all methods available to parent classes of IsoPlayer such as IsoLivingCharacter etc
It will also suggest to you what type of parameter can go into the method call. Which is time saver.
Anyway if you have any questions about any of this just ask 🙂
will do! Thank you!
I'm noticing more people are using Umbrella which is a very good thing.
Quick question: I'm seeing three events listed for similar things: OnZombieDead, OnPlayerDeath, and OnCharacterDeath. The first two are pretty obvious, but I'm not sure that I'm reading the API correctly in terms of what a "Character" is in this context. I'm presuming that technically a "Character" is Class IsoGameCharacter and technically is a parent class to both Players and Zombies? Would this event first when either die?
yes, it fires in either case
iirc OnCharacterDeath will fire for players who aren't local players, whereas onplayerdeath won't
Hm. The references I need for this always feel overwhelmingly exhaustive and incomplete at the same time every time I try to dip back into this.
In this context, a local player is the player (or I suppose players, in split-screen co-op?) who is playing in the specific client, not another connected player in a multipler session?
yeah
this is the event reference i maintain https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md , as far as i know it is the only up to date event reference and it tries to specify things like that
Okay. I shouldn't need to worry about the distinction much, just yet.
Yeah I've been trying to peruse things like that. I'm having a hard time finding all the events that I would expect to find so I guess I have to start looking at some of the classes themselves to see what is going on.
Some things I was considering for a mod that I'm looking into are when a hit is made on a zombie, determining if the hit was made from a gun and if the hit was a crit, and hooking into when a gun is repaired, which I'm still picking apart how to find the repair functions.
this has every single event listed with parameters and at least basic descriptions, it tries to specify whether things fire in singleplayer/multiplayer, if they're client/server only, but that information i don't guarantee 100% since it's difficult to determine just from code and testing would be an insane undertaking
https://projectzomboid.com/modding/ is fantastically dense.
package index
it's more helpful when you have more of an overview of how the game works
Hmm. Is it even possible to hook into when an item is repaired?
i think you can just hook into ISFixAction
My understanding was that hooks replace the vanilla code instead of running with them. Is that correct?
that's not quite hooking
we save the vanilla code into a variable and call that alongside our replaced code
effectively just adding our code to the vanilla function
the general structure is like this:```lua
local old_func = vanillaFunction -- reference to the function, don't include the () or you'll just call it instead
function vanillaFunction(...)
-- code to run before the original
old_func(...)
-- code to run after the original
end
Lord above that makes so much more sense.
I'm still figuring my way around all the game's internal Lua but once I finally find the right file for what I'm hooking into, things start making more sense.
Thank you so much, this explains a lot. https://github.com/demiurgeQuantified/PZ-events-guide/blob/main/Hooks.md was throwing me for a loop.
ohh, right, the game's hooks are a different thing
if i'm being honest, you can just forget about them entirely
the way they're designed really heavily limits their usefulness, and there's so few of them they lose most of the remaining usefulness they would have had
while i was writing that guide i went from 'cool thing nobody knows about! i better document it' to 'what are these even FOR'
hahaha
Is it possible to access the player's java\core\skinnedmodel\advancedanimation\AnimatedModel.java ?
the class isn't exposed
Ah goddamit 😦
In terms of adding code to ISFixAction, since it has different functions such as ISFixAction:new, ISFixAction:perform, etc; would it be saving and replacing :perform?
local OriginalFixAction = ISFixAction:perform
function ISFixAction:perform(...)
OriginalFixAction(...)
self.character:Say(self.item.mainCategory)
end
probably! perform is usually the 'successful completion' function
Okay then. Hopefully this should all work smoothly. Thank you!
How can I unset IsSeeEveryone flag on an admin ?
from my reading, on their client call getDebugOptions():setBoolean("Cheat.Player.SeeEveryone", false)
Hello again everyone, today I have a question regarding IsoPlayer:load(<fileName>)
https://projectzomboid.com/modding/zombie/characters/IsoPlayer.html#load(java.lang.String)
How can I check if the file exists?
I tried making a call to a non-existing file but it doesn't throw an error nor does it return a value from what I can see to create a handler.
i don't really know if these functions search from the same filepath but fileExists()
Thanks, I can test it real quick!
Hey yall
I dont make mods very often but I need a little assistance with a quick and dirty project im working on
I moved up from ethanwdp's cheat menu to Cheat Menu PX
but PX lacks the Infinite Carryweight item, which I like to use to make the storage capacity of my base containers not a problem
so i decided to make a quick item thats essentially the same thing to just spawn in, only it's not showing up in the item spawn menu, and I was wondering if anyone knew how it worked
any problems here?
i used zomboids empty tin can as a base item and edited relevant values, as i didnt feel like writing it from scratch.
you need a module
{
item InfiniteCarryweight
{
...
}
}
ahhhhhh
let me add that in and test it again
the module name can be named anything yeah?
yeah, preferably something that represents your mod
don't forget the } to close the module
just at the end
at the very end of the file, on a new line
okay, so after the last bracket for the item
right!
looks good to me!
alright! i appreciate it
thanks for bein patient too
i would upload it to workshop but, effort. if you want it i dont mind yall taking it
maybe you could do a cleaner implementation than i can lol
i'm not sure how i'd do it, but i've been told that negative weights will no longer work in b42
;O;
and its still not showing up in Cheat Menu PXs item spawner >:/
the item spawner does have other modded items, so i know its not that
hmmmmmmm
i cant access PX's files so i cant see how it does things
Confirmed, filesExists() uses the full path
nice!
is there a getter for the cache directory? otherwise seems a little impractical for most other uses
good question ¯_(ツ)_/¯
working blind here without documentation and a ton of trial-error
i'll come back to this at some point 
Til then, as I said, anyone has full permission to mess with it more
just let me know if you have any new developments
Hello! Is there some way to put breakpoints in lua code, for debugging in the built-in debugger (F11) ?
open your file in the debugger and double click the line
Is this the only way? Maybe there is some magic word that can be inserted into the code on which the debugger would stop?
i think you could use error("") like that
Thanks! I will try
I feel like asking this again in the daylight hours, does anyone know how to, through script, add, say, 7 ammo to an inventory? That is to say, bypassing ammo's usual multiple of 5 to put a literal direct number of bullets into an inventory.
I haven't been able to make any given or found examples function .-.
Can you show your code fragment please?
local zombieinv = zombiedropitem:getInventory()
local ran = ZombRand(100)
local ran2 = ZombRand(43)
local item = InventoryItemFactory.CreateItem("Base.Bullets9mm")
if ran < 100 then
if ran2 < 3 then
item = InventoryItemFactory.CreateItem("Base.Bullets9mm")
end
if ran2 >= 3 and ran2 < 6 then
item = InventoryItemFactory.CreateItem("Base.Bullets45")
end
if ran2 >= 6 and ran2 < 9 then
item = InventoryItemFactory.CreateItem("Base.Bullets44")
end
if ran2 >= 9 and ran2 < 12 then
item = InventoryItemFactory.CreateItem("Base.Bullets38")
end
if ran2 >= 12 and ran2 < 15 then
item = InventoryItemFactory.CreateItem("Base.ShotgunShells")
end
if ran2 >= 15 and ran2 < 18 then
item = InventoryItemFactory.CreateItem("Base.223Bullets")
end
if ran2 >= 18 and ran2 < 21 then
item = InventoryItemFactory.CreateItem("Base.308Bullets")
end
if ran2 >= 21 and ran2 < 24 then
item = InventoryItemFactory.CreateItem("Base.556Bullets")
end
if ran2 == 24 then
item = InventoryItemFactory.CreateItem("Base.Bullets22")
end
[ . . .] etc
local lCount = 0
local tCount = (ZombRand(5))
while (lCount <= tCount)
zombiedropitem:getInventory():AddItem(item)
lCount++
end
end
end
Events.OnZombieDead.Add(dropammo)```
it doesn't throw errors on execution, it just doesn't function as expected. I actually wish it did throw errors, the script debugger is the best I've ever seen.
:AddItem() arg must be string as i know
pl:getInventory():AddItems("Base.ShotgunShells", 5)
like this
according to the doc it also takes InventoryItem
it can be an item yeah
as far as I can see InventoryItemFactory.CreateItem("Base.Bullets9mm") should create an InventoryItem instance of Base.Bullets9mm, which should be able to be passed to inv:AddItem
Yes, it looks like it should work
when you say it doesn't function as expected, can you say what should happen and what is happening?
what should happen is that something should be added to the inventory. what is happening, is nothing at all
throws no errors, but also does not function
you can see your file in the debugger? it's definitely running?
that's what I'm about to sanity check, as I realize. but it was throwing errors at me earlier on execution that I fixed, so I can only assume it still is firing
you can add print somewhere in function to make sure it's running
alright well the script is absolute not running. but why
I have a theory: ZombRand(100) will never return 100, but only 99. Therefore, the code in condition ran < 100 will not execute. Well, or it's just a very small chance. Random is random
ugggghhhhh 
I found my error.
>>>>>Do
zombiedropitem:getInventory():AddItem(item)
lCount++
end```
failing to put the 'Do' there causes it to fail silently without throwing an error. 🤡
rather it causes the script to just never execute, silently.
lua...
explicit 'do's kill me
it's not like there's a competing while-don't loop :o)
anyways thank y'all for the rubber duckying, it does function normally now
does anyone know to to stop spawning zombies with bandages, I know it's from erosion but is there a way to disable the bandages while keeping erosion on for everything else?
hold up it's not from erosion I read it wrong
they just spawn with them, anyone know how to change that?
they are actually referenced in the scripts
They are, but do they have some hidden use
no, i think they were just made because they could
it's unnecessary, but it is actually a little convenient for modders since we can hook the empty functions for mod compatibility instead of assigning functions to those things and inevitably being incompatible with every other mod that does that
i feel like that probably wasn't their intention with it though
I am trying to figure out why can't I make the headlight on my MTB work! It only works when you leave the game and reload at least once, after the bicycle is spawned
And I am using the same code TIS has for their headlights
Except i'ts not hardcoded
i actually need to do something like that soon, i was hoping it'd be easy
The part is there and all it's just the light itself won't work until after a reload
I was like "Oh, silly me. I just had to update it like the game does hahah... oh man it doesn't do anything basically. Oh god. OH GOD"
So yeah guess uhh. Can't make it work period.
I am gonna send prints cause I hate discord's formatting
They call this function to create the part, and the light. So far so good.
If I do the same, the part is created yes, but light doesn't work
So I figure, let's check the init function that's also called immediately after. It's empty.
Lastly we got update, was hoping that'd solve it...



