#mod_development
1 messages Β· Page 165 of 1
ok ty ill check that, i tho at first it was maybe the category type but nope lol
items have some properties that are important to know
Type is the internal name used by the game to determine what the item is because its display name can change
Name is what is displayed
Category is an arbitrary category system for items and it can also be changed
Tags are assigned to items based on their functions. ie: all the hammer items have "Hammer" as a tag and thats how the game knows they can be used for hammering purposes without needing a list of every valid item.
well zombie:knockDown(true) is working perfectly fine for my mod π€·ββοΈ
Unless some pz update broke it recently but no one complained so far
my assumption is that since im tying it to a zombie getting hit by a weapon its getting overridden by vanilla knock down mechanics.
its aight, i shelved the idea for now. i'm just gonna leave it as a stagger effect instead.
on a separate note, is there any way to detect when a player shouts? like with Q
AFAIK all the functions to make the player speak end up calling IsoPlayer.Say()
so unless there's a way to detect shouting by "hearing" it, I doubt it's possible
what about detecting the keypress?
maybe you can pull the control scheme and have a function trigger on key press?
hey guys can you guys help me on making an way to npcs naturally spawn on aiteron npc mod? project humanoid
that would be a question for #mod_support in here we're talking about the internals of zomboid modding.
is modding related
im making an modification in code
im trying to do modding to make npcs spawn naturally in The project humanoid im trying do it with coding
it doesn't look like it, as it seems like that the two places the shout fires from is within "ISEmoteRadialMenu.lua"
it would be possible to intercept the lua before it fires though
can anyone help at the part of npcs spawn naturally im trying to program that to make it work
like an submod
by intercepting both ISEmoteRadialMenu:emote and ISEmoteRadialMenu.onKeyReleased
ISEmoteRadialMenu.onKeyReleased actually doesn't even have to be intercepted actually, as you can't technically. It would be best to have your own function fire with the same event hook and conditions
if it's only called from lua as mentioned above, you could just hook the metatable for Callout
Am I able to make my mods and test offline? I just moved today and donβt have internet
is that how it works?
as it seems like Callout is on the Java end of the game and not the lua side
yeah, but you can still mess with the lua reference to that method
as long as it's called from lua it has to go through that
can you guys help me
im trying to make npcs spawn naturally at project humanoid with lua
Events.OnWorldSound.Add(myFun) interface= (x,y,z,radius,volume,source)
im trying to make npcs spawn at an random location with project humanoid can someone help?
that could work, it would be a bit of a blanket coverage though.
what i'm trying to do is detect when a player shouts so i can have it retarget zombies in front of the player using zombie:setTarget()
like a taunt mechanic for multiplayer being able to force zombies to target you instead of your friend who keeps burning all of his endurance.
you filter by source == player that's exactly what this event is made for
isnt that going to trigger on all sounds though?
like coughing or building?
yes most (not exactly all) but it will include all your players sound and you can filter with the input parameters
aight, i'll look into it. Thanks!
yes, you can start PZ with -nosteam option to play disconnected.
@stone garden what's the issue exactly? Shouldn't be too hard. Also isn't it already implemented in Aiteron's mod?
nope it isnt implemented soo i need you to help soo the npcs are not spawning soo i have to program to make it spawn
what's your code so far?
im thinking into one
but each one i tried doenst work
can you give me some ?
actually no, never tried to spawn npc
i want it automatically spawn
but if you have some code snippets I might be able to help you getting it to work
I fail to see how that would spawn a NPC π€
well I already told you I don't
well
Why aren't you checking Aiteron mod? He's definitely spawning NPCs, so it would be a good start
im using it as an base but the npcs dont spawn automatically
what do you mean by "they don't spawn automatically"? When I've been trying Aiteron's mod, NPCs would spawn, and it wasn't a manual thing, meaning it had to be automatic somehow
well
is there an solution to increase frequency
probably yes, you'd have to dig his code to find out though
Anybody here have tile ed and would be willing to help a modder out? I'll see myself out for that pun but still!
nope i really don't get it how to make a custom item attachable with the mod noir attachment, checked all the codes and can't find it :/
depends which modder you want out π
I don't have it but I'm curious, what is it you need?
maybe check authenticZ?
I need dozens, maybe a hundred or so tiles' names
Gonna be very boring and annoying doing this in-game
why don't you simply download the tileset then?
π
I mean you can download the tileset separately from tilez
IIRC it's just a zipped folder with all the tiles
Tell me what you think of the (very tiny simple) evolution proposal on github.
any modder who can help me with the attachment bag?
that helped me, thanks now it work but i have a problem 1 of my 3 plushie appear at the wrong location on the backpack and i really don't know why, they have the same codes and location models :S
π¦
It's over my head to be honest, but I'm pretty sure if you ask nicely to AuthenticPeach he'll try to help you
@late hound sorry to ping you! I need your help if you have time of course. β€οΈ
any clue what could identify a server uniquely? I've been using the IP address but it's actually not a good idea because it's sensitive information that shouldn't be embedded in code
Name + timestamp of first start ?
the name is too easy to change, and I need a value that would persist over a restart
trying to enforce a blacklist on some servers π
uh, that's way beyond what I expect, ngl
Anyway, guess I'll sleep on it. See you guys
well if you want to go turbo nerd you could set up some public-key encryption and encrypt a message with your private key, allowing your users to decrypt with your public key to reveal the contents of your message, that way any prospecting charlatans who wish to pose as you will need to either get access to your private key, or break modern security standards as we know it!
but there's probably an easier way
I will say though, depending on your concern for your privacy, an IP doesn't reveal that much information. Especially as a lot of ISPs will change your IP whenever your router disconnects, meaning you don't have a persisting IP. Mind, not all of them do it, but yeah.
There's not an awful lot the average person can do if they get your IP - maybe figure out your country or state, but beyond that it's very unreliable for location data. Unless you're being targeted by a hacker group, it probably isn't much of a concern.
If you are very concious about your privacy, you could set up a forwarding proxy or something to mask that IP while still allowing people to access through an IP, but that's not something I have experience in and it's probably overkill.
hm, i didn't make these ping replies so they might not see this, i should probably @weary matrix in case they get any use out of it
also im reasonably sure that if people are connecting to your server they can probably get your ip if they want anyway
well ppl always scare about exposing their ip to public, but still willing to give out phone number or address for online shopping 
using phone numbers for identification is dumb and i hope websites stop it :(
doubly so because they'll normally send text messages with codes and stuff, and sms is totally unencrypted!!!
ooh looking that up though it seems there's a new protocol called rcs that actually has an encryption
i'd rather we just do away with texts all together but that's something!
anyway sorry this isn't crunchys-tech-security back to zomboid with me
Anyone familiar with any mods that use evolved recipes for something that isn't cooking?
@ancient grail
how do vanilla animations like fire work? Is it made from the fire.frag and fire.vert files, because I see no tiles.
Tile animation
It can be found on the vanilla pack files
I just figured this out last night
do you remember the prefix or file?
nice
That's enough, I know where that is.
SteamLibrary\steamapps\common\ProjectZomboid\media\texturepacks\Tiles2x.pack
ah ok ill just leave it here still incase someone else wants to know
I assumed that since it was not in the tiles images zip, it would not be in this file and checked only all other smaller packs.
hi, we can have mods from server side?
hello everyone, i'm trying to remove visual iso square highlight for some reason. But there is so many classes about square. Is it https://zomboid-javadoc.com/41.78/zombie/iso/IsoGridSquare.html#IsOnScreen() ? Or maybe https://zomboid-javadoc.com/41.78/zombie/iso/IsoGridSquare.ILighting.html#bCouldSee() ?
Javadoc Project Zomboid Modding API declaration: package: zombie.iso, class: IsoGridSquare
Javadoc Project Zomboid Modding API declaration: package: zombie.iso, class: IsoGridSquare, interface: ILighting
Are you trying to hide an object or just remove highlight?
Hello
just hiding the highlight effect. I'm working on arsenal 2.0 compatible version of advanced trajectory mod. But one arsenal's weapon brings back this isogrid highlight
I'm not familiar with that mod. If it highlights an object or adds a square marker maybe I can help.
Since it's a weapons mod, maybe it's a muzzle flash.
this mod take over all the autoaim system, and calculate vectors based on mouseposition for projectiles. So it draws it's own mousecursor, and removes original ones. It uses square check to catch all targets data, but no square highlight should be seen. It works quite good atm but i found a shotgun that brings back this square highlight, so i would like to make it invisible. It's the same iso square highlight you can see for rightclick->move to feature.
Why the ping
Nah, these two are definitely outliers and probably luck on my part. Your mods are better performing on average.
Wdym?
Just on the server? No
move to uses setDrag and has a Lua cursor object
i already use setDrag and a lua cursor object with mousecursor as a parent. But maybe i dont understand everything you meaned
You can have only one dragged object. So stop the change or add your object again.
I remember you can use sprites in chat, does anyone know how?
Ah got it
me rn ^
you were right on the fact that i wasn't using set drag for this weapon mode XD. However, i tried to add it in my object initialisation like if not Advanced_trajectory.panel.instance and getSandboxOptions():getOptionByName("Advanced_trajectory.aimpoint"):getValue() then Advanced_trajectory.panel.instance = Advanced_trajectory.panel:new(0,0,200,200) Advanced_trajectory.panel.instance:initialise() Advanced_trajectory.panel.instance:addToUIManager() getCell():setDrag(Advanced_trajectory.aimcursor, 0) endIt runs, but it won't hide the green square
Youre the author of advance trajectory?
Does the square follow the mouse?
Usually that is drawn by the lua cursor every tick. Maybe it's as simple as setting to nil.
the square follow the mouse, but i don't know where this square come from. It's only on one weapon. I'm trying to set it to nil, but i'm strugling to catch only the display of the square. I'm not familliar with the use of IsoGridSquare. I just tried if IsoGridSquare.ILighting():getVariableBoolean("bSeen") then IsoGridSquare.ILighting():setVariableBoolean("bSeen",false) end But debug is just laughing at me
try getCell():setDrag(nil,0)
from console
just for debug, to find what is happening
if it works, then try doing this after the other mod's logic
nah i keep getting this green square, that's weird
Guys, what is the correct way to make in the zomboid Kalua a class, and make that class a singleton?
What are you trying to achieve?
I'm trying to turn this file: https://github.com/mxswat/pz-transmog-definitive-edition/blob/master/Contents/mods/TransmogDefinitiveEdition/media/lua/shared/TransmogDE.lua
Into a proper class, to tidy up the code, and I want to turn it into a class. And import an istance of that class using require
I think it's a good way to tidy up my code, but I'm open for suggestions.
So that instead of doing
TransmogDE.setClothingColorModdata(ogItem, TransmogDE.getClothingColor(ogItem))
TransmogDE.setClothingTextureModdata(ogItem, TransmogDE.getClothingTexture(ogItem))
TransmogDE.setTmogColor(tmogItem, TransmogDE.getClothingColor(ogItem))
TransmogDE.setTmogTexture(tmogItem, TransmogDE.getClothingTexture(ogItem))
I can do
self:setClothingColorModdata(ogItem, self:getClothingColor(ogItem))
self:setClothingTextureModdata(ogItem, self:getClothingTexture(ogItem))
self:setTmogColor(tmogItem, self:getClothingColor(ogItem))
self:setTmogTexture(tmogItem, self:getClothingTexture(ogItem))
Does this make sense @weary matrix ?
Not really but because i'm on my phone right now π
if your methods are statics, which mean the method is not used by an instance itself you wouldnt need to do this
Sorry but, what do you mean?
your current code look good enough
Making it a class that can be instanciated into multiple instance is only needed if you plan on running multiple instance
for example:
Static method
TransmogDE.getClothingColor = function(item)
is an utility method that you pass an item and get a result.
Instance method
TransmogDE:getClothingColor = function()
return self.item:getColor() --- just an example
end
In your case i think static is proper as it seem to be an API.
Okay, I see. But I do also have these two, that at the moment I'm accessing in some functions directly using TransmogDE.BackupClothingItemAsset
TransmogDE.ImmersiveModeMap = {}
TransmogDE.BackupClothingItemAsset = {}
As an example:
TransmogDE.getClothingItemAsset = function(scriptItem)
if scriptItem.getScriptItem then
scriptItem = scriptItem:getScriptItem()
end
local fullName = scriptItem:getFullName()
local clothingItemAsset = TransmogDE.BackupClothingItemAsset[fullName] or scriptItem:getClothingItemAsset()
return clothingItemAsset
end
And I don't know why, but this feels messy, and I'm not sure why. In general the code of this mod feels messy and even though it works, I don't feel super satisfied.
Then you need to find what exactly that mod is doing. π€
yeah sorry for that, i need help and i got told you could help me. i have a problem 1 of my 3 plushie appear at the wrong location on the backpack and i really don't know why, they have the same codes and location models :S
Are you making this plushie mod?
yeah, its more of a weapon pack, the plushies are just bonus lol
"the plushie mod is more of a weapon pack" is quite the sentence.
loll i added '' AttachmentType = SpiffoPlushie,
StaticModel = chocoboplushie,'' to it so it can work with noir attachment mod
amazing
this is the kind of creativity we need
Very smart I like that
re-export this model rotated 180 degrees on the X axis and translate it up in your 3d modeling program of choice.
ok will try thank you
Peach, since you are one of the pros of clothing modding.
Did you ever had a situation where after equipping at item, the model would not render properly?
And that this issue happens only with certain combination of equipped clothing? eg: A backpack, and a pair of trousers, will make the backpack model buggy once you wear the trousers
thanks for the help my friend, i had a deadline today, so i must move on. But you are right. I think this bug comes from an outdated/incorrect weapon definition from Arsenal(26), and is most certainly related to the boolean IsAimedHandWeapon. But it will have to wait before we get any answers.
are any of these models custom-made?
For testing mods with a friend, do I just have to ask them to drag and drop the mod into the workshop folder?
Or is there a few other feats I have to do?
lua is messy by default lol
The API is to blame here.
There's little consistency and that is defined by legacy code practices which are no longer at play.
^
My code is fixed!!!

Can anybody give me instructions on how to edit this for my character? Like via the lua console maybe? (the kills and time survived)
Edit: This post helped me out - https://www.reddit.com/r/projectzomboid/comments/mq8bxk/surviving_a_century_fake_it_till_you_make_it/
62 votes and 27 comments so far on Reddit
have you tried player:setHoursSurvived() and player:setZombieKilled()?
getPlayer():setHoursSurvived() was what worked in the end!
does anyone got a .x exporter
On windows there's plenty of tools to do it. Otherwise there's one for older blender release, but pz supports .fbx which is way easier to work with
i use ,x
Nope, vanilla models
Any clue about a simple example of using ISPanel? I just need a simple panel with some text and a button.
Probably a conflict in the bodylocation s
That what I'm suspecting. Should I move the body location? Like what the furry mod does?
yes exactly, thanks
Or is there anything else I can do?
Do body locations still have to be entered in order?
change around the bodylocations, some hide the rendering of others
If I recall there is no way to reorder them. You have to define them in entirety
Alright, I'll give it a shot. Thank you.
It is possible, i don't have the code now cause I'm on phone. But i saw that the furry mod does it. And it works very well.
I managed to find a way to make the vending machine, but I had to give up using an item as a machine. Anyway, the mod is looking like this:
you won't really see any mods doing this, they really aren't fit for anything but food
Thank goodness.
Hey y'all, could anyone tell me why my return value comes out as nil here?
function TraitTags:getPlayerTraitTags(player)
local playerTraits = player:getTraits();
local concatenatedTags = "";
local returnString = "";
local traitName = "";
--
--local test1 = getn(playerTraits);
--print(tostring(test1));
--
if playerTraits ~= nil
then
for i = 1, playerTraits:size() -1
do
local trait = playerTraits:get(i);
if TraitTags[trait] ~= nil
then
concatenatedTags = "";
for _,tag in pairs(TraitTags[trait])
do
if not returnString:contains(tag)
then
concatenatedTags = concatenatedTags..","..tag;
end
end
returnString = returnString..concatenatedTags;
end
end
end
return returnString;
end
So at the very end returnString has ",anthro,carnivore,human" buuuuut
d (the testing value that's supposed to store the result of getPlayerTraitTags()) is null
and so is a, which also returns a string.
I'm thinking maybe there's an issue with the way I have the function structured?
but for the life of me I can't see anything I'm doing wrong
add print and check what is going on in the console
The function looks fine to me. I'd immediately assume it's just a typo - lua is terrible and will just allow you to access variables that don't exist, and it causes endless headaches.
Just a reminder that is is now possible to write third-party documentation for PZ's API & JavaDocs for non-English languages.
Wow. It's been a long time since I've seen someone use 8-space Tabs.
You clearly use Linux. xD
Rip my heart out will ya? xD
How could someone make "Item Displays" like special shelves for the game?
Alright, I am racking my brain. Is there a way from one mod to completely disable an item from another. Not "replace it" but completely just nuke it.
I used getClassField to manually set Hidden to true on the Item, but if a player has it on them it just makes it undroppable π (and hidden so it "works")
I tried to manually peek into scriptmanager right after OnGameBoot to manually remove the item from all the points I can find but that as expected is causing all sorts of hell. Like it works, but there must be more reference to the item than I can find cause I then start to get all sorts of issues with rendering.
Basically, does anyone know a way to actually remove an item?
i can only imagine this causing endless issues
You can disable the mod
how can i create a custom keybind?
ModOptionsn has a relatively effortless way to do that.
it really does
Its like.. an endless pit of "oh so you thought you had it.. NOPE"
why are you trying to do this?
Pitstop is an awesome mod with a lot of cool stuff, but some of the items it adds are.. well.. a bit much
you can override the file that adds them as long as your mod loads later
well... they don't π
if you are about to tell me, i can jsut copy the txt file
and remove the items
I will go cry
if you have multiple script files with the same name and directory only the one that belongs to the latest loading mod is used
If I added a mod to the requirement in steam, that wouldn't break any servers right?
no, steam requirements don't do anything beyond the pop-up warning
I know adding required mods to the modInfo breaks servers cause dedicated servers don't get any warnings and just drop mods missing requirements
Thinking of starting to blanket require my errorMag mod π©
And maybe merge fingerPrint into it
Yeah that's a massive problem imho
Need to add that to the issues for community projects
Maybe there's something that can be done
add requirement on steam provokes the automatic update for steam servers. so if you pair it with the modInfo requirement, these servers won't have problems.
Should'nt the problems only come for clients using steam (and so having the auto update of the mods) while playing no-steam on a disconnected server? Or am I missing something ?
adding an item as a steam requirement won't make servers download that item
yeah not immediately, but at restart it should, no ?
no, server never automatically adds new workshop items
When I start my pz with steam, am I also wrong to think my subscribed mods update automatically ?
they do
thanx
steam requirements don't do anything besides a pop-up when you subscribe telling you to also get the requirements
oh, so I see why afterwards added requirements are leading to those quiproquos.
I thought steam doesn't update if you open the game?
tag Albion, they know better (than me)
@bronze yoke Can you update the game while it is open?
the game, probably not, if you mean workshop items, not sure
there's a steam setting to allow downloads while playing a game, not sure if that still blocks same game workshop though
I don't think it even activates the mod if it were to be downloaded either
I can download mods with Zomboid open
If you trigger a lua reload they'll be good to go
Makes sense, I remember disabling those now.
Hello there, I'm playing with GlobalObject and I did not find how to detect the client object destruction event. Any idea what I should use for that ? Could I use OnObjectAboutToBeRemoved or is it only server-sided ?
It triggers for the client on whose side it breaks but not for everything. On server it should trigger for everything I think.
Do you also know if it triggers for all objects loaded in the cell ?
What do you want to do exactly?
Would knowing when a client lua object is removed be enough?
yes
I'm displaying a gridmarker on a square with my IsoObject. I want to remove it from all client views when the object is removed
Server sends command and your system's removeLuaObjectAt function is called.
This would be triggered on all clients, even if square is not loaded.
Good evening.
Smart ill try this
Is there a way to preview a single clothing item in a UI box, like it's done in the Improved Hair Menu?
eg: in image
Like, is there anyway to instead of having a player, an object is rendered here? in ISUI3DModel
So fun fact, it shows as nil in the console but is actually there if you print it. Thanks
Does anyone know why this causes a black screen on mod load?
TraitTags = {}
local function sanitizeTags(tagString)
--remove all spaces, control characters, null, punctuation & symbols (except commas)
local workString = tagString:gsub('[^%w,]', '')
return workString;
end
function TraitTags:toString()
local returnString = "";
for trait, tagTable in pairs(self)
do
if type(tagTable) == "table"
then
returnString = returnString..trait..": ";
returnString = returnString..table.concat(tagTable, ',');
returnString = returnString.."; ";
end
end
return returnString;
end
...
function TraitTags:PlayerTagCountLargerThan(player, subjectTag, comparatorTag)
local stats = self:getPlayerTagStatistics(player);
local subjectIndexS, subjectIndexE = stats:find(subjectTag);
local comparatorIndexS, comparatorIndexE = stats:find(comparatorTag);
if subjectIndexS ~= nil and comparatorIndexS ~= nil
then
if subjectIndexS > comparatorIndexS
then
return true;
else
return false;
end
else
if getDebug()
then
print("TraitTags: PlayerTagLargerCountThan(): One or more of the given tags is null");
end
return nil;
end
end
ModData.add(TraitTags);
This is the last thing in the log
sounds like an infinite loop
My best guess is that I'm making global mod variables wrong lol
let me double check. Why do you say that?
no errors but endless black screen usually means an infinite loop
fair enough lol
i don't think this would cause the issue, but ModData.add() at lua load wouldn't work
moddata is save specific and lua loads on the main menu
actually, are you adding your whole class to moddata?
My hope was that I was creating a table with some functions in it and adding that to moddata
functions can't be saved to moddata, i think it might work until it tries to save anyway but it feels like you might be misunderstanding the purpose of moddata if you're trying to do that
local function TTInit()
ModData.add(TraitTags);
end
Events.OnNewGame.Add(TTInit);
So if I stuck this at the end, that's one problem fixed?
Gotcha, i think. I still need to put keep track of strings so that when the lua is reloaded the mod doesn't run on nil data haha
like whenever I make a change and save in my environment and reload the file, the data I need is cleared out and messes with my testing. That's why I was trying to shove it in a more persistent place
but I could still maybe... make a TraitTags object that gets returned and can use the functions I have? And I'll just have the tags I need in moddata?
if it's just for testing, you can just keep it in the global namespace and make sure your code doesn't overwrite it if it already exists
you generally only want to use moddata when you want data to be persistent to that save file
I definitely want this data to be persistent to the save file. Hopefully that will take care of it working in MP as well
I think I'm gonna try to separate the functions out from the data I need by turning all the "TraitTags:[function name]"s into "local function [function name]"s. Just unclear what to do with the "selfs" I have floating around. That won't automatically reference the TraitTags Table, will it?
And just an aside, this is the thing I was working on like a week ago that will allow you to assign persistent groups (defined by a tag) to traits, so if there's a gameplay mechanic you want affected by a trait (like a model, UI, or something), you won't have to code out the possibilities per trait, just per trait group (as defined by a tag)
My use case in particular is, if someone selects a trait like "Hoofed" from the Anthro Traits mod i'm in the middle of finishing, if they have Anthro Survivors installed, they could only select a species with hooves at character creation
@heady crystal did you figure out if reusable needles is worth being added to common sense
Hello again, Is there already a vanilla fully transparent sprite available ?
lua functions being assimilable to strings, it can be done.
hay guys is there a way to make the avatar panal in the character creation screen bigger ? ive been at it for a few days now but i cant figure it out - that or i cant get my file to show up in game ... this is what i have so far
https://pastebin.com/qCtPpw9d
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
https://steamcommunity.com/sharedfiles/filedetails/?id=2901615211 this mod probably does that
True and real lol... I'll see if I can get the same effect on the character creation screen
Sorry busy atm
all good
Still struggling with this. I have a github if that would help anyone?
Hmm I feel like it might be a bit different as I may need to modify characterCreationHeader to get the adjustment i want but I can't get it to show up in game
No you had two open brackets there
yup
i saw
omfg
i didnt even do the model code
What are you doing?
a weapon
im too tierd for this shit
but i really want to get this done
and i forgot how brackets work
{
-- Stuff
}
Next step - tetris π
dunno if this is a dumb question or not but is there any easier way to fill out a distribution file? like get AI to write it or something?
anything to just do it easily i dont wanna copy paste the code for an hour for 120 items π
Does this decrease my boredom in-game?
there are worse deaths than to dying by playing tetris.
Lol
how hard was it to make this?
oh man, flashbacks to the era of flash games...
must neatly stack.......
You could automate it if you know code, basically output a huge string that matches how the syntax you want
that's what I did/do, there's probably a tool chain somewhere that does it already
How hard would it be to make the squares smaller, but the items take the same space? Think Neo Scavenger style
Hello everyone
where am i wrong? The events are not triggered.
Thank you
Client-side
require("MyDebugServer")
local function onServerResponse(player, command, args)
print("onServerResponse")
--if command == "exampleResponse" then
-- local response = args[1]
-- print("Received server response:", response)
--end
end
local function sendServerRequest()
print("sendServerRequest")
local player = getPlayer()
sendClientCommand(player, "exampleCommand", "AAAAAA", {})
-- sendServerCommand(player, "exampleCommand", "AAAAAA", {})
end
Events.OnKeyPressed.Add(sendServerRequest)
Events.OnServerCommand.Add(onServerResponse)
--Events.OnClientCommand.Add(onServerResponse)
Server-side
local function handleClientRequest(player, command, args)
print("handleClientRequest")
local response = "Hello from the server!"
sendServerCommand(player, "exampleResponse", response, {})
-- sendClientCommand(player, "exampleResponse", response, {})
--if command == "exampleCommand" then
-- print("handleClientRequest")
-- local response = "Hello from the server!"
-- sendServerCommand(player, "exampleResponse", response)
--end
end
Events.OnClientCommand.Add(handleClientRequest)
-- Events.OnServerCommand.Add(handleClientRequest)
Client
require("MyDebugServer")
local function onServerResponse(module, command, args)
print(args[0])
end
local function sendServerRequest()
print("sendServerRequest")
local player = getPlayer()
sendClientCommand("MyMod", "exampleCommand", { "A" })
end
Events.OnKeyPressed.Add(sendServerRequest)
Events.OnServerCommand.Add(onServerResponse)
Server
local function handleClientRequest(module, command, args)
print("handleClientRequest - " .. args[1])
local response = "Hello from the server!"
sendServerCommand(module, "exampleResponse", { response })
end
Events.OnClientCommand.Add(handleClientRequest)
Sorry, Man but it seems like it's not working. I hosting the game on my PC, I don't have a server. Cloud this be the problem?
Thank you
Can you send console.txt?
I'm working on linux
How do i set a drainable water container's water level?
I want to completely drain the water bottle
Remove the water bottle and spawn in an empty bottle
I guess I could do it that way
but I also don't always want to remove 100% of it
id like to add future ability to only do 50%, 25%, etc
would it be as simple as setting self.item.waterUnit = WATERLEVEL;?
Then youd need to set its used delta i think i dont really know
Small change in client
local function onServerResponse(module, command, args)
print(args[1])
end
local function sendServerRequest()
print("sendServerRequest")
local player = getPlayer()
sendClientCommand(player, "MyMod", "exampleCommand", { "A" })
end
Events.OnKeyPressed.Add(sendServerRequest)
Events.OnServerCommand.Add(onServerResponse)
Sorry but nothing change.
Anyway thank you for your interest
This work on my PC in host mode
Can you confirm that it is working in your system?
Yep, this works
Okey Man, I reinstall the game and i will check my OS. Thank you
Is it possible to calculate the amount of indoor zombies?
I think you can get all zombies of cell and check how many of them indoor
As I was looking at Louisville pops
Apparently there are maps per cell how many spawn indoors
You can't check unloaded cells
I always wanted to fiddle with pop to get a quarter mil
Now I'm not sure whether to do 4.5 or 12x
I have deleted the Zomboid directory, and now your code is working. Thank you.
Heylo! I'm a newbie at Zomboid mod making π I'd like to be able to display a tooltip on hover, when the user hovers over Containers in the game.
I know that the functionality is probably somewhere in lua/client/ISUI.
Are there any other mods folks can think of that display a UI tooltip when hovering over items in-world? That I can look at to start with
self.item:setUsedDelta(1.0)
1.0 = 100%
0.5 = 50%
So, like the preview for this first aid kit - but just straight up displaying it when hovering over a container in-game without having to open it up.
It's not hard to make the squares smaller, items just look terrible though. The textures are meant for 32x32, which I designed around.
Cool cool,noted ^^
don't think i know of any mods that do that unfortunately
Thank you for the reply regardless π
I heard this is easy to use if you want to skip headache of getting familiar with PZ UI.
Does anyone here know if there is a way to make a trait mutually exclusive to an occupation/profession.
For some reason making traits exclusive to profession traits instead of regular selectable traits doesn't seem to work
Does anyone know if its possible to add new information and numbers in this area (circled) which would have different numbers for each vehicle?
i know this is a dumb question, but how do i get started with making a food mod? i've been wanting to make a mod that adds some more snacks/foods (ex. bottles of juice, chips, candy, etc.), yet i have no idea where to even start from. i checked google, and no useful info appeared. could someone lend me a helping hand?
(plus i have like really slim modding experience, having made only 3 mods (two of them being addons)
Probably you could start there https://pzwiki.net/wiki/Modding#Creation_of_mods
In the Beginner level you have the Mod structure and Script Syntax which is the bare minimum you require.
Then you could review some of the mods in the workshop to see how they do it
awesome, thanks! though it really sucks that basically all of the links don't direct to anything anymore :p
This is for EmmyLua. Same goals.
very nifty
It's already ready to use.
i just might have to learn ts, god dang
This isn't for TS.
That's PipeWrench.
You could mix TS and Lua and use both typings too.
Didn't another guy use Umbrella as base for another tool? π€
I wouldn't know. I made a logo so mine is official. =P
This is a collaborative effort BTW.
Ah cool!
I rewrote the PipeWrench Java API generator for Candle.
Candle is my Java API rendering tool for Umbrella.
Wow Impressive!
Candle does something else.
I wrote a project called PZ-Rosetta which scrapes the JavaDocs and saves documentation from PZ's official code like parameter names to a Yaml dictionary.
That data is picked up and rendered with the exposed Java API.
So basically (arg1, arg2) is replaced with (x, y)
PZ-Rosetta opens the door for modders to add to the documentation too, in non-English even.
oh that's pretty sweet
man you three are like mod dev tool all star team
I'd like to activate the Russian modding community when I write a tool to make this process easy to do.
Would be sick to see a flavor of Umbrella with Russian documentation on the game's API.
it also includes my event stubs, which are generated using, as far as i know, the only up to date event schema
I'm drafting a Yaml schema right now but:
https://github.com/asledgehammer/PZ-Rosetta
- name: invokeOnPlayerInstance
modifiers:
- public
- static
return:
type: void
notes: >-
The IsoPlayer.instance thread-safe invoke.
Calls the supplied callback if the IsoPlayer.instance is non-null.
Performs this in a thread-safe manner.
It is intended that, should any thread intend to use the IsoPlayer.instance, and does not want another thread
to change the ptr in the meanwhile, it should call invokeOnPlayerInstance(Runnable callback)
eg.
IsoPlayer.invokeOnPlayerInstance(()->
{
IsoPlayer.instance.doStuff();
}
Stuff extracted from the official JavaDocs.
could somone help me with my brackets
@red tiger didn't you make a tool to check if brakets in a script item are correct?
they are wrong
ZedScript extension on vscode?
but idk why
You don't post the entire script yet ask about bracket issues?
it just is red on vsc
Walk through your file.
im booting vsc up
{
}
item Naginata
{
MaxRange = 1.55,
WeaponSprite = Naginata,
MinAngle = 0.8,
Type = Weapon,
MinimumSwingTime = 2,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = Improvised;Spear,
ConditionLowerChanceOneIn = 10,
Weight = 1.5,
SplatNumber = 1,
PushBackMod = 0.3,
SubCategory = Spear,
ConditionMax = 12,
MaxHitCount = 2,
DoorDamage = 10,
SwingAnim = Spear,
DisplayName = Naginata,
MinRange = 0.98,
SwingTime = 2,
KnockdownMod = 0,
SplatBloodOnNoDeath = TRUE,
Icon = Dudclub,
RunAnim = Run_Weapon2,
IdleAnim = Idle_Weapon2,
TreeDamage = 0,
TwoHandWeapon = TRUE,
CriticalChance = 30,
CritDmgMultiplier = 10,
MinDamage = 1.3,
MaxDamage = 2,
BaseSpeed = 0.9,
DamageCategory = Slash,
DamageMakeHole = TRUE,
BreakSound = SpearMacheteBreak,
HitFloorSound = SpearMacheteHit,
ImpactSound = SpearMacheteHit,
DoorHitSound = SpearMacheteHit,
HitSound = SpearMacheteHit,
SwingSound = SpearMacheteSwing,
AttachmentType = Shovel,
Tags = FishingSpear,
model Naginata
{
mesh = weapons/1handed/Naginata,
attachment world
{
offset = 0.0000 -0.1660 0.0070,
rotate = -180.0000 0.0000 0.0000,
}
}
}
}
there
item Naginata {
MaxRange = 1.55,
WeaponSprite = Naginata,
MinAngle = 0.8,
Type = Weapon,
MinimumSwingTime = 2,
KnockBackOnNoDeath = false,
SwingAmountBeforeImpact = 0.02,
Categories = Improvised;Spear,
ConditionLowerChanceOneIn = 10,
Weight = 1.5,
SplatNumber = 1,
PushBackMod = 0.3,
SubCategory = Spear,
ConditionMax = 12,
MaxHitCount = 2,
DoorDamage = 10,
SwingAnim = Spear,
DisplayName = Naginata,
MinRange = 0.98,
SwingTime = 2,
KnockdownMod = 0,
SplatBloodOnNoDeath = true,
Icon = Dudclub,
RunAnim = Run_Weapon2,
IdleAnim = Idle_Weapon2,
TreeDamage = 0,
TwoHandWeapon = true,
CriticalChance = 30,
CritDmgMultiplier = 10,
MinDamage = 1.3,
MaxDamage = 2,
BaseSpeed = 0.9,
DamageCategory = Slash,
DamageMakeHole = true,
BreakSound = SpearMacheteBreak,
HitFloorSound = SpearMacheteHit,
ImpactSound = SpearMacheteHit,
DoorHitSound = SpearMacheteHit,
HitSound = SpearMacheteHit,
SwingSound = SpearMacheteSwing,
AttachmentType = Shovel,
Tags = FishingSpear,
model Naginata {
mesh = weapons/1handed/Naginata,
attachment world {
offset = 0.0000 -0.1660 0.0070,
rotate = -180.0000 0.0000 0.0000,
}
}
}
}
ty
If someone wants to help explain these fixes, please do. Am at work.
Figured it would be best to simply show you the format.
what was wrong
no module and unbalanced brackets
I'm going to go mad if b42 doesn't have formatted scripts.
oh
can somone help me my model doesnt show ingame but i think its all fine
module Base {
item Naginata {
MaxRange = 1.55,
WeaponSprite = Naginata,
MinAngle = 0.8,
Type = Weapon,
MinimumSwingTime = 2,
KnockBackOnNoDeath = false,
SwingAmountBeforeImpact = 0.02,
Categories = Improvised;Spear,
ConditionLowerChanceOneIn = 10,
Weight = 1.5,
SplatNumber = 1,
PushBackMod = 0.3,
SubCategory = Spear,
ConditionMax = 12,
MaxHitCount = 2,
DoorDamage = 10,
SwingAnim = Spear,
DisplayName = Naginata,
MinRange = 0.98,
SwingTime = 2,
KnockdownMod = 0,
SplatBloodOnNoDeath = true,
Icon = Dudclub,
RunAnim = Run_Weapon2,
IdleAnim = Idle_Weapon2,
TreeDamage = 0,
TwoHandWeapon = true,
CriticalChance = 30,
CritDmgMultiplier = 10,
MinDamage = 1.3,
MaxDamage = 2,
BaseSpeed = 0.9,
DamageCategory = Slash,
DamageMakeHole = true,
BreakSound = SpearMacheteBreak,
HitFloorSound = SpearMacheteHit,
ImpactSound = SpearMacheteHit,
DoorHitSound = SpearMacheteHit,
HitSound = SpearMacheteHit,
SwingSound = SpearMacheteSwing,
AttachmentType = Shovel,
Tags = FishingSpear,
model Naginata {
mesh = weapons/2handed/Naginata,
attachment world {
offset = 0.0000 -0.1660 0.0070,
rotate = -180.0000 0.0000 0.0000,
}
}
}
}
i had to update my code a bir
Hi mod makers
I'm going to ask, how difficult would it be to make agorophobic not mutually exclusive with adrenaline junkie?
@tame mulch Here's some examples of the Umbrella project.
https://i.imgur.com/PROEzfI.png
https://i.imgur.com/5uFUlty.png
https://i.imgur.com/yXU0BsA.png
Very cool!
I'd like to get this project exposed to the public. Let me know what I can do if you have ideas for that.
Might make a steam guide, a forum post, and a reddit post.
- pin here and on pzwiki
I can't pin posts here. I did push this project to the PZWiki.
I think It's not problem to ask for pin this tool in this chat) Just need check who can do this
I wish that Git would allow media embeds for git projects to show a graphic for the repository and not the account / org's picture. =(
Any clue if TIS fixed their broken RCON implementation?
What was broken about it? Just curious
I think not yet. I hope request about RCON on TIS forum?
This looks similar to what I've been experiencing: https://theindiestone.com/forums/index.php?/topic/49257-rcon-times-out-88-of-the-time-when-using-rcon-pip-package/#comment-342653
41.65 Multiplayer. Dedicated. No. Reproduction steps: pip install rcon rconclt @127.0.0.1:27033 help The rconclt command hangs forver in about half of the cases. server log when it succeeds: LOG : General , 1645268810174> 1,664,515> RCON: new connection Socket[addr=/...
I needed to spawn a car when the onCreate function was called in the recipe script on the multiplayer server, could anyone help me? it seems that addVehicleDebug does not generate the car on the server
it's unreliable. If you use a standard rcon client, sometimes the command will work, but the following commands won't work
Use /help command in server console, there's a command to add vehicles
My use of it was odd because I'd be getting back the return of the previous command.
Ah also just found out the post I made about it: https://theindiestone.com/forums/index.php?/topic/46783-rcon-returning-invalid-responses/#comment-340747
On occasion, using rcon cli or rcon libraries for python, and even python-valve the rcon server returns empty byte responses and causes exceptions with these libraries. It's hard to pin down when it happens, rcon-cli has been the most stable but still on occasion gets a dead response from the PZ ...
I'm creating a mod that spawns a car when creating an item, I needed this to work through the script. It's working in solo but needed it for multiplayer
Is it possible to create a mod that adds new information in the mechanics menu?
local command = string.format("/addvehicle %s", "Base.Van")
SendCommandToServer(command)
hmmm, wait. It will works only for admins
You need for any player?
yes I am creating a car shop that spawns a car when making the recipe
I need to write a Steam guide on how to splice PZ mods to write exclusive content on servers.
The code is already provided to make this possible.
It utilizes the Lua BufferedInputStream API to separate code that is then bootloaded into the mod after requesting it from the client-side via mod.
Try to check if this logic can be reproduced from Lua. This code is from the /addvehicle command in the engine:
IsoGridSquare square = ServerMap.instance.getGridSquare(int1, int2, int3);
if (square == null) {
return "Invalid location " + int1 + "," + int2 + "," + int3;
} else {
BaseVehicle baseVehicle = new BaseVehicle(IsoWorld.instance.CurrentCell);
baseVehicle.setScriptName(string);
baseVehicle.setX((float)int1 - 1.0F);
baseVehicle.setY((float)int2 - 0.1F);
baseVehicle.setZ((float)int3 + 0.2F);
if (IsoChunk.doSpawnedVehiclesInInvalidPosition(baseVehicle)) {
baseVehicle.setSquare(square);
baseVehicle.square.chunk.vehicles.add(baseVehicle);
baseVehicle.chunk = baseVehicle.square.chunk;
baseVehicle.addToWorld();
VehiclesDB2.instance.addVehicle(baseVehicle);
return "Vehicle spawned";
} else {
return "ERROR: I can not spawn the vehicle. Invalid position. Try to change position.";
}
}
I found! You need send command to server from client and on server call function addVehicleDebug
Is it even possible to create a weight system for every vehicle to be different and show hiw much the vehicle weighs in the mechanics menu? I think it would be cool if it was possible but do not know where to start in creating a mod like this
I think I understand, I'm still a beginner in Zomboid mods, I didn't quite understand how to send commands to the server. I will try this today, thank you very much!
The weight of the vehicle is already listed on the mechanics GUI
And it does have an effect over vehicle's performance, its just not that noticeable
Check my messages above in this chat. I send some info about commands today or yesterday
Okay
MapRemotePlayerVisibility anyone know where this is handled?
i mean. not the ini, but the lua side
Sorry for the late reply. I wanted to make newer system with weight affecting towing. Example if you were towing more than your vehicle could handle it would slowly destroy the tires and frame.
is this not how it is in vanilla?
Not to my understanding... but if it is, then it would be atleast more visual... showing numbers and such
In java
thank you
Not the frame on itself, but yes, that's how it pretty much works in vanilla lol
Then again, its not that noticeable due to how vehicles handle
Notice how you can only reach high rpms in reverse with Speed Demon
Never not a golden opportunity to Java mod. 
Hum my link to the fresh export from Albion's events tool is down. Anyone knows where I can find one ? (wiki is still on B41.65) @bronze yoke
oh, i didn't realise there were links about - i moved it to https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
awesome thx
i don't expect it to move again, the project was very disorganised before this
no worries reorganise as you want
hi guys, we can centered a ISUIElement or just set x,y position?
you can calculate manually where center by using getWidth() and calcs
and then use set x y
ahh okey
and u know any tutorial to create ui elements?
walked me through the documentation
No link to Umbrella? xD
it's not the stubs, it's just an md reference
Exist UI lib mod in steam. no guide exist now as I know. I plan in future do it)
RadialMenu drawCircle API call when?
Also AngelCodeFont API support for ISUIElement font draw calls when?

I'd like to round the corners of my UI.
Nah, nice square boxes βΉοΈ
everything exposed that you can grab an instance of
Hmmm, it's not very easy. Need check OpenGL for good solution for this
Oh dw, there's two ways to do it.
Actually 3. One is annoying.
Draw round corner sprites?
GLSL can be used to draw and discard areas of the screen that can be calculated to create these round corners.
You can also draw polygons with GL11 calls using radius and resolution.
This could be achieved using the BasicSpriteRenderer implementation yall have.
You can do sprites but this limits to what's available.
PZ doesn't actually have any communication layer between GLSL shaders and Lua.
This would make the GLSL approach not possible.
I modded PZ's core render code to see if UI shading would be possible and useful. Spoiler Alert: It totally is.
So much so that I'd give my async Shader Uniform API if TIS were willing to modify it how they see fit and implement it.
We have some plans about UI. But not for 42
hi again, what is this params:
InventoryItem(String module, String name, String type, String tex)
how can i get a player inventory
Would it be a possibility to get such an API implemented if an already complete example were provided?
I'm talking about GLSL Uniform accessibility, not UI implementations.
That's a separate thing.
Can you write me detail about this in pm? I will think about it
Sure thing.
how can i get InventoryItem when dragging a item with the mouse?
What exactly you want?
I want that when I drag a weapon to a box I have created with ISUIElement, this weapon is equipped on the character.
Isn't it (not at a computer) ISMouse.dragging?
There's a static object the inventory populates with the stack of items your dragging
The property name is definitely .dragging
ISMouseDrag.dragging
Ye thx
One question, is it possible to modify an already created mod to fix or change some functionality and use this modified mod on my server and have other players use this mod?
you'd have to request permission from the author of said mod. Alternatively, depending how the mod is developped, you might be able to replace functions from this mod at run time. In that case you don't need to ask permission.
I wonder if a modder who couldn't get permission and rewrote a better take on the same mod idea got taken down.
Silly mod drama things. x)
I hope, yes. e.g. I corrected Achievements from Nolan. If he is not happy with my version he should be able to take it down.
Well I'm no law expert but I think in most countries it would OK as long as you didn't take any code from the original mod, because ideas don't belong to someone unless they're patented
if you used code from the original mod then it would be obvious copyright infridgement
Yeah I specifically meant a "Clean Room Design".
What's the diffference betwen onGameBoot and OnGameStart?
I specifically write code with the understanding that I can use that approach more quickly as a CRD approach to avoid legal issues.
OnGameBoot is called at main screen while OnGameStart is called when your new or saved game is loaded
Boot is when the game loads fully after lua files are loaded. Start is when the player clicks on the black screen to start the game.
Okay makes sense thank you
Jab I am using your library to transpile TS to Lua, but I see that there are types that do not appear in the java doc, is this ok?
hum, I'm getting a weird behavior with mod dependencies. I have two mods with require=MySuperMod in their mod.info. When I try to enable first mod, it correctly enable MySuperMod, but not for the second one. Any clue what might be the culprit?
I double checked for typos etc
arf, I had the non-working mod in a modpack I subscribed for testing π
but isn't Zomboid/mods supposed to take precedence over steam mods?
I had the same issue, I remember it had precedence, but something has changed
it seems inconsistent
Anyone know of a mod that provides a hub like environment?
i've had cases where either one takes priority, and i've even had strange cases where the local mod takes priority but the sandbox-options.txt from the workshop mod is loaded
something like a hypixel hub?
@gilded hawk @bronze yoke thx for confirming I'm not crazy π
@tame mulch Any plan to have a fully working implementation of loadstring()?
it seems to be working for simple values/expressions but for example functions and events seem to be ignored/missing when loaded through loadstring()
So this is because the docs exposes more than the game's API allows you to access.
I'm probably doing something wrong... would that be it? This gives an error on sendClientCommand()
-- Arquivo media/lua/client/client.lua --
AUESP_Economia = AUESP_Economia or {};
AUESP_Economia.commands = AUESP_Economia.commands or {};
function AUESP_Economia.sendCommandToServer(module, command, args)
local player = getSpecificPlayer(0);
sendClientCommand(player, module or "AUESP_Economia", command, args or {});
end
Events.OnServerCommand.Add(function (module, command, args)
if module == "AUESP_Economia" then
if AUESP_Economia.commands[command] then
AUESP_Economia.commands[command](args);
end
end
end);
-- Arquivo media/lua/server/onTest.lua --
AUESP_Economia = AUESP_Economia or {};
AUESP_Economia.commands = AUESP_Economia.commands or {};
function Recipe.OnCreate.BuyCarChevalierCeriseWagon(items, result, player)
local sortnum = ZombRand(2);
local arguments = {};
if sortnum == 0 then
arguments["vehicleName"] = "Base.CarStationWagon";
else
arguments["vehicleName"] = "Base.CarStationWagon2";
end
AUESP_Economia.sendCommandToServer(player, "AUESP_Economia", "SpawnVehicle", arguments);
end
-- Arquivo media/lua/server/spawnVehicle.lua --
AUESP_Economia = AUESP_Economia or {};
AUESP_Economia.commands = AUESP_Economia.commands or {};
function AUESP_Economia.commands.SpawnVehicle(player, args)
local vehicleName = args["vehicleName"];
local vehicleSkinID = args["vehicleSkinID"];
local isoDir = args["isoDir"] or IsoDirections.S;
local coordToSpawn = player:getSquare();
local vehicle = addVehicleDebug(vehicleName, isoDir, vehicleSkinID, coordToSpawn);
end
what exactly need?
hello aitreon
Hi!
what error?
@tame mulch BTW that Rosetta project that is extracted details from the JavaDocs? I'm writing a software that allows third-parties to generate their own docs. This will open the door for projects like Umbrella to support Russian-translated / Russian-written docs.
?
nevermind, sorry, just realized I had to call it like this loadstring(data)() and not like this loadstring(data)
now it seems to be working perfectly
wondering why though π
I use PZ-Rosetta as a library to sprinkle over Candle, the Java API portion of Umbrella.
maybe some value is nil?
You could modify this dataset with non-English documentation.
arg parameter names becomes the names from the docs, and even their TIS documentations are brought over.
aitreon is it allowed to retexure vanilla cars?
This is need? I think English is enough. Anyway without knowing English is very hard to code PZ mods
why not?
thanks
I'm not sure but it looks like you're passing a value that java tries to cast to something it shouldn't
=) It's a want. It's a creative way to help modders. It'll be there for them when they want to do that.
i would assume its for people that cant speak english which is most of the population
so it makes sense
Okay, I don't understand what you want from me? π
I thought I'd let you know. Perhaps you'd find it interesting.
Modders could document where is needed.
English aand non-English.
Yep, this is cool option
We are all patchworks of knowledge on how things work.
your sendCommandToServer function takes three arguments but you are passing it four
something is jumbled there
This screen appears
Use {arg1=foo, arg2=bar} instead of arg1, arg2. It's not a varargs.
in this case, you are passing the player object as the module
@magic halo AUESP_Economia.sendCommandToServer(player, "AUESP_Economia", "SpawnVehicle", arguments); means you are calling
function AUESP_Economia.sendCommandToServer(module = player, command = "AUESP_Economia", args = "SpawnVehicle")
everything's jumbled so it breaks when it tries to call the java method which is expecting completely different parameters
OMG, I fixed what you said here and it worked perfectly! Thank you very much! @bronze yoke
Thank you for your patience guys, I really appreciate it
glad to see my assumption was correct π
I'll send here a preview of the mod
I will try to correct the vehicle positioning now
@heady crystal what was added in the most recent update for common sense
Check the update notes 
it doesnt say anything for may 30
just 2.1.0
whoops
my dumbass
sorry for pinging you
i shouldve read more
aww
It's okay
no reuseable needles
I am working on an update right now
T_T
But it's coming next week or so
Can't update too frequently
It includes a ||sound overhaul||
I only found this about resugin needles so far:
I'd have to find a surgeon to make sure
its more a matter of keeping it clean
so you dont get infected
also
mod reccomendation
zombie bites cause deep wounds
cause ya know, flesh getting torn off you is probably gonne be a little deep
@sage eagle
I'm struggling to debug my mod - I can't see any of my print() commands come through to the debug log. Does anyone have a recommendation of an easy Events hook I can hook into & trigger on command just to test a simple print to console command?
OnPlayerMove
Thank you π
Hey guys/gals, I'm working on a mod that removes bandages/wounds from spawned zombies. Giving them a cleaner look. Does anyone know which .lua file contains the logic for that? I've been scanning around for a couple hours and haven't been able to find it.
I'm working on a mod to adjust stats on food and everything's working fine but I want it to ignore unopened canned food because unopened canned food shouldn't display stat changes. I'm new to modding and to adjust the stats of those foods I tried to call on the CantEat line in items_food.txt but no matter how I try it just calls nil. I have no idea what I'm doing and my girlfriend can't help me at the moment so I was wondering if anyone here had any ideas.
Check IsoZombie.java maybe?
I thought it was too difficult to adjust stats on food, so I went around it and adjusted hunger, et. al. after eating
Or i guess it didn't really fit my use case. But that's an option
I'm trying to adjust the happiness and boredom on food. I'm basically making a mod to randomly assign your character picky eater traits, so certain foods make you happy and certain make you unhappy
can you show the code you're using?
And like I said it's all working for the most part so far, but I want canned foods to not display that they make you unhappy when they're unopened. I figure I just need to multiply the unhappiness and boredom by zero but like I said I have no clue how to call upon the canned food specifically
oh, i think they actually have a special property...?
I'm pretty sure there is an IsCanned or IsContainer property
There is, but that affects both opened and closed canned food
ah, i see that now
The only variable that closed canned food has that opened canned food doesn't is CantEat = True
those properties don't seem accessible...
So why are you trying to adjust the cantEat line when you just need to change its happiness values?
i think they're just trying to automatically detect these items
Yeah, I am, I'm trying to detect if CantEat = true then unhappyness * 0 etc. essentially
a hacky way could be to regex the item name, or check the model as they seem to all have CanClosed as their static model
it might not interact nicely with modded food though
imo this is your best bet
i feel most mods will probably follow the item name pattern
worse comes to worst you can detect if said food-adding mods are activated and do the same thing you're doing now to the applicable foods
I appreciate the help. Like I said, it's my first mod and I have no modding experience. My girlfriend is the one with all the experience and knowledge but she's asleep and she recommended I check here if I have any problems.
you could save yourself the regex and just go if luautils.stringStarts(name, "Canned") and not luautils.stringEnds("Open")
that seems like it would catch all the vanilla closed food cans
Base.CannedCornedBeefOpen
Base.CannedSardinesOpen
base.OpenBeans
base.CannedCarrotsOpen
base.CannedCornOpen
base.CannedFruitCocktailOpen
base.CannedPeachesOpen
base.CannedPeasOpen
base.CannedPineappleOpen
base.CannedPotatoOpen
base.CannedTomatoOpen
base.TinnedSoupOpen
pretty sure these are the IDs of all the vanilla opened cans
OpenBeans 
yeah i need to double check that one lmao
it seems correct
This isn't a thing in-game?
tinnedsoup too... this is a pain
i guess you'd just have to have special exceptions for those two, and hope mods don't deviate too much
TunaTin 
@fading horizon
Did you happened to see the last suggestions I made in Backpack Flags?
yeah, i think if you combine that pattern with a lookup table of special exceptions it might work
yes, i've just been really busy with other things
Steam nuked All of the comments I ever did
Thank you both 
Because I tried to share a translation to a mod with a Google Drive link
i'm able to see them still
since i'm admin of this mod
that's cool actually
didn't know that
That's good
this is what ive been working on recently
prosthesis mod
i'm also about to upload another mod rn
Oh, cool
Thank you! I haven't checked those yet
Omg prosthesis would be so cool
boss...
i tried playing the game earlier...
game kinda boring
making mods is more fun
lol
I'm guessing that you cant get scratches or anything on artificial limbs, it'd be interesting to see how you deal with them being damaged
Sekiro and The Walking Dead come to mind for the potential with Prosthesis
Like Armor/Weapons getting damaged over time
Berserk cannon arm lol
The first for how the damage works, the latter for how repairing them does
albion if you don't mind me asking, where were you grabbing those IDs from? You seemed to be looking at them pretty fast
I think it's about the possibilities
wait no ultimate zombie movie prosthetic, Ash Williams chainsaw arm
i just opened up the script file π
in notepad no less
Heck Yeah
pff rip
you could quite easily write regex to extract item names if you needed something like that
Well, I went through the game's debug mode item spawner thing
that's probably faster
I missed the tuna so I want to slap that into a file I have
an item browser might be a fun tool... out of my depth though
the event stub generator is the deepest i've dove into tool creation
Hey by the way, are you going into the gui to adjust these values manually at all, or just changing the item stats? If so, how do you change them per-player?
I am not a very technical person so I don't know if I know how to answer. My girlfriend has helped write a good deal of the code. I really have like no clue what I'm doing without her 
I can do very basic functions and that's about it
fair enough. I'm doing the same concept with my mod that I've been working on (for too long)
I was curious to see if there was a better way to do what I was doing, and if not whether or not I could help
I'm not the best person to ask. My girlfriend recommended I look at other people's similar mods for ideas on how they handle things and that has helped a bit but I haven't found anything exactly like what I need. I've found some that come close that have helped a bit, but my mod got a bit more complicated 
Well, if you need help feel free to ask. I threw up my code on github so feel free to take a look
I referred to the mod Dog Food Isn't That Bad for a large part of the coding for picky vs. non-picky eating, but as I said it's not perfect because I need to make multiple categories of picky eaters so you can be randomly assigned multiple traits and stuff
So you take the trait and the categories you don't like are randomly assigned?
Yes, it's part of a larger mod
that sounds pretty fun, if you could choose it'd likely get pretty stale
Not to mention the meta. I can imagine going someone going "Lets get some free points by taking Picky Eater: Insects, cause no way in hell am I gonna eat those anyway lol"
I really like the Neurodiverse mod and wanted to make my own addon for ASD since me and my girlfriend both have it. I thought the neurodiverse mod was really cool to see myself represented in game, but I wanted to make my own contribution and make a similar mod.
Yeah, it adds ADHD, Tourrettes, Alzheimers and Bipolar Disorder. It's not perfect but it's really neat and as someone with tics I love the addition of playing the game with tics.
Kind of hate the implementation of ADHD in extra traits or whichever trait mod it is.
"Bahh I can't read without my antianxiety pills"
i'd consider making a mod to represent my own neurodiversity but i'm not quite sure what the mechanical implications of 'likes my little pony a bit too much' are
Multiplied unhappiness gain if you spend too many hours away from MLP figurines / tapes
lol
You can make VHS episodes of MLP lol
With your own little scripts of your fav characters
hehe i've considered it but needing to write a couple vhs tapes has had an update for my literacy mod held behind... maybe a year now...? so i know my limits LOL
Gotta collect em all
My plan is to make Autism randomly assign you picky eater traits, make you stressed by noises and certain sensory factors, and you have special interests that manifest as randomly assigned stat bonuses. It's not perfect but like I said I wanted to feel represented in gameplay a bit, and if other people felt represented or it spiced up other people's gameplay then I'm glad
I think the stressed moodle is underutilized so good on you
By the way.... anyone know how to change up load order?
in vanilla singleplayer it's just alphabetical
I think my AnthroTraits mod is loading before my TraitTags mod and--
yep that'll do it lmao
i think if you require a mod it'll load that one first
otherwise you can just require that mod's files
which you'll need to do anyway if your mod is written modularly
if you have mod manager you can move them around and servers can do that anyway
though lua requires are always respected
hmm, maybe those doesn't enforce load order then
they don't throw errors in the traditional sense
it's more like they throw warnings (though the warnings do say error iirc)
they won't make a stack trace or pause the game or anything
one of the less important advantages to using modules is things break in a more obvious way when the require fails π
I'm not aware of what modules are qwq
it's basically what you're doing, but instead of adding your table to the global namespace, you keep it local and have the file return it
then when you want to use it in another file, you do local myModule = require("etc")
it avoids polluting the global namespace, and it just runs faster
it's how you're supposed to write lua, but most modders don't pick up on it because the vanilla lua is not done properly 
Albion :l do you think we could talk in a VC here and I can stream my workspace and ask you some questions? This TraitTagsFramework thing has been really kicking my ass the past couple of days and I'm fighting to keep up the enthusiasm to get my AnthroTraits mod to the finish line
i'm sorry, i don't vc, but i'm happy to give you any advice
No worries. Let me see if I can try to collect my thoughts real quick
So I definitely shouldn't be doing this
No global ModData. No Global functions. Just a local module.
if TraitTags contains your functions and stuff, yeah, definitely not i'm afraid π
I can probably figure that out without asking too many questions, but then I'm stuck with the original issue of where do I put the table? It needs to be remembered if the lua gets reloaded, a server gets restarted, etc
if lua gets reloaded, won't the module reload too? i don't quite understand the issue
unless the trait tag table gets populated during gameplay or something and isn't necessarily going to be the same every time it's run with the same settings (and needs to stay the same despite that)
It does. Let me show you
Events.OnGameBoot.Add(initAnthroTraits);
``` is where this section of code runs
Maybe there's a better way to plug in the data than this? I think I'm starting to understand my path forward
My thought is to keep the functions out of the table itself by keeping it local, and creating the table in the TraitTagFramework files. Still I'd be adding the TraitTags table to the global moddata table, but I could only interact with it through the module (interacting being your standard CRUD functions and some statistics)
I hope I'm making sense. I have a bad habit of using imprecise language in situations like these lol
i don't think i understand, if lua reloads won't this code just run again and you end up with the same table?
I don't think the OnGameBoot event runs again, only once when you start the new game
i think you're misunderstanding OnGameBoot, that fires when the game reaches the main menu and after lua reloads
O_O
If that's the case, then why does everything added to TraitTags get wiped after a reload? My testing functions always errored out after a reset saying they were nil
if you did need to keep it persistently (i don't think you do), this is sort of how you'd do it, though normally you'd just keep the table of tags in moddata and not the entire module
that's a good question, i don't really know
keep in mind though that the vanilla traits are set up by ongameboot, so if it doesn't fire, traits shouldn't work either...?
As far as I know they did. Oh god, I have to do a lot more testing
well, when i say that i mean that the issue is probably elsewhere, because traits definitely work after lua resets
is your file in the server folder? ongameboot behaves strangely there
I think I understand what my path forward is now at least. I'm changing all the functions in TraitTagFramework.lua to local functions that aren't inside a table local function add(traitName, tags), still adding the data table to ModData, but calling the module and interacting only through that to affect the table.
Nope, is that how you test in MP?
if you want to call it from outside the file you need to add the functions to a local table and then return that
this is the basic structure when we talk about modules```lua
-- myModule.lua
local myModule = {}
myModule.foo = function()
print("bar!")
end
return myModule
-- another file
local myModule = require "myModule"
myModule.foo()
So I couldn't do
TTF = require("TraitTagFramework");
...
TTF.add("TraitName", "Tag1,tag2,tag3")?
OH i see i think
you can keep things completely local if you don't want other files interacting with them (or if you want to control interactions with them by only giving them functions to interact with them and not the object itself)
Oh lord. So this is the lua equivalent of encapsulation
yeah, though most people don't bother with stuff like that and just throw everything in the module
That's kinda gross to me lol. I've always been strong in OOP so I've been consistently wondering how to make my code "cleaner" in that way
I should make a wiki page about this
keep in mind that you should keep it local or it basically defeats the purpose of using modules
so this is where it gets a little messy. How do I separate the data table from the function table?
TraitTags = TraitTags or {}
is what I have. Should I add another one like
TraitTagsFunctions = TraitTagsFunctions or {}
and use that one...?
i'd just do TraitTags.tags = {}
TraitTags = TraitTags or {}
TraitTags.tags = TraitTags.tags or {}
So like this you think?
i should mention that if you're working modularly, TraitTags = TraitTags or {} has no meaning since that's for ensuring multiple files with the same global table don't overwrite each other - instead you'd just do local TraitTags = {}, and if it is defined between multiple files just require the first file
I'm adding the or bit just in case another modder happens to use this and this module gets calle--
buh
Ah okay I get that I think. I saw that in Moodle Framework and thought that was... just the way to do it lol
it's another solution to the problems that modules solve better
π€ but that makes sense I guess. The module itself can be local, but the data is floating in ModData. So other mods using the framework at the same time could have their own instance of the function table, but they'd all be accessing the same global ModData table
God lua makes my brain hurt
modules are local, but the file returns it, so that other files can get a reference to it in their own local namespaces by requiring that file
the global namespace is just generally bad news (it's considered by many a disaster how much vanilla uses it), so modules avoid it entirely
require("NPCs/MainCreationMethods");
local TTF = require("TraitTagFramework");
local function initAnthroTraits()
...
TTF.add("KeenHearing", "Anthro,KeenHearing");
TTF:add("EagleEyed", "Anthro,KeenVision");
...
okay so this is how the implementation should look, right? I think I fixed up the TraitTagsFramework file to be a module. Can I show you the whole thing somehow, and do you have the patience/time/inclination to look?
this looks right (except the mixed usage of . and : in your add calls - one of those is probably a mistake?)
i can look at the whole files if you'd like
I did that intentionally cause I didn't know which one was correct lol. IIRC the colon calls like, an instance of a function or something?
the colon is for calling functions on an instance of an object - it's syntactic sugar, myObject:function() is the same as calling myObject.function(myObject)
it's mostly just to make lua's weird fake oop look less weird
https://github.com/badonnthedeer/TraitTagFramework/blob/main/media/lua/shared/TraitTagFramework.lua
I put my changes in a new commit here. Don't wanna post too much code here haha
This makes more sense hahaha
brb I'm gonna grab a cookie
when defining a function using a colon is the same as adding a self argument as the first argument
i think you forgot to push your commit π
at the very end of your file you want to return TraitTags
that's what lets other files grab it with require
other than that - i see you swapped your functions to be written the other way around (name = function() instead of function name()), i just thought i should make sure you know that that isn't a mandatory part of the module format and just my style preference, which is why i wrote my examples that way
the only practical difference is that you can't use colon when defining them that way and functions defined that way can't recurse (unless you declare the variable first)
i still don't think the moddata is necessary but it shouldn't interfere with the operation of your module or anything
And if I could figure out why functions calling TraitTags return nil after a reload, I could just include TraitTags.tags in the module, right?
fair enough. I wrote some functions that hooked into vanilla functions that way. I might settle on that way of writing functions tbh
it's already included in the module, anything under TraitTags will be
i picked up the habit when i was modifying a mod that had functions under very long chains of tables and it was just easier to understand that structure that way - it doesn't really matter for things written in a reasonable manner
@ancient grail are you able to delete thread posts in #1070852229654917180 or no?
just to clean the chat messages and such
I have to say albion, thank you very, very much for your help. You've consistenly helpful to me--I wanted to credit the discord somewhere in the development of this mod but I think I'd like to mention you specifically? Is that alright?
that'd be lovely ^_^ thank you
I already credit albion and the server without approval lol
I'll slap the credits into the steam page and github page, not sure really how else to do it lol
yeah i mean if anyone wants to give me another thing to put on my cv i'm all for it
"helped make a bajillion scripts for a zombie apocalypse game"
I mean. I'm all for it if you want to put "contributed to a Project zomboid mod to make furries more furry-like".
lmfao
I could understand not wanting to do that though
hey, it's the industry
i have to now remember wth i was doing with my java code a week ago
game over: you looked away from your code for ten minutes
oof. Good luck mucking about in the Java
I remembered. I have to scour through all of it to figure out why it is still behaving like vanilla
time to procrastinate again π
I have an idea for a mod
"Tile Shipping Trucks"
Trucks that appear shipping the Furniture from different Tile Packs so you can get access to a wide variety of building options in any map and on already started saves
Including random packs of "Floor Tiles"
true
local bodyParts = bodyDamage:getBodyParts();
for i=bodyParts:size()-1, 0, -1 do
local bodyPart = bodyParts:get(i);
if bodyPart:isInjured() and bodyPart:isBurnt() then
bodyPart:setBurnTime(0)
bodyPart:setNeedBurnWash(false)
end
end
Am i using wrong syntax?
Seems unnecessary to walk backwards on a normal loop procedure.
Inconsistent semi-colon usage. Either use it or don't.
if i dont backward loop once i remove the burn it will remove it from the array
i assume
but ok ill try forward then thnx
That's a mighty assumption. It's not like a java Iterator and even then you have to invoke remove()
I don't know what the issue is but I can see that you complicated your code without needing to.
for i = 0, bodyParts:size() -1 do
local bodyPart = bodyDamage:getBodyParts():get(i)
if bodyPart:getBurnTime() > 0 then
bodyPart:setBurnTime(0)
end
if bodyPart:getBurnTime() > 0 then
bodyPart:setNeedBurnWash(not bodyPart:isNeedBurnWash())
end
end
got it working
im not overcomplicating i really need to iterate the parts as i dont know which one is burnt
hello! π I am trying to understand how to add a new moveable item in game. Like a new chair, or a small container to let players interact with. I tried to define a new item like that:
item Mov_LockableSafe
{
DisplayCategory = Furniture,
Type = Moveable,
Icon = default,
Weight = 40,
DisplayName = Lockable Safe,
WorldObjectSprite = location_business_bank_01_68,
}
With no luck. The result is that I can see the item in the item list, but I can't place and can't see the sprite on it. Is there a guide or something that explains how to add new moveable items? Thanks!
Hello, this page has some info and links to video guides for adding tiles.
https://pzwiki.net/wiki/New_Tiles
π thanks a lot!
Anybody knows a way to prevent vehicle parts from taking damage from zombies?
Setting them to 999 condition doesn't work
most armour mods, repair them every tick
Hello, good morning. Is there any property in the title properties that prevents the zombies from breaking the wall? I want to emulate the behavior of certain walls, that do not break, but when I place them on the map, the zombies zombify them. My idea, is that they surround them. There are several such walls within the game.
What's the best way to get OnMouseUp to trigger for children elements that extend the parent element.
I get OnMouseUpOutside instead.
I'm guessing I have to add them to UI manager or manually find them from parent.
Hi guys!!
Quick question, I've read that you can now use Typescript to code Mods, is this true? Do you have the same flexibility as lua or are there any missing pieces that I should be aware of?
Thank you!
I believe the tool is under development
https://github.com/asledgehammer/PipeWrench-Template
Although I am not 100% sure.
Wow this is awesome. Thank you man, I'll check it out π
Guys, I'm having a very annoying problem on my server, what can cause this error here?
ERROR: General , 1685711587269> 0> ExceptionLogger.logException> Exception thrown java.io.IOException: map download from server timed out at WorldStreamer.requestLargeAreaZip line:850.
ERROR: General , 1685711587270> 0> DebugLogStream.printException> Stack trace:
java.io.IOException: map download from server timed out
at zombie.iso.WorldStreamer.requestLargeAreaZip(WorldStreamer.java:850)
at zombie.iso.CellLoader.LoadCellBinaryChunk(CellLoader.java:440)
at zombie.iso.IsoWorld.init(IsoWorld.java:2625)
at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268)
at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225)
at java.base/java.lang.Thread.run(Unknown Source)
Bad connection?
A huge amount of people are having this error
I've been trying to find the cause of this for months and nothing π«
They get stuck in the part of downloading map chunks
But sometimes they manage to log in and play normally
@mystic rose maybe IsoPlayer:getPlayerMoveDir() can help you get the angle of the character facing
hmm
i assumed that gave an xyz on the location rather then facing direction, but i could always be wrong
i'm also very new to modding so i don't know what i'm talking about, just fyi lol
it returns JVector2 which seems to have a couple of ange functions
For others here that are smarter then me, im trying to get the exact angle of the player facing even with decimals but the closest ive found in my search was getAngle() but it gives very little info on what it does or is used for, could be it though
local charOrientationAngle = character:getAnimAngleRadians();--Hum, this may be angle 0 = East, PI/2 = South, -PI/2=North, PI=West
eh?
also do not rank smartness, this is just about experience
so character:getAnimAngleRadians(); gets the exact angle or? how your saying it sounds like its just rounding up to each cardinal direction
I wrote something related to this, it's used in fancy handiwork I believe(?)
The snippet should be in here if you search -- I type alot though π
ill be lookin
it gives the exact angle, I'm just expliciting in comment the value
Also, yeah, I'm not smart -- I just slapped stuff together until it got what I expected
ah ok
As is tradition πΏ
theres a lot of messages...
so i could just now print to console to verify..
while true do
if player:isAsleep(false) then
print(character:getAnimAngleRadians())
end
end
``` wish i knew a way to update it whenever the character moves, rather then every frame but it works for testing
this is an infinite loop
Events.OnPlayerUpdate.Add(function(player) if player and player:isMoving() then print(player:getAnimAngleRadians()) end end)
OnPlayerMove would probably let you circumvent that check
(and you never need to check if player as part of an event because if there isn't a player then the event wouldn't be fired)
wat
Events.OnPlayerMove.Add(function(player)
print(character:getAnimeAngleRadians())
end)
no while?
the while true just makes an infinite loop and crashes the game
OnPlayerMove will already fire every single tick that the player is moving
oh right...i forgot about that...
Why player and character? I see it's in the original snippet
Ah gotcha
does the print go to the ingame console or the cmd window?
it should go into the debug console and the log
anyone there has a snippet for getMouseSquare that handles the Z coord depending on local visibility ?
and if you handle the joypad it's even better
Mine is mouse only and I only use player square Z.
Hi guys!
I'm exploring some mods and I know that some can extend properties in SandboxVars.lua file to let a user customize variables. Is there any guide on how to properly setup such extension?
For example: i want user to set an array of items to delete, by name, in a property in this file called: ItemsToRemove = {
items = [array]
}
Do any of you know how to do such thing and can point me toward a guide, perhaps?
Thanks!
@mellow frigate How hard would it be to adapt Dogs for MP?
why am i getting an error, did i do the stupid? im just copy pasting what albion said...did i need another part for that?
I have not digged enough to discover that
i feel like it needs to be called but im unsure
oh, i was copying what you did and mixed up the character/player π
no plan to do it?
replace character by player
character is nothing in this context
oh derr
I don't know that there's a guide, but vanilla handles a similar type of rule by using a string delimited with semicolons. i.e., item1;item2;item3. You can create a sandbox variable with a special file in your mod's media folder, sandbox-options.txt.
Example string option:
option ModName.OptionName
{ type = string, default = default value that cannot contain a comma or curly brace, page = ModName, translation = ModNameOptionName, }
so it would be player:getAnimeAngleRadians()?
some people use the two terms to refer to different things but they don't have any inherent meaning
player:getAnimAngleRadians()
not quite sure how that anime got in there π
no plan to do it
sad, it would be a nice addition
ah uhh
going to try it right now in SP
Freudian slip π€¨ (/j)
player for isoPlayer and character for isoGameCharacter
you know i would have never noticed that even if i looked at it for hours
π ask TIS !
i like to use player for objects that are definitely players and character for objects that could be non-player characters, though that doesn't occur in the current version of the game
im assuming theres no way to stop the snapping to directions without a weapon?
Zombies are characters, Players are characters
Any clue where I can reach Dislaik?
(it *definitely* makes sense to base your naming conventions around a feature that will doubtlessly require you to rewrite half your code anyway)
Wow, You are right, I could treat it as a string with delimiters!
Thank you π
yep PM
i don't think i've run into many situations in my code where i don't know/don't care if a character is a human or zombie
i use character when the code would theoretically apply to npcs too, or just in areas vanilla tends to do that