#mod_development
1 messages ยท Page 21 of 1
Well, if there's any guide out there, would be wonderful, though the recipecode.lua unblocks me somewhat
Javadoc Project Zomboid Modding API package index
Also if you know what Typescript is and how to use it, you have the option to code mods with it.
I do know, is there a transpiler for lua or does PZ accept ts and transpile it itself?
I'm a part of the team that wrote homebrew code that transpiles both the Java and Lua API as typings.
If only I knew you yesterday, I wouldn't have read the lua getting started site haha
Where can I read more about that @jagged ingot ?
Anyone know if its possible to change the color of the light from a flashlight, I see how to change the cone and distance but cant find an example anywhere for making the light green or red like the lightbulbs do
Here's @thin hornet's environment using the typings: https://github.com/Konijima/pzpw
This is the org that generates the typings: https://github.com/asledgehammer/
We have a discord server too. If you want that you can find it in a readme.md there or I can DM you it since I can't link to it here directly.
Sure, please do
We set this up, am working (shelved), on a rewrite of a bukkit-like framework for the server to have java plugins, and we also recently added a commissions marketplace for PZ people to pay others for mod work.
๐
Do players need a to patch their cient?
For Typescript? No. TSTL is a library that we use to compile Typescript to Lua.
What about the Java portion?
I have an assumption that if you alter java side code, youd need to change the client as well.
Only if you change the protocol or something sensitive that wouldn't work otherwise.
I guess if there is code that is only imitated server-side, then thats when a patch is not needed?
Minecraft servers are almost always modded now which works with vanilla clients. (Unless it's forge)
PZ can also work with modified servers. Unfortunately people aren't as aware of what you can do with the server. ๐
Yeah, for starters, just making a small recipe, but wanted it to give exp
It does work
But I had a bunch of ideas and am thinking I need those function hooks
But only not for tailoring
Because this xp is given difrently or something like that from what i have heard
Yeah, that recipecode.lua has everything but tailoring hah
But the signatures are there in all those functions, I just can't figure out what those arguments are
Yes, from what I can tell, I make the function, but the function has a special signature
If you give me 5 mins i will send you one because i already made it
5-10mins
I will take shower
This one from AuthenticZ is the one I looked at:
function AZRecipe.OnGiveXP.Tailoring20(AZRecipe, ingredients, result, player)
player:getXp():AddXP(Perks.Tailoring, 15);
end
But where can I introspect what ingredients, result, and player are? I mean, is there documentation around these?
Thanks @grim rose
Oh so you mean more effects you can do?
Guess its time to learn typescript. I was looking for a Java modding toolchain or framework. However, all the projects for that seem abandoned.
Besides PZHook, I believe we're the only active Java modding team for PZ.
We go back to 2015.
PZHook seems to require client side patches
I mean, what is ingredients? is it an array? results? player? what do those objects contain is what I'm wondering if there's documentation that explains that instead of going down the rabbit hole of printing them
I think robot once send me documentation
When you can literally see what you can call and also know when something isn't passed right or isn't called correctly, it saves countless hours of grief. ๐
JSON Schema for recipes when?
I was looking at that page, but it doesn't really explain the function signatures. For instance, there's the zombie.scripting.objects package, I see it has some strings, and methods like setLuaGiveXP(), but it's signature has nothing to do with the one in Lua so I'm at a loss with that API page.
I wonโt lie
I was too
I still am
Anyway
@storm snow you want that Tailoring XP thingy?
Well, I can sort of copy paste it and make it work. what I really want is to know if there's any documentation around these functions that get called.
yea, i see you prefer to get fishing rod rather than fish
Right now I'm looking at other mods to figure out how they're doing it but, I'd rather know if there's some source of truth that expresses "Hey, recipes have these functions that expect these parameters"
I'm hoping that one day TIS will release an updated javadoc so that we can see function-parameter names and any documentatin they've added since.
And if that's how everyone is doing it, that's alright by me, but I don't know if I'm doing it the wrong way is all
PipeWrench has a modeling solution for generating human-fed documentation from modders to the typings.
yea, the best idea to look up on mods with specyfic parameters
i wanted to make character panicked when they do one thing
i looked up mod that reduces panic levels
and added "-" to that reducition to make them stressed
i ain't best in lua commands, but i like to help
Does anyone know what the parameter for booktitle is? No matter what I try in my items definition, it always comes out with an auto generated title
tooltip:
?
The worst part is that I cant seem to find any mods that are able to set these properly. All other mods seem to do the same thing
Oh I haven't tried that yet
item item
{
DisplayCategory = x,
Weight = x,
Type = x,
DisplayName = x,
Icon = x,
WorldStaticModel = x,
Tooltip = Your book name here,
}
Nada, just adds an additional tooltip
:?
i will look it up how they do it zomboid
{
DisplayCategory = SkillBook,
NumberOfPages = 220,
Weight = 0.8,
Type = Literature,
DisplayName = Trapping Vol. 1,
Icon = Book4,
SkillTrained = Trapping,
LvlSkillTrained = 1,
NumLevelsTrained = 2,
StaticModel = Book,
WorldStaticModel = BookYellowBrown_Ground,
}```
Yeah, I found those but that's only the name of the book (which is working), not the 'BookTitle'
For reference
I'm not super familiar with lua yet, could it need an object? tooltip: { booktitle: name } ?
look up in lua/shared/Translate/EN/TooltipEN
I see I see, let me try that
so create file like this in your lua folder
Tooltip_EN = {
Tooltip_BookTitle_spear = "Spear",
}
image in text
item item
DisplayCategory = x,
Weight = x,
Type = x,
DisplayName = x,
Icon = x,
WorldStaticModel = x,
Tooltip_BookTitle_1,
Tooltip_BookTitle_spear = "Spear",
}```
Yeah that still seems to be failing
@mystic rampart something like this
eh i hope it will help
other than that
goodnight
Rip thanks for taking a look though
Adding that made the associated book disappear from my world altogether though lol
Anyone know if you can request/receive parts of a modData table or would I have to create a new modData per list?
Hello, would I be able to get some assistance with adding a map to an MP server via Gportal?
honestly, based on the source code, reflection is the only thing i could come out with. developers already being kind enough to provide the reflection api.
will inform you if i can find any other method to deal with the recipes.
what kind of mod data? the mods info or the tiles mod data?
global modData
I'm transfering the modData from server to clients
would prefer to be able to pick specific keys or nested values
Also, Idk if this is new but itemtweaker does not change scripts on serverside
probably not stable for specific features
Does anyone know how I can have attachables on my custom bags I made? I based mine off the alice pack and it has all the same things idk what else it could be unless it's the displaycategory...item Bag_BloodAlicePack { Type = Container, DisplayName = Bloody Alice Pack, ClothingItem = Bag_BloodAlicePack, CanBeEquipped = Back, WeightReduction = 87, Weight = 1, Capacity = 42, Icon = BloodAlicePack, OpenSound = OpenBag, CloseSound = CloseBag, PutInSound = PutItemInBag, BloodLocation = Bag, RunSpeedModifier = 0.97, CanHaveHoles = false, AttachmentReplacement = Bag, ReplaceInSecondHand = Bag_BloodAlicePack_LHand holdingbagleft, ReplaceInPrimaryHand = Bag_BloodAlicePack_RHand holdingbagright, WorldStaticModel = ALICE_Pack_Ground, }
{
DisplayCategory = Bag,
Type = Container,
DisplayName = Large Backpack,
ClothingItem = Bag_ALICEpack,
CanBeEquipped = Back,
WeightReduction = 85,
Weight = 2,
Capacity = 27,
Icon = AliceBag,
OpenSound = OpenBag,
CloseSound = CloseBag,
PutInSound = PutItemInBag,
BloodLocation = Bag,
RunSpeedModifier = 0.94,
CanHaveHoles = false,
AttachmentReplacement = Bag,
ReplaceInSecondHand = Bag_ALICEpack_LHand holdingbagleft,
ReplaceInPrimaryHand = Bag_ALICEpack_RHand holdingbagright,
WorldStaticModel = ALICE_Pack_Ground,
}```
depends on what attachment system ur using
looks like the authz one
u have to define the slots for ur bag, and if it's a reskinned alice pack that should be easy, but ive not done it for authz
I just had another mod idea, unsure how possible it is but I don't see why it wouldn't be (?)
How possible (and useful) would a jumper cable mod be?
I feel like it'd be possible for the detection, just gotta determine if the player is at the front of both vehicles, open up the hoods (if present), hook to batteries (if present), then just turn on the engine of car 1 to get car 2's battery to temporarily "work".
Then car 2 can just get started up and use gas to recharge from there.
Could see jumper cables coming in handy for "10 years later" type settings, ntm roleplay servers for people leaving their car lights on.
i haven't mess around with the global moddata yet but, if the stuffs you want to do is server-sided, try to retrieve any mod data and see if there's a data. it might be another architecture issue
the entire table transfers fine
but I would like to transfer a part of it at a time for optimization sakes
was it through server command or another event hook?
because, the only thing i know that allows you to control what kind of data can be send would be the server / client command
what determines whether this "This item overrides:" bit shows up - most of the time when i override things it just shows the line above that proclaiming im entirely responsible, even overriding base items, whether i have Override=TRUE or not
e.g.
It's through modData.request/recieve
I send data through command
the issue is calling for updates
it's a shop system - so changes need to be sent to other players
@sour island
Looks like you can't optimize it further.
that's what I figured
didn't want to place each store/store listing as it's own object
would make reading/debugging globalModData a shitfest
thanks i'll look in authz
Tinkering with a VHS mod, how are the xp codes found? From what I see it looks like the first three letters of the skill (eg TAI = tailoring, BOR = boredom). Is there a list of these somewhere?
I'm looking for non-standard xp grants (fitness, strength), and cannot find an existing mod that uses them
@sour island
mind if I ask you an example of partial data you want to send? I'm making a framework to deal with the lack of tools so i would like to see if i can create another way to transfer the mod data
to a client right?
I have clientside data requesting from serverside data
one way always
client sends commands for the server to make changes
then sends the changed data to all players
right now it's two lists
stores and wallets
stores table contains keys of IDs and values of tables
I wanted to be able to request/recieve something like "STORES.ID"
and ideally "STORES.ID.listings.listingID"
yeap, i went through everything again and confirmed that you can't do partial data transmit through globalmoddata.
if you don't mind doing through server / client command for this part, i can upload the framework I'm working on which has already streamlined the command processing part. will be uploaded in 2 hours or so though.
here's the example of how it works
CommandChannels.Server[strModID][strCommand] = function(oPlayer, tArgs)
...
end
CommandChannels.Client[strModID][strCommand] = function(tArgs)
...
end
just need to do the usual sendServerCommand / sendClientCommand to trigger it though
that's probably the best way to do it
Anybody know which function is called when the player attacks? If we have such access that is
if i want to increase a backpacks capacity but make it a mod instead of having to change it in the game files everytime, how do i do that
is it your own bag or the base bag
vanilla school bag
Hello, Im trying to use items with useDelta in a recipe, for example like this:
Glue/DuctTape
How can I use only a fraction of the items?
I tried Glue=1/DuctTape=1 or Glue/DuctTape=1 but it throws errors
normally I only see the overrides stuff when using DoParam to modify items. and only get the mod text when entirely replacing or a new item from the mod. although I haven't tested this to exactly determine what causes what. are you properly modifying the gunpowder item with doparam? because if not and you are just replacing the whole item, then it makes sense to only "blame/point to " your mod since even if other mods first modified the item, your item would entirely replace their changes anyways so only your stuff is present.
sorry sorry, I should've specified before, this is in a recipe
{
Pipe,
Glue/DuctTape,
keep Saw/GardenSaw,
CanBeDoneFromFloor:true,
Result:Something,
Sound:Sawing,
Time:230.0,
OnGiveXP:Recipe.OnGiveXP.None,
AnimNode:SawLog,
}```
Like this
glue and ducttape have useDelta property, but when performing the recipe, the entire item is consumed
I'm using the Base items for this, not overwriting anything
to my memory, Glue/DuctTape=1 should work. can you show the error you were getting?
Thanks, Iโll try tomorrow.
is it possible to upgrade a backpack via crafting which results in higher weight reduction and capacity?
yes, you would just need to make a recipe to turn the back pack into a new item with better stats
so i just make a folder named whatever, put 2 files in it, one for recipe and one for the items themselves?
that simple?
Sadly not that easy, you have to follow standart mod structure
and what's that
Look up that basic modsing tutorial
It will get you on trackp
i did but didn't found anything that actually taught me anything besides what's the difference between lua and java
imma go search on Reddit
Iike yt one
How to make mod
alr i think i know what to do
need 3 folders, mod.info, media and lua
media contains script folder, normally it also has model and texture folders but since im using vanilla backpacks that might not be necessary (?)
and the lua folder contains client folder
or server folder, but this mod is only for me so no need
Just dl a backpack mod and follow the structure
dl?
i know
but what i want is real simple so i like to do it myself
it gives me a sense of accomplishment
So you dl a backpack mod and follow the file structure? It's like the skeleton and you're putting your own code or meat on it
If you are confused
i still don't know what dl means
ohhh
so all i need is a backpack mod and add and remove stuff from till i get what i want?
Just get a simple one that adds a bag and look at how the folders are structured and make your own following it as a guide
Yeah just look up the bag txt in the project zomboid scripts folder on your pc you can prolly copy and paste the vanilla bag in from there and just change the Carry capacity
And whatever else to your liking
and where can i find the mod folders?
follow instructions in workshop when pz is open
make sure it works before uploading
C:\Users\Me\Zomboid\Workshop
you'll put your mod in here
replace Me\ with username
ok thx alot
if i copy paste the vanilla school bag, and change the name and capacity, will it still use the same models and textures?
i made 4 backpacks and recipes for each of them in like 10 mins, surprisingly easy to make
if i copy and paste a vanilla script there without changing anything besides capacity, does that make that change the vanilla item?
Think so
I haven't tested changing vanilla
You could write your own .Lua to spawn in with the items needed to craft it and test or just play and look for the bag or debug and spawn it in and check
Debug prolly easiest for you
another follow up q on zoomlevels and resolution size. What i tried earlier by limiting every1 to 1920k works as intended and takes away sight advantages for 2k/+ users, but destroys graphics on anything higher then 4k monitor, making game unplayable. Im looking at tinkering the zoomlevels and came up with this.
1st is local function to be used once, 2nd overrides main menu options
numbers are randomly chosen atm
would this be a better solution to tackle the zoom issue? Not forcing a resolution but limitting the actual usable zoom lvl. Its a lot more code, but might be better in general
edit: cleaned up
how do i make a loot table, like hoe can i make my items spawn in the world?
naturally without debug
if above works i will refractor it in an array of resolutions, + for loop (hopefully the increment is linear) with division by set value, otherwise hardcoded
Hello!
Is there any way to detect that I hit a zombie or obstacle while driving?
I have tried the following event hooks and none of them occur upon collision.
- OnCharacterCollide, OnObjectCollide, OnHitZombie
https://github.com/Li-Zero/PZ-Simplify
I've uploaded initial version of lua framework. No comments yet and some stuffs are not included at the moment since they're not finished yet. Examples are included but not tested since I got too many distractions every few minutes.
edited
I extended the require function to include 'cache/lua/server' and root mod folder. Just check out the extension folder and see what else did I extended or added.
Are the detections for towing lua-side?
Same goes for detections of the front of the cars.
thx, this is real useful, would be nice if you had some item/gear and recipe templates
if you're asking for script template, it's better if you ask the others since I haven't dabble with those stuffs yet. I have no idea how the item properties work
asking item modders would be a good idea
Hello everyone, so I'm new into PZ modding scene and I have a question.
I'm developing a mod for multiplayer, now-- do any of you know how to add a right click option on another player (example- right click to inject vaccine on another player)?
alrighty then
is the ModData shared between all mods? or is it local to each mod.
example: if i make a value called "DurationRemaining" and some other mod also has a value called the same thing. will the 2 mods overlap and mess with each other?
yeah its pretty feasibly. I would suggest taking a look at the current medical code to see how to get the other player object from the client, and in general look at other mods or vanilla code to learn how to implement your own UI stuff
i wanna read exactly how the fields on guns impact combat, in particular AimingMod
and i can't seem to find a place that they're used in the decompile
just places that provide them
am i missing something?
search for the "Medical Check" one and then wrap that context menu with a new function that calls the original and add yours to the menu
Is there a mod that changes zombies and overtime in a world theyโll turn into clickers, where theyโll have better hearing and less vision and also look different like in TLOU?
I'm trying to setup the 'Vehicle Spawn expanded' mod. It has Workshop ID/mod ID, but it also lists 'map folder' what do I have to do for that?
Thanks a lot for the help UdderlyEvelyn and Robot ex140
You da best ๐ซ
some craftings says 300 for crafting time, but i doesn't take 300 seconds
how is that calculated?
I think (not 100% sure) it is 300 ticks which is equal to 15s.
so it's ticks
#mod_support or #pz_b42_chat.. @hoary sage too..
hey.. so.. for removing a vehicle on the client end you do a sendClientCommand, etc.. but what about when you're doing it from the server end?
do you still sendClientCommand but with a nil player or smth?
i think there's a sendServerCommand but my assumption was that that was for sending stuff to the clients
or is there a "doCommand" or something xD
as a workaround, can i make all necessary items available by crafting them from vanilla stuff that spawn normally.
would that work?
you can add ur stuff to the procedural distribution tables
that's the typical thing to do these days
For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.
:|
i told u the keywords
so
yeh
looking at the args im guessing it IS this
hm, well maybe that webapp broke, just put it in normal google lmao
alr
@weak sierra How do you figure I should go about making the funny battery charger
I reckon I'd need to use some tile definitions so that's one thing
Then I'd have to figure out how to UI

tbqh that's entering territory i haven't tread in yet
agony
im sure i could figure it out but i'm no help, so can u
lol
noir is one of few modders who messes with UI
poke around his mods
the shops mod does UI and has a custom tile that is tied to it
so probably helpful, though far more complex than u need
for the battery slots check out the vanilla radio mb
Figured vanilla radio would be the way to go for that
Cuz then I can copy over the funny battery meters too
pls help
how do i do a teleporter script for players? i got this error when i attempted to do just that
-- SendCommandToServer("/teleportto 12515,3452,0");
-- getPlayer():setX(12515);
-- getPlayer():setY(3452);
u'd need to give them rights to do it or else do it from the server end
yeah
see the former requires rights
thus the error
how do i do it on the server end?
depends on the goal of ur mod
tbh
what's a good event to tie into for getting the cell a player moves into when they move between cells
OnPlayerMove seems overkill but ill do it if i must
oh no, it requires TILES files
icky :p
please link me to resources you find on this
im sure i'll end up in that world soon
might need to head into #mapping even
do wish that you could just define tiles in a similar manner to an item script.
Does anyone know how I'm supposed to edit these parameters?
My goal with this would be to use the function only if this event occurs with certain weapon type (example scalpel) and if possible after this event apply some changes to "character" parameter (example add isinfected = true)
I believe those params are hard-set, though I don't see why you wouldn't be able to gather what you need from said params.
Wielder, Character, and handWeapon offer you the Attacker, Victim, and weapon in question.
So you could gather what weapon type it is via handWeapon, who used it via wielder, and the character attacked with character.
Unless im misunderstanding your question.
i believe there is an anticheat you need to disable to allow that
They are-- but is there a way to create similar event/function that would use a specific type of weapon and not all the weapons? That is queation no1
Question no2 is what would I need to do in order to apply some effect, such as isInfected to a character that is hit by a weapon?
I don't believe there is an event per-weapon, you'd have to simply use OnWeaponHitCharacter with an if statement to determine weapon type and apply from there.
Do I just add player.IsoCharacter:getBodyDamage():setIsInfected = true
Inside a function or do I need to do something more to make it work

That might work, I'm unsure though since I don't have the code at the top of my head atm
Well this helped clarify some things, so thanks.
Ill just need to figure out the right code to set a specific weapon and/or just apply the effect
if i want to create a recipe for a vanilla item like recipe for flour, do i just type recipe make flour or do i have to call it first since it's not from thag script?
you guys figured this out yet? how to use teleport or move position if comands from the client?
yeah he dm'd and i had a longer talk about options
is anyone free enough to help me with a few minor things about my mod?
u have to import base
i did
it's all good now
now im struggling with another department
farming
i want to add wheat so i can make flour for bread easier
i think i added it but idk if that also counts as the seed for planting it
here is the script for it
module base
{
item Wheat
{
DisplayCategory = Food,
Type = Food,
DisplayName = Wheat,
Icon = Wheat,
Weight = 0.2,
HungerChange = -3,
DaysFresh = 24,
DaysTotallyRotten = 48,
FoodType = Vegetables,
Carbohydrates = 14.52,
Proteins = 2.88,
Lipids = 0.15,
Calories = 70,
WorldStaticModel = Potato_Ground,
}
}
making plants is alot more complicated. you need to modify the harvest, and grow functions in vanilla to handle a new plant, and you need to create the tiles for all the stages of the plant.
and making a mod that adds more crops is alot of effort to make them compatible with each other
well what do i do then?
honestly, would probably just be easier to find one on workshop that already does that if you just want more flour
Can someone help me so i added a modded map in a it worked but i cant see it on map and the roof bug in when i go in to the building - dedicated server btw
there are definitely many
well, can't copy a plant like potatos and change the values and name?
i really don't care about the growing visual
soul flechers has wheat
this is what wheat is for
recipe Make Flour
{
keep Spoon/Saptula,
keep MortarPestle,
keep Bowl,
Water=1,
Wheat;1,
CanBeDoneFromFloor:true,
Result:Flour=3,
Time:25.0,
Category:cooking,
Sound:SliceBread,
}
recipe Make Yeast
{
keep Spoon/Saptula,
keep MortarPestle,
keep Bowl,
Water=1,
Flour=1,
Salt;1,
CanBeDoneFromFloor:true,
Result:Flour=3,
Time:25.0,
Category:cooking,
Sound:SliceBread,
}
not really. you need to make new functions to handle the growth of the plant, and the new tiles even if you don't modify the visuals, as they need to be different tiles in game
So i added a modded map in it worked in my dedicated server but the roof bugs my view and i cant see it on the map anyone help
try mod support
if i want to cook raw clay so it's dried, how do i do that
like how do i specify that it needs to be done via an oven?
would be pretty complicated. PZ doesn't really modify items when they are cooked, and only modifies the food related variables, and just adds "cooked" text to the UI. you would have to implement it all by your self
alr so i'll just do it like a normal recipe
yeah that would be the easiest way
Is anyone willing to check my code and see what is preventing me from adding a contextOption when rightclicking otherPlayer? I tried basically everything and it is either this or just giving up on the mod I'm trying to develop
When a timed action runs :perform
Is there a good way to still fail the action?
just post your code and if someone can see whats wrong they will say it
if I want to add a custom icon, i have to place the png in the media/textures folder?
you can probably call :stop on the timed action
Parts that are marked with !!!!! DOESN'T WORK !!!!! are the ones I failed to code correctly
Most of this is basically copied from the IsWorldObjectContextMenu.lua from the main game files and from the LabModEngine.lua's previous working code
When I right click another player-- nothing shows up.. no context option nor can I perform a function that was coded in here
That doesn't work and it keeps doing the stuff, it's odd.
like how to load it in-game?
I put mine in
%USERPROFILE%\Zomboid\mods
And then I run the game with -nosteam -debug and add it from the mods menu
what's nostream?
-nosteam just launches the game as non-steam version.
I don't know if you can load the user mods from the normal version
%USERPROFILE%\Zomboid\Workshop\ModTemplate
There's a template to how workshop mods should look like,
You can make a copy of this in the workshop folder
And then run the steam version of the game and there's a upload mods button somewhere
there is only these in that folder
is it supposed to be like that?
Yea you would copy your mod there
alr
i put my mod in that folder, now if i go ingame it will be near the other mods?
I assume yes
I think if using -nosteam, it should only show you the mods in that folder
I mainly just use -nosteam when I'm playing solo campiagns, because I make copies of the mods i use, so they don't update when I'm playing
I put them all in the %USERPROFILE%\Zomboid\mods folder alongside with any mods I'm working on
@weak sierra Just did a really lazy alternate patch route that feels amazing

Literally doing string.find() to find "Remove Battery" or "Insert Battery" in the recipe names, with the "recipe function lookup" as a backup.
use the other mods you have from steam workshop as base, you can find steam mods like this steamapps\workshop\content\108600\2127326898\mods\antiserum
There are also guides to modding https://github.com/FWolfe/Zomboid-Modding-Guide
I mostly just got started by editing a mod and changing a small part of it
sounds like shit i might do 
only when game makes it hard
sometimes u gotta do that sort of hack for maximum compat
It's so dumb but it works
in modding-land
I still have 'hardcoded" compatibility just in case for a specific few mods
Yea
Thought I told you this last night?
i did use them as base
bad memory
Put in the workshop folder and enable mod
i did, went ingame to see how it is, 3/4 of the stuff wasn't there and the only thing that was there was the backpack, which also is a mess
Well that's a different issue then
yeah nothing went as planned
What are you trying to add besides bag
few simple materials like straps, leather and stuff so i can use them for crafting the backpack
and a few recipes to make flour,yeast and paper
and a handmade book that has half the stats of the normal book
i just copied the closet thing from the wiki and changed the name, weight and usage in recipes
i don't get why it didn't work
Ur trying to make your own straps and leather instead of using the leather strips provided in the base game?
no, leather is just 5 leather strips stitched togather
and strap is rope,ripped sheet and denim strips combined
So a recipe to craft from the base materials? Should be pretty easy
yes
Follow the base games recipe txt for a guideline
did
this is how the recipe for backpack works
recipe Make Survivalist Bag
{
keep Needle,
keep Scissors,
schoolbag;1,
thread=5,
leather;4,
strap;2,
Result:SurvivalistBag
Time:120
Category:general
}
i typed it on phone now so it's a bit wacky
no recipes appeared, i couldn't get any of the items besides the bag as if they didn't exist, the bag was messed up
and i just copy pasted already existing code
i don't get what can cause the problem
most things I Know i learnt from this guide
Think you need to load your own module in then if it's not working before base
I'll try tomorrow
pls do not ping me for stuff like that :P
module MyMod {
imports {
Base
}
item MyItem
{
Type = Normal,
DisplayName = My First Item,
Icon = MyIcon,
Weight = 0.1,
}
}
would that work?
also i want my stuff to be in a custom category for both inventory management and crafting menu tabs
how do i do that?
Might, that's what i was thinking but like I said earlier try to dl a mod that does something really similar and use it as a tutorial
i did tho
That might have to do with tooltip in the translate folder
You found a mod that uses items not in the base game to craft something also not in the base game
...no
I'm 100 percent Sure there are
People have modded weed into the game and you can craft blunts and such so it's 100 percent possible and done on a much bigger scale than you are trying to do
That's not what you want tho..
but that's a start
okii
Ok I thought you did that last night when I was talking to you lol
Well gl
now that i think of it, the custom materials like leather are really similar to some vanilla stuff, might be able to make backpacks completely made with vanilla
Yep prolly easier for first mod
oh i might be real dumb, i named my item script resources
does that effect anything?
that would explain why the custom items didn't show up, and the recipes didn't show up because i used a custom category that wasn't defined.
it all makes sense now
@acoustic dust
mind if I ask what kind of custom item you want to add? and can you also give the link of the mod you used as the base? i'll see what I can help with
When a mod (call it B) is loaded after another mod (call this one A), is it possbile that mod B can overwrite items like clothing items which are introduced by mod A? I presuppose that the corresponding items of mod B have the same script IDs and same xml data as the ones from mod A which should be overwritten.
I believe if it's loaded after yes
If it's loaded before, that's a whole other can of worms
Thanks for the info! Was also my guess. I am thinking about making an add-on for an existing mod whiere the add-on retextures some of the items introduced by the original mod. I even did some testing and my first impression was that it works. However, I am not sure whether this is really a save way of doing it or whether there could arise more complicated problems during longer game play. Especially if the original mod contains some lua code which affect the items in question. Therefore my question...
Is there a way to create a trait that decreases weapon effectiveness except for a few that I've selected?
Here is a simple way which will NOT work in multiplayer but could be used in singelplayer: Write some lua code which changes the stats of the specific weapons when the game starts and apply those changes only if the player has the trait in question. For example, if you want to change the effectiveness of a hammer, you could try smth like this (pseudo code):
if [player has your trait] then
local item = ScriptManager.instance:getItem("Base.Hammer")
item:doParam([change the stats here])
end
Not exactly sure about the code but smth like that might work. This won't work in mulitplayer because it will change the stats of the hammer for every other player but single player (without npcs), this could work.
Hey I have an Idea I'm sure most would like if anyone will listen I have a special zombie mod Idea. I've seen a mod with a zombie call the nemesis that will hunt you down he seems big and bulky and has a lot of HP. I wanted to make that the template for this idea. For a Halloween special type mod I wanted to ask if anyone has the skill to make a zombie be able to grab you and you'd have to tap the push button or key to push him off causing him to stubble backward and probably fall. if you have low endurance or the red lung moodlet then it'd bite you once. In a separate mod that can pair with this for those who don't want their youtube/twitch accounts copyright struck you can have skins for this mod and have Jason, IT the clown, or Pinhead as that special zombie with their distinct sounds. think about it your pillaging a house and you hear this.
the ability to be grabbed and not insta-killed is what I am getting at.
and this special zombie rarely appears
let me know your thoughts people is it a possiblity?
Not gonna cut it unfortunately, this mod does need to be supported for MP.
I've come up with this lua code from MoreTraits, but don't know how to specify short-bladed weapons.
-- MoreTraits code btw ftw lol
function mundane(_actor, _target, _weapon, _damage)
local player = getPlayer();
local weapon = _weapon;
local weapondata = weapon:getModData();
if _actor == player then
-- is there a way to do something like 'weapondata.isShortBladed'?
if weapondata.origCritChance == nil then
weapondata.origCritChance = weapon:getCriticalChance();
end
if player:HasTrait("mundane") then
weapon:setCriticalChance(1);
else
if weapon:getCriticalChance() < weapondata.origCritChance then
weapon:setCriticalChance(weapondata.origCritChance);
end
end
end
end
Oh, ok! ๐ Then my strategy is not a good idea.
Any way to copy paste a range of tiles (let's say 8x8)? Right now we can only copy paste one tile
Is there a mod allowing copying ofmultiple tiles?
Just added loads of support to my mod, feeling good
How many ticks per second in PZ?
Is it different for different clients among themselves and for the server?
hoorah!
If there is, please @wooden lodge so I see it. Ty a lot
Looks as if your code example is designed so that the problems I mentioned are bypassed by using modData and the "if weapon:getCriticalChance() < weapondata.origCritChance then" condition. Not bad...
Can't you try to modify the code so that it checks whether the variable "weapon" contains a short-bladed one. For example
if weapon == "Base.Knife" then
[execute the code you posted]
end
??? Question is whether "weapon" really contains a script ID like "Base.Knife" or smth else but probably possible to find out and adjust the code accordingly.
I imagine it would vary based on client / server performance as well as game speed.
Well, it doesnt change on game speed, and that's kinda the problem with it at times.
I guess it shouldn't vary if CPU < 100%
I'm trying to find if I can get the weapon type from weapondata, but I'll give it a go
if "weapon" alone does not work, you can also try "weapon:getFullType()". but just an idea...
Is that an actual function? Could you link the documentation for it?
it's a java command which can be used in lua to get script IDs (if applied correctly). see here: https://zomboid-javadoc.com/41.65/zombie/inventory/InventoryItem.html#getFullType()
Javadoc Project Zomboid Modding API declaration: package: zombie.inventory, class: InventoryItem
Fantastic! I'll give it a whirl :)
here is a trick to find out what variables like "weapon" actually contain (in case you don't know already): just include the command "print("MY OUTPUT: ", weapon)" in the function. Then play the game in debug mode, do something so that the relevant function is executed and check what is shown in the debug window. Alternatively, the print-output can also be found in the console.txt
That's what I'm doing, way ahead of ya :P
haha! ok!
Couldn't get the function to work unfortunately :(
I'll work on it later today though, I'll manage :D
getFullType() doesn't work?? hmmmm.... then "weapon" contains some other type of data. what does the print output for "weapon" shows? but... yeah when you have the time....
It doesn't print it all, chucks the entire error screen at me
so, printing does not work if you include "print(weapon)" as the first line of the function mundane(_actor, _target, _weapon, _damage)?
Ah, I did print(weapon.getFullType()) instead of just weapon. Was that really the issue?
important EDIT: not first line, but after the command "local weapon = _weapon"
Did that, don't worry :v
first thing: you need weapon:getFullType() with a ":" instead of a point "."
haha. and if it still doesn't work, you can simply try print(weapon) and see what happens (not guaranteed that this will help but maybe worth a try)
whoops. no quotation marks around weapon in print.... I edited....
I know general coding practices, dw Razab :p
Just new to lua as a whole, shits a bit wack
Also didn't work :/
I'll look further into it later, I've gotta work on some other stuff
If you're interested Razab, I can send you the github project and you can have a look yourself
might be better if you tell me where the code can be found in more traits and which action I should execute in game so that the function is executed
Yeah sure, one sec!
and what trait do I have to give to my character?
player = getPlayer
weapon = getWeapon
if player:Profession == SpecificJob:
if getWeapon == isShortbladed:
(Do twice the damage)
else:
(Do 0.25x the damage)
I made a custom one for my mod
ok... so I just try the original more traits mod and see whether I can find out that weapon stuff
Sure sure, thank you so much Razab ^^
@thorn bane I just modified the More Traits code and works perfectly fine for me:
function mundane(_actor, _target, _weapon, _damage)
local player = getPlayer();
local weapon = _weapon;
print("TEST OUTPUT!!!!!!!!!!!!!!!: ", weapon:getFullType())
local weapondata = weapon:getModData();
if _actor == player then
if weapondata.origCritChance == nil then
weapondata.origCritChance = weapon:getCriticalChance();
end
if player:HasTrait("mundane") then
weapon:setCriticalChance(1);
else
if weapon:getCriticalChance() < weapondata.origCritChance then
weapon:setCriticalChance(weapondata.origCritChance);
end
end
end
end
in your pseudo code, the question is how exactly do you get the weapon. if you access the weapon in a proper way, then I am inclined to say that weapon:getFullType() should indeed give you the script ID and you can simply check whether it is a short blade...
Iโll give it another crack in a few, maybe my lua coding needs improving ๐๐
Thank you tho Razab, Iโll update you when Iโve gone through it
kk
hi, i'm currently working on csv database for modders to use.. just want to ask if you guys want me to add any other column for players table.
currently the table only contains these columns
steamID;username;privileges;lastLoginDate
here is play-tested code which shows you the weapon a player has while attacking. what is still missing is accessing the player's profession or traits but there is probably also a way to do this.
Is there an event when the user shoot a firearm?
Thank you! Iโm currently out but Iโll let ya know how it goes
yeah relax. I just have some time and boredom atm. ๐ btw for accessing the profession, you could try player:getDescriptor():getProfession() but not sure if this works...
Anyone know how the metabolic rate, core temperature stuff works in terms of modding? Like if you modify fatigue and endurance, will it automagically figure out the metabolic rates so that there's an impact on body temperature, hunger, thirst, calorie consumption, etc. or is that all manual? I can see certain fields are accessible via getStats() and getBodyDamage(), but I don't see anything related to core temperature, metabolics, etc.
does anyone have any idea what happens to mod workshop folder when they get updated? will it delete any unrelated files outside of media folder?
sure
can we talk in dm?
how do i call a function when a player steps on a specific coordinate
faction
and way to
[insertscripthere]
end```
gotcha. will add those two columns.
and, can anyone tell me why is the recipe using semicolon(;) for salt? Is it the amount used is one bar instead of unit one?
Salt;1,
if i remember correctly, it means it uses one hungers worth of salt
@shadow geyser
thanks alot, i was bashing my head trying to figure out what it is
what about property with no amount? Such as yeast?
Yeast,
maybe that means one yeast?
the in game recipe that uses yeast just takes one yeast per items crafted so...
yeast is drainable, so it should use one unit of yeast
i think
might want to try it in game
this is just of memory rn
I am in unimaginable panic, I accidentally broke my hand cranks and that's literally the one thing my mod is known for
Now I have to redo the backend a bunch just to make things work the way I want
Basically, HandCrank wasn't being recognized as a BatteryItem anymore because of some changes.
No the update was a compatibility update, losing all of that work wouldn't be worth it.
I could just make a recipe, but now I've become dead-set on making it so every "remove battery" recipe is collected into one
So you can just do "Remove Battery" and it'll recognize every individual recipe under one
yeah thats alot cleaner
Problem is, I have to modify every Remove Battery recipe, including modded, to hide itself and basically stash every single item it would've supported under the vanilla one
then again it's just a battery mod- once i fix it everything will probably be fine
mods break all the time

mfw I keep getting a null error for something that shouldn't be getting null
Wait, oh my god it is null
Hi o/ - Is there a way to change the in the "Fitness" in a :getXp():getXP(Perks.Fitness) function? I have an array with all the skills as index and would like to use that function but replace the actual skill with index after Perks.<skill> in a for loop.
mind if i ask something about worldstaticmodel for item script? can you use image texture like 64x64 icons?
an icon should be 32x32
@cosmic condor
so, you can use icon for worldstaticmodel? and thanks for the info
I didn't confirm anything. if you don't have 3d model, the game will display its icon
okay. thanks alot, i really appreciate it ๐
uh wait, i don't need to define the 'worldstaticmodel' if i dont have it then?
you can define it to your png file
and the png file needs to have the 'Item_' prefix right?
not sure though, you should try it ๐
alright, will do so
yeap... i'm already occupied with lua errors hahaha
will try the model thingy and see if it works that way
I just can't remember because I didn't put my hand on it for a couple weeks so I can't confirm the info ๐
@ancient grail
Can you teach me how to get player's wayto value?
Help I have a problem.
It's called addiction to mods.
Plz help, what's the cure?
I am at 524 mods. ๐ญ
did the id name of the welding mask change or something? I cant make this recipe work
{
JMScrapMetal=25,
Result:WeldingMask=1,
Time:2000.0,
Category:Survivalist,
} ```
should be the same. try removing the =1 for the result. you dont need it. maybe it is messing things up
Yes
thanks
Np
not sure i understand wht u mean
you mentioned about adding faction and wayto columns to custom database im working on so I'm just wondering how to get the value for wayto
oh sorry, i misunderstood it haha
you mean way to use the faction. sorry for bothering you. ๐
remove "=1" in result, also remove ".0" in time, even if this won't fix it you don't need to have that
i think you cannot use not rounded time in recepies
Can any1 point me towards where the zoomlevel is at when you roll your mouse wheel, in which file is this code, i found it for main menu options, but not for ingame changing
Also my previous draft screenshot was pretty much code from hell, will post something clean later
So I asked last night but I may of asked in the wrong place. I can't make a modded server on my own without it crashing. What mod list do you guys use that's stable for 41.73? Or mods I should avoid?
this blocks zoom changing above 1920, i want to set it to a hardcoded number instead of blocking it
in the main code the variable is a string for that function so i kept it
I have my own sword, is there a way in the code to stop blood from appearing on the sword?
BloodLocation = is for clothes but what would it be for weapons?
Have you looked at LuaManager.java?
Also. IsoUtils.java
If you get it done, I'll use your restriction mod
thx, ill nose around there a bit, i see some possible usefull stuff
Im working on something else to deep dive with you
I see lots of useful functions though, if you run into something let me know.
I wanna see this happen
will do, thx for the tip.
i was shoving these books in one of my mods one day right before a friend got on to play
so i made the former
today i had time to go over them, huge difference
๐
the former was made in like 20-30 seconds ๐คฃ
How long did the second one take?
So, I have a question. Is it possible to modify the weight/mass of vehicles so, for example, a box truck doesn't almost roll, or stop moving, after you hit 1 zombie? Like I drove semi for a few years, and I've hit a few deer without it slowing me down -at all- ... just looking for a little more realistic weights/mass.
now worries. thnx for considering my suggestion. if u manage to do this pls let me know im sure to use it
i believe theres a vehicle tweaker api
tho i havent used it personally
u can still the old one for Udder.OldBook ๐
https://www.youtube.com/watch?v=_PtDuyJ9GcI
If it can help, it's in French but it's easy to understand ๐ this is to replace vehicle textures
Petit tutoriel pour remplacer les textures des vรฉhicules.
Discord : https://discord.gg/4CwHTXjq8Q
1-2 mins?
5 maybe cuz i dicked around making it into a template
lol
i used the vanilla book icons as a base so i didnt redo the linework
wanted it to match
just selected diff parts, split them into layers, recolored
then redrew the wrench and added side text
cool, that way you can make new one faster
mhm!
oh and i made the pages part its own layer
and kept the old weathered one
when i want older books i can just swap
Is there a standard way to wait in a lua script in zomboid? So if you call a function have it execute, wait some seconds, finish executing. I was looking at putting something together using the in game time and a while loop or something - but maybe there is something better that already exists? Maybe references to how long the game has been running in game time. Anyone know anything like that?
Is there a mod where zombies die by entity cramming against a wall?
Or trample each other
https://steamcommunity.com/sharedfiles/filedetails/?id=2856413047
This one doesn't let them die, but give chance for trip.
Nice
Thanks
Make sure to read it though. I don't know if it works for MP.
Aight
wait a second, does it affect performance or something? didnt know this and have like 100 recipes that end with result =1
I also have all of those recipes with a .0 after the time
result=1 isn't wrong, i think its unecesary if you get only 1 item from that
but time .0 can be cause of problems
like last time i seen zomboid being mean because someone wanted to have 1.5 fanny pack
ok mmm gonna kill all the .0 from the times, sometimes there is stuttering, thought it was other mods but maybe its my own mod
Were do i add my custom trait icon?
local function initTraits()
TraitFactory.addTrait("TraitVar", "TraitName", 0 ,"TraitDesc", false);
end
Events.OnGameBoot.Add(initTraits);
Just blank rn
Wow... talk about luck it needed to be in media/ui/Traits (yea capital T)/trait_<traitVar>
Icon not final
if you are asking for timer, there's none but i do have prototype in-game timer which needs to be improved. as for in-game current time, you can search for expose to web mod something made by wergio. that guy did in-game time conversion from millis to date.
Hello! I found an event when a player press the button to reload a firearm, but that event is not fired when the player do the same action using context menus. Do you know what can I use to also catch that case?
Or even better , something like a onBeforeShoot to prevent to fire a weapon based on a condition
Awesome thank you for the tip on that mod I will look at that! It seems like there is plenty to build some out but I will need to play with it a bit - I haven't used any of the gameTime stuff I am not sure even how to call it yet.
btw, link to wergio's mod https://steamcommunity.com/sharedfiles/filedetails/?id=2855326218
and, i forgot to mention that if the resulting value is java long, take note that it has been trimmed from 64 bits to 53 bits (lua number is a double with 53 bits precision) when accessed from lua side
heya. Question: How would I go about transferring modData from a specific tile type to an adjacent specific tile type??
hello, what would be the good way to increase distribution and spawn rate for a vanilla item?
hi im working on a mod right now and trying to run LUA function when only CAP LOCK key is pressed and performed only when it is pressed
but seems like the code i used make the function played when i pressed any type of keys
can someone help me what i have done wrong?
the code I used was this
local function OnKeyKeepPressed(KEY_CAPITAL)
print("both")
end
Events.OnKeyKeepPressed.Add(KEY_CAPITAL);
print("both") is executed no matter what key I pressed
I haven't used that event, but try 58 instead of KEY_CAPITAL. I don't know
other than increasing spawn rate on the setting?
i tried 58 , "58" as well and it still didn't work but thanks for the suggestion
Yes, I'm creating a mod that need 3 items to appear more often. I don't know if doing a tablet.insert of the ProceduralDistributions is a good or bad practice
yes, I think I'll do that. I don't think that'll conflict with other mods
yea i believe it's safe
about the KEY_CAPITAL
as long as the item name doesn't overlap with other mods that you do not want to conflict against
`local function OnKeyKeepPressed(KEY_CAPITAL)
print("both")
end
Events.OnKeyKeepPressed.Add(OnKeyKeepPressed);`
try that
ah, also did try that
wait no
if key == KEY_CAPITAL
print("MAYUS")
end
end
Events.OnKeyKeepPressed.Add(OnKeyKeepPressed);```
Is there any way i can contact a dev of this game to see about a certain mod idea?
yea i tried this before and for some reason that brings up the error
Whatโs the error?
Do you have more code in the function?
yea but i just tried with only the code you gave me
produces same error
in this line
if key == KEY_CAPITAL
Weird, something else is failing in the setInfected method
Something has that method in the file
ah i think it needs "then"
near print
k, that solved the error pop up. let me see if it plays correctly during the game play
now it's not doing anything even the button is pressed XD
Put a breakpoint and check the value of key
Yes, thatโs how it works. You need to put the conditional to react only to the key you want
๐
๐
i screwed up... you can't write files to steam workshop folders using mod file writer? the inconsistent behavior between steam workshop and zomboid workshop really screwed me way too hard now ๐คฆโโ๏ธ
is there anyway to write files to steam workshop folder?
oh wait, is it UAC problem?
oh god, i found it. it's inside zomboid/steamapps folder hahaha ๐
It's not possible to add new moodles?
function UdderlyAmmoCrafting.OnCreateGiveScrapBits2(items, result, player)
player:getInventory():AddItem("Base.ScrapMetalBits", 2)
end```
should this not give 2 of the item?
all numbers i throw in there all just give you 1
oh wait i think it's AddItems
of course it'd be a single character
it always fucking is ๐
it sure is possible
๐
Hi, does anyone know how to edit a zombie's backpack? I would like to know how to, so please ping me so it will notify me. Thank you in advance
that question doesn't make much sense
zombie backpacks are just random backpacks from outfit sets
do u mean edit it as in change its contents, as in change the item, as in change which backpack, etc..
if u mean which backpack then u wanna edit outfits i think
or else add to the pool of potential stuff in the outfits via distribution table stuff
@bright heron
Hey it is posible to change size of Models? Dk if asked that question here be4.
I wanted to do bigger zombies
@weak sierra so it's not possible to edit zombie backpacks? Like add items on it. If not that's sadโน๏ธ
I'd say do reverse engineer on Authentic Z mod, they have some fat zombies, maybe you can grab ideas
@empty cove no, not the capacity, i want to add items inside the backpack
if im not mistaken, you can edit the predistribution thingy for that
zombies use the same 3d models as player characters afaik. so changing zed models cannot not directly be done without changing the player character's models. a work-around is to equip the zeds with tricky clothing items which give the impression that they have a different body type or size.
@bright heron
Take a look at 'distributions.lua' and 'proceduraldistributions.lua' inside vanilla 'media/lua/server/items' directory
Hmm, i think it will only add items inside the inventory of the zombies not inside the backpacks i guess
If your mod contains a lot of items which shall be distributed, you might use this snippet as well for a single ItemDistributions.lua per mod: local ItemDist = { -- LootableMaps { Distributions = { {"CrateMaps", 50}, {"CrateMaps", 20}, {"CrateMechanics", 2}, {"GasStorageMechanics", 2}, {"Magazine...
this is from distributions lua
There's one for Outfit_Inmate
Aye thanks, I will try to do that and add some things, thank you
np
does anyone knows what does '<local2> is null' means for errors?
i'm having intensified confusion which can't be solved easily.
Problematic line
local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small)
Caused by: java.lang.NullPointerException: Cannot invoke "zombie.core.fonts.AngelCodeFont.getLineHeight()" because "<local2>" is null
So question, how do you put items in their backpack like
table.insert(SuburbsDistributions ["all"]["Bag_InmqteEscapedBag"].items, "Base.Axe");
table.insert(SuburbsDistributions ["all"]["Bag_InmqteEscapedBag"].items, 50);
Like this?
That should be InmateEscapedBag sorry for the typographical error
Does anyone know a mod to give Welcome item for the first spawn only? So the Welcome item will only spawn once since the player enters the server?
wasnt there a setting for this in the ingame server options? so maybe you just have to check server config file for that
any links for zomboid API documentation, i wanted to see all the vehicles method that i can call...
and what's the result data type
How are some servers getting away with a long description and a long mod list, when i exceed it flags my server as ??? but then i look at the server list and see long descriptions and 200+ mods, how?, any ideas how you can reduce the size? Is server mod packs the way?
how XD
there are no mods on the workshop that add new moodles
hi guys , which program can i use to start making mods ?
Any ideas?
i have some nice ideas and would like them implemented as mods
Notepad ++ is good or vs code
bruh
Trying to figure out how to add a corpse to a square, currently looking at the docs and it specifies a addCorpse function to the IsoGridSquare object. Not sure how to properly construct a IsoCell and properly call the function, any help?
*or i can somehow construct a custom corpse and use it in addCorpse?
We have a mod that lets you know how much you gain a skill when you're skilling it.
Do we have a mod that lets you know that stuff by percent? How much that skill pool towards your next lvl has already filled by percent?
Spitting out a new, improved percent as you keep leveling
ye but that a cloths visuals
Hi guys, the mods I have added to my server are not working. I added it via the text file with the workshop id. Do I need to open a new map?
Just curious what mods you guys recommend for someone thats trying to just be casual and shoot zombies for days?
just dropping this here, perhaps someone will find this useful: https://github.com/kldzj/pzmod
it makes working w/ hundreds of mods a bit easier than going in raw
Not exactly sure what do you mean... With tricky clothing items, there are a lot of things you can do to give the player the impression that zeds (or even player characters) have various new bodily features. As an example, the mod Authentic Z uses this trick to make overweight zombies and it works quite well. But whether this really could work in your case depends on the exact type of modification you want to apply ofc.
Which one is yours?
Also congarts
It always feel great to see it
I'm trying to create a custom WeaponReloadType, like revolver or shotgun, how would i go about doing this? Also congrats pwrcosmic.
What section in the code to stop blood from appearing on a certain weapon?
BloodLocation = is for clothes only right?
What would it be for weapons?
BloodLocation is for clothes (although it might be that weapons have a similar or even the same system). To stop blood splatter appearing on a certain part of a clothing item, you can search for the item's script entry (in vanilla folder "scripts") and then delete the respective BloodLocation from there.
Thatโs clothing item, looking for weapons
I donโt think weapons are classed as clothing items in the code
Or none that I have found at least
Ok... No they aren't for clothing. Your post was a bit unclear because your first sentence is just "What section in the code to stop blood from appearing on a certain?" Probably forgotten a word... ?
I know they used a singular texture file for all weapons as you can turn it off in the games settings, but I am not sure where that moniker is
I missed weapon out but underneath I put โWhat is it for weaponsโ
yeah people have wanted this
grats
i keep sabotaging myself by posting some mods unlisted while i test them in mp for days and then releasing them, thus making them not show up as new lol
Where can I commission someone to make a mod?
I have a question, does the rv interior mod and the basements mod interfere with one another?
fiver? XD
Nope, already checked. No takers
sanity check: if i had an item, X, which spawned at rate Y, and i want to replace it with a group of variants, say colors, of X, but spawn only the same number of X overall regardless of color.. i should give each variant an Y/#Variants chance to spawn, yes?
im pretty sure it's against TIS's policies
for whatever reason
Oof
can somebody help me, im trying to figure out how to use the "addZombiesInOutfitArea()" i wanna use it in function which get triggert by recipe over an OnCreate:
You can always use the server command 'CreateHorde2'
thx mate, but i would need to make the allways manually, right? cuz i wanna make a recipe that spawns a mini horde whenever a player uses that recipe ๐
No, I think someone did something that called the createhorde2. Just a moment, I'll link to you
oh cool! many thanks!
awesome man! thank you very much! ๐ ๐
np
Anyone have any insight why this wouldn't spawn my custom item? The item itself works and can be spawned in with commands, but seems to refuse to ever drop even after ~300 zombies killed.
require 'Items/SuburbsDistributions'
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "CS_Storage_Fridges");
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 1);
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "CS_Storage_Fridges");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 1);
Anyone got a sample on how to call the "garbage cleaner" earlier? Like force a clean corpse on the server?
I'm pretty sure this table you are doing is not for zombie drops, but for loot spawning in the world. Let me check here if this is the right way
function CheckDrops(zombie)
if not zombie:getOutfitName() then return false end
local outfit = tostring(zombie:getOutfitName());
local inv = zombie:getInventory();
if outfit == "TheyKnewNBC" then
local lootchance = SandboxVars.TheyKnew.LootChance;
if lootchance >= ZombRand(1, 100) then
inv:AddItems("TheyKnew.Zomboxivir", 1);
end
local pillslootchance = SandboxVars.TheyKnew.LootChanceZomboxycycline;
if pillslootchance >= ZombRand(1, 100) then
inv:AddItems("TheyKnew.Zomboxycycline", 1);
end
end
end
Events.OnZombieDead.Add(CheckDrops);
This is how the "TheyKnew" mod deals with adding items to the drop table
You can skip the If Outfit == check or simply change it to If 1 == 1
Right, but this would also be an unusual case where its directly tied to the sandbox variables
What do you mean? You can just remove the SandboxVars and add a number there, like 10, 50
This is just a more complete example
So it helps in whatever way you want
You can tie to a specific outfit, or you can do it with a lootchance tied in the sandboxvars, or just skip everything and just add the item
was making a simple mod, and i went to change a texture and fix some mistakes in a few names of things - i fix the names, i change the texture, and now the mod freezes the game up
ugh
ive reviewed for syntax errors multiple times
i see nothing
making an extension mod for military poncho mod
LOG : Mod , 1662322900687> mod "MilPoncho" overrides media/fileguidtable.xml
LOG : Mod , 1662322900690> mod "MilPoncho" overrides media/lua/shared/translate/en/contextmenu_en.txt
LOG : Mod , 1662322900724> loading MilitaryPonchosExpanded
LOG : Mod , 1662322900749> mod "MilitaryPonchosExpanded" overrides media/fileguidtable.xml
LOG : Mod , 1662322900751> mod "MilitaryPonchosExpanded" overrides media/lua/server/items/mponcho_distributions.lua
LOG : Mod , 1662322900753> mod "MilitaryPonchosExpanded" overrides media/scripts/recipes.txt
LOG : Mod , 1662322900760> mod "MilitaryPonchosExpanded" overrides media/textures/clothes/mponcho/mponcho_yellow.png
LOG : General , 1662322900773> translator: language is EN
it stops there
how the hell do you guys know so much about modding?
is it experience or is there classes?
experience
how long have you been modding for?
holy shit
and modded one other game
and made game engines and stuff
all that helps a lot
not everyone has as much experience going in as me, u can learn it either way
yeah lua seems way easier then c#
C# is what i prefer, strongly
i agree with you
i am good enough at that to teach classes on it
but lua is a headache
and the script language in PZ is worse cuz no syntax checker
how come?
what's a syntax checker?
it.. it checks the syntax

it checks for mistakes in formatting of code or references to things
so basically like a teacher grading your test which is our code in this scenario?
kinda
started making many, finished none
i seem to like making game engines and content but burn out on the inbetween
but i had untreated ADHD for a long time so maybe ill finish one next time
lol
say, you make game engines, what's the difference between making one and using something like unity or unreal?
you get more control and there's tradeoffs
if you make your own you can tailor it to your project as much or as little as you want
and you can do things your way
but you have to understand a lot of things and it takes longer to put together if you have to learn them as you go
if you use a premade one you're constrained to what they decide to make possible in many cases
and it might or might not be optimized for what your game is or does
but you don't have to know as much about how game engines work
this is pretty off topic for the channel at this point :P
Does anyone know a mod to appear with nothing?
yo i gotta question
where do find like game saves
not like in files
but like someones savegame i can import into my game
it was another missing bracket
this time it cost me.. 2 hours
instead of 5
i again reiterate my emphatic request for a syntax checking pass for scripts
i suppose i should formalize this request on the forum
at the rate we're going i might have to write my own syntax checking tool
wrong channel, unless ur about to say you're making one
finally managed to spawn some Z over a recipe, how could i make them aggro the player as soon as they spawned? i used the DoFootSteps before, but it seems to be triggert the very moment the Z spawn so they dont aggro. anybody has another idea? ๐
Do you mean that you have no items when you spawn or do you mean something else?
I tested and my original code actually works with Vanilla items (using the insert.table method, zombies are spawning crowbars).
I also noticed my custom item vanishes if I leave and rehost with it on the ground/in my inventory, so its something about the custom item and not how i'm distributing it.
can somebody tell me whether it's possible to make http requests (access sockets) in the pz lua runtime?
nope can't do. io and os is not made accessible afaik (https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md#zomboids-lua-component)
oh nay, thanks for finding that reference
luckily enough it seems like my use case can also be handled via rcon commands
I have a perplexing question.
How would I handle something like a "jumper cable" if a car just.. drives away while it's connected.
Would it remain connected to the first battery and be disconnected from the second? Would it just plop on the ground (assuming that's even possible or remotely easy)?
cancel the action and break the cable
That's the problem though, it's not so much an action.
It'd be closer to how the towing mechanics work, minus the towing.
It'd take an action to set up, but once it's it's set up, it's set up.
well, then just use the same logic as for normally disconnecting the cable, but i'd love to see the cable break if someone were to just drive off ๐
It would be entertaining
use random chance to determine on which car it still is attached
holy cow
btw i recognize u from project apocalypse
you can try urlstream, i saw it defined inside luamanager but cant remember the actual name so if you've decompiled the game, you can look for that
and i didnt test it yet
will definitely investigate, it would be much more worthwhile to also have the results running through the game's event loop
how do you know what is available to import and which methods/functions are available on each class/object?
super noob here, attempting my first mod
i have like amaxzing idea for u mod nerds. make m0ore militry police stuff now...good ok, bye
๐
Anyway to message the developers of this game? (for modding related questions)
As an example of what I mean, here's a snippet of code from the BackPack Borders mod:
require "ISUI/ISInventoryPage"
-- Add background and border to new buttons
ISInventoryPage.addContainerButton_pre_backpack_borders = ISInventoryPage.addContainerButton;
How does one find out what we is available to require at the top and additionally what functions/methods are available on those imported objects/classes such as ISInventoryPage.addContainerButton?
Trying to create my first mod and I'm stuck just getting started. Any help is appreciated.
find a way to debug and then just check if (ISInventoryPage)
And if a file ends with return statement, you get thatt variable or object
such as
myVar = require "ISUI/ISInventoryPage"
And if ISInventoryPage has
local MyObj = {};
return MyObj
in the end
But anythign that's not a local definiton should be available
This is a good resoruce
oh hey
i cant say i remember that name from there
but 
having trouble marking recipes as obsolete
it throws no error but the recipes just.. stay there and are accessible/usable
e.g.
recipe Make Military Poncho (Green)
{
Tarp,
PaintGreen,
Thread,
keep KitchenKnife/HuntingKnife/Scissors,
keep Needle,
Result:MPonchoGreenUP,
Sound:ClothesRipping,
Time:300.0,
AnimNode:RipSheets,
Category:Survivalist,
SkillRequired:Tailoring=2,
Obsolete:true,
}```
@weak sierra Are you able to help me out with a map mod I have? My friends don't have the same issue in the same server but I do. I can give you the details if you're up
@weak sierra In the Daegu map mod in specific, it messes up my view of interiors by enlarging them or bugging the shadowing effects
it's weird af, and the problem only happens for me in the server but not my friends
did u make sure 2x textures is enabled?
that is def wild
this is probably better for #mod_support btw
i see u already posted it there
@zenith smelt Thank you for the help! By "find a way to debug" do you mean the "-debug" command in launch options?
How do I find the files you mentioned? I can't find the source files for PZ on my machine, would me being on Mac instead of Windows have anything to do with that?
I've read over that resource you linked but I haven't found information on the basics of getting started anywhere such as what I'm asking here ๐ฆ
local message = "Test debug message"
local fileWriterObj = getFileWriter("my_debug.log", true, true);
fileWriterObj:write("" .. message .."\r\n");
I don't know how to make it write to the normal logs so I just did this
and then I can turn that into fucntion and just
myvar = 3+3;
local message = "Test:" .. tostring(myvar);
mydebugtest(message);
The best way to learn is to just try to see how some mods work I guess ๐
Where is that in options?
:p
How do I increase the damage a player deals on an attack?
I don't know but I think there'
There's like something like "anger mod" on steam work shop that might do that
I'm talking about how to increase damage via lua :P
I'm thinking of making a mod where players earn Trait Points in play to either buy new traits or buy off negative traits. Perhaps for every so much XP earned by levelling, you get a single trait point.
Is this possible to do?
Or is zomboid modding support to the point where almost anything is possible?
if i set someone as collaborator to my mod
then both of us can update that mod right? does it apply to unlisted mods aswell?
There's a little line
For some reason, I don't thin kit's there on the image
Is this a texture bug?
Wh
When I open the texture in photoshop
There is no edge
But in-game there's an edge
Transparent texture bug
How to attach custom weapons on zombies back?
media\lua\shared\Definitions\AttachedWeaponDefinitions.lua
-- katana in stomach
AttachedWeaponDefinitions.katanaStomach = {
chance = 1,
weaponLocation = {"Stomach"},
bloodLocations = {"Torso_Lower","Back"},
addHoles = true,
daySurvived = 60,
weapons = {
"Base.Katana",
},
}
Like that?
I think this is a texture compression bug, so I will just use a different solution
Thanks for the reply.
Just like that, but how can I put it only on outfits? For example ArmyCamoDesert and ArmyCamoGreen have custom guns in their backs
Nvm, I found the coding where you could put it in zombies back. I will come back when it doesn't spawn
It doesn't work :v
If you just wanted to make guns appear on the clothes and not actually be lootable guns, maybe just make it part of the clothing model?
Lootable, like a police outfit zombie with shotgun attached on its back
can you show what youve done? also there already is a shotgunPolice btw.
AttachedWeaponDefinitions.shotgunPolice = {
id = "shotgunPolice",
chance = 30,
outfit = {"Police", "PoliceState", "PoliceRiot", "PrivateMilitia"},
weaponLocation = {"Rifle On Back"},
bloodLocations = nil,
addHoles = false,
daySurvived = 0,
weapons = {
"Base.Shotgun",
},
}
Here
Ohh, so they will spawn on the outfit you choose
you can create a new outfit defiitnion too?
Outfits have some GUID thing
I dunno how that works
Yeah yeah
I looked in the AuthenticZ and yeah you can create new outfit definition
maybe best thing to do is to double check the AttachedWeaponDefinitions.attachedWeaponCustomOutfit.PrivateMilitia in the console to double check that your changes made it in properly
Sorry I didn't get that since I'm only new to this thingy, what do you mean by that?
I browse the AttachedWeaponDefinitions.lua and find that and copy all the "AttachedWeaponDefinitions.attachedWeaponCustomOutfit = {};" into my file
Nvm
It worked, thank you @shadow geyser
nice. also for future reference, what I meant was to check in the console in game. if you launch PZ with the -debug option, you get a bunch of debug stuff when you go into a game. and there is a console there which you can type lua code to do some digging if you need to. so for example in this case you could have gone into the console and typed for i,data in ipairs(AttachedWeaponDefinitions.assaultRifleOnBack) do print(data) end, and it would print out the contents, and it lets you manually check what the game has. it helps alot if for example you just made a typo and set some other table that isn't being used.
I see it's very helpful.
Now my problem is how do I put items inside the NomadBackpack in Undead Survivor mod
