#mod_development
1 messages · Page 215 of 1
getNormalTexture can be called on Item instance and getTex on InventoryItem instance. If I interpret your request correctly (spawning concerning only InventoryItem), you want to call ScriptManager.instance:getItem(itemName):getNormalTexture()
Hello everyone. I got a question. Does anybody know how to make an extra options menu for sandbox world or for a mod?
I want my mod to have some options (Like a slider to adjust the amount of certain elements that appear, Checkboxes to enable/disable functions, etc).
To give an Idea, I'm working on a mod that modifies a little the zombies adding some variation and I'm trying to give them some multipliers to shove distance, or increase the chance they fall, etc. etc. (and the chance that a zombie is different from the standard)
vanilla sandbox options are very limited. but I am pretty sure I saw a mod on the workshop once, add the kind of stuff you are looking for. I never tried it though.
Could be done through game options via mod options
When you right click a light switch, and choose "turn on" or "turn off" it uses the ISToggleLightAction timed action. If you left click the switch, it toggles it on/off, but I can not for the life of me find out where that happens.
If this happens in java.. I am going to cry
OMG.. always. Right after I post about it I find it
ISObjectClickHandler.doClickLightSwitch
is there an id list anywhere for the clothes? not the base.X ones i mean the id that is all random letters and numbers
The GUID ?
Why do you need a list of the GUID ?
oh, youre who helped me earlier, thx again
i checked the clothing.xml file, it has what i want but the ids are written in random letters and numbers, i need them in that base.x thingy idk how its called. since you wanna know about it ill tell you why i want them: im trying to put together an npc event using the pznc framework. im basically doing human counterparts for the zombie bandits and survivors you find in vanilla, and to make it faithfully i needed the code that sets up said random events and the outfits involved.
now i have the list, but it takes very long since to do it i have to open all the clothing files (+800 files) and ctrl+f for the right guid between other steps that really make it a slow process, so an hypothetical guid list would be very useful.
You could try to make a python script tbf
If you know how to code in python
Also the clothings are usually not called by the GUID but their names
Python is not too far from Lua so you could easily understand it
bro, i hate letting you down but i dont know shit about coding, not lua not python
rip
i said i was putting this together and that is a key word haha
To change the clothing of a zombie I use this:
zombie:dressInNamedOutfit("Boomer")
zombie:reloadOutfit()
With Boomer being my custom clothing name
cool, but i dont think that function will work on the npc, will it? (its a function right?
Depends if the framework is made to function like zombies
In terms of coding at least
nope, doesnt work
how do I do that but with zed outfit?
also can I change zombie behavior? such as making the zombie not be able to bite or scratch
You can
It's in fact not that hard to stop a zombie from attacking
oh I meant ZedDmg
how? I can't seem to find anything similar in the docs
First off: there's no documentation, just forget about this shit you'll have to learn 99% of it yourself or through others tips or mods
Secondly: animations sets
The status of an attack is defined by its animation, so you can basically make sure the attack animation doesn't launch and you'll be fine
Discovered about it when doing tests and learning how the animation system works
Here I replaced a bunch of animations, and I've set the lunge animation (if I remember) with the dance animations from True Dancing. This animation in the base game triggers when the zombie gets close, by putting its arms in front of him to reach for you
You can do so much shit that way it's amazing
You could technically make a zombie that sticks to your butt forever without ever killing you
I suggest you go check out LeaperZed and how they made the custom animations, I took everything from there
how do you see the code of a certain mod in the workshop?
It's the best example out there yet but I hope to bring my own example to the table soon with custom animations and possibly behaviors for The Last of Us Infected
Go look it up
I cant find the code of this mod
this is what im talking about
thats from leaper mod
If you have that clothing you cannot see it in your inventory but you can wear it to your character or a zombie
hmm ima try the code from the mod
this is because this is just the item script, it doesn't define the logic
what makes it so it's invisible in the inventory is that it lacks a display name tag
I've been trying to wear it to a zombie for hours
how do I get the outfitID of the zeddmg clothing I made?
what do you mean outfit ID
Im trying to use this:
dressInPersistentOutfitID
public void dressInPersistentOutfitID(int outfitID)
Specified by:
dressInPersistentOutfitID in interface ILuaGameCharacterClothing
Overrides:
dressInPersistentOutfitID in class IsoGameCharacter
because dressInNamedOutfit doesnt work
looks like you are putting the cart before the horse here
wdym
local inv = zombie:getInventory()
local equip = inv:AddItem(item);
print(tostring(zombie:getOutfitName()))
zombie:dressInNamedOutfit("InvisUtility")
print("WORN ITEM:")
print(tostring(zombie:getOutfitName()))
the last print is still the generic shirt
you are trying to do everything while understanding nothing
what do I need to understand?
Here I added the ZedDmg clothing into the zombie's inventory now I just need to wear it to the zombie
"items" with ZedDmg are technically not items, but an overlay
how do you wear that overlay?
here's a mod that does it
function Vamp.setZedVamp(zed)
if not zed then return end
if Vamp.isDay() and Vamp.isVampire(zed) then zed:dressInRandomOutfit() ; end
if Vamp.isNight() and not Vamp.isVampire(zed) then zed:dressInNamedOutfit("Vampire") ; end
zed:DoZombieInventory();
zed:resetModelNextFrame()
end
but it doesnt work for me, all it did is reset the zombie char model and naked
How did you define the outfit InvisUtility?
module PSZ {
imports { Base }
item InvisUtility
{
DisplayCategory = ZedDmg,
Type = Clothing,
ClothingItem = InvisUtility,
BodyLocation = ZedDmg,
WorldRender = FALSE,
}
}
That code refers to an outfit, not an individual clothing item
u mean this
you are trying to have your code call on an individual item and that won't work, that is why you are getting that error from the console
no
basically the clothing is just a small "cube" from blender, Im trying to make the zombie arms invisible
so I just needed the Masks
look at the vanilla clothing.xml file
this is what you need
the outfitManager shits?
if Vamp.isNight() and not Vamp.isVampire(zed) then zed:dressInNamedOutfit("Vampire")
OR
zombie:dressInNamedOutfit("InvisUtility")
calls upon outfits such as in that file. You need to define your own.
yes this is what you are missing
yes
the outfit needs its own unique one then your item's
you can also populate the outfit list with vanilla entries too
Ill just put clothing xml and edit it
do I need to specify the clothing.xml path somewhere?
just put it in \media\clothing in your mod directory and you are good
then Ill use this method?
local inv = zombie:getInventory()
local equip = inv:AddItem(item);
print(equip)
print(zombie:getOutfitName())
zombie:dressInNamedOutfit("InvisUtility")
zombie:DoZombieInventory()
zombie:resetModelNextFrame()
print("WORN ITEM:")
print(zombie:getOutfitName())
yes
still the same
thats the log
oh I didnt change clothing name in clothing.xml
hmm nice, getOutfitName prints InvisUtility now, but the masks doesnt work, arms still not invisible, zombie just changes model
Hi, new to the modding. I want to make a feature like land claim block in 7dtd.
For starter, if player place a campfire, it will set safehouse of NxN size for that player.
I already seen the SH api SafeHouse.addSafeHouse but still cant figure out how to detect event if "Player A place a campfire at XYZ"
Tried the Events.OnObjectAdded but that did not called when i placed the campfire.
Any brief direction/pointer is appreciated! Or if there any existing mod that does that, I will try to study code from it. Thank you!
look at media\lua\client\Camping\TimedActions\ISPlaceCampfireAction.lua
Hello everyone!
I would like to be able to create new commands for a mod and the first question would be, is this possible? If so, how do I create new commands?
Yes ? Basically you need to remove the DisplayName line from the clothing
Oh so, a lot of stuff is wrong but AuthenticPeach kind of said it all
One thing I will add: you do not need to add the clothing to the zombie inventory, nor can you because you can't access the inventory of zombies unless:
-they are dead
-they are reanimated players
Defining the outfit of the zombies the way I showed you requires the name of the outfit
zombie:dressInNamedOutfit("InvisUtility")
The name of the outfit is defined in this file
<m_Name>Vampire</m_Name>
InvisUtility needs to come from such a file with such a line of code for clothings for male and female zed
I think they're made in java but you might be able to make ones in lua, with this mod
https://steamcommunity.com/sharedfiles/filedetails/?id=2825060402
read the description of it
otherwise I don't know how java modding works but searching for "commands" in the game files shows a folder with these
how can I translate tile name from .tiles text file? I need to translate dismantle item`s name, that consides in .tiles text file
is it possible to use drawrect in scrolling list ? if yes how cause in ui i need to put it in prerender, if someone could write me an example it would be nice
looking for a way to spawn npcs (pzns) with the vanilla bandit outfit, anyone knows and can help?
Didn't I already explain to you how it's done on zombies ?
Else check the framework and it's documentation probably ?
Reason: Bad word usage
oh hello, i tried what u suggested but it didnt work
Check the documentation of the mod then
The NPC maybe have an inventory so they could be reanimated zombies and that means you can equip them clothing by putting it in their inventory
Does anyone know where I can find some documentation on how in-game chat/radio works? Im trying to create a discord bot to relay text radio messages to a channel
look in the source code of mods that send things in the chatbox
i think there was a player join message mod so look at that one's code
does anyone know how do I modify the properties of a vanilla item in a mod?
in this case I want to increase the range of remote controller in media/scripts/newitems.txt
again look into the source code of a mod that does the same
im trying to do that rn
it just seemed weird the way they did it, I'd rather have it done programatically
but i'll try to do the same way I just saw somewhere else
I'll start there, thanks!
does anyone know the location string names for primary hand and both hand for setAttachedItem? going crazy trying to force equipt items to player
nvm the list is in AttachedLocations.lua
and BodyLocations.lua
how can I translate tile name from .tiles text file? I need to translate dismantle item`s name, that consides in .tiles text file
Can someone point me in the right direction on how to get a vehicle in the game?
let me give you the cheap answer
look into the source code of a mod that does that
to find the installed ones in the game files its
SteamLibrary\steamapps\common\ProjectZomboid\steamapps\workshop\content
from there you'll see it
you can also go to steam, right click zomboid and game files bla bla
just google "how to find steam game files"
and this will lead you to the mods as you open the folders, you'll see
Is there anything in particular I need to do inside of a modeling engine to get the model to properly appear, or can i just take the files in those mods and rename all references to my vehicle's model without issue?
getOutfitName() returns InvisUtility, but the Masks does not work. The zombie's arms are supposed to be invisible
Maybe it's the attached bones the issue
but idk how that tag works
can I just change the player's current clothes masking?
hmm wait, even if i make a player wear a shirt from the game it doesnt wear it
the shirt isnt changing
but getOutfitName() returns the changed shirt
You make the player wear that ?
Hello I was wondering if anyone is able to do mod commissions. It likely wouldn't any time soon but we could negotiate on a price based on what can be done for making the mod.
You might want to share a few more details. Is it a map mod? A clothing mod? Vehicle mod?
technically im in need of multiple mods in the future
map, clothing, and weapons are the main ones
but i still need to save the money needed
I thought i figured this out yesterday but i didnt
I want to force equip a weapon to the player's hand(s) when they spawn, instead of just putting weapon in their inventory
setWornItem, setAttachedItem, and setUseHandWeapon all don't seem to be the correct way
Im pretty sure usually a timed action would be used, but i want the character to seem like they already have the weapon in hand
Hi everyone. I'm new to the discord and sorry for my bad English... I'd like to learn how to create mods. Do you have any guide to recommend to me to start taking the first steps?????
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
https://github.com/Konijima/PZ-Libraries
https://projectzomboid.com/modding/
https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md
Tool for generating Lua documentation for Project Zomboid events and hooks - demiurgeQuantified/PZEventDoc
Complete tutorial to decompile and use Intellisense for Project Zomboid modder. - GitHub - Konijima/PZ-Libraries: Complete tutorial to decompile and use Intellisense for Project Zomboid modder.
package index
thank you so much ☺️ now I have to start studying!
looks like this message shows exactly how to force equip weapons to the player 
#mod_development message
i have a question
so if i were to make custom tiles for my map
do i need to make a seperate mod or can it be included with the map as 1 mod?
also can you edit 1 map in a couple of people?
Not 100% sure if you can include it as one mod or not, but even if you can I'd avoid it.
If you make another mod and want to reuse all or some of those tiles you're then forcing the user to install the same tilepack multiple times, instead of just requiring they install the tilepack as a seperate mod
hey techies, really quickly. What's the market price for commissioning a small-middle size mod these days?
im just trying to make a map for me and my friends to play on and whenever i try to load up the editor i get the message "Failed to create config directory" anyway i can fix this?
A couple of ideas to throw in the abyss:
Something that randomizes the episodes of Cooking/Woodcraft/Survival so they don't play in the same order every game would be great.
Something that goes a step further and makes these episodes run up until power shuts off would be great for multiplayer.
I only looked for about 30 seconds to find an existing mod, appologies if it's been done.
it says it everytime i load in and immedietly kicks me out
Does anyone know what the float parameters of
BaseSoundManager.PlayWorldSound(String string, IsoGridSquare square, float float1, float float2, float float3, boolean boolean1)```
actually do?
String name, IsoGridSquare source, float pitchVar, float radius, float maxGain, boolean ignoreOutside
Thank you so much!
is there any way to decompile the java and retain the parameter names? Or is it just a guessing game until you figure it out?
seems like I've been using the wrong java docs then, thanks
Is there a way to grab all the tiles that are "outdoors" compared to inside? would someone have to go over the map and do a custom region or something like foraging or wut
Anyone know where the duct tape icon is stored? Can't seem to find it and I'd prefer to copy the icon instead of making my own at this moment
My solution was to copy the icon from a wiki page and rename it. Genius
i got a question
what should you make buildings like on a canted road
so im trying to recreate a city
ill post it in a second
the main road is very curved
and a lot of roads
any suggestions what i should do here?
i can make the road angled
but
theres these barriers here
i got a question when ever i save my cell bmp to tmx it doesnt add the grass and vegetation but when i click on the tmx file and try to drag it, it shows up but doesnt appear,
the first image is when i put it over it and then add it it dissapears
hey yall, i dont know alot about modding im making a traits mod, have i done anything wrong?
require('NPCs/MainCreationMethods'); --Required for adding traits
local function initEsk3rsTraits()
local Introvert = TraitFactory.addTrait("Introvert", "Introvert", 2, "Isolation and lonliness is nothing new to you. \n You can live through the apocalypse without human contact.", false);
end
--Add the traits
Events.OnGameBoot.Add(initEsk3rsTraits);```
Everything look alright to me, so should work correctly
great, also i was wondering if i can use traits from other mods in my mod?
How do you unset moddata? Will getmoddata() = {} works? I don't it works since getmoddata append or replace. Erm....
Depends what you want to do with it but yes you can make sure a player has a trait for example
Not sure if you can modify such trait if that's your plan without editing the original file
Most things other mods use can be used usually by just making sure you call for "require mod_file"
At first I thought this imported the functions of another mod in your mod but apparently it's not that and it just makes sure the file you called for require is loaded before yours to not break anything
You can also do something to "require" only if the other mod is present by adding a simple if check
well i want professions from my mod to have traits from another mod, can you please guide me on how to call for require mod file?
for professions idk
Is there a place I could ask about having someone make a mod/mod requests?
u want to commission a mod?
Yeah I found the modding discord just now
then you know where to go
you can clear tables by looping through them with pairs and setting all values to nil, but you shouldn't do this to moddata or you'll just break other mods and even some vanilla functionality and it'll be very difficult for users to diagnose
Trying to fix compatibility issue with tsarslib hauler code. It stores all the parts in the moddata then restores them. It naturally also stores the moddata of the parts in it. Setting the nil doesn't remove it, it just make it nil but I guess there's no other way than to check for nil or a unqiue text to ignore.
nil is 'removed', that's lua's empty value
But moddata is table. You just set b to nil, a still exist.
no, the key is removed when the value is set to nil
Anyone knows how I could have the highlighted line being a random selection? (Not sure I explain this right)
I'm trying to get my zombies to start random dances and maybe the original movement whenever they spot me
But I'm stuck with one dance per mod
duplicate the file (and change the names) make them all having a condition that you activate from a model random value
wdym ? You want different animations ?
In your case, since your condition is the walktype
Zombies tend to swap between the walktypes
Like sprint 1 2 3 4 5
They'll usually swap between these (at least in the case of walking I know it works like this)
So if you set multiple files that for every walktype with different animations
You can have some diversity
Maybe it was you who asked questions about animations and I explained a few things, but if you want custom animations for zombies you can also set a new condition variable
You can check LeaperZed code on how they do it
first im a noob at modding :p I was hoping that I could do some modification on the Groovy zombie mod (which switch most walking animation for dances from true action act 3 dancing) so far I can change the name of the dance in the highlited line on my picture (and in all the other movement files) to any other dance from true action 3 and it works. I can put different dances to sprint 1 to 5, slow walk 1 to 3 etc... starting to think this is gonna be too much for me :p
but thanks for the tips, ill have a look at leaperzed code
You probably don't need to go that far
I mean if you just wants zed to switch between different dances
thats all i want :p
honestly I tought i could stick all the dance names in the line with an , or ; but nope :p
Ok I need some help
I plan to edit the zombie textures
And make my own textures for the zombies
Because I love making zombie designs
Does anyone here know what I would use to edit the textures?
personally is use blender to render my texture as i make it
Hi, sorry to bother, while playing with a couple friends and doing some "pvp" a lot of us are bothered by the fact that guns and grenades are pretty much useless, shooting someone with a slingshot or throwing a grenade under him really makes no difference, so I was wondering is there a way that makes it so that when you receive too much damage too quickly you die instantly? I thought that to fix this all I had to do was to increase the damage of some weapons but it seems that they are still capped to the body part they hit, my experience with modding is really only limited to tweaking existing mods and trying to make some adjustments, so it is very limited
Hello! I am new to this server but not to pz, so I apologize if I am in the wrong place. I am looking to pay for a single armor creation. Is anyone interested in taking that on? I'd make it worthwhile.
I am a very busy person, please @ me so I don't miss any replies!
hey yall, i was wondering if its possible to change the location of where the sleepingbag model attaches to the bag from noir attachment mod?
Go with Blender
Probably yes
If he defined it himself and it's not something hard coded in the game, you can do it
HI! Experienced PZ modders, i have a question about some things. I'm trying to learn the ropes of modding, but i want to start with a fairly advanced project and concept. I want to implement a new type of vehicle, capable of moving omnidirectionally like the player does in aim mode. I'd like to implement animations and two drive modes. One mode would be like a traditional vehicle, driving and turning based on speed and player skills. The other would be much slower, and i'd like it to function similar to a turret or hovercraft/tank with fixed guns.
I have several years of experience with blender, game asset design, and some experience in game development. I honestly just need someone to act as a guide and show me the basics of where things go and what the PZ limitations are in terms of modding. I haven't been able to find a tutorial or wiki that presents any of the information i need in a way that adhd me can digest.
Really quick, if I am making a model script and want to use base game models/textures do I still need to use the import block?
no, files aren't part of a script module
if the thing you're referencing is a script object you need an import (or full type) but otherwise you don't
Thanks <3
does anyone have a good link regarding saving external config files for your mod?
Can anyone tell me where I can find the base code for the generator? How it works and such
What folder can I find it in?
@delicate leaf If you want to modify the generator, or create something similar to it, you would have to check out the more build for example, which allows you to craft it. https://github.com/ProjectSky/MoreBuilds/blob/main/media/lua/client/MoreBuildings/BuildsModule/Type_Survivas.lua#L136 in that file, you will be able to find a way to add it, although it calls for many other things, defined in other files. And then also, because that's not enough, also, if you want to change the properties, you have to review and work with this file. https://github.com/ProjectSky/MoreBuilds/blob/main/media/lua/server/BuildingObjects/ISGenerator.lua
Thank you, im thinking on doing a upgraded version of the generator as a mod
Go ahead then. At one point, I was going to create a custom generator, which could be started, powered and serviced, but not moved/lifted. In many servers, or games, you want to leave generators in community places, after the power goes out, and sometimes, people take them because they don't know that they are offered in that place or sometimes, even though you tell them, They take it anyway.
Exactly, im thinking on a idea like that
In order to achieve this, you will have to modify the last file that is passed to you, where the properties of the object as such will be established. Because the first file, alone, establishes the materials and the form that is added to the world. But if you add it, using the default generator, it can be lifted and disconnected. So it has to be a new entity.
Thanks
Here you can get some information about the classes and methods. https://projectzomboid.com/modding/zombie/package-tree.html
I'm not sure what you mean by the question. Do you want to create files such as a log?
how can i check?
like, config files. settings for the mod that can be saved or loaded on server start etc
i was just about to ask a similar question
is there any problem if i place/create text files in mod's media or lua folders with comments?
if you are trying to setup sandbox settings
make a text file "sandbox-options" in media
should also setup text file "Sandbox_EN" translations in shared/Translate/EN
sandbox-options:
VERSION = 1,
option ModName.exampleBooleanSetting
{
type = boolean, default = true,
page = ModName, translation = exampleBooleanSetting,
}
option ModName.exampleNumberSetting
{
type = double, min = 0.0, max = 100.0, default = 2.0,
page = ModName, translation = exampleNumberSetting,
}
Sandbox_EN:
Sandbox_EN = {
Sandbox_ModName = "Name of this mod in Sandbox Settings menu",
Sandbox_exampleBooleanSetting = "Name of the setting",
Sandbox_exampleBooleanSetting_tooltip = "This message shows when hovering over the text",
}
then to read the settings at runtime:
local myBooleanSetting = nil;
local function myModSettings()
myBooleanSetting = getSandboxOptions():getOptionByName("ModName.exampleBooleanSetting"):getValue();
end;
Events.OnInitGlobalModData.Add(myModSettings);
so 100% lua in shared is loaded before lua in client, right?
cause if so im writing some stuff wrong, it had seemed like client loaded first, everywhere online says shared is first tho
Hi I have a problem exporting my map mod, it seems that depending on the cells where it is exported, it works or not, for example in the 43x37 nothing is shown, but in the 32x24 cell, it does.
Another question, this more technical, I want to make a server to test things, I can upload my own map to the server, and go updating it without having to be restarting the map all the time? I know that you could restart cells to avoid having to start over again when there is a map update, but I do not know how or how it works, any idea?
if I have a container, how can I add an item to the container if I have the item name?
container.AddItem("HCMakeshiftaxe"); is what im looking at now
This should work. You can add the item amount like so:
container.AddItem("HCMakeshiftaxe", 2)
got it. didn't realize you have to transmit object to clients after adding items to it
why can't we use math in our mods? I always get errors.
For instance, typically I would do something like
math.floor(math.random() * #itemList)
we're supposed to use ZombRand instead?
okay, thx.
i'm getting a weird error... it's not letting me add two numbers together in the lua?
local random_index = ZombRand(#itemList)
local item = itemList[random_index + 1]
Error:
Exception thrown java.lang.RuntimeException: __add not defined for operands
does itemList definitely exist? and is this the exact code you're running? (you didn't remove lines for easier demonstration etc)
otherwise i'm lost because there isn't really any mistake in this code, i put it into a lua interpreter and it runs without error
the only reason i can see this failing is if itemList is not a table
Is itemlist returning a value that can be added?
local items = {}
local numberOfItems = 2
do
local i = 0
while i < numberOfItems do
local random_index = ZombRand(#itemList)
local item = itemList[random_index + 1]
items[#items + 1] = item
i = i + 1
end
end
return items
end
Nvm random index I'm silly 
is whatever's calling this function actually passing a second argument?
print(#itemList, " items in list")
local spawnedItems = getRandomItems(nil, itemList)
getting
"6 items in list" in my console
im transpiling from typescript...
But i'm directly looking at the lua right now obviously to find the issue. I'm not seeing anything wrong though
figured it out... it's a Pipewrench thing. Pipewrench uses the
ZombRand(double min, double max) variant of ZombRand...
I am trying to use the
ZombRand(double max)
variant.
PipeWrench.lua:
function Exports.ZombRand(arg1,arg2) return ZombRand(arg1,arg2) end
Does debug mode allow me to spawn in modded items?
Yes of course
thank you!
hey guys, im trying to upload a simple 1x1 cell custom map (doesnt even have any buildings yet) to the game that i made for testing reasons and ive managed to troubleshoot everything up to this point. im able to load the mod containing my map properly (img 1) and select it from my mods list, and even get the option to spawn into it upon starting a new save (img 2), but once the game actually tries to load me into my map the game crashes and i get this bug (img 3).
so i open console.txt and this is the error that i get (img 4):
>java.lang.RuntimeException: can't create player at x,y,z=11702,6896,0 because the square is null at IsoWorld.init line:2799.
this is odd because that square... shouldn't be "null" at all? im pretty sure i organized/created my map folders and files properly (img 5) but even upon deleting that spawn point and making a new one elsewhere it throws the same error, including at the same xyz coords (11702,6896,0), every time. i followed daddydirkiedirk's youtube series on making maps and i cannot see any steps that i missed.
how can i go about trying to solve this error? i don't even know where to begin. any help or advice is greatly appreciated!!!
So I've gotten as far as creating the script for the item and recipe, it's just a canned food, I can't get it to show up in debug item spawn and I'm not sure where I'm going wrong - if I add in the import {base} to the script, my game completely crashes
give us a look at your script there
/* canned foods */
item CannedTestOpen
{
DisplayName = Opened Canned Test,
DisplayCategory = Food,
Type = Food,
Weight = 0.8,
Icon = CannedCornedBeefOpen,
CannedFood = TRUE,
EatType = can,
EvolvedRecipe = Pizza:12;Burger:12;Omelette:8;Stew:12;Stir fry Griddle Pan:12;Stir fry:12;Sandwich:8;Sandwich Baguette:8;Salad:12;Roasted Vegetables:12;PastaPot:12;PastaPan:12;RicePot:12;RicePan:12,
/*EvolvedRecipeName = Canned Corned Beef,*/
EvolvedRecipeName = Corned Beef,
FoodType = Beef,
Packaged = TRUE,
ReplaceOnUse = TinCanEmpty,
DaysFresh = 2,
DaysTotallyRotten = 4,
HungerChange = -24,
Calories = 720,
Carbohydrates = 0,
Lipids = 48,
Proteins = 78,
StaticModel = CanOpen,
WorldStaticModel = CanOpenCornerBeef,
Tags = HasMetal,
}
item CannedTest
{
DisplayName = Canned Test,
DisplayCategory = Food,
Type = Food,
Weight = 0.8,
Icon = CannedCornedBeef,
CannedFood = TRUE,
CantEat = TRUE,
Packaged = TRUE,
Calories = 720,
Carbohydrates = 0,
Lipids = 48,
Proteins = 78,
StaticModel = CanClosed,
WorldStaticModel = CanClosedCornerBeef,
Tags = HasMetal,
}
recipe Open Canned Test
{
CannedTest,
Result:CannedTestOpen,
Time:60.0,
Category:Cooking,
OnGiveXP:Recipe.OnGiveXP.None,
}```
I've taken it straight from vanilla files (canned corn beef) and changed it to "test" because the previous code I wrote didn't show up in game either
i dunno if it's the main issue, but i'm pretty sure you need to wrap the module with braces
like
module jiizzy_test
{
-- scripts
}
so it'd be:
module jiizzy_test
{
item test
{
--details
}
}
that was it!
the key for formatting code is broken on my keyboard this is all you're gettin
excellent
easy mistake to make :)
I wasted hours last night trying to fix this, for it to just be a bracket, thank you so much!
it won't be the last time either lmao
we've all been there well too many times
no problem, best of luck with the mod
Haha I'm sure it won't be! Thank you! ☺️
how did you go about changing the spawn point?
silly question, you answered it in your post
also sorry for interrupting 😭
aha not at all it's what the chat is for
can you show us the code for your spawnpoints?
also you might check and see if there's a default spawn in your server options
i know nothing about map development but the co-ords being the same even after you changed them seems like a big clue
if you can figure out why i'd say you're golden
whats strange is that spawnpoints.lua lists the ACTUAL location that i placed the spawn point in worlded
also its not connected to a server im testing it out on a solo world
also also: i did regen lots after moving the spawn point, i know that can cause problems if u dont do it
does it work if you change the word 'profession' to 'unemployed'?
hmmmmmmmm let me try
WORKED TYSM 
Anyone know if/why the following wouldnt work?
require "recipecode"
function Recipe.GetItemTypes.Fertilizer(scriptItems)
addExistingItemType(scriptItems, "Fertilizer")
addExistingItemType(scriptItems, "CompostBag")
end
It is under the Lua/Server
I used gimp
It worked pretty well and my textures are working in game
I don't quite know how to use blender
Not the most user friendly program out there
Anyone have armband template?
not a bother :) best of luck with your map!
welcome back gamer
I thank thee
doubt anyone's made that so far, what dya need it for?
For my server, need to make faction armband
Sadly nobody made it so far, so I tried to make it in blender
But with 0 experience, it's too hard for me
I found one mod, but models are in xml
And again, I have no idea how to convert it
the bandana armband mod? the coloured armbands don't suit your server?
Sadly no, I need this one
that mod is about as close to a template as you're gonna get, if you want anything more you'll need to make it yourself or commission it from someone
Models in this mod are xml too, maybe you know how can I convert it or open in blender?
i don't, but you might have better luck asking in #modeling
i see you've asked there already but be a bit more specific
explain that you want to make an edit to an existing item and you might get a response
idk if the original author will be happy about ya adapting their work, however
mod idea: mod that adds the diy scrap gun used to assassinate shinzo abe
Co-existing wheat my beloved.
Of course they are working, but you can't see what you are drawing lmao
I actually can
load the game every once in awhile to check how it covers the model
Other than that I just use the in-game texture for the zombies and practically mutilate it
There are a few mods to use as a template
I'm specifically using the rabies retexture as a base
As they said they don't mind if you change it up
That way I don't have to completely remake a bunch of textures
And can see what I'm doing
Yes you can load the game but requires numerous reloads
While in blender it's in real time
Yeah I usually just do so after finishing a set
Or 2
I would use blender but I am awful at it
I might have a video tutorial with a part on how to load textures
Wouldn't I need the model itself
For the zombies
This video took too long to make, but I made it.
Yes there will be a part 2, no it won't be as long as this one... I think.
Official Project Zomboid Discord server: https://discord.gg/theindiestone
Official Project Zomboid website: https://projectzomboid.com/blog/
Kekdot's video for armature rigging: https://www.youtube.com/watch?v=hWfUe03Ib5E&...
There are a lot of models you ca use
I have an IK one (moving a limb moves every other)
Ok ok
This is what I need
Could I edit parts of the zombie model?
Or would it just stop working
I've seen people just use hats instead of doing that so I assume there's a problem with doing so
I only ask because I really want to remove the nose
addExistingItemType is a local function
not a global one
There's a download link to an IK model for blender with everything setup
The model, not really, but you can use tricks for custom models for zombies. It's what I did for my Bloater model
Thanks for this
You made that?
Damn
I definitely need to ask how at some point
I want to make my oculus luminous zombie in the game but would need
To make a new head entirely
Damn I love that, where's that from ?
Yup
Also your model would be fairly easy to do
Check out Occult zombies mod
I just made it up with a bunch of lore
I love making shit like this
I have a ton more as well
I reckon if I figure this out I could model and add my numerous zombies to the game over time
I love eyes so I love the design
You can take example on occult zombies on how to add different zombie models
I'll give it a look and try to figure out how they did it
I'm not the best with the coding side so I'll have to figure it out with this
Is there an easy way to get the IDs of all the items added by a mod? I need full IDs with the prefix such as filcher.cornseedbag
I did a python script to get every bodyLocations of every clothing added by thr game recently, you could do exactly that
Yours would be even easier as items added by mods with IDs are in a script file
And items are written as item ID
So you could just check the script file of the mod and get every ID for every item lines of it
Thanks
I figured it out I think, the prefix is determined by this
Many mods just call the module "base" so their items are base.itemname
Yes
Hi, do you how to trigger by luacommand a meta event, like screaming or gunshot ? Thanks !
I figured out how to make pages maps - is this something that would benefit from being an API?
At the very least you could have maps have backs
At most you could make books or pamphlets
Symbols are also saved per page
you mean like little standalone maps that are separate from the worldmap?
theres a lot of RP potential there
Definitely
I'm certain this shit would be used in so many things
Yes, the paper maps
Works with map related mods like draw on maps too
definitely would be useful to the RP community
Or well did before I messed with the UI
and i'm sure people will figure out how to leverage the API if its there
I think they're doing something similar with vanilla objects - but probably not going to use maps to do so.
Curious what that will look like
what weapon stat changes how many enemies can be targetted/hit per shot? (like a shotgun)
i got a weapon here that's behaving weirdly, it's targetting/hitting 2 people per shot even though it's not a shotgun
is there a chance it's a stopping power instead? havent looked at guns
id say try to check into vanilla shotgun code maybe
projectile count says it's 1
list of events:
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
i may be wrong, but i think meta events are NPC events
OnMultiTriggerNPCEvent
OnTriggerNPCEvent
could try searching for those in vanilla code
Tool for generating Lua documentation for Project Zomboid events and hooks - demiurgeQuantified/PZEventDoc
Thx you so much cerb !!!
any clue what this stat is?
It counts Pierce effect as 2nd target i belive
ah
So you can hit 2 zombies with one bullet. If you were to make it max hit 1 target it would not have pierce effect
that fixes it
I think shotgun has 6 "projectiles" but max hit count is 4
Where is that stat from?
a weapon file i found
Modded?
yeap
Then its probably related to that mod only
Growing crops from 3 separate sources (Vanilla, SoulFilcher, and LGR) all next to each other in harmony.
when trying to store external config files for my mod... sandbox-options is a possibility, but it's still too hardcoded for my use case.
Ideally, I would like to save and load .json files to store my mod's configuration settings. Is this possible? Do I use BufferedWriter?
how do we get the workshop mod directly and how do we get the FileWriter? Is that LuaFileWriter?
I was able to use this on client to save files:
export const saveArena = () => {
const fname = "arena1.json";
const fileWriter = getFileWriter(fname, true, false);
fileWriter.write("arena test");
fileWriter.close();
}
I'm trying to accomplish this server-side though if possible. The server is not saving files. Does anyone know if it's possible to make this work on server side mod?
Thanks as always, friend 💕
How do I go about comissioning someone to make a mod?
Im trying to get the difference in time between two dates in terms of years, months, days, hours, and seconds. Is there a lua function that can do this for me or do I have to individually calculate each different measurement of time?
I need the measurements to be a string too
🍋🪴?
I'm looking at this method:
IsoGameCharacter.Hit (HandWeapon weapon, IsoGameCharacter wielder, float damageSplit, boolean bIgnoreDamage, float modDelta)
Can anyone explain to me what damageSplit and modDelta are? Been fiddling around with them but am struggling to decipher what they do exactly
Is there anyway to turn a table element into an integer or a string
After working with the textures for awhile my retexture should be on the workshop now
Was very fun to do I hope people enjoy
Anyone worked with UI elements know why ISMap doesn't call render every tick? atleast seemingly?
Ok ok
Seems my mod isn't going to the workshop
Does anyone have a guide for uploading retexture mods?
hey, i got a question, is it easier to make mods for PZ then it its for Dayz?
depends on the mod
map making seems easier, probably less of a ball ache to make assets too due to low poly and low res
compared to texturing a new gun or whatever in dayz, the detail can be much less
can anyone tell me how I'm supposed to set up umbrella with beautiful-java? I want to start reading the game code where I can actually see the the variable and function names. Instructions were unclear and didn't work. Please @ me.
Yeah I used that, but I want to see the variable and function names too using umbrella but I don't know how to combine the two. As far as I know it just contains the typing and is not ment to be used -instead- of beautiful Java but I could be wrong, is one of the reasons I'm asking
I can't speak to beautiful-java because I decompile using a different tool, but I will say I don't know of a current way to merge the two. I usually just have a folder with the decompiled code open in another window for reference if necessary
I'm a little lost, I'm pretty new to working on mods to this depth, trying to make a modification for Anthro Survivors, I've checked my setup against similar mods that work in solo and multiplayer and my mod works in single player, but is posting an error when I try to run my server, testing from a fresh server. It's saying something in the logs about "Missing femaleClothing on species" but I don't have anything in my mod for having a female option, and another mod works without the female option just fine. I'm not sure what I'm missing.
Well I fixed that error, but now it's just doing this, I can't figure out what's wrong as it doesn't seem to actually be providing an error.
Just realised there is a coop console log, getting the following error.
is your mod private?
the server needs to download the mod anonymously, so if it's private it can't download it
it's better to just not go through the workshop at all for initial testing, but you can set it to unlisted to get around this
How do i make a zombie go to an arbitrary x, y position? I can see zombies have a setTarget method, but it accepts an IsoMovingObject. How can i make the target just a location, something that doesn't move?
For context, i want the zombie to go to the last location the player was
I thought this might be the issue so I switched it to public, but it's still having the same issue
Seems my mod isn't going to the workshop
Does anyone have a guide for uploading retexture mods?
I verified my cache and everything is working now, thanks for the help anyway though :3
where is the soundtrack located? I found the old versions of PZ's OST in the media directory but they're obviously unused now.
thank you!
I guess is not possible to make zombies completely blind? I want to make zombies that only reacts to sound
Is it fairly regular that people commission mods for pz?
its not uncommon, so i'd say yes
Where would I find them
I'll send the commissions server invite link in DMs since I can't post the link here
Are table elements considered integers or strings?
I'm a little confused how it is explained on the lua book
keys and values can be pretty much anything in lua
anyone know what is the best way to disable or modify recipes of another mod? and also to modify lua functions from another mod?
I am using a bunch of mods for my singleplayer play through that I think works very well together, except that they have some duplicate recipes and a few conflicting functionalities. So I want to just disable recipes and do some slight tweaks so that they complement each other well.
Greetings all, are there currently mods available OR does modding provide a way to extend admin commands (and by extension RCON commands) to do things like spawn zombies or items at coordinates for example?
Reason: Bad word usage
Is there a way that i could send a file from the client to the server? Like a image file, maybe converting it to base64 string... is there any method avalible on lua side to do that?
Does anyone know if the loot actions are in lua or java code?
I want to convert the looting action into a passive skill, and increase the looting speed of items
Yeah, got it... but what im trying to achiev its realy read a file image on client side, and send this file, or its data to server side, so the server can save it too. For anticheat purpuse, like the client send to the server a screenshot
Hi so im kind new to coding and modding. I was hoping to ask question about pz modding.
Cause when I took a look in to the game and mod files I kind got stuck try to find the in game Variables to sort out how to build code for the mods
I had the idea of add exp to some action in pz. Examples clean clothing, take pills, and remove negative moodles to give u exp for medical
Gonna try
Check out mods that seem to give xp to actions and check out how they do that
do u by chance mod?
To give xp for washing clothes you should look in lua\client\TimedActions\ISWashClothing.lua and see how to extend those functions. As for Take Pills it's the same, in lua\client\TimedActions\ISTakePillAction.lua
👌
let me know if you need help
id love some help with it. im try to work on it when i have some time
adding xp should work by this command
player:getXp():AddXP(Perks.Doctor, 20)
This will add 20 XP to first aid. You may also want to search the vanilla client folder for the string "AddXP" to see some further examples of how this command is properly used.
does anyone have a mod reccomendation that makes good use of Dialog menus with buttons etc. etc.?
Or, does anyone have an example on how to build a dialog gui?
wdym with "Dialog menus" ?
i guess they're called windows?
currently playing with ISCollapsableWindow
const createMenu = () => {
const window = new ISCollapsableWindow(0, 0, 300, 300);
window.title = "Hunger Games";
window.initialise();
window.addToUIManager();
}
just trying to figure out how to hydrate it with contents 🙂
Is there something we can use that is similar to HTML's <select> element? Some sort of multiselect we can use with the UI builders?
Couldn't tell you whether it's already set up for multiselect, but I've used ISScrollingListBox to create a single select menu before. Worst case you can extend it to support that, if it doesn't already
Reason: Bad word usage
Also re. dialogs above, there are elements like ISModalDialog
i've been making a little progress with it... thanks 🙂
Hi everyone!
Anyone know of an easy tutorial that just shows how to set the mod up to just override original textures with custom made ones?
i've followed the 'clothing tutorial' but it goes way more in depth than I need. Hoping to just override some Textures is all
nvm I may have found the proper way just tinkering myself. If there isn't one out there maybe I will make it for others who may want the same thing
thanks, that works. What about for overriding lua functions? do you know anything about that? Like for example I wanted to add an additional if condition. How do I reference the lua function from another mod
does anyone know how to align muzzle flash?
i keep changing the 3 values but I just keep making it worse
Anyone know how I can make a valid DoTooltip call on an existing item? I don't want to override it, I just want new item values to be reflected accurately in the tooltip.
As in, I've edited the insulation value of an item of clothing, and I'd like the tooltip to reflect the new value.
I found I could do it by editing the scriptItem directly, but that affects every instance of the item rather than the specific inventoryItem
hmm i think i'm too stupid lmfao. The function in question is being added to Events.OnFillWorldObjectContextMenu.Add(Object.function_name)
I even tried to just do Events.OnFillWorldObjectContextMenu.Remove(Object.function_name) and it doesn't do anything.
The file is in lua\client\file_name.lua and i am importing it by require("file_name")
my file is also in lua\client\
what am i doing wrong
Hello, anyone knows How to enable debug mode in project zomboid steam?
no, you will need to remove the original and re-add it after overwriting
when you 'overwrite' a function, you actually just change what function that variable points to, the original function isn't actually changed - usually it's the same thing, but since the original function has been added to the event, that's the one it will call
In case you want to overwrite textures for clothing, here is a way that should work:
As an example, overwrite the texture for the clothing item called "Skinny Leather Trousers".
Step 1: Get your texture ready as .png file and name it TrousersMesh_Leather.png (same name as the vanilla texture)
Step 2: In your mod, create the folder media/textures/Clothes/Trousers_Mesh
Step 3: put your texture TrousersMesh_Leather.png in the folder you created in Step 3.
That should do it.
In case you'd like to overwrite other textures, make sure to give them the same name as the vanilla texture. The vanilla textures can be found in the vanilla directory media/textures/Clothes. You may also have to change the folder name from Step 2. For example, when you would like to replace texture for underwear, it should go into a folder called "Underwear" instead of "Trousers_Mesh". In general you just have to mimic the vanilla folder structure here. The folder structure can also be checked at the vanilla location media/textures/Clothes.
Yeah I have and it didn't do anything lol.
Not sure what your mod is but im just asking for in general. For now I am just changing the actual file of the local copy of the mod lmao. Couldn't figure out how to override it separately.
But thanks tho.
Reason: Bad word usage
Does the game supports custom sounds at the moment? To be exact, custom vehicle sounds - engine sounds, doors, etc.
Hello There, I have a (supposedly) splitscreen compatible version of MoodleFramework cooking and need SPLITSCREEN TESTERS to validate the evolution (basic non-regression done). If you have the time to spare and are used to split screen, please test the mods of this workshop item: https://steamcommunity.com/sharedfiles/filedetails/?id=3154632356 (I expect the link to be valid for everyone as it is an unlisted workshop item)
hey, anyway to detect zombies near the player eg. 10 tiles etc?
is there a system for balancing the muzzle flash?
i have spend hours in total making little changes trying to align it
You know you can do that ingame?
wha
enable debug mode
And it will actually save on that txt file
let me show you, gotta launch game first
currently crying at this information
I belive its called attachment editor
skkkhhjfskhfhjk
Depending on your gun model, rotation and scale it might vary
i have been doing this by hand for DAYS

how can i reload lua?
There is reload lua in main menu
weird, I can align it in the model but it doesn't add up
So question. When comes to mod. What's the best way to learn the basics? I find that my coding class only deal with coding theory but not so much practice
usually i look at a mod i wanna make, try to find something similar and try to reverse engineer what they did
Exactly
Mmm? Any example piece u have u can share
Hello. I'm trying to make a mod where the character, after performing a recipe should say something if he has an item with a certain itemsTag in the inventory, and say something different if the item is not there.
What i have so far doesn't work, and since i'm a LUA noob, i don't know why. Could someone help me there?
Its your custom model?
nope i am using cjs
Cjs?
So you have not seen this model in blender, right?
My quess is it has diffrent rotation in blender that probably was not applied
Without fixing it in blender, nothing
Making first firearm mod in pz is half the battle, other half is to make attachemts work and appear where they should be, both when equiped and when placed on the ground (on player model they might look good, but once you place it on ground it might cause for example scope to appear in diffrent place)
But once you have first working firearm model and see how it should be placed in blender, with what scale/rotation and location its all easy, unless you go for pistols.
Sorry, you can still semi fix it with playing with attachment editor, just move it in diffrent locations,
And axis
But thats more of a work around
yeah it took forever
but i trial and errored it
at least with the debug menu it was 100x faster
But now if you had what i mentioned above: scale, size and rotation, it would match attachment editor 1 to 1
you don't need to define player, that arg is passed down via oncreate.
you want to use player:getInventory():containsTagRecurse("EmptyPetrol") to scan your player inventory/bags for any item that is tagged with EmptyPetrol
@fleet bridge Thank you very much. Saved me further time and stress. I appreaciate it.
I think the empty petrol tag check is broken
Oh, if they're using the tag recurse it should be fine
Thank you for the info, good to know. But the "EmptyPetrol"-Tag was just an example, i'm using other Tags.
I just released a simple mod to allow players to choose how long they'd like to smoke for, instead of being locked into a single option of too short or too long: https://steamcommunity.com/sharedfiles/filedetails/?id=3154853514
is there a profession template?
Does anyone know what the tag would be for a tile used as a roof? Or any other way to identify this?
like one of these, maybe
i'm trying to find out if a player has a solid tile above them, but gridSquare:isSolid() doesn't seem to work
You just want to check if the player has a roof above his head ? Whatever the tile is ?
Or just specific tiles ?
I'd like to be able to detect 'solid' tiles, in a sense
I can find if a floor tile is above the player, but non-walkable roof tiles like those above won't be detected
and if I just take any tile then transparent tiles and 'non-solid' tiles like overhead cables and stuff will block weather
there's a list of tags for gridSquares https://projectzomboid.com/modding/zombie/iso/SpriteDetails/IsoFlagType.html
declaration: package: zombie.iso.SpriteDetails, enum: IsoFlagType
but none of them jump out to me as appropriate for what i'm going for
essentially, yeah, whatever would pass the common understanding of a 'roof'
ugghh
i think i've solved it, our lovely mappers pointed out to me that isSolid() returns true if the tile 'blocks movement and sight'
using isSolidFloor() works for detecting solid tiles
someone please :breakdance: react i'm not allowed
Could anyone help me real quick, I want to make a mod that replaces every zombie's appearance with one outfit set, but i have zero clue how i'd do that
mod idea that i think would be simple to create that i might work on as my first actual mod project:
a mod that removes those ugly visible patches from mended/tailored clothing when the player has a high enough tailoring level (this would really have no practical use outside of rp but it would mean that in an rp server you can bring tattered clothing to a high-enough lvl tailorer and they would be able to fix it to look brand new)
i have looked to see if this mod already exists but i havent found it 🤔
Sounds pretty good do you know how to code in lua?
very very very very very basic knowledge
like. ive opened the roblox level editor a few times kind of knowledge
but lua is known for being easy to learn right? this should be a simple enough beginners project
You should check the workshop before starting. Some things might sound easy, but anything that is hard coded requires full overwrite. If it's hard coded in java then you need to make a java overwrite or create a new system.
hacky solution could look something like this
you wouldn't use onZombieDead
idk why i wrote that
but a similar event
There's been more than a few mods dealing with clothing patches.
ooh.
can it set stuff like facial hair, hair, gender
i don't see why not, but gender might be a little more involved
Because my idea is just making a mod called "Lambdapocalypse" and it makes all the zombies look like this (abeit without the player's skin, just using the zombie skin)
If player's skin is possible that would be really fucking funny
lmao i'm pretty sure you could use the entire skin but it's beyond my ability rn
in fact i'm certain you could, since other people have made custom zombie skins
I probably could because the skin's texture is easy to access
doesn't this already happen at tailoring 10?
S tier thumbnail
awesome!!!
thank u!!!
no prob bub
going to download this mod so i can dissect it and learn how it works first and foremost
exactly the best way to learn
i just have it enabled at all times because good god patches look ugly
i like how ugly they look, closest i'm gonna get to battle scars lmao
i want my pristine medical coat
is it considered bad form to upload an edit of someone else's mod
bc this mod is what i want but i also want it to be tied to the player's tailoring level
probably, but you can ask the mod creator
if you literally just edit a line and reupload it then yea, maybe a bit cheeky. but learning how to do it and recreating it is usually fine
sometimes there's only one way to do something elegantly
invisible clothing patches in reality just seems to make the texture for the patches invisible (duh) therefore making the area under the patch visible, and there's no holes there
i doubt the mod even has like any coding involved
anyone remember the proper syntax for searching an array?
i feel like i knew it at one point but i'm pulling a blank
sure there was a helper method somewhere
along the lines of this
if it's an array, yeah, that's it
if you mean a table, there is none
loop through it until you find the element or if it fits your purposes use a lookup table instead
i was worried that'd be the case, i dunno why i thought i'd done it before
thanks albion
Reason: Bad word usage
Reason: Bad word usage
Can I use IntelliJ for free? Or is it just 30-day trial?
Awesome, I'll learn how to mod this game when I have time.
I already have a mod in mind.
What you thinking of doing out of curiosity?
Nested Containers but with the option to turn off the ones in your character's inventory. Just imagine looting a bunch of garbage bags lmao
I just want it for when inside other containers or trunks.
Nice, sounds like a plan! I always used ExtraSauce Sac for container shortcuts, but you turn those on manually rather than off manually. Good idea though. Might work as a patch if you require the original.
I still have no idea how modding in this game works xd
I'll begin learning tomorrow since I won't be working for almost 2 weeks.
-
Read Zomboid game files (usually the Lua ones) in ProjectZomboid.
-
Figure out where you want to do things in the flow of the game and figure out what file manages that moment.
-
Change the file that manages the moment you want to mod by creating new functions, decorating old ones, hooking events, etc.
A mod like yours would mostly be written in Lua.
There is a Zomboid modding wiki and there are many freesources for learning Lua online.
Good luck!
I already have years of experience with programming especially Python so Lua is pretty much not a problem.
Also watching a tutorial video might help
I already checked the wiki and didn't find anything that helpful.
Apart from decompiling and other stuff.
Also mentally prepare for indexed arrays to go from 1 to size instead of 0 to size - 1; most tables in Lua are going to work that way
I'm already familiar with that.
Right on you'll be fine
as in, the first element in an array would be like "Array.Element[1]?"
Yes
first time for everything I guess lol
I made this awhile ago to help people, but many would recommend you localize modules and return them... I started doing that more after I wrote this tutorial. https://steamcommunity.com/sharedfiles/filedetails/?id=2929985581
Or you can just do:
array = {
[0] = "first",
[1] = "second"
}
```xD
That would be the dumb way imo
No offense
Lol
Because Lua explicitly gives you access to array sizes based on last index
So you would force yourself to do #luaTable + 1 for its size every time
Just because you didn't want to mentally adjust
#luaTable is size of a table in Lua and works by grabbing last numbered index
If you're indexing 0 to size - 1, # would give you wrong size.
Complicating the process instead of learning the language is not what I would recommend. 😉 😉
I for one welcome our new indexing overlords
An indexed Lua loop through a table usually goes
stuff(index)
end
You would have to complicate that style to change how you index
To each their own
Haha I just adjust to the context I'm in... Lua is not an overlord to me 😂
Unless its a java array then you have to start at 0
But I also like it sometimes
Yes, if you're accessing Java ArrayLists via Lua they work as they do in Java
But of course then they have a size() function that accounts for this
Most programming languages are zero-indexed, the creator of Lua is special.
I am also trained on 0-indexing but I have developed a soft spot for Lua indexing after writing many mods that rely on it
It's not bad, just (unnecessarily) different
E..g modulo looping goes nextIndex = index % size + 1 instead of nextIndex = (index + 1) % size. The adjustments tend to be trivial like that.
You get used to it
If you try
Java and Python were my first languages so I do relate to starting out more comfortable with 0 indexing.
Also, if you index your Lua tables from 0, you'll be likelier to end up with a mod that uses 2 different indexing styles for Lua tables (because all the vanilla Zomboid Lua tables and most mod Lua tables will be indexed from 1), so your code will be a bit more convoluted than it needs to be if you try to reject the standard.
You'd loop 0 - #exampleTable through your Lua tables and 1 - #exampleTable through almost everyone else's, and that would feel pretty weird to me.
And your table's sizes would all be #exampleTable + 1 while everyone else's were #exampleTable
But if that sort of unnecessary complexity is fun for you, I obviously can't stop you. 😜
To me that's like capitalizing some local simple data variables and not others. I would never.
Are there any events fired "before" a player dies? I want to prevent the player from dying.
I was able to prevent death in certain situations with a function that works when the character takes damage and checks the character's health. In cases such as falling from a height or receiving very high instant damage, the character still dies. Do you have any suggestions to prevent these as well?
put the player in god mode ?
tho that would heal everything else too
Like setting every stats to max
(food, water, stress etc)
you can set invincible
but there is no event that fires right before a player dies, onplayerdeath is triggered by the player death
No, what I mean is, I'm making a fainting mode for multiplayer. When the character takes a certain amount of damage, I make him faint and have another player Ress him if possible. Currently, if the character falls below 20% health, he faints. However, in some cases, the character dies directly instead of fainting. Such as falling from a very high place or taking high instant damage. Apart from this, cold weather also reduces the character's health to 1 and the OnPlayerGetDamage Event is not triggered for damage caused by this. Since it cannot be triggered in the situations I mentioned, the character still dies.
in these cases, is there an event that runs just before death to save the character, or is there anyone who can suggest a different method?
the server sends the death information to the client
maybe try asking on the PZ modding discord
Hello,
Is there any way of modifying vehicle physics so that speed and acceleration no longer depend on weight?
I don't know about removing weight dependency per se but Soul Filcher (who works for the company behind Project Zomboid now) published this:
https://steamcommunity.com/sharedfiles/filedetails/?id=1430463738
... I'm not sure but it looks like you can easily use that mod to make your own mod that edits vehicle mass (which I presume logically corresponds directly to weight)
I suppose if you edited all the vehicles on your server to have the same mass, then, in theory... Weight would no longer be a factor in acceleration or top speed.
Or more precisely it would be the exact same factor in every vehicle, so, not a differentiating factor.
I Want try to edit function who define de speed
i'd just use the scriptmanager
vehicle tweaker's very similar to item tweaker in that it just wraps the scriptmanager
Fair. Do you happen to know if speed is one of the values it can tweak?
that's not something i specifically looked at when i was doing my vehicle stuff but you should be able to do anything that's defined in the vehicle script, i'd be surprised if speed isn't
DND GameNight Add-On released: https://steamcommunity.com/sharedfiles/filedetails/?id=3155647614
Also for the modders: https://steamcommunity.com/sharedfiles/filedetails/?id=3155647374
roleplaying game within a roleplaying game
Would anyone like to share with me the line of code to place on a container for limiting the item to 1?
Hello, I have decompiled the code using beautiful-java, how would I begin writing my first mod?
It depends on what kind of mod you want to write. For example, here you have a code that what it does is create a list of items, with a certain quantity and is associated with a number. Then, every time a zombie dies, internally, a die is rolled, and if that number matches the number established on the list, the prize is given to the player. https://github.com/pangolp/itemsAwards. https://steamcommunity.com/sharedfiles/filedetails/?id=2911373802
The structure is more or less the same generally, at least the folder, the files can be several. Here are some files, because in turn, they are uploaded to a github repository, but not all of them are necessary, as is the case of README.md for example.
ItemsAwards
|-- Contents
| `-- mods
| `-- ItemsAwards
| |-- media
| | `-- lua
| | |-- client
| | | `-- awards.lua
| | `-- shared
| | `-- Translate
| | `-- ES
| | `-- IG_UI_ES.txt
| `-- mod.info
|-- README.md
|-- preview.png
`-- workshop.txt
9 directories, 6 files
The workshop.txt file is created when you publish the mod.
And at the beginning, you can have translations or not.
In my case, I added the Spanish translations.
I don't know the functions, methods, and classes defined so I don't know how to code my own xd
Are there any references out there?
Or do I just have to go through the decompiled Lua codes?
Well, I know some of them, but not all of them.
The first thing you have to identify is the event.
And then, based on that, you see the rest.
https://pzwiki.net/wiki/Lua_Events
I see, Events should be easy, what about methods and other stuff?
Like, how would I access the player's inventory and know what items they have?
In the case of the code that I gave you above, I used this event https://pzwiki.net/wiki/Lua_Events/OnZombieDead, which is triggered every time a zombie dies at the hands of a player, or at least I think so.
They're all probably self-explanatory.
Within the player, you have some methods, which allow you to see the inventory. You can check out some mods that work with it or the game code itself as well.
Where?
For example, this mod, at this line https://github.com/ProjectSky/MoreBuilds/blob/main/media/lua/client/MoreBuildings/MoreBuilds_Main.lua#L154 accesses the player's inventory and if I remember correctly, check if you have the necessary materials or tools. It is a mod for constructions.
I have not decompiled the code.
Maybe I should do it.
But for now, I've done a few basic things.
I don't have the knowledge for very advanced things.
I am progressing little by little.
Do you have any linting / auto-complete for the code?
Here you can also obtain information.
https://projectzomboid.com/modding/zombie/Lua/package-summary.html
No, there is some other project floating around I think. I tried it once, but I don't think it was finished. I can't help you with that.
Not speaking much English, and having to use a translator, makes reading and researching a little more difficult for me. So possibly, that will be easier for you.
can someone tell me how to make a lua script print to the debug console?
print(“my text”)
@cosmic ermine Do not put the arms down. I kept trying.
It won't come out at first.
Try to look for a mod, in the workshop, that does something similar to what you are looking to do, and in that way, study the code to see how they do it.
I learned to mod another game before by myself but that also comes with a bit of help from other modders. That game doesn't have a single how-to-mod tutorial yet I learned it, I just don't have time right now and apparently not passionate enough to learn even with the lack of resources.
I'll see again tomorrow.
How do you view a mod's source code?
I don't have any more help than I gave you. I think that in the forum, there are some tutorials and documentation, but it escalates my level of research.
In their respective workshop folders
When you download it from the workshop, you go to the folder, and you have the source code. Because they are generally lua files, they are not compiled.
Need to find the workshop id but it’s usually in the steam page for that mod
So it's in steamapps?
Yep
Let me see. I thought it was in User/Zomboid, my bad.
Steamapps/workshop/108600
SteamLibrary\steamapps\workshop\content\108600
Got it, thanks.
No, in that folder, the most personal information about the games and some other things are saved, such as the mods that you create and upload. But the downloads are found in the other folder that we mentioned.
Since there is no channel in Spanish, I have unfortunately not been able to get in touch with other Spanish-speaking mod creators, and unfortunately, I have made progress in some aspects, but in others I cannot advance.
Reason: Bad word usage
How do I make my mod have dependencies on another mod?
For example, I want to make that the players that play my map, have to download the britta armor, how do I make that when they download my map, they have to download the britta armor, and at the same time when they select it in the mods tab, it asks them to activate the britta armor (or install it automatically)? I don't know if I'm making myself clear.
Workshop?
In the steam workshop, what should I put, or if it is done automatically.
You can add it as a dependency in the steam workshop site but youd have to do it manually
Also you need mod.info id and not the workshop id i missspoke sorry
The ID of a mod is the requirement of another mod. Example
#More Traits/mod.info
name=More Traits
poster=generic.png
versionMin=41.0
description= Adds additional traits to the game to offer more balanced variety for character creation.
id=ToadTraits
Authors=HypnoToadTrance, Fajdek
icon=icon.png
# More Traits - Disable Prepared Traits/mod.info
name=More Traits - Disable Prepared Traits
poster=generic.png
versionMin=41.0
description= If this submod is enabled, Prepared traits will be disabled.
id=ToadTraitsDisablePrepared
icon=icon.png
require=ToadTraits
Perfect, thank you very much, much easier this way, since I will be able to make other users use other complementary mods.
Correct.
Is there a resource where I can find everything logged about the project zomboid connection protocol, I don't wanna spend days capturing packets and analyzing them... :|
The truth is that I have no idea about that topic. Do you have a more concrete example of what you want to do? Let's see if with this, I can understand better. Or if you were already clear enough, then my knowledge cannot help you at the moment.
-
Looking to write my own implementation for the RCON in Kotlin and I wanna know the format of the headers and what information I should need to pass through to establish the required information, is there anywhere a detailed guide where I have all that relevant information present?
-
For a packet validation tool just for laughs
I like how you're thinking.
Can we get a sticky/locked channel with some (UP TO DATE !!!) resources on modding? I spent some time yesterday following the wiki, the github, some guys from discord, and couldn't get it to work with any JDK I tried. Searching through discord, I immediately find a convo from yesterday here. The info is there, just not formatted. Reading backwards through huge discord chats is even more annoying than reading outdated documentation 😦
Just looking to decompile (java) right now. Then I'll spend some time reading and getting to know the codebase
Ehh... I wanted to actually not bother with deobfuscating the entire codebase to make sense so feel free to do all the heavy lifting for us lazy people :P
🙏🏿
wait deobfuscating??? I expected it to be readable and include symbols xd
I would assume it's obfuscated no way they left the entire code unobfuscated when shipping, have a look and let me know, just a hunch from previous experiences
I don't know that topic.
now it makes sense why they call java "unmoddable" xD
I read their license, and it really made me believe that they tried to make it easy for people
Might be, have a look, just a hunch from previous experience, let me know though, I'm curious
Ok. WIll do 🙂
My brain is already molten today, so maybe I should procrastinate untill tomorrow... I think I should be okay. Mostly doing C# currently, but the first code I ever read and wrote was Java
and that was 13 years ago
Maybe it already exists ? But I want to start by making some API for external services to communicate with the game server. Auto check workshop updates and shedule restarts would be the first thing I'd look into
Eh, that should be fairly straightforward with the Steam API already... half your work is done then reschedule to run updates with a cron...
yes. someone else already did it. I just want to check and make sure that the in-game message is also displayed correctly for those kind of restarts. I am a total noob to this game and have no idea yet.
the server I'm playing on now does sheduled restarts, but no auto restarts for mod updates. And when the admin force restarts (to update) there's no in game message pop up for the players
I don't think there is any popup you can actually employ
To be honest... I know there is a workaround
You can exploit the fact that there exists the "welcome message" message which is broadcast to connected clients
the scheduled restarts display a message in red text on the server. "Restart in 2 hours".. 1 hour.. 30 min.. 20 min etc
So you can probably malform this in a way to appear like a message :P
oh, that's curious
aah might be that yes xD
I sent the discord of the server in pm
blegh...
no clue what mod it is. too noob. Admin is currently afk. maybe you can figure it out with the mod list
?
i don't like clicking things
Oh xD
thanks anyway though :)
I'm gonna click through the mod list myself then
The MOD side of things should work as intended LUA is powerful enough, but something low level makes for something cooler :P
I just wanna know how the game works mostly
can't figure out which mod it is. will ask admin once he's back
send mod ids on dm
I can have a quick look for you
but don't send me another link, links are spicy
it's 149 mods. is there a file I can access and copy paste?
That's a good question
that's just a server-wide message, it can be done via RCON or in-game using /servermsg "your text here"
there's a mod called Udderly Up to Date that will check for mod updates then shutdown your server, you need something external to automatically restart the server though
nice, someone who knows stuff 🙂 thanks for spreading the knowledge
Hi @pulsar rock ! Are you the developer behind the Skill Limiter mod? There's a topic related to it that I'm hoping to talk about
I am!
Do you have a sec?
Sure thing! My DMs are open 🙂
Perfect, thanks
anybody know what files hold the data for the explored/unexplored areas of map?
Hopefully someone has a fix for me... I am trying to send an item in a container to the server so it can change the item's Use() to try and update it for everyone on the server. I know I can't sent the object itself in the args to the server. I tried sending the x,y,z of the square the container is in to have it search the container, find it an change the Use() but I am running into a weird memory issue. Is there an identifier that is not the object itself that I can send to the server so that it knows the object without doing an eloborate search for it? Some sort of object ID number or something? Been looking through the isoobject with no luck. Thank you
if some one could kidly explain to me me how the f i make sandbox options for my mod and how you make a lua overwrite for another mod i cant figuire those 2 things to save my life
My functionalappliances mod has several sandbox settings you could use a learn from. I have the files in github
I can walk you through the process on voice
The overwrite I don't know
Maybe a stupid question: is it possible to edit a mod in my files and see the effects of the changes without having to restart my game?
debug mode
reload lua bottom right
Would that be accessible within the F5 menu? or is that just in the general bottom right of the screen?
F11 in debug mode
And the tilde button
Thank you!
That will bring up the debug console
sometimes it can cause odd issues depending on what you change between reloading
hello. i havent done this in a long time. where can i check my error logs?
from outside of the game after closing it
\zomboid directory off users in windows... console.txt
can anybody tell me if there is a way to view contents of a .bin file in readable format? Specifically map bin files
or how they are structured?
nice
i changed how my blackouts mod works. now i just gotta test different things to make sure it actually works
seems to work nicely!
i hope this version of the mod will be compatible with multiplayer
and fix other bugs from the old version
☝️
better sound effect and less scuffed method of triggering blackouts
this version MIGHT work better with multiplayer but i have no way of testing it
and i also integrated lua timers (with permission and credit) to reduce dependency
nice!!!!
if anyone uses it in multiplayer lemme know if it works! i made a change that was linked to a lot of the issues in the old version, but i have not tested it in multiplayer
lmao i didnt upload the right files
i forgot to replace the media folder with the one i used in my test folder
Classic
if i wanted to show off a small mod i made (its just a true music addon but its my first mod) would i post it here or in showcase perhaps
show it off here!
no mod is too big or too small to be appreciated and shared
word 😎😎😎
ty!!
if ur as autistic about prince as i am this ones for u
https://steamcommunity.com/sharedfiles/filedetails/?id=3156373481
next ill either do the Beatles or ABBA
Reason: Bad word usage
i feel like this should be part if the main game. it really fills you with dread when you're doing something and then the power's go out
i appreciate you saying that! i hope this mod fits the vanilla experience enough so you and others wont feel like you're missing it!
Looks awesome! I love to see these packs for our True Music jukebox!
DM'd you about this, hope it's okay!
i like how i recently replied to someone saying i wasnt playing the game or working on mods, and then i suddenly felt like working on a mod the same day
unfortunately i still probably wont try fixing the immunity mod until at least build 42 if they make the health panel moddable and improve how infection works
I may know a way to mod the health panel fwiw. Issue is just that it's a local table right?
yea it's a local thing which i am not keen on doing
Can I DM you?
i'd like to make a mod that has maximum compatibility. but if someone were to make that a dependency mod that many mods used it would be chill
sure!
has anyone investigated that issue with any findings? where you either get cured or are immune, but if u get bitten in the same limb after it healed from a bite, you die instantly
this just a question of if anything has been found, since i will not be investigating this bug myself anymore in B41
Hey guys! I am currently figuring out how to mod. I created a mod, uploaded it to the workshop, set its visibility to friends only, downloaded it from the workshop - but it does not appear in my ingame modlist. Where did I take a wrong turn, what am I missing?
Forget about it, lol. I am stupid and set its ingame name to ModTemplate by accident xD I will surely be back with more questions 🙂
it's caused by not resetting the time of infection when curing the player
when they get infected again, the game thinks they've been infected the whole time since the first bite, and kills them because of how advanced their infection should be
yeah that's as far as i understand but i dont know if there is a way to fix that
it's as simple as resetting their time, to -1 i think?
is there a function for infection time?
i can try taking a looksie next time i am back on
wow! might be this simple. will try later
thanks!
Question: Is there a way to only change one item in the items_food list? I want dandelions (and mushrooms) to keep from spoiling, so I can use them as decoration. I managed to make them not spoiling by using the whole item_food list, but then the game tags every single food item as one of my mod. I also tried removing all other food items from the items_food list, but that left only dandelions (and mushrooms) as food, with no other kind of food existing in game. There must be some workaround I am not aware of
you can just redefine the items in your own file instead of overwriting the entire vanilla file
e.g. items_mymod.txt
ahhh!!! I give the file a new name, and then the game replaces its original spoiling dandelions with my superb non spoiling ones?
It works!!!!! I can barely believe it 😄 Thank you @bronze yoke!!!
@rancid panther May I ask how you code?
Do you have auto-complete or do you just refer to the pzwiki for documentation?
i take the advice of other people here + do my own research using https://projectzomboid.com/modding/index.html or looking at other mods
package index
sorry, i'm not sure what you were looking for with your question, but im very amateur and try to only do things i can understand
Two questions about translations:
If I include a translation file for french named MyMod_FR.txt under shared\Translate\ , I'm assuming PZ will just look for a _FR.txt file if the game itself is set to french, yes?
How would I go about translating strings from Lua into a different language? Would these just be included in the respective translation file as MyMod_variableName = "Translated Text Here", or how would I translate something like the below screenshot?
There is the getText function that returns the translated string for you based on the game language you have
So for any string that I'd display to the user I'd just replace it with a call to getText("Yes") and that'd return "Yes" in the users language?
it also follows a format depending on the type of text it is iirc
i would show u an example i have in one of my mods but im not fully awake yet
No sweat about it rn, I'm about to leave home for uni so I won't be able to get to it for now anyway
Would appreciate a screenshot whenever you do get the time though!
Youd need to make a txt file jn the shared translation / your language prefix and then call jt smth like IG_UI_[language prefix] and then put for example IGUiI_MyText = “my text”,
this is it. ignore my example
do keep in mind that depending on what type of text it is, it still follows a format
you can also add parameters to it, which is pretty pog.
So if I had the table for the english translations of my mod named ComfySleeping_EN, to get the translated text of a string "Yes", I'd define it in the translation file like ComfySleeping_YesStatus = "Yes" and get it via getText(ComfySleeping_YesStatus) correct?
The file needs specific name and location.
you would have to put it in like IGUI_EN, it can't be some random file
and you would have to call it in getText with quotes
Ok, appreciate the pointers!
👌
Mod idea for B42: unicorns, unicorn horn bats instead of nails
u can put these in #1075939080287834113
Good afternoon everyone, how are you?
I'm developing a mod for Zomboid involving machines (they are considered items)
Is it possible for me to make these items only usable if they are near a generator?
Not sure
My bad! ❤️
no prob!
You can check OnTest if the item is on a square that has electricity or if the electricity hasn't been shut off. See in-game recipes that check with that OnTest and adapt for your recipe.
maybe i can find this in "Battery connector" script?
I think the battery connector after you place it down is an IsoObject which is different from what you want. Check the recipe to refill the Blowtorch.
the blowtorch has eletricity option?
No lol, but it has that OnTest that checks the item
I will write this down, when I have access to put it into practice I will test it
you just have to find an item that has the function of being on a tile with energy
hey i need a mod makers help
heres the situation
on my server we use a mod called toxic zones stalker edition
this mod overlays an intense green fog when you enter a toxic area
i want to get rid of this overlay entirely
so far i've discovered you can remove the image
but how do we get rid of the line of code that looks for an image
We may have found a fix, by simply changing the image to an invisible one we can just hide it
Hey guys! How do I add 3D models to the game? I feel like I am missing something. I tried renaming existing meshes and textures, that worked fine. I created my own mesh and texture, created a new item (shows up in game), but it is not working. I used the right file types and PNG size (128x128), I am sure I modded the right files (script "items" and "models_items") and set the right pathes in my txt files. But the model is not showing up. So I feel like I am missing something crucial? Is there like a size limit to the mesh?
Might have better luck in #modeling, fwiw.
Sorry, I am new to discord. This channel did not even show up for me before you posted it, so thank you 🙂
No problem! And you may have a goal that overlaps a bit; some people who know what you need to know may be here, and some may be there. So no harm in posting both places.
Good day ppl. What is the correct way to use another mod/api? E.g. The PZ-Community-API (https://github.com/Konijima/PZ-Community-API/tree/master) have a function that I would like to use in my own mod. I stuggle to find info pertaining to "importing" another mod as a library of sorts?
Steam workshop is blurring the crap out of my image. If you upload a large image, it will scale it down to 636x358.
I figured I'd just make the image 636x358 (It will look stretched in Mod Manager, but at least it'll look good on steam workshop page).
Nope. the 636x358 image is blurry.
(if you click on it, it opens a new steam window and it looks crystal clear)
Tried a variety of 16:9 resolutions, including... 616x336, 624x344, 632x352, 640x360.
All 5 look bad. Maybe I can find an existing mod on the workshop with a good looking preview, and copy their dimensions.
edit: actually, the preview is 636x358, which is NOT 16:9. It looks like my images need more height. super strange
edit2: looking at other people's mod pages, i guess the workshop is just scuffed. everyone's images have black borders. nvm
Idk who needs to hear this, but a great idea for a mod- placeable corpses. Like furniture. I see autopsy tables but have no way to put zombies on them. I feel like its something everyone has thought about.
If a placed item model is slightly off center in the game world, is that an issue with the model itself? Or did I mess up somewhere with the coding of the placement?
Can I reset Lua in-game? Not in the main menu.
You can reload files from F11, but certain files will not reload correctly. Depends on what the mod actually does.
If you are in -debug
☝️
Ok, thanks. So it is possible to reset only a single file?
You can only set single files that way
Resetting an entire mod or item of files is not possible from in game to my knowledge

