#mod_development
1 messages · Page 196 of 1
zombies dont save theirs unless they're flagged as a former player
Man you guys rock! I wish I came here ealier!
👍
To be honest, I've haven't tried yet to set myself up to have access to uncompiled PZ code, so I've been coding blind for now. Still not sure what's the best/easiest way to do that.
I would recommend one of the two annotators
CAPSID is older, but I haven't really worked up the courage to switch over to... umbrella?
Naming the tools after items in game is really nice design - but man I can't remember what each does at all
umbrella won't help you decompile, the annotator is open source but it's distributed as the generated annotations
ah
umbrella is basically the output of a few connected annotator projects
for decompiling i recommend https://github.com/quarantin/beautiful-java , it's a lot less messy to set up than capsid
does it address class inheritances? capsid has that issue
oh, and it doesn't show you unexposed stuff
capsid generally doesn't
is umbrella automated entirely?
in terms of updating releases?
ah yeah co`'s stuff is solid
Hellooo
no, it's something i'd like to see but at the moment it's not too actively developed
Jab is the dev right?
for candle, the java annotator, yeah
omar wrote the lua annotator and i wrote the events annotator
Quick question 
How can I trigger an event exactly at the middle of a timed action ? In other words how can I fetch the current progress or time of a timed action ?
yall are awesome
If you check IsBaseTimedAction there's a function for it
Thankss
(I think it's update()?)
Thanks guys, will look into all that. I'm really bad with setting up setups like that.
Understandable, but honestly - it's like night and day
I bet!
Uh if you mean TimedAction:update() isn't it just what's going to be triggered in every tick while the action is being done ?
Yes, and you can grab the delta, to clarify
In my day job I work with Unreal 5 and have direct access to code. But I never has to set anything crazy to make it possible. 😄
Oh I think I can just set a timer at the beginning and increase it in each update
Thank you, it will be helpful
😘
Quick update:
Yeah, I can now persist MoData on the player when doing the save with OnPlayerUpdate.
I was testing with the rest of the code draft before so I guess something else was preventing it to work.
Thank you some much guys!
So I guess doing something like this stores the current instances of the objects and won't persist, right?
Can I retrieve the new session objects through their IDs?
for i,v in ipairs(getPlayerLoot(playerNum).inventoryPane.inventoryPage.backpacks) do if v.inventory:getType() == "SmallBatteryCharger" then local chargerIso = v.inventory:getParent() if v.inventory:getItems():size() > 0 then player:getModData().BatteryChargers[chargerIso] = v.inventory end end end
In situations other than when you’re actively fighting the game to implement it like hardcoded male/female values grrrr, is lua modding really that restrictive? Would it be possible to, for instance, implement moving creatures using lua alone? I’m inclined to say it is, but I’m not sure
yes but you can't render characters from lua specifically in multiplayer
if you saw that dog mod that was popular for a while, that's why it didn't support multiplayer
Ooooooh
That’s weird. Wait, why wouldn’t that be possible? Can’t mod data be shared between client and server easily?
It would be a hassle, but couldn’t you just sync something like the dogs yourself?
you just can't render their models in the first place
i don't know the exact reason behind it
the dog mod probably used LuaMovers, which are the ideal class for this kind of thing, but most npc mods just create player objects, which also don't render in multiplayer for whatever reason (except when they're real players)
I really hope the domestic animals they release in 42 are mostly implemented in lua, or come with functions necessary to render non-player and non-zombie entities in multiplayer
i've always imagined that will happen anyway, it seems like they would have to outright try to stop us at that point
It would suck if they were just implemented completely in java and entirely closed off from most modders
for sure, it feels very out of line with their typical design though so i'm sure that won't happen
the flexibility of the new systems could go either way but i'm sure lua will be able to interact with it to a decent degree
and from what i've seen the newer systems have tended to be much much more lua oriented
(/better written)
I am kind of concerned because they already said they didn’t want to release partially unfinished survivor code, because they didn’t want the modding community to do ridiculously cool stuff with it before they’re even able to finish it themselves
I am worried the same thing kind of applies to animals, because even the most basic ability to have multiplayer-compatible creatures could open up an absurd degree of modding capability. And since the domestic animals are kind of the “unfinished”/prototype version of the animal system, it’s the same kind of situation
they did seem to suggest that the animals would have modding support, and that was why they were leaving out some of the more intelligent parts of the ai they've developed until 43
oooh, so that implies they’re trying to get the modding tools out as fast as possible, before they get wild with it themselves? that would be awesome
ah sorry i missed a word there, it was meant to be leaving out
they don't want people to use their own technology to steal the npc steam, so the b42 animals will essentially be a lobotomised version of the ai they've been working on
there are many hot takes about this I could espouse but out of respect for it being the official server I won’t say anything
Well, I meant other than the fact that it is really understandable. I can’t imagine how disheartening it is to have game dev plans and then have some hyper focused modder do everything in a couple hours before you even formulate it
i mean, they've been working on it for nearly a decade, it's the most common suggestion and the most common complaint, and their release will likely be pz's biggest moment in the spotlight - but if npcs nearly as good using the technology they developed for it have already been modded in it won't really mean much
Yeah
btw sorry to interrupt, people please answer this person I also don’t know anything about per player mod data and am curious
what is project zomboid moddata
Hi! I'm trying to develop a sneak overhaul mod but I can't seem to find the files related for sneaking anywhere. Does anyone know anything about it?
🎉 you got the daily double 🎉
Okay, this isn’t so much about my own development because this is well outside of my scope, but would anyone be willing to try and update this to include the newer magazine types that have been added to Brita’s since this was last updated?
https://steamcommunity.com/sharedfiles/filedetails/?id=2887315718
help 
Nope, if something's changing in the files ya gotta reload for it to take effect
You can probably find the file path if you start the game, only press the crouch key a bunch, and close the game. Then you should be able to check the game logs for the related file.
Thanks I will try that
@bronze yoke @sour island Based on your recommendations, I gave up on the idea of storing a list of all battery chargers on the player, and went back to the simpler approach I had initially: Only updating batteries charge when the player interacts (or is near) a battery charger container.
I doesn't take in account time periods where a a running generator stops working, but I guess it's good enough for a first version of the feature.
Do you guys sometime do code reviews here? I'd be curious to see if some things could be done better, or optimised.
If you use GitHub you can link it here.
Ok sounds good! I got to get that setup again. I used to have all my code there a while ago, back when I was modding for 7 days to die.
Nice, it's useful for any type of project tbh
What does 7days modding look like? Scripting as well?
think it's on a strict 7-day limit
Can I do a POST using openURL?
Probably not, as Zomboid's Kahlua won't allow you to touch the interfaces
I made a short code but not sure why this isn't working. Could anyone help me out? "
if player:getInventory():getItemCount("Base.Money") >= 50 then
UI["b1"]:setColor(1, 0.5, 0.5, 0.5)
else
UI["b1"]:setColor(1, 1, 1, 1)
end"
I haven't done it for a while, so it may have changed since. Adding new items, recipes, sounds was super easy, all done through XMLs. But if you needed to add new game functionnality you had to overwrite the vanilla C# base code (game uses Unity Engine) which was not ideal. There was a special mod launcher made by modders to manage those type of mods, and package all the base code modifications of the mods you have active together, to modify vanilla code in one compile.
If you know the game a bit, this is the kind of mods I was doing back when the only vehicle available was the mini motorcycle: https://www.youtube.com/@manu_x3299/videos
None of that is working anymore, it was for A16 version.
We can print an image in the user screen smh?
You can draw a texture but you need to do it per frame
If that's what you mean
I want to draw an image in the cheater screen if something gets detected
I'm not just drawing a black color in their screens
Works well but that's not my idea
can anyone help me with procedural distribution? i just need an item to spawn in one location then i can do the rest
this is what i have but it doesnt seem to work
require 'Items/ProceduralDistributions'
table.insert(ProceduralDistributions["list"]["ArmyStorageMedical"].items, "Base.HungryMane");
table.insert(ProceduralDistributions["list"]["ArmyStorageMedical"].items, 10);
Textures can be pngs
DrawRect is a shape
Both have to be drawn every frame
There must be something I'm missing about tiles
I have no idea how I can detect what I'm clicking on when creating a context menu
Soon, my evil will spread to the Steam Workshop…
The only thing scarier than the zombies… THE VAGUE IMPLICATION OF NON-CIS PEOPLE EXISTING!!! And CHARACTER CUSTOMIZATION OPTIONS! OH NO! ||/s||
Was that option gender or sex ?
Should I use TextureDraw?
Will try, thanks for the info
making some character model (“male” or “female”) locked options non-locked, such as beards, and making the “male” and “female” options “masculine” and “feminine” for more accuracy (they’re literally just player model choice)
Understood. I don't have any comments on that topic.
Though I don't think you can implement that without editing each beard model for feminine(?) playermodel since female and male playermodels are not the same and they are originally made for male playermodel
Indeed
I have already implemented workarounds to the programming side of it but the actual models need to be edited
Hoping to figure out the addition of an androgynous player model too, but that’s a long way off
Actually, you can pretty easily enable beards on female models
They get auto removed on model update - so you'd just need to snap it back on for specific events
I don't recall seeing if beard growth is kept to male characters though
Oh discord did that thing where it doesn't update messages
okay well i got my item to finally appear in the lootzed but it has a -1406 chance of spawning lol, hows that possible?
well i fixed that, but when i refill a container to see if my item can spawn, it doesnt. it shows up in the lootzed so shouldnt it be able to spawn?
Good advice, I’ve already got it working in character creation but again it’s just broken because it’s built for the masculine model
I hate to interject on an ongoing conversation but I have a five second question
are Mod ID's the same as Workshop ID's?
(setting up a dedicated server for context and pzidgrabber.com is down or not working)
I believe the Mod ID is defined in the mod.info file and the workshop id is a unique set of numbers given to a file when it’s uploaded to the workshop, so they should be different, I believe
😭
Will entering the Workshop ID's autofill the mod ID's like when hosting non dedicated?
well actually I think I can grab them albeit tediuously by making a server settings and adding the workshop items
thanks to all
When you add a mod via the workshop setting the mod id should also show up in the mod page
keep in mind one workshop item can contain multiple mods, and you may not want to use all of them/they might be outright incompatible
That is true, it was moreso a matter of helping to find them in the first place.
should i continue my 1985 ford LTD model to then figure out how to mod it into zomboid
is there any way to make a drink multi drinkable - more than one use that is
Hello
guys any idea why this msg spam in console every minut ?
WARN : General , 1694554171438> 646 404 731> AnimationPlayer.play> Anim Clip not found: InvalidOnPurpose
WARN : General , 1694554171540> 646 404 832> AnimationPlayer.play> Anim Clip not found: InvalidOnPurpose
LOG : General , 1694554171554> 646 404 847> receiveObjectModData: index=-1 is invalid x,y,z=10713,10149,0
LOG : General , 1694554174919> 646 408 212> receiveObjectModData: index=-1 is invalid x,y,z=8156,11656,0
WARN : General , 1694554175942> 646 409 234> AnimationPlayer.play> Anim Clip not found: InvalidOnPurpose
WARN : General , 1694554176035> 646 409 327> AnimationPlayer.play> Anim Clip not found: InvalidOnPurpose
LOG : General , 1694554176262> 646 409 555> receiveObjectModData: index=-1 is invalid x,y,z=14064,5202,0
LOG : General , 1694554176548> 646 409 841> receiveObjectModData: index=-1 is invalid x,y,z=10592,9166,0
Hey guys im making my first firearms mod and ive got everything correct and working exept the gun is invisible in the player models hand and ive checked all my scripts it all checks out so if anyone has any advice that would be great.
Because you use one of my mods 🙂
@mellow frigate what do you mean ? more details please 🍻
Infected Player mod is using tricks to use Zombies animations instead of Players ones. But there are visual artifacts I achieved to remove by calling invalid animations. I called those animations InvalidOnPurpose for users not to be afraid. they have no bad consequences.
can I fix that as I have a problem with my bot's. File getting to big and bot freaking out
I do not know any way to remove those warnings. Else I would have done it in the mod. So you'll have to restart more often your server or remove Infected Player
not good not good but thx for info
lol
Yo im making a gun mod and the gun model is not showing up can anyone help?
Would anyone here have any experience with editing Advanced Trajectories / adding new weapons for it?
I'm having an issue where a custom weapon's projectile pierces through an unlimited amount of zombies in AT, despite the gun being set to no piercing in vanilla (It doesn't pierce in vanilla)
I've tried all sorts of changes, there even seems to be a value for piercing in AT, which i've tried both on true and false, and that doesn't work either.
Perhaps anyone has an idea here?
Nevermind! User error here.
Think it's possible for Endurance to drop into the negatives, similar to how the nutrition stats work?
rather, allow Endurance to drop into the negatives by stopping whatever is making negative endurance reset to 0
is there a way to call a function when having finished reading a magazine
i would of asumed that OnEat would of worked as i thought it does but apparently wont do it for me
DisplayName = Razzy's Knowledge Bundle 1,
Weight = 0.5,
Type = Literature,
StressChange = -5,
BoredomChange = -20,
UnhappyChange = -12,
UseWhileEquipped = true,
CustomContextMenu = Read,
OnEat = RazzyBooks_Book1,
WorldStaticModel = PopBottleWorld,
UseSelf = false,
Icon = MyIcon, }```
hello, i finally got a specific item to spawn in loot but cant get multiple specific items. what are the basic lines of code to achieve that?
sorry to bother but can anyone help with that?
Why would you eat a magazine? You could hook to ISRead action when it finishes.
All drinks can be drunk multiple times, just stop drinking.
Does anyone know how to get the containers the player is within distance of and can see the items inside?
If someone knows plz @ me, thanks.
All it does is check that the player did something and run a function, would of assumed it would have worked either way
I'll try IsRead
hey im new to modding i would like to know how to do ambience mods, if anyone knows drop some tips or tricks
Check the lua code of "Smokin' Joe's Coolers" mod. I don't know if it's the most optimal way to do it, but that's what I used as a reference for something I'm making that also needed that.
Thanks, Manu. I actually found a global lua function called getPlayerLoot that returns all of the containers within reach under the children property. I'll look at Smokin Joe's Cooler mod to see how it compares, though.
Yeah that's what that mod uses too.
lol damn and it took a bit of digging into to the code to find it. Oh well, now I know where to look for all the global lua functions in the future.
He does it OnPlayerUpdate, and that's the part I'm not sure is optimal. But there doesn't seem to be better events to attach to.
That gives you the player's loot UI.
In the mod I'm making, I'll be calling it from OnFillInventoryObjectContextMenu because that's when I'll be needing it. You can call it any time you need, just check for nil or whatever in case there's no surrounding containers.
Technically, there should always be 1 container, and that's the floor
I thought I tried the that event but was not triggering when or what I needed, can't remember.
I currently do it with something like this:
for i,v in ipairs(getPlayerLoot(playerNum).inventoryPane.inventoryPage.backpacks) do if v.inventory:getType() == "SmallBatteryCharger" then -- Then dig inside the items... end end
And yes if there is no containers around, you still always have the floor.
It detects any tile or item containers like backpacks.
Thanks for that code, now I know an easy way to get backpack items on the player. That works for any container that can be equipped or just ones that can be equipped on back?
From what I remember it only gets nearby containers of tiles or item containers on the floor (or maybe in tile containers too), but it does not get the ones that are currently on you.
In the mode I refered earlier, he also has a variant of that to check the containers that are on the player. I don't remember the call he uses.
simple mod idea: ability to change duffle bag colours
I have a rough mod that I wrote that uses the crafting to generate a new duffle bag upon crafting
HOWEVER
crafting a dufflebag into a new dufflebag deletes the contained items
{
recipe Change to Random Colour
{
Bag_DuffelBagTINT,
CanBeDoneFromFloor:true,
Result:Bag_DuffelBagTINT,
Time:1.0,
}
}```
this is literally just a crafting txt file
but.... it "kinda works" as it crates a new duffle bag with a different colour
just as mentioned, it deleted all contained items within it.... thats the problem
need to find a way to retain the items in the container, or have some user interface/colour picker to choose what colour to change the duffle bag into
so if I were to release this "mod" it may cause collateral damage since it deletes items from the duffle bag, please help!
(I will post a video on what this looks like later/soon/right now/im recording)
you could either use an OnTest function that checks that the bag is empty before letting you craft, or an OnCreate function that moves the items into the new bag
I am a 3d artist, not a programmer. so I am not totally sure how to do that/works, sorry!
only got this "working" from deconstructing how a crafting recipe works
this seems like a viable solution
since its doing a check, which will remedy this "issue" of it deleting items
You need a OnCreate function that iterates over the inventory of the bag and and adds it to the inventory of your new duffelbag
might be simpler to just work out how to change the colour of the existing bag honestly
I have tried with an alternative texture
no success with that for now, since I need to have a function to be able to access additional textures
yeah so its just a simple recipe mod to "change" the colour of the duffel bag
but as you can see, it deletes the items
this is most likely NOT the optimal way to make a colour/TINT mod for duffel bags
the purpose of this mod is to remedy the black backpacks being nearly invisible, and to have a nice way to sort stuff since you can colour code the duffel bags (without the use of backpack borders)
yeah this can likely be done with what the current EDIT with debug does
this feature is supported with debug mode, if we could bring this into a mod that would be the best solution
but I dont know how to program or create UI elements, buttons or functions 
how does this relate to what I am seeking assistance for?
makeup ui was a pain in the ass
does this mod contain some way to modify an items colour?
im sorry, who asked?
I subscribed to your mod to deconstruct it looking for any functions that were related to assist me, but there was nothing
just a self advert huh?
yeah nah
you could probably look into transemog mod it think it has what your looking for
it changes colthing items colors and textures
or the cosmatic look at least
the extra e sry
🤣
thanks, I will study this for now

shiiit, this looks like exactly what Im looking for, thanks for now
I will try to figure out if this is a viable solution
k
probably learn how to by deconstructing additional occupations and traits mod
since these are just extra additions and integers within the files
tinkering with names and numbers that give you extra stats are each to their own "occupation"
i am not that smart ill try it again 🥔 (tho i failed once)
almost crashed my game
TY 🙂
Guys,is there a way to parent a part to another via script?
like a window to a door?
Could someone walk me through why multiplayer-compatible moving creatures/npcs aren’t possible? I’m legitimately curious and want to know
Maybe partially because I want to see if I can find a workaround (not likely)
I’m only really familiar with lua and not the scripting side but if this is to make a door that’s two tiles tall, don’t two tile tall objects exist in game natively?
I’m mostly interested in why that is the case
It seems superficially possible to make an “illusionary” model/sprite using client side lua but I honestly don’t know if that’s past the extent of the lua api or not
i doubt it, i've seen somebody fake it with dropped item models but there's no chance of animation, clothing, or even smooth movement that way
rendering is pretty locked off from lua
animated models are one thing, but i'm not sure we even have the ability to just... render a model independently of existing systems
sad 😦
i'm curious about finding the exact reasoning behind it myself - not really interested in npc mods but it would be a fun breakthrough
hack could be using the SpriteRenderer which seems to be exposed but that could reach into absurd territory
but tbf absurd territory is fun
i heard somewhere that it actually did work in early b41 versions, but i don't really remember who said that so i can't say for sure they even knew what they were talking about
Javadoc Project Zomboid Modding API declaration: package: zombie.core, class: SpriteRenderer
multiple render() methods seem functional
ugh, the auto-generated parameters are egregious here
wow i can't wait to input my FLOAT VARIABLE NUMBER 3 into FLOAT ARGUMENT NUMBER 3 to do undefined behavior
the named ones aren't much better but it looks like they draw tris
there is a "drawModel" method but i wouldn't know if there's any way to access a "ModelSlot" properly nor if it even works in multiplayer or if they use entirely different rendering methods for that
for all we know rendering could be hardcoded for multiplayer, right? java is kind of a black box. like i could decompile it but that might not even help
the lack of z co-ordinate could imply it's in gl screen co-ordinates, or this actually does just refer to sprites still (since the 2d -> 3d conversion 'sprite' often still means model)
i don't think the model manager is exposed, which makes this kind of a nightmare
tbf either way it could still work, just without a z coordinate it would require massive amounts of manual calculation
you'd basically be writing a renderer - and you can't access any of the low level tricks opengl needs to be performant
i wonder if we can get shader ids from somewhere, i thought we were unable to reach uniforms but it looks like you can do that here
rendering to this level is kind of out of my depth but it might be possible to either decompile code, reach out to a dev or, in the worst case scenario, create a mod to iterate through a bunch of int values
https://pzwiki.net/wiki/Lua_Events/OnRenderTick there's an OnRenderTick event
also PostRender, if someone wanted to do post-processing I guess
i've written an opengl renderer recently so i'm familiar with what appears to be going on here, but using these functions to manually render a model (as i don't think renderModel can be used) would have unacceptably terrible performance
Javadoc Project Zomboid Modding API declaration: package: zombie.core.skinnedmodel, class: ModelManager, class: ModelSlot
it does have a constructor
can kahlua "use" those?
it's not exposed unfortunately
rip
we can use constructors
no, unfortunately i don't know of any list, i just check the lua manager source
it has a big block of setExposed(classname.class)
Ooooh
is ModelManager exposed?
because ModelManager has an Add(IsoGameCharacter) method
it isn't, i think encapsulated classes are exposed together with the class
rip
yeah the LuaManager doesn't even expose ModelInstance or anything
which is kinda weird imo
maybe security thing
wait
an exposed lua method:
loadZomboidModel(String var0, String var1, String var2, String var3, boolean var4)
returns a model
seems to load one put in path to the ModelManager
it's in the LuaManager class, ctrl+f "loadZomboidModel"
what's weird to me is that it returns a Model object even though Model isn't exposed to lua at all???
yeah, i'm not sure what we can do with this - i *think* you can still pass unexposed objects
you just can't call any of their methods
so something that takes model as a parameter would be worth looking at
entering the deep end then i guess
yeah, it does understand it as an object
strange
SceneModel(UI3DScene var1, String var2, ModelScript var3, Model var4)
setExposed(UI3DScene) is in LuaManager
sort of unclear on what exactly it does
but i think it might be used to render cars?
but if that's the case it should be hijackable
hmmm it might be for the map
kinda weird it's in the vehicles package then
There's an ingame vehicle editor
A similar thing exsists for item attachments too
Theyre all related to stuff like the character screen
fascinating
If you're curious about using that type of UIelement you can check out that mod that adds/changes the hair display in character creation
i assumed the mechanics screen and the radial was the extent of that but this game continues to impress me
There also someone manipulating models rn to get obese + diff weights
If you speak with them maybe you can help each other test / avoid trending over the same ground
@keen silo meet @balmy terrace
I've been looking around for a bit, maybe I'm searching for the wrong thing.
Where could I look to get info about adding a contextmenu to a specific tile
There's an event called when adding context menus to the world.
Search for OnFillContextMenu
Gotcha, thank you!
@balmy terrace what mod are you trying to make exactly?
hmmm i guess i'm sort of just testing the waters to see what might be possible but, in a perfect world where i had unlimited brainpower and time, some kind of creature/animal api
They would like to make the features selectable in CC not tied to gender.
I assume specifics would be hair styles and facial hair.
Maybe taking the bodyframe of the female gender sans breasts
I think it fits with what you're trying to do in terms of the technical approaches
probably, would have to experiment more
Yeah, just saw how much time you're putting into it - and figured to spare someone else + possibly lighten your load
that too, but this could hopefully apply to more maybe
this are the compiled classes modified that enable me to swap the models characters of the game @balmy terrace
i'm curious about getting animated characters rendering in multiplayer myself
true, the non-gender-locking mod would benefit a lot from this
Can't you just send a command to tell others to animate?
my understanding was that they were unable to render in the first place
That's how I handle MP sound ☠️
otherwise i'm not sure why npc mods haven't done it already
that's something i'd be willing to resort to java modding for, the demand is great enough
Oh wait, I made MP animations
this works as follows: you get the HumanVisual of the character, use setForceModel(model) method and it should copy the model
For Sharks car mod - the seat animations are MP compat
my theory, if it is at all possible, is that it was not possible in previous updates and that updating the current dominant npc mod "line" to fit with multiplayer would require a complete rewrite
If it was Nolan stating it was impossible I would just take that with a grain of salt
that's excellent but unless i am mistaken this requires javamodding
the LuaManager doesn't expose HumanVisual
yes it does
nvm it does
HumanVisual is exposed
how did i miss that
it seemed like the general impression, and even from scratch mods haven't supported multiplayer
i'm going to investigate it a bit more myself
the problem is that by default, if you setForceModel() of human visual it doesn't work correctly
so I had to make it work :v
would it work well if you used the ServerCommand() event to call it individually on each client?
Commands have the option to send to all actually
is it just broken in the java code and required javamodding to fix?
well i meant sent the command to all clients and then have all of them call setForceModel() themselves
yeah, i haven't had any success playing with force model, regardless of multiplayer
I haven't tested on multiplayer, I focus more on the SinglePlayer experience
just, experiment :v
to be clear, the usual lua process of replacing a method to overwrite it does NOT work with kahlua right? because it's basically just a wrapper around java?
because if it did you could just 'override' getModel() and put a bunch of your own code in there
yeah, when you replace a method you only replace lua's reference to that method, not the method itself
which means that calls from lua get modified but not calls from java
hey can anyone help im creating a firearms mod and the gun model is invisible ingame i checked debug menu it shows up with correct textures and all correct exept in game
did it take javamodding to "make it work" for you or did it just take lots of workarounds?
Javamodding, but it didn't add any lua functions
weird
are all the scripts written correctly?
again i'm not familiar with the game's scripting
well then that makes it significantly more difficult to distribute..,
Yep i checked for some reason it still just dosent
is just a fix that makes it so that the forcedModel is asigned to the model instance of the player
wdym
because the way is currently done, each characters modelInstance model has only 4 posibilities, a human male/female, or skeleton male/female
we're talking about unhinged deep modding lore
oh lol its my first mod im making here bro
I changed it so that you can force the model of any specific chr to any model
this is very weird
looking at the code, getModel() should return the forceModel in the vanilla code if it has been set at all
this means that it should work in vanilla, but for some reason it just doesn't
yes
because
it doesn't use the humanVisual():getModel()
to set the model for the model instance
setExposed(ModelInstance.class)
sadly
I cannot compile the LuaGlobal
so I cannot do that
I really REALLY wish to
but none the less, I cannot
i know we're just talking about different mod ideas and stuff
uhm
do you have any mods that modify or change the display of weapons?
model Manager uses the public function getBodyModel
😭
the model might be too small/too large, zomboid works at a weird scale
public Model getBodyModel(IsoGameCharacter gameCharacter) {
if (gameCharacter.isZombie() && ((IsoZombie)gameCharacter).isSkeleton()) {
return gameCharacter.isFemale() ? this.m_skeletonFemaleModel : this.m_skeletonMaleModel;
} else {
return gameCharacter.isFemale() ? this.m_femaleModel : this.m_maleModel;
}
}
This is the code of the function. as you can see, it completely ignores the model of HumanVisual 🙃
i mean no offense to the project zomboid devs but that is extremely annoying
Nah i used a tutorial where it says to remodel it to the size of different pistol models so i just did that its the same size ima just try something real quick and see
and that's not even the best part yet
zomboid has lots of dead code, you have to accept it at some point
ModelManager has a private loadModel function. For some reason, this function loads the skinned body models correctly, and configures the skinningdata apropietly
however
I havent managed to load other skinned body models correctly
nah i checked everythings in order for some reason its not working could it be cus of large file size
we found a model loading global method in LuaManager. is that relevant?
whats the normal kb size for gun models btw?
think i've seen fed using it before
speaking of which, has there been any experimenting/knowledge about setForceModelScript specifically?
i tested it earlier today and it didn't seem to do anything
I think they're supposed to be relatively low-poly? but i'm not sure
there's no hard limit, it shouldn't refuse a big file or anything
just know that it will take longer to load bigger files, and nobody can tell the difference at zomboid's zoom level
extremely hacky method of animated multiplayer player models: setHairModel to a model big enough to cover the entire default player model
i don't want to do that though
is hair animated?
oh tbf it's not
you could technically manually "animate" it by manually setting the model to different positions.
super saiyan mod incoming
well with my experimentation i've reached a point where i can definitively say that not only are they not an effective replacement for npcs, actually lua movers are impossible to be used in any circumstance
a java error instantly exits to main menu if you try to use them
this feels like a coincidence
i think they intended us to be able to call setForceModel but made a mistake
oh wow
it might be old, or yeah an accident
doesn't work
when the mover's update function gets called it tries to update its moodles, but movers don't have a moodles object and there's no way to give them one, and the game immediately exits to main menu
I had to make a java function to copy the skinning data from the male models to the other models :v
you can prevent its update from being called but then they won't render
doesn't do anything apparently
is the moodle update function a java thing? could you just replace it?
it doesn't affect the model instance from what I experimented, so I kinda ignore it
it's a java thing
AGH
i don't see any way around it - lua mover calls the isogamecharacter update method, which expects a moodle object to exist even though only IsoPlayer ever has one

that's not the issue
i know java, don't want to have to distribute sussy jar files to people for my mods
obviously our only option left is code injection ||/j||
I'm not that good of a modder to help you with code injection
joking because i really do not want to resort to actual literally hacking to get these things to work
and i'm assuming the way Kahlua works, you can't just define the moodles right?
nah, even if kahlua was a little more functional it's protected
the root of the issue is in the constructor```java
if (this instanceof IsoPlayer) {
this.BodyDamage = new BodyDamage(this);
this.Moodles = new Moodles(this);
this.xp = new XP(this);
} else {
this.BodyDamage = null;
this.Moodles = null;
this.xp = null;
}
i'm not really sure i understand why these objects aren't just part of IsoPlayer at this point but sure why not
mfw
IsoMovingObject doesn't subclass from IsoGameCharacter
are cars game characters?
no, BaseVehicle inherits from IsoMovingObject
actually IsoMovingObject has a sprite due to inheriting from IsoObject and seems functional
you might be able to make like a moving 2d sprite that way
or even update it based on direction faced
isomovingobject might actually support models, never seen any indication of it but literally every subclass of it i can think of is 3d
isomovingobject is also exposed
there's literally no model methods or fields on it which is weird because of what you just mentioned on it
just checked it's source code and no it does not
but it would probably be way more performant to manually render sprites through it
so do they do that for every subclass individually? U_U
but i know nothing
i mean in my check i found out that it checks if it's a player in slideAwayFromWalls which is extremely weird?
like it literally checks if it's a subclass of itself/instance of IsoPlayerObject/has animation object
this does not work for the non-gender-locking mod but unless i'm wrong about isomovingobject a multiplayer compatible mod that adds animated creatures is totally possible
there is kinda of a way to get the non-gender-locking mod working I gather
you could make the skins and hair clothing models
and just
code how they should be worn
yup, that's my current plan. it does severely limit the mod's scale though
(add the value can't have holes)
if anybody has the time pls test isomovingobject and either way ill test once i can
IsoMovingObject has an anim map that you can call anims from
oh no the horse car
Does anyone have a good tutorial I could follow for retexturing base game cars?
Is this something alot of people know about? https://crowdcontrol.live/guides/projectzomboid/
It's an actual mod too...
A fair few people I play with know about it, namely from watching streamers use it.
It's pretty sick
Curious why they don't upload it to the workshop too
Being it's a lua mod one could add their own support
too much text saying "boost your income" and not enough explaining what it does.
It's a twitch integration mod - a suite of callable events
basically what m3ss made - but has more twitch end stuff
Yeah the whole boosting the income bit is because it makes donations directly impact the gameplay for the streamer, effectively further incentivizing donations.
Spoke a bit with the devs - they may add support for other mods 🙂
Nice
Thanks for the recommendation about beautiful-java. The install was not too harsh and it is indeed day and night!
Can you guide me on finding where it is that I can see which functions are available to the lua layer?
I'm testing the character:say(string) function that has a java implementation with more params but it doesn't seem available through lua.
I have this idea for a mod to make
I’m an animator and I wanna reanimate all the gun animations for this game, is this possible? I see people adding in custom animations for their weapon mods and I was hoping I’d be able to do that too
Alright, so now I have some code that lets me place down a tile (set as ISSimpleFurniture) with a custom name.
Now i've been trying to create a custom contextmenu that only shows up when you right click this tile. I've been trying some things out, but I seem to be stuck with detecting the tile.

And, to add to your question. That should be doable, yes 😄
I think by overriding the same animations in your mod, by using the same names?
OnPreFillWorldObjectContextMenu event is what you need to hook in
technically, because the game has a scripting system, I think none? But it might be more difficult than that if you want different animations for different kinds of guns (other than the basic differences between types like pistol and rifle, which are almost definitely easy to change animations for separately) and such
CATAN
although its a bit pixel hunty you can use place item to organize the board faster
for some reason I thought “THE ONE PIECE IS REAL” after seeing the reaction to “CATAN” and now I need to add a flippable, actual readable one piece manga to the game
any public method in an exposed class should be available to lua, you can see if a class is exposed by whether it's listed in LuaManager, there's a big block of setExposed(ClassName.class)
Ok thanks I had found the LuaManager but was not sure if all functions of those classes were automatically available.
In that case I guess I didn't set the function parameters properly.
I was trying to call this implementation of:
IsoGameCharacter.Say(String var1, float var2, float var3, float var4, UIFont var5, float var6, String var7)
using this in Lua:
character:Say("No Power", 1.0, 0.0, 0.0, 30.0, 0, "default")
I'm basically just trying to change the color of the text that is displayed.
Might be the UIFont failing, was not sure what to put there. I thought I could use something similar to what's called within the simpler version of IsoGameCharacter.Say:
public void Say(String var1) { if (!this.isZombie()) { this.ProcessSay(var1, this.SpeakColour.r, this.SpeakColour.g, this.SpeakColour.b, 30.0F, 0, "default"); } }
if the method is public it's exposed
You have to call on methods using exact argument types
The way I get say to use colors is applying "radio" instead of default
Ok thanks, and the types are the same in Lua, just using ":" instead of "."?
yeah, the uifont is the issue there
So this maybe?
character:Say("No Power", 1.0, 0.0, 0.0, UIFont["Medium"], 0, "default")
Greetings,
My friend recently modeled an M270 mlrs and we thought of introducing it to Zomboid as mod. I'm wondering if it's possible to make the rockets works because in my research working mounted guns on vehicles do not exist. I hope someone enlighten me with knowledge .
@sour island you're actually insane. much love my dude
I think there is some mounted turrets in the "Armored MH MkII" mod.
And yeah no error when fixing the font parameter, thanks!
Color doesn't change thought, I'll try you're "radio" trick...
Ah ok I get it. I has to be set to "radio" so that it listens to the color params. Thanks a bunch!
OMG, I missed your board game posts, that's really amazing, wow!
Thank you. I will check it out.
just and idea but they use different models for every rotation, you could use one model and rotate it in the part script instead. This might be more difficult to get right alignment, do what you find easier.
This is my first time modding a game. Currently I'm reading the moddign guide https://github.com/FWolfe/Zomboid-Modding-Guide/tree/master/api
thank you
Vehicle scripts
https://pzwiki.net/wiki/Scripts_guide/Vehicle_Script_Guide
https://github.com/Poltergeistzx/pzVehicleWorkshop/blob/main/docs/VehicleScripts.md
Vehicle guides
https://theindiestone.com/forums/index.php?/topic/24408-how-to-create-new-vehicle-mods/
https://theindiestone.com/forums/index.php?/topic/28633-complete-vehicle-modding-tutorial/
Great, Thank you so much
Is there list for Lua naming conventions that the community is using that I should be aware of ?
I came from Laravel (PHP framework) background
I do notice the use of camelCase
Can you access private members with reflection?
I don't need to right now, but just wondering
camelCase, also keep your variables local to help performance and avoid conflicts. if global, use modules or unique names, or both
I believe the answer is either “no” or “only in debug mode”
But I'm uncertain, so take that with a grain of salt (maybe that applies to modifying them? idk I just woke up and probably shouldn't have even answered)
Right. I was trying to read Calories off of a script item, and they're private there(I know because I was using reflection somewhere else). I managed to read the values by getting the InstanceItem... Still, just curious
hello, i need your help with commands again, all i need is just arguments for commands, i tried some ways but it didn't helped
ISChat.allChatStreams[9] = {name = "kill", command = "/kill", tabID = 1};
in this command i need just 1 argument ,i'll be very grateful if you help
What did you try? What went wrong/how did it not work?
i tried just to add arguments{arg} and {"arg"} so after this i had errors, i want to write /kill "nick" so i think i need arguments but don't know how to add them
What does your code that checks for the command currently look like?
And how did you try to add those? As new table keys? I wouldn't expect errors there unless there was a syntax error (which would be another push towards reading PIL!)
this is all commands:
ISChat.allChatStreams[8] = {name = "addperk", command = "/addperk", tabID = 1};
ISChat.allChatStreams[9] = {name = "kill", command = "/kill", tabID = 1};
this code checks commands:
sendClientCommand("cmd", "addperk", {});
elseif chatStreamName == "kill" then
sendClientCommand("cmd", "kill", {});```
and this is main code:
```local function addperkcmd(data)
print("addperk command called")
local plrnick = data[1]
local perk = data[2]
end
local function killcmd(data)
print("kill command called")
local plrnick = data[1]
getSpecificPlayer(plrnick):getCharacter():setHealth(0.0)
end
function mycmds(mdl, command, data)
if mdl == "cmd" and command == "addperk" then addperkcmd(data)
elseif mdl == "cmd" and command == "kill" then killcmd(data)
end
end
Events.OnClientCommand.Add(mycmds)```
i tried to add them like this:
ISChat.allChatStreams[8] = {name = "addperk", command = "/addperk", tabID = 1, arguments{plrnick, perk}};
ISChat.allChatStreams[9] = {name = "kill", command = "/kill", tabID = 1, arguments{plrnick}};
sendClientCommand("cmd", "addperk", {plrnick, perk});
elseif chatStreamName == "kill" then
sendClientCommand("cmd", "kill", {plrnick});
end```
If its a table wouldnt it be better/safer to do table.insert?
there's another problem, its not working
I think it'll be easier to respond to this with a list rather than prose; hopefully this doesn't come across as terse
arguments{plrnick}is not valid syntax for what you're trying to do (it's not a syntax error, since it is valid syntax for something else, but an error is expected from it). If you want to add a key-value pair with the key arguments, you need the equals sign, as the other keys show. You should also have the values in quotes, since they presumably should be strings:arguments = {'plrnick', 'perk'}- It appears that you didn't actually add handling for the arguments—you assumed their existence when reading the command. You need to read those variables from the command input
- I don't see the full code so I can't be certain, but it looks like you've copied the original function rather than doing an override as I originally suggested. This is still just a suggestion, but please consider deferring to the original function when your modifications don't apply, so you don't break other mods
but how to read variables?
You can use functions in the string module to read the player input (disclaimer, as always, that PZ Lua is not exactly equivalent to Lua 5.1. The documentation of the string module should still apply)
ok, i'll try this, thanks
does anyone know what may cause the skybox on a car to be zoomed out? here's my car compared to vanilla
I tried changing the scale of the model with the script, exporting from blender in a different scale, changing the size of UVs... nothing works. Not sure what I'm doing wrong.
looks cool !
@tardy wren I'm not sure if it applies to private as well but you can read java fields brute forcing through the javafields outside of debug
Writing to them can only be done in debug
Ty 🙂
😋
Through Javafields? Is that different from... normal reflection?
It's not something usable in realtime probably
Even in this example I store the values
Sorry I'm new to here. I have Lua 5.4.2 installed on my pc. Currently trying to follow some modding guide and this appeared :
modules aren't a lua thing, the txt files in scripts are an original format
Thank you
"local function canibuy()
local itemname = zamahardcode[args.index]"
Could anyone tell me why 'local itemname = zamahardcode[args.index]' is causing an error?
you miss end ? It would help if you provided the stack trace logs.
most likely either zamahardcode does not exist or args does not exist
Thank you!! It says 'attempted index: index of non-table: null.' Does this mean that the [arg.index] number is not available?
it means args does not exist
Thank you very much! I gotta figure out why args is missing
I managed to get rid of errors! But I faced another problem which is 'buy' button is not working. ```local function itemdes(button, args)
local player = getPlayer()
infoUI:open();
infoUI:setPositionPixel(subUI:getX() + subUI:getWidth(), subUI:getY());
infoUI:setWidthPercent(0.1);
infoUI["name"]:setText(zamazonhardnames[args.index])
infoUI["itemcode"]:setText(zamazonhardcode[args.index])
infoUI["image"]:setPath(zamazonharditemicon[args.index])
infoUI["number"]:setText(tostring(numbers[args.index]))
if args.choice == "buynow" then
if player:getInventory():contains("Base.Money") >= numbers[args.index] then
player:getInventory():AddItem(zamazonhardcode[args.index])
player:getInventory():RemoveOneOf("Base.Money")
else
end
end
end
local function onCreateUI()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subUI:nextLine()
subUI:addImageButton("zh1", "media/ui/brake.png", itemdes)
subUI["zh1"]:addArg("index", 1);
subUI:addImageButton("zh2", "media/ui/brake.png", itemdes)
subUI["zh2"]:addArg("index", 2);
subUI:addImageButton("zh3", "media/ui/brake.png", itemdes)
~~~~~~~~~~~~~~~~~~~~~~
subUI:saveLayout()
infoUI = NewUI();
infoUI:setTitle("Item Information");
infoUI:isSubUIOf(subUI);
infoUI:nextLine()
infoUI:addRichText("name", zamazonhardnames[1]);
infoUI:nextLine()
infoUI:addImage("image", zamazonharditemicon[1]);
infoUI:setLineHeightPercent(0.05)
infoUI:setWidthPercent(0.03);
infoUI:nextLine()
infoUI:addText("number", "", "Small", "Center")
infoUI:addText("itemcode", "", "Small", "Center")
infoUI:nextLine()
infoUI:addButton("buynowButton", "Buy Now", buynow);
infoUI:close();
infoUI:saveLayout()
end``` infoUI:addRichText("name", zamazonhardnames[1]); and infoUI:addImage("image", zamazonharditemicon[1]); are working great, but infoUI:addButton("buynowButton", "Buy Now", buynow); isn't working.
Does anyone know where/how things like *hammer* in chat get replaced with images? I have dug through the lua, followed the trail back to UIElement in java, followed that to AngelCodeFont in java, then looked at the fonts in media/fonts but still do not see where the parsing is done for that.
I know of <IMAGE:texture> works, but thats different than *hammer*.
Are there any results when you search for uses?
Nadda, both in the lua and java source
public static String parseStringForChatLog(String var0) <- Appears this is it
Now just need to figure out how tf that works
declaration: package: zombie.core.textures, class: Texture
Thats what defines them all!
Perfect, ty yall
Hey, wanted to ask how distributions for items work.
I followed a tutorial, but since it's 3 years old a lot of stuff changed.
So I would like to know how to do it today
(Tutorial that I use + the timestamp: https://youtu.be/N6tZujOPnDw?t=1080)
is there a way you can it make it where someone dies instantly after eating a certain food?
yes, you can use the onEat script value or hook to the eat action.
lol tyvm mane! ill look into what all onEat can do
would i put the onEat function in the _items.txt?
yo is there a event that can be called only when the players move any item inside hes inventory or player is inside inventory ui.
what masses is the game in?
pounds or kilos?
nevermind seems to be in pounds... Americans 
I believe it's officially neither—can’t remember where by now, but I'm p sure they said it's an abstract “encumbrance” measure that considers both weight and difficulty/awkwardness to carry
it seems like pounds canned tuna = 0.3 ... 0.3 from pounds to grams is ~140g which is the weight of an average can of tuna
they probs leave it unoffical so they dont get nitpicked like crazy over "THIS SHOULD BE 0.01 POUNDS HEAVIER!"
and added benifit - really free to balance how they want XD
the game is incredible honestly - and i only see it as an advantage for them to build it how they want, allowing modding is the icing on the cake
I think the founders are actually from UK and Canada (not US). 😄
Hey, sorry to bother y'all. I'm working on a small mod just for personal use, but I'm struggling to understand how the controller system is implemented. I've got bits and pieces of what I'm doing working, but I have a few questions if anyone's familiar with it and has the time
-
getControllerCount always returns 16, which I've noticed from looking at a bytecode decompile of the controller system, is the maximum due to some kind of sanity check. But I only have one Xinput controller connected. Is it picking up the first 16 USB input devices, even ones not supporting Xinput?
-
I can't pull axis and button count from any controller index (Always returns 0). Do I need to activate a controller for it to work? If I do, how do I do so? Pull its GUID and call addJoypad? (Can I pull the GUID with Lua or does that require a decompile and working with the Java source?)
-
From what I've gathered, Lua is unable to work with button and axis information outside of what's normal on an Xbox 360/One Xinput controller/in the controller binding file. 6 Axis and 14 buttons, is this true?
-
Can multiple joypads be active and assigned to one player?
If there's a write up anywhere that describes the controller system and how to work with it, a link to that would be more than fine
There is someone who wrote/writes patches for controllers - I don't recall whom, they may have more knowledge.
otherwise digging around the joypad files lua/java would be your best bet
https://steamcommunity.com/sharedfiles/filedetails/?id=3035791897
Just released my first mod in a while. Hope y'all will enjoy it 🙂
Hello everyone! I hope you're all having a productive day. I'm curious if someone knows a method to prevent body damage from showing up on zombies without simply overwriting the BodyDmg texture.
Ahh, no worries. It's a shame there aren't many folk around with the information, but I'll manage eventually 👍
ERROR: General , 1694746047201> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: OnInitGlobalModData of non-table: null ```
I think you might be trying to treat something that isn't a table, as a table. If I'm understanding that right? Like having a string, integer, float etc with a table index?
for _,v in pairs(Shotguns) do
local item = ScriptManager.instance:getItem(v)
item:DoParam("OBSOLETE = true")
end
for _,v in pairs(Pistols) do
local item = ScriptManager.instance:getItem(v)
item:DoParam("OBSOLETE = true")
end
end```
all is happening is that its Event.OnInitGlobalModData.Add(ChangeDefaultItemTable)
then running the function
i didnt have this issue before - which is why it is so odd
I think either Shotguns or Pistols isn't successfully having data put into it, so it's empty when it tries to loop through it?
"Base.ShotgunShells", "Base.ShotgunShellsBox"}
local Pistols = {"Base.Pistol", "Base.Revolver_Long", "Base.Revolver_Short", "Base.Revolver", "Base.Pistol2", "Base.Pistol3",
"Base.Bullets9mm", "Base.Bullets9mmBox"}```
ohh maybe im running the function before it actually ini the tables
thats probably why XD
Oh xD Yeah that'd definitely do it
ill just call it in a function - no idea why its having a problem weeks later XD
i should of just "kept it simple" XD
Is it possible the event is triggering later than it used to? I don't really know why that would happen though
i think it was having issues getting the SandboxVars before so i delayed it (not quite sure honestly)
I don't know enough about the event triggers and when things happen during mod loading to really suggest much. Might be worth putting some debug info in, chuck a print() in before you init the tables, and at the start of the function before the for loops. Then check the console to see which one's loading when. Wishing you luck though 👍
I'm trash, and litter my garbage code with "if debug then print() end" and then set debug to false when I don't want anyone to see it. lmao
idea: make debug method that does that check and takes debug and the message as variable
that would be WAAAAAAY to easy and intelligent
intelligence doesn’t exist, just luck
too real
Is there any way to loop the sound, since the action is very long and because of this, during the first action or further restart, it lags for a couple of seconds, or maybe there is a way to load the sound in advance?
self.sound = self.character:playSound("Autopsy")
I read this and was like.. Wait, why aren't I doing that?? Something like mlog(msg) would save me a ton of time going back through and fixing my debug lines 🤦♂️
Done, thanks for the idea xD
Also, accurate.. Luck really do be a big part of everything
coming back to my reanimation mod, how does gun animation work in this game?
im guessing theres multiple seperate anims for each reload
that being:
mag out
mag in
bolt pull
unless the reloads are all in one anim just broken up
ive been playing this game for so long
and only now have i dived into modding, a fascinating switch up from modding unity games, this game uses LWJGL right?
https://www.youtube.com/watch?v=31H54TpJjSA just watched an amazing tutorial!
This video took too long to make, but I made it.
Yes there will be a part 2, no it won't be as long as this one... I think.
Official Project Zomboid Discord server: https://discord.gg/theindiestone
Official Project Zomboid website: https://projectzomboid.com/blog/
Kekdot's video for armature rigging: https://www.youtube.com/watch?v=hWfUe03Ib5E&...
Note that this is for animation. You can find the simple rigs for creating accessories and whatnot in the #modeling pins.
so somone has made a full fledged maya rig but no one has made one for animating in blender????
i have to make it myself? 😭
wtf is this 😭
What were you expecting?
Importantly, what are you doing with it?
making my own gun mod that replaces the gun animations
i want to do a test but this rig is unusable
You can still add IKs and other bone constraints to this model
wish there was this for blender but i guess not
another reason to switch to maya 
all good rigs are on maya like 90% of the blender rigs i use for animations suck
I've found the rigs to be fine. I just add some constraints, IKs, and clean up the bone orientation. No problems for me. I try never to blame my tools.
Regardless, I think #modeling May have more insight for you.
yeah
well, once you make it its ready for future use tbf
Is there any way to loop the sound, since the action is very long and because of this, during the first action or further restart, it lags for a couple of seconds, or maybe there is a way to load the sound in advance?
self.sound = self.character:playSound("Autopsy")
Events
You can script sounds to have access to additional parameters such as looping
script?
PZs own scripting format, just like for items, and models
ok, thanks for help
Hmm, is there any sort of event to run some code on world creation, or something along those lines. Would OnNewGame work for that?
I'm trying to spawn some tiles into the world through the code, so would have to do it when the world's already been initialized I think?
Are you trying to spawn in tiles somewhere specifically?
Like in a specific cell or grid?
Yeah, I do have specific coordinates. I should be able to figure out that part, just wanted to know if the event I found was the right one, or if a different one should be used.
I dont know if that would work through that basically you’d need to have the specific cell loaded in first to get the coords for your tile
And if player hasnt visited that cell they arent initialised and are null
If im not wrong
Albion talked about the same issue earlier before
Hmm, I didn't know about that. That's good to know.
Bruh...
so... is there any server-side alternative for addVehicleDebug.
I'm looking precisely for spawning in coordinates and returning the vehicle object.
Hello, I want to create a mod that makes existing vanilla items not appear in the game. Does anyone know of an example mod or guide for this???
{
Bullets38/Bullets44/Bullets45/Bullets9mm/556Bullets/308Bullets/223Bullets/ShotgunShells
/Bullets50MAG
/10gShotgunShells
/20gShotgunShells
/410gShotgunShells
/4gShotgunShells
/Bullets22
/3006Bullets
/Bullets357
/Bullets380
/Bullets4570
/Bullets45LC
/545x39Bullets
/Bullets57
/50BMGBullets
/762x39Bullets
/762x51Bullets
/762x54rBullets,
Result:GunPowder,
Time:10.0,
OnCreate:Gunpowder_OnCreate,
Override:true,
}```
Hey folks im trying to override the blacksmith mod's gather gunpowder recipe but wrapping the above code in module Base wouldn't work. Any help is appreciated! Thanks a lot in advance
You can use obsolete in an overwriting script
Oh, Thank you
Where can I get informations like that?
local text3= "Zamazon Light Bulb Package"
local text4= "Zamazon Fishing Tackle Kit"
local text5= "Zamazon Garbage Bags 20PK"
local text6= "Zamazon MakeYourDoor Package"
local text7= "Zamazon Electronic Repair Package"
local zamahardnames = {text2,text3,text4,text5,text6,text7}```
IGUI_text3= "Zamazon Light Bulb Package",
~```
I'm working on translating texts in Lua, But I'm not sure about this.. Am I doing correctly or missing something?
I think something should be in there between IGUI and text. maybe Lua's name?
you use getText("IGUI_text2") to get the translated text for that entry
keep in mind that all mods need to share the same names so very generic entries like 'text2' are not a good idea
Thank you!! so it will look like.. local text2 = getText("IGUI_text2")
YaY Thanks!
Gotta change the names as well
I am gonna make a big mistake and edit a ton of items at once at runtime
Since editing script items doesn't change the existing ones, I'll be hooking into OnRefreshInventoryWindowContainers and looping through it all to change spoil timers of everything
I'll make it a disabled by default feature
Albion you seem to know this is as bad of an idea as I do, if you have anything better please speak or remain silent forever
nothing comes to mind
It may not be as bad
Proximity inventory does the same thing
I don't know how often the event fires exactly... I can try to throttle it somehow
well it's difficult for any one competently written mod to actually cause serious performance issues, but things like this stack
but i think it'll be okay
This is supposed to be a transition-only measure for when you install the mod on a running save
new saves won't even need to use it so it's just a compatibility option
probably not ideal, this is fine
i was going to suggest something but i think it'd actually be much worse 😅
this is probably the best way of doing things
as long as the code is efficient it won't be noticeable
Well... I don't think I can avoid a double loop
I can try to throttle it, depending on how often the event runs
Can try to make it run on only a single container every launch
I'll make it work, then I;ll worry for performance
Anybody knows what the Local Container is from ISInventoryPage.GetLocalContainer?
Oh nevermind, wrong file, it's not vanilla
There's this mod by @fast galleon that can help with that.
You can run commands os specific coordinates when they are loaded
https://steamcommunity.com/sharedfiles/filedetails/?id=2969455858
immersive solar panels spawns tiles using this
Hello!
Is there any way to have more than 1 overlay sprite on top of a tile?
The tile is a container which already has container overlays defined through TileZed, but I would like have an additional custom overlay on top, triggered through lua.
When I use the below, it replaces the container overlay. I would like to add it as another layer on top instead.
chargerIso:setOverlaySprite("myTiles_01_4")
no, you can have one overlay. When it's used for container it will be constantly changed automatically when players move items from what I remember.
you could add an attached sprite or another object.
function attachAnim(isoObject,spriteName)
local isoSprite = getSprite(spriteName)
isoSprite:setName(spriteName)
local spriteInstance = IsoSpriteInstance.get(isoSprite)
local attached = isoObject:getAttachedAnimSprite()
if not attached then
attached = ArrayList.new(4)
isoObject:setAttachedAnimSprite(attached)
end
attached:add(spriteInstance)
end
Ok thanks, I'll try that!
Alternatively I guess I could also make all the possible sprite combinations as separate sprites and manage them all through lua instead of relying on the built-in container overlay feature.
Your trick totally works, thanks a lot!
Not the greatest sprites, but this is a battery charger for small batteries. The 4 green batteries inside are the default container overlays and the green light on the left is attached with your method when there is Power available on that tile.
How can I mod that replaces files for another mod.
Basicly a mod that applies a fix onto a mod without uploading the whole mod that needs the fix
Depends on what are you trying to fix.
If it's item or recipes, you can copy their entrys on the script file and edit in a separate .txt (not very compatible). You can also edit the scripts after they are loaded in Lua (more compatible)
I would like to fix the item distributions
If it's some kind of Lua file that you want to fix, sometimes you can override the original function in your own file if it's public (more compatible), or if it's local, you copy the whole file and edit what you want (not very compatible)
Then it's a Lua file. I'm not very certain of a good way of changing entrys on the distribution table.
If I was doing a fix, I would probably copy only the whole distribution file and make my changes
Maybe @bronze yoke will have a better idea than me
yeah I fought also about just copy the whole file, fix it but then what?
After the "fix" is done, somehow I have to tell the mod to use my file instead of thiers
If you want to override the original file, just put your in the EXACT folder structure and the EXACT name of the original, then it will override it
I think load order matters in this case
Not sure tho
Yeah, I have a 'Test' mod just for testing some random ideas ;P
^^
Quick follow-up question. Is it possible that attached sprites are not persisted when closing the game?
Is there a native Zomboid way, to save a lua table to file? Kinda like the sanbox options?
It could be, if they don't have properties from tiledef file. You may also have issue rotating the tile.
Ok thanks, I'll patch it with some special start game init code for now.
If it's to store a table for an item/object, you could use modData. It can persist tables or simple variables for a given item/object.
I was thinking about it, but I need to persist this info between multiple savegames. And mod data, or global mod data is specific to the save game.
Hi all
I'm making a mod to add some recipes for making digital watches for my server. However, when I add the recipes to the script file, and load the game to check it, the recipes don't exist. I've looked through the console.txt to see if there are any errors, and there aren't any, I've checked through errorMagnifier to see if it caught anything and it hasn't.
I know this code works as I made another mod recently that adds the exact same recipes, has the same code (except for me importing Base on this code), and that mod works. I've attached a screenshot of my code. I'm genuinely stumped as I don't know what I'm missing.
The only other thing I can think of is I have a separate recipe file for making bourbon for my server mod, but I'm unsure how that would affect it.
Lua seems to support json, that might be the easiest way to do it.
Yeah, I think ill stick to that
Have you tried removing "Base." in front of the result items? I think you don't need it when your import Base. Or try removing the Base import section.
Let me try that and see!
So I tried both options and the recipes still didn't show.
I'm not familiar with mods on servers. In SP, that should work. (given that the script is in the right folder and the mod is activated)
The mod is in the right folder and is activated, and I am testing this in singleplayer, which is mainly why I'm confused
As you are right, it should work
Yeah it's weird. I would at least expect them to show up in the craft menu, and give an error when trying them if there is an issue with definitions inside.
You could always try adding a simple item in the script and check if you can add it to your inventory in debug mode. At least you'd know if the mod is working properly.
I do know the mod is working, as my separate file for a bourbon recipe based off corn does show up.
I don't know if console.txt has all the errors. I usually check the ..._DebugLog.txt to check errors.
it should
So I redug through both console.txt and the DebugLog.txt, where I specifically searched for "error", The only thing that pops up besides errorMagnifier is this:
Im not sure if this is the actual error, but it is the only thing I can find
Did anyone manage to extract this icon from the game files? media/ui/Container_DeadPerson_Male.png
Nevermind, apparently the wiki has them: https://pzwiki.net/wiki/Category:Container_icons
ALBION
I CAN HOOK INTO OnContainerUpdate INSTEAD
oh my god finally... scientists have found a use for OnContainerUpdate
I don't know when it runs exactly but I can use that to edit the items in the container
it's whenever the list of containers the player can access change
Also hello from 3 am
or actually when it could change
Wait, really?
hehe it's only 2am here, much better 😇
Your doc mentioned it's when it first loads
hmmm i might be misremembering, my doc seems pretty explicit
I know that a container calls its update function when you look into it
but the basic idea of it is that it happens when a new container becomes available/an old one becomes unavailable
In multiplayer at keast
i think the primary function of it is literally just to tell the ui to update to show the correct containers
not 'when the contents of the container changes' like it sounds 
Right
So it would be the same as the current event, theoretically
You can avoid flash-spoiling of food by not looking into the fridge until you power a generator
i think the event gets fired even if you can't reach the container
That'd be better for my usecase.
Regardless, I'll look into it with some debug printing at a more sane hour
the vanilla use is essentially to the tell the inventory ui 'the containers the player can reach COULD have changed'
later i'll have a quick look over, i trust my docs over my memory
(Client) Fires when a container is added or removed from the world.
That's what the GitHub doc says
yeah, sometimes it might be overly brief since i wrote all 100 or so in about a day so i have to check that that's not misleading

hey folks can anyone give me some help on how to override a modded item/recipe?
sure, "subscribe to a mod in the workshop that does it and look at how they do it."
actually, now that you mentioned it, lemme see what i can do
hmmm i checked historical weapons and armor, they used the same module name but I am also using the same module name
and i have override=true in my recipe too, doesnt seem to work
You cannot override a mod reliably from txt changes you need to look at a mod that overrides another mod through lua.
right... i will check that, for now i used new recipes instead. thanks for the info!
Where I can I find the vehicle distributions of a custom mod map? I'd like to make it where vehicles don't spawn in specific areas of the map. Is it in the map file itself?
nvm found it
Is decompiling the game and working with it in a Java IDE something that's allowed to be discussed here, or is it lua modding only?
Modding Java is allowed for discussion as far as I’m aware
Awesome 👍. I couldn't find a statement anywhere or anything in the rules regarding it so I figured I should ask
Hi all, Is there a way to print global variables like ProceduralDistributions.list while the game is running?
In debug mode you have access to console and can do that easily. However this list can be inaccurate while the game is running, it's mainly used to initialise distributions in java.
If you are looking for something specific in distributions you can check the LootZed tool.
Is it possible to make a mod for logging when containers are sledged/disassembled?
Looking for some help with reviving a dead mod: https://steamcommunity.com/sharedfiles/filedetails/?id=2565273421&searchtext=cdda
It seems to have an issue where the third book read doesn't grant EXP. Trying to understand the functions its calling but it looks like it's referencing some classes and variables from the base game. Is there a way to see these classes and their variables without decompiling the whole game?
Just trying to understand the game's API
the lua doesn't need to be decompiled, you can just read it from the media/lua/ folder
a reference to the java api is here https://projectzomboid.com/modding/
Anyone knows how to get some sort of bool that can tell if character is yet to be created/ already created?
It does seem all events, including EveryOneMinute already running even in stage of character creation.
Tried to do this
local player = getPlayer();
if not player then return end
But apparently its not always true and doesn't return at some point.
Maybe Events.OnPlayerUpdate.Add(function) ?
Hey, how do you make inventory:FindAll search through a list/table? currently it accepts a string only.
this doesn't work, i think it tries to find if the player has ALL of these items, not any of them
local arena_weapons = {"Base.ArenaSBlunt", "Base.ArenaLBlunt", "Base.ArenaSBlade", "Base.ArenaLBlade", "Base.ArenaAxe", "Base.ArenaSpear", "Base.Apple"}
local items = inventory:FindAll(tostring(arena_weapons));
You’d need to iterate over the table yourself and feed the items one by one to FindAll
oh, right, thank you! i got it to work now
Where can i find the scripts for the crafting skills (Espec. Metal- and woodworking)?
Whats the method for getting the player's currently wielded/held weapon/item
context: i am trying to remove items from the player's hands, e.g they are holding an item, i want to remove that item. setting their hands to not wielding anything.
i tried this, but it doesn't work unfortunately.
player:removeFromHands(tostring(element))
function updateUnequip(isoPlayer)
if isoPlayer then
--unequip all
local primItem = isoPlayer:getPrimaryHandItem()
if primItem then
unequip(isoPlayer,primItem)
end
local secItem = isoPlayer:getSecondaryHandItem()
if secItem then
unequip(isoPlayer,secItem)
end
end
end
function unequip(isoPlayer,item)
if not isoPlayer then return end
if not item or not item:isEquipped() then return end
if InfPla.Verbose then print ('InfPla.unequip '..p2str(isoPlayer)..' '..tab2str(item)); end
isoPlayer:removeWornItem(item)
local hotbar = getPlayerHotbar(isoPlayer:getPlayerNum())
local fromHotbar = false;
if hotbar then
fromHotbar = hotbar:isItemAttached(item);
end
if fromHotbar then
isoPlayer:setAttachedItem(item:getAttachedToModel(), item);
isoPlayer:resetEquippedHandsModels()
end
if item == isoPlayer:getPrimaryHandItem() then
isoPlayer:setPrimaryHandItem(nil)
end
if item == isoPlayer:getSecondaryHandItem() then
isoPlayer:setSecondaryHandItem(nil)
end
item:getContainer():setDrawDirty(true);
end
i will try this out, thank you
Anyone familiar with timed actions, specifically transfer and drop getting "bugged actions" errors and resetting the queue?
Since world items can't be moved around and you can't change their offsets directly - ive taken to using pickUp and drop in a queue to do it.
Prior to this I gutted out the internal steps since using timed actions was causing problems with flickering + the slight delay of picking up and moving (as well as the bag sound).
But even with the two timed actions being used again, it's causing "bugged action clearing queue" with transfer, as well as the initial issue which is "error, container has ID" is still occurring.
Best way to determine location of any scripts is looking for media/lua by searching any related string translations, variables are usually tied to them.
So if you have a specific button with word "Craft" you will most likely find the exact script in less than a minute.
That's considering if its translated, but so far modders do care to translate their stuff too.
from memory, bugged action on transfer timed actions occure when one of the element of the transfer is not valid (or not in the right container) anymore. This can occure in an asynchronous world (MP) when two players do concurrent actions or when a server-side action (like fire destruction) removes an item during the transfer. Other than that transfer timed actions works well and if you meet those bugged actions a lot it is likely due to invalid requests (e.g. in earlier versions of autoloot I was piping twice the same transfer action)
How do you parse through a container's items (backpacks)?
Inventory:FindAll() only searches through the player's inventory
player:getInventory():getFirstTypeRecurse(itemType);
Hmm, I'll have to check the actions - maybe it's sending the request twice due to how I wrote the UI
look at ItemContainer.java it has a lot of search methods, one for each use case you may have.
The "error container has ID" was the original issue - which happens alot less but still occurs. And in that the container is getting two entries of the same item.
I have to loot it twice to clear it
I do not recall anything about that one
is there a way to add or remove a recipe input through lua?
Yeah, I think trying to work around the limitation of not being able to change the offset is finding new ways to break stuff lol
I made the "change offset of world object" thingy in that mod: https://steamcommunity.com/sharedfiles/filedetails/?id=3000569721
Oh? Does it involve removing and adding? Or?
yes
local arena_weapons = {"Base.ArenaSBlunt", "Base.ArenaLBlunt", "Base.ArenaSBlade", "Base.ArenaLBlade", "Base.ArenaAxe", "Base.ArenaSpear", "Base.BaseballBat"}
function remove_arena_weapon()
local player = getPlayer();
local inventory = player:getInventory();
--unequip and remove arena weapons
for _, element in ipairs(arena_weapons) do
player:setPrimaryHandItem(nil)
player:setSecondaryHandItem(nil)
player:resetEquippedHandsModels()
local items = inventory:getFirstTypeRecurse(element);
print("test!! ", items)
if items then
for j=items:size()-1, 0, -1 do
local item = items:get(j);
print("removing arena weapons", item)
inventory:Remove(item);
end
end
end
end
I'm iterating through a string table to find items and remove them, inventory:getFirstTypeRecurse doesn't work because it returns nil
i tried other methods in the itemcontainer, but they all also return nil
getFirst does return an item or nil, not an array of items
and you probably cannot expect the result to always be different from nil.
also I am not confident Remove method works recursively so you have to remove the item from its own container
Not sure If I reinvented a wheel here but you might want this at some point
function IC:sleepAnDo(seconds, func)
local time = os.time();
local targetTime = time + seconds;
local function OnSleepTick()
local timeNew = os.time();
if timeNew >= targetTime then
Events.OnTick.Remove(OnSleepTick);
func();
end
end
Events.OnTick.Add(OnSleepTick)
end
Me? or are you talking to chuckleberry?
No i mean in general whoever reads that snippet
Never found any "engine solution" so far for sleep function to schedule code.
Yeah, thats probably the problem. FindAll searches through a container
i just need to figure out how to tell it to search through a backpack or a fannypack
getFirstTypeRecurse works through worn bags (that's what Recurse means in that context). but Remove I doubt it. just use the item:getContainer instead of inventory
That worked finally, thank you!
Does anyone know how to fix a low resolution icon? I even matched the Bit depth but it still looks like this.\
@tardy wren@bronze yoke From my testing OnContainerUpdate() only triggers after a container is removed from the world and its argument container is usually nil at that point.
The one that triggers when the list of nearby containers changes is OnRefreshInventoryWindowContainers().
And with it's iSInventoryPage arg you can directly access a list of all nearby containers using iSInventoryPage.backpacks.
Okay, thanks for the tip
Will see myself
I currently have a similar need so I've been debugging all the events to see when they trigger.
the reason the argument container is usually nil is because in most cases it doesn't pass any arguments
the vanilla usecase doesn't need anything so they didn't add any, except in a couple calls where it does pass some things
I was initially using OnPlayerUpdate to detect and verify nearby containers but that seems very taxing on perfs.
I'm converting it to use OnRefreshInventoryWindowContainers instead.
What mod are you making btw?
Just a simple Battery Charger for the small batteries.
A tiny container tile that charges batteries when there is power on it's square.
Hmm, OnContainerUpdate did fire when I loaded a new save...
You're right, it also seems to trying when you place a moveable in the world. It's arg is still nill thought.
Yeah... and it seems OnContainerUpdate doesn't fire when you load older saves
technically this event does have a tiny bit of vanilla documentation
-- Called when an object with a container is added/removed from the world.
-- Added this to handle campfire containers.
one of the five comments in vanilla lua
No good for my usecase then
What's your use case?
Syncing existing Inventory Items with their Script counterparts
i guess it doesn't fire for objects being streamed in since you'd have to be moving to access them anyway
Is it triggered for all containers? Even bags that you drop from inventory on the floor?
Didn't test that
yes
actually it's triggered for all items dropped
it doesn't check if they have a container
Think not
If you want to know when a container gets filled with its loot items, OnFillContainer seems to do that.
No, no
Newly spawned items are fine
It's the existing items before the mod was installed
Yea i wouldnt think so too
it just exists to dirty the ui, so things that would already be handled probably won't trigger the event
Hmm
For some reason it didn't update all of the items in the container
Okay what the hell
Canned Chilli avoids detection somehow
It's not perfect
Right
I, like a moron, initialized the inner loop with a value of the current index of the outer loop
AKA I did
for j=i, items:size()-1 do
Oh this is not something you want to see
What? You don’t want to see butter?
i got an idea what if pool tables have a mini game you can play with 1-4 players while your playing the world pauses and a mini game pops up like the map so you can play
can be fun activity for mp and reduce
and 
It isn't very active, but there's a thread for mod ideas: https://discord.com/channels/136501320340209664/1075939080287834113
May be better there, since those message will get pushed up by mod discussion. I've had a similar idea for a more general framework for minigames, but the project that gave me the idea was a bit narrow for my liking after realizing it could hypothetically do stuff like what you just said 😄 Idk about pausing the world, but it's certainly a plausible idea
Thanks
ehm is sendServerCommand operational?
I can catch event from client to server, but cannot do the same from server to client via Events.OnServerCommand.Add(func)
Wouldn’t that be commands sent directly from the console versus a client sending commands to the console via /commands through in-game?
anyone here know any mods that change just the sound of sprinting zombies? looking to figure out how to do this myself for a personal mod that will change the sound of spinters to Last of Us Clickers. I know there's a bunch of mods that will replace the sounds of all zombies but I need it for a world that only has like 2-5% total sprinter population
Not sure what you meant, but my point is for client to ask server do something, then send a response.
Client asks server succesfully and OnClientCommand do trigger, meanwhile I cannot get a response back from server.
are you testing in singleplayer?
servercommands don't function in singleplayer, even though clientcommands do U_U
yeah
if there aren't any mods that do that, anyone know if sprinters even do have their own sounds files? and if they do, does anyone know which files those would be in (what i assume is the correct area to edit this) ZomboidSound.bank?
I'm working on something related to UIs, and I need to draw a texture (tile sprite), but not the full texture.
Is there a way of 'cutting' only a part of the texture and draw it?
eg. a 128x256 texture, I want to cut 64 from the top and bottom, getting 128x128
Hi guys, I want to create a basic mod the replaces the level up sound in the game but I am not sure where to start, any advice would be appreciated !
I feel like someone should make a repeating crossbow mod
can't update workshop item because "reason=2"
on my private server mod
i just uploaded an identical copy to the test version of the mod a few mins ago without issue..
anyone?
will try
some mods on the workshop do exactly that look them up.
did not work :|

this is bad
unfortunately steam gives 'reason 2' for literally everything
might not like the files, might just be having a bad server day
if you already uploaded it it's probably not the files
steam has logs for workshop upload
was very helpful
[2023-09-16 16:30:27] [AppID 108600] Upload workshop item <redacted> failed (Colliding file mapping of "/home/evelyn/.local/share/Steam/steamapps/compatdata/108600/pfx/dosdevices/c:/users/steamuser/Zomboid/Workshop/UdderlyRP/Contents/mods/UdderlyRP/media/lua/server/items/VFE_Distributions.lua" and "/home/evelyn/.local/share/Steam/steamapps/compatdata/108600/pfx/dosdevices/c:/users/steamuser/Zomboid/Workshop/UdderlyRP/Contents/mods/UdderlyRP/media/lua/server/Items/VFE_Distributions.lua".)
i apparently had this under two capitalizations
not sure why it let me upload it other times tho
@bronze yoke wanted you to see
/home/evelyn/.steam/steam/logs/workshop_log.txt
in case u ever run into it or help someone who has issues, helpful place to look it seems

i sort of agree with case sensitivity on principle but god case sensitive file system can't ever be good
im fine with it as long as it's consistent, but it sucks that the ecosystem is like half case-sensitive and half-not
that log file will be crazy useful
yeah
better than me going 'idk restart steam' every time
i cant imagine trying to update a mod that overrides a file in Items
when ur on windows
and items == Items
but then on linux server
the mod doesn't work
etc
must drive people nuts
advantage of linux client
iirc they made the game search case-insensitive for files because that kept being way too prominent of an issue
when doing override by path i think it's still an issue?
anyway thanks for the help
gotta go now
how do I go about making my own type of grenade / projectile?
I haven’t written any of the code yet but basically I want to make a mod that plays a music file when a player crosses a certain coordinate on a map. To create an invisible line for the music file to trigger would I have to list each coordinate individually? Would it make more sense to use an interface similar to creating safe zones?
would I have to list each coordinate individually
No; you can use math
Would it make more sense to use an interface similar to creating safe zones?
Maybe, but this is a question about specifying the area rather than the code that would be used to trigger it
For specifying an area, should I have it load on chunk load or when a player enter that specified coordinate? Sorry if I’m not being clear, I’m new to modding.
should I have it load ...
What do you mean by “it” here?
I think the answer will be “it's up to you,” regardless. Depends on how you'd like to implement it
An audio file that plays voice lines.
Well it’s for my RP server but I could see that a static implementation would make it challenging to use in future seasons.
Ah, gotcha. There are ways to preload sounds iirc but I don't think that'll be the biggest concern (i.e., it'll still play the sound you specify without that preloading). I'd focus on having it play at all before thinking about when to load it
Then it would be best to implement it in such a way that in can be easily reused. The basic inputs to think about are, of course, the area (or boundary?) that should trigger it, and the sound
Oh like a house alarm
Some other things are worth consideration: will it play only the first time? Every time? Either way, you'll need to ensure you don't inadvertently trigger it multiple times in rapid succession
Yeah calling a sound file in quick succession would be catastrophic
I'm not sure exactly how those are implemented or whether it's Lua or Java side, but that's a great idea of a place to start (i.e., searching for that in the code)
I downloaded IntelliJ and decompiled the Java and Lua libraries although I’m not sure if it is functioning correctly with PZ doc. I had to revert cradle back to a version released around time to get it to work.
I could use .getCalendarInstance to set a fixed interval that would limit the amount of time before the sound could play again right?
Sorry for late response I’m at work. Thank you for your advice!
How do I tie in player positions relative to function luautils.getNextTiles
Speaking of IntelliJ, can anyone give me advice setting it up? I can code but I did the network architecture/Cisco side of things in college and never got taught how to set up an IDE.
I have the file I want to work with in src/zombie/core/physics/ where it is in the game files, and I have the game files set up as a library. It validates the file fine, gives me warnings, but it doesn't throw errors until I build it, and then it can't resolve any of the imports :/
The dependencies are set up so it looks at the game files and libraries first
I'm not using maven or gradle to build it since I don't know how to set them up, using the default build system in IntelliJ
I suppose I'm wondering:
- Which version of the jdk do I want to be on? The tutorial I initially used to decompile the game used 19, but I'm not sure if that's still correct
- With the zombie/core/physics/CarController.java, do I have zombie as the source, or do I have zombie in the source?
PZ.io.storm GitHub page will help you set up gradle
Oh, awesome! Thank you I'll follow that then
Just a heads up though, you’ll need to mess around with the source SDK and gradle version to get it to work since it was discontinued 2 years ago. I ended up having to revert gradle to the version that was released around the same time as PZ docs latest release version
Ahh, definitely good to know. Thank you 👍
I was looking for a modding api when I was originally trying to figure out how to work with the java side of it, but had no luck finding one so I'm glad there's actually something like that around
It’s a bit old lol so I’m still having issues trying to get certain functions to work
Like I ended up having to set my sdk version to 16
It’s on 20 right now
I mean, it can't be worse than beating my head against a wall trying to resolve import problems I shouldn't even be having
At least, I hope not xD
Dude I’m still beating my head about knowing if it’s working properly or not lol. Although it could be my lack of knowledge in Java 😅
That's in general just been my experience trying to get this stuff working 💦
Every other time I've messed with a java game there was an up to date tutorial for setting up gradle that just worked 😅
I'm sure it's a skill I need to get off my ass and learn. Setting up an IDE, and maven or gradle from scratch
My approximate understanding of build order, libraries, and dependencies is fine once I have the stuff set up. But if anything goes wrong I'm just staring at it like.. What do I even do
is modding in this game difficult
If you're doing something that only needs Lua, no it's super easy
i dont know lua
For me
and ive only ever done programming sucessfully one time
If you're doing something in Java and know how to set up your build environment, it'd be easy to moderate. If you're doing something in Java and don't know how to set up your build environment, then, yeah pretty difficult
Well, imo Lua's the best option to start off with
I managed to get console to print, “hello world” , once
It's not as fussy with syntax as most languages
You should use IntelliJ
Well, first off, what are you trying to do? What sorta modding are you looking at doing?

