#mod_development

1 messages · Page 348 of 1

peak nymph
#

Just added twigs for now

#

not sure how easy it will be to do this, i'm just piggy backing off of fishing zones currently, so its just absed on water tiles

#

settled on this for now

    item = "Base.Stone2",
    weight = 300,
  },
  {
    item = "Base.Clay",
    weight = 40,
  },
  {
    item = "Base.Mussels",
    weight = 20,
  },
  {
    item = "Base.LargeStone",
    weight = 20,
  },
  {
    item = "Base.CopperOre_Crushed",
    weight = 10,
  },
  {
    item = "Base.Base.IronOre_Crushed",
    weight = 10,
  },
  {
    item = "Base.GoldCoin",
    weight = 2,
  },
  {
    item = "Base.TinCanEmpty",
    weight = 30,
  },
  {
    item = "Base.BeerEmpty",
    weight = 30,
  },
  {
    item = "Base.WaterBottleEmpty",
    weight = 30,
  },
  {
    item = "Base.PopEmpty",
    weight = 30  
  },
  {
    item = "Base.Pinecone",
    weight = 30  
  },
  {
    item = "Base.Ring_Left_RingFinger_Silver",
    weight = 5  
  },
  {
    item = "Base.Twigs",
    weight = 30  
  },
  {
    item = "Base.JawboneBovide",
    weight = 15  
  }```
bright fog
#

You can probably get every items with the tag and add that manually in the input

wicked summit
#

Hello all, Trying to start my first mod... how do i get it to start showing up in the mod list to start testing?

so far i have the init.lua and a mod.info

ChatGPT 5 has been helping but I'm missing something for Sure

peak nymph
wicked summit
#

C:\Users\Commander\Zomboid\mods\MediaNet\media\lua\client\init.lua
\ mod.info

#

oof, is it that bad? lol

peak nymph
#

try putting it in your workshop folder, and I think you are missing the COntents and outer levels of the folder

e.g. mine is C:\Users\name\Zomboid\Workshop\ModName\Contents\mods\ModName\42\media etc
and as far as I know mod.info should be copied to both the inner ModName folder and to the 42 folder (media should be directly in the inner ModName if on b41 i think and mod.info should be there)

silent zealot
#

Rusted sledgehammers and the soggy remains of generator manuals.

More seriously: any metal weapon/tool with very low condition and low rarity, jewelry, nails/screws/scrap metal.

wicked summit
#

b42 for sure

wicked summit
cold skiff
#

Do you know if anything has changed when repairing an item? I had this code:
fixing Fix LegendaryKatana
{
Require: LegendaryKatana,
GlobalItem: BlowTorch=5,
ConditionModifier: 1.5,

Fixer: SheetMetal=1; MetalWelding=8; Maintenance=4,
Fixer: ScrapMetal=3; MetalWelding=8; Maintenance=4,
}
To repair the legendary katana, but I've heard on the forums that this now causes errors on any item that needs to be repaired. Does anyone know anything?

silent zealot
#

And is your mod.info in teh 42 folder? I'm not sure from the lext alignment in Discord.

peak nymph
wicked summit
silent zealot
#

Extremely so.

#

You are far better off looking at existing mods to learn

peak nymph
silent zealot
#

ChatGPT can answer specific, non PZ coding questions (it's great for "if I have a bunch of points that make a polygon, how do I convert that to triangles" type stuff)

wicked summit
silent zealot
#

And if you give it code and ask it to explain it's usually helpful

#

If I just did what it said pretty sure everything with be broken in an unrepairable way right now lol

#

"helpful but not trustworthy" is the nicest I'm willing to go.

peak nymph
#

I have only rarely used it for coding purposes (i'm a web dev)

#

I mostly use it as a sounding board

#

basically ask it stupid questions until you learn enough to google right questions

#

Unrelated
don't know how much people have done blacksmithing yet, but

which of these ideas sounds the most fair to people
Create large bellows from intact leather coats
Create large bellows from Tarps
Create twin-bellows from two normal bellows and piping, can be used to craft the forge instead of large bellows

or do they all sound a bit OP/unrealistic

wicked summit
#

all 3 seem Plausible

the Doulbe Bellow may be awkward to Opperat depending on the representation

peak nymph
#

we have medieval examples of "twin bellows", basically you can pump them alternatingly so you get a constant stream of air, either by hand, or some have a "lever" attached to both so they can be operated with a pull chain etc

bright fog
#

: usage was normalized to =

#

So replace : by =

silent zealot
peak nymph
#

i've pumped 4 small mods out today lmao

wicked summit
#

i have my text trees laid out i just need a kick lol

peak nymph
#

I am european lol, but also all the info I learned is just from the wiki, or downloading mods and seeing what other people have done

wicked summit
#

i just hate it when i cant figure something out naturally in hour 1

I just gotta do it

peak nymph
#

just message here also, there’s much more talented people than me in this chat

cold skiff
vast pier
#

you can also make a basic forge using a cooking pot and a hole in the ground so long as you're not smelting anything as hot as steel's melting point

mellow oyster
#

The example mod thats already in the correct spot doesnt load.

mellow oyster
#

I even tried editing a mod.info file on one of my already visible workshop mods and it didnt do anything. Its just ignoring any change i make.

bronze yoke
#

the example mod is hardcoded not to load, that's expected

#

people who didn't really understand what it was would assume that it was a mod they downloaded and enable it

mellow oyster
#

Maybe i was missing the media folder in common. If it loads then i guess thats what i was missing.
Its weird though that when i changed mod info in a workshop download nothing was changed or reflected in game.

Yeah i was missing the media folder.

bright fog
#

But the common folder itself is mandatory

mellow oyster
bright fog
willow tulip
#

(though in theory you should need power to use that)

peak nymph
willow tulip
#

kinda unnessecary if your gonna let them do it with tarps

#

(blower is way less common)

peak nymph
#

Not added the tarp recipe atm, just the coat one (may remove) and the two normal bellows

willow tulip
#

blower would be cool if it somehow reduced crafting time or something.

#

(not that that seriously matters much)

peak nymph
#

For the forge atleast I always imagined it was the hammering and shaping etc that took up most of the crafting time, not the heating

peak nymph
peak nymph
#

Does anyone know any examples of mods or vanilla recipes that have either item with a tag or a defined item as an ingredient

So like tags[CharcoalMedium] or [Base.Plank] etc

all I’ve seen so far is one or the other

mellow oyster
bronze yoke
#

<@&671452400221159444>

wicked summit
pliant cypress
#

does anybody know how to fix gun mods

wicked summit
#

I had to start over
I Uninstalled all Games, removing extra MODs on the System
I dumped all my Mods Files in a seperate

wicked summit
wicked summit
#

ok Phew, now that everything is working again i can start lol,

vast pier
#

@pliant cypress

#

I’m assuming this is what you’re having issue with

pliant cypress
#

None of my mods work

sonic needle
#

you need a key, you can blank it too

faint steeple
#

Hey quick thing, I'm still kinda new to PZ modding so I'm unsure how to properly debug in this case.

I'm trying to update a mod to be b42 compatible since some people have been wanting me to for a while, and while I was able to update it and have the item appear, and partially work, there is a crash that can happen with it that will close the server, and kick you to the main menu without being able to see the error, and when trying to load back into that same save, it will kick you out immedietly. I'm able to reproduce this crash easily however I'm not sure on the proper way to debug this here, any help would be appreciated, please ping in response 🙂

bright fog
faint steeple
#

and since i cant get the error, I cant see what the issue is

bright fog
#

Get the error

#

You don't have time ? Do it later that's fine

faint steeple
#

Thats-

bright fog
#

But you can't debug your mod if you don't identify the error

faint steeple
#

Do the errors get written to a file anywhere

bright fog
#

Yea

#

Console.txt file

#

In your cache folder

#

Welp I guess that was the first thing to teach you, didn't think that'd be the step you're at 😅

faint steeple
#

Yea 😭 like i said im new to pz modding

bright fog
#

Red error pop ups don't go to void

faint steeple
#

Uh.. now i gotta find the cache folder lmao

bright fog
faint steeple
faint steeple
#

Okay all i found was two warnings from mine, I believe the error thats happening before it goes to the main menu is actually something completely unrelated.. but happens when i get on the skateboard so also not unrelated? idk its weird..

LOG : General f:0, t:1759385407506> ERROR: IntegerConfigOption.setValue() "MaximumRatIndex" 100 is greater than max=50

WARN : Script f:0, t:1759385337963> VehicleScript.Loaded > vehicle "Skateboard" extents != physicsChassisShape
WARN : Script f:0, t:1759385337918> VehicleScript.Loaded > vehicle "Skateboard_Slow" extents != physicsChassisShape

#

I'll have to look into it tmr tho, thank you

vivid mauve
#

So I found the reason why the Gun Light no longer works. Any flashlight that uses a battery needs the "Drainable" tag. Problem is, if the type is drainable, it can no longer be attatched to a weapon.
I assume you can't do multiple types. Any idea how to fix this?

drifting ore
#

Hello, is it possible to make a certain loot match in a certain house? Well, for example, there must be a crowbar or something else in the starting house.Build 41?

peak nymph
#

hi all, i'm confused as to how I translate item names, its working for recipes but not item names, can someone share a mod example or some info

wicked summit
#

I'm still staring at the folder line you gave me yesterday

then reading these help documents over and over trying to find the bare minimum in a show all fashion

#

almost took the day off so i could sit in silence

peak nymph
#

would share an image of the file structure of one of my mods but I don't have image permissions haha

bright fog
bright fog
peak nymph
#
|   Preview.png
|   workshop.txt
|
\---Contents
    \---mods
        \---Firesteel
            |   mod.info
            |
            +---42
            |   |   mod.info
            |   |   Poster.png
            |   |
            |   \---media
            |       +---lua
            |       |   \---shared
            |       |       \---Translate
            |       |           \---EN
            |       |                   ItemName_EN.txt
            |       |                   Recipes_EN.txt
            |       |
            |       +---models_X
            |       |   \---WorldItems
            |       |           Firesteel.fbx
            |       |
            |       +---scripts
            |       |       Firesteel.txt
            |       |
            |       \---textures
            |           |   Item_Firesteel.png
            |           |
            |           \---WorldItems
            |                   Firesteel.png
            |
            \---common

```@wicked summit
peak nymph
#

does anyone know if I can do multi-line descriptions in the workshop.txt file

blazing arch
#

Does anyone know about development for that horse mod

thin swan
blazing arch
#

Ooh nice is there any videos of the progress i could check out?

#

And is there a way we could use spears on the horse?

thin swan
blazing arch
#

Oh alrighttt that’s really cool :0

#

Can zombies pull you off the horse yet?

thin swan
blazing arch
#

I am so excited for the mod I can’t wait to ride horses in multiplayer with my friends

thin swan
blazing arch
#

Yes that is what I am saying, when b42 releases

#

Is there like a stamina bar for the horses

#

Can they get sick or tired yet and do they have to sleep

#

Sorry if it’s too much questions I am just very interested

midnight mortar
#

heyo was trying to port over to b42 a few mods i use but they do not show up and have no error present
i moved the minimum version to 42.0 but it doesn't seem to be reliant on that as i originally thought
any suggestion? i don't know where to start debugging with no logs/dependecy errors/errors

#

location is within steam > workshop > project zomboid > mods, i'm unsure if that's the problem

thin swan
peak nymph
#

does anyone know if there is a way to either (or both) apply on ontick function or something of the kind on an inventory item, and if there is a way to detect/tick a lua function when the item is heated

struggling to find anything definite in the docs

sharp sage
#

not trying to model anything i just wanna do something for the funny

#

i wanna change the color to the gmod missing texture

bright fog
#

You might also be interested in the app I amde to upload mods

peak nymph
peak nymph
#

Does anyone have any docs of what the heat property does in a craft recipe, can’t see it mentioned in the docs, basically can this be used to only allow a craft when it’s cool, or does it only work for detecting if something is above a certain heat not below

vivid mauve
#

gun light got fixed in 42.12.1

#

guess I wasted my time looking into it

willow tulip
#

you might also find it uses in disinfect bandages

vast pier
#

How would I go about adding a function to the upgrade interaction ?

I want to change an item's moddata when attaching/detaching a specific item

peak nymph
willow tulip
faint steeple
#

Two questions

Do all vehicles in B41 REQUIRE doors (code wise)?

Do all vehicles in B42 REQUIRE doors (code wise)?

willow tulip
#

looks through java Hu, TIL that food can get tainted if left outside in the rain?

willow tulip
faint steeple
willow tulip
#

shrugs its got a b42 version I know.

bronze yoke
#

afaik nothing significant changed about vehicles between builds

willow tulip
#

Neat. apparently putting gasoline into a campfire is a bad idea. I need to try that.

#
                    if (fluidContainer.contains(Fluid.Petrol)) {
                        fluidContainer.removeFluid();
                        boolean boolean0 = this.container != null
                            && this.container.getParent() != null
                            && this.container.getParent().getName() != null
                            && this.container.getParent().getName().equals("Campfire");
                        if (!boolean0 && this.container != null && this.container.getParent() != null && this.container.getParent() instanceof IsoFireplace) {
                            boolean0 = true;
                        }

                        if (this.container != null && this.container.SourceGrid != null && !boolean0) {
                            IsoFireManager.StartFire(this.container.SourceGrid.getCell(), this.container.SourceGrid, true, 500000);
                        }
faint steeple
#

Hmm, okay, thanks

willow tulip
vast pier
queen oasis
willow tulip
queen oasis
#

my guess is IsoFire doesn't have a sprite. idk, a check for nil sprite solved it tho

willow tulip
#

ahh

peak nymph
willow tulip
#

(the bug reports are because people have no clue they need to heat the item)

peak nymph
willow tulip
peak nymph
bright fog
#

Simply copy paste your Steam description inside the in-game editor

#

Bcs setting it up in your workshop.txt will be annoying

prisma mauve
#

Is there a way to apply weight reduction to a bag attached to a bag slot? Like, say, the bag itself like a medkit or something, is attached to a backpack item slot, like the bedroll slot, how would I get that medkit to apply it's weight reduction while attached to the backpack slot?

#

Right now, every time I put the bag from equipped in my primary hand to being attached, it increases my encumbrance, nullifying the bag's weight reduction fully.

bronze yoke
#

<@&671452400221159444>

willow tulip
prisma mauve
#

That says to me that items in that slot CAN have weight reduction applied, it's just not applying the weight reduction from the item being put in the slot, or it's being modified after the fact.

willow tulip
#

(at least I assume it just swaps between items)

prisma mauve
#

Maybe the BedrollBottom location itself has a set value?

prisma mauve
#

Maybe not, after reading it two more times

willow tulip
#

very few results for BedrollBottom in the lua

prisma mauve
#

It's not changing the item itself, just attaching it to the slot.

#

Where is "AttachmentsProvided" defined?

willow tulip
#
public float getInventoryWeight() {
        if (this.getInventory() == null) {
            return 0.0F;
        } else {
            float float0 = 0.0F;
            ArrayList arrayList = this.getInventory().getItems();

            for (int int0 = 0; int0 < arrayList.size(); int0++) {
                InventoryItem item = (InventoryItem)arrayList.get(int0);
                if (item.getAttachedSlot() > -1 && !this.isEquipped(item)) {
                    float0 += item.getHotbarEquippedWeight();
                } else if (!this.isEquipped(item) && !item.isFakeEquipped(this)) {
                    float0 += item.getUnequippedWeight();
                } else {
                    float0 += item.getEquippedWeight();
                }
            }

            return float0;
        }
    }
#

isFakeEquipped maybe?

#
    public boolean isFakeEquipped() {
        if (!this.isInPlayerInventory()) {
            return false;
        } else {
            return this.getOutermostContainer() != this.getContainer() ? false : this.isKeyRing() || this.hasTag("FakeEquipped");
        }
    }
willow tulip
#

weird, can't find the tag 'FakeEquipped' anywhere else in zomboid

#

@prisma mauve I can't find any code that really does anything special with attachedSlot or attachments in general besides what iv pasted -_-

#

If just attaching it (Make sure your following the bedroll code to make sure your doing everything right to attach it) doesn't do anything then I dunno.

#

Oh, heres something:

#

Tags = LightWhenAttached

#

on sleeping bags -_-;

#

and the only ref:

#
    public float getHotbarEquippedWeight() {
        return this.hasTag("LightWhenAttached")
            ? (this.getActualWeight() + this.getContentsWeight()) * 0.3F
            : (this.getActualWeight() + this.getContentsWeight()) * 0.7F;
    }
prisma mauve
#

Ok, that's something. Where is that at?

willow tulip
#

the code or tag?

prisma mauve
#

I just now saw all this, I've been digging myself

willow tulip
#

this is all java decompiles from 42.11

prisma mauve
#

Ok

willow tulip
#

Ask someone more skilled then I on how to decompile PZ if you want a copy.

prisma mauve
#

Specifically, the line to attach the bag to the bedroll slot is just AttachmentType = Bedroll, in the item's script

willow tulip
#

looks like 'attached' items should be 0.7x weight, while LightWhenAttached tagged items should be 0.3x

willow tulip
#

and a similar line in the backpacks item script

#

I can't find anything to indicate there is any LUA/context menu stuff expressly for sleeping bags being attached, so it may be automatic

prisma mauve
#

AttachmentsProvided = BedrollBottom,

willow tulip
#

Yea

#

note that there is one backpack with AttachmentsProvided = Bedroll,

prisma mauve
#

THat's on the bag being attached to. Somewhere in between there is weight reduction. I Now just need to figure out exactly how to make THIS backpack have a different modifier

Might be one of the dumbest thigns ive ever said

willow tulip
#

Im guessing the exact name has some kinda hardcoded offsets to where the object will appear

willow tulip
#

But that gives you a fixed 0.3 multiplier, vs 0.7 without it.

#

Your not gonna get the 'container reduction'

prisma mauve
#

Yeah

willow tulip
#

You can try adding the tag: 'FakeEquipped' (maybe only when attached?) and see what that does.

#

(might make a bag give its equipped weight reduction at all times? Dunno!)

prisma mauve
#

I'll give it a shot.

willow tulip
#

Its not used anywhere in vanilla.. But it seems to exist!

#

@bronze yoke Fun unknown tag knowledge here ^ 🙂

willow tulip
#

I guess this also explains how all keyrings are automatically equipped

#

though I guess this also means that things can't be fake equipped if they are inside a container, have to be in the players main inventory.

prisma mauve
#

Well... "Attached" and "Equipped" aren't the same, right? So It should work. I'm just brainblocked on the implementation now. Been thinking about it too long, might need a walk.

willow tulip
#

if it does what you want. or if LightWhenAttached is good enough.

#

You can worry about adding/removing the tag later, first see if it even does what you want.

prisma mauve
#

Yeah see, I was definitely thinking too hard, and compltely forgot about that line in the item script lmao

#

I definitely have a problem where I'm convinced my head is harder than that wall.

prisma mauve
#

Not in that spot, anyway.

willow tulip
#

you added it to tags right? with a ;

prisma mauve
#

yeh

#

wait, i left the comma

#

My skull is tungsten

#

The only W i'll ever get

prisma mauve
# willow tulip Weird?

Doesn't crash, but also doesn't apply the weight reduction. Still adding a full ten kilos when i attach it. Looks like 0.7x, because weight of the items in the pack is a bit over 14.

#

<@&671452400221159444>

left plank
#

Thanks

prisma mauve
#

No, thank you

willow tulip
prisma mauve
#

Tags = IgnoreZombieDensity;FakeEquipped, As far as I can tell, it's not ACTUALLY doing anything to the pack, and I wonder if that tag isn't somehow specific to keyrings.

#

I'm taking a break from swimming through the code to actually just play for a bit though.

#

The pack itself has a weight reduction of 100, and just holding it in my base inventory is enough to get that, but when it is attached into the slot, it gets that 0.7x. Mild inconvenience, really.

#

It fully overrides the weight reduction on the pack and uses whatever the modifer for the BedrollBottom slot is

willow tulip
#

tempted to make a mod that just applies fakeequipped to all bags in your inventory...

willow tulip
valid oyster
#

Does anyone know what might be wrong with the syntax or formatting for this file for a B42 vehicle mod?
It seems when this file is not disabled, right clicking to repair vehicle parts causes an error ALL vehicles in the game.

{
    fixing Fix 89 Acty Truck Hood Welding
    {
       Require : 89actytruckHood1,
       GlobalItem : BlowTorch=2,
       ConditionModifier : 1.2,

       Fixer : SheetMetal; MetalWelding=1;Mechanics=2,
       Fixer : SmallSheetMetal=2; MetalWelding=1;Mechanics=2,
    }

    fixing Fix 89 Acty Truck Hood
    {
       Require : 89actytruckHood1,
       GlobalItem : Screws=8,
       ConditionModifier : 0.5,

       Fixer : SheetMetal; Mechanics=2,
    }
}```
bronze yoke
#

replace : with =

#

the syntax was changed in 42.12

valid oyster
#

hmm I did try and it fixed vanilla errors, but the repair options for the parts is still not showing up

valid oyster
#

Fixed it, looks like the item names next to Require needed to be prefaced with Base.

prisma mauve
# willow tulip try `LightWhenAttached` then, for 0.3x instead, best I can do.

LightWhenAttached works as intended, but also overrides the item's base weight reduction. When in my inventory with that tag, it retains the full weight of the items inside the pack, then gets the 0.3x when attached. This is closer, but unfortunately still weighs more attached in this implementation than unattached in my invetory without that tag.

I'll probably fuck with it more tomorrow at some point. Thanks for your help.

peak nymph
#

a weird one but not sure how else to word it, is there a way to either put items in a non container via lua

or is there a way to make a container inaccessable to the user

trying to make something that is "sealable" but I still need to be able to affect the items inside via code

vale garden
# vast pier

Is this the firearm mod? Will there be a series of such firearm?

vast pier
#

The gun model and stats are entirely determined by gun parts

#

Think fallout 4's weapon customization.
That's the sorta thing I'm striving for

vale garden
#

I see, altho I never play Fallout 4 before, but multi purpose firearm is really cool.
It would be interesting if firearm can also be turned into other weapon type instead of just Bayonet/Spear.

vast pier
#

I hadn't actually considered other weapon other than just smacking the enemy with the gun like a club

#

but now that you say that, that gave me the idea of things like spikes/barbed wire/cutting blades being attached instead of just stabbers

#

Thank you for that, I will put that in my notes

#

Do note this mod is only possible in B42 due to B42 removing the gun attachment limits

#

So there will not be a B41 version

#

Well it's technically possible in B41 but it would have to be simplified a lot to fit in that version

vale garden
peak nymph
#

okay might need help with my approach for a mod because I keep hitting dead ends
Long story short I'm trying to create a pressure canner

Ideally this is a container that can be "sealed" meaning the items can no longer be accessed, but are once again accessible when its "unsealed"

The other part is updating the items inside after the item is heated/cooked

But the part i'm struggling is switching the item to a new version that still contains hidden items/itemData
The addExtraItems function seem to only allow for base items, not the evolved recipes and lua generated items etc that I wish for this to allow

And as far as I can see there is no methods to "lock" a container item in the same way as a IsoContainer or car trunk

So long story short, does anyone know of a way to either make a container no longer interactable, or to pass item data to a non container item

bright fog
#

What do you put in the pressure canner ?

willow tulip
#

maybe use addExtraItems just as an 'indicator' to show what the jar contains?

bright fog
#

There might not be any need for that

#

They need to give more context

#

Bcs it could be done with craftRecipe or evolved recipes simply

willow tulip
bright fog
#

It really depends

willow tulip
#

thinks.. I wonder if I could make beefcake change how you add items to evolved recipes.. instead of an evolved recipe calling for 5 or 15 or 20 hunger, maybe there could just be a submenu where you add 1/4 1/2 3/4 or full ingredient.

peak nymph
# bright fog You need to add a bit more context I think. Which game version ? What are you wo...

build 42

The items placed inside were going to be canned food items, both a version identical to vanilla produce jars, and custom items that copies stew/soup data onto a jar

The whole journey would be to craft these jars (tagged as unsealed)

place them in the pressure canner (was planned to be a container item)
seal/lock the pressure canner

the sealed canner can be heated/cooked in an oven or fire

then when cooled (just ontest if it is no longer hot) you have the option to unseal the container and take the items out

these items are modified versions of the original items

willow tulip
#

pressure/heat canning is totally valid and I dunno why it wasn't the default -_- Sure it might not be suitable for all things, but we could have 'other' canning methods for things that don't work with just pressure canning.

peak nymph
#

this approach it was originally dependent on the idea I could store the full item data in a hidden way on a new item (that was originally gunna be a craft recipe to convert between the sealed and unsealed canner) but hit a wall with this approach

bright fog
#

I think the best idea to do it here is what moons mentioned, with mod data holding the food item informations

willow tulip
bright fog
#

And then recreate the food items with the recipe to open the jar

#

Can different food items be put inside it ?

#

So carrot with potatoes etc

willow tulip
#

Yea. There might be a way to cheat it with evolved recipes, if you don't care about getting back the 'original' stuff. But if you want genuine original ingredients for use in the original cooking recipes (like say, canning tomatos, and then using those tomatos to make tomato paste), your gonna wanna recreate the original items, likely from moddata.

#

evolved recipes might still be usable if all you want is 1 ingredient (but that seems wasteful as a lot of vegis are hardly worth canning 1 of)

peak nymph
willow tulip
#

You could even still have it be a 'container' with mod data, and when you 'can' it, it just converts from a container, to a new 'sealed item' with a bunch of moddata about what it contains (and maybe addExtraItems just to show the user what items are inside the jar)

vast pier
peak nymph
# bright fog Can different food items be put inside it ?

So first step the user would transfer evolved recipe to jars
This would work the same was as splitting a meal into bowls

These jars/bowls are what is put in the canner container

This canner/container is "sealed" (transformed to a version where items can't be taken out or put in)

This canner/container item is "cooked"
The item itself stays the same but the data for the items inside change

Then you can "unseal" the canner/container
and take the processed items out

willow tulip
#

yea if you wanna do evolved recipes too, id recommend moddata for sure so you have total control over things.

peak nymph
bright fog
willow tulip
#

You can make it a container, or slap your own rightclick context menu on your starting-jars (maybe both? so you can support evolved recipes? Or just jar literal bowls of soup!)

willow tulip
#

Maybe the jaring process can spit the bowl/pot/whatever back out when its done?

bright fog
#

You want to put vegetables inside the jars ? Meat ? Soup ? Give explicit example here

#

The jar using an evolved recipe sounds like a bad idea

#

The jar accepting evolved recipe item results is doable

peak nymph
# bright fog What evolved recipes are you talking about here ?

for simplicity lets say just bowls of soup, with vanilla recipes you create a soup, you have a vanilla craft recipe to split this into 4 bowls, these bowls are the items to be canned (will be replaced with my own similar items but lets just keep it simple for now)

bright fog
#

Why not the pot/saucepan ?

#

Or accept all of these ?

willow tulip
bright fog
#

Less confusing for players

vast pier
willow tulip
#

(Option B is kinda like how evolved recipes work, at least from the players side of things, but you'd still be doing all the work manually with moddata)

peak nymph
# bright fog Why use the bowls directly ?

I don't know how else to explain it but I think you have the wrong idea
ignore every single thing i've said and i'll start again

this is the most stripped down version of the mod I can think of

I want to have a container/item that you can place soup bowls in

You can then "lock" the container to items cannot be put in or taken out

You can then "unlock" the container and take the items out

These items will have a tag added but otherwise be identical to the items originally put in

willow tulip
#

then yea, Id likely make a process that converts them to moddata

willow tulip
#

since your doing food, you don't need to store too much, the calories, hunger, lipids, protein, carbo, weight, baseitem.. Maybe the poison factor, age... cooked/burnt status...

peak nymph
willow tulip
#

I guess might as well store happyness/boredom/etc too..

bright fog
#

What items can be put in it ?

#

Make a list

peak nymph
willow tulip
#

setOnlyAcceptCategory(String onlyAcceptCategory)

#

public void setAcceptItemFunction(String functionName)

#

Dunno if the latter takes LUA functions, maybe.

#

1st should be able to filter it to food, and since you'd be writing the 'canning' code, you can always have it eject or fail (with a onscreen reason why) if it has invalid items

peak nymph
willow tulip
#

Looks to be LUA accessable

#

stuff uses it from LUA

#
function AcceptItemFunction.AmmoStrap_Shells(container, item)
    return item:hasTag("ShotgunShell")
end
#

yea, the item script has this line:

#
AcceptItemFunction = AcceptItemFunction.AmmoStrap_Bullets,
#

so you can just set a container to have a filter function on what it accepts

willow tulip
#

in theory, you could even try using the accept item function to say why they can't move stuff, cause it SHOULD only be triggered when they try...

#

(your milage may vary on this idea/concept and if it actually works or not)

peak nymph
#

thanks so much, now just gotta write the moddata function

willow tulip
#

have fun, sounds cool, better then the existing canning system since im assuming we could can meat/vegis/whatever and use them for whatever 'original' recipe demanded them

#

Desire: Put the shelf life as a sandbox option, so I can have like 5 year canning or something If I want 😛

peak nymph
#

unsure whether to make the canner craftable or just make it something you have to search for

willow tulip
#

Both is always good too :0

spiral goblet
#

I used to be able to put my mods into my local mods folder to use them. Can I not do this any more?

nova whale
#

Noob question incoming- is there a way to import vanilla buildings into the building editor? As far as I can tell, there is no way to do it naturally. I know bikini tools can save building blueprints, but can I use it, or any other mod, to add a vanilla building to the building editor? The reason I want to know is because I want to add some vanilla buildings to a custom map. (B41)

fervent sparrow
nova whale
#

Thanks!

fervent sparrow
#

Though this question would better fit in the mapping chat, but no worries

distant inlet
#

just one about recording/replaying routines

buoyant violet
#

as anyone manage to change the firerates of fully automatic weapons?

#

im looking to make an ak shoot slower than an m16

peak nymph
#

hey all, trying to "copy" a food item into mod data, and then recreate it
everything but hunger seems to be working (hunger is set but the wrong value)

but setting each of the values gets the same error and really not sure why
heres an example of the error

function: UnsealCanner -- file: HiemCanning_CannerHandler.lua line # 113 | MOD: PressureCanning
Callframe at: performCurrentRecipe
function: performRecipe -- file: ISHandcraftAction.lua line # 197 | Vanilla
function: perform -- file: ISHandcraftAction.lua line # 170 | Vanilla

ERROR: General      f:17948, t:1759498436702> ExceptionLogger.logException> Exception thrown
    java.lang.IllegalArgumentException at NativeMethodAccessorImpl.invoke0 (Native Method).
    Stack trace:
        java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)```
peak nymph
# peak nymph hey all, trying to "copy" a food item into mod data, and then recreate it everyt...

here the function thats triggering it

    local items = craftRecipeData:getAllConsumedItems()
    local results = craftRecipeData:getAllCreatedItems()

    local sealedCanner = items:get(0)
    local openCanner = results:get(0)
    local inputModData = sealedCanner:getModData()

    local items = inputModData.containedItems

    for i=1, #items do
      local itemData = items[i]
      local item = instanceItem(itemData.type)

      item:setBaseHunger(totalBaseHunger)
      item:setHungChange(totalHungChange)

      item:setName(itemData.name)

      openCanner:getInventory():AddItem(item)

      local extraItems = itemData.extraItems
      for j=1, #extraItems do
        local extraItem = itemData.extraItems[j]
        print(extraItem)
        item:addExtraItem(extraItem)
      end

      item:setCooked(true)

      -- applyNutrition(item)
      print('here')
      print(item)

      item:setThirstChange(totalThirstChange)
      item:setBoredomChange(totalBoredomChange)
      item:setUnhappyChange(totalUnhappyChange)
      item:setCarbohydrates(totalCarbs)
      item:setLipids(totalLipids)
      item:setProteins(totalProteins)
      item:setCalories(totalCalories)
      item:setActualWeight(weight)
      item:setWeight(weight)
    end
end```
old dagger
#

anyone here got any tips how to create custom scenarios? Something like that mod:

#

i've seen video on youtube but there were no info how to make mod out of debug mode

bright fog
#

What scenario are we talking about here ? Like CDDA ?

old dagger
#

Yea like you have already configured scenario and you just select it while creating new save

old dagger
#

Maybe 10 years later mod with less erosion would be nice with it.

merry fjord
#

Anyone can help me with this issue?

Basically, i want to incorporate toxic zones with getting irradiated water and the intent is basically filling up a test tube with irradiated water.

function: tick -- file: ISTimedActionQueue.lua line # 81 | Vanilla
function: onTick -- file: ISTimedActionQueue.lua line # 194 | Vanilla

Getting error around this repeatedly on ISTimedActionQueue

"function ISTimedActionQueue:tick()
local action = self.queue[1]
if action == nil then
self:clearQueue()
return
end
** if not action.character:getCharacterActions():contains(action.action) then**
print('bugged action, cleared queue ', action.Type or "???")
self:resetQueue()
return
end
if action.action:hasStalled() then
self:onCompleted(action)
return
end
end"

bright fog
old dagger
#

yeah, for now i will take one config from pillow's mod and figure out how to modify it for my purposes.

#

i quess pillow based on ingame scenarios and created his

merry fjord
peak nymph
#

I am instantiating an item, which is of type
Base.SoupBowl:zombie.inventory.types.Food@3fa3a205

and despite methods such as :setCooked working
all the setBaseHunger and setProtein etc methods all error

I'm so confused

bronze yoke
#

what error?

peak nymph
# bright fog Like albion said, what error ?

Callframe at: setWeight
function: UnsealCanner -- file: HiemCanning_CannerHandler.lua line # 113 | MOD: PressureCanning
Callframe at: performCurrentRecipe
function: performRecipe -- file: ISHandcraftAction.lua line # 197 | Vanilla
function: perform -- file: ISHandcraftAction.lua line # 170 | Vanilla

ERROR: General f:17948, t:1759498436702> ExceptionLogger.logException> Exception thrown
java.lang.IllegalArgumentException at NativeMethodAccessorImpl.invoke0 (Native Method).
Stack trace:
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

bronze yoke
#

illegal argument, the function exists but you're passing something weird to it

peak nymph
#

hmm, i'm passing the same value got from getWeight (added to modData then read and tried to write to new item)

bronze yoke
bright fog
#

Classic the search doesn't show inheritance

bronze yoke
#

i never lost the habit of ctrl-f so i didn't even know that

bright fog
#

Tho I guess it's quite unreliable lol

willow tulip
#

(that are called, so helpfully, getX and getY)

peak nymph
#

omg i'm so stupid, i was referencing totalCalories not itemData.totalCalories for all the moddata
thanks for everyone help

empty bramble
#

If I wanted to make a custom map in PZ, what would be like the first immediate steps to take? I'm just unsure where to start.

peak nymph
empty bramble
#

I didn't realize there was a whole channel dedicated to mapping, thanks :D

bright fog
#

Check the Mapping wiki page

empty bramble
#

A lot of them are pretty old, so I was just wondering if map making has become more intuitive since they were posted.

bright fog
#

The blackbeard videos are up-to-date from my understanding

empty bramble
#

I guess the whole thing just seems a bit intimidating since you've gotta use like tertiary programs and stuff to do things like placing the terrain.

#

I made it about that far before I gave up and decided to try again later.

bright fog
bright fog
empty bramble
#

Thanks, will do.

bronze yoke
#

<@&671452400221159444>

peak nymph
peak nymph
#

Does anyone know of any events/hooks to know when an item is heated? Can’t see anything in the docs

No worries if not as will just make the item “cookable” instead but would prefer to be able to “tick” a value as it’s heated instead

peak nymph
#

Or (a probably les performant option) is there an OnTick or something similar for an inventoryitem

bright fog
#

Need some feedback for the Item script wiki page

I'm reworking the organization of the Item script page

I'm testing some presentation for the list of parameters that can be used for the various item classes (Type param) and need your feedback on it:
https://pzwiki.net/wiki/User:SirDoggyJvla/sandbox#How_parameters_are_arranged_by_"Type"_parameter

In comparison, here is the old presentation:
https://pzwiki.net/wiki/Item_(scripts)#How_parameters_are_arranged_by_"Type"_parameter

-# Note I haven't changed anything else on the page, only the parameter list presentation in my sandbox page

mellow frigate
#

Me blind? Me not see the difference.

mellow frigate
#

good news, I'm not blind ! (I have other problems though)

bright fog
mellow frigate
#

the inability to see the whole row on the synthetic (new) view is a problem to me, but it may be a problem on my side only.

bright fog
#

There's sadly not any solutions regarding that, besides modifying your wiki page view settings

mellow frigate
#

it is so long (so many rows) that when going full down to move the cursor and see the right part ... I cannot find my way back to the expected param

bright fog
#

Yea it's definitely a problem

mellow frigate
#

that synthetic view is still awesome. so keep both views

bright fog
#

Thinking about it more, do users even need to see which params are in common between classes ?

mellow frigate
bright fog
#

I guess

bronze yoke
#

to be honest, i find the new version really hard to use

bright fog
#

I think I'll keep both version like Tcherno suggested

bright fog
#

Steam Uploader v0.6.0

v0.6.0 doesn't impact much on the user side, mostly fixes previous 0.5.0 version which was non-working.
A bit of restyling for the console logs when using the app
https://github.com/SirDoggyJvla/Steam-Uploader/releases/tag/v0.6.0

GitHub

Major code reformatting by aoqia to cleanup the whole app
Ditched the CMake for the Windows build since it wasn't working at all and it took us more than a hundred commits just to make it work
...

cinder iris
#

i want to make a skills/profession mod for a personal server of mine, how would i go abouts doing that? any tips?

covert wren
#

Back at it again TT_evilFingers

peak nymph
cinder iris
peak nymph
peak nymph
#

has anyone messed with item age at all
because items are converted to modData in my mod, they are basically held in stasis until converted back to items, but instead I want to age the item appropriately when opening it, but item age for the items I have in there are less than 2 even when they've existed for a while, but if I get time stamp when "sealing" and "opening" the difference between the values is 7, so if I add this to the item it'll be aged massively, so does anyone know how i'd convert "time" to "age"

peak nymph
little bane
#

Are there any mod that let you type and run lua script?

#

Can you do that with Cheat Engine rebirth Lua interpreter?

bright fog
#

Currently no, but that should be doable. It's what the debug console allows you to do

#

But it isn't very practical currently to run big scripts

little bane
#

I see

#

I want to run local function lua script from some mod but i don't know how to do that

#

The mod said it will add command to the game but when i tried that command nothing happened and the game said unknown command

little bane
bronze yoke
#

<@&671452400221159444>

small osprey
#

Heya folks. I took a summer break from Zomboid and Modding. Happy to be back 🙂

late hound
#

lol did anyone see that they threw all their clothing scripts into one file now? Have fun searching for things in a 24000 line file 😆

bronze yoke
#

yeah, they generate their scripts now so organisation isn't a concern anymore, pretty annoying for us 😅

bright fog
#

Didn't realize that

desert dust
#

I'm trying to update my mod to work with Build 42, but it's not even showing up in the mod list.

I've got the mod folder in the 'Workshop' folder of the main PZ directory on Steam, and I've got a folder named '42' (I've also tried naming it '42.0' to no success). Inside this folder I've got my mod.info and poster.png files, as well as media/scripts/recipes where I've got my ModRecipes.txt folder. Yet every time I start the game, the mod isn't showing up on the list, and I can't for the life of me figure out why. Any pointers?

It's probably something minor that I'm missing, but I just can't see it.

bronze yoke
#

add a common folder too

#

it doesn't have to have anything in it but it does have to exist

desert dust
#

Yeah, I've got one of those too. Sorry, forgot to mention it.

bronze yoke
#

oh, it shouldn't be in the main pz directory, those mod folders are fake

#

it should be in %UserProfile%/Zomboid/

icy night
#

Hey, does anyone know if I can check how fast a player is driving using getSpeed()

bright fog
#

getSpeed ?

icy night
#

Yes, getSpeed() from VehicleHitField

bright fog
#

Did you test it ?

icy night
#

I will

#

This worked: vehicle:getCurrentSpeedKmHour() > 30

vast pier
#

Is there a way to change an item's display name ?

setDisplayName("Name")
doesn't work

little bane
vast pier
desert dust
#

Any reason why my recipe wouldn't actually create the item it's supposed to? I'm using debug mode to test it, but no matter how many times I try, the item isn't appearing in my character's inventory. 🤔

{
    craftRecipe Geo.QOL.CraftGasCan
    {
        timedAction = Base.RipClothing,
        Time = 60,
        Tags = AnySurfaceCraft,
        needTobeLearn = false,
        AllowBatchCraft = True,
        SkillRequired = Tailoring:1,
        category = Geo's QOL,
        inputs
        {
            item 10 [Base.WaterBottle],
            item 4 [Base.Scotchtape;2:Base.DuctTape],
            item 1 tags[Scissors] mode:keep flags[MayDegradeLight],
        }
        outputs
        {
            item 1 Base.PetrolCan,
        }
    }
}```

(If anyone can suggest a replacement for the water bottles, do let me know; I'm using them because Base.BleachEmpty doesn't exist in B42. They hold 1L each and gas cans are 10L, so it makes sense in my mind.)
vast pier
#

have you tried doing the recipe with the actual ingredients in your inventory and not the debug function ?

desert dust
#

I made sure to spawn them into my inventory before attempting the recipe.

bright fog
#

Remove those dots in the naming

#

Idk if it's that the exact source of your problem

#

But I wouldn't do that

#

Besides that, the rest looks good

small osprey
desert dust
desert dust
#

I assume using Lua? Because I've tried the [IsEmpty] and [ForceEmpty] flags, but neither worked.

bright fog
#

Aren't there outputs flags tho ?

thorn siren
#

Does anyone know how i can insert mod items into existing recipes? Specifically im making a mod that adds some new seeds and i want to include these seeds in the recipe to put them in and take them out of packets. I've already succeeded in creating an independent recipe, but it'd be nice if it would just be part of the exiting one.

desert dust
willow tulip
#

I see no evidence of any vanilla recipes that make empty items when the fluidcontainer had a default fluid

#

Weird, there is a itemname translation key for: Base.EmptyPetrolCan

#

but I can find no evidence this item exists anywhere lol

willow tulip
# thorn siren Does anyone know how i can insert mod items into existing recipes? Specifically ...
bronze yoke
willow tulip
#

ah.

alpine hazel
#

Posted this already on the PZ Modding Community but I though I'd post it here too in case its useful for anyone.
I've made a python script that provides a simple, navigable menu for uploading and updating mods on the Steam Workshop using Steam Uploader #mod_development message made by @bright fog

Check it out here: https://github.com/xberkth/Steam-Uploader-Menu
If you have any suggestions or want to report a bug, @ me or send me a PM.

GitHub

Python script for the CLI tool Steam Uploader v0.6.0 by SirDoggyJvla. - xberkth/Steam-Uploader-Menu

bright fog
alpine hazel
#

Yeah it works perfectly with 0.6

#

I still need to add support for --new and app_id but I haven't figured out how to approach it yet 😅

shadow tapir
#

Hey everyone — I’m currently working on a Tank API system for Build 42 that allows any container or item to store liquids (not just predefined types). The goal is to make it work universally, starting with KI5’s tank vehicles, and then expand it so modders can add or register new liquid containers directly through code.

I’ve got everything showing and functional in Build 41, but nothing appears in Build 42, so I think I’m missing a few key changes in the new build’s mod or file structure.

If anyone experienced with B42 mod loading or script changes could point me in the right direction or help me identify what I’m missing, I’d really appreciate it.

desert dust
peak nymph
#

hi all, does anyone know why setWeight and setActualWeight don't seem to do anything for an item
this is for an output item of a crafting recipe using an "OnCreate" function

The value is unchanged from base if I use those

and if I add setCustomWeight(true) also the weight of the item ends up at 0.0

peak nymph
# peak nymph hi all, does anyone know why setWeight and setActualWeight don't seem to do anyt...

heres the function, not sure what else to try, can't see anything different in the docs and i'm not getting any errors

    local items = craftRecipeData:getAllConsumedItems()
    local results = craftRecipeData:getAllCreatedItems() -- 2 jars + 1 pot

    local input = items:get(0)

    local jars = {}
    for i=0, portions - 1 do
      table.insert(jars, results:get(i))
    end
    local pot = results:get(portions)

    for i=1, #jars do
      local jar = jars[i];

      applyJarNutrition(jar, input, portions)
      -- applyJarWeight(jar, pot, input, portions) -- no working 
      jar:setActualWeight(1.25)
      jar:setWeight(1.25)

      jar:setAge(input:getAge())
    end
end

function Recipe.OnCreate.CreateJarredFood2(craftRecipeData, character)
  createJarredFood(craftRecipeData, character, 2)
end```
shadow tapir
peak nymph
shadow tapir
peak nymph
cold rapids
#

For PZ World Ed where does the config / settings file save on Windows?

Also can i compile a map via batch?

buoyant sky
#

Hm i was thinking i make something like a recap mod for zomboid, as first iteration something like tracking where you go until you died

vast pier
# vast pier

Both are technically the same item due to item ID, but it copies over all the stats from the actual gun (and the bayonet attached to the gun)

#

the sharpness and condition stats for the melee version of the weapon is stored directly on the gun part

#

meaning it carries across guns if you attach it to something else

bronze yoke
#

<@&671452400221159444>

peak nymph
# vast pier

How are you setting the weight of the new item? trying to figure out what I’m doing wrong with my mod

vast pier
peak nymph
willow tulip
#

and the weird thing that...

        if (this.getDisplayName().equals(this.getFullType())) {
            return 0.0F;
        } else {
            return this.ActualWeight < 0.0F ? 0.0F : this.ActualWeight;
        }
    }```
#

getactualweight is.. disabled if the displayname equals the fulltype? lol wut

#

also seeing: drainablecomboitem has this:

#
        if (this.getReplaceOnDeplete() != null) {
            if (this.getCurrentUsesFloat() >= 1.0F) {
                this.setCustomWeight(true);
                this.setActualWeight(this.getScriptItem().getActualWeight());
                this.setWeight(this.getActualWeight());
                return;
            }

where they constantly.. reset the actualweight -_-;

#

also ending in:

#
        if (this.getWeightEmpty() != 0.0F) {
            this.setCustomWeight(true);
            this.setActualWeight((this.getScriptItem().getActualWeight() - this.WeightEmpty) * this.getCurrentUsesFloat() + this.WeightEmpty);
        }
#

there is also setWeightEmpty

bronze yoke
willow tulip
#

Also of note: setWeight is never used in LUA, neither is setemptyweight... But setActualWeight() is

#

Weaponparts also have setWeightModifier that might be of some use @vast pier

vast pier
#

Oh i wasn’t needing anything, was just answering their question lel

#

The attempt to help is acknowledged and appreciated though

willow tulip
vast pier
#

Shouldn’t need to since the weapon attachments get transferred to the melee version and vice versa

willow tulip
#

kk

#

Uh, thats an interesting.. debug menu.. that does the nothing.

bronze yoke
#

only works in multiplayer

willow tulip
#

(apparenty hugolibby is the random name of the character im playing as)

willow tulip
peak nymph
#

Thanks all

willow tulip
#

TIL that the weight of an object in PZ comes from its name. thats why baseball bats and charcoal is so heavy while pens are light. /s

bronze yoke
#

the assumption is basically any item without a name is meant to be for weird internal use only

#

like the zombie scars that are technically clothing items

willow tulip
icy night
#

Is 64x64 the correct profession img size? And if so, am I allowed to go a bit bigger than that? Wondering if I could fit a 84x84 image

#

ik some things are restricted in size, while others have some wiggle room

bright fog
icy night
#

ah

bright fog
#

It'll still be 84x84

thorn siren
#

I can't get my item tooltip to work, it looks practically identical to vanilla tooltip code and another mod's tooltips code that i tested worked.

media\lua\shared\Translate\EN\Tooltip_EN.txt
Tooltip_EN = {
Tooltip_GSplanting = "test test",
}

and

media\scripts\GrassSeed_items.txt
module GS
{
imports
{
Base
}

item GrassSeed
{
    DisplayCategory = Gardening,
    Type = Normal,
    Icon = Seeds_Generic,
    Weight = 0.02,
    WorldStaticModel = Seeds_Ground,
    Tooltip = Tooltip_GSplanting,
}

item GrassBagSeed
{
    DisplayCategory = Gardening,
    Type = Normal,
    Icon = Seeds_Grass,
    Weight = 0.1,
    WorldStaticModel = GrassSeedPacket_Ground,
}

item GrassBagSeed_Empty
{
    DisplayCategory = Gardening,
    Type = Normal,
    Icon = Seeds_Grass,
    Weight = 0.02,
    WorldStaticModel = GrassSeedPacket_Ground,
}

}

bronze yoke
#

what do you see ingame?

thorn siren
#

The last thing on the little window when hovering over the item is just the mod identifier, there's no tool tip at all that should be showing up under it

knotty stone
#

Wouldn't that be Tooltip_Tooltip_GSplanting ?

thorn siren
#

This is how it's formatted in the vanilla code and in other mods' codes I've referenced.
A random example from vanilla:

#

normal.txt
item AlcoholBandage
{
DisplayCategory = FirstAid,
Type = Normal,
Weight = 0.1,
Icon = Bandage,
Alcoholic = true,
AlwaysWelcomeGift = true,
BandagePower = 4.0,
CanBandage = true,
count = 1,
Medical = true,
ReplaceOnUse = Base.BandageDirty,
Tooltip = Tooltip_AlcoholBandage,
WorldStaticModel = Bandage,
Tags = NoPour,
}

#

While it's tool tip is in vanilla Tooltip_EN.txt
Tooltip_EN = {
...
Tooltip_AlcoholBandage = "Used to sterilize wounds and aid recovery from infection.",
...
}

knotty stone
#

Maybe because it's not a Base. Item but GS you need another format like GS_Tooltip_GSplanting

#

Tooltips are a bane of mine lol. I have a translation mod where I had to replace them with lua cause the Chinese modder was lazy xD

thorn siren
#

Well after a ton of fucking around, shuffling tooltip keys from vanilla items and other mods, and renaming files. I put everything back just the way it was and now it just works for some reason.

#

I'll put the real text in it tomorrow and see if it still works consistently then I can finally start working on the actaul core mechanics of the mod after spending over a week just trying to make the items exist

peak nymph
#

would it be too mean to have my pressure cooker item explode if used incorrectly, if too much water is put in and its left to burn

bronze yoke
#

the microwave explodes if used incorrectly so it seems fair to me

#

i don't know what the majority consensus is but a lot of players (myself included) love that sort of thing

peak nymph
#

the plan is if you put no/to little water itll still cook food but jars wont seal, and if you leave it to burn food will burn
if you put the right amount of water jars will seal and food wont burn
and if you use too much, jars will seal, but if left to burn it explodes

peak nymph
#

is anyone familiar with fluid container names, specifically a way to not add "Empty" or "Water" before the container name

peak nymph
#

I could do it onCooked but that seems mean haha

daring bough
#

Any ideas why blood level value number is not getting over 4, no matter how much zeds I hit?

peak nymph
willow tulip
#

set daystorotten (or whatever it is) to be item:getScript():getDaysToRotten()*sandboxvar

peak nymph
willow tulip
peak nymph
willow tulip
#

(Since B42.12)

night shell
#

So, Co-Pilot wants to add an "unnecessary chaining protection" to an extender function of ISWorldMapSymbols:prerender but I am suspicious of this. I am not very versed in Zomboid modding yet but I haven't seen this before:

local EMSUI_prev_prerender = ISWorldMapSymbols.prerender
if not ISWorldMapSymbols.__EMSUIWrapped then
function ISWorldMapSymbols:prerender()
    if EMSUI_prev_prerender then EMSUI_prev_prerender(self) end
    self:extraUI_Init()
end
ISWorldMapSymbols.__EMSUIWrapped = true
end

Anyone have an input on this?

night shell
night shell
bright fog
#

Also you have some useless checks. Mostly checking your EMSUI_prev_prerender exists, you're sure it does and if it didn't you'd break the UI

#

Since you wouldn't call the original prerender

night shell
#

When you stare at a problem for too long zederp

#

Though not sure about uploading it without the UI. I guess it could require the original but then you must set the sort order right so my fix overwrites the faulty one.

empty gate
#

👋
I'm wondering if it's possible to display a kind of animated ui (like gif or webP or raw png sequence at least) inside this window?

    local o = ISCollapsableWindow.new(self, x, y, width, height)
    o.title = ""
    o.resizable = false
prisma wren
#

out of curiousity, does anyone know where i'd find the gif for the loading icon of the zombie walking?

bright fog
bright fog
#

It might give you some insight

red tiger
#

Does Project Zomboid come with any unit or metrics testing library / software that I can use for a Java performance patch?

#

Was thinking of using JUnit but in-game code execution also matters when it comes to performance.

bronze yoke
#

they seem to use junit internally but it's not packaged with the game

red tiger
#

I wrote a patch last week that optimizes target method invocation within the Kahlua / Lua engine dramatically.

#

(Removes the Reflection API overhead)

#

I'll take a look and see if I can get both a JUnit test and an in-game looped time test and then gather those metrics and compile them into a sheet.

#

But as it turns out the biggest bottleneck beyond architecture / design for Kahlua2 is the use of Reflection API.

prisma wren
#

i wonder if i'd be able to get the full size but i'll just try to swap the gif first

prisma wren
#

where are mod files stored? im looking for the mod i installed for a reference but i cant seem to find it in the local files

#

its not under steamapps

prisma wren
#

this is great resource

#

thanks

sturdy silo
#

Hi I am the creator of "Throbby's Energy Drinks". It was brought to my attention by a friend that a website called GGNetwork appears to have re-uploaded it without any kind of permission from me. Any advice on if I can or should do anything about it. Thanks

bronze yoke
#

afaik not really, those websites just mirror the whole workshop

#

i'd just ignore it, those sites are only used by people who can't access the workshop (usually because they pirated the game) so they don't really take away from your traffic

sturdy silo
#

I see, I just don't want someone to pull a virus from it, I appreciate your help, thanks

prisma wren
#

ok how is a gif a png?

bronze yoke
#

the loading icon isn't a gif, it's an animated png

prisma wren
#

great, how do i make one of those?

#

should i just use a website like https://ezgif.com/apng-maker

bright fog
twin socket
#

Hi, I'm working on a mod that replaces the player model. It shows up fine in character creation but when I load into the game it just loads with a black screen and throws an error in the bottom right corner, and I'm not sure why. If someone could help me, I'd appreciate it. I can share console log if needed. Thanks!!

prisma wren
#

i probably definitely should have compressed the png since its big as fuck, i'll see about updating it and compressing the files

#

i WILL be compressing it i forgot that this file has 4 seperate interations

#

and all are 50 mbs

#

for some reason the loop gets all weird

#

i need to 100% update this

prisma wren
#

although the weird looping issue eludes me

#

and it looksbetter at a lower resolution

naive crest
#

Is anyone able to help with my I get a stack overflow error when turning on my texture pack

#

this is how my mod died

bronze yoke
#

<@&671452400221159444>

left plank
#

danke

olive lance
#

hi guys where am i meant to put recipe scripts (b42, first time doing any of this)

currently doing Zomboid\MODNAME\Contents\mods\MODNAME\42\media\scripts\Test.txt

module Base
{
    craftRecipe TestRecipeXD
    {
        Tags = AnySurfaceCraft;CanBeDoneFromFloor,
        inputs
        {
            item 1 Base.EmptySandbag,
        }
        outputs
        {
            item 1 Base.Gravelbag,
        }
    }
}
#

running the game with the mod in the workshop folder to start with crashes with a really nondescript error, actually loading it with the reload lua button gives two errors, one mentions unknown recipe param: Base.EmptySandbag

im assuming nothing's wrong with my recipe bc i've rewritten it from the wiki a couple times already but idk 😭

willow tulip
olive lance
#

only the inputs need it according to wiki ig

willow tulip
#

in their infinite wisdom they made input and output syntax differ

olive lance
#

either way it was kind of a silly thing to be hung up on since i was literally starting by copying the recipe files and editing them

olive lance
#

aaaa another error, trying to add timedaction now

TimedActionScript 'SmashGravel' could not be found in recipe SmashStonesIntoGravel at CraftRecipe.OnScriptsLoaded(CraftRecipe.java:824), will have to experiment w this more bc the action im using is literally a c+p of another

bronze yoke
#

try referencing it as GrapesGravel.SmashGravel in your craftRecipe

olive lance
#

ty lol

#

i've worked w namespaces b4 i feel like an idiot 😁

bronze yoke
#

nah, it's pz's fault for their implementation being completely inconsistent 😅 excluding the namespace for objects in the same namespace *usually* works but doesn't for everything

olive lance
#

fair ig since it should be referenced as Base.x but wtvr erm hopefully the game will get there, ty for help

olive lance
#

damn ran into another namespace hiccup w translation files

#

is it good practice to put the tl files in common

#

or does the game error when stuff isn't used

drifting ore
#

Mine are in my 42 folder

bronze yoke
#

i prefer to keep them in common

zealous silo
#

Hello, to make it quick, I am creating a profession mod and want to add some traits from another mod, but I don't know how to do it. When I put the traits in the .lua, the professions break. I am using the standard version of Profession Framework and More Simple Traits, all in B41. Any help with Profession Framework would be appreciated. stressed

olive lance
olive lance
mental patrol
#

Mod suggestion for B42 (mp servers when it comes out) a mod that adds a few more job specific spawn locations
like construction workers spawning on build sites
or chefs in resturants
burglers having a 40 or 50 % chance to spawn in jail
ETC ETC :3

hot void
#

This is a tool for adding tattoos to Ellie tattoo parlor created by me which will make adding tattoos even faster

topaz tangle
#

thats so cool very user friendly

topaz tangle
#

Doing work in my Powell again (looks better now, older screen shot)

icy night
#

Is there a guide on how to make poster images pop-up? I have a trading card that I'm trying to get to show up on screen but the script I made doesnt work.

icy night
#

Ah, nvm. Figured it out with bandits week one scripts

topaz tangle
#

thats so cool

topaz tangle
#

i did it

#

just gotta update the other model now

vast pier
#

Don't know what to do about this

willow tulip
# vast pier

Well, first replace the input values with 4 and see what happens...

#

So you'll know if its the set weight, or the get weight thats failing you.

vast pier
willow tulip
#

Now thats what I call a weapon!

#

does it degrade your gun or the chopper to cut down a tree?

vast pier
#

Chopper

#

Gun durability and attachment durability are tracked separately

#

same with sharpness

willow tulip
#

❤️ nice

#

Plz make sure sharpness degrades faster then condition. I really don't like having to repair stuff before I sharpen it. (maybe even make sharpness factor into chance of condition loss or something if your redoing the math)

#

(vanilla knives/weapons often seem to lose condition at same speed or faster then sharpness, meaning you never get to sharpen them as max condition sets max sharpness)

vast pier
#

I'm not calculating condition myself

#

it's the vanilla calculations

#

Condition and Sharpness are stored via params and modData that is directly tied to the attachment itself

#
    item LugSawBlade
    {
        DisplayCategory = WeaponPart,
        Type = WeaponPart,
        DisplayName = LugSawBlade,
        Icon = Scope2x,
        MountOn =  SaltyFirearmsFramework.ImprovisedRifleTest;SaltyFirearmsFramework.ImprovisedBoltActionNoStock;SaltyFirearmsFramework.ImprovisedBoltActionStock;SaltyFirearmsFramework.ImprovisedSemiActionNoStock;ImprovisedSemiActionStock;RamshackleWeapons.RevolverRifle,
        PartType = saltylug,
        Tooltip = Tooltip_Scope,
        MetalValue = 22,
        WorldStaticModel = SaltyFirearmsFramework.ChopperSawblade,
        CanAttach = Recipe.WeaponParts.hasLugSpace,
        CanDetach = Recipe.WeaponParts.hasLugSpace,
        Sharpness = 1.0,
        ConditionLowerChanceOneIn = 6,
        ConditionMax = 27,
        Tags = LugChopper;Sharpenable,
    }
    /*MARK:[Lug Attachment]
    */
    item BayonetImprovised
    {
        DisplayCategory = WeaponPart,
        Type = WeaponPart,
        DisplayName = BayonetImprovised,
        Icon = Scope2x,
        MountOn =  SaltyFirearmsFramework.ImprovisedRifleTest;SaltyFirearmsFramework.ImprovisedBoltActionNoStock;SaltyFirearmsFramework.ImprovisedBoltActionStock;SaltyFirearmsFramework.ImprovisedSemiActionNoStock;ImprovisedSemiActionStock;RamshackleWeapons.RevolverRifle,
        PartType = saltylugattachment,
        Tooltip = Tooltip_Scope,
        MetalValue = 22,
        WorldStaticModel = SaltyFirearmsFramework.BayonetImprovised,
        CanAttach = Recipe.WeaponParts.hasLugAttached,
        CanDetach = Recipe.WeaponParts.SaltyAlwaysTrue,
        Tags = ImpLugAttachment;ImpBayonet;Sharpenable,
        Sharpness = 1.0,
        ConditionLowerChanceOneIn = 6,
        ConditionMax = 27,
    }```
#
local function SaltyOnSwing()
    local item = getPlayer():getPrimaryHandItem()
    if not item then return end
    if not item:hasTag("SaltyRefresh") then return end
    local modData = item:getModData()
    if not modData.SaltySharpness then print("fuck") return end
        print("Initial Sharpness modData " .. modData.SaltySharpness)
        modData.SaltySharpness = item:getSharpness()
        print("Resulting Sharpness modData " .. modData.SaltySharpness)
end
Events.OnWeaponSwing.Add(SaltyOnSwing)```
vast pier
#
local function SaltyonEquipPrimary()
    local item = getPlayer():getPrimaryHandItem()
    if not item then return end
    if not item:hasTag("SaltyRefresh") then return end
    local modData = item:getModData()
    if not modData then return end
    local WeaponID = modData.SaltyItemID
    if not WeaponID then return end
    --local ModelAttachments = modData.SaltyModelWeaponPart
    local InputSprite = modData.SaltySprite
    --local InputSpritesByIndex = modData.SaltySpriteIndex
    local BayonetConditionMax = modData.SaltyMaxCondition
    local BayonetConditionChance = modData.SaltyConditionChance
    --local AttachmentType = modData.SaltyAttachmentType
    --local MagazineType = modData.SaltyMagazineType
    local GunChambered = modData.SaltyGunChambered
    local Weapon = instanceItem(WeaponID)
    local SaltyClip = modData.SaltyClip
    local BayonetSharpness = modData.SaltySharpness
    item:setModelWeaponPart(Weapon:getModelWeaponPart())
    --item:setWeaponSpritesByIndex(InputSpritesByIndex)
    --item:setModelIndex(Weapon:getWeaponSpritesByIndex():indexOf(InputSprite))
    item:setWeaponSprite(InputSprite)
    item:setAttachmentType(Weapon:getAttachmentType())
    item:setConditionMax(BayonetConditionMax)
    if BayonetConditionChance and BayonetConditionChance > -100 then
        item:setConditionLowerChance(BayonetConditionChance)
    end
    if SaltyClip == 5 then
        item:setMagazineType(Weapon:getMagazineType())
        item:setContainsClip(true)
    end
    if GunChambered == 5 then
        item:setHaveChamber(true)
        item:setRoundChambered(true)
    elseif GunChambered == 3 then
        item:setHaveChamber(
        item:setSpentRoundChambered(true))
    end
    if BayonetSharpness then
        item:setSharpness(BayonetSharpness)
    end
end
Events.OnEquipPrimary.Add(SaltyonEquipPrimary)
Events.OnCreatePlayer.Add(SaltyonEquipPrimary)```
vast pier
small osprey
small osprey
# small osprey TIL: With two small helper functions we can trigger Zone Stories from lua. https...

As "Stories" seem to be defined purely on the Java side and to make dynamic placement of "rich-ish" scenes more robust and require less boilerplate and hard-code, I think I will create a small scene builder with chainable API. Has anybody seen something like that or began work and then abandoned?
PZNS NPC framework has maybe some lifecycle inspirations I would guess but place-once stuff like the scene described below might not need much in that regard.

    :corpse()
      :outfit("Boilersuit","Vest_BulletCivilian","Hat_GasMask_nofilter")
      :onBody("Bag_ToolBag","Screwdriver", {"ElectronicsScrap",2}, "ElectricWire","DuctTape","CarBattery1")
      :dropNear("RemoteCraftedV1","Speaker")
      :blood{ splats = 6, trail = true }
      :place("near_window", { retries = 6, fallback = {"away_from_door","any"} })
    :container("Bag_MedicalBag")
      :fill("BookFirstAid3","PillsAntiDep")
      :place("near_door")
    :scatter()
      :items({"ElectronicsScrap",3},{"AluminumFragments",2},"Notepad","Pencil")
      :count(12):bias("workbench_like"):radius(4)
    :spawn()```
night shell
icy night
prisma wren
#

i would really like a mod that lets you modify weapons like some hunt showdown variants, like the talon, the trauma, the hatchet, and others

#

wish i knew how to code zomboid mods, i know the basics of lua but not the code structure of zomboid

peak nymph
prisma wren
#

hmm, maybe i’ll check out some mods and see what i can do

#

i’ll stick to vanilla weapon stats but see if i can make the interaction and crafts to do that whenever i can make time

vast pier
bronze yoke
#

basically any time they ran out of ideas for weapon variants they would add a new melee one so it ended up with some pretty cool designs

azure escarp
#

Hello guys I've been thinking about making a mod for zomboid for a while now but I've never made a mod before

#

i can currently code in java and C++ so I'm good at coding. is there a tutorial available or anyone who can help me?

vast pier
azure escarp
#

i should have checked first

bright fog
#

np

icy night
azure escarp
small osprey
topaz tangle
#

the powell has been fixed :D

topaz tangle
#

More Powell work
Did the modeling and part of the texturing for the utility wagon

willow tulip
topaz tangle
#

That is actually something i considered early on, but then i realized i didn’t like it much

willow tulip
#

1% monocromatic noise + slight desaturation

topaz tangle
#

This looks the exact same to me lol

willow tulip
topaz tangle
#

I try and make my stuff fit with vanilla vehicles (though, with less issues) as much as I can
I also suck at adding fine details

willow tulip
#

also, perlin noise.

#

small amount of perlin noise added.

#

exadurated amount.

#

IMO, subtle levels of noise that you can hardly even notice actually add a lot to a model.

#

without it, your brain tends to think something is just.. a bit wrong.

azure escarp
#

if i get any problems i'll be here

next forge
# willow tulip

Colors look sligly less vibrant but even for me who is pretty got at seeing small difference in color the change is relly small.

upbeat turtle
#

overhauling the radial UI in the next tame-able wolves update! thoughts, y’all? 🐺
(this is just a mockup)

#

the flow is…
Player presses “G” >> Selects a tamed wolf from the first side >> Transitions to the second side with commands for that specific wolf

small osprey
#

the "triforce" thing indicates top, left-low, right-low ? I haven't used the mod so I assume directions are by mouse coursor?

bronze yoke
#

is there a reason you're not using the vanilla radial menus?

upbeat turtle
upbeat turtle
#

plus the ui is fully customizable when we have more assets 😄

small osprey
#

Hehe ok. So as I am not a user I am not very qualified to give feedback. I just wonder:

  1. How would that be for a number not 3
  2. How does the user select. hotkeys or mouse or cursor?
upbeat turtle
bright fog
#

You can have as many elements in it. You could have the radial with sub radials for indvidual animal commands

#

So first radial are available wolves, second are commands for this wolf

upbeat turtle
#

neato!!

bright fog
#

Can even have the wolf render inside the radial options to show clearly which wolf you're selecting

upbeat turtle
#

this new menu will definitely have a submenu

bright fog
#

You can do your own radial sure but the vanilla UI system is extremely flexible

#

You can use the vanilla radial, derive it and modify it to customize it yourself

upbeat turtle
#

yee

#

another part of it too, this was more or less an experiment on my end with custom ui stuff lol

#

later down the road, we’ll need to cook up some more custom uis for other systems in the mod

#

prior to learning lua, majority of my coding experience came from C++

#

it’s fun seeing what we can do with the game engine 😆

#

yesterday I figured out we can force animation states for animals with lua

#

that really opens the door to a lot of possibilities & needing to rely less on the vanilla behavior system

topaz tangle
peak nymph
#

does anyone know why my OnEat function doesn't seem to be being called

got this in the item script
OnEat = JarOnEat

and this function in my lua/server/myfile.lua

  print('here')
  local lid = instanceItem("Base.JarLid")
  character:getInventory():AddItem(lid)
end```

the print never fires
other functions in that file (an OnCooked function etc) all work fine
peak nymph
#

does anyone know if its possible to disable a craft recipe via sandbox option?

topaz tangle
#

having an annoying issue: when trying to update my mod, its claiming that im missing a mod.info file but as far as i can tell im not

peak nymph
topaz tangle
#

The first folder, then in the main folders for the main mod and submod
Also in my 42/ folder

upbeat spear
#

Why the. Britas armor abd guna dont load on thr game?

topaz tangle
#

I changed nothing and it fixed itself

#

Oh wait no

#

I removed the submod folder

#

Hmm

#

In that mod I just have the mod.info file in the FHQSUPPORT/ folder but I also don’t have b42 support

#

I added folder for b42 support and it’s fine now

bronze yoke
peak nymph
bronze yoke
#

lines have to end with a comma to be parsed

peak nymph
#

knew it would be something stupid i was missing, thanks

topaz tangle
peak nymph
#

does anyone know of a way to disable or hide a craft recipe, either through lua or an existing tag or something I can use lua to add

topaz tangle
willow tulip
#
peak nymph
# willow tulip Sadly, no -_-;

Ah damn, someone left a comment on the steam page for my mod asking if I could add a sandbox option to disable the craft recipe (so its only findable)

#

Can probably just separate the recipe to a different sub mod, and if you enable both you get the recipe, and if you don’t want it just enable the main one

willow tulip
fleet bridge
wind sphinx
#

i was thinking about developing a trait mod and i dont exactly know where to start, ive watched a couple tutorials but none of them were for traits. any help would be great.

topaz tangle
wind sphinx
topaz tangle
#

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

then find the number of the mod you want to look at, should be in the mods description

#

then you just gotta try and fine relevent scripts and stuff

topaz tangle
#

Np!!!

bronze yoke
#

<@&671452400221159444>

thorn siren
#

so wait, in build 42 placing dirt/sand/gravel is a building action that completely replaces and destroys the floor beneath it? Like if you pour some sand on the road then try to dig it up then you just get the dirt texture that indicates that there's no interactable tile there anymore and the concrete is just gone. That almost completely ruins the premise of a mod I'd been working on if I'm not just completely mistaking about it, and kinda just doesn't make sense.

queen oasis
thorn siren
#

In hindsight I guess my mod concept can still work by mimicking this new functionality since it was actually going to do similar, but it still seems pretty stupid from a vanilla standpoint that pouring some dirt/sand/gravel on the ground would destroy whatever ground was already there.

willow tulip
#

I literally have to use debug mode to do it

thorn siren
# willow tulip Please go make a bug report on the forum, because yea, its just dumb and wrong t...

I think that's because when you dig grass you're actually removing the dirt on that tile and making it an "empty" tile that just uses the dirt "blend_natural_1_64" sprite, and you can't dig furrows on "empty" tiles. There is a bug though that you can't put the dirt back on the "empty" tile because the code has a catch to prevent you from building floors on top of identical floors and both the dirt floor from the build menu and the "empty" dirt floor use the that same "64" sprite. There's a mod that came out the other day though to address this by replacing the built dirt sprite with a different but identical sprite so the catch doesn't stop it anymore.

willow tulip
thorn siren
#

yeah, but what I'm getting at though is that the new system sucks in general for deleting existing flooring just because you put dirt on it

willow tulip
#

also gimme the name of that mod if you know it, lol

willow tulip
#

My god, I'll be able to actually do basic teraforming ingame? Likely with less bloody clicks then using the brush editor since you need to first delete the tiles before placing new ones to avoid stupid bugs and visual issues?

#

(you know its bad when your tile editor takes longer then doing the equvilent action ingame)

thorn siren
#

Well I'm pretty sure you do still have to dig up the grass then replace the dirt for you to be able to dig furrows

willow tulip
#

thats fine

#

just so long as I don't need to load up into debug mode just to plant another damn row.

upbeat turtle
#

very early wip — radial menu overhaul 🐺

#

i’m considering changing the text color from white to black. Thoughts?

peak nymph
#

I feel like probably not but is there anything I can hook into for when you are adding an item to an evolved recipe

Basically I want to put a different item in the extra items data for the recipe (or possibly multiple), rather than the item used, as well as return an item to the user

#

Couldn’t see anything by in the docs but not sure if I’m just looking for the wrong name etc

bright fog
peak nymph
peak nymph
bright fog
#

Usually your best starting point is either to have a clear starting point in the Java code or other Lua code of where this timed action can be triggered or you can use translation keys that lead to triggering what you're looking for

#

I'm not familiar with evolved recipe but I assume at one point they must have a UI option to trigger these that has text in it

#

So you can search for this text, find the translation key and then look at where it's used

peak nymph
jovial escarp
#

hi guys, I'm trying to test a mod that adjusts vehicle stats, but in the Mods tab it shows up in red and cannot be enabled. What is usually the cause of this? This is my first time making a mod, so I'm not sure what to do.
I wouldn’t mind if there were at least an error message to give me a clue, but since there isn’t, it’s really giving me a headache.

bright fog
jovial escarp
#

When I click the mod, its image, description, location, and other details are displayed.

#

Simply hovering my cursor over it doesn’t show anything.

unique harbor
#

How can I change the scroll order of the buttons?
I'm currently changing the Y of the buttons to order them correctly because table.sort seems to break it...

willow tulip
#

shudders upon reading about table.sort That is why you should always traverse arrays with ipairs, rather than pairs. The first imposes the key order 1, 2, ..., whereas the latter uses the natural arbitrary order of the table.

#

.... tables... used as arrays.. arnt actually sorted internally?

#

I mean.. I guess that makes sense since its likely just a hashmap...

willow tulip
bright fog
#

Video Guide

Setting up a basic mod structure
https://youtu.be/LwwH3jYhN9U

This is the first video in what I hope to be a continuous long serie of videos on creating Project Zomboid mods. Please do give your feedback, I made this in like one or two hours at most and on the spot, and it's very likely I'll remake this video in the future. Give any feedback, if you find it shit don't hesitate lol. Not being an english native speaker, my prononciation might be rough some times, I know I'm not best speaker out there and tend to not articulate when I talk. I know I'll get better at it however, also I literally did not make a script for this video so it can be messy and I do miss one or two important points I would have liked to cover.

Don't hesitate to give feedback

This guide goes in detail on setting up a basic mod to work on for Project Zomboid.

WIP: this is currently my first ever video guide for PZ modding and serves mostly as a concept currently. It's likely I'll rework this video in the future.

Relevant Wiki pages:
https://pzwiki.net/wiki/Mod_structure
https://pzwiki.net/wiki/Mod.info
https://pzwik...

▶ Play video
wind sphinx
#

so im analyzing the "op traits" mod and i think but im not sure if this is where the traits get put into the character creator.

#

if anyone can confirm that would be great

peak nymph
wind sphinx
peak nymph
wind sphinx
#

thank you, will do

unique harbor
willow tulip
#

Floor also might have some kinda special index? dunno

peak nymph
#

is there anything extra I need to do to add an existing ingredient to my custom recipe

#

got this in the lua

  "HiemVegetables",
}

local HiemVegItems = {
  "Base.BellPepper",
  "Base.Broccoli",
  "Base.Cabbage",
  "Base.Carrots",
  "Base.Cauliflower",
  "Base.Garlic",
  "Base.Habanero",
  "Base.Jalapeno",
  "Base.Leek",
  "Base.Lettuce",
  "Base.Onion",
  "Base.Potato",
  "Base.Pumpkin",
  "Base.Radish",
  "Base.GreenPeas",
  "Base.Soybean",
  "Base.Zuccini",
  "Base.Tomato",
  "Base.Turnip",
  "Base.Spinach",
}

function populateVegetableJarRecipes()
  for _,name in ipairs(HiemVegRecipes) do
    for _,type in ipairs(HiemVegItems) do
      local item = ScriptManager.instance:getItem(type)
      if item then
        item:DoParam("EvolvedRecipe = "..name..":"..(0 - item:getHungerChange()));
      end
    end
  end
end

Events.OnInitGlobalModData.Add(populateVegetableJarRecipes)```
#

with my evolved recipe like this

  {
      BaseItem = Base.EmptyJar,
      MaxItems = 6,
      ResultItem = HiemCanning.CannedVegetablesNoLid,
      Cookable = true,
      Name = Prepare Jar of Vegetables,
      Template = HiemVegetables,
      MinimumWater = 0.9,
  }```
#

I originally tried with HiemVegRecipes containing the recipe name instead of the template and still no luck

willow tulip
#

Not seeing anything offhand, other then more stuff that makes me fear ever so much:

#

oh wait that only uses | for the cooked tag nm

willow tulip
#

Id also throw a print in your innermost loop just to make sure its executing

#

(or I guess debuglog statement)

peak nymph
peak nymph
willow tulip
#

Weird. should work judging from other mods that do similar.

#

oh

#

instanceItem:getItem("Base.Rice"):DoParam("EvolvedRecipe = SapphCooking.PanPaellaEvolved:8;SapphCooking.BRicePan:8;SapphCooking.ABRicePan:8;SapphCooking.RisottoEvolved:8")

#

you might need the fullname of your evolved recipe?

#

though looks like that isn't used for base. evolved recipes..

#

I assume evolvedrecipe JarOfVegetablesNoLid is in base. ?

peak nymph
#

no its in my module

finite scroll
#

can someone explain what the orange circle mod icon means compared to the blank mod icon? (b42)

willow tulip
willow tulip
#

item:DoParam("EvolvedRecipe = HiemCanning."..name..":"..(0 - item:getHungerChange())); or something :0

peak nymph
willow tulip
peak nymph
wind sphinx
peak nymph
wind sphinx
peak nymph
wind sphinx
finite scroll
#

this may potentially be a linux-exclusive issue but i'm not sure

#

tmk naming the icon icon.png shouldn't be a problem

jovial escarp
mild granite
#

Hi everyone, I want to intercept the WeaponHitCharacter hook, run my own code, and in some cases block or modify the damage. My questions are:

How is WeaponHitCharacter can be replaced on the Lua side?

Are there internal mechanics I need to respect to avoid breaking things?

Is using this hook the right approach if I want to replace the default damage handling with my own logic, instead of using the standard event system?

bronze yoke
#

hooks aren't standard practice unfortunately due to their extremely limited scope (there's like 5) and being really hard to work with

mild granite
#

I did found some interresting code in Hit method of IsoGameCharacter LuaEventManager.triggerEvent("OnWeaponHitCharacter", wielder, this, weapon, damageSplit); LuaEventManager.triggerEvent("OnPlayerGetDamage", this, "WEAPONHIT", damageSplit); if (LuaHookManager.TriggerHook("WeaponHitCharacter", wielder, this, weapon, damageSplit)) { return 0.0F; }

bronze yoke
#

hooks run instead of vanilla code, but that's not conditional: if you add a WeaponHitCharacter hook, you are now responsible for handling all effects of weapon hits yourself

mild granite
#

If i want to redefin some damages is this the best way to do it ? or should i just use Events.OnWeaponHitCharacter ?

#

but i really want to know how to use hooks anyway ^^

bronze yoke
#

<@&671452400221159444>

raven sable
#

Hey guys. I'm having an issue with Noir's Shops mod in regards to the currency in it. It won't spawn so I'm trying to make a crafting workaround.

Would anyone be up for giving me feedback on the crafting recipe script?

mild granite
bronze yoke
#

they aren't conditional, if there is a hook the vanilla code does not run

#

this is why they aren't used, everyone wants to do something similar to what you want to do, but ends up being required to rewrite a huge amount of vanilla code

mild granite
#

alright so the correct way would be to use OnWeaponHitCharacter Event -- and use something like player:setHealth(player:getHealth()+ damageSplit /2)

#

?

#

like the IsoGameCharacter would take damage then get half back ? is it a correct way to do it ?

bronze yoke
#

apparently there are more complex calculations that make the damage values returned by the event not very reliable, @bright fog knows more about it than i do

#

in fact that was for zombies -- for players, the game doesn't really use a health bar, so you can't just add health back

#

every body part has a separate health bar that's mostly affected by injuries, the health bar in the health menu is based on these separate healths

#

this is just a weird area the modding api is quite weak in unfortunately

mild granite
#

that's why it may be lighter to just use hook : XD

bronze yoke
#

that's why there aren't really any mods that do stuff like that

topaz tangle
#

does anyone know how to make it so there is a chance that another model with spawn ontop of an existing vehicle model? (sorry if this is poorly worded)
i know you can but i cannot figure out how

topaz tangle
#

i think i figured it out...

topaz tangle
#

i figured out half of it

ashen maple
#

Does the craftUI use OnTest in craft recipe to determine if a craft is possible (enable the craft button?)

bright fog
#

Like albion mentioned basically

#

The damage value is completely fake

#

There's sooooo much more going on on this vakue after

#

It's never a good indication of damage, besides the damage ramp up on zombie after multiple hits

bright fog
topaz tangle
#

Does anyone have any idea why my icon and world model for an item is not working

lofty frigate
#

It could be a problem in the scripts

topaz tangle
#

I can share pictures of them but it all looks fine to me

muted garnet
#

How can I get the active stove when the player reloads the world? I want to implement an item with custom cooking logic that can only be cooked in a specific stove. However, when reloading the world, the stove keeps its “on” state, but my item doesn’t retain the “cooking” state.

lofty frigate
topaz tangle
#

That’s so fair, I think I’ve figured it out but I’m not sure just yet

#

I just LOVE yelling so loud when things so wrong

lofty frigate
lofty frigate
topaz tangle
#

It’s always good when it works, I think I just misplaced a file but I cannot find it

raven sable
#

I've redone my script a couple times and now its completely broken my crafting menu.

lofty frigate
#

b41?

raven sable
#

I'm trying to make a crafting work around for the SHops mod that Noir made. I have an issue where I can't get the coins for it to pop up in the loot table despite throwing it over absolutly everything

lofty frigate
#

Oh, I don’t know, what I was talking about was for build 42.

raven sable
#

I can spawn them in so I figured making a crafting recipe would be a simple fix using jewelry.

lofty frigate
#

Maybe it’s missing the final comma after maxTime

raven sable
#

so maxTime = 60,
}

lofty frigate
#

maybe yes

raven sable
#

Could the text program I'm using be the issue? Should I try making it on somethign else like Notepad++?

true nova
true nova
raven sable
#

I looked at other mods in my workshop list and tried to plug and play with it. I don't have any coding experience so I was hoping I could work off a skeleton

lofty frigate
#

Now that I see it, I’m not sure if you can add comments using ‘-- text’ in the scripts. I think it has to be / * text * / instead.

raven sable
raven sable
true nova
raven sable
#

Okay. Giving it a go. .-.

#

Fiftieth time is the charm

lofty frigate
#

/* Accept any of these gold items */ But I don’t think you need to add any comment here.

#

guns, I hope to release the snowman mod soon. In the description, I’ll say that thanks to your Functional Clothesline mod, I was able to make mine.

true nova
lofty frigate
# true nova no don't look at my code its all trash 😭

Great mod. The only thing I noticed is that instead of using EveryOneMinute, you could make the container overlays update only when there’s item movement. I also looked at the Veracious Network's Garage mod. Between the two, I was able to figure out how to do it Snowman mod.

raven sable
#

I think I need to fix the item Id's

#

base.GoldBangle etc

true nova
true nova
raven sable
#

SO would I need to use the Item name or the Item ID?
Eitehr way I am wrong on all accounts for the item in the script

true nova
#

you're using the display name

#

so goldbangle would be Bracelet_BangleRightGold

#

and Bracelet_BangleLeftGold

topaz tangle
#

both scripta

raven sable
topaz tangle
#

PEAK!!

bleak remnant
#

Excuse me guys, i need help. i am trying to add something in my mod. For an example, when the player throw a bomb, it is trigger by the player and the bomb spawns in the world, ok, but how do i trigger that by code? i mean, trigger a bomb to spawn with code? i have been seaching for a while but i have no clue how to do it

willow tulip
bleak remnant
#

Basically the entity of a bomb after you throw it

willow tulip
#

I mean.. vanilla has the remote detonated pipebombs and stuff already?

#

they just... have shitty range..

#

just copy that code?

#

(and scale up the blast radius and ideally transmitter range lol)

bleak remnant
willow tulip
#

Ok so heres how you find it

#

get programmers notepad, or some IDE,or anything else with find in files

bleak remnant
willow tulip
#

look up one of the items in questions name, in *.txt, that will lead to an item name in the translation files (or maybe even the item itself)

#

if you just get a translation file, you look up the middle of the translation key in *.txt and you'll find the item itself

bleak remnant
#

Nhum... The bombs txt have only the specifications of a certain item/bomb, it isn't the lua code that trigger the thing and the location it explodes

#

Finding the lua code responsible for stuff like this is quite complicated

#

One day i was trying to track the exact moment a player interact with a sink to fill a bottle of water and oh my god, what an awful experience.

bronze yoke
#

that wouldn't be in lua at all

bleak remnant
# bronze yoke that wouldn't be in lua at all

Wait, what... So, like, if a want to spaw an aerosol bomb, not the item, the entity after you throw it somewhere, for, after that, have that explosion, and i want to trigger it somehow, how would i do it?

#

For what i am trying to do is, i have a zombie with an specific clothe, i successfully can track when you hit it and it's y, x and z location. The only thing missing is spawning an aerosol bomb at it's feet. I am actually using an alternative way where you kill all the zombies and player around it, but it don't trigger the ragdoll so i am unsatisfied.

scarlet dawn
#

when im in a "throw away the games artstyle and make my characters look like stupid ass porcelain dolls" challenge and my opponent is a pz player model mod creator:

covert wren
#

Does anyone know what might be going on? The female model is invisible if I go to male and go back to female. Both models are custom with custom uvs. If I remove the male fbx model the female works fine. It’s when I combine the two models in the mod folder where this issue starts happening.

uncut igloo
#

I have a question: I want to create a mod for car spawning (a different version of 'Did I Have A Car?'), but I’m really dumbass to coding. Where can I find examples or guides for things like spawning, ModOptions, etc.? Sorry if this is a dumb question

mellow frigate
#

play in debug ang right click anywhere on road it will be available

uncut igloo