#mod_development
1 messages · Page 527 of 1
Yes, but unless you have lua checksum disabled (which is important for anticheat), you will get file mismatch errors when people try to connect unless the server and the clients have the same version of the modified file installed.
@willow estuary thank you, I went through the whole process to make sure we all had the same version of the mods, its just me and a few friends running on a dedicated computer in my house
Cool, sounds like you're going about it the right way then 🙂
@hearty herald ok thank you I'll mess around with it more
eyyy I found the instructions in the VehicleZoneDefinitions.lua in the game files
Can you explain me again what you trying to do ? I'm pretty good at math and geometry
see that screenshot up there with the faces?
i can make it do the red. i need it to be green.
nope!
Or it's radiant ?
it's hell on earth. lol.
Ok nice, that better
Are you sure it's angle Y that you want ? Because for me that should be angleZ
https://pastebin.com/n6AMr6ad - this works. as long asyou are going northeast or southeast, otherwise i gets whacky
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.
Can you check for angleY/angleZ ? I will draw you something to make you understand, that gonna be easier
For me the right angle ro use is the Z rotation, are you sure it's angleY that need to be use ?
local angle = vehicle:getAngleY()
So you mean there is only 2 angle ? 0 and 90 ?
Mmmm so there should be something to know if you face north or sud
the green arrows show how it adds up or counts down.
the mower in that shout would be going 0.
even though 0 is behind him as well.
that means his dealta1 is 0 instead of 1.
trust me this whole maffs and vehicles
i miss doing tiles, where the only math i needs was 27.5
Ok and what append is you set an angle >90 ou <-90 ?
i'm 36+ hours without sleep lol
Haha developping game is a lot of math, I love it but that not for everybody
i could have set one to mickey mouse and i wouldn't know.
you want the current mod? you can test and what not.
Can you send me the whole mod ? Or put it unlisted on steam ? Like that I can try something
do whatever you need to code wise... i just want it so that when i run over a zombie a corpse it removes them and does a spray of blood out the RIGHT side of the mower.
Is it currently not possible to make mounted guns or why isnt there one in the workshop?
do you guys know if the day/night cycle and weather cycles are locked behind java or are they open for modding? I want to make a map set in antarctica but I don't want to waste my time if I can't make the summers have 24 hours of light and the winters have 24 hours of dar
Is the only way to access speed controls through the UI in Java? https://projectzomboid.com/modding/zombie/ui/SpeedControls.html
If I wanted to create a mod for multiplayer speed controls, is that even possible?
I think no
Only by params of server for all sleep and something else
Alright, I wanted to make something so that time could speed up if all players are doing longer timed actions like reading or resting
Check what params for server settings exist. Maybe exist for this param
Doesn't seem to exist. Is it feasible to modify the base files of a dedicated server to implement it?
In terms of obfuscation / file integrity issues
looks like the new update has icons that are inspired by our extra map symbols :>
and the "rest map symbols" option not only deletes all icons, but literally clears the whole map. not sure if i like that.
Anyone playing Brita's Weapon Pack can tell me which gun is better? M16A1 vs M16A2 vs Colt CAR-15 Survival Rifle?
Is this the only documentation? Are we supposed to decompile the source to have any understanding?
https://projectzomboid.com/modding/
Seems super unintuitive
There's so much stuff locked behind the source code too. Like adding/changing moodles? Can't do anything with them. Seems like you can't change the base game day/night cycle either
If you want to change the length of day / night, I think you could hack it together by manually setting the time of the GameTime instance
Might break some stuff though
What is the best way to communicate between server and client?
Is there a serverside event for chat events?
Guessing OnCoopServerMessage?
Do the events pass any arguments, and if so, how do we know which?
Any texture artists available to to help me out with something in DMs?
Would it be possible to add a firearm, but replace the damage dealt with the player/zombie tripping over?
Yes, you could use the OnWeaponHitCharacter event for this, here's a quick and sloppy example of a way t could be done, substitute your own weapon script name for "WEAPON_THAT_TRIPS", ie if you used "Axe" then the Axe would do this.
However, I think that this this specific example might not work for making the zombies trip? I use it to make players trip, never tried with zombies, but regardless it's an example of how one could go about it?
function Trip_Weapon(wielder, target, weapon, damage)
if not weapon then return end
if not weapon:getType() == "WEAPON_THAT_TRIPS" then return end
target:setBumpType("stagger")
target:setBumpFall(true)
target:setBumpFallType("pushedFront")
end
Events.OnWeaponHitCharacter.Add(Trip_Weapon)
This is not a good general solution, in that the player always falls backwards, I don't know if it works for zombies, but it's a start for you? 🙂
You could randomize the direction
if ZombRand(2) == 0 then target:setBumpFallType("pushedFront")
else target:setBumpFallType("pushedBack") end
It would get more complicated if you wanted the positioning of the shooter vs the target to dictate what direction, but not impossible.
When I shoot a zombie, it kicks me back to the main menu and when I rejoin and shoot it does nothing. So I think this might only work on players, which is fine for me.
Oopsie! Okay, you could use this in the code somewhere
if not instanceof(target,"IsoPlayer")) then return end
There's likely a function in the code somewhere for knocking zombies down as well, so you could do "if a player do this but if not do that instead" if you had the function? Just don't know if/what offhand.
Is the debug command console's lua input client or serverside?
Aight thanks, gonna go look for the zombie code now. 👍
Right on! I'm sure you'll be able to get something working 🙂
Hi!!! After a lot of googling and googling, and trying to create my mod, I get questions.
I have a delicate linux server and I would like to test the mods that I make on it. It can be done somehow without adding it to the workshop. Thank you very much
add to your mods folder, make sure hte mods on the server match the client's mods folder as well
i assume you meant dedicated not delicate
if you meant delicate i would suggest sending your linux machine to karate classes or something
also uhhh #mod_support
Dedicated yes 🤣
I am really struggling to find relevant documentation. Almost all tutorials are simple item additions.
How do I distinguish between server and client in the debug tools?
How do I know which java classes and methods I can access via lua and whether it is from client or server?
Do I have to decompile the source code myself, in order to get any documentation on the java stuff?
E: also, what is the convention for communicating between client and server?
Javadoc Project Zomboid Modding API package index
Thanks @odd notch :)
I want to make a small mod that saves the time I've been alive and the zombies I've killed in a file, that part is done and it works locally, but I need to use it on my server.
honestly its a pain to setup intellij and to then decompile everything. i just use the javadocs or ask the grand magicians here about functions if im unsure
Javadoc Project Zomboid Modding API declaration: package: zombie.Lua, class: LuaManager, class: GlobalObject

there's a really nice json file writer utility i see a lot of people use
Bufff
I have no idea about java hahaha
I only know how to use javascript, vbs and powershell
Jajajaja
The mod works and export that to a file
the only drawback is calculating the time I have survived, I don't know how to calculate it with LUA and I do it with powershell. The game returns a Double that I don't know how to change in time format
@odd notch in servertest.ini I only have to fill in mod= right?
with the mod id
I don't know if this is the channel to ask or if it's #mod-support, Sorry
Thank you! I'll try or I'll give it up lol
Anyway to get a weapon to do 0 damage and only apply the staggering effect to zombies? I've set all the dmg/crit options to 0 and its still killing them.
victim:setAvoidDamage(true)
Should I add this to a separate .lua file due to the "if not instanceof(target,"IsoPlayer")) then return end" or keep it in the same file?
This needs to be in the same function as the other code?
I think you might have reached a point where you're gonna need to learn basic lua/programming stuff to be able to implement your ideas to be honest.
Yeahh, I'm pretty new to lua. I've only really done some Python stuff. Apologies if I'm asking dumb questions.
Nah, it fine. You've just reached a place where you need to develop some simple lua familiarity in order to be able to do what you want to do and all?
Lua is not that terrible as far as programming language go.
However, I am a gigantic stoned idiot, and not a fancy pants code smart guy, so teaching anyone that stuff is way outta my capabilities?
I just share the lego pieces that work for me and such.
I'd say find some "hello world" tutorials and such, and suffer through them.
Yeah I understand, will do then. Thanks for the help 👍
If I wanted to manipulate this https://zomboid-javadoc.com/41.65/zombie/GameTime.html#MULTIPLIER on serverside, what would that look like and is it a bad idea?
Javadoc Project Zomboid Modding API declaration: package: zombie, class: GameTime
Its there a mod for better and stronger walls
Aside from gently directing people to mod_support when they're looking for help with bugs as mod users, there's no need to be fussy about people asking that sort of stuff.
People chit chat about all sorts of mod-related business in this channel, it's fine 🙂
I've never used this mod or anything, but it does exist and sounds like what you're looking for?
https://steamcommunity.com/sharedfiles/filedetails/?id=2708835802
Seems nice, but I saw some people had other kind of walls.
Well, your best bet is probably to search "walls" on the workshop and check out what comes up? That's the only one I knew about, but from doing a search it looks like there's quite a few of them 🙂
Np, good luck! 👍
In this introductory video we take a look at what Lua is, What we need to run lua and we set up a little test project to make sure everything was done correctly, If you enjoyed the video be sure to leave a like and subscribe if you wish. Thank you.
LuaForWindows : https://code.google.com/p/luaforwindows/
Sublime Text : http://www.sublimetext.com/2
this is a playlist
codeblue teaches good shit
where i learned GLUA
thats the basics then it's similar to java too
I think the ideal for a multiplayer raid experience would be this mod, combined with a new mod that has a door that could only be destroyed with an explosive (sledgehammer disabled). With admins controlling how players acquire a C4 (or EXTREMELY rare).
Or similar to Dead Side, where when you kill a player, you can collect the dogtag (in this case, the key chain) and then an area is revealed on his map with approximate location of the base, only in this way a raid is possible (with the above method)
I say this based on feedback from 2 months running a server, with players generating issues and arguing about safehouses (which is not worth it, nor should I extend it here)
I'm going to post this suggestion on the forum, but I wanted to say it here too to see if I can inspire someone with more free time and knowledge than me 😆
@tame mulch hate to ping you but can i bug you real quick?
Yep, what problem?
What in a world getAngleY() is from [0-90] and [0--90]. How do I know if I face sud or north ?
i need to be able to spawn and yeet a blood spatter like i hit a zombie with an axe. how do?
It's about angle of vehicle?
Yes
It uses local axis as I know
I do not understand
Afternoon everyone, I'm new to the PZ discord! I'm planning to add additional weapon stats to the hover tooltip since I haven't been able to find such a mod. Seems fairly straightforward, I'm basing the code off of the Show Material mod but I can't find ISToolTipInv in the javadocs, would anyone know where I could find it? Also, is there any recommended getting started guide for modding apart from the wiki page?
mmmmm I kind of see
So I need the vector right ?
Easy way to find - take point in front, point in center of car and calculate direction
Do you have the function quickly ?
Maybe addBloodSplat(square, N)
i already do that ut they all look the same
check my mod about helicopter
Ok I should be fine, thank you !
it comes out very ... chessboard like. and not organic at ALL.
maybe add some random to near squares?
that's the problem.. all 20 variations... ar the same thing.
i mean it can be varied but only slightly.
Also maybe will help creating IsoZombieGiblets for visual effects
would love to. so how do you throw them? lol
did you have to use CustomQuaternion to find the direction of the helicopter?
Yep. But you don't need this. Just use get points positions
Your mod released? I can try fix this, I have some time (need take a break from development NPC mod)
Good, PM me
Does anyone know why this would be throwing a STACK TRACE of "attempted index: getTexture of non-table: null"
table.insert(ProceduralDistributions.list["all"]["crate"].items, "MCM.testItem")
table.insert(ProceduralDistributions.list["all"]["crate"].items, 0.5)
oh i was using the wrong item xD
the error is actually "attempted index: crate of non-table: null"
Hello, I am trying to make a clothing mod for a server I'm in. Right now I'm using the t-shirt template pinned in #modeling and this guide ( https://steamcommunity.com/sharedfiles/filedetails/?id=2648115890 ). I can get the items to appear in the game, but when I put the shirts on, they don't appear on the player model. I suspect it's because I'm pointing m_MaleModel and FemaleModel to "MaleBody.X" and "FemaleBody.X", but I can't seem to find the default t-shirt model the game uses if this is an incorrect model to point to. Does anyone know what model I should be pointing them at instead?
all.crate is not in ProceduralDistributions but SuburbsDistributions, example
table.insert(SuburbsDistributions.all.crate.items, "Base.BlairsBestItem")
table.insert(SuburbsDistributions.all.crate.items, 2)
ahhh okay thanks I'll give that a shot
Now its a "Callframe at: table.insert"
That's Lua code, not Java. Find it under media\lua\client\ISUI in your PZ install dir
Great, found it, thanks!
is it just me or ISBaseTimedAction:start is not always called? (in the new unstable branch)
it goes to perform directly and doesnt run start() not sure why
im just hooking into start to print something to test but it doesnt get in
ah right, its not calling the parent function.. (never did)
ex: ISBaseTimedAction.start(self);
would be usefull if we could get vanilla events to detect action start, stop, perform.
local function onAction(actionType, actionMethod, actionInstance)
print(actionType) -- print ISGrabItem
print(actionMethod) -- print stop
print(type(actionInstance)) -- print table (the action instance itself)
end
Events.OnAction.Add(onAction)
Huh, looks like WeaponLength is set twice for the Katana for whatever reason, probably a bug
Anyone know what BaseSpeed on weapons does? I assume it's a run speed modifier?
Just finished my first mod and it's now avaiable on steam workshop. I wanna thank you guys for helping me out
Drop the workshop item link!
Congratulations!
thank you. You guys helped me alot to get started. Very kind of you
Programming thrives on community 🙂
that new item OnCreate is such a massive feature 😄
Is is when an item is Spawned or only Crafted ?
even in containers in the world I guess
Any windows devs out there, a little powershell script to watch console.txt in real time (with the options to clear it on run)
$yesno = Read-Host "Clear Zomboid log before proceeding? (Y/N)"
$consoleFile = "<console.txt-location>"
if ($yesno -eq 'y')
{
Clear-Content $consoleFile
}
Get-Content $consoleFile –Wait```
So I had written an event system for actions and the start method wasnt triggering. Here is a fixed version.
With this you can detect any action that has Started, Stopped or Performed.
File: ActionEvents.lua
require 'TimedActions/ISBaseTimedAction';
require 'TimedActions/ISTimedActionQueue';
LuaEventManager.AddEvent("OnBeforeActionStarted");
LuaEventManager.AddEvent("OnActionStarted");
LuaEventManager.AddEvent("OnBeforeActionStopped");
LuaEventManager.AddEvent("OnActionStopped");
LuaEventManager.AddEvent("OnBeforeActionPerformed");
LuaEventManager.AddEvent("OnActionPerformed");
-- Hook the action event when adding it to the queue
local ISTimedActionQueue_add = ISTimedActionQueue.add;
function ISTimedActionQueue.add(action)
local action_start = action.start;
function action:start(...)
triggerEvent("OnBeforeActionStarted", self.Type, self);
action_start(self, ...);
triggerEvent("OnActionStarted", self.Type, self);
end
local action_stop = action.stop;
function action:stop(...)
triggerEvent("OnBeforeActionStopped", self.Type, self);
action_stop(self, ...);
triggerEvent("OnActionStopped", self.Type, self);
end
local action_perform = action.perform;
function action:perform(...)
triggerEvent("OnBeforeActionPerformed", self.Type, self);
action_perform(self, ...);
triggerEvent("OnActionPerformed", self.Type, self);
end
return ISTimedActionQueue_add(action);
end
-- HOW TO USE
-- Might have to require this ActionEvents.lua before adding your events in a different file.
-- OnActionStarted
local function onActionStarted(actionType, actionInstance)
print("Action " .. actionType .. " started!");
end
Events.OnActionStarted.Add(onActionStarted);
-- OnActionStopped
local function onActionStopped(actionType, actionInstance)
print("Action " .. actionType .. " stopped!");
end
Events.OnActionStopped.Add(onActionStopped);
-- OnActionPerformed
local function onActionPerformed(actionType, actionInstance)
print("Action " .. actionType .. " performed!");
end
Events.OnActionPerformed.Add(onActionPerformed);
Hi hi!
I have a doubt related to the OnPlayerUpdate, is known how many times it runs per second? I have been thinking it runs every tick but now I see there is a OnTick event so... is not that it changes anything for my code but to not use wrong information 🤔
Hm, it was validated recently that that doesn't run per tick, but I don't remember if the rate was discussed
is there a way to play an animation in a while loop?
I have been using the word tick to explain my mod but I'm wrong with that. Damn xD
where as longa st hey are in that loop it plays that animation, other wise it does the regular anims.
buffy asked in January and an answer then stated that OnPlayerUpdate runs every frame
difference from OnTick and OnPlayerUpdate is that OnTick doesnt have a parameter for a player instance.
OnPlayerUpdate will run for each player (split-screen) too.
other than that it should run every tick too.
interesting
local function onPlayerUpdate(playerObj)
print(playerObj:getPlayerNum()); -- will print which player (split-screen) is updating.
end
Events.OnPlayerUpdate.Add(onPlayerUpdate);
would be similar to loop through all players in a OnTick event (but doing this would be less efficients)
Yes, I mean, I use the OnPlayerUpdate on certain situations to modify modData but wasn't sure if say: "The moddata is modified in X amount per tick" is correct when that's done in the OnPlayerUpdate
It is something I want to know for my mod guide, not really affect my code, I just want to give correct information
and doing this
local function onTick()
local playerObj = getPlayer();
-- would give you the first player only so wouldnt get you the splitscreen additional players obj.
end
Events.OnTick.Add(onTick);
is there a mod that allows you to attach items and bags from the ground to your back?🍞
So, knowing it runs per tick. It is correct to assume in PZ also applies this calculator?
https://mapmaking.fr/tick/
1 second --> 20 ticks
i believe player ModData is only transmitted when saving the character on the server.
for my computer 1 second = 60ticks
I personally use glogg. Log reader, you can add custom RegEx rules to highlight some logs, usefull to debug your mod
probably depends from computer to computer not sure
sweet will give it a shot
Hmmm, I know that most of the games standardise that but not sure if PZ does the same
anyone know of a way to check performance stats. for instance if frame rate is taking a big hit? i would like to include in the mod i'm working, a way to automatically tune check frequency if there's a performance penalty
in other words, to remove my mod (temporarily) from extra performance burden
kind of weird that we can drink water from washing machine
probably only does that with the new combo washing machine
omfg... i am in the middle of testing and now my lua is invisible to you!?
@thin hornet mmmmmmm delicious washing machine nectar
if it doesnt show up there is a good chance there is a syntax error preventing it from loading
verify your console for an error
nothing.
:\ you sure it's loading the workshop from your zomboid directory and not the one subscribed (steam dir)?
it was never put on the workshop
have.
I've noticed, if there's an error in he file when you load the mod, it will not appear in the F11 menu
You have to reload the mod & fix the syntax error
Yeah, simply remove it from modlist, or add a random other mod
That still loads because it doesn't have any errors
It just failed to load the lawnmower.lua, so it doesn't know that it exists in the debug
anyone know how to add distribution to any corpse? not just a specific outfit
player:setActionAnim("DriveMower") why would this throw nil?!
show the error
your variable player doesnt have PlayAnim. make sure your variable player is actually an IsoPlayer
actually player is nil atm
player:setActionAnim("DriveMower")
is this an action?
trying to change the driving animation to one more fitting a riding a mower.
how do you assign your player variable
local function MowerUpkeep(player, vehicle, args)
i believe Events.OnPlayerUpdate.Add only has one parameter, player:IsoPlayer
local vehicle = player.getVehicle and player:getVehicle() or nil
why not just
local function MowerUpkeep(player)
local vehicle = player:getVehicle()
if vehicle then
end
end
Events.OnPlayerUpdate.Add(MowerUpkeep)
what is player.character:PlayAnim("DriveMower")
player:PlayAnim("DriveMower")
should be that
back to calling nil.
and player:setActionAnim("DriveMower") should be self:setActionAnim("DriveMower") and self is the action object.
hum playerObj:PlayAnim("Idle"); should be ok from an IsoPlayer object.
setActionAnim is a function for Action only. not IsoPlayer
what you want in your case is player:PlayAnim("AnimName");
player:PlayAnim("DriveMower")) soi that one?
yeah
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>DriveMower</m_Name>
<m_SpeedScale>0.80</m_SpeedScale>
<m_AnimName>Bob_Idle_Lawnmower</m_AnimName>
<m_BlendTime>0.20</m_BlendTime>
</animNode>
``` that's the xml for the animation.
if the animation was not found or not ok it wouldnt throw the error anyway. But it look ok
the anim must be in anims_X and the xml in AnimSets i dont know if it need more specific
so i supose you dont get the error anymore but the anim not playing?
Hey hey, i recently posted my first mod hair on the Workshop and some people have problems with the hair showing as bald for them even with Fluffy Hair downloaded. Anyone already had this problem before and know a fix ??
For me it works perfectly so i really don't know where to look first
if you can share the faulty lua script maybe we can spot what cause it
I don't know the answer precisely, but to clarify, are they wearing other head items, or are they always bald? I believe fluffy hair assigns new custom models when wearing headgear, but only for vanilla styles; maybe you missed that step?
From what i understood they are always bald. What do you mean by wearing other head items ?
i'm not sure on the exacts of it. If you wear some headwear that partially covers the hair like a bandana or ballcap, the game will show an alternate model that was defined in the item xml for that hairstyle
okay so diabling and renabling it is not working anymore :/
I already made different models for each headwear groups if that's what you're talking about 😮
I works for me with hats, bandanas and caps
ok cool
For example
They don't appear bald for me :c
For now i only had two person come to talk to me about this bug
So i don't know if anyone else experiences it too, because i don't and don't know how to reproduce it
i see that it requires fluffy hair, but i can't find a way to make the game load your mod without that also being present.
Is it not good that it is required ?
i'm sure it's fine. I was wondering if somehow they managed to load the game without Fluffy Hair and that bungles things
Are people making this report about playing in MP?
Because, unfortunately, servers don't automatically set up requirements, and there's many many many "bug reports" from people using mods on servers that don't have the requirements.
So if you need fluffy hair for your mod to not have the bald heads, it's very likely that people are using your mod on servers without also using fluffy hair.
the only thing loading it without fluffy hair would do is make hats use the wrong hat categories
i'm not sure since that's what they said :c
They haven't talked about mp no, i even tried the mod on mp with my bf and it works great for the both of us
it's working for me too, btw
That's really weird then
I told them to try checking the game's file integrity, i don't know what else to do 😦
Okay good, just putting that out there as that's currently an issue with mods with requirements in MP.
I'll see if anyone reports that kind of bugs again in the future, but for now i'm confused
#modeling message
Peach had a kind of similar problem recently
it works fine for me
it might just be workshop weirdness so maybe resubbing might fix it
I hope, because i'm not remaking the entire mod 🥴 ahahah
Maybe someone could help me. Ive been rebuilding my mod list for past few days, but i cant seem to find anything pertaining to two things i am looking for - mod that would increase interaction range(like how far from container i need to be to "see" into it) and custom crating values(aka instead of just "one" and "all" being able to enter custom number).
does anyone have experience with working with the global object system? I made and object accompanying system, and I am able to update the moddata on the serverside through EveryTenMinutes event, but I can seem to get that update to the client side. I can see for the server in the logs that the moddata is indeed changing for the object, but from the clientside when using the CMyObjectSystem.instance:isValidIsoObject: to get the correct object, it is as if the moddata has not been changed at all. I am using transmitModData on the isoobject on the serverside script but it doesnt seem to transmit it to the client
Any mods with dogs/pets?
Getting this error for the distributions am I doing something wrong.
--Farmstorage
table.insert(SuburbsDistributions.farmstorage.all.items, "MCM.testItem"); <---- line 17
table.insert(SuburbsDistributions.farmstorage.all.items, 1.4);
I get the same issue when I do
--Farmstorage
table.insert(SuburbsDistributions["farmstorage"]["all"].items, "MCM.testItem"); <---- line 17
table.insert(SuburbsDistributions["farmstorage"]["all"].items, 1.4);
farmstorage does not have a all table
all doesn't work either
there is no all
all if used as a catch-all category in Distributions.lua
i mean
Callframe at: table.insert
function: MCM-Distributions.lua -- file: MCM-Distributions.lua line # 17
good grief
So the way I had it before where it didn't work -_-
Basically, you have to scrupulously check every roomdef/container combination to see how you need to set up each individual distro table insertion.
In Distributions.lua and ProceduralDistributions.lua, located in media/lua/server/items
so for ["all"]["crate"] that is suburb?
It is for me
table.insert(SuburbsDistributions.all.crate.items, "CokeBaggie")
table.insert(SuburbsDistributions.all.crate.items, 0.01)
okay sweet thats how mine looks
So this should be right
table.insert(ProceduralDistributions.list.farmstorage.crate.items, "MCM.testItem");
table.insert(ProceduralDistributions.list.farmstorage.crate.items, 1.4);
or do you not get access to the container with procedural
No, I think you're fundamentally misunderstanding how the distributions tables work with procedural distribution tables.
table.insert(ProceduralDistributions.list.WardrobeWomanClassy.items, "CokeBaggie")
table.insert(ProceduralDistributions.list.WardrobeWomanClassy.items, 1)
You have to insert to the actual procedural tables,.
right
Yes, that looks correct. 👍
love that example xD
Are you working on a drug mod?
Nah, that's been on the workshop for a while?
kk
table.insert(ProceduralDistributions.list.gardenstore.items, "MCM.testItem");
table.insert(ProceduralDistributions.list.gardenstore.items, 1.2);
So like that
no
that one doesn't have items right
When the Distribution table use procList
It mean it take the procedural list
so you have to go into C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Items\ProceduralDistributions.lua
then you find the proc List there
so for example GardenStoreMisc
yeah
sooo
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, "MCM.testItem");
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, 1.2);
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, "MCM.testItem");
table.insert(ProceduralDistributions.list.GardenStoreMisc.items, 1.2);
yeah
okay sweet, now I get it
cool 😄
So you can't choose what containers they go in with procedural
many Distribution could use that procedural list yes
you could create your own and add that list to the distribution
ProceduralDistributions.list.MyOwnProcList = {
rolls = 4,
items = {
"MCM.testItem", 10,
},
junk = {
rolls = 1,
items = {
}
}
}
table.insert(SuburbsDistributions.gardenstore.crate.procList, { name="MyOwnProcList ", min=0, max=99, weightChance=100 })
So what would happen if we ran a dedicated server on the unstable branch and then the main branch update later? Also how do we specify the beta branch for the dedicated server?
With the new substation.... Please un-hardcode generators 😢
what do you want to do with the generator?
I was hoping to increase the range from the Substation out, depending on how many of the pylons are repaired.
is there an online lua checker or something? it will NOT load my file any more.
Maybe set an invisible generator at the center of the map that would have maybe 100 tile range, and then require electrical + supplies to "repair" the pylons in the substation, and for each repair, increase the range of the generator by another so many tiles or something. But Generator Range is hardcoded. I'm assuming placing a running generator every 20 tiles is not a good idea.
That would be pretty neat to do, have a whole community wired up by a cache of generators
Yeah, I imagine it to be some sort of community event, keeping the substation running would be pretty difficult even for a group of electricians.
Especially without a constant supply of coal
Ooh. Could probably get some Lumberjacks to cut wood and make charcoal though.
Probably makes a lot of noise, have to keep the zombies off 
I'm not sure if charcoal would even work in a boiler, not nearly enough heat to turn that big of a turbine
Unfortunately we're missing a mine though, so it'd have to work lol.
now fission, thats where its at lol
LOG : Lua , 1645576304384> Loading: C:/Users/Owner/Zomboid/Workshop/RidingMower/Contents/mods/RidingMower/media/lua/shared/RidingMowerSpawnList.lua it never loads my RidingMower.lua
internal screaming
i give up.
files that DID work, dont now.
is there a file cache or something?!
Does anyone know how room temperatures of houses is calculated?
Anyone know the mod that lets you pull the water bottles off the water dispensers?
Hey again, i made the clothing.XML for my mod and i was wondering if i absolutely have to make the "ZombieZoneDefinitions.LUA" file and set every outfits one by one or will the outfits spawn randomly like the hair from my first mod do.
When testing i sometimes see zombies wearing the outfits i made but it's very few and random
This is tough. The only references I found in Lua are either commented out/replaced or in debug code. I see PlayerClimateDebug registers some temperature-related variables based on self.player:getBodyDamage():getThermoregulator(). Following the trail in the Javadoc, Thermoregulator has a getExternalAirTemperature() method. That's about all I can divine at the moment.
Hey all, are there any resources out there that explain multiplayer compatibility in mods? I've just finished my mod and now want to make sure that its going to be MP safe but I cant seem to find any guides on this and thought someone here might be able to point me in the right direction
Ooh, this looks like smth I'll be adding to my mod list, thanks. ||nitpick/fyi for future reference: when writing elision, the apostrophe is used to mark the deleted portion(s) of the word (in this case, "re"), so it would be mo', not 'mo||
I'm working on something similar. Care to share notes?
Is there a mod that lets you load and unload crates and such?
Or access loaded containers atleast?
@daring palm Thanks, I have done that, I currently have the mod install on my dedicated server and everything seems to works fine. I was just wondering if there was an info on best practices etc. Seems I will just have to check out the source and a few mods and get an idea of what's required. My main concern is that because I interact with worldobjects and inventory that something could go wrong and either duplicate or delete items due to sync issues.
well you may open as many new clients as you want and connect to the local server to test things
you may spot sync issues right there
Does it make much difference testing with the Steam vs. non-Steam servers?
Thanks, I'll change that haha
Hey can you guys make dragon breath shells, we want them. Thanks
I wonder if it’s worth making a C.H.UD. Inspired zombie retexture
Weapon projectile effects are currently not possible sadly
Ok, I have a bit of a head scratcher. In my custom timed action PFGPushAction I can useself.inventory from function PFGPushAction:perform() just fine but when I try to use if from function PFGPushAction.isValid() I get a nil error. I can see in the source code that I should be able to use self.inventory in isValid() but mine just does not want to work
function PFGPushAction.isValid() for i,v in ipairs(PFGMenu.typesTable) do if self.inventory:contains(tostring(v)) then --Problem line return false end end return true end
Greetings! I come bearing gifts! Well, a gift, a new method to manage and quickly export translations for PZ mods! 
I've made a tutorial explaining how it works here: https://steamcommunity.com/sharedfiles/filedetails/?id=2762135456
If you're tired of how your translations are managed, I suggest you give this a try. Feedback and comments are always appreciated. Cheers!
Steam Community: Project Zomboid. Combining the flexibility and accessibility of Google Sheets with a one click solution to generate the Translation files!
Link to the file: https://docs.google.com/spreadsheets/d/1ooD8gsax1FKceatHDMK
I have returned for another quick question about OnCreate recipes, and specifically, what the proper way to have them give you, say, three different items would be. I'm a big fan of having litter junk items after use, so all of my food items (packaged anyways) make use of oncreate to give you both the food and an empty wrapper. I recently made a box of mac 'n cheese, though at the moment I can't seem to have it give me extra items. For instance, making the recipe will currently give me the cheese seasoning packet and of course a saucepan with the noodles inside, but I'm also trying to have it give me the box. What would be the most efficient means for that?
Can someone add the death till us apart map stand-alone. Its probably not hard bc the map is already in the game as a challenge map.
That looks like it adds those hooks to the global table action each time an action of that type starts though?
It varies. You can get the length of the previous update with a function of some name, so maybe that works in the player update too?
What about that one mod that changes the muzzle bloom or whatever
I would like to apply a color mask to the player, as shown in the attachment.
"setHighlighted" and "setHighlightColor" of IsoObject are also tried.
But they work for Object, but not for the player.
Any ideas?
Ah rats, so the muskets I wanted to try and make won't have any fancy smancy powder covering up your vision sights!
I finally found a mod that does what I wanted 😄
the mod is called Twitch Stats
That is what I thought. The temperature system cannot be modded. Too bad, as a thermal engineer I would have made a realistic system for managing room temperatures in a building
Heyo peeps!
So a thing that changed with the unstable .66 build is how the ClothingType item tag
ClothingItemExtra = PonchoYellowDOWN, works.
Now with your mod items, you need to specify your module name to avoid the item erroring out on Double Click.
Here is an example of what I got working. My item module name is: "AuthenticZClothing".
item Authentic_Headphones
{
DisplayCategory = Electronics,
Type = Clothing,
DisplayName = Headphones,
ClothingItem = Authentic_Headphones,
ClothingItemExtra = AuthenticZClothing.Authentic_HeadphonesNeck, ---This line---
ClothingItemExtraOption = WearNeck,
clothingExtraSubmenu = WearHead,
BodyLocation = Necklace,
Icon = Headphones,
Weight = 0.3,
ChanceToFall = 25,
WorldStaticModel = WorldItem_HeadPhones,
}
Before in .65, you did not have to add that specification. Now with the new build, since there is new code that puts tooltips on all modded items, you have to add this little detail.
for TIS
To add onto AuthenticPeach post, it seem that the usage of the ClothingItemExtraSubmenu is broken for item with a custom module name other than Base.
So maybe it might be something about this line where it get the type instead of the fullType
client\ISUI\ISInventoryPaneContextMenu.lua line 3514
Can any devs tell me if this can be manipulated safely and if so, is it automatically communicated to clients?
https://zomboid-javadoc.com/41.65/zombie/network/GameServer.html#bFastForward
Javadoc Project Zomboid Modding API declaration: package: zombie.network, class: GameServer
Could this code allow for speeding up the server by using the same variable that sleep uses? (let's assume the sleep check doesn't overwrite it, even though I know it does)
local function setFast(msg,tab)
if msg == ".fast" then
network.GameServer.bFastForward = true
network.GameServer:syncClock()
elseif msg == ".normal" then
network.GameServer.bFastForward = false
network.GameServer:syncClock()
end
end
Events.OnAddMessage.Add(setFast)
or am I misunderstanding which java variables I can access through lua?
Looks like LuaManager$GlobalObject.class doesn't expose GameServer directly. So that is a no.
Honestly, I don't understand why all the lua methods aren't just exported directly from Kahlua and added to the wiki. Seems like minimal effort would make modding significantly more accessible.
Does anyone happen to know if tampering with the java files on a dedicated server will give issues?
Does anyone know good special infected mods? And if so can you link it thx
in network/GameServer.class, there's the following logic
int n10 = 0;
int n11 = 0;
for (int index5 = 0; index5 < GameServer.Players.size(); ++index5) {
final IsoPlayer isoPlayer = GameServer.Players.get(index5);
if (isoPlayer.isAlive()) {
if (!IsoWorld.instance.CurrentCell.getObjectList().contains(isoPlayer)) {
IsoWorld.instance.CurrentCell.getObjectList().add(isoPlayer);
}
++n11;
if (isoPlayer.isAsleep()) {
++n10;
}
}
ServerMap.instance.characterIn(isoPlayer);
}
setFastForward(ServerOptions.instance.SleepAllowed.getValue() && n11 > 0 && n10 == n11);
Could automatic fastforwarding be implemented by simply changing if (isoPlayer.isAsleep()) { to if (isoPlayer.isAsleep() || isoPlayer.isDoingActionThatCanBeCancelled()) { on the dedicated server?
Any modders online? I need help. I finsihed making a pistol gun mod, everything is okay so far but an error line came out. It says.. "Error: Missing Translation "Pistol". I wanna know how to fix it hehe
Those messages really need to be removed from the game, as they're inconsequential "developer nagging" and not indicative of anything serious that can affect people using the mod.
However, if you want to remove that message look at \ProjectZomboid\media\lua\shared\Translate\EN and the file ItemName_EN.txt for an example of how you can set up translations for your new item.
Generally however, only console messages with "Stack Trace" are anything of genuine concern.
Okay, i will check it out and put out an update once I've done some debugging again! Thanks Blair!
Np! 👍
Can anyone suggest me the best vscode lua extension? with something similiar to JSDocs support if possible
Oncreate lets you execute functions. so you can have "Oncreate:myfunction," in the recipe without the quotes, then in a lua file define a function:
function myfunction(items, result, player)
local inv = player:getInventory();
inv:AddItem("Item fullpath");
end
you can add what ever code you want inside that function to add whatever you want to the player inventory.
guys, I need some help. I'm about to release the exoskeleton mod, but I found some clothing issues.
There are some specifics clothes I'm wearing that overlaps the exoskeleton armor in that area. I'd like to keep the skeleton clearly visible over any cloth.
Here's the issue when I wear the bulletproof vest
Oh. I tried to push the faces of the exoskeleton's mesh outwards and It didn't work
@late hound
Hate to do it this way but honestly this saves me some time from fixing it myself every time the mods are updated plus no other way to report it. And I don't know Shark's Discord handle, so any help on that would be welcome.
Shark's and Peach's Military Uniform Improvements
Distributions_SMUIClothing.lua
Lines 153 and 155
Items are named "SMUIClothing.Jacket_CamoUrban" instead of "SMUIClothing.Jacket_ArmyCamoUrban"
Jacket_CamoUrban doesn't exist.
Shark's Law Enforcement Overhaul
Distributions_SLEO.lua
Line 66
Item is named "SLEOClothing.GreenLegPouch_Right" instead of "SLEOClothing.GreenLegPouch_RLeg
Line 69
Item is named "SLEOClothing.BlackLegPouch_Right" instead of "SLEOClothing.BlackLegPouch_RLeg
Line 75
Item is named "SLEOClothing.ElbowGuards" instead of "SLEOClothing.ElbowPads
Line 78
Item is named "SLEOClothing.KneeGuards" instead of "SLEOClothing.KneePads
you should ask in #mod_support
Perfect, thank you and sorry again ^^
np
morning all
anyone mind testing this mod see if the lua loads for them?
i feel like the game cached a bad one and now it wont delete it
drop it
Hello, I'm trying to make a spawn tweak mod for Filibuster Rhymes' Used Cars for me and my friends to play with on a server, but it won't work at all and it throws me an error when loading to the server. I tried using this mod as base https://steamcommunity.com/sharedfiles/filedetails/?id=2732270391
this is the start of my .lua
and the end
I also tried changing the spawn chance like this
neither works
can someone please help me with this?
What error are you getting?
does PZ cache mods somewhere? and if so where? i need to clear one out.
Do we have a mod that lets you make some kind of a mark on a zombie once you are done looting it so you don't have to return back to them later, checking, did you loot them or not?
That's a handy idea!
Hey, does anybody know if it's possible to extend the discord integration with a mod? On the surface it doesn't seem possible as I guess none of it is exposed in lua 😦
And I presume the lua is sandboxed so wouldn't be possible to make arbitrary web requests to trigger the discord bot?
In which case, I would think the only alternative would be to have a separate bot which just watches the server log file and responds to things in there, and/or inspects the save files for info?
Unless you're willing to dig into java bytecode, I don't think it's feasible
I am certainly not willing to do that 😄
I'll knock together a standalone bot and see how that works
I am currently working on something in bytecode, but the spaghetti makes it hard
Interesting - Anything I can follow for that? Happy to offer help although Jave is not my wheelhouse
I removed the lines causing errors but the spawn tweaks still don't work
If you don't have experience with assembly or similar, it's pretty hard to mess around with. What is it you want access to that isn't exposed with lua?
I'm a c++ dev by trade and have dabbled in asm when necessary. Basically I'd like to be able to use bot commands from discord to query things about the game/server, so there's a number of ways I can imagine it being done, but fundamentally if there was something which allowed control over received/sent discord messages then that would cover most things
Or perhaps even if the in-game chat is exposed in lua, then that would work with just the default discord mirror
Ah, OnWorldMessage may be useful
Yeah have found the new one
in general chat message stuff might be enough to get what I want, effectively just leave the discord bit up to the official integration, and add all the "bot" behaviour to the in-game chat
Does anyone know the lua fuction for the attack animation? With both melee and firearms?
I need to make the player attack randomly 
someone please tell me why won't it work
I guess you are trying to disable vehicles from another mod, right?
yes, from Filibuster Rhymes' pack
if your mod loads that file before Filibuster's those changes will not apply
is there any way to give priority then?
I tried moving them up and down on the multiplayer mod list
didn't change anything
You can make your file require his file
I may be wrong but you could add a require
oo, I'll try this
You know the file you're editing isn't the same name as the one in the error message?
It also mentions which line is the problem - #24
It's hard to tell as you don't have line numbers visible, but I think that line is just outside your screenshot
I added the require on steam and nothing changed
does the require have to be a line in the mod files?
apparently yes
It is a line in the mod files.
This is for example from my mod
require "TimedActions/ISBaseTimedAction"
still asking this. i can't work on my mower until i get it cleared
Ah yeah, I've used the code stuff before I've just been struggling to have it give me another item on top of the extra it already adds, been messing around trying to get that to work but haven't found a solution yet
Hmm, for mods I guess you could look around in Steam's Workshop folder with the 108600 ID just in case it didn't remove itself
added the require, still doesn't work
tested both under and above original mod on the list in the multiplayer mods
i didn't publish it. it's still all local.
No no, you need to add it to your file that does require it. For example this is one of my file, and this one in particular requires the vanilla file, so I have the require at the top of the file
oh, so it should be in the lua file?
Yes yes exactly
It basically means that your file requires the other file, so it solves the problem
FRUsedCars is the modID right? you need to specifcy the folder/name of the file you require
You need to identify which file from the other mod you need and use that
so the full file location like this right?
this is the original file with the spawn values
I'm not really sure so if somebody else confirms would be cool but I think you can simply say
require "FRUsedCarsSpawnListNEW.lua"
BUUUUT again, I'm not sure
alrighty, gonna test it
anyone know where base-game animations are stored at?
Again, if I'm not wrong what I understand is that it will search inside client/server/shared folders, in this case the file is in
shared/file so you don't have an extra folder like
shared/anotherFolder/file which in this case you would require something like
require "anotherFolder/file"
nvm found them
Actually, I'm seeing and the .lua is never used so it should be
require "FRUsedCarsSpawnListNEW"
yeah this one didn't work
gonna try without .lua now
okay
it seems to work
but
not fully
You may require multiple files?
went through wreck congestions and mall parkings lots
and I didn't see any of the cars I don't want to spawn except for one
gonna try one more time and then another with one car set to 100 spawn chance
changed the volvo spawn chance to 100 and now I can confirm it works
@worldly olive thank you dearly for the help, I would've gone insane without it lol
Awesome!! 😄
Is there a attach to back from ground mod out there.
Well it's finally done. I managed to add fastforward in multiplayer without sleeping. Now my mates and I can read books at a reasonable pace. I don't think I will be craving Italian anytime soon though 🍝
Had to use IsoPlayer.isSitOnGround() instead of IsoPlayer.isReading() or IsoPlayer.isDoingActionThatCanBeCancelled because both of those are only available on the clientside though 🤡
so i did a full reinstall of PZ. the ONLY mod i am loading is mine. there are NO errors. and my ridingmower.lua is not being loaded. if i send the mod to anyone else. it loads for them. i need some help.
Is there any info on like, the actual damage/attack speed formulae or is that all still unavailable?
check the console.txt for the file. It might not loading due to a crash in the file. might be a syntax error somewhere
there's NO error.
LOG : Lua , 1645637269235> Loading: C:/Users/Owner/Zomboid/mods/RidingMower/media/lua/shared/RidingMowerSpawnList.lua
that's the ONLY line
and my file that's missing is RidingMower.lua
I need an adult!
If you rename it, does it still not load?
yup
renamed the mod AND the file.
if i send you a copy of the mod it will load fine.
temporary delete all the file content save and reload and see if it see the file?
i have fully reinstalled pz.
if so then there is an error in the file
want me to send you the mod ... so it can load just fine?
just the file
it's literally JUST ME that it's not laoding for.
Anyone tried my UI library ? I'm about to update this mod with The Only Cure, so if you have any feedback, I take
i have not mr bounty. sorry. i plan to! but cannot at the moment.
Don't be sorry, it's 2 days old. If you planned to try it's already nice, thx
What defines if a weapon has a detachable magazine or an internal magazine?
Anyone has any idea which mod uses the "CSword" module? It also adds a EntrenchmentTool. Also does anyone knows which mod adds the 1, 2, 5, 10, 20, 50 and 100 DollarBundle? Items like "100_DollarBundle".
If you use something like notepad, you can research in every .txt in your mod folder to find any "CSword"
not sure if it matters, since the game probably corrects it anyway, but I'd suggest using / rather than \
I'm using Notepad++, problem is, I don't have that mod. It's another mod referencing it and I'm searching for it.
oh, thanks Discord for only showing me commentary from hours ago
Mb, so no idea
@little vessel is it a mod you have installed?
Nope. Which is why I'm asking around.
is this something not on the workshop?
people should be marking other mods as a dependency of theirs, if they rely on it
they may (should) also have done that in their mod.info
but depending on what you're doing, you might be able to get away with only doing the link in Steam's UI
Dunno. No idea. It's no big deal - I'm just cleaning my console.txt out of "ghost" distributions to guarantee everything is working and spawning as it should (as the game tells you if an item doesn't exist and you are trying to spawn it). If an item doesn't exist, it still generates a log entry
ItemPickerJava.ExtractContainersFromLua> ignoring invalid ItemPicker item type
Which doesn't really break anything but pollutes the file. So I remove the items from the distribution table if their respective mods are not active, thus cleaning it. Except I cannot for the life of me figure out these two.
you mean you can't figure out which mod on your HDD is putting some junk in (Procedural)Distributions?
I can figure out which mod is putting these ghost entries, I cannot figure which mod these ghost figures are supposed to be from.
For example, Expanded Helicopter Events. It adds Firearms B41 items to the loot tables. So I do
if getActivatedMods():contains("ExpandedHelicopterEvents") and not getActivatedMods():contains("firearmmod") then
RemoveItemFromDistribution(VehicleDistributions, "Base.MP5");
RemoveItemFromDistribution(VehicleDistributions, "Base.M60");
RemoveItemFromDistribution(VehicleDistributions, "Base.AmmoCan762");
RemoveItemFromDistribution(VehicleDistributions, "Base.762x51Box");
RemoveItemFromDistribution(VehicleDistributions, "Base.Bullets9mmBox");
end
And that cleans it up a bit.
EHE doesn't really suffer if I don't have Firearms B41, but the console.txt log gets a bit more cluttered.
why not just query ScriptManager for each item name and see if it returns you a definition
oh god the spam.
then you don't need to care what mod it is, you just have a small loop that nukes everything ScriptManager doesn't know about
Hmm can you explain it with code, please?
local sm = getScriptManager()
for <items> in <distributions stuff>
if not sm:FindItem(<item>) then <nuke it> end
Hmm that makes sense and might be easier than what I'm doing so far. Thanks, I'm going to try it.
if for some reason getScriptManager() isn't a thing, though I'm pretty sure it is, ScriptManager.instance also works
it also means you won't clobber items from mods that don't use a script file to instantiate them
though I think if you want the items to persist, you have to generate a script file - at least, I had to
but, you probably don't care about that.
However, what you might care about is caching the result, because I believe FindItem is going to be a linear search
and if there's a shitload of items, it might make your server startup times suck quite hard
:[
xD
before im going to even research how to make a mod for zomboid - is it even possible to change the mainmenu music?
yes
thanks
I’d appreciate if you followed the rules, specifically with including a full dick in the image.
any help?
I need to know how to make an animation work period lol.
Reason: Don't post stuff like that here.
I know there is DoAttack(0) but it's not enough
@left plank Ok understood ( But you should have had a bit of humor as it was clearly intended )...and by the way....That frog displaying a human ass is not exactly in line with your moderation mate...just to say....
I thought it was funny
does anyone happen to know if there is a way to detect a player has "quit" the server but before that user's chat session closes?
...from the client side of course
Is there a way to manually invoke this events?
Events.OnPressReloadButton
Events.OnPressRackButton
triggerEvent("OnPressReloadButton", param1, param2, etc)
Does this work for the Hook too?
because I need to summon Hook.Attack too
Ah, >.< so how can I force the player to perform the attack or shove?
i dont get my mod to show up in the modlist, its supposed to be a mainmenu music replacer and i had some help by copying the filestructure of a 41.50 version mod. Does that mean they changed the method
maybe LuaHookManager.TriggerHook() works idk
If the mod does not show up in the modlist maybe you have the wrong file structure in the mod folder
try it
I will 
yeah well as i said, i copied the filestructure of a 41.50 version mod that does exactly the same
im not shure what to do with that because i only copied the filestructure of your mod and that wasnt in there
you maybe want to have a look at it?
just to confirm its correct
that was intended for Mx
i see
for the file structure did you try make a mod with the template mod?
no i deleted that
use it
and place the files in the correct locations
remove what you dont need like the template maps that come with it
Yeah doesnt seem that Hook is exposed in anyway
using Hook.<EventName>.Add() seem to only add it to a kalhua table that java will read
Oh, okay sad, but okay
but if we look where that hook is triggered in java we can maybe call that method
so you want to trigger Attack hook
So, player:AttemptAttack(0)?
and doesnt trigger with barehand
Ah
so must have a weapon
Barehands goes directly in the shove function?
now when isoPlayer call AttemptAttack(this.useChargeTime); it pass in the useChargeTime
i supose it like the delay between each attack
actually idk
i think you can omit the parameter
player:AttemptAttack() should do
AttemptAttack work with any living character but the hook will only trigger for IsoPlayer type of character
public boolean AttemptAttack(float var1) {
HandWeapon var2 = null;
if (this.leftHandItem instanceof HandWeapon) {
var2 = (HandWeapon)this.leftHandItem;
} else {
var2 = this.bareHands;
}
if (var2 != this.bareHands && this instanceof IsoPlayer) {
AttackVars var3 = new AttackVars();
SwipeStatePlayer.instance().CalcAttackVars(this, var3);
this.setDoShove(var3.bDoShove);
if (LuaHookManager.TriggerHook("Attack", this, var1, var2)) {
return false;
}
}
return this.DoAttack(var1);
}
also if it find a hook return true it will not do the attack
Oh, okay interesting
So, the issue of the Attempt attack is solved, what about invoking the shove? 
public boolean DoAttack(float var1, boolean var2, String var3) {
if (!this.authorizeMeleeAction) {
return false;
} else {
this.setForceShove(var2);
this.setClickSound(var3);
this.pressedAttack(true);
return false;
}
}
var2 is boolean and mean force Shove
so player:DoAttack(0, true, ""); i supose could work
I will test it right now
it works! 🎉
yay
local function Tourette_Init()
if skipFirst then
skipFirst = false
return
end
local player = getPlayer()
local roll = ZombRand(100) + 1
local vehicle = player:getVehicle()
local weapon = player:getPrimaryHandItem()
print('Tourette roll:'..tostring(roll))
if roll > 0 then
if vehicle and vehicle:isDriver(player) then
ISVehicleMenu.onHorn(player)
return
end
if not (player:isDoShove() or player:isSprinting() or player:IsRunning()) then
if weapon then
-- Rack the gun
if weapon:isRanged() then
if ISReloadWeaponAction.canRack(weapon) then
triggerEvent("OnPressRackButton", player, weapon)
return
end
else
-- Swing melee
player:AttemptAttack()
return
end
else
-- do shove
player:DoAttack(0, true, "")
return
end
end
player:Callout()
end
end
I got asked to add it to my mod

So does everyone update their mod for the unstable branch atm? and what will that do to the server not upgrading yet (that we already know 😆 ) but im wondering what you guys doing about it.
Is there a function available to return some sort of WorldUUID?
I need a number that uniquely identify the world creation
it must be consistent as long as there is no reset
Well, I think there's only a couple of new features in 41.66 that provide new modding possibilities, such as the very sexy OnCreate for items?
I don't think anything mod-wise can be broken by 41.66, offhand?
It's just a matter of waiting for 41.66 to be stable in my books, and then time to use the new cool stuff 🙂
oh yeah that is sexy asf we agree on that 
Oh man, it was added for the fish or fish fillets that spawn in stores, and it's like discovering unobtanium by accident!
Cause i want to update computer mod to randomise the game CD properly using OnCreate
But as you say that will not break anything
will just not work until next official release
I feel like .66 will go stable soon, haven't heard any issues re it?
honestly didnt see any issue with my mod pack so yeah pretty good for now
Oh, isHidden for recipes is very intersting as well.
It makes it so recipes with that flag don't show up in the crafting interface itself, just right-click-on object.
So if you want to not bloat the recipe interface for stuff like, say, "unfold multitool".
sick
Oh yeah, very fucking sick.
that will make the recipe UI much faster i suposed without the bloat
||as well as puzzle/mystery stuff 🙊 ||
Well, I'm not sure about that, in that it might still need to evaluate the recipe?
But hopefully!
right it still loop it all
but if hidden it still skip all the code inside that loop
might help
How do I send an animation for a player on the server ?
But yeah, those are the two BIg Cool Things in 41.66 that popped out to me 🙂
if using an action it will sync it automatically
i do think playerObj:PlayAnim() should sync too but havent tested yet
Mmmm, but I see only one game doing the animation
I use self:setActionAnim("WearClothing")
setActionAnim should be sync
if the other player start the action and is in range of you
if you arrive after he started it you will not see it
I think it's because in my timed action, character is the other player
but also if you try to change the animation while the action is running it will not change
what do you mean your timed action is on the other player
They just next to each other
the Action will be transmitted and running on the player that start it on each player clients
when do you define the animation in the action
I mean that the variable character, which I presume is the one the anim is set, is not the local player
At start
you start a timed action from ClientA onto ClientB?
No I make a timed action an clientA, clientB got no anim, nothing, just need to stay
just at the end, at perfom I send a command to playerB
in your action:start()
if you run self:setActionAnim(animName); it should work for all client
thats very just simple like that
now if it doesnt work thats strange
I wonder if the door sync glitch has been fixed in 41.66
Been searching the whole source code to find what could cause it but no luck
Doors just opening randomly when passing by or walking into it (in MP only)
Ok that was it
I'm trying to get into lua modding PZ and ran into an issue I was hopping someone had experience with.
Any idea why this lua script snippet might be failing?
local function OnVehicleHorn(character, vehicle, pressed)
print("Scripting: On Vehicle Horn Event triggered")
end
Events.OnVehicleHorn.Add(OnVehicleHorn) -- zombie.Lua.LuaManager RunLuaInternal SEVERE: at betterHorn.lua:34
I tried the exact code on the (wiki)[https://pzwiki.net/wiki/Modding:Lua_Events/OnVehicleHorn] and also modified the function definition based on the code at ProjectZomboid\media\lua\server\Vehicles\Vehicles.lua. The vehicle enter event works with identical code, and I verified the Events object contains the method OnVehicleHorn and further contains the Add method.
I'm running the script from the lua/client directory in a single player world if that matters.
(moved from mod_support to here as this was the correct chat)
self:setActionAnim set an anim for the variable self.character and it's need to be the local player
Are you trying to sync action with multiple players ? like for example handshaking both player together?
well if you got it working thats cool
Yep, I should of try that before asking
Are there any mods that let you play custom music ingame? Is that even possible if not?
You can play custom music file yes
search music on the workshop youll find plenty of example
I mean like using a radio to play music. And custom like you choose the song, not a mod that replaces the ingame music with whatever
You can play music into the world
you can play the music from a character or from a square.
you can do this in Survivor Radio
I need advice. How do you think this would look best when on your back with a bag on? https://i.imgur.com/TD66L7h.png
also how do you guys do possitioning for models?
I am using the attachment editor with debug and I hate it
With a pack on?
in general
Uh
Well idk if you can specify different placement for different situations
Like without a backpack on it would make sense to just attach in on the back
But with a backpack on I would just not allow it to be carried on the back
oh you can.
Oh can you
Maybe just have it sit like
On the bag itself
Like so the bag is sandwiched between the pillow and player
^ I would think maybe a blanket roll-style of thing, though I'm not sure if you could change the model depending on where it's placed
Also yeah
I was gonna suggest like a blanket roll
Below the bag
But that wouldn't make sense
Cus the pillow would be stuffed
I suppose it depends how stuffed, I was thinking on top with just a slight curve to it
I was also thinking blanket roll on the bottom of the bag but the model is pretty long plus all the backpacks are diffent sized
it might not look right on the hiking bag for example
Yeah that could work too
Cant find a good one
Google like
SPLAV Backpack
Or even the 5.11 Tactical RUSH100
Basically
Those backs have it so the bottom of the bag sits at butt level
But the top of the bag goes above the wearers ehad
Head*
Like it sits higher on the back
But do that with the pillow
oh yea that's what I was talkling about
So like, the pillow mounted on the back of the bag itself
But slightly higher up on the bag
Idk how to explain it really
that would look kinda gooft do to how long it is
I think I might just have to leave it alone
looks best this way I think
either way like I was saying what do you guys use to position models on the player?
Well, I suppose I'm going to ask here again as I still haven't fully understood so far. Trying to get an OnCreate recipe to add multiple items, eg. saucepan, empty box, and packet. Can only have it give me two items, what's the format for adding an extra item?
eg. the AddItem("EmptyRootBeerBox"); for an example on my box of root beers, but would I need AddItem(s), any extra commas or different formats?
True but the skateboard mod is more radical
yes, but the bicycle would be much better than the skateboards
they could make them spawning tied to something with a chain and that to guide them you need to break the chain. And could add a whole part of mechanics, repair, painting and spare parts just for the bicycle
anyone here good at tuning cars?
problem with 2 wheeled vehicles is they really need more physics to look good. Granted we have the motorbike mod but I feel like a normal bike would be even harder. More animations and such.
I know, but it would be a really nice addition (and that could also revolutionize some of the mechanics of the game)
oh for sure
I noticed this is apparently also coming with 41.66 "Added functions for modders to add trait/profession definitions."
is 41.66 out now?
if so, thank goodness, my radio semi-fix mod is now obsolete
ah, looks like it's on an unstable branch, so i'm glad i just edited the title of the mod instead of outright hiding it
that I know there is already a mod that does, maybe I’m wrong
Yeah, it's good if it's easier to accomplish now though
i don't think so
41.66 is released under the Betas tab as "unstable"
yeah
i need to update and crack it open to see if the function i fixed with my patch is... actually fixed
since the 'fixed radios' bit seems to have disappeared between the prospective changelog list and the official one
Got my mod working but before I publish it, how do I ensure compatibility with other mods that also override the same function, ie. ISToolTipInv:render()?
Run an instance of the dedicated server, install both mods, and play on it
New UI update of my mod ! Made with my UI library
https://steamcommunity.com/sharedfiles/filedetails/?id=2703664356
Let's now pray that I didn't make explode every server xD
The one that loads first is the one that's displayed, but since they affect different item types there should theoretically be a way to make them compatible
Yeah, they also have to be written specifically to be compatible is my understanding
Which of course not everyone does
The sections in FWolfe's Zomboid-Modding-Guide regarding "Overwriting Vanilla Code" and "Overwriting Another Mod's Code" touch on this topic https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md#overwriting-vanilla-code
In fact it specifically mentions ISToolTipInv:render()
AddItem(item) for one, AddItems(item, x) for more, x being the number added
how do I get coordinates for a spawn point (like worldX=10, worldY=7, posX=133, posY=163)? Ingame it gives me smth like 3002/5789 when I use the teleport tool
The first set of numbers, worldX=10, worldY=7, are the Cells, If you multiply them by 300 they should align with the coordinates you get when you arrive. You might have to apply an offset of 300, just test and see what's necessary.
But what you'd do for the spawn points is divide the X and Y coordinates by 300 to get worldXand worldY, and use the remainder for posX and posY. There may be a 1 cell offset, not sure offhand without testing and doing the math myself?
Ah, more-so different items. As the methods I've done so far just end up with an error. eg. for this specific recipe, you get back a saucepan with noodles, a cheese packet, and the empty box. But so far I can only get two of the three to work
I don´t get it, so if I want the 3002/5789 spawn I divide 3002 by 300 which is 10.00666666666667 and then ???
It´s not going well
now I got it
so u dont do 3002 / 300 but instead 3000 / 300 and 2 remaining
is it possible to change a zombies player model?
say i made a model of a box. could i change an existing zombies model to that?
Hey all, I'm looking for as much information as possible on Mod IDs
I need to know what characters are allowed/not-allowed in a Mod ID
Hi, what's the fix to making vehicles appear on modded maps in logical locations i.e parking spots, roads etc without spawning them in via cheats?
I don't know if he's on here, but Mr. Macbeth has been working on a vehicle mod recently. If he is on here, you might be able to ask him
i just want my mower to drive like a mower, and the trailer to not be an anchor.
What's the difference between OnRenderTick and OnTick? I mean...OnTick is called at every game tick ( or rather about 8-10 milliseconds ) but the display is also continuosly rendered...Maybe the difference resides in the time duration for the event to be called ( Sample: OnTick = 8-10 milliseconds, OnRenderTick = 20 milliseconds )
Any idea?
You can spawn as many different items you want. There's is probably a mistake for the item that is not spawning
If i had to guess, onTick is every game update, and onRenderTick is every time a new frame gets rendered. onTick is probably a fixed rate and onRenderTick scales to whatever framerate you desire.
I'd think it'd be a mistake for the code more than the item, as the item spawns just fine if you choose the option to just take the cheese packet out
@runic sparrow Thanks mate, very good guess 😉
I am trying to run a function on the player every update, but its not working. I copied this code from the modding wiki and it wont print anything. can someone help?
Question 2: Is there another event that can be used to replace the OnGameBoot one? ( Asking bacause the mod I'm using generates an error on game start if I use it ). I mean: Is there another event that activates on game boot ( or close by ) but that is not the OnGameBoot one? ( ...and that is not the ONTick one too )
@runic sparrow It depends...what you wanna do?
check if the player has an infection, probably by using the isInfected() method
SP or MP?
Preferably both
mmm..ok...the hello word message is displayed on screen or in the chat?
Try using OnEveryTenMinutes or EveryHours
it should appear in the console, it works when i run it without the function
... or EveryOneMinute depending on your needs
Just remember that the more is called the more strain is put on the PC ( In theory ) so tests it well first 😉
my mod wont be nearly complex enough for that to be a problem
its going to be like, and if statement, and a couple calculations
also, i need to be able to modify the player, can i do that with EveryOneMinute?
What you mean by modifying the player?
Hey hey, anyone know if being on Windows 11 can make some mod glitch or just not work at all ?? My mod doesn't work for someone and the only thing we found is that he's on Win11 and me on Win10
get and modify all the values associated with being infected. I want to add a way to delay the infection
@strange sequoia Just a guess but I think that the problem is in some mods/files you're using not in the OS...
That's what i thought too but of all the people who downloaded my mod, only 3 have a problem with it apparently. The hair in my mod appear bald for them :/ And for now i'm really confused about what that could be. They have Fluffy Hair installed and everything but it just doesn't work for them
@runic sparrow In that case I would use OnTick ( Not recommended but it continuosly call the event ) or EveryOneMinute because I do not think that the infection could spread/change status faster than a less than a minute
could it be an incompatibility with another mod?
either of you two any good at changing animations?
I don't think because they tried with only both required mod installed and it still doesn't work for them
@Yaki So based on my experience I could say that if you got only 3 people having the issue, most probably they are making some error on their side (...and as always if asked they'll reply " No I've done it all correctly, I'm 100% sure LOOLL 😄 )
Another thing that may help....Steam updates are tricky and can generate different files inside a mod even if the mod is exactly the same...I suggest to tell to your user to completely delete the mods of interest and then re-subscribe...
I really don't know at this point ahahah x) For now i try to find solutions to make it work for them but i'm running out of ideas
I'm going to update my mod with new content soon so maybe it'll unlock it for them 🤷♂️
I can't say I know much about hair modding, but I wish you luck in finding a solution
Maybe..My suggestion is that if it's a critical updated to indicate to users what I wrote above in my previous commet ( ...and don't forget to make a backup first of your currently working mod..Just in case something may go wrong... 😉 )
@runic sparrow I was guessing a bit...Most probably for your needs the best one is EveryHours
( or rather every some mins IRL )
i do believe i am going to scream now.
@runic sparrow Start with this one...if you need something called faster go for the 1 min one
I cannot seem to get any of these events to work, am i doing something wrong?
does print("text") not work when i use it inside a function?
@runic sparrow If they don't work there's something wrong in the script or the way in which you are using the events...events can't fail by themselves... 😉
@runic sparrow (by the way if you quote your script will be more easy to help you...there's lot of talented people here willing to help with good ideas/fixes 😉 )
#mod_development message
@lusty nebula i posted an image earlier, is that what you meant?
local function MowerAnimation(player)
local vehicle = player.getVehicle and player:getVehicle() or nil
if vehicle and string.find(vehicle:getScriptName(), "Base.RidingMower") then
local seat = vehicle:getSeat(player)
--print(seat)
vehicle:playPassengerAnim(seat, "Mower")
end
end
Events.OnPlayerUpdate.Add(MowerAnimation)
``` why does this WORK but do NOTHING!?
@lusty nebula I think i figured it out. I think the print function prints to a different console when run on client vs the server, so i was looking in the wrong one.
then it doesn't work 🤔
well firstly player.getVehicle is a method not a property
Don't you play the animation every frame ? So you basically only see the first frame
if i OVERRIDe the default it work, but that will mess up ALL motorcycle mods
it's only one frame long
this is the default.
this is the new one.
i want it to use the new one but ONLY if you are in the mower.
#mod_development message
Any helps? 😦
try that: vehicle:playPassengerAnim(seat, "Mower", player)
Can you chew zeds with it too? LOOL 😄
So I guess the vehicle is overriding your animation
Sanity check, is it actually being called?
and doing it in player update won't work
is what being called?
The function
And what Ziboo says seems appropraite as well
the player object has a lot of methods with the word highlight in it, maybe try going through all of them?
It probably needs to be a vehicle related function where you set the animation
on vehicle update?
Sounds like a good start to investigate
try "OnEnterVehicle" events
is there a list of events?
function ISEnterVehicle:perform()
self.vehicle:setCharacterPosition(self.character, self.seat, "inside")
self.vehicle:transmitCharacterPosition(self.seat, "inside")
self.vehicle:playPassengerAnim(self.seat, "idle")
-- if self.vehicle:isDriver(self.character) and self.vehicle:isEngineWorking() then
-- self.vehicle:startEngine()
-- end
triggerEvent("OnEnterVehicle", self.character)
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self)
--ISBaseTimedAction.stop(self)
end
@faint jewel https://pzwiki.net/wiki/Modding:Lua_Events
You should be able to register to OnEnterVehicle
and then call self.vehicle:playPassengerAnim(seat, "Mower")
Events.OnEnterVehicle.Add(MowerAnimation) like that?
yo instead of typing the mod id and name into my config file directly can i add the workshop item in the workshop file for my save?
okay NOOOOOO not like that.
local function MowerAnimation(player)
print("fired")
local vehicle = player.getVehicle and player:getVehicle() or nil
if vehicle and string.find(vehicle:getScriptName(), "Base.RidingMower") then
local seat = vehicle:getSeat(player)
--print(seat)
vehicle:playPassengerAnim(seat, "Mower", player)
end
end
--Events.OnVehicleUpdate.Add(MowerAnimation)
Events.OnEnterVehicle.Add(MowerAnimation)
``` that just went ham with "fired"
Well yes
player.getVehicle would error
it should be player:getVehicle()
and, you don't need "or nil" i think, because player:getVehicle() would return nil if you're not in a vehicle?
would anyone happen to know how to print messages to the chat?
Just print or the :say("text") ?
local function MowerAnimation(player)
print("fired")
local vehicle = player.getVehicle()
if vehicle == nil then return end
if not string.find(vehicle:getScriptName(), "Base.RidingMower") then return end
local seat = vehicle:getSeat(player)
if not seat then return end
vehicle:playPassengerAnim(seat, "Mower", player)
end
Events.OnEnterVehicle.Add(MowerAnimation)
I'm also worried that the conditional assignment of vehicle might assign a boolean instead of the vehicle? Not really well versed in lua though.
Make sure this line works too: string.find(vehicle:getScriptName(), "Base.RidingMower")
print vehicle:getScriptName() to be sure
I think string.find might return index number not a boolean
And I think in lua, all integers are true?
So even if it returns -1 for not found it might still be "true"
String1:Contains(String2) I think is usable, which does return true/false
I'm using the OnGameStart event but my script seems to take a couple of seconds before loading the script while starting a new game....any way to let load the script load faster?
I think OnGameLoad is when you load the mods in start screen/after changing mods
if string.find(vehicle:getScriptName(), "Base.RidingMower") == nil then return end
this should work then
I don't think this works in lua because only false and nil are false
@hearty herald Can't using it, it generate an error when I start the game...I'm starting to get convinced that when you start a new game the game take a couple of seconds to load the scripts by default ( hardcoded I presume )
There is also OnCharacterCreate I've seen. What is it you're trying to do?
Nvm, It seems string.find gives you a nil as return value if it doesn't exist
@hearty herald Basically I'm in the advanced stage of a mod that auto-equips player's clothes...Everything working as planned but in the UI mod ( the one that displays the player's weapons,belt ect ) it takes some second to load the belt slot/icon....I have to check if it's not directly that mod that it takes that time to update ( It works but it takes -10-15 secs to load the correct icon slot )
In Lua it seems you can simply check for equality with strings in most cases, so vehicle:getScriptName == "Base.RidingMower" Should work too
Hmm, I think the UI has a different framerate/update frequency that you can change in settings?
@hearty herald Good point I have to check....
Atleast the base game UI has a framerate cap, I think default is like 15fps?
( Checked it's already set to max or rather 30 fps )
Maybe I need to create something to switch it to 60....
It could be that the UI mod has not detected the changes until something else notifies it
I'll take a look at the UI mod let's see if there something in it...
If it's waiting for some kind of event to trigger to make changes it's likely that
Is the normal inventory UI updating properly that the stuff is equipped?
I checked that https://www.lua.org/pil/20.1.html
Yeah I checked it too
I did reply to myself saying that yes it would work like that
But even simpler is probably just using string1 == string2
yep if you are sure that it's a 1:1
It should be a 1:1 match in the case of what he is trying to do
The lawnmowerscript doesn't change name
yep I don't know never worked with vehicle and don't know what getSCriptName() return
@hearty herald I think I've found the culprit...The UI mod ( Namely the Weapon Condition Indicator one ) uses the event OnPlayerCreated that works but that's slower in respect to OnGameStart....
What happens when you die and recreate a character though ?
Could also be a timing/update thing. If there's a way to prod it for force update you could work with it
I guess OnGameStart is not called but OnPlayerCreated is
I have some mods that don't work after you respawn a new character, and you have to quit and continue to make them work again
@hearty herald On game start is called while the new game is loading...OnPlayerCreated instead is triggered after that the player spwans....that's why is delayed...
@faint jewel look at the file SkateIdle.xml in media\AnimSets\player-vehicle\idle in this mod https://steamcommunity.com/sharedfiles/filedetails/?id=2728300240
@lusty nebula , do you have a lot of mods loaded?
It might be delayed extra time if you have a lot of mods using the event which need to finish first.
@hearty herald Yep actually yes...that could be also another cause....what's the ideal/suggested max number of mods enabled to keep activated ( if any)
I don't think theres a guideline for it, but things like that is the reason it's good to make efficient code!
When I was testing stuff I disabled all the mods except the one I was testing, the game loads a whole lot faster
@hearty herald Yep I know ( and I've done the same ) but I've already passed that fase...Now I'm testing how the mod behaves in a normal environment ( or rather with mods activated to simulate the user's standard usage )
Everything works fine there's just that little delay in loading the UI icon slots...nothing major but I'm picky as hell so it annoys me LOOL 😄
Did you notice the delay when you were going with just your mod?
