#mod_development

1 messages ยท Page 21 of 1

storm snow
#

Scratch that...found the actual recipecode.lua ๐Ÿ˜…

#

Well, if there's any guide out there, would be wonderful, though the recipecode.lua unblocks me somewhat

jagged ingot
#

Also if you know what Typescript is and how to use it, you have the option to code mods with it.

storm snow
#

I do know, is there a transpiler for lua or does PZ accept ts and transpile it itself?

jagged ingot
#

I'm a part of the team that wrote homebrew code that transpiles both the Java and Lua API as typings.

storm snow
#

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 ?

upper junco
#

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

jagged ingot
#

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.

storm snow
#

Sure, please do

jagged ingot
#

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.

#

๐Ÿ‘

random finch
#

Do players need a to patch their cient?

jagged ingot
random finch
#

What about the Java portion?

jagged ingot
#

You'd patch it for the server-side yes.

#

Not client.

random finch
#

I have an assumption that if you alter java side code, youd need to change the client as well.

jagged ingot
#

Only if you change the protocol or something sensitive that wouldn't work otherwise.

random finch
#

I guess if there is code that is only imitated server-side, then thats when a patch is not needed?

jagged ingot
#

Minecraft servers are almost always modded now which works with vanilla clients. (Unless it's forge)

grim rose
#

Oh you doing something to increase tailoring XP?

#

Like making clothes?

jagged ingot
#

PZ can also work with modified servers. Unfortunately people aren't as aware of what you can do with the server. ๐Ÿ™‚

storm snow
#

Yeah, for starters, just making a small recipe, but wanted it to give exp

storm snow
#

But I had a bunch of ideas and am thinking I need those function hooks

grim rose
#

But only not for tailoring

#

Because this xp is given difrently or something like that from what i have heard

storm snow
#

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

grim rose
#

You have to make custom lua file that will give you XP

#

With custom lua command

storm snow
#

Yes, from what I can tell, I make the function, but the function has a special signature

grim rose
#

If you give me 5 mins i will send you one because i already made it

#

5-10mins

#

I will take shower

storm snow
#

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

grim rose
#

Oh so you mean more effects you can do?

random finch
jagged ingot
#

We go back to 2015.

random finch
#

PZHook seems to require client side patches

storm snow
#

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

random finch
grim rose
jagged ingot
#

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. ๐Ÿ™‚

grim rose
#

Like webpage with effects

jagged ingot
rough dew
#

nvm, no [,] here

#

Would this be doable in Lua?

storm snow
#

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.

grim rose
#

I was too

#

I still am

#

Anyway

#

@storm snow you want that Tailoring XP thingy?

storm snow
#

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.

grim rose
#

yea, i see you prefer to get fishing rod rather than fish

storm snow
#

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"

jagged ingot
#

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.

storm snow
#

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

jagged ingot
#

PipeWrench has a modeling solution for generating human-fed documentation from modders to the typings.

grim rose
#

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

mystic rampart
#

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

grim rose
#

tooltip:
?

mystic rampart
#

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

grim rose
#

item item
{
DisplayCategory = x,
Weight = x,
Type = x,
DisplayName = x,
Icon = x,
WorldStaticModel = x,
Tooltip = Your book name here,
}

mystic rampart
#

Nada, just adds an additional tooltip

grim rose
#

:?

#

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,
    }```
mystic rampart
#

Yeah, I found those but that's only the name of the book (which is working), not the 'BookTitle'

#

For reference

grim rose
#

i see

#

hmmm its tooltip

mystic rampart
#

I'm not super familiar with lua yet, could it need an object? tooltip: { booktitle: name } ?

grim rose
#

look up in lua/shared/Translate/EN/TooltipEN

mystic rampart
#

I see I see, let me try that

grim rose
#

so create file like this in your lua folder

Tooltip_EN = {
    Tooltip_BookTitle_spear = "Spear",
 }
zenith smelt
#

image in text

grim rose
#

item item

       DisplayCategory = x,
       Weight          =    x,
       Type            =    x,
       DisplayName        =    x,
       Icon            =    x,
       WorldStaticModel =   x,
       Tooltip_BookTitle_1,
       Tooltip_BookTitle_spear = "Spear",
   }```
mystic rampart
#

Yeah that still seems to be failing

grim rose
#

eh i hope it will help

#

other than that

#

goodnight

mystic rampart
#

Rip thanks for taking a look though

#

Adding that made the associated book disappear from my world altogether though lol

sour island
#

Anyone know if you can request/receive parts of a modData table or would I have to create a new modData per list?

coarse folio
#

Hello, would I be able to get some assistance with adding a map to an MP server via Gportal?

empty cove
#

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.

empty cove
sour island
#

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

glad ridge
#

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,
    }```
weak sierra
#

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

quasi kernel
#

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.

empty cove
# sour island global modData

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

sour island
#

the entire table transfers fine

#

but I would like to transfer a part of it at a time for optimization sakes

empty cove
#

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

weak sierra
#

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

sour island
#

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

empty cove
#

@sour island
Looks like you can't optimize it further.

sour island
#

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

glad ridge
mystic rampart
#

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

empty cove
#

@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

sour island
#

I'd just like to be able to send a nested key/value

#

rather than the entire table

empty cove
#

to a client right?

sour island
#

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"

empty cove
#

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

zenith smelt
heady crystal
#

Anybody know which function is called when the player attacks? If we have such access that is

acoustic dust
#

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

glad ridge
#

is it your own bag or the base bag

acoustic dust
#

vanilla school bag

vivid imp
#

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

shadow geyser
# weak sierra e.g.

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.

vivid imp
#

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

shadow geyser
acoustic dust
#

is it possible to upgrade a backpack via crafting which results in higher weight reduction and capacity?

shadow geyser
#

yes, you would just need to make a recipe to turn the back pack into a new item with better stats

acoustic dust
#

how do i do that?

#

do i just write a script and put it in a folder?

grim rose
#

You writte recepie file

#

In same folder like item file

acoustic dust
#

so i just make a folder named whatever, put 2 files in it, one for recipe and one for the items themselves?

#

that simple?

grim rose
acoustic dust
#

and what's that

grim rose
#

It will get you on trackp

acoustic dust
#

imma go search on Reddit

acoustic dust
#

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

glad ridge
#

Just dl a backpack mod and follow the structure

acoustic dust
#

dl?

glad ridge
#

You can have the recipe and bag in same txt

#

Off workshop.

acoustic dust
#

i know

#

but what i want is real simple so i like to do it myself

#

it gives me a sense of accomplishment

glad ridge
#

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

acoustic dust
#

i still don't know what dl means

glad ridge
#

Down

#

Load

#

Dl

acoustic dust
#

ohhh

#

so all i need is a backpack mod and add and remove stuff from till i get what i want?

glad ridge
#

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

acoustic dust
#

that's smart

#

also can i use the same models and textures as the vanilla ones?

glad ridge
#

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

acoustic dust
#

and where can i find the mod folders?

glad ridge
#

C:\Program Files (x86)\Steam\steamapps\workshop\content\108600

#

something like this

acoustic dust
#

alr i think i can make my mod

#

thx

#

but how do i install it?

glad ridge
#

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

acoustic dust
#

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?

glad ridge
#

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

rough dew
#

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

acoustic dust
#

how do i make a loot table, like hoe can i make my items spawn in the world?

#

naturally without debug

rough dew
#

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

hidden compass
#

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
empty cove
#

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.

GitHub

LUA framework for project zomboid. Provide necessary tools for modders. - GitHub - Li-Zero/PZ-Simplify: LUA framework for project zomboid. Provide necessary tools for modders.

quasi kernel
#

Are the detections for towing lua-side?

#

Same goes for detections of the front of the cars.

acoustic dust
empty cove
#

asking item modders would be a good idea

livid geode
#

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)?

acoustic dust
#

alrighty then

hidden jungle
#

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?

shadow geyser
weak sierra
#

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?

weak sierra
halcyon tide
#

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?

hoary sage
#

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?

livid geode
#

Thanks a lot for the help UdderlyEvelyn and Robot ex140
You da best ๐Ÿซ‚

acoustic dust
#

some craftings says 300 for crafting time, but i doesn't take 300 seconds

#

how is that calculated?

livid geode
acoustic dust
#

so it's ticks

weak sierra
#

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

acoustic dust
weak sierra
#

you can add ur stuff to the procedural distribution tables

#

that's the typical thing to do these days

acoustic dust
#

but I don't know how

#

that's the problem

weak sierra
#

:|

#

i told u the keywords

#

so

#

yeh

acoustic dust
#

thx

#

nothing shows up

weak sierra
weak sierra
acoustic dust
#

alr

quasi kernel
#

@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

weak sierra
#

tbqh that's entering territory i haven't tread in yet

quasi kernel
#

agony

weak sierra
#

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

quasi kernel
#

Figured vanilla radio would be the way to go for that

#

Cuz then I can copy over the funny battery meters too

ancient grail
#

pls help

#

how do i do a teleporter script for players? i got this error when i attempted to do just that

acoustic dust
# rough dew

how do i make my scripts in notepad++ colory like this?

ancient grail
#

-- SendCommandToServer("/teleportto 12515,3452,0");
-- getPlayer():setX(12515);
-- getPlayer():setY(3452);

weak sierra
#

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

ancient grail
weak sierra
#

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

quasi kernel
#

oh no, it requires TILES files

weak sierra
#

icky :p

#

please link me to resources you find on this

#

im sure i'll end up in that world soon

#

do wish that you could just define tiles in a similar manner to an item script.

livid geode
#

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)

quasi kernel
#

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.

shadow geyser
livid geode
quasi kernel
#

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.

livid geode
#

Do I just add player.IsoCharacter:getBodyDamage():setIsInfected = true
Inside a function or do I need to do something more to make it work

quasi kernel
#

That might work, I'm unsure though since I don't have the code at the top of my head atm

livid geode
#

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

acoustic dust
#

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?

ancient grail
#

you guys figured this out yet? how to use teleport or move position if comands from the client?

weak sierra
acoustic dust
#

is anyone free enough to help me with a few minor things about my mod?

acoustic dust
#

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,
    }
    
}
shadow geyser
#

and making a mod that adds more crops is alot of effort to make them compatible with each other

acoustic dust
#

well what do i do then?

shadow geyser
#

honestly, would probably just be easier to find one on workshop that already does that if you just want more flour

acoustic dust
#

there is none

#

not that i found

crystal burrow
#

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

shadow geyser
#

there are definitely many

acoustic dust
#

well, can't copy a plant like potatos and change the values and name?

#

i really don't care about the growing visual

shadow geyser
#

soul flechers has wheat

acoustic dust
#

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,
    }
shadow geyser
acoustic dust
#

alr

#

also a question

crystal burrow
#

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

acoustic dust
acoustic dust
#

like how do i specify that it needs to be done via an oven?

shadow geyser
#

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

acoustic dust
#

alr so i'll just do it like a normal recipe

shadow geyser
#

yeah that would be the easiest way

livid geode
#

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

zenith smelt
#

When a timed action runs :perform
Is there a good way to still fail the action?

shadow geyser
acoustic dust
#

if I want to add a custom icon, i have to place the png in the media/textures folder?

shadow geyser
livid geode
#

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

zenith smelt
acoustic dust
#

guys i made a mod but how do i test it out?

#

before uploading it

zenith smelt
#

like how to load it in-game?

acoustic dust
#

yes

#

where to put the folder and stuff so i can enable it ingame

zenith smelt
#

I put mine in

%USERPROFILE%\Zomboid\mods
#

And then I run the game with -nosteam -debug and add it from the mods menu

acoustic dust
#

what's nostream?

zenith smelt
#

-nosteam just launches the game as non-steam version.
I don't know if you can load the user mods from the normal version

acoustic dust
#

i see

#

and if it all went well

#

how do i upload to steam workshop?

zenith smelt
#
%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

acoustic dust
#

is it supposed to be like that?

zenith smelt
acoustic dust
#

alr

acoustic dust
#

I assume yes

zenith smelt
#

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

acoustic dust
#

nothing loaded in correctly, the whole thing is a mess

#

im sad now

quasi kernel
#

@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.

zenith smelt
# acoustic dust nothing loaded in correctly, the whole thing is a mess

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

GitHub

Guide to modding various aspects of Project Zomboid - GitHub - FWolfe/Zomboid-Modding-Guide: Guide to modding various aspects of Project Zomboid

weak sierra
#

only when game makes it hard

#

sometimes u gotta do that sort of hack for maximum compat

quasi kernel
#

It's so dumb but it works

weak sierra
#

in modding-land

quasi kernel
#

I still have 'hardcoded" compatibility just in case for a specific few mods

weak sierra
#

yeah thats ideal

#

esp since recipe name COULD be different

#

but eh

quasi kernel
#

Yea

glad ridge
acoustic dust
glad ridge
#

Put in the workshop folder and enable mod

acoustic dust
#

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

glad ridge
#

Well that's a different issue then

acoustic dust
#

yeah nothing went as planned

glad ridge
#

What are you trying to add besides bag

acoustic dust
#

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

glad ridge
#

Ur trying to make your own straps and leather instead of using the leather strips provided in the base game?

acoustic dust
#

no, leather is just 5 leather strips stitched togather

#

and strap is rope,ripped sheet and denim strips combined

glad ridge
#

So a recipe to craft from the base materials? Should be pretty easy

acoustic dust
#

yes

glad ridge
#

Follow the base games recipe txt for a guideline

acoustic dust
#

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

acoustic dust
quasi kernel
#

@weak sierra do you know a way to check if an item is a drainable

#

nvm found it

glad ridge
acoustic dust
#

I'll try tomorrow

weak sierra
acoustic dust
#

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?

glad ridge
#

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

glad ridge
#

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

acoustic dust
#

...no

glad ridge
#

So..

#

That's what I'm saying....

#

If they got it to work..

#

Follow their steps

acoustic dust
#

but i don't think there is a mod like that

#

is there?

glad ridge
#

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

acoustic dust
#

a mod that uses vanilla items to make another item

#

should be easy enough to find

glad ridge
#

That's not what you want tho..

acoustic dust
#

but that's a start

quasi kernel
glad ridge
#

Ok I thought you did that last night when I was talking to you lol

acoustic dust
#

i found a mod for tje backpack

#

but not tje other stuff last night

#

the*

glad ridge
#

Well gl

acoustic dust
#

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

glad ridge
#

Yep prolly easier for first mod

acoustic dust
#

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

empty cove
#

@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

small topaz
#

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.

quasi kernel
#

I believe if it's loaded after yes

#

If it's loaded before, that's a whole other can of worms

small topaz
#

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...

thorn bane
#

Is there a way to create a trait that decreases weapon effectiveness except for a few that I've selected?

small topaz
# thorn bane Is there a way to create a trait that decreases weapon effectiveness except for ...

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.

shy aurora
#

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?

thorn bane
# small topaz Here is a simple way which will NOT work in multiplayer but could be used in sin...

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
small topaz
wooden lodge
#

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?

quasi kernel
#

Just added loads of support to my mod, feeling good

undone elbow
#

How many ticks per second in PZ?
Is it different for different clients among themselves and for the server?

wooden lodge
#

If there is, please @wooden lodge so I see it. Ty a lot

small topaz
# thorn bane Not gonna cut it unfortunately, this mod does need to be supported for MP. I've...

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.

quasi kernel
#

Well, it doesnt change on game speed, and that's kinda the problem with it at times.

undone elbow
#

I guess it shouldn't vary if CPU < 100%

thorn bane
small topaz
thorn bane
small topaz
thorn bane
#

Fantastic! I'll give it a whirl :)

small topaz
# thorn bane 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

thorn bane
small topaz
thorn bane
#

I'll work on it later today though, I'll manage :D

small topaz
thorn bane
#

It doesn't print it all, chucks the entire error screen at me

small topaz
#

so, printing does not work if you include "print(weapon)" as the first line of the function mundane(_actor, _target, _weapon, _damage)?

thorn bane
#

Ah, I did print(weapon.getFullType()) instead of just weapon. Was that really the issue?

small topaz
#

important EDIT: not first line, but after the command "local weapon = _weapon"

thorn bane
#

Did that, don't worry :v

small topaz
#

first thing: you need weapon:getFullType() with a ":" instead of a point "."

thorn bane
#

Ouuh, that'd make sense

#

I'll quickly edit that, one sec!

small topaz
#

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....

thorn bane
#

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

small topaz
thorn bane
#

Yeah sure, one sec!

small topaz
#

ok... already found the code

#

now, what action should I do in game? just fighting?

thorn bane
#

Yeah, on Player attack

#

I'll write some pseudo code, one sec

small topaz
#

and what trait do I have to give to my character?

thorn bane
#
player = getPlayer
weapon = getWeapon

if player:Profession == SpecificJob:
  if getWeapon == isShortbladed:
    (Do twice the damage)
  else:
    (Do 0.25x the damage)
thorn bane
small topaz
#

ok... so I just try the original more traits mod and see whether I can find out that weapon stuff

thorn bane
#

Sure sure, thank you so much Razab ^^

small topaz
#

@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

small topaz
thorn bane
#

Thank you tho Razab, Iโ€™ll update you when Iโ€™ve gone through it

small topaz
#

kk

empty cove
#

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
small topaz
vivid imp
#

Is there an event when the user shoot a firearm?

thorn bane
small topaz
coral briar
#

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.

empty cove
#

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?

ancient grail
#

how do i call a function when a player steps on a specific coordinate

ancient grail
#

and way to

[insertscripthere]
end```
empty cove
#

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,
shadow geyser
empty cove
#

@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,
acoustic dust
#

maybe that means one yeast?

#

the in game recipe that uses yeast just takes one yeast per items crafted so...

shadow geyser
#

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

quasi kernel
#

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

shadow geyser
#

what happened?

#

can't you just revert what you changed?

quasi kernel
#

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

shadow geyser
#

yeah thats alot cleaner

quasi kernel
#

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

lucid talon
#

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.

empty cove
#

mind if i ask something about worldstaticmodel for item script? can you use image texture like 64x64 icons?

cosmic condor
#

an icon should be 32x32

empty cove
#

@cosmic condor
so, you can use icon for worldstaticmodel? and thanks for the info

cosmic condor
empty cove
#

okay. thanks alot, i really appreciate it ๐Ÿ‘

#

uh wait, i don't need to define the 'worldstaticmodel' if i dont have it then?

cosmic condor
#

you can define it to your png file

empty cove
#

and the png file needs to have the 'Item_' prefix right?

cosmic condor
#

not sure though, you should try it ๐Ÿ˜‰

empty cove
#

alright, will do so

cosmic condor
#

trial and error and you will remember that

#

my advice maybe wrong lol

empty cove
#

yeap... i'm already occupied with lua errors hahaha

#

will try the model thingy and see if it works that way

cosmic condor
#

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 ๐Ÿ˜…

empty cove
#

@ancient grail
Can you teach me how to get player's wayto value?

zealous wing
#

Help I have a problem.
It's called addiction to mods.
Plz help, what's the cure?

#

I am at 524 mods. ๐Ÿ˜ญ

wet osprey
#

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,
    }    ```
shadow geyser
empty cove
#

thanks

eternal garnet
#

Np

ancient grail
empty cove
#

oh sorry, i misunderstood it haha

#

you mean way to use the faction. sorry for bothering you. ๐Ÿ™

grim rose
grim rose
rough dew
#

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

noble patio
#

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?

rough dew
#

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

eternal garnet
#

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?

random finch
#

Also. IsoUtils.java

#

If you get it done, I'll use your restriction mod

rough dew
random finch
#

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

rough dew
#

will do, thx for the tip.

weak sierra
#

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 ๐Ÿคฃ

cosmic condor
modest meadow
#

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.

ancient grail
ancient grail
ancient grail
autumn garnet
weak sierra
#

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

cosmic condor
weak sierra
#

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

elfin stump
#

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?

drifting ore
#

Is there a mod where zombies die by entity cramming against a wall?

#

Or trample each other

drifting ore
#

Nice

unkempt bronze
drifting ore
#

Aight

wet osprey
grim rose
#

like last time i seen zomboid being mean because someone wanted to have 1.5 fanny pack

wet osprey
#

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

keen stratus
#

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

keen stratus
#

Wow... talk about luck it needed to be in media/ui/Traits (yea capital T)/trait_<traitVar>

#

Icon not final

empty cove
vivid imp
#

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

elfin stump
empty cove
#

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

fiery pecan
#

heya. Question: How would I go about transferring modData from a specific tile type to an adjacent specific tile type??

vivid imp
#

hello, what would be the good way to increase distribution and spawn rate for a vanilla item?

brisk smelt
#

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

vivid imp
#

I haven't used that event, but try 58 instead of KEY_CAPITAL. I don't know

brisk smelt
brisk smelt
vivid imp
brisk smelt
#

u could just edit the itemdistribution script

#

and increase the spawn % in there

vivid imp
#

yes, I think I'll do that. I don't think that'll conflict with other mods

brisk smelt
#

yea i believe it's safe

vivid imp
#

about the KEY_CAPITAL

brisk smelt
#

as long as the item name doesn't overlap with other mods that you do not want to conflict against

vivid imp
#

`local function OnKeyKeepPressed(KEY_CAPITAL)

print("both")

end

Events.OnKeyKeepPressed.Add(OnKeyKeepPressed);`

#

try that

brisk smelt
#

ah, also did try that

vivid imp
#

wait no

#
    if key == KEY_CAPITAL
       print("MAYUS")
    end
end

Events.OnKeyKeepPressed.Add(OnKeyKeepPressed);```
mellow oyster
#

Is there any way i can contact a dev of this game to see about a certain mod idea?

brisk smelt
vivid imp
#

Whatโ€™s the error?

brisk smelt
vivid imp
#

Do you have more code in the function?

brisk smelt
#

yea but i just tried with only the code you gave me

#

produces same error

#

in this line

#

if key == KEY_CAPITAL

vivid imp
#

Weird, something else is failing in the setInfected method

#

Something has that method in the file

brisk smelt
#

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

vivid imp
#

Put a breakpoint and check the value of key

brisk smelt
#

good idea

#

looks like it's reading any keys that i press

vivid imp
#

Yes, thatโ€™s how it works. You need to put the conditional to react only to the key you want

brisk smelt
#

ah fixed it

#

u have to put the int digit for the keys

#

Thanks jorgeroic

vivid imp
#

๐Ÿ‘

brisk smelt
#

๐Ÿ‘

rancid tendon
#

public release of something i've been working on for the past few months

empty cove
#

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 ๐Ÿ˜‚

zenith smelt
#

It's not possible to add new moodles?

weak sierra
#
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 ๐Ÿ˜‚

brisk smelt
brisk smelt
bright heron
#

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

weak sierra
#

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

vivid imp
#

What's the format to translate Fixings?

#

I couldn't find anything in the base game

median lagoon
#

Hey it is posible to change size of Models? Dk if asked that question here be4.

#

I wanted to do bigger zombies

bright heron
#

@weak sierra so it's not possible to edit zombie backpacks? Like add items on it. If not that's sadโ˜น๏ธ

empty cove
#

if you mean by capacity, you can refer to that mod

vivid imp
bright heron
#

@empty cove no, not the capacity, i want to add items inside the backpack

empty cove
#

for zombies is it?

#

i mean zombies random backpack?

bright heron
#

Yeah, zombies backpack

#

Like in inmateescapd i want to add food inside of it

empty cove
#

if im not mistaken, you can edit the predistribution thingy for that

small topaz
empty cove
#

@bright heron
Take a look at 'distributions.lua' and 'proceduraldistributions.lua' inside vanilla 'media/lua/server/items' directory

bright heron
empty cove
#
#

this is from distributions lua

vivid imp
#

There's one for Outfit_Inmate

bright heron
#

Aye thanks, I will try to do that and add some things, thank you

empty cove
#

np

empty cove
#

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

bright heron
#

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

dapper geode
#

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?

young orchid
lime hedge
#

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

quaint mirage
#

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?

zenith smelt
empty nebula
#

hi guys , which program can i use to start making mods ?

empty nebula
#

i have some nice ideas and would like them implemented as mods

quaint mirage
young orchid
#

the help is real

#

but a bruh doesnt make it any better I believe ๐Ÿ˜…

delicate pilot
#

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?

pulsar niche
#

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

wild moss
#

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?

swift tapir
#

Just curious what mods you guys recommend for someone thats trying to just be casual and shoot zombies for days?

quasi kernel
#

@weak sierra SORRY FOR THE PING BUT LOOK

#

I DID IT, I DID A THING

hardy flint
small topaz
# median lagoon ye but that a cloths visuals

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.

grim rose
#

Also congarts

#

It always feel great to see it

quasi kernel
#

Better Batteries

#

And thankk

wise sinew
#

I'm trying to create a custom WeaponReloadType, like revolver or shotgun, how would i go about doing this? Also congrats pwrcosmic.

eternal garnet
#

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?

small topaz
eternal garnet
#

I donโ€™t think weapons are classed as clothing items in the code

#

Or none that I have found at least

small topaz
#

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... ?

eternal garnet
#

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โ€

weak sierra
#

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

fiery pasture
#

Where can I commission someone to make a mod?

drifting ore
#

I have a question, does the rv interior mod and the basements mod interfere with one another?

zenith smelt
fiery pasture
weak sierra
#

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?

weak sierra
#

for whatever reason

fiery pasture
#

Oof

undone crescent
#

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:

alpine scroll
undone crescent
alpine scroll
undone crescent
#

oh cool! many thanks!

alpine scroll
#

This message

#

It has a sample on how to use

undone crescent
#

awesome man! thank you very much! ๐Ÿ˜ ๐Ÿ‘

rustic dock
#

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);

alpine scroll
#

Anyone got a sample on how to call the "garbage cleaner" earlier? Like force a clean corpse on the server?

alpine scroll
alpine scroll
# rustic dock Anyone have any insight why this wouldn't spawn my custom item? The item itself ...
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

rustic dock
#

Right, but this would also be an unusual case where its directly tied to the sandbox variables

alpine scroll
#

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

weak sierra
#

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

acoustic dust
#

how the hell do you guys know so much about modding?

acoustic dust
weak sierra
#

experience

acoustic dust
#

how long have you been modding for?

weak sierra
#

this game? month or so?

#

i've programmed for 17 years tho

acoustic dust
#

holy shit

weak sierra
#

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

acoustic dust
#

yeah lua seems way easier then c#

weak sierra
#

C# is what i prefer, strongly

acoustic dust
#

i agree with you

weak sierra
#

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

acoustic dust
#

how come?

weak sierra
#

loose language

#

errors sometimes don't happen due to unexpected things

acoustic dust
#

what's a syntax checker?

weak sierra
#

it.. it checks the syntax

#

it checks for mistakes in formatting of code or references to things

acoustic dust
#

so basically like a teacher grading your test which is our code in this scenario?

weak sierra
#

kinda

acoustic dust
#

i see

#

say you have alot of experience coding..

#

did you also make any games?

weak sierra
#

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

acoustic dust
#

say, you make game engines, what's the difference between making one and using something like unity or unreal?

weak sierra
#

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

random warren
#

Does anyone know a mod to appear with nothing?

median cliff
#

yo i gotta question

#

where do find like game saves

#

not like in files

#

but like someones savegame i can import into my game

weak sierra
#

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

undone crescent
#

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? ๐Ÿ™‚

weary crypt
rustic dock
hardy flint
#

can somebody tell me whether it's possible to make http requests (access sockets) in the pz lua runtime?

hardy flint
#

oh nay, thanks for finding that reference

#

luckily enough it seems like my use case can also be handled via rcon commands

quasi kernel
#

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)?

hardy flint
#

cancel the action and break the cable

quasi kernel
#

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.

hardy flint
#

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 ๐Ÿ˜„

quasi kernel
#

It would be entertaining

hardy flint
#

use random chance to determine on which car it still is attached

vapid needle
#

btw i recognize u from project apocalypse

empty cove
#

and i didnt test it yet

hardy flint
brazen vale
#

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

latent orchid
#

i have like amaxzing idea for u mod nerds. make m0ore militry police stuff now...good ok, bye

eternal garnet
#

๐Ÿ‘‹

mellow oyster
#

Anyway to message the developers of this game? (for modding related questions)

brazen vale
#

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.

zenith smelt
#

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

weak sierra
#

i cant say i remember that name from there

#

but cowWave

#

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,
        }```
vapid needle
#

@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
#

maybe?

vapid needle
#

@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

weak sierra
#

did u make sure 2x textures is enabled?

#

that is def wild

#

i see u already posted it there

brazen vale
#

@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 ๐Ÿ˜ฆ

zenith smelt
#
        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 ๐Ÿ˜„

vapid needle
weak sierra
#

display

#

someplace

#

might be "double-sized" or something

#

instead of "2x"

vapid needle
#

ohh gotcha

#

thanks cowpoke

weak sierra
#

:p

thorn bane
#

How do I increase the damage a player deals on an attack?

zenith smelt
#

I don't know but I think there'

#

There's like something like "anger mod" on steam work shop that might do that

thorn bane
#

I'm talking about how to increase damage via lua :P

drifting ore
#

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?

ancient grail
#

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?

zenith smelt
#

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

bright heron
#

How to attach custom weapons on zombies back?

zenith smelt
# bright heron 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?

zenith smelt
bright heron
# zenith smelt Like that?

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

bright heron
#

It doesn't work :v

marble lynx
#

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?

bright heron
#

Lootable, like a police outfit zombie with shotgun attached on its back

shadow geyser
bright heron
zenith smelt
#

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

bright heron
bright heron
shadow geyser
#

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

bright heron
#

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

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.

bright heron
#

I see it's very helpful.

Now my problem is how do I put items inside the NomadBackpack in Undead Survivor mod

marble lynx
#

I've been trying to figure out how to make an assignable hotkey for an action using lua, what should I be referencing?

#

Complete newbie to lua btw

#

stuff like this