#mod_development
1 messages · Page 504 of 1
thanks but im singleplayer only 🙂
@solemn horizon Okay, I know when you first start your save you can click on "custom sandbox" and select the exact shutoff date in there too
If you're game is currently going still, I believe you can enable -debug mode on your game and then change it from there. Or you can install a cheat mode that allows you to do it
no sadly you can only choose 0-30 or instant, im gonna browse the workshop to see if i can find something
When I make changes to an item's display name in the media\scripts\items_weapons.txt file, nothing happens. Am I modifying the wrong file? I know that the mod is loading, because I also modified a texture and it's working.
If you enable -debug mode, you can change it in the custom sandbox then 🙂
Should look like that
Could I see the item? If the image is changing, it sounds like it should be working. Where are the files located at?
thanks
The file is located in my C:\Users\name\Zomboid\mods\ folder, and it's a direct copy from the base files in my steam directory with changes made to the DisplayName of various guns.
Basically I'm trying to rename the "M9 Pistol" to anything else
Ah gotcha. Are you reloading the files by disabling/re-enabling the mod from the main menu? If not that - I haven't tried overwriting base objects yet...I will have to mess with that
I restarted the game every time I made changes, and I think I also disabled/re-enabled it the last time I tested, too.
This is my first attempt at modding this game, so I might just be missing something little
Gonna delete items_weapons.txt from the steam directory and verify files to generate a new one to make sure that it's not from a past version or something
Okay, so I've found part of my problem. The DisplayName property in this file doesn't do anything. The display name for the sawnoff JS-2000 starts with "Sawn Off" in the default file while it's "Sawed-off" ingame.
at worst you can check the player in OnPlayerUpdate and give them the trait if they don't have it
Is anyone familiar with Radio/TV modding that could answer some questions?
Okay... so MP has 1 big issue, base raiding. Weapons do not take damage when you break down doors, etc. and the sleds is OP if you have the destroy feature enabled. Is there anything out there to adjust durability when doors, stairs, etc. are being damaged?
@sour island @tacit ermine Thanks for the help guys. I can get the code running if I exec it manually, but am having a hard time getting it to launch via events for some odd reason. A problem for another day I suppose lol. Thank you again for the help tonight
Well, nevermind. I got it working - but I had to do a loop
EveryOneMinute event
Gross lol
Amazing 
Anyone know if i can remove the result on creating a recipe?
i know i can use destroy to destroy an ingredient but i need to remove the created item
when i try to upload my mod to steam workshop it gives me error "failed to update workshop item result=9" anyone know what to do?
ty !
daniel san! wax on, wax off... must train to kill zombie daniel san...
i made a female version of this one too
ignore that beard there lol
Hello! Is it possible to retexture exisiting vanilla map tiles?
Got my server vehicle store working in singleplayer, Thanks to @sour island helping me out with the spawn code. Works well in singleplayer but the vehicles don't save in multiplayer (dedicated server) and I don't seem to be able to interact with them properly https://www.youtube.com/watch?v=G8eba3iF82Q
You sell vehicles on the server?
Players will be able to buy them from a trader with currency obtained off Z
Solves new players joining and not being able to get a start
That's cool
If I can get it to work haha, one hurdle after another
https://steamcommunity.com/sharedfiles/filedetails/?id=2700619293 can someone test if this mod works for them?
just saw this
was hoping we can pick em up too
They are able to be picked up without the mod aswell, so I think it should still be possible with my mod, I will test it.
I can pick them up, you need a crowbar.
what about the military crates, you cant pick those up either
and i absolutely love the way they look
so cool
reminds me of dayz servers lol
There's a remove result thing you can add to the script, you still need the result line which will show up as recipe preview
Where are the base game item icons tucked away?
What am i doing wrong?
print("EveryOneMinutes")
end)```
Nothing appears in the debug
Is EveryOneMinutes working?
How does it work? I am higher than Slav Facemaps in the search yet it has more subscribers than me
steam doesn't update it real time
someties it feels like there's an underpaid intern doing it manually
But i made it after the Slav, he had more subs to begin with
Or is it viewers to subscribers ratio based?
it doesn't matter what it really measures, it doesn't update real time so the position you're seeing there is outdated anyway. The only reliable list is most recent
🤔
most subscribed is all over the place, if you go checking one by one
Are there any mods for day time sprinters?
Does anyone know how to implement a sleep () or wait() function (or any kind of similar function) that delays a specific function in the game?
(* The os.clock function doesn't work in Project Zomboid)
e.g.
function <name>
addVehicle(name)
sleep(1000)
vehicle.repairvehicle()
No, but there are ways to add the countdown for that
I remember my disappointment when i found out there is no sleep in lua while coding in stormworks
Oh, if you have a chance, could you tell me how to do it?
You could add a variable to your vehicle that is update every time the vahicle updates, and do what you want once it reaches a certain value
I see. Since vehicles spawn quickly, I want to use a delay function that repairs vehicles after a certain amount of time (about 0.5~1 seconds after spawning). I was looking for the wait, sleep, or timer function, but I could not find any.
I am horrible at looking through the game files: How does the game make the "this is how you died" text appear
When you start / load a new game
@cobalt steeple Most of the text is in the game folder in \media\shared\Translate\ That one in particular is located in \media\lua\shared\Translate\EN\UI_EN.txt (if you're using English) and it's called 'UI_Intro3'
Thanks :3
Nice, gonna change it to "This is how you spent your life in a shed eating cabbages and worms"
Several vehicle functions do their thing after the inital spawn/some other things in the vehicle have been initialized, in that case you don't even need a countdown, you just need to identify the right time
Another language edited mod?
O.O
?
Oh i made a mod that changes some of the english words lol
PZ Re-Worded
Has anyone added like monsters or more weird zombies?
Thinking about changing skins and having an event on my server with stronger zombies
What are some recommended workshop mods that don't change the core game too much?
Guys I'm in trouble, my vehicle mod flips over whenever it goes over bodies
Does anyone know how to solve this?
I tried everything
Terror Zeds, Turning Time
Perhaps the collision of the car is higher and therefore there may be overturns or the wheels are too high
Heyo, I'm trying to iron out some distributions for a mod.
Trying to figure out what some specific room types are called so I can spawn items in the correct places.
What's a good way for me to figure out what different containers and rooms are called so I can expand on this better?
That is some impressive code man
Like, is what this mod does documented anywhere? https://steamcommunity.com/sharedfiles/filedetails/?id=2260110173&searchtext=distribution
I'm still trying to learn that
I don't think luah as a wait, sleep, or timer function. It does have a way around it though. I'm not sure how to do it best with PZ though. I just started learning LUA yesterday lol.
@stiff furnace it's really not, just uses a few tricks but works well enough
Vehicle spawning doesn't work in MP though, it seems to run through the client still so the server doesnt save the cars and they arent able to be interacted with
If anyone knows how to make the server do it, please help haha
Hmm yeah, I'm not sure about the locality of these things yet
me and pals cant claim a big abandoned warehouse for it being "occupied" for some reason, but other than that..
Is there a way to actually light up a huge light less building in PZ? Mods included
Remove the cars and other human beings before claiming it
dead Zs included?
Maybe
@blissful meteor How are you spawning the vehicle? I sent a client command to the server, and then spawned the vehicle via addVehicleDebug from the server and it seems to work fine.
https://streamable.com/7dpmrz
Testing with 2 clients on the same computer, but still on a dedicated server.
used bikinitools to stack corpses from the entire building, then canibal mod to delete the bodies - still occupied :(
Does this building has lights? You removed all vehicles and people from the claim zone and it still says occupied?
it has no lights (unfortunately) - and no vehicles inside, only some around it
Havent found any more bodies inside - still occupied
if it's multiplayer, maybe someone dc'd inside and it's checking that
It can?
You won't be able to claim it if it has no lights
Private server for 2 people, not an option
Sounds.. strange? Do i have to add lights to it or is it just impossible to claim then?
Why do you want to claim it in the first place then?
I probably have some thoughts about what building you are in, you can send a screenshot for me to confirm
so the zs wont spawn, or is it not for that?
Not every building is claimable
On our server they spawn even inside claimed region (although it's probably a bug)
Claiming is mostly so no one else can come in your claimed house
Yeah, exactly this one
Is unclaimable
You can check golf club, it's pretty neat and has a lot of space, and not dirty
I will, ty
For some reason items in my containers respawn after i place them in there and later take out
Example - just went back to my microwave and it had uncooked pancakes 🤔
same happened in the old map in the firefighers building
Not to be rude, but this really isn't the channel to be carrying on and on about safehouse claiming...
Desync/bugs
is there a mod for this game that lets you both roll up and drop cloth ropes once its on a window? like, in real life i would be rolling up the ropes until i needed to get out and thats when i would drop them and descend
Well you still can just remove it when you don't need it
that is not the same, but still an option. does it refund full components?
I believe so, if not it will only take another nail to hang in the worst case
i dunnno man, nails are kinda hard to come by when youre new and bad at the game. but yeah thats still an option, just would be neat if i could eventually just metal craft ladders that can be lowered and raised
You can find a ton of nails in the storage areas
Although making a ladder mod is a pretty good idea
the warehouse i found has an upstairs and a rooftop access and is massive, and surprise surprise, containts most of the initial crafting material i need in the boxes on the first floor
question about the irrigation pipe mod. Do i have to water my seeds first for the pipes to work?
I was thinking of procedurally generating item icons but this makes the game crash.
local myTextureDataVariable = myTextureVariable:getData();
zombie.core.textures.Texture.getData is in the documentation here but I do not understand the example
https://projectzomboid.com/modding/zombie/core/textures/Texture.html#getData--
@brittle jewel I spawn it through a recipe for my vehicle store, I figured I would need to send a command to the server. Could you send me the lua code you used to send command please and I'll see if I can adapt it
function Recipe.OnCreate.BuyVehicleCar(items, result, player)
local vehicle = addVehicleDebug("Base.CarNormal", IsoDirections.N, -1, player:getSquare());
local keys = vehicle:createVehicleKey()
end
Similar to that
Not at my pc
I figure instead of local vehicle I need something else
Also does anyone know if clearing map.bin files renew the vehicle spawns too?
I have another idea but I need to be able to respawn vehicles at their zones
Hey, is it possible to change the texture/model of a specific zombie to something else?
So I could for example have 1/100th of all zombies spawn with a different model for example.
Probably, was looking through the files and saw something about what skin a Z uses
It was when I was looking through the clothing and zombiedef
Ah okay, I'll take a look 🙂
Probably have to just make a new Z type though
Still trying to figure out how to navigate the modding documentation
you can do that?
Like how authentic Z does I mean
Their outfit, probably a good mod to look through for that sort of stuff
not sure about the actual zombie skins but you could do something with the zed damage textures
Ill have a look at authentic z, thanks.
although im worried that just uses distributions
Perhaps you could give a zombie a clothing item which has the model you want, and which hides all of the zombie's default model.
ah yeah that could work, not sure how nice that would work with anims though
Is it possible to just dress up zombies after they've spawned?
If you want a model that uses the default animations it should work.
@blissful meteor This is in the client folder:
if isClient() then
sendClientCommand("CarTrader", "spawnCar", nil)
end
And here is in the server folder:
local function carTraderSpawnCar(module, command, player, args)
if not isServer() then return end
if module ~= "CarTrader" then return end
if command == "spawnCar" then
print("onClientCommand")
local vehicle = addVehicleDebug("Base.CarNormal", IsoDirections.N, -1, player:getSquare())
print(vehicle:getId())
end
end
Events.OnClientCommand.Add(carTraderSpawnCar)
Anyone happen to know if there are any Multiplayer "marker" mods so you can see where your friends are on the map? I can't seem to find any but maybe I'm not looking hard enough
Chuck was doing something with zombie outfits. Normal zombies which are not reanimated players do not save their inventory in the save game, but they save their outfit which is something in a lua file, he said.
that makes sense, I'll see if I can find anything about outfits
Texture:getData()
returns WrappedBuffer. Setting a Lua variable to it crashes the game. Is there some way of using this method from Lua? Like maybe there is a java object that can have a WrappedBuffer that I can use to make item icons with code?
https://projectzomboid.com/modding/zombie/core/utils/WrappedBuffer.html
im not sure if this is the place to ask, but is there a mod that increases gun accuracy a lot and reduces jams a lot?
Is anyone free to explain to me what setInfectionTime and setGrowthRate do for infections? I am messing with the numbers trying to learn but it doesn't seem to impact the rate or level of the "Infection Level" bar
local bodyDamage = player:getBodyDamage()
bodyDamage:setInfectionGrowthRate(0.02)
bodyDamage:setInfectionTime(0.002)
That's what I am executing into the console
I've tried lots of numbers...dont see a difference
getData()
returns the texture's pixel in a ByteBuffer EXAMPLE:``````java
ByteBuffer bb = getData();
byte r, g, b;
bb.rewind(); //<-- IMPORTANT!!
try {
while (true) {
bb.mark();
r = bb.get();
g = bb.get();
b = bb.get();
bb.reset();
bb.put((byte)(r+red));
bb.put((byte)(g+green));
bb.put((byte)(b+blue));
bb.get(); // alpha
catch (Exception e) {
setData(bb);
This is what the online documentation says but I think the example is probably Java, so maybe Lua mods can not use it.
It's never use in the all game folder so I assume it does nothing
I found that:
bodyPart:setWoundInfectionLevel(-1)
bodyPart:setWoundInfectionLevel(10)
in media\lua\client\XpSystem\ISUI\ISHealthPanel
Huh, interesting okay. Thank you MrBounty
How can I find a list of global functions I can use? 🙂
I'm having some trouble figuring out how to navigate the massive class list and finding what i actually need
specifically im looking for info on addZombiesInOutfit but no clue where to look
Hahahaha, that the all game. I use the doc in pinned messages(especially https://zomboid-javadoc.com/41.65/), search in the modding channel, the wiki for the script of base item and I look in all the files of the game if the function is used or use key word like "Infection". Also i have a list of different type of mod that i can search in too. (I do a find in all the files)
haha fair enough 🙂
I've been digging through other mods mostly as well
and searching in this discord
but the function i was looking for was onlymentioned twice
wich one ?
addZombiesInOutfit
No idea if this is the spot for it, but would anyone know where to find the user access level's (a multiplayer function) in the files?
found that FightStep.momzombie = addZombiesInOutfit(FightStep.zombieMomSpawnX, FightStep.zombieMomSpawnY, 0, 1, "TutorialMom", 100) in media\lua\client\Tutorial\Steps.lua
So addZombiesInOutfit() seem to be:
addZombiesInOutfit(x, --x position
y, --y position
z, --z position
float, --outfit index ? idk seem to be 1 a lot
string, --Name of the outfit
[0-100], --Health of the zombie
)
Awesome, thanks 🙂
My terrible cursed dog food mod has fought and clawed its way up to the third panel of the first slide in the zomboid workshop front page, next to two actually complex and useful mods
Absolutely baffling
The fuck
lol one of my friends did 1 of every award as a joke, the ones higher than one were actually given by other people
i don't even really know what awards are or do
You can get fancy avatars and steam profile backgrounds in the points shop and give others awards with the points, that's about it.
yeah it just gifts steam points to the receiver
is there any way to load a lua file through code? for example, the lua file that defines which clothing is available in character creation is loaded when the game boots, am I able to reload this via code after boot?
recent game buyer here, just wondering if anyones thought about doing a Project Fungoid mod, aka TLoU Mod, would be perfect for the mechanics of this game tbh. to clarify im no where near skilled enough to mod anything, just think it would be a perfect fit and am wondering if one exists
InfectionTime is the time a character got a zombie infection at, in days
it's only used in Java code
InfectionGrowthRate seems only used for food poisoning and fake infections (infections when you turn off death to zombification?)
setFoodSicknessLevel(getFoodSicknessLevel() + getInfectionGrowthRate() * (float)(2 + Math.round(PoisonLevel / 10.0F)) * GameTime.instance.getMultiplier())
Just had my first hacker kill my server
Has anyone duplicated the functionality of ISRadioInteractions, where an object (TV) can modify the stats (boredom levels, xp, etc) of characters near the object but who haven't directly interacted with the object? I'd love to incorporate that functionality into my piano mod, and would like to see more examples than just ISRadioInteractions.
I think I may have a mod issue, or am I mistaken? I can only select Engineer when creating a new character upon death.
No idea what kind of mod would cause it
someone make a pet cat mod
you wouldn't feed your cat dog food would you?
feed kitty fishies
too much labor for one furball
You could put the code in a function and then run that function?
good evening guys
does anyone knows how to get the player who just disconnected by the OnDisconnect event? (https://pzwiki.net/wiki/Modding:Lua_Events/OnDisconnect)
also, is there a way to store custom metadata inside IsoGameCharacter ?
Hey guys, so i have some mods installed on my hosted dedicated server, they are installed correctly however alot of the vehicle mods i installed seem not to be spawning cars as frequent as i want (some of them are super rare) how can i edit my mod settings on a dedicated server?
Does anyone happen to know why a custom hair entry would be named incorrectly like this?
can someone make a mod to make sprinter zombies run like Naruto
Just a simple anim swap
thanks
dm when done
in your mod files create "media\lua\shared\Translate\EN\IG_UI_EN.txt" and include something like this
IGUI_EN = {
IGUI_Hair_Bihawk = "Bihawk",
}
"IGUI_Hair_" is a prefix and the "Bihawk" part is what it's called in the hairstyles.xml file
the string can be whatever name you want
Awesome, thank you.
lmao wtf is this xD
lol
i have never seen a bihawk before
Ah, that makes sense.
Hey guys, is there a way i can check which mods are active on my dedicated server? after afew hours of playing i noticed no weapons or ammo from Brita's mod pack are in my world
Rip
Check the item spawned
Spawner
How can i do this?
As admin
pretty much ready my supergirl suit
I love how the EMT outfit in sharks law enforcement pack is called “Ambulance driver”
How do you place items in the world? I.e., get them to spawn on the ground in houses?
I actually have no idea how to do it.
Is there a way to do it with a distro, or do you have to mess with lua?
Where can i find a list of mods to add to my game?
Anyone ever have a 3D model float very high from the ground? lol
can i add raven creak to a world already made? no one has even left our starting town
The model's origin is probably messed up. Would need to be fixed.
You cannot add maps to an existing world, no.
goddamn
i might just actually make project zomboid: a post nuclear survival game
goddamn it
i have to now
trying to intercept Callouts so that we can add some fluff text to them, anyone see any issues with this
__classmetatables[IsoPlayer.class]["__index"]["Callout"] = function(self, doEmote)
local range = 30
local shoutPath = "New"
if getCore():getGameMode() == "Tutorial" then
shoutPath = "Tutorial"
elseif self:isSneaking() then
shoutPath = "Sneak"
end
addSound(self, self:getX, self:getY(), self:getZ(), range, range)
self:SayShout(string.format("%s shouts, \"%s\"", rpname, getText("IGUI_PlayerText_Callout"..ZombRand(1,4)..shoutPath))
if(doEmote) then self:playEmote("shout") end
end
the only one i know of so far is "this doesn't set player.callOut, which means shouting counts for boredom reduction"
but
eh
oop there's one: if(doEmote) should be if doEmote
self:getX should be self:getX() 💀
i do not have that
Hi, everyone. Question, is the zombie modData shared accross clients in a server? If player1 set a modData.X=Y inside a zombie, will player2 also see zModData.X=Y for that zombie or is it local?
what are some good zombie mods? like ones that add new variants
is there are list of possible distributions?
as in mod is complaining about ProceduralDistributions["list"]["IceCreamKitchenFreezer"] but how do I find out what the name has changed to?
if i understood you correctly then there is a ProceduralDistributions.lua following this path \Steam\steamapps\common\ProjectZomboid\media\lua\server\Items
attempted index: items of non-table: null at
is it telling me that the item is at fault or the inventory?
and thx for helping me
not so sure about that, what are you trying to do? fix your distribution?
or are you just looking at some ones mod and trying to fish errors?
i am trying to just get someone else's mod to work well enough without just commenting out offending lines
hence i am trying to make sense of pz systems
not gonna upload the fix to ws
well if it has problems with distributions, you should just look at where it was spawned before and look similar place in PD.lua that you can find following path i gave you
yeah, I am looking at mod's distribution and pz dist file you gave me
i guess I will just have to try inputting stuff and see what works ))
you can take some working mods with working distr to look how it should work
👍
hello. I want to create some kind of horde mod for me and my homies. Do you know where i could get started learning to script events?
currently i am looking at other event mods reading the scripts and trying to understand
not sure if/how it is working though
probably you can take a look at that
ok thank you
also i think you can probably make some sort of horde with helicopter events? like make it invisible and soundless but to attract zombies all over but i have no idea how to do that so im just saying
and also for heli events there is good reference - https://steamcommunity.com/sharedfiles/filedetails/?id=2458631365
yeaht thats what i thought too :DD looking at both mods currently trying to figure out how they work and what belongs in shared/server/client
good ideas tho
will try to work some wacky thing out
currently there is almost no ppl in ch due to well last day of the year, so all ppl who could help you with lua/java or events will probably be later
ok i will try to make sense and try again new year
would like to see good horde mod in WS!
also
i really feel like i need attacks on my base or my location for late game
most of the zeds tends to go to main roads right?
and since i always play on no zombie respawns i am really lacking challenge
so probably main roads marked some how
true
it would be also okay to make the hordes gather on main road and roam it
but first thing need to defines what exactly makes them gather on roads
Hi all, I'm having some trouble with Better Towing, sometimes the car just rubber bands back into place, sometimes it works sometimes it doesn't, is anyone else having this issue?
made some notes
first i am gonna look into that horde spawner and try to get it working for MP
you can also probably can use alarm event, for example check user position and in range of 150-200 cells trigger some silent (to player) alarms, it make zombies to gather "near" the player and maybe spawn like 20-30+ zeds in that place as well
maybe push the bounds so that hordes wont spawn like 20 M behind you
it will not be like hordes but maybe it will look like illusion of it
what a nice idea
coz you will basically create new horde nearby user(in 200 cells)
ok maybe i should try to do that instead
and they will with time try to move to free cells(usually where player is)
sounds much more manageable for small brain humans
also there is a reference for invisible alarms
as far as i remember main logic of this mod is to trigger alarm that user dont hear and lure them inside buildings
so you probably can dig through his code for reference
i think that's all that i can think of at the moment, hope it was of some help to you
👍
try to ask later, ppl who worked with events like (old good modders) probably will have more tips and ideas on how to make it
new rare zombie variant that can sprint and open doors
can also scream really loud to attract all other zombies to the area, about as loud as a house alarm
it should have custom idle sounds so you can differentiate what they sound like compared to regular zombies
oh yeah, i do sound design so if anyone needs sounds for mods i can help ^_^
is it possible to make my .xml to depend on another .xml from another mod? or overwrite it in some way? or if i use the same items guid will it overwrite object with that guid?
ehh thats a little over the top for what i was thinking
one single unique zombie variation is fine for me, especially if it can sprint, draw a large amount of zombies in one area, has lots of HP, and can open doors
i wish i actually had the time to learn lua + java so i could make these things lol
it has nemesis that almost unkillable (huge amount of hp) and banshee that can run and scream
not sure if she attracts other zeds
based on this mod you can do yours and to your liking at that!
How do you save modData?
currently using
local modData = getPlayer():getModData();
self.rpName = modData["buffyChat:rpName"] or getOnlineUsername();
modData["buffyChat:rpName"] = self.rpName;
and changing it with
ISChat.instance.rpName = command;
local player = getPlayer()
player:Say("Name updated to:" .. command);
player:getModData()["buffyChat:rpName"] = rpName
but it doesn't persist after a save/load
also PSA to people using Say() as a way to show output to the player:
don't
use player:addLineChatElement() instead
same arguments
Say() will be picked up by radios, addLineChatElement is visual only
modData is automatically saved if the elements inside are not objects
otherwise those elements are not saved
transmit is to share the data with the server
well, presumably that'd be necessary to save it
I would assume so - but MP code is eluding me rn so who knows
Does using a colon in an indirect not cause issues?
eh? indirect?
[""]
table.foo is syntactic sugar for table["foo"], yes
i think you're thinking it's the other way around
table[":::::"] is totally acceptable
table.::::: is not
I would've just assumed those symbols wouldn't be functional
it's just a string
Yes, but I figured if it is interchangeable with direct references that internally it may behave similarly where list.list:list would break
but I guess it would just use the table id internally rather than try to re-reference it
Random modding idea. Make burgers/fries/corndogs etc from Spiffos have like, a year long expiration date.
Reason: The amount of preservatives in Spiffos food can't be healthy, and it's a fun meme to expand the service life of food that otherwise goes bad in a few days.
im sure that wouldnt be hard to do since all youd have to do is change the spoilage somewhere wherever it is stored in the code
hey how do i import a .x into blender
it's not interchangeable
table.key with spaces doesn't work
table["key with spaces"] does work
the former is syntactic sugar for the latter
where the FUCK is fort redstone
lol
Hello, i'm currently trying to make a mod an having some trouble putting in the game, and getting the error "MeshAssetManager.loadCallback> Failed to load asset: AssetPath{ "KP31" }" weapon works but the model itself doesn't appear, made the model myself, so not really sure what there is to it that may cause problems.
does anyone know a mod that increases the FLOOR max capacity from 50?
there is also a big ass sign going from rosewood, saying redstone is up ahead :]
wrong path in the model's script perhaps?
not sure what else is to path there is to it
is the solar array mod fixed?
keep in mind it is all case sensitive
yes i changed the names to Kp31 after i did the first question, still problems
why is it telling me this? Every guide I've seen the file structure has "Mod Named Folder"/Contents/media
I dont want to make a building I want to make an item tweak mod lol
Contents/mods/media
if I have no client folder in my mod does that mean the mod wont run in singleplayer ?
Would anyone be willing to take a look at the mod just in case?
No, in single plsyer you're both server and client
Question: Can I mod a mod added item?
Someone added a backpack to the game in a mod, I'd like to change its capacity for balance reasons with my own mod, is that possible?
Yep, Item Tweaker
yeah I've got that installed, so do I make a new mod and change it with a lua?
Yeah follow the instructions on the Item Tweaker page
thx
lol 🤷♂️
i am trying to start the game with -debug, but i'm hanging in the beginning
anyone can tell me what i am supposed to do?
clicking the box does nothing, so does f11
Idk then sorry
but with f5/f6 i can go through every single line
can i suggest a mod
idea
bc i think it should be a vanilla feature for sandbox zombie respawns but its not, but i think
there should be a mod where zombies can respawn but only on the map edge, slowly having to come into the map, that or via events
bc i run respawn off but i know its gonna get empty if i run a game for too long
any mods that add a safety/immunity type thing when you first spawn in until you move ?
anyone know any good resources for someone who wants to start modding for PZ?
if this is for a workshop thing then you need the actual mod package folder inside Contents/mods like this
anyone have a recently working sandbox vars override? my old method isn't working any more
seems like most events at the start of the game are only ran at mainmenu and no where else?
btw, i dont know why but the More Hair Colors mod is nuked off steam workshop, if you had it in your load order for a server, make sure to remove it
you wont be able to start with it
you know what would be cool is a modular vest system that you could start with like
a plate carrier and find attachments / pouches for it
that actually go onto the vest visually and can be used as an extra compartment for storage in inventory
or add like, a first aid pouch that gives u faster bandaging, or a mag dump pouch that gives you faster reloading
theres a mod that lets you attach stuff to backpacks
after many tears I figured out that events given arguments can only fire once?
After hitting mainmenu
once in game
Not even ontick fires
strangely the bare call doesn't show up on game load but the rest do
[Sorry, wrong channel for this question.]
Looks like adding functions with arguments into events prevents them from firing outside of lua load
is this hydrocraft?
Nope, my mod pack.
Hi, does anyone know if the kahlua will let me edit scale and models of individual zombie spawns? Just to know if it is worth to bother with it
I need it 😦
just a yes or no question: is it possible to remove all gun systems and items from paw low loot so that i can have all the cool clothes and vanilla guns and ammo. i understand that if yes i would probably have to delete lines of code in the files of the game.
the guns in paw low loot are an optional file
Has anyone tried adding a new FabricType? Seems like scratch and bite defense is hardcoded to the 3 base fabric types
I have and it does not work because of what you said, in the Java.
Huh...maybe that explains why I couldn't get the OnDestroyIsoThumpable event to fire. I tried on client/shared/server
Yeah exactly. Ah well :/
Hey guys, is there like a master list of mods that I could look through to find things that I might want to play with?
Or like a list of recommended mods?
To be clear I was doing:
Events.OnCreatePlayer.Add(HelicopterSandboxOptions("OnCreatePlayer: "))
Events.OnCreatePlayer.Add(HelicopterSandboxOptions)
```Where the first line was the issue and not firing.
If I install mods to play on a public multiplayer server, will those mods affect my single player save?
no
so you install mods per save then?
the save loads the mods it used when you first created the save
do change the mods in an existing save you need to click the "more" button next to it
ahh ok thanks
What mod is taht reloading bench from?
There's a mod menu for the main menu which creates a kind of shortcut when making new games
But you can modify mods when creating a new game with sandbox also
It's understandable people are confused going into it
Question, does the order mods load matter? So Item Tweaker needs to be first for a mod that uses Item Tweaker to work?
order shouldn't matter
all Lua files are loaded before being run
Ok cool.
Any idea why an item tweak Lua that changes the stats of a bag won’t change the name? Everything else edits just fine but the name stays the same despite writing something new
Toi aussi ! 🥳
Would the towing rubberbanding be from the tow mod or from the vanilla detach not syncing to a dedicated server?
Ammo Maker mod
Only available in my blog for now: http://pzmodding.blogspot.com/ , soon I will release the modpack for 41.65 (Not compatible now with last build)
ah, ill hold off on that, i dont understand a word on there
Mods available on English and Spanish language.
Page in Spanish.
also, the dying light wallpaper on your website is making weird cuts on higher resolutions.
😮
What is your resolution?
In this video, we take a look at a hidden gem of a Project Zomboid mod from the popular creator, Snake! Le Gourmet Revolution adds hunting, as well as a variety of cooking, farming and fishing mechanics to the game. It's an absolutely incredible mod and well worth a look. This will be the first of a series of videos where we take a look at some ...
2560x1440
Thanks, I will check to fix that issue!
i guess you wont upload your mods to the workshop? its too bad since i would like to try them on a server
Soon
The modpack needs to be very stable, I'm working on that.
Here you can view a little gameplay with my modpack https://www.youtube.com/watch?v=xgEbKTqnGFg
In this series of Project Zomboid, Logan Stone has been shipwrecked on the Cherbourg Coast. Here the zombies are tougher, food is more scarce and we are completely and hopelessly lost! But, at least we escaped Knox Country!
Project Zomboid to me is the ultimate zombie survival game experience, this game does not hold your hand and will punish y...
Ah, it's not on the Workshop or Nexus. Would be why I haven't seen it. 😄
If/when you publish it on the Workshop, would you let me make a Brita patch for it?
Nope, for now.
First I suggest to play only with my mod pack (If you want a good survival experience) I don't want to make pz in a shooter game :p You need to make a lot of things to get ammo. A separate skill.
Don't use Nexus
It's a hard work
Helicopter Events works good with modpack, a lot of people on our spanish community plays with that combination.
Also, car mods works properly
:o do you use the vanilla perk factory for your skill?
Yeah
I was curious to test Skill Recovery Journal with a custom skill
You have Ammo Reloading Skill and Hunting Skill. With books and that.
Black books (Ammo Reloading Books)
For what it's worth, I've already made a Brita patch for a mod similar to yours, Simple Ammo Conversion. I'm no stranger to balancing a mod either.
In theory someone could get all the books and be the sole supplier of fresh ammo in a server and get super rich lol
If you've made it challenging and realistic, all the better.
Just wait for the procedurally generated map!
🙂
hahaha yeah! I rework all loot tables for MP
It's, this update will be very very very big!
Does your mod have an EN translation? I might give it a go.
It does
Yeah!!
You should redirect users to a Google translated page lol
Any new guns or upgrades for the guns in this new update snake?
The mod pack can be translate to all languages
All right. But why not the workshop? You'd get a lot more exposure if you uploaded it there.
Spanish is a scary 🥺
Strange to see a mod NOT on there.
Some weapon parts for AK47, but the work now is make the mod pack similar to base game (3D models, maps, foraging system, Metal detector, Mining)
Based
Rework of all loot tables, and some systems to fit with the base game.
Well, there is more categories of items, plants for dyes, metals using metal detector (Sounds of the metal detector when a item is detected), and found some rocks and need a pickaxe to get it (You can see anims when you break the stone with pickaxe)
Ah neat
It's a modded version of new foraging system (Some functions)
All items for mods can be found using the new foraging but a lot of them is legendary ones. So it's really hard.
Sweet
Base game have some of that I think
Really?
Need o confirm
need to confirm xD
But with the modpack can find eels and crabs
Some water turtles
you ever get a answer on this?
making a texture for the harley quinn bat, on the vanilla bat model
It's a good predator! https://www.youtube.com/watch?v=BJZlARomqPs
A fin de abril, trabajando con Oscar Federico Dono en Esquina, guiados por Nacho Piaggio, registramos algo en vídeo de manera absolutamente casual. La cámara estaba encendida justo en ese mismo momento y encuadrando el área en cuestión. Aunque entendimos qué fue lo que pasó, no llegamos a verlo con claridad. Luego, quedó olvidado. Ahora, revisan...
Cook it in a pan with some lemon and you are set
haha I not eat fish, only sport fishing, sometimes I give fishes for friends!
Hey guys, is there like a master list of mods that I could look through to find things that I might want to play with? Or a list of recommended mods
Most subscribed all time on workshop
What Chuck said. The top rated Steam Workshop mods are as good a place as any to start.
anyone know if pz lua has some built-in hashing function for string comparison, probably the same function used to check the mods checksum.
actually im gonna research and post here if i find xD
Well obviously if they have one it's broken, so you might not want to use it 😂
PZcrypt.hash
i wonder if thats usable in lua and also might be overkill since its for hashing password with salt
i just need some quick md5 or sha1 hashing. guess ill have to install a lua lib
or maybe CRC32 var3 = new CRC32(); if that is actually exposed
and yet if i can make byte array in lua
xD
depends what you need but crc32 is only 32bit, might not be good enough depending what you're trying to achieve
i need to compare two string
Lua or Java string?
why do you need a hash to compare strings?
cause i got a big string(file) that im not going to send over network
unless its different
if thats a one file lib that will be amazing 😄
looks great, thanks
and doesnt have any next() so it will work easy, hopyfully let try
Well, you can get the hashcode of java strings, I think.
Also psa: don't use Say() for outputting to the player
that will be picked up by the radio, use addLineChatElement
Aha it is co`, someone who knows about java. Perhaps thou couldest aid yours truly. I was thinking of procedurally generating icons, and a texture (can be set as an item's icon) has the methods getData and SetData which edits the image with code.
When I try getting the data from a texture with Lua, the game crashes to desktop though. The documentation says
https://projectzomboid.com/modding/zombie/core/textures/Texture.html#getData--
getData()
returns the texture's pixel in a ByteBuffer EXAMPLE:``````java
ByteBuffer bb = getData();
byte r, g, b;
bb.rewind(); //<-- IMPORTANT!!
try {
while (true) {
bb.mark();
r = bb.get();
g = bb.get();
b = bb.get();
bb.reset();
bb.put((byte)(r+red));
bb.put((byte)(g+green));
bb.put((byte)(b+blue));
bb.get(); // alpha
catch (Exception e) {
setData(bb);
It says it returns WrappedBuffer. I don't know what to do hey maybe you have an idea like maybe it only works in Java or there's a special way of using it in Lua.
A pick a part for my server, Costs money droped by Z to enter. Plan is to reset it each week so there is always parts for players to fight over. Thanks @brittle jewel for the help! https://www.youtube.com/watch?v=4cdrUaJAJis
Not working in pz as is, guess some stuff is missing like require("bit")
Also getFileWriter seem to crash my game with big file xD damn it.
Please, TIS remove or make these admin text toggleable
Got a question: How do I go about modding one of these little story events in? I had a few ideas I wanted to try out.
Kinda want to know how I can get modded items to spawn in the world like this.
i've been wanting to know that as well
i know the table stories are hardcoded in java, i don't remember about the others
The stories are tied to an enum - however before the MP release I helped work out something called SpawnerAPI (formerly farSpawner, and can be found linked in the pins) that stored objects and subsequent functions to be loaded once a square was reached. You could technically set up randomized stories this way.
Currently SpawnerAPI doesn't work as intended and needs a refactoring to work in MP.
Is there a mod that adds weight in the loot window without the need of hovering over the items?
wouldeve loved to add metalworking story events ,_,
Has anyone around successfully played the Cherbourg map?
what tools do most people here use when making mods for the games? id love to learn a bit more about coding and modding but dont know where to start
so farm my only experience with this is just dwarf fortress, which is just making a list in a text document in a certain format, maybe making a png image for it, and putting it in the files and boom, mod complete. if anyone does answer just @ me or dm me any advice so i wont miss it
@hexed terrace really the tool will depend on what you want to achieve. Define your mod idea and find the proper tools after.
There is alot of different tools for modding pz cause there is alot of mod possibilities.
- Adding items and recipe require only a text editor and a 3D software to make the models.
- Adding functionality in Lua require also only a text editor but there is better tools for that too.
- Most vanilla scripting is available to you to study in the media/lua directory of the game install directory.
- Making maps require the official project zomboid tools such as TileZed and WorldEd, those tools also have multiple other utility in it for other possibilities like creating custom sprites, tiles etc...
- There is a Wiki for references.
- Checking existing mods is also a good way of getting started.
- Checking TIS forum for answered questions.
So it really come down to:
- what do I want to create.
- what are the tools I will need to do it.
- is there any mods doing similar stuff that I can check as a reference for helping myself.
yeah alright that sounds good. i suppose with pz having development tools readily available theres honestly really little for me to have to do myself in terms of making or finding a tool that can alter the game. guess into blender i go. are there any assets out there in 3d file format that i could use in blender? or does one of the pz tools provide that as well? cause id like to actually see how the models are formed before i do any myself
there are pinned messages in #modeling that have the character models and clothing models
nice. ok thanks
cause one thing i for sure i wanna add.....is a function to wear jackets either zipped up or open
it bothers me way too much to not be able to see a flannel shirt under my black leather jacket, or rolling up sleeves,etc fashion over function is a big thing for me
if i recall theres a few mods that ADD clothing that are open jackets but theres none that ive seen that lets you open/close or roll up any vanilla clothing, and just having the option to do that to clothing that use the assets of the game itself would be nice, but i imagine id have to get something done in terms of generating a bump/texture map for how it would affect the front area visually when the jacket is unzipped in a uniform fashion rather than having me be required to add textures individually across the board for every piece of clothing one by one
a metal ladder than can be lowered and raised as a later in game upgrade version of sheet rope would be cool too
Ladders in general. Being able to use and craft them would be a game changer, literally.
i despise the ladders in game
i understand they have an aesthetic function but not having them function is like painting a entrance onto a brick wall and going straight into it like a cartoon
sheets allowing you to negate wired fences would totally be worth it btw
it would also be an easy cheese though. find a place thats surrounded by tall fences that dont get damaged by ombies, put ladders on each side, boom, impenetrable fortress.
you are confusing cheese for gameplay
where zombies arent a problem people will always be lol
depends on your view on a fortress that zombies cant scale and where the primary defense requires no upkeep
zombies breaking fences would kind of fix that
the way i stay safe is i have a location in the middle of the woods where zombie density is low surrounded by walls. the downside being that getting to and from locations with loot requires a vehicle
but yeah a retractable metal ladder mod would make a few things far more enjoyable in game
just looks weird having little napkin lookin ropes everywhere rn
@hexed terrace Spongie's Clothing Mod adds ability to wear vanilla jackets open as well as adding 2-3 other jackets
it does? i didnt see it mentioned anywhere just saw that it adds open clothing
Also functions to reduce insulation so you can unzip or zip your jacket based on weather
It was added at some point but it works with almost every base game jacket
as in it works with every jacket i have tried but i have not tried them all lol
lets see if it works with this dope as leather jacket
the only ones i havent added yet are the suit jackets and the new track jackets unless there are others i forgot about lmao
hmmm, i right click on the leather jacket, the classic negan lookin one, not seeing any options for opening it
make sure you enable the optional mod
its in a seperate mod you have to enable
which one
i have spongies clothing, hair and fluffy hair mods
as well as vanillas edits on
its in the vanilla edit one
imma try to find some other jackets and see if its just the one im wearing thats the issue.
worked for leather jacket for me
hmmm
is it enabled on your save?
how would i check that
do i have to start a fresh save or will it affect continued ones
when you select the save in the load menu there should be a "more" button or something like that at the bottom
and then you can change the mods
oh...huh, yeah ok, i didnt know that it would not automatically enable new mods on old saves
i wish more games had it honestly lol
same
it makes it easier to not break saves by accident
as well as choose any major game changing mods for the sake of different mode style saves. several games i own i have to manually turn on and off mods anytime i switch save files that i set up for different "modes" of gameplay, so a feature like this is super cool. now i just gotta find a last of us style mod and itll be perfect
or make one
but spores, craftable/findable gas masks and filters, and different zombie types would be dope as hell
high target locations or high density locations having spores would be cool, having to be careful in tight enviornments would be even more important. if only i knew more about code
i suppose thats why im trying to learn
i remember like yeeaars ago i saw people on the forum planning on making a tlou mod but i dont think it went anywhere lmao
oof
yeah that kind of mod would be pretty big, or id assume so i know little about modding and just starting out
i know theres a toxic fog mod which is kind of similar but i think it affects the whole map rather than just some areas at once
yeah, i wouldnt want the hole map to be that way, just tight and Closter phobic areas with little to no air flow
honestly just some reskin mods for different virus/apocoliptic SPC's would be dope too
well hey, thank you very much. this mod is exactly what i wanted from my jackets
💪
Toxic Fog Mod rocks but would be great if there was a distinction (eg: Toxic Areas) like Chemical Spills or else.....
is it possible for a mod to override media/scripts/vehicles/template_engine.txt in order to add a new field?
honestly if the toxic mod had an actual system of where the toxicity originates from, travels and what causes it to stick around or dissipate i would gladly get it. after that itd be a matter of whether or not it lets you craft filters for your mask or not
also i found that last of us mod, its been discontinued since 2017
i feel like a mod like that would be a pretty big undertaking though. a rework of the stealth system and a new algorhythm for how the zambos actually "see" the player, not to mention applying a different system between runners, slower infected that dont see as well due to the fungus in their eyes, clickers, bloaters, etc, as well as throwable noise making items and all that.
however a skill that prevents a bite at the cost of a melee weapon such as a knife or something is a pretty neat idea to add to the game
it would make things like bread knives, spoons and forks fairly useful as a shiv
A mod making you invisible for a short time to zombies when chatting or checking the map in MP would be amazing lol
5 second duration and ends when exiting chat and 5 second cooldown maybe to avoid abuse
https://cdn.discordapp.com/attachments/753705447503953977/926811956680204328/unknown.png Okay got my weapon working, (friend made the scripts were having issues so i just replaced it with template and renamed parts and it worked).
also happy new year
Hi Guys, I'm new to modding and I need help with a lil thing that I can't seem to get right
(Sorry for my english)
So I'm trying to spawn an NPC, I've got Superb Survivor as code reference and I've noticed that It is using IsoPlayer to render a new survivor, but I've checked the Javadoc and there is also IsoSurvivor
I'm using IsoSurvivor, everything is fine but I don't understand how to render my NPC. Through the debugger I can see that there is my object istance, but no character in game.
I'm not even sure that It is the right way, maybe I need to use IsoPlayer like Superb Survivor is doing.
Thanks to whoever can help me out 😄
what should I look at if I want to add a moodle ?
HELP how do u get past the DEBUG screen? I pressed all F keys, nothing happends
click the break on error box
press f5/f6 while clicking the small checkbox in the top of the screen. there is an issue that causes it to only work in those moments
once you are past that, you can press f11 to skip the debug screen
dosn't work
hammer the keys down while clicking. it works
Clicking on break on error while hitting f5 did the trick, thanks 😄
Enjoy guy, hope there is not too much bugs
If you try it, do not hesitate to give me your opinion
can you cut legs off ?
Not yet
😦 cool mod anyways
Planned
Nice
look at kenshin amputation system if u want ideas
But I will surely ask in the channel modeling for help on the models and icons because I suck at that
Hey, that looks really well thought out and thorough!
I'm usually not enthusiastic about amputation as a game mechanic, in general, but that looks like it avoids some of the reasons I'm not usually keen on it?
This is a mod i have secretly always wanted
I tried to make it realistic and be the last resort. There is no advantage in cutting off an arm except not turning into a zombie
What happens if you amputate both of them?
Do you just suffer?
You can no longer equip anything in your hands and the actions take like 4 or 5 times longer. Planned to not allow car too
But you can still craft and do stuff right?
Basically the true cdda challenge
Maybe you could add an amputee trait, that would have to be a -10 point trait though
Yes you can do anything except to have an object in your hand cut off but everything takes longer. To reduce the time of actions you equip a prosthesis.
Planned
Phew
Well, sounds like this could also serve as the groundwork for a handcuff mod, as it sounds like it solves some of the issues with implementing that.
Just subbed
Yes, you increase the time of each action by 1000 if you are handcuffed and voila. If it interests people I can do it quickly
Wait no, it's for multi. I don't know how to do that
woah this looks cool, does it have a different visual when you amputated your arm?
What do you mean ?
when you cut your arm off
does it show the mutilated model's arm cut off?
If you have a hand available and the weapon can be equipped in one hand, it equips it in the available hand. Otherwise it makes it fall to the ground
how do i get the mod id? i know the workshop id but not the mod id
Yes you can cut in three places, hand, forearm and whole arm. It takes away the part cut
Thank you! btw, does it work on MP build?
Not test yet but I think
Thank you!
so can anyone confirm if setting SurvivorHouseChance = 1 is what i need to do for raven creek on servers?
Question: I can use item Tweaker API to tweak backpacks just fine, but I CANT change the displayed name. The displayed name is changed where? In the LUA for the item tweak or the .txt file?
I just found out that a weapon's attachments become invisible when it is put on the ground :<
I suppose you could get around it by putting items in the same place as the weapon which are invisible in inventories.
Hi all - is there a mod that lets you add metal plates and weapons and shit to vehicles Mad Max style?
someone have a list of mods working for 41.65 coop? thx :D
are there any lua events for when a player spawns after clicking start?
so i got this, but how do i make it select one or 3 of the items in the list?
ZombRand(x, y), i think, which returns a number from x (inclusive) to y (exclusive)
Priorities in modding 😄
if you want to have it not select duplicates it's more complicated
but what i'd do is like
choices = {{"Base.TinnedBeans"},{"Base.CannedMushroomSoup"},{"Base.TinnedSoup"},{"Base.TunaTin"},{"Base.PopBottle",3}} etc
then you'd do somethingl ike
https://pzwiki.miraheze.org/wiki/Modding:Lua_Events
I use OnCreatePlayer() on my mod
Yeah, I saw that but it doesn't work for me idk why.
function onCreatePlayer(int, player)
local player = getSpecificPlayer(int);
print(player)
end
Events.OnCreatePlayer.Add(onCreatePlayer)
the only event that works for me is OnPlayerMove and OnPlayerUpdate
I made my first mod https://steamcommunity.com/sharedfiles/filedetails/?id=2704009889

I have no idea if it works
I am at work right now
But theoretically it works great
Hi guys, do you know how to loop through ArrayList in Lua?
I've got ProfessionFactory.getProfessions() and I need to loop it but I can't seem to get it right
I'm trying with iterator from Java, but It is not working, so I'm out of idea
Don't use int as variable name, that should be the issue
for i,v in ipairs(array) do
--code
end
i is the index and v the value
Thanks for your help.
It is not working tho, here is my implementation:
function getAllProfessions()
local professionsList = ProfessionFactory.getProfessions()
local professions = {}
for key,value in ipairs(professionsList) do
professions[key] = value
end
return professions
end
It seems it isn't looping through professionsList.
My doubt now is that it is actually empty
Edit: I've checked with: professionsList.isEmpty() and It is not empty
for index=0, arraylist:size() -1 do
-- use arraylist:get(index)
end
ipairs only works on lua tables
Vanilla firemarms expansion holographic for shotgun, is it attachable?
Thank you! It is working fine now.
@main lion gun mod person?
why does isServer() and isClient() return false if you host the game through main menu ?
local spawnItemChoices = {{"Base.TinnedBeans"},{"Base.CannedMsuhroomSoup"},{"Base.TinnedSoup"},{"Base.TunaTin"},{"Base.PopBottle",3}} -- etc. etc., can be easily modified on the fly
function initTraitsItems(_player)
local inv = _player:getInventory();
if _player:HasTrait("preparedscrapweapons") then
local tries=ZombRand(1, 4) -- spawn 1 to 3 items
for i=1, tries do
local selected = spawnItemChoices[ZombRand(1, #choices + 1)]
if #selected == 1 then
inv:AddItem(selected[1])
else
inv:AddItems(selected[1], selected[2])
end
end
end
end
and for without duplicates:
function deepcopy(orig) -- use with care; this is not suitable for copying tables with recursive references
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[deepcopy(orig_key)] = deepcopy(orig_value)
end
setmetatable(copy, deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
function pickAndTake(choices, n) -- choose n items at random from choices, without duplicates
local newlist = deepcopy(choices) -- clone the list, so we don't modify it
local out = {}
for i=1, n do
out:insert(newlist:remove(ZombRand(1, #newlist+1)) -- pop a random item from the list and add it to the output
end
return out
end
local spawnItemChoices = {{"Base.TinnedBeans"},{"Base.CannedMsuhroomSoup"},{"Base.TinnedSoup"},{"Base.TunaTin"},{"Base.PopBottle",3}} -- etc. etc., can be easily modified on the fly
function initTraitsItems(_player)
local inv = _player:getInventory();
if _player:HasTrait("preparedscrapweapons") then
for _, itemEntry in ipairs(pickAndTake(spawnItemChoices, ZombRand(1,4))) -- spawn 1 to 3 items, no duplicates
if #itemEntry == 1 then
inv:AddItem(itemEntry[1])
else
inv:AddItems(itemEntry[1], itemEntry[2])
end
end
end
end
obviously doing it without duplicates is harder
you cuold also let pickAndTake modify the original list to avoid having to use deepcopy
function pickAndTake(choices, n) -- choose n items at random from choices, without duplicates.
local out = {}
for i=1, n do
out:insert(newlist:remove(ZombRand(1, #newlist+1)) -- pop a random item from the list and add it to the output
end
return out -- remaining items in choices are what wasn't chosen
end
function initTraitsItems(_player)
local inv = _player:getInventory();
local spawnItemChoices = {{"Base.TinnedBeans"},{"Base.CannedMsuhroomSoup"},{"Base.TinnedSoup"},{"Base.TunaTin"},{"Base.PopBottle",3}} -- etc. etc., can be easily modified on the fly
if _player:HasTrait("preparedscrapweapons") then
for _, itemEntry in ipairs(pickAndTake(spawnItemChoices, ZombRand(1,4))) -- spawn 1 to 3 items, no duplicates
if #itemEntry == 1 then
inv:AddItem(itemEntry[1])
else
inv:AddItems(itemEntry[1], itemEntry[2])
end
end
end
end
you can also remove some of that indentation like this
function pickAndTake(choices, n) -- choose n items at random from choices, without duplicates.
local out = {}
for i=1, n do
out:insert(newlist:remove(ZombRand(1, #newlist+1)) -- pop a random item from the list and add it to the output
end
return out -- remaining items in choices are what wasn't chosen
end
function initTraitsItems(_player)
local inv = _player:getInventory();
local spawnItemChoices = {{"Base.TinnedBeans"},{"Base.CannedMsuhroomSoup"},{"Base.TinnedSoup"},{"Base.TunaTin"},{"Base.PopBottle",3}} -- etc. etc., can be easily modified on the fly
if not _player:HasTrait("preparedscrapweapons") then return end
for _, itemEntry in ipairs(pickAndTake(spawnItemChoices, ZombRand(1,4))) -- spawn 1 to 3 items, no duplicates
((#itemEntry == 1) and inv.AddItem or inv.AddItems)(unpack(itemEntry))
end
end
but that's a bit overboard :P
ok thanks
is anyone having troubles to upload mods in the workshop?
if not then is my connection, but I cannot update
how do you get the new debug mode to show angle of fire arms
heres a generic fix for gun mods for pvp servers
just change the guns angle to 1 or so
used to be able to make it abit more extreme in build 40
but it removes most of the bs cone aiming style
As in when loading into the world, not just char creation? I have not found the event, but I did just use Events.OnChatWindowInit.Add() on Sleep With Friends and it did the trick to make it wait until the player is more "in the game" before really activating.
Btw Sleep With Friends is now v1.2.1 so server owners gotta update
New variable in sandboxvars.lua, as you can now set sleep length to go by real-time minutes or in-game hours
does that event have any params or do I use getPlayer() ?
Events.OnChatWindowInit.Add(getVars) would make function getVars() activate and that is all
hello could someone point me in the right direction on where I could learn about creating timed actions and adding options when interacting with object, currently quite lost thankyou!
@cunning hare
Context Menu Options:
local function onOption1(worldobjects, playerObj, destinationSquare)
--walk to destination, if luautils.walkadj() then
--add timed action to queue
if luautils.walkAdj(playerObj, destinationSquare) then
ISTimedActionQueue.add(MyCustomTimedAction:new(playerObj, params1, 20));
end
end
local function onFillWorldObjectContextMenu(player, context, worldobjects, test)
if test then return; end;
local playerObj = getSpecificPlayer(player);
--if somestuff is true then
local destinationSquare = clickedSquare -- or any square you need
local myOption1 = context:addOption("Option 1", worldobjects, onOption1, playerObj, destinationSquare);
--end
end
Events.OnFillWorldObjectContextMenu.Add(onFillWorldObjectContextMenu);
Timed Action
require "TimedActions/ISBaseTimedAction"
MyCustomTimedAction = ISBaseTimedAction:derive("MyCustomTimedAction")
function MyCustomTimedAction:isValid()
-- Must return true or the action will stop.
-- Check for various thing the action requires to be valid.
return self.character:getInventory():contains(self.params1)
end
function MyCustomTimedAction:waitToStart()
-- Do something like facing the destination object before starting
self.character:faceThisObject(self.params2)
return self.character:shouldBeTurning()
end
function MyCustomTimedAction:update()
-- The update method run every tick after start()
end
function MyCustomTimedAction:start()
-- Do thing when the action start()
end
function MyCustomTimedAction:stop()
--Do things when when the action is canceled
ISBaseTimedAction.stop(self)
end
function MyCustomTimedAction:perform()
-- Do thing when the action is completed successfully
ISBaseTimedAction.perform(self)
end
-- Define parameters that you need in your action
function MyCustomTimedAction:new(character, param1, param2) -- add any amount of param needed for your action
local o = {}
setmetatable(o, self)
self.__index = self
o.character = character
o.param1 = param1
o.param2 = param2
o.stopOnWalk = true
o.stopOnRun = true
o.maxTime = 10 -- will set this in start()
return o
end
thankyou heaps
Co' has made an excellent list of PZs currently functioning events.
Making mods seems really intimidating and reading the "beginners resources" only seemed to reinforce this conception
Anyone have any advice?
@drifting ore #mod_development message
Where would I go to find the game code about composters?
I want to make something that lets me compost dead zombies
I tried looking at the API whatever that means but it doesn't make any sense to me
and on the note of similar stuff
I think I could borrow some intellectual property from just out the window and see how he did some of his stuff
You can check other mod to learn there is no problem.
Just don't publish a complete copy.
All lua script are in C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua
All workshop mods are in C:\Program Files (x86)\Steam\steamapps\workshop\content\108600
how would I go about checking if the player has right clicked a corpse
You would have to build a context menu
@thin hornet what ide are you using?
I use VisualCode, Notepad++ and Intelij. Depending what i want to do.
I like the search tools for VisualCode, Notepad++ open quicker for quick view or quick note writing. Intelij when i make my official mods with the game libs and annotation.
Ugh, I want to make a mod that disables player built walls becoming transparent above ground level but it's so complicated, and I don't think there's any existing mods that can help me.
I apologize if this is the wrong section to ask about mods, but is there a mod that lets me fully customize the starting gear?
@drifting ore #mod_support is the proper channel, here it's about 'making' mods.
Gotcha! Thank you! I misread the channel description. My bad
Np
Greetings! I require help with a trait mod I am making. I get an error popping up when I load the mod. Looking at the console.txt it points to line 7
Here is the code
try to post the error too
hey guys. i'm having some trouble here.
my created recipes just won't show in game.
i have enabled the mod; made sure the mod was a txt file; made sure that the filepath was correct, etc etc.
what am I doing wrong?
module Base
{
recipe Fix Valu-Tire
{
OldTire1,
Result:OldTire1,
SkillRequired:Mechanics=10,
Sound:PutItemInBag,
Time:500.0,
}
recipe Fix Valu-Tire 2
{
OldTire2,
Result:OldTire2,
SkillRequired:Mechanics=10,
Sound:PutItemInBag,
Time:500.0,
}
recipe Fix Valu-Tire 3
{
OldTire3,
Result:OldTire3,
SkillRequired:Mechanics=10,
Sound:PutItemInBag,
Time:500.0,
}
}
Its trying to call nil
which mean that your function addFreeTrait() is not defined
Can you tell me where that function is defined
I think I know now what I did wrong. I'm doing it like the profession does. It's probably why it doesn't work.
Great
Also that function is in the MainCreationMethods.lua
Now I have a question for anyone who can answer.
Anybody have an idea how to transfer large text file to clients from the server?
sendServerCommand() throw a buffer overflow when sending too much info.
Does your mod appear in your mod menu? You selected and activated it before starting the game?
addFreeTrait is only defined on professions, not on traits, yes
Anyone else getting an error when using Paw Low Loot with the Resident Evil China Mod?
Yes, I did.
What is oldTire1, an item you made ?
No, it's the Valu-Tire
hey I am struggling with getting a context menu going, I haven't even managed to add options does anyone have any suggestions of a mod or mods that would be a good example of how the timed action system applies?
I used this as reference
Try not using - in valu-tire
let me see
I think you'd have to break up your command into chunks and send each of them as a separate server message, server message data has a cap of ~1000KiB
1000 KiB is quite a bit though, where do you hit the overflow?
nope, did not work
module MyModule
{
imports
{
Base
}
recipe Combine improvised surgeon kit
{
Nails,
Thread=3,
Result: TOC.Improvised_surgeon_kit,
Time: 30.0,
NeedToBeLearn: false,
CanBeDoneFromFloor: false,
OnGiveXP: NoXP_OnGiveXP,
SkillRequired: FirstAid=2,
Category: Surgeon,
Tooltip: Recipe_Tooltip_Improvised_surgeon_kit
Icon = surgeon_kit,
}
}```
Try the import base, otherwise I don't know
so it should look like
module RandomModName
{
imports
{
Base
}
recipe Fix Valu Tire
{
OldTire1,
Result:OldTire1,
SkillRequired:Mechanics=10,
Sound:PutItemInBag,
Time:500.0,
}
recipe Fix Valu Tire 2
{
OldTire2,
Result:OldTire2,
SkillRequired:Mechanics=10,
Sound:PutItemInBag,
Time:500.0,
}
recipe Fix Valu Tire 3
{
OldTire3,
Result:OldTire3,
SkillRequired:Mechanics=10,
Sound:PutItemInBag,
Time:500.0,
}
}
my file is 2mb
ill try cut it in chunks good idea
i only send it to connecting player if the timestamp has changed
gonna try it now
is getModData() persistent?
ModData is persistent
that didn't work also, sadly
does it get saved to the player file ?
But you need to use player:transmitModData()
player, zombie, isoObject and items have modData.
and you have global modData
they all persistent, and yeah other than item, you must transmit
Can't help now, I thinks it's from your folders
Hi guys, how do i download mods? I subscribe on workshop but they don't appear
you mean the filepath?
I mean if i do player:getModData().keycode = "1234"; if they log back in will the keycode be set ?
Yes
@vestal falcon that would be a question for #mod_support
ok thank you
C:\Users\MyUsername\Zomboid\Workshop\ModName\Contents\mods\ModName\media\scripts
Yes but use player:transmitModData() otherwise it's not save
Put it in Zomboid\mods\ModName\media\scripts
that did work. thank you.
but now, how do I upload it to the workshop, since the folders are set up differently?
You can't but that mean the probleme is the workshop so either your filepath is wrong, either you miss a file for the workshop
well, I need to see what is wrong, then. because i'm using this same filepath to change another item, and the changes made to the item works, just the recipes that don't
@devout oriole works ok here
Can anyone help me with a dedicated server load order?
Trying to make sure I get my load order right on my server
keep getting little errors
What errors
most of the time the little errors in the bottom right corner or whatever dont actually matter
unless you notice you cant do something you normally can and the error appears
I'd say they do matter. Even if they don't break things, they're bad to have and most good mod authors will appreciate being informed about them, if their mod is to blame.
Any idea why my mod won't play the sound file right?
{
sound ZombieSurprisedPlayer
{
category = Zombie,
clip
{
file = media/sound/hoo.wav,
}
}
}```
The sound file is fine, it's a .wav
Everything is done exactly the same to all the other sound alert mods
But the sound won't play
It's just one sound file, why won't it work

yeah, it works. but it stops working when i add it to my mod that has other files too
For those having issues with Server to Client command in SinglePlayer
To simulate sendServerCommand in single player server scripts:
-- ServerScript.lua
-- To send Server command to client
-- Handling SinglePlayer compatibility
local function isSinglePlayer()
return not isClient() and not isServer();
end
if isSinglePlayer() then
triggerEvent("OnServerCommand", "ModuleName", "CommandName", data);
else
sendServerCommand("ModuleName", "CommandName", data);
end
sendClientCommand is already handled for single player in the Java code.
Does that mean sendClientCommand works fine in singleplayer and sendServerCommand does not?
Exactly what it mean 🙂
thxm8
np
To know if the client is Admin or is in single player from a client script
local function isSinglePlayer()
return not isClient() and not isServer();
end
local function checkClientIsAdmin()
return isClient() and isAdmin() or isSinglePlayer();
end
To know if the player is Admin or is in single player from a server script
local function isSinglePlayer()
return not isClient() and not isServer();
end
local function checkPlayerIsAdmin(playerObj)
return playerObj:getAccessLevel() == "Admin" or isSinglePlayer();
end
Handling Server to Client Communication
This goes into a Client script, it listen for commands sent from the server.
Client/MyClientScript.lua
local function onServerCommand(module, command, args)
if module == "MyModule" then
if command == "setResetArea" then
-- do something
-- access arguments with -> args.myValue
end
end
end
Events.OnServerCommand.Add(onServerCommand);
Handling Client to Server Communication
This goes into a Server script, it listen for commands sent from a client.
Server/MyServerScript.lua
local function onClientCommand(module, command, playerObj, args)
if module == "MyModule" then
if command == "" then
-- do something
-- access arguments with -> args.myValue
-- access the sender with playerObj
end
end
end
Events.OnClientCommand.Add(onClientCommand);
if isClient() and isAdmin() or isSinglePlayer() then
return true;
end
return false;
```Hey you know what, maybe you could make that smaller if this would work
```lua
return ((if isClient() and isAdmin()) or isSinglePlayer());
actually
return isClient() and isAdmin() or isSinglePlayer();
would be enough
updated it, thanks
if isClient() and isAdmin is true, it will not check the or
Lua needeth not the brackets in boolean... so that be its behaviour.
Does anyone know if there is a sort of API that lets you view things like custom .png files in-game? E.g, like the hitlists from Authentic Z, or the paint/tint guides from Paint My Ride?
Would be neat if the community had a way of doing something like that easily.
There's ISUIElement.drawTexture which uses a java object to draw pictures
i think those examples used the old map system which was just an image
sooo anyway to set admin when Hosting a game from the main menu. I tried edit the db but nothing i do works.
Hard to test admin stuff in coop-server when i cant even be admin
anyone know what the difference is between scrap armor and (new versions)?
he has the mod id listed with (new version) under all his mods and kinda confused on what is which
Figured it out. Idk if someone has a reach to djvirus but there is an error with his weapon packs. Seems to be related to his new traits he just added.
@hollow shadow
?
See above.
oh thats already sorted out on my discord
only use the new one
Are guns supposed to be extremely plentiful with Brita's Weapon Pack?
@hollow shadow oh really? is that version pushed already?
@weary summit You need to do a lot of testing to tweak the spawn rates
I legit just spent all day doing that
just tweak the settings and keep making new worlds and see what spawns
it also ties into the sandbox spawns too
Really?
So, I had a ridiculous mod idea earlier today. Not sure how many people would enjoy this, but it makes me laugh so hard:
Parent in the Apocolypse:
Adds "New Parent" trait. Spawns an item in the player's inventory that functions like an alarm clock with multiple alarms throughout the day (randomized, if possible). Must be carried in primary or secondary slots instead of inventory. If you put the baby somewhere, and a zombie gets near it, the baby dies. If you don't feed it (I'd guess it loses durability over time, and maybe there's a repair-like function to add food to it?) it dies. If it dies, your character suffers an extremely high, permanent depression drain.
these are tweaked for a 32 players server with lorefriendly spawns with weapons and ammo set to common
@weary summit check the arsenal description for a detailed write up of the spawn system
I use 5 guns and 1 ammo with brita, seems pretty balanced altough those ammo canisters spawn a little too much
Yeah, I started a new game and in a single row of 5 houses and a couple garages I find 6 pistols and a many boxes/canisters of ammo
Its a bit silly
Wtf
That or as a non-American I just don't understand just how many guns that country actually has
Searching garages I never found any guns or ammo with brita lol
well we have a lot ngl
Its the ammo canister setting, its set to 50%, turn it down to 10%, that should do
if you went home to home youd prolly fine some
not that much in everyone home but some ppl have a lot of stuff
Hey if anyone needs to manage a Zomboid Linux server this might help: https://github.com/quarantin/pz-server-tools
@thin hornet No need for root anymore 😄
Nice 😄
Good job with this man 
@thin hornet du coup j'ai codé un mini client/server en C pour éviter d'utiliser sudo a tout vas 😂
I'm relatively proud of the result 😅
does anyone know exactly what zombie:setUseless(true); does when referencing a zombie?
I was working on learning modding and wanted to make some changes to how stealth works. opening up a few other mods that use stealth, one was turning on players ghost mode, but that seemed overkill to me. The other was calling zombie:setUseless(true); in certain siutations, like if you get far enough away from them with distance based on sneak skill
but I wasn't too clear what that does exactly, it seems like maybe being set to useless makes the zombie lose aggro on you and stop, but I was having trouble finding exactly how to tell what effects it has
would setting that to true make the zombie stop moving, and reset, then get back to normal next frame? If not that is basically the effect I want to be able to have on a zombie with my mod, so a suggestion on how to achieve that would be awesome thanks!
@deep frost well useless zombies are... useless, they might move but they will never react or chase any survivor
Just curious is anyone in here thinking about making playable instruments such as guitars or something like that be pretty cool for like if ur out in the wilderness with a guitar?
Thank you! I was thinking to make my mod I might make it so if player gets far enough away from a zombie the zombie will become useless for a tick and useful again. If you made them useless for 1 onZombieUpdate call, and then useful again on the next. Would that sort of reset their aggro, make them stop moving toward recent sounds, and kind of start over from scratch?
i guess yes
Ok I might experiment with that as a method to make a zombie lose interest in a player if they are far enough away. The distance needed based on sneak + lightfoot skill levels
thanks very much!
Has anyone had any success getting "True Music" to work in Multiplayer? I saw it was updated to work with Multiplayer, and the dedicated server won't even let me join.
Me and my friend got it working in MP
We just had the exact same files
And it worked
Altough we are not playing on a dedicated server
I'm getting this error after dying, and hitting "New Character". Any ideas what could be causing it?
have you found a fix for this?
Hi all ! \o/
I'd like to create a scenario, but I want to add more points than intended at creation 😦
Do you now how i can set that up in the lua plz ?
thank you ! 😄
I would also like to know this
I want to create an object at their position when they disconnect
but not sure how to obtain which character disconnected
It’s fixed internally on their build atm
happy new year to everyone here, I'm trying to make a silly challenge where every zombies in the world chase after me moment i spawn
which file should I tweak for that to happen?
Hi all, I'm a bit new to modding, I was just wondering if there was a maximum SwingSpeed/rate of fire for firearms? I'm trying to add a fast firing weapon but when I lower the swing speed it doesn't seem to effect anything. Is there a different stat that effects this? Or am I going about this wrong?
try changing minimumSwingTime
I have both SwingTime and MinimumSwingTime set to 0.05 and also tried 0.005 but it doesn't seem to change
I also tried increasing the time to like 100 out of curiosity and this also seems to have 0 effect
The gun seems to fire at the same speed no matter what
Hi guys! Is there any documentation regarding how to create custom UI Windows? I'm looking through Lua's scripts but having a doc would be nicer
Thanks, sorry for my english
@granite torrent not sure but you can try looking at other mods for examples
eg: https://github.com/nolanritchie/Super-Survivors/tree/master/media/lua/client/4_UI
Oh alright, yeah I'm using this mod as code reference, but at the same time I'm wondering if there is any "official" doc by the devs or community made only about lua scripts, not Java side
documentation is sparse
Yeah that's true, maybe I'll find it, who knows
Does anyone know if it's possible to extract this map image?
dont think so, youd have to just screenshot it
Is it possible to get the inventory of an offline player? where is this information saved and how can I retrieve / modify it?
Maybe this mod can be a start? https://steamcommunity.com/sharedfiles/filedetails/?id=2695733462
hello i tried to write a mod for me and my friends. i cant code tho. would someone like to look into the code possibly telling me whats wrong with it? i took code from other mods and wrote some stuff to test. The Log is telling me it spawned zombies but i couldnt see them appear
do the Brita's mods remove Smithing/Blacksmithing for anyone else? Like, the skill's just gone
wait, blacksmithing's just not a skill at all.... wtf?
I turned off all the mods except one that had been working fine
I even used Debug mode to see if I could add it somehow:
Dumb question, but do you have the blacksmithing mod?
Is ProfessionFramework (https://github.com/FWolfe/ProfessionFramework) Needeed to implement custom professions? Or I can do it without using it?
What it does is that it makes it significantly easier to implement profession stuff?
I used the examples from it's github as a guide for my own stuff using it.
https://github.com/FWolfe/ProfessionFramework
You do need to include this line in your code when using the workshop version of PF
ProfessionFramework.Traits.Hypercondriac2 = nil
I figured, I'm new to zomboid modding, and usually I like to make mods without extra dependencies, so if it makes implementing professions significantly easier then I will use it
Yeah, I hear you on that. PF is pretty solid and I use it personally; it saved me a lot of time and headaches when I switched over to it vs cooking up my own code from scratch?
Thank you for the information, I will give it a try
Okay so like for getting started with coding
What do I install and start writing code on?
The workshop version is this one right? https://steamcommunity.com/sharedfiles/filedetails/?id=2216760107&searchtext=profession+framework
Cause I noticed there are 2 version of it
Well, there's the original version, and the "patch" version. The patch version has the fix in it, but if you have the code ProfessionFramework.Traits.Hypercondriac2 = nil in your code you don't need the fix.
Aside from that the older version is the official version, that's about all I know about the difference between the two?
Okay thanks man 👍
👍
I dont know much about moddin so I thought id toss this in here real quick and see if anyone may know, apparently the current max plumbing height above sink is 1 floor, is there any way possible to change this or is it just stuck atm
How hard would it be to make a mod that adds in a bunch of little decorations , like toys and such?