#mod_development
1 messages · Page 552 of 1
turn on Manual drinking option in your settings
is there any boolean to detect if a house alarm / car alarm is playing / has been triggered etc or if a zombie can hear an alarm or something
where can I find the VHS tapes script? i couldn't find it in the media files
#projectzomboid #zomboid
Imagination required: For the next Project Zomboid challenge , I'm playing with Floor is Lava rules in place, similar to Glock9's 7 Days to Die Playthrough: https://www.youtube.com/watch?v=aD491FlHBdE
So glad everyone has enjoyed what has come so far with the all negative traits character, and there will definitely be mo...
im a bit late to the party but has anybody made challenge mods for amphibian
can't you just sed the zombies to ignore player built structures?
Hi, I’m trying to learn to mod, does anyone have any tutorials for modding? I tried blackbeards tutorials on YouTube but they didn’t work for me.
my comment removed because 'wrong channel
One of the best way to learn is to find a mod on the workshop that look similar to what you want to achieve and then you examine how the mod has been developed.
If you have an idea of what you want to do you can ask here. We may be able to point you in the right direction.
also you will find all the mod you have subscribed to here C:\Program Files (x86)\Steam\steamapps\workshop\content\108600
Ok thanks
Also, I tried making a mod a while ago, I put the mod into the mods folder and it did come up in the mods section but wasn’t enabling
Do you know why this happened?
You can copy/paste C:\Users\<user>\Zomboid\Workshop\ModTemplate into C:\Users\<user>\Zomboid\Workshop and rename it to your mod name and also rename the mods info in both workshop.txt and mod.info.
anyone have any idea why my event Events.OnMechanicActionDone fires 4 times in thesame second for some players? i'm trying to link a logsystem to this event to show what has been uninstalled, but its acting up
Ok thanks, I’ll try that if it doesn’t work again
Try using the same ModID for your mod directories (naming)
Are you using Events.OnMechanicActionDone.Add somewhere special? Could be maybe you are adding it multiple time
I need a little help by any experienced coder, something i think should be simple for the ones that know best..
nope, just once in an initialize function upon an event called OnGameStart
Just throw your question here
the vehicle id in the log also differs for every log made, which is very weird
can you show some snippet of the usage of these event from your code?
So I think my blind zombie code is nearly completion, I was able to make some descent behaviours for the zombies but theres just one small problem
and I think its due to my inexperience with coding and or 0 experience with lua even tho its similar do c#
one of the things not allowing me to complete is.. let me see how to better word everything
if my character is moving the player is detected and the zombies starts to follow it, but as soon as I sneak / stop moving.. its like the player is magically gone.. the zombies will stop immediately (because of the zombie:setUseless), I tried using a boolean for that but as you probably guessed
the boolean is always being set true and false
I would need to show you the code for you to understand it better tbh
I'm using a combination of character modes (isSneaking, isMoving, isRunning) and a distance check between zombie and player + setUseless to achieve a fake blind zombie behaviour
again.. it works.. if you sneak and walk by them.. its like they are blind.. but if you run they will notice you and run after you, the problem is.. if you stop, they also stop
I want them to keep following the character
You could add a "delay" like you increment a variable that say how long the player has been sneaking and if that number is higher than X then set the zombie back to blind
You can dm me with some code ill check with you
will do
Hello, how can I make a weapon not rotate when attacking?
That it always stays static in the hand.
thanks so much @thin hornet , my mod works
still need to work out some bugs but thank you so much
what am I looking at 👀
Katamari PZ edition
i have no idea, it changes wherever you look
it can be colours, doors, grass when it is supposed to be a opened can
what is the item's script block?
XD that is weird
and you have that icon in the textures folder?
thanks for making me recruit btw
Anyone know how to set a timer ?
is there any mod that adds foods/drinks with energy?
had snake's modpack which added energy drinks but its outdated now unfortunately
anyone have any idea how hard it would be to set up a system similar to the way T-Shirts with decals work in the game on baseball hats?
or hoodies even
Hi there! Are there some good mods that add to the game (items / cars / stuff) and are very stable?
currently on the beta branch
guys have problem
with textures for vehicle
in blender and photo editor see the same
in game
is orange and cannot change color or see scratches or blood ///
all texstures are done correct
so RUST BLOOD DMG COLOR texstures not works
only what works is MASK and LIGHTS texture
sorry color mask works but only for lights/wheels/black area of car
Tornado mod confirmed for PZ?
and what put to second channel?
that blood rust and dmg?
or something else
yo
if anyone here could help me out with starting up and hosting a modded server
i have all the mods installed properly and eveyrhting works in SOLO
but doesnt when i host
and ive looked through multiple threads on this server, on steam, and everywhere else and im still confused af
if ya could hop on vc and i could screen share, @ me or dm me
otherwise imma go insane
Is there a way to modify the player's movement speed? I read that the run speed modifier on clothing items got disabled a few months ago and so even though items can say they have a run speed modifier, they don't actually. Is there any other way that a mod could adjust the player's movement speed?
does anyone know any gun mods that don't add too many guns, but simply adds a couple guns to each caliber.
(please don't say brita's gun mod because it adds FAR to many guns and 0 mags so you cant even use them)
My mod fits your description. But sadly i can't post it on steam public yet.
you can turn off most things in brita, such as have only USA weapons, that will cut them down by 1/4 or so
but most people just use firearms b41 since it only adds 10 guns
just copy the UV that u have
If you can't solve it, call me in private.
hi, does anyone know how to make a custom hat, im not too sure about how to make the custom meshes and where they go in the file directory
Can anyone make an updates modding system where you can inspect your weapon and customise it(kinda like a cod modding system)
updated*
Ah dang, why can't you post it?
I've tried that but I keep getting 3 guns and one mag for a gun that I don't even have, I also get like 6 cases of ammo for a gun I don't have.
you expect everywhere you go to stock what you need..?
it's already in my friend server as an exclusive gun mod.
ah dang
but im planning to post another gun mod.
Yoooo, can you dm me the name of it when you do?
i name it Ossalion's BoomStick🤣 🤣
Anyone here knows how clothing.xml works?
I am trying to create a custom outfit with existing items, however the zombies are spawning naked
How does one add sandbox settings to their mod?
all of the item guids that you use in your outfit also need to be inside your mods fileguidtable.xml, you need to go to the vanilla game's guidtable and then copy all of the items that you use into your own table
I do not need the item textures, just the fileguidtable, right? Also, can I use the same guid since I am not changing anything on the clothing item?
yeah you just need to copy it from the vanilla table to your own, you dont need any of the files for the item
oh wait do you have a fileguidtable.xml already or not?
No I do not
Not for the mod that I am doing
But thank you @winter bolt , I think you nudged me to the right direction
np lol
you just need to make fileguidtable.xml in the media folder and then add in the stuff you need from the original file
Howdy, folks. Taking a break from struggling to get the darn jacket working and have a question regardin' evolv'd recipes. As an example, I'm creating some knock-off Lunchables for my mod and have given the pizza variants the ability to add various ingredients. I'm wanting to make the sauce packet have three uses, and so would've thought EvolvedRecipe = PIPizza:3, would do that, though it doesn't seem to do very much. I could give it three packets, but I'd prefer for it to just have one single packet with three uses. Is there another means to accomplish that? Is the fact that the sauce gives very little nutritional value the problem?
@deft falcon, apologies for the ping. I've been looking at your MoreTraits repo to figure out how to add Sandbox options, but it doesn't seem to be adding the options to my sandbox menu. The defaults do seem to apply, however.
Any chance you could help me out or link me to some documentation you found?
Much appreciated!
Hm, I seem to be doing exactly this, but the options aren't showing up 
idk
Sandbox_EN.txt
Sandbox_EN = {
Sandbox_SkillLimiter = "Skill Limiter",
Sandbox_SkillLimiter_AgilityBonus = "Agility Bonus",
Sandbox_SkillLimiter_AgilityBonus_tooltip = "The bonus to the skill cap for agility skills. (0 - 3)",
Sandbox_SkillLimiter_CombatBonus = "Combat Bonus",
Sandbox_SkillLimiter_CombatBonus_tooltip = "The bonus to the skill cap for combat skills. (0 - 3)",
Sandbox_SkillLimiter_CraftingBonus = "Crafting Bonus",
Sandbox_SkillLimiter_CraftingBonus_tooltip = "The bonus to the skill cap for crafting skills. (0 - 3)",
Sandbox_SkillLimiter_FirearmBonus = "Firearm Bonus",
Sandbox_SkillLimiter_FirearmBonus_tooltip = "The bonus to the skill cap for firearms skills. (0 - 3)",
Sandbox_SkillLimiter_SurvivalistBonus = "Survivalist Bonus",
Sandbox_SkillLimiter_SurvivalistBonus_tooltip = "The bonus to the skill cap for survival skills. (0 - 3)",
Sandbox_SkillLimiter_PassivesBonus = "Passives Bonus",
Sandbox_SkillLimiter_PassivesBonus_tooltip = "The bonus to the skill cap for passives skills. (0 - 3)",
}
sandbox-options.txt
VERSION = 1,
option SkillLimiter.AgilityBonus
{
type = integer,
min = 0,
max = 3,
default = 2,
page = SkillLimiter,
translation = SkillLimiter_AgilityBonus,
}
option SkillLimiter.CombatBonus
{
type = integer,
min = 0,
max = 3,
default = 1,
page = SkillLimiter,
translation = SkillLimiter_CombatBonus,
}
option SkillLimiter.CraftingBonus
{
type = integer,
min = 0,
max = 3,
default = 0,
page = SkillLimiter,
translation = SkillLimiter_CraftingBonus,
}
option SkillLimiter.FirearmBonus
{
type = integer,
min = 0,
max = 3,
default = 1,
page = SkillLimiter,
translation = SkillLimiter_FirearmBonus,
}
option SkillLimiter.SurvivalistBonus
{
type = integer,
min = 0,
max = 3,
default = 0,
page = SkillLimiter,
translation = SkillLimiter_SurvivalistBonus,
}
option SkillLimiter.PassivesBonus
{
type = integer,
min = 0,
max = 3,
default = 3,
page = SkillLimiter,
translation = SkillLimiter_PassivesBonus,
}
Like, the settings appear to be working fine
Their defaults are
I hosted a local server and made myself admin; But the mod's sandbox options aren't showing up in there.
welcome to zomboid modding
😩
yea idk the text is literally the same as the one in my other mod
where are the files put btw
sandbox options is in media right
legit no idea
Hm
do the options show in single player
Do mod sandbox options show up in singleplayer saves on world creation?
Was about to give it a try
yea they should
Let's see
yea all text is what it should be
no missing , either
legitimately have no idea whats up
have you remembered to restart pz
or reload lua
try restarting pz
what the fuck
i legitimately have no idea how thats possible
im comparing ur code to mine and theres no difference (apart from the names ofc)
nah
The defaults are applying (I verified this)
This is wack
So, the settings are working
Just not... showing up
This channel is about creating mods
the files are put in correct spots
there are no missing quotes or commas
I believe so?
i legitimately have no idea
My IDE isn't giving me any warnings, at least
my sandbox-options.txt
VERSION = 1,
option ETE.StartItems
{
type = boolean,
default = true,
page = ETE,
translation = ETE_StartItems,
}
my translate file
Sandbox_EN = {
Sandbox_ETE = "Extra Trait Effects",
Sandbox_ETE_StartItems = "Starting Items",
Sandbox_ETE_StartItems_tooltip = "If this setting is on, traits and professions will receive unique items at the start of the game.",
}
comparing my code to yours has no difference
excluding different names
does assigning a new property value by using getModData() not persist after server restarts?
@deft falcon I don't need any lua script in the client folder, right?
i dont think so
@willow estuary I'm terribly sorry for pinging you over this. Neither Fajdek nor myself have found what's wrong, and you linked the example mod for sandbox options. Is there any chance you could provide some insights as to what might be wrong?
Sandbox_EN.txt
Sandbox_EN = {
Sandbox_SkillLimiter = "Skill Limiter",
Sandbox_SkillLimiter_AgilityBonus = "Agility Bonus",
Sandbox_SkillLimiter_AgilityBonus_tooltip = "The bonus to the skill cap for agility skills. (0 - 3)",
Sandbox_SkillLimiter_CombatBonus = "Combat Bonus",
Sandbox_SkillLimiter_CombatBonus_tooltip = "The bonus to the skill cap for combat skills. (0 - 3)",
Sandbox_SkillLimiter_CraftingBonus = "Crafting Bonus",
Sandbox_SkillLimiter_CraftingBonus_tooltip = "The bonus to the skill cap for crafting skills. (0 - 3)",
Sandbox_SkillLimiter_FirearmBonus = "Firearm Bonus",
Sandbox_SkillLimiter_FirearmBonus_tooltip = "The bonus to the skill cap for firearms skills. (0 - 3)",
Sandbox_SkillLimiter_SurvivalistBonus = "Survivalist Bonus",
Sandbox_SkillLimiter_SurvivalistBonus_tooltip = "The bonus to the skill cap for survival skills. (0 - 3)",
Sandbox_SkillLimiter_PassivesBonus = "Passives Bonus",
Sandbox_SkillLimiter_PassivesBonus_tooltip = "The bonus to the skill cap for passives skills. (0 - 3)",
}
sandbox-options.txt
VERSION = 1,
option SkillLimiter.AgilityBonus
{
type = integer,
min = 0,
max = 3,
default = 2,
page = SkillLimiter,
translation = SkillLimiter_AgilityBonus,
}
option SkillLimiter.CombatBonus
{
type = integer,
min = 0,
max = 3,
default = 1,
page = SkillLimiter,
translation = SkillLimiter_CombatBonus,
}
option SkillLimiter.CraftingBonus
{
type = integer,
min = 0,
max = 3,
default = 0,
page = SkillLimiter,
translation = SkillLimiter_CraftingBonus,
}
option SkillLimiter.FirearmBonus
{
type = integer,
min = 0,
max = 3,
default = 1,
page = SkillLimiter,
translation = SkillLimiter_FirearmBonus,
}
option SkillLimiter.SurvivalistBonus
{
type = integer,
min = 0,
max = 3,
default = 0,
page = SkillLimiter,
translation = SkillLimiter_SurvivalistBonus,
}
option SkillLimiter.PassivesBonus
{
type = integer,
min = 0,
max = 3,
default = 3,
page = SkillLimiter,
translation = SkillLimiter_PassivesBonus,
}
The defaults are applying just fine it seems, but the options aren't showing up in the sandbox options menu.
Have problem with blood texture ... due when car hit and smashed zombie then nothing happen... car stay clean
dsd
but when add it by Vehicle Blood option
someone can tell me how to make it works correct
Is this your own mod? Or are you asking about a mod you installed?
my own from 0 to 1
model works
all works as should just have problem with rust/blood/dmg texstures
where rust somehow fixed but only appear when spawn (random)
dmg... idk why the faq but only works on windows
and blood as you see works but not works
the problem is that whole model use same texstures so it works on half car and second half not
yes car have 2 uv's map
so im out of idea ... fighting second day with it
can you verify that its loading your local workshop mod and not the subscribed mod?
I unsubscribed from the workshop mod
mhm
are you 41.71 or 72?
Yep
i supose
Multiple times now
The heck

Now I'm wondering if there's some weird caching thing going on with the old version of the mod
Gonna restart Steam
?
Let's see
Crap
I see what's going on
It's using my Workshop folder mod
🤦♂️
I'm so very sorry about all of this
Thanks for the tip to check the path in the mods menu
yeah singleplayer is weird, its the only mode that give priority to the steam workshop
i usually dont have this problem

you have the workshop dir for your local mod and the one from steam for subbed mods
so no onehave idea how to fix blood xD
whats wrong with the blood?
oh
how do u get that vehicle blood ui?
by debug
yeah just where do you get it i dont see it anywhere
nope
but you know
due all is on 0set by default
so your car doesnt add blood when hitting zombie but when adding it manually it works
hum nope the fact you can add it manually
and its not adding it on collision
looks like a collision problem maybe ive never made custom car so not quite sure how that part works
o.o
all set around my model
i need help someone whos make vehicle for PZ or The Indie Stone dev...
Does anyone know a command to disable the spawn of a specific item and put another one in its place? In my mod in the part "C:\Users\Windows\Zomboid\Workshop\MyCoolMod\media\lua\server\item" -> "MyCoolMod_Distributions", I put this command
"
local function postDistributionMerge()
ReplaceItemInDistribution(SuburbsDistributions, "Base.Item", false, "MyMod.Item", false, true);
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
"
I didn't find the item on the map (I think), but I found the item inside a car, does anyone know how to fix it?
make new world
I created it but it kept spawning
(SuburbsDistributions, "Base.Item", false, "MyMod.Item", false, true);
(SuburbsDistributions, "Base.Item", false, "MyMod.Item", true);
that what i do my replacement
Does anyone have experience adding localization to their mods? I added Spanish, English and Russian with no issues, but now I'm trying to add German, French and Polish and it isn't adding the translations in game for some reason this is what the folders and files look like for German.
Hello, I would like to commission very simple mod that makes cold weather more deadly for survivor and destroys crops at low temperatures. If someone is interested and has required knowledge DM me.
Ahh ill try that, thanks
Anyone know anything about the palette parameter of createZombie()?
yeah that changed nothing unfortunately
anyone know if its possible to send a confirmation message in chat to the current player, like this:
any idea
how to fix that
...
btw dmg zone works on hits
and textures also
just blood not apply on contact
try to check ischat.lua
Vanilla weapons enhanced or firearms b41 might be what you want. Look it up on the workshop
look for that mod id 2830035515
Does anyone know what these Sandbox.vars translates to normal settings?
SandboxVars.Zombies = 2;
SandboxVars.WeaponLoot = 3;
SandboxVars.RangedWeaponLoot = 5;
SandboxVars.AmmoLoot = 5;
Like, is zombie 2 apocalypse settings?
And ammo loot abundant?
These settings are from media\lua\client\LastStand\Kingsmouth.lua
I think those names correlate with the java file's setting's names.
@gilded hawk, Found in media/lua/shared/translate
Sandbox_ZombieCount_option2 = "Very High",
Sandbox_ZombieCount_option3 = "High",
Sandbox_ZombieCount_option4 = "Normal",
Sandbox_ZombieCount_option5 = "Low",
Sandbox_ZombieCount_option6 = "None",
``` ``` Sandbox_Rarity_option1 = "Extremely Rare",
Sandbox_Rarity_option2 = "Rare",
Sandbox_Rarity_option3 = "Normal",
Sandbox_Rarity_option4 = "Common",
Sandbox_Rarity_option5 = "Abundant",
Daamn! Thank you so much!
Apparently the kingsmouth challenge is more fun than expected
anyone here use nitrado to host ?
Hey 🙂 can you remove this TIS please```java
public void setModID(String var1) {
if (GameClient.bClient) {
if (this.modID == null) {
this.modID = var1;
} else if (!var1.equals(this.modID) && Core.bDebug) {
WorldDictionary.DebugPrintItem(this);
throw new RuntimeException("Cannot override modID. ModID=" + (var1 != null ? var1 : "null"));
}
}
}``` ?
we cannot connect to the server with the debug
anyone knows how to reload a mod that is being edited in real time
it takes to reload the game and i jist want to slowly learn while scripting
is there a way to do this that is applicable to the latest version
im just modding items and traits no maps involved thnx in advance
depends on the file. alot of lua files that just declare functions can be reloaded from the f11 menu in debug mode. just need to search for the file in that browser and press reload. but if it is lua code that adds/modifies lua objects in some particular ways, you have to just reload the game. I guess you could technically write alot of code to handle to lua env to make it as if you reloaded in those cases, but that would be alot of work. as for scripts like the ones defining recipes and items, I don't know how you would reload them other than exiting and reentering the world. I think traits are in that section of lua stuff that would need a reload since I think they are just defined in lua, but handled by java. although I may be wrong.
i see.. so if im working to edit a specific lua then i wont need to restart but if its item txt then thats the time i dont have a choice?
yes. alot of lua stuff can just be reloaded but not all. and with any .txt files you are shit out of luck to my knowledge
ok thnx for the infos i guess i dont have a choice but to write the code neatly. i mean im still experimenting so its kind of hard
just to give a couple examples of the lua stuff that can't just be reloaded. Functions which you then give the function to an event handler, it won't be enough to reload the file unless you have addition lua code to remove the old one from the event handler. although maybe you could do some funky stuff with local imports inside the functions to handle that but Im not sure. UI stuff also are all created once in the beginning so extra stuff would be needed to make sure they are created properly. Ive never looked into how possible that is to do in lua though so idk if there is a work around there. Distribution changes can't just be reloaded, unless you properly remove the additions from the previous load of the file. there probably is more but I can't think of them atm
ill look at it, thanks!
https://www.youtube.com/watch?v=7ksDELl37bc
personally i prefer vanilla expansion because it keeps added guns limited to a few but they're very intentional additions and they fit better alongside the original guns. it also adds tweaks to existing vanilla weapons (i.e. 1911 actually looks like a 1911, bolt action guns have 5 shots and an integral magazine, etc
hey can someone help me with some of my mods dm me
Hello everybody!! i hope there is no problem that i'm posting here a project zomboid mod collection made for me. i would like to share with you and i hope you like it!! suggestions are welcome. thumbs up and rating is appreciated. See you soon survivers!
https://steamcommunity.com/sharedfiles/filedetails/?id=2834233804
Nice mod pack, by the name I thought it would be something focused on the vietnam war, with helicopter mods and that sort of thing
haha i would like such mods!! it's just a cool picture of a cool movie and i think it fits with multiplayer project zomboid experience.
hello, in a weapon how can I remove the option to place in primary hand?
To make it only two handed?
No, I am making a weapon that is equipped in the second hand and if it is put in the first hand it gives errors.
Weapons can't be used from the second hand - what kind of mod are you making?
Hello, could someone help me out with making an item that teleports you back to your safehouse once consumed?
Please ✉️ DM me directly as I'll most likely miss this here due to a busy schedule. Thank you in advance.
I feel like Aza made something like that already
Reminds me of the Magic Mirror from Terraria.
Yes, we really need it. We're hosting events a lot and offering people TP to and back from the area is a bit ... stressful for staff
Giving an item to people to just poof and go back to their safehouse... Would be way better.
I implemented a code to use the secondary hand, for my doom slayer mod, I put the doom blade because it is placed in the left hand.
and it does not help me to put it in the right since it is placed with the wrong orientation.
That would be like applying the function of appearing in the safehouse when you die but I don't know how to see that.
Exactly, it would make things so much easier and I'm sure a one way ticket back to safehouse isn't that hard to code either I'm just too dumb with those things
With the anti-cheat system, teleporting might be hard to achieve
So technically
thats how you get teleported
-- On the client, when received from the server
player:setX(x);
player:setY(y);
player:setZ(z);
player:setLx(x);
player:setLy(y);
player:setLz(z);
but that will definitively kick you if you use it just like that from a client.
The goal would be an item to eat that will teleport player X to their safehouse and player Y to their safehouse, not everyone to the same location
Just like when you're an Admin and you check the Safehouse List and use "Teleport"
admin teleport is all done using admin commands
something that cant be done for a regular player
So there's no way to make a teleporter that teleports people back to their safehouse when consuming? It would help so much.
Teleporting 30 people back to their safehouse is a hassle
What about adding a command to this:
Like the option you get when an admin right clicks in the Mini Scoreboard
Instead of Teleport or Teleport To You, is there no way to add a Teleport to Safehouse?
So admins could at least "send" people back to thei rSafehouse that way
That would be a different approach
Im researching but real quick i cant think of any situation where a player teleport
might be worth check the RV Interior mod
and see how he teleport player inside the RV
Adding an option to teleport people to their Safehouse wold probably be a good point to start
Why not add it to the vnailla game hmmmm haha
the respawn at safehouse is different its not a teleport
its a starting point
at the character creation its set the position from the safehouse
Yes, but using "Teleport" in the Mini Scoreboard is an admin command teleporting YOU to thei r safheouse
Is there no way to edit that so you can teleport OTHERS to that location you are meant to be? If that makes sense at all
I mean you can teleportthem to you already
stuff that is java is not editable
admin commands are only for admin and if there is no other command allowing us then we cant
otherwise it might require to turn off some anti-cheat
So you're saying we can't add another admin command?
As that's locked behind Java literally?
to allow using
-- On the client, when received from the server
player:setX(x);
player:setY(y);
player:setZ(z);
player:setLx(x);
player:setLy(y);
player:setLz(z);
if you can get past the anti cheat whatever
well technically you can add a server command with a java mod on your server
I'm almost positive you'd wanna utilize https://projectzomboid.com/modding/zombie/iso/areas/SafeHouse.html this
They're adding more admin commands, why not allowing admins to TPpeople to their safehouse too
That would solve all those issues 😂
Yes
That's what I mean
Can we not get a function to right lcick and teleport them to safehouse?
Even with modding?
did you know the mini scoreboard allows you to teleport somebody too
I let go the idea of them being able to TP themselves
If at least admins could TP peple to safehouse without going there first and then summoning htem
That'd be a huge help already
well yeah you can easily make an option for admin to teleport someone to its own safehouse
That's what I meant! YES, YEEEES
please
😂
Events are hosted by staff anyways, so adding an option to TP players to their safehouse would be the golden solution omg
What are people using to work with the Java end of the mod commune?
Storm seems to be abandoned since last year
And a lot of mods I see are too complex for Lua
Unless I am underestimating this new API with 41
I'm surprised this hasn't been tweaked yet.
onTick() {
// Calculate delta
// Check against a max delta security check (Vehicles with different max deltas)
// Enforce max delta by resetting position or kicking the player
}
@wooden lodge
local function teleportPlayerToItSafehouse(player, safehouse)
if isAdmin() then
local x, y, z = safehouse:getX(), safehouse:getY(), safehouse:getZ();
SendCommandToServer("/teleportto \"" .. player:getDisplayName() .. "\" " .. tostring(x) .. " " .. tostring(y) .. " " .. tostring(z));
end
end
--- somewhere with the reference of the player to teleport
local safehouse = SafeHouse.hasSafehouse(player);
if safehouse then
teleportPlayerToItSafehouse(player, safehouse);
end
Wasn't the client-code for safehouse kicking moved to be handled on the server side since 41.65?
neat
@wooden lodge what you could do is use the context menu named "[ADMIN] Teleport player to it safehouse" then loop all online players that has a safehouse and add as sub-option with each player and when clicked then it run that function teleportPlayerToItSafehouse written earlier.
I am a total noob with this, still. So do I add this to a LUA and name it TeleportSafehouse or something?
wait a sec
Sure, take all your time, I really appreciate your help even though I'm probably going to end up needing a step by step on this
not tested
local function teleportPlayerToItSafehouse(player, safehouse)
if isAdmin() then
local x, y, z = safehouse:getX(), safehouse:getY(), safehouse:getZ();
SendCommandToServer("/teleportto \"" .. player:getDisplayName() .. "\" " .. tostring(x) .. " " .. tostring(y) .. " " .. tostring(z));
end
end
local function doAdminTeleportToSafehouseMenu(_, context, worldobjects, test)
if not isAdmin() then return; end
local entries = {};
-- Check all online players if they have safehouse
local players = getOnlinePlayers();
for i = 0, players:size() - 1 do
local player = players:get(i);
local safehouse = SafeHouse.hasSafehouse(player);
if safehouse then
table.insert(entries, { player = player, safehouse = safehouse });
end
end
-- Loop for each entry we have
if #entries > 0 then
local debugOption = context:addDebugOption("Teleport Player To Safehouse");
local subMenu = ISContextMenu:getNew(context);
context:addSubMenu(debugOption, subMenu);
for i = 1, #entries do
subMenu:addOption(entries[i].player:getUsername(), entries[i].player, teleportPlayerToItSafehouse, entries[i].safehouse);
end
end
end
Events.OnFillWorldObjectContextMenu.Add(doAdminTeleportToSafehouseMenu);
add this to a lua/client/MyMod/AdminTeleportPlayerToSafehouse.lua
I assume in here? Kaeldor\media\lua\client
yeah
Now the question is, how do I test that? Does it show up only in the Mini Scoreboard or how do I pull it up?
Log as admin
right click
context menu should show the option only if there is online players
also if they have safehouse
Let me see, I'll host a local server and see if the context menu shows it
The other stuff... Guess I need to test when our server is updated
o 3o
it will only show if you have online players with safehouse
that do includes you tho
From the use of that Lua seems to be the answer there lol
Let's see
I'll claim a safehouse real quick and test
so I can technically TP myself to my safehouse with that?
yeah (i think so)
Odd things happening 😂 After the This is how you died screen I'm stuck at a black screen rn
Will Alt F4 and try again lmao
Ayy yo, i'm interested in doing some 3D modelling on some mods for PZ, where can I go to find a group? Or how should one approach this?
console.txt
@wooden lodge make sure to re-copy this code
i fixed it after sending it
i think u have the older one
Restarting and will report again, replaced it now
No errors when right clicking at first, gave myself a custom safezone, right clicked again, errors
No safehouses = no errors, just tried that too @thin hornet
@wooden lodge its because i used unstable version code
local function teleportPlayerToItSafehouse(player, safehouse)
if isAdmin() then
local x, y = round(safehouse:getX() + safehouse:getW() / 2), round(safehouse:getY() + safehouse:getH() / 2);
local command = "/tpto \"" .. player:getUsername() .. "\" " .. tostring(x) .. "," .. tostring(y) .. ",0";
player:Say(command);
SendCommandToServer(command);
end
end
local function doAdminTeleportToSafehouseMenu(_, context, worldobjects, test)
if not isAdmin() then return; end
local entries = {};
-- Check all online players if they have safehouse
local players = getOnlinePlayers();
for i = 0, players:size() - 1 do
local player = players:get(i);
local safehouse = SafeHouse.hasSafehouse(player);
if safehouse then
table.insert(entries, { player = player, safehouse = safehouse });
end
end
-- Loop for each entry we have
if #entries > 0 then
local addOption = context.addOption; -- 41.71
if context.addDebugOption then addOption = context.addDebugOption; end -- 41.72+
local debugOption = addOption(context, "Teleport Player To Safehouse");
local subMenu = ISContextMenu:getNew(context);
context:addSubMenu(debugOption, subMenu);
for i = 1, #entries do
subMenu:addOption(entries[i].player:getUsername(), entries[i].player, teleportPlayerToItSafehouse, entries[i].safehouse);
end
end
end
Events.OnFillWorldObjectContextMenu.Add(doAdminTeleportToSafehouseMenu);
What's the difference?
context:addDebugOption is a new feature in 41.72+]
Once it updates, will the function still work or need adjustments?
I'll try the code you just sent now, brb
@wooden lodge try the code again #mod_development message
now it should teleport in the middle of the safehouse first floor
Will try! brb
It now doesn't throw errors, but it gives me the hint down left as if I enter a command wrong
Doesn't actually move me anywhere though @thin hornet
what does the message say
It's what shows up when you just type /teleportto into the console
It's some kind of automated help response I'd assume
If I type /teleportto without any values, the same message shows up as if I'd click on the command you added
If that makes sense
try entering /tpto "username" x y 0 replace x and y by coordinates replace username with yours
Trying again, brb
Sadly still the same. Shows the message in bottom left again, no actual teleport @thin hornet
That teleports me into the black void
but the command doesn't throw errors nor does it teleport me to my claimed safheouse
It does throw the same message down left as if I would just type in /teleportto
this worked?
Yes, into a dark void
I teleported back to my safehouse via safehoust list -> Teleport to get out of it
Then ran away, tried command again, nothing,j ust the help message in the bottom left showing up again
Hey all.
Big issue on my PZ server. I'm making a very vertical map for my roleplay server
But obviously in PZ you can't shoot to stories above you... meaning that PvP is just trivialized by just "whoever gets the high ground"
doe sanyone have any ideas for how otmake people be able to shoot upwards?
Brand new to modding, wanted to try with this game. Does anyone know a good tutorial video/channel for modding build 41 PZ? The ones i've found are out dated or not very good at guiding through the process. I have the mod made but can't find it in the mod list via debug mode. Any help helps, thanks!
Isn't like anything under 5k tiles void? I use 11900, 6900 for tests
Can I do a timed action for a zombie
Like, when it gets within 5 tiles of me, it stops moving for a few seconds or something, then returns to it's regular state
i just made it since i'm bored lmao
i'm gonna make a bunch of among us merch items
I want to learn how to mod to remake fallout NV in PZ and fuse fallout 1 and 2 mechanics with PZ's ones
imagine the entirety of fallout NV and fallout 3 in PZ and the DLCs
space is big ennough
Turns out I can't find out any way to do a timer
Someone needs to make documentation for this game, it's actually horrible having to research for 5 hours for a function which ends up being as simple as "isUseless" or something, pure pain lol
If someones out there that can mod. Please make one where I can feed other players 🙂
That's uh
Kind of a weird suggestion lol
you can do it on other games
and I have had someone die on multiplayer cause of starvation because of AFK
if you can add hunger on medical theoreticaly that might be possible
I read all of it... all of the modding links, every extension of documentation, every discord link... oh lordy there is a lot of information
Kinda like DayZ?
i could definitely see the devs adding that when they end up adding in the handcuffs and burlap sack lmao
I feel like this would head in the direction of ARK where people were keeping player characters hostage on servers with no way for them to kill or reset themselves
maybe but i dont remember how dayz handles it either
I don't have idea... everything checks colisions works, uvs too file is correct settled...
all texstures works except blood on contact...
by manual cann add blood np.. by hiting only take dmg with dmg texture but without blood...
im out of ideas :cry:
Just got the game. Does anyone recommend some mods?
anyone here able to identify which mod is causing an issue from logs?
once Im past the character customisation screen on a server im hosting it just goes to black and not responding
try sending your logs
which logs specifically
Fort Waterfront
that one
most spamming of errors
Ill delete it from the file and try again
i think after stop using it you need to create new world due that custom map
yeah I delete player and world every time Im troublehsooting
howly moly... not sure who make that mod but he not call of Base texstures just copied whole files and put to mod now your log is messs with duplicate texture
xD
check revives and before download
y se ven con las texturas horrible sobrepuestas
the 2nd floor grid going south is not accessible
mod conflict with other map mods
😅
Make Korek Machete, Make Reaver Cleaver, Make Improvised Cold Steel Spear
Salvage items
M113
Hat_Beret_Tactical
that mods do errors on your log
but java error make beret xD
Ill delete scrap weapons and try
M113 has broken templates
but works maybe idk just spam of errors that templates can't be found
and cannot import to self vehicle
salvage items is outdated i think
ill delete workshop aswell
Vehicle Repair Overhaul that is this mod
Is it possible with a lua mod to connect to a remote database? I want to save some information from my server to display on my discord 😊
Anyone know if it would be possible to make a mod that changes the field of vision of the character to a green tint? I'd be interested in making a night vision mod that doesn't turn the whole screen green. Kind of like a flashlight with green tint that zombies can't see.
trynna run server with just Britas and Im just getting a crash after character customisation
servers without it work fine
any mods that can soft reset without touching safehouses/player build containers?
You might be able to send info through an API
d
Idk if it works here but
If we have access to any ASync commands then yeah
You could also just run the bot on the same server and point to a server directory but
That's not as versatile
I already wrote the bot, but only with all the details available from steam query (players, description etc.) - was hoping to add a bit more details like time of day etc
LuaSQL exists
Do you need/want super secure info storage?
Because if not I think LuaSQL doesnt have MySQLi support
The bot is not hosted on the same machine, since I also use it for other games supporting steam query and multiple servers (6 currently)
That might work 🎉
I've been learning web development with MySQL and its heen
An experience, thats for sure
But yeah no you might be able to like
Create an SQL DB on the local server that hosts ZB
And then have it open a port
Then your bot just queries that port
I haven’t done much with lua since warhammer online ages ago lol - can we add libraries like luasql to pz?
Luasql would work with remote database if possible
black screen after hosting server and then "connection lost", anyone know a fix?
Im not to sure, the documentation for this stuff is pretty much non-existent
Yeah it’s a lot of trial and error currently
Is there any way, or any mods, that stop military and police zombies from spawning with weapons?
For all modders who struggle with testing/work on their mods and having to juggle mods around to play with friends you can do the following:
- Top bar of steam, select:
Games>Add a Non-Steam Game... - Browse for the PZ launcher:
ProjectZomboid32.exeorProjectZomboid64.exe - Under launch options, add an unique directory path for local files:
-cachedir=E:\Zomboid - Name the "added game" something useful like
Project Zomboid [DEV].
You can also add -debug after that command to force the client into debug as well.
The folder created is the same created under user/<name>/Zomboid/ - so it includes the upload folder for mods and the game will recognize it as such.
This lets you develop your mods, have saves for testing, change local files, and all separate from your "real" saves/files.
Note: This still requires you to unsubscribe from mods matching any mods you wish to work on as the game will prioritize downloaded content over local files.
Also useful if you're travelling and want to take your saves with you
Although loads times will be impacted even on a 3.0usb
neat, I didnt know that that will be usefull
Only found it cause I was curious about cloud saves, https://steamcommunity.com/app/108600/discussions/0/1608274347723385437/
Before that I tried to create a github repo of my server save
would not recommend
the issue was the number of files I think
my save was under 1GB afaik
but 300k files made github lock up
you could probably set your self a gitlab self hosted
Honestly happy with the usb, as long as I dont forget it
This is AMAZING!
i used to host on digitalocean linux and files count is a big problem with linux most of time with too many files
and yo chuck whats your server ?
It's just a private one with friends atm
I'm interesting in setting up a "10 years later" server with this mod (https://steamcommunity.com/sharedfiles/filedetails/?id=2820757649)
What kind of setting should I put to make it work properly? Like, very destroyed cars, no fresh food in fridges/fully rotten food, erosion settings, etc etc
Dane includes some suggestions in the description
Yeah, I'm following that, but it feels like I'm missing something, and I don't know what 😦
if you use vanilla sandbox and set months after to 12 all fresh food would be rotten
I'd also recommend setting stories to as common as possible
Stories? 🤔
Like the random houses thing?
The randomized situations you find cars or zombies in
I think there's a sandbox option for those
Alright give me a sec
I'm preparing a mod collection for a post-apocalitic enviroment and hard game mode. take a look. hope you like. suggestions are welcome.
https://steamcommunity.com/sharedfiles/filedetails/?id=2837213135
Oh, this looks interesting!
Maybe you can get or create the square instead of getting it. Someone said something about something like that.
So, how am I supposed to set how many years have passed?
I'm playing with the kingsmouth sandbox mod, and I did set the erosion day to 6k (10 years), but the food in some fridges is still good 👀
Erosion date =/= start date
Afaik
I'm still trying to replace a vanilla item with a mod item but I'm failing, every time I look for an item that can be found in a vehicle I find the vanilla version of it, does anyone know what I'm doing wrong in this code? I've already recreated the map, put the code in a separate file, I still haven't had success.
Hello! I have been experimenting with making custom foraging zones in PZ. I already have some custom items in mind but to save me some grief. Does anyone know where I can find the code for it? Thank you!
Hands down, @thin hornet is one of the greatest and most humble modders I've ever met. Thank you so so so much for assisting me as much as you did with this script.
shared\Foraging\forageDefinitions.lua
Oh shit thank you! I was searching now 😭
Unironically i have never interacted with Konijima but he's now my second favorite person
and one more thing, I am looking to disable the base default professions to rewrite it with unique professions. Would I just name my mod file the same as the ingame file or how would I go about that
shared\NPCs\MainCreationMethods.lua
Events.OnGameBoot.Remove(BaseGameCharacterDetails.DoProfessions);
BaseGameCharacterDetails.DoProfessions = function()
-- your own prof here
local profList = ProfessionFactory.getProfessions()
for i=1,profList:size() do
local prof = profList:get(i-1)
BaseGameCharacterDetails.SetProfessionDescription(prof)
end
end
Events.OnGameBoot.Add(BaseGameCharacterDetails.DoProfessions);
basically you write your own file like shared/NPCs/MyOwn_MainCreationMethods.lua
i think
you are going to have to test how that goes
Alright! I'll go test it out now then and see if it works. Thanks for the advice tho!
When making items, you don't have to delete other items to make room correct?
I don't assume so, but some games have this limitation
I don't think so, a lot of mods add new items just fine without removing the initial ones
It worked! thank you so much for the help!
yay
Is there a way I could get a setting that's from multiplayer (like bumping into another player) and put it into single player?
i dont think singleplayer uses any server settings.
you can, NPC mod uses 'togglePVP'
I just don't know how to toggle player clipping into another player
then you can try getServerOptions() global
local options = getServerOptions();
options:getBoolean("PlayerBumpPlayer"); -- get it
options:putOption("PlayerBumpPlayer", "true"); -- set it (value has to be a string)
might be something like that
ok
Hello, I need help with the detect of a weapon, I am trying it this way but it seems to be the wrong one.
Player:getSecondaryHandItem(IsWeapon(Base.DoomBlade)) then
Anyone know if theres a workaround to runspeed modifier not working or is it just something we cant interact with at all entirely
if Player:getSecondaryHandItem() and Player:getSecondaryHandItem():getType() == "Base.DoomBlade" then
-- do soemthing
end```
Vehicle loot uses VehicleDistributions not SuburbsDistributions
Thanks, it no longer gives an error so it seems that it recognises it, but it does nothing, I will see how to solve it.
I did it too
It works correctly now, it doesn't have to have "Base" in the reference.
I get this error when trying to place down my modded item, anyone know why?
When clicking "Place Item" it renders the model and texture, along with the correct size, but I click the left mouse button, it gives me the error, I exit that menu and then it stops rendering even when just clicking "Place Item"
The item is modded in
I put a comma after the displayname but that also didn't fix the main issue lol
Fixed it, I had to add an icon 💀
Also spitters now spit acid every few seconds in my left 4 dead mod
Anyone making a bicycle mod by chance?
There is one
!!! Where is it?
Made by AlteredMinds from this server too 
No problem lol
Spitter acid now damages you over time if you're near it
Hello, I'm having some trouble getting the server to recognize updates that happen whenever a player repairs a vehicle. It updates on the client-side, but the server disregards/ignores/never receives it. For example, if a player repairs a car from 50% to 54%, the player will see 54% on their side, but everybody else on the server still sees 50% (because the value never actually changed on the server), and if the player logs off and back on, they will see 50% again
I'm thinking that maybe I am using sendClientCommand() incorrectly, any help please? Below is the code that I use to send the update to the server
if isClient() then
local args = {
vehicle = self.vehicle:getId(),
condition = self.part:getCondition()
};
sendClientCommand(self.character, "vehicle", "repairEngine", args);
end
/**
* Method Parameters:
* - (String arg0, String arg1, KahluaTable arg2): void
* - (IsoPlayer arg0, String arg1, String arg2, KahluaTable arg3): void
*/
function sendClientCommand(..): void;
@warm sail
I only know part of your client-side implementation. The server side is set up properly with the event associated with the client command?
Not 100% sure but I think you'd use OnClientCommand in the server scopr to receive this.
For consistency's sake, I'd recommend sending the client command to the server (Find a way to make it work first), then either have the server update all players if it can be done there with what's provided or update all clients (including the player sending the command), so inconsistencies don't cause problems if something fails.
I don't know anything else about your code so I can only help this much. 🙂
Is there a way to make a specific zombie silent and not make it's usual zombie sounds?
I don't see anything exposed to set a zombie as silent or relates to silence. Someone else might know something I don't.
RIP, it'd be weird but I might just have to have two sets of idle sounds, my custom ones and the vanilla ones lol
I'm making specific zombies have different idle sounds so I can't just replace the defaults
I see these calls for IsoZombie:
/**
* Method Parameters:
* - (long arg0, GameSoundClip arg1, BitSet arg2): void
*/
stopEvent(arg0: number, arg1: zombie.audio.GameSoundClip, arg2: java.util.BitSet): void;
/**
* Method Parameters:
* - (long arg0): void
*/
stopOrTriggerSound(arg0: number): void;
It'd be a hacky method but you could use OnTick to stop common sounds zombies emit.
Not 100% on that. Would be a bit of work.
Everything I'm doing is hacky so that shouldn't be a problem lol, thank you, I'll see if I can get that to work
Just thinking a little more creatively about the problem.
is there any way I can see what functions are available when i use "ScriptManager.instance:getItem"
You can either use the unofficial JavaDocs for 41.65 here:
https://zomboid-javadoc.com/41.65/zombie/scripting/objects/Item.html
Or you can use the TypeScript definitions I use as an alternative:
https://github.com/asledgehammer/PipeWrench/blob/master/Zomboid_41.71__zombie_scripting_objects.d.ts#L365
ohh nice this is helpful
looking at the serverside receiving the command, it needs more properties. I'm guessing the command is getting an exception when run when it is missing args.skillLevel. You should take a look at ISRepairEngine.lua to see all the args sent with repairEngine and in VehicleCommands.lua to see how they are being processed.
L4D2 mod? 👀
Yes 
I am so confused, why there is a typescript definitions repo for zomboid 👀 ?
You can write TypeScript to mod Project Zomboid.
WHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT
Holy shit
There are currently two people working on their own NodeJs environments to improve on the prototype one in that article. There's also work being done right now on generating Lua code Typings.
This is absolutely amazing, and I would be quite nice if combined with my https://github.com/mxswat/mx-create-mod to make scaffolding and mod development faster
@thin hornet is working on something like that with his NodeJs environment.
IIRC you'd install it globally and use commands.
I do run mine using npx mx-create-mod npx take care of the rest
Great! Maybe we can work together
PipeWrench is a project under the asledgehammer organization. I can DM you their Discord server. It's run by JabDoesThings. I'm part of the org.
Yes please
The same org made the anti-cheat for 41.60 builds when multiplayer came out and prevented people from destroying public servers.
Damn, impressive.
Was written in Kotlin. 🙂
Sent a friend request. (Can't send msgs)
hi guys, can someone help me a second? I'm looking for how to make one item that I made require electric power, how to do?
thx
Require to have battery inserted or to be in an area that has electricity avail?
require to be in an area that has electricity
Mhm
Is it used into recipes?
im waking up ill check this out just need a coffee first
it is a "printer" type object
a really simple object, it is required for a recipe and the recipe says CanBeDoneFromFloor:true,
but I would like to need electricity to work
so basically you just need to be near to it so that the recipe can work
Could do something like that for recipes
local function playerIsOnPoweredSquare(player)
return ((SandboxVars.AllowExteriorGenerator and player:getSquare():haveElectricity()) or (SandboxVars.ElecShutModifier > -1 and GameTime:getInstance():getNightsSurvived() < SandboxVars.ElecShutModifier));
end
MyModNameRecipes = MyModNameRecipes or {};
MyModNameRecipes.OnCanPerform = MyModNameRecipes.OnCanPerform or {};
function MyModNameRecipes.OnCanPerform.RequireElectricityToPerform(recipe, player, item)
return playerIsOnPoweredSquare(player);
end
otherwise anywhere you need you can just use this custom function
local function playerIsOnPoweredSquare(player)
return ((SandboxVars.AllowExteriorGenerator and player:getSquare():haveElectricity()) or (SandboxVars.ElecShutModifier > -1 and GameTime:getInstance():getNightsSurvived() < SandboxVars.ElecShutModifier));
end
thats how the game check for power for example when taking fuel at the gas station
i see
you could use it into a TimedAction isValid() method and in a context menu when adding the option.
local option = context:addOption("Do something that require power", worldobjects, func, playerObj, etc);
if not playerIsOnPoweredSquare(player) then
option.notAvailable = true;
end
you know any mod that use it where I can get a better understanding of it?
My computer mod does check for electricity
How do you interact with your printer? (recipe or context menu)
my function added and not computer:getSquare():isOutside() so that the computer doesnt work outside even if power wasnt cut yet (but work outside if using a generator)
i see
Is this done?
Also I apologize since I didn't read any context lol, I'm tired
its the version on workshop yeah
i have much more plan with the computer, in an unreleased v2 branch but lua got me tired when making it
project grow big fast, and object oriented in lua gets complicated
So chance are im going to remake the mod in Typescript which will make it cleaner and easier to expand.
👍
I was trying to make all the zombies with this outfit white, but I found one who was black, I got really mad because I didn't know what I did wrong, but after finding like 10 zombies with the same skin tone in a row I'm pretty sure I set the skin tone to black on accident instead of white 💀
thought the outfit was broken but turns out I'm just really dumb lol
oh you can control the skin texture that zombies spawn with?
I thought so, "I'm just really dumb" was an understatement, I was taking the GUID from the AuthenticZ mod, but didn't realize until just now the creator has it as custom clothing things
Explained that poorly, but this is basically how it works
ohh
I am going to steal this method of doing it though because the game apparently doesn't want me to be happy lol
By the way, did you make the Open Jackets mod? I saw your name and planned on asking at some point but forgot
I only use like 3 mods in my playthroughs, true music, open jackets, and drawing on the maps, so if so I appreciate your work in adding something to the game that should just be in it anyway lol
yeah lol
Doing God's work
i stole an idea from shark's military mod and i'm doing the nightmare work to make every pair of trousers tuckable with boots
That sounds incredibly painful lol
its mostly just tedious
i wrote a function in my lua script that automates as much of the duplicate work as i can but i still have to manually do all the .xml files
Heh.
This is why I'm making a scripting GUI tool for items and recipes.
Shelved it for the moment to focus on something a little more urgent.
a hero
I'm wondering what Is the best way to turn my sandbox pre-sets into a mod? 🤔
I'm looking for a way to consistently sync my MP an SP presets
I've been wanting the ability to just package saved outfits, traits, and sandbox settings into a mod file people can install, but I'm not sure it's possible lol. However, if you really want to go through the trouble you could have a mod which sets the sandbox settings when the game boots through a lua file
Also to clarify I know barely anything about that so there may be an easier solution my ape brain is currently unaware of
tucking acquired
Hello. Does anyone know which file I should look at regarding player handling of multiplayer servers (how many players are in-game and other related information)?
you would want to look at zombie\Lua\LuaManager.java
for example you can get all the player online using
@LuaMethod(
name = "getOnlinePlayers",
global = true
)
public static ArrayList getOnlinePlayers() {
if (GameServer.bServer) {
return GameServer.getPlayers();
} else {
return GameClient.bClient ? GameClient.instance.getPlayers() : null;
}
}
so in lua
local players = getOnlinePlayers();
if players then
for i = 0, players:size() - 1 do
local player = players:get(i);
end
end
interesting this is very helpful thank you
I need some Experience Modder support
Is there an alternative to newPreset.options:loadGameFile(newPreset.name) in particular loadGameFile ?
Apparently, it only targets the main game folder not the workshop one too and it throw the following error:
STACK TRACE
-----------------------------------------
Callframe at: loadGameFile
function: getOneYearLaterPreset -- file: MoreSandboxPresets.client.lua line # 15
function: loadPresets -- file: MoreSandboxPresets.client.lua line # 23
function: create -- file: SandboxOptions.lua line # 479
function: instantiate -- file: MainScreen.lua line # 784
function: addToUIManager -- file: ISUIElement.lua line # 1009
function: LoadMainScreenPanelInt -- file: MainScreen.lua line # 2148
function: LoadMainScreenPanel -- file: MainScreen.lua line # 2065
ERROR: General , 1658318493273> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at NativeMethodAccessorImpl.invoke0 (Native Method).
ERROR: General , 1658318493274> DebugLogStream.printException> Stack trace:
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[Trimmed Log here]
Caused by: java.lang.RuntimeException: media/lua/shared/Sandbox/OneYearLater.lua not found
at zombie.SandboxOptions.loadGameFile(SandboxOptions.java:1492)
... 24 more
public boolean loadGameFile(String var1) {
File var2 = ZomboidFileSystem.instance.getMediaFile("lua/shared/Sandbox/" + var1 + ".lua");
if (!var2.exists()) {
throw new RuntimeException("media/lua/shared/Sandbox/" + var1 + ".lua not found");
} else {
try {
LuaManager.loaded.remove(var2.getAbsolutePath().replace("\\", "/"));
Object var3 = LuaManager.RunLua(var2.getAbsolutePath());
if (!(var3 instanceof KahluaTable)) {
throw new RuntimeException(var2.getName() + " must return a SandboxVars table");
} else {
for(int var4 = 0; var4 < this.options.size(); ++var4) {
((SandboxOptions.SandboxOption)this.options.get(var4)).fromTable((KahluaTable)var3);
}
return true;
}
} catch (Exception var5) {
ExceptionLogger.logException(var5);
return false;
}
}
}
🤔
might want to check at loadPresetFile
instead
seem to be the user generated presets tho
Yeah
it's annoying cause loadGameFile only looks inside the Zomboid Directory, but ignores the mods
Does not seem to work, it loads the default settings 😦
i'm trying to design a claim vehicle system, but i noticed that car ID's seem to change all the time, anyone know why this is?
what id are you pulling
What is the default cache dir? 🤔
LuaManager.getSandboxCacheDir() In my case is C:\Users\massi\Zomboid\Sandbox Presets
try vehicle:getSqlId() that should be the ID in the database
can i load a vehicle object in-game using that id?
i'd need to release the claim attached to that vehicle when a player releases
even when the player is nowhere near that vehicle
Is this vanilla
LOG : General , 1658075851159> 82†858†766> command entered via server console (System.in): "ping@pong"
I feel like I've left debug messages in command sends but usually I use ping and pong on the different ends.
well if you save car claim in global mod data you could show that player the list of car he owns and use the stored id to just remove it from the global moddata
its vanilla yeah
ah ok, I spent like 20 minutes looking through my repos lol
i get that alot in my server logs
by global mod data you mean the mod data of the vehicle and/or player, or is this a seperate thing i haven't heard of yet
i suggest you do all the operation and storing on the server side.
and only send the global moddata to players as a reference
global moddata is World moddata
attaching to the car will not be safe and you will need the vehicle reference to interact with it
does the world instance have it's own modData too?
ah, that sounds interesting,
I know gametime does - which I used before they added global
global moddata is not really to the world per say but if you reset the world it will be cleared
have a look at this if you want you can use this too
it let you play with networking and global modata easily
for an example how to use it i have this mod that is built with basemod
https://github.com/Konijima/PZ-Random-Sound-Events
it contains a base code that handle everything for you, so you can just add what you need to a config file in shared.
then you have access to create commands and functions for easy networking
this one use basemod too
https://github.com/Konijima/PZ-World-Time-Manager
An idea for the #mod_development channel / maybe even for the #mod_support - use of the discord threads feature for specific help/discussions?
oh sorry wrong channel
:P
oh wait
nvm this was the correct channel
I made progress on making my own tiles, which I started with posters. but when I attempt to place posters on the walls, either ingame or in the editor. they vanish when going on the walls? does anyone know whats wrong?
did my message confuse you?
my bad, it was an unrelated idea
we used to have a bunch of pins of 'useful code' that got scrubbed to the wiki (?)
but this was before threads was a thing
my posters are just really weird when interacting with the world. like i'd attempt to play it on a south wall and the poster will face the North direction
even though I have south selected in the tilezed
probably
Almost seems like the directions are reversed tho?
Like when you have the blue marker on the floor attached to the wall - I think the poster is on the other side of the wall?
With the poster face facing the wall at that
Anyway to add a window to the walls to test?
ya that was the issue. I used the vanilla tiledef information. but I had to invert the vanilla tiledef to work for my posters. for some reason lol
strange, maybe they're reversed visually
but i did find an issue code wise lol
if I have multiple posters with different ID's but same item name. it breaks the placement
like I had "BerserkPoster1" and "BerserkPoster2" but both named Berserk Poster
but both posters broke and wouldnt place into the south direction unless I changed their item names
this as an example
would break the south direction placement, unless I change the DisplayName
@thin hornet sorry to trouble you but you seem very knowledgeable with regards to modding, do you know if it would be possible to import the luasql library in a mod to be able to connect to a remote database?
I suggest that you try, import it and see if there is any error, and if there is try and fix error by error until it work. I know for example the json lua lib needed some tweak cause kahlua didnt like some of the global methods.
but for the remote part i dont think it will be possible
is it possible to get a player heatmap for a server?
Separate process executing Lua with periodic checks for file-written data perhaps?
That'd be the only way, unless you want to get really funky with SQLite with some other process.
(That or core mod)
right not really something id love to do
unless making a server javamod that integrate http and weksocket communication
How do I change my zombies back to the default ones?
I installed a mod that changes their skin, and they're the same, even if I disable it.
Aye, aye, thanks.
how do you use mods in multiyplayer
how do u make spawn points for a map
i want to add spawnpoints to a map that has none for my server
like
do u just list em
guy's whats type 8 and type 15 in anti cheat?
Yeah this was the method I developed to control zombie skin tone. Later used it to put a green skin color on the Free Hugs zombie.
😆
Is there a way to choose custom vehicle trunk loot?
If someone could someone point me the right way? Thanks! 😄
In the way that a police car has police loot, spiffo van has spiffo loot
Think i found it- VehicleDistributions
Anyone able to help work out how to get specific loot spawning in vehicles?
Currently both the trunk and glovebox is empty apart from a key
This file from Filibuster's Rhymes Used Cars has examples of how to implement specific loot spawns for specific vehicles. He won't mind me sharing it as an example, but obviously don't use the same file name.
Thanks will take a look
I'm making a special infected mod and I want to have a sandbox option for the game to wait a week before spawning them, like a boolean, can I check it here?
like if the boolean is off, daySurvived is 0, if the boolean is on, daySurvived is 7
hey @tranquil reef
oh i see so you want the value of the sandbox option to be in that object there
it wouldnt make it there in time i fear
would have to see when is the AttachedWeaponDefinitions used and if we can edit it later after game load
So this runs before the sandbox settings are checked?
its defined right when the script is loaded
sandbox are not transmited yet
at least for a server / client
but even for single player
script are reloaded before you even start setting your sandbox options
Rip
this is used in IsoZombie.addRandomAttachedWeapon()
it may be possible to edit after
didnt find where this is initialized yet
ah i think it may be in RunLuaInternal
nope its in AttachedWeaponDefinitions.init()
Well I guess I'm either going to have to make two mod files, or just only have one of the options by default lol
it could potentially be done
i think
using reloadLuaFile()
it would force to reload the file which would make the AttachedWeaponDefinitions dirty and re-init
not sure how that would act toward other mods adding to the attachedWeaponDefinitions tho
ah nevermind
it might not be possible in the end
wow wait
actually
AttachedWeaponDefinitions = AttachedWeaponDefinitions or {};
because this is written like this
it would work
so, the reloadLuaFile() thing would work or something else lol?
That also still comes up with my original question, can I change the daysSurvived requirement by having an if statement or something
lua/shared/Definitions/spitter_AttachedWeaponDefinitions .lua
AttachedWeaponDefinitions = AttachedWeaponDefinitions or {};
local function defineSpitter()
AttachedWeaponDefinitions.spitter = {
chance = 100,
weaponLocation = {"Stomach"},
bloodLocations = {"Torso_Lower","Back"},
addHoles = true,
daySurvived = SandboxVars.SpitterMod.daySurvived or 0,
weapons = {
"Base.Katana",
},
}
end
local function init()
Events.OnTick.Remove(init);
defineSpitter();
if (isServer()) then
reloadServerLuaFile("Definitions/AttachedWeaponDefinitions");
else
reloadLuaFile("Definitions/AttachedWeaponDefinitions");
end
end
Events.OnTick.Add(init);
By reloading the file it will set the java object to dirty and re-init it, which will get that lua table again which is already stored in global so nothing is lost no matter which mod added to it
and this code would run on both client and server since its shared directory at the first tick.
so when a zombie is spawned it would fetch a random outfit and attached weapon from the up-to-date version of this global lua table
Oooo nice, thank you
let me know if it actually worked
For this part though, "SandboxVars.SpitterMod.daySurvived or 0,", the sandbox variable is a boolean that can be set to true or false, could I just have a "local daysRequired" or something in defineSpitter, and then have it be set to 0 or 7 depending on the boolean?
If that makes any sense
just have a sandbox options of type double so that people choose the amount of days
if they want 1 month they could
The special infected are from a game called Left 4 Dead, and in the lore of that game the first 5 zombie types start appearing after a week, and the next 3 start spawning after 2 weeks, so I'm trying to replicate that rather than actually having the player choose specific amounts of days
then have a boolean
and use this ```lua
daySurvived = SandboxVars.SpitterMod.daySurvived and 7 or 0,
that should work
Alright, thank you
np
Anybody know a way to make a zombie extremely difficult/impossible to knock over? zombie:onlyJawStab does this but it also makes it immortal unless you stab it in the jaw
I currently have a l4d tank that has like 4000 health, but you can walk up and push it over lol
Does anyone know any mods that show the weight as a separate column in the inventory, if not can anyone point me towards the API function to register/add a column?
Is there any city mod that removes west point what whatever reason ?
Asking because while playing online with a friend west point was unreachable, but single player it still there
Even tho sp and mp have the same mods so idk..
I'm not sure on the specifics of the code but Advanced Zombies by Algol has similar mechanics, I think it's just flat immunity to hitstun though
yes. it is up to date.
Thank you, I'll look into the code and see if it's helpful
2021 last update...
that is the most up to date one you can find afaik
Yes, it's on steam

i never downloaded it either lol, I just use the 2021 TileZed and WorldZed I found on the indiestone website
idk what else the modding tools would have tho
ya lol
thats literally all it is
is just the mapping tools
anyone got a pack of mods that dont bug out the hole game
this isnt the place for that lol, you would go to #mod_support
mb
I am attempting to have a main menu replacement for my mod but I am having an issue where the Title and Title2 files are not properly sitting next to eachother. they have a 1 pixel gap between them
I even went through and extended the title image sizes by 1 pixel, so they should be overlapping at that point but the line is still there
I wonder if it's aliasing artifacts or something.
Since textures are drawn using double values, have you tried flooring the coordinates?
Can someone help me with codding seconds? I want to make a → if player:isSprinting() "for more than 1 second" ← But i have no idea how
I was using a timer but that was not it, since the penalty would occur even if it was for less than a second
OnTick using boolean logic along with timestamp logic.
Unless there's a better way to know when the sprinting started in the API, that's my first guess.
Could you give me an example? I'll look in to it
in an OnTick listener, check if the player is sprinting. If the last result is different, handle the switch.
You then calculate the delta since the player started sprinting with a stored timestamp.
Then make a method that checks both the flag set to true and the delta.
Use millisecond timestamps.
timeDelta = timeNow - timeThen
Ah i see
if timeDelta >= 1000 then return true
Again if someone knows if the time is tracked elsewhere in the code for PZ, that'll be a better way.
No no that's fine, i was just looking for IRL seconds
The only caveat with my approach is inaccurate deltas when pausing the game while sprinting.
You could code more to work against that, however if you don't care then this simple delta calculation works.
I have no idea of what im doing
It's fine to feel lost. Don't worry.
I figured walking you through the problem logically would help you to think more about the solution than being stuck at the problem.
I don't really know much about codding im sorry, TimeDelta for instance would be Local?
You can make it local yeah. You could calculate it either in the OnTick listener or when you call for it as a function.
Try to make it work first before optimizing it though.
Probably would've been easier if i showed the code before.
For the Sprint part i wanted to make it so it would only happened if you sprinted for more than a second.
OnTick is a built in PZ thing?
When solving any problem in coding, planning, building a prototype, then improving on that prototype is a good way to keep yourself from getting stuck.
OnTick is an event that PZ has to run code every update in the game.
Is it the → Events.OnTick.Add(functionName)
Oh sorry i was looking at this one https://pzwiki.net/wiki/Modding:Lua_Event/OnTick
Looking at the wiki example, is this the right way to use it?
I wouldn't know or have knowledge of this part of the API to help. If it doesn't work, try playing around with it. Someone else might be helpful here.
No problem, you already did more than enough, i appreciate the help
No problem.
Hello modders 👋 What is the best way to add a new Item (such as a journal or a sheet of paper) with some text already in it? 🤔 I was looking to add or define a new item, but then I realized there is not property like "content" or something like that I can use to add a custom text:
item SheetPaper2
{
DisplayCategory = Literature,
Weight = 0.1,
Type = Literature,
DisplayName = Sheet of Paper,
Icon = Paper,
CanBeWrite = true,
PageToWrite = 1,
WorldStaticModel = SheetOfPaper,
}
Once you upload a mod to steam, is there anyway to change the thumbnail?
this texture issue is also present in the vanilla main menu, I just never noticed it before. its still there lol
Hello, I want to add icon with tooltip under health bar in the health panel, but I can't find exact place in lua code anywhere (the health bar, not panel). Can someone tell me which lua file I need to look at?
How will players encounter the item or how will it be added to the game world?
There are lua functions for OnCreate - I'm not sure if this applies to found loot however.
@undone crag @sour island I found a way to achieve what I wanted to do:
- Define a new item type
- Use the
OnPreFillInventoryObjectContextMenuto add the content the first time the user click on it
Reportedly if you have a function on OnPreFillInventoryObjectContextMenu it slows loading.




