#mod_development
1 messages · Page 348 of 1
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
}```
You can probably get every items with the tag and add that manually in the input
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
what is your file structure currently
C:\Users\Commander\Zomboid\mods\MediaNet\media\lua\client\init.lua
\ mod.info
oof, is it that bad? lol
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)
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.
B41 or B42?
b42 for sure
i was starting to see something about content in the Mods uploade? i will attempt the adjustments over lunch TY!!
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?
You need a common folder as well as the 42 folder. The common folder can be empty, but it must exist.
And is your mod.info in teh 42 folder? I'm not sure from the lext alignment in Discord.
i'm not personally aware of anything like that, do you know of any vanilla recipes that work similar to what you want? can look in the code if so
Damn, no, cgpt5 is severely lacking on PZ mod skills haha
I personally don't use it, but I seriously doubt it'd be very good for any "niche" topics such as zomboid modding, as there isn't enough info in its data set
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)
I think you are right, I DLd the commonsense mod to try using common sense to compare with CGPT.. lol
And if you give it code and ask it to explain it's usually helpful
I was trying it for work today, seeing if it could help with a complicated AD issue. #mod_development message
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.
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
all 3 seem Plausible
the Doulbe Bellow may be awkward to Opperat depending on the representation
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
Read this page
https://pzwiki.net/wiki/Getting_started_with_modding
Especially the section about AI
And then this page to properly setup your mod
https://pzwiki.net/wiki/Mod_structure
Yes
: usage was normalized to =
So replace : by =
We also have modern examples of a forge being made with a hairdryer and old brake drums, if you want a realistic way to let people make a forge without working through the entire medieval tech tree.
mainly wanted to stick with alternate ways to make the actual bellows as it doesn't require me to make a new sprite/tile haha, just new recipes
probably needs balancing but made an option with the twin bellows and coat recipes for now
https://steamcommunity.com/sharedfiles/filedetails/?id=3578272218
i've pumped 4 small mods out today lmao
i would LOVE to jump on a call around 9p central with you haha
i have my text trees laid out i just need a kick lol
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
i just hate it when i cant figure something out naturally in hour 1
I just gotta do it
just message here also, there’s much more talented people than me in this chat
Thank you very much, it seems to be working correctly now.
People really don't consider how much modern objects allow humans to just skip huges parts of the evolution of tech if they tried
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
The example mod thats already in the correct spot doesnt load.
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.
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
this wiki page explains how mods need to be structured to be recognised by the game https://pzwiki.net/wiki/Mod_structure
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.
Common folder can be empty
But the common folder itself is mandatory
Well, when i added the folder media to it, it showed up in mods so. Only thing i can think of other than magic.
I can assure there is most definitely a good reason for it to appear, but not the media folder thing
We also have a literal 'blower' item in the game.
(though in theory you should need power to use that)
yeah feel that’d require a new tile (to add power requirement) to make sense, and probably new art and can’t be bothered to make that right now
Yea basically how id feel about it too lol
kinda unnessecary if your gonna let them do it with tarps
(blower is way less common)
Not added the tarp recipe atm, just the coat one (may remove) and the two normal bellows
blower would be cool if it somehow reduced crafting time or something.
(not that that seriously matters much)
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
I’ve made it so the coat recipe requires heavy thread also, so you need to hunt animals for sinew or destroy bulletproof armour before you can craft it
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
Well between the time i changed that folder and the last time i loaded the game, nothing really changed. Didnt change anything with the structure or anything so im not sure what else it could be. I restarted my machine so maybe that did it i dont know.
<@&671452400221159444>
A local blacksmith that would show up at history events was a bit older.. he always loved his heat times, used them for rest
does anybody know how to fix gun mods
I had to start over
I Uninstalled all Games, removing extra MODs on the System
I dumped all my Mods Files in a seperate
that might be in the Mod-Support chat
ok Phew, now that everything is working again i can start lol,
yep
None of my mods work
you need a key, you can blank it too
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 🙂
Two things:
- wdym by "server", there isn't MP in B42
- if you know how to reproduce it, then describe it. There's many ways to debug something but we can't give you indications if you don't give more info
by server i just meant the save, world, whatever you wanna call it really.
Its when I get on this skateboard (Which can also be used as a weapon), it just closes, I see that there is an error but I don't have enough time to go and check what that error was
and since i cant get the error, I cant see what the issue is
I mean, I can't help you
Get the error
You don't have time ? Do it later that's fine
Thats-
But you can't debug your mod if you don't identify the error
Do the errors get written to a file anywhere
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 😅
Yea 😭 like i said im new to pz modding
Red error pop ups don't go to void
Uh.. now i gotta find the cache folder lmao
Yea but the console.txt file isn't specific to modding itself
Sec
I thought they MIGHT go to a file but wasnt 100% sure (Proably shoudla asked this from the start)
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
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?
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?
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
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
would share an image of the file structure of one of my mods but I don't have image permissions haha
You can't do multiple types actually (I think I read it wrong first time)
The gun attachment flashlight wasn't using batteries before tho ? Not vanilla items at least I think ?
Kind of
You can use the command "tree" in a command line interface
| 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
does anyone know if I can do multi-line descriptions in the workshop.txt file
Does anyone know about development for that horse mod
Yeah, I'm one of the devs 😄 We're still actively developing it, there's work being done every day and we've made great progress
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?
There's some videos in this thread yeah https://discord.com/channels/136501320340209664/1366841696796672031
At release we'll likely just have kicking, but we're gonna expand on the combat system post-launch to allow for weapons
Yes indeed! If a bunch of them surround you on the horse they'll drag you off.
They can also scratch and bite you if they get too close, but only on the lower body
I am so excited for the mod I can’t wait to ride horses in multiplayer with my friends
Hell yeah 😄 Just in case you didn't know, the mod is for B42 only, so we gotta wait for multiplayer to drop before we can have jousting tournaments and group rides on the beach 😄
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
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
Haha it's all good! 😄 But I'll reply to your questions in the horse thread instead so we don't clog up the chat here
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
not trying to model anything i just wanna do something for the funny
i wanna change the color to the gmod missing texture
Yes, but I suggest you don't edit the description there
You might also be interested in the app I amde to upload mods
It was more because I updated my mod and it reset the description to what was in the workshop file
So was gunna copy the stream one back into the file
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
Believe so, sapph's cooking uses it
you might also find it uses in disinfect bandages
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
but that wants heat, I was wondering if it can be also used to check if the item is cool
Doubt, use ontest/oncreate for that.
Two questions
Do all vehicles in B41 REQUIRE doors (code wise)?
Do all vehicles in B42 REQUIRE doors (code wise)?
looks through java Hu, TIL that food can get tainted if left outside in the rain?
pretty sure the motorcycle/atv in autoclub mod don't have doors (or even a hood)
Is that for both 41 and 42?
shrugs its got a b42 version I know.
afaik nothing significant changed about vehicles between builds
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);
}
Hmm, okay, thanks
Couldn't find the relevant code on heat related crafting in my quick search.
nvm the game already tracks attachment durability, I don't need to do it myself
thanks for the idea~ it made me find a bug in my menu code...
Not sure how but glad I helped? lol
my guess is IsoFire doesn't have a sprite. idk, a check for nil sprite solved it tho
ahh
Is there an easy way to give feedback to the user that it is too hot etc, from the OnTest
No and sapph's cooking gets constant bug reports that they can't figure out how to get recipe that needs heat to work. I recommend adding a tooltip at the very least.
(the bug reports are because people have no clue they need to heat the item)
can I add a tooltip to the recipe? Or just the item?, I’ve added them to items before but not recipes
I’m assuming the “ requires surface” etc tooltips are hardcoded and tag based, not something I can easily just add a new item (meaning requirement not inventory item) to
No idea -_-, you could add something like (Requires heat) to the recipe name though
Requires being cool in my case but same concept
Don't do that either
Simply copy paste your Steam description inside the in-game editor
Bcs setting it up in your workshop.txt will be annoying
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.
<@&671452400221159444>
I feel like the answer is you don't give the backpack a slot for the item, you give the person a slot for the item and only let them wear it if they have the backpack on?
For starters, is the BedrollBottom location vanilla? Because what's happening in the actual code is that the secondary bag is just being listed as being able to be put into that equip slot. It's not FULLY nullifying the weight reduction, it looks like it's half reduced. I guess now I'm trying to figure out where THAT value is coming from
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.
Sure its not just hardcoded reduction of weight of the item? Like when you pack/unpack the bedroll and it becomes different items?
(at least I assume it just swaps between items)
Maybe the BedrollBottom location itself has a set value?
Yeah that
Maybe not, after reading it two more times
very few results for BedrollBottom in the lua
It's not changing the item itself, just attaching it to the slot.
Where is "AttachmentsProvided" defined?
Found this, might help, note B42.11 decompile:
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");
}
}
in the item.txt script?
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;
}
Ok, that's something. Where is that at?
the code or tag?
I just now saw all this, I've been digging myself
this is all java decompiles from 42.11
Ok
Ask someone more skilled then I on how to decompile PZ if you want a copy.
Specifically, the line to attach the bag to the bedroll slot is just AttachmentType = Bedroll, in the item's script
looks like 'attached' items should be 0.7x weight, while LightWhenAttached tagged items should be 0.3x
Yea
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
AttachmentsProvided = BedrollBottom,
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
Im guessing the exact name has some kinda hardcoded offsets to where the object will appear
bedrolls have the tag LightWhenAttached
But that gives you a fixed 0.3 multiplier, vs 0.7 without it.
Your not gonna get the 'container reduction'
Yeah
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!)
I'll give it a shot.
Its not used anywhere in vanilla.. But it seems to exist!
@bronze yoke Fun unknown tag knowledge here ^ 🙂
Mainly this ^
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.
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.
Oh I meant literally just add that tag to your containers itemscript and see how that goes.
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.
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.
Yeah, it didn't like that. Fully crashed. Does not like that tag.
Not in that spot, anyway.
Weird?
you added it to tags right? with a ;
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>
Thanks
No, thank you
Weird. Whats your tag line in the itemscript?
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
Ah, so fakeequipped works, but not for attached things.
tempted to make a mod that just applies fakeequipped to all bags in your inventory...
try LightWhenAttached then, for 0.3x instead, best I can do.
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,
}
}```
hmm I did try and it fixed vanilla errors, but the repair options for the parts is still not showing up
Fixed it, looks like the item names next to Require needed to be prefaced with Base.
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.
Weird.
np
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
Yes, working title is just "Salty's Modular Weaponry"
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
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.
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
Agree, depend on how you combine the parts, pistol can also be short knife(short blade) or brass knuckles(short blunt)
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
You need to add a bit more context I think. Which game version ? What are you working with ? Recipes ? Simple container items ?
What do you put in the pressure canner ?
Im not finding anything useful in itemContainer, but you can store a bunch of data in the objects modData? Enough to recreate the food? (baseitem, hunger, calories, etc?)
maybe use addExtraItems just as an 'indicator' to show what the jar contains?
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
Hu, evolved recipes might be nifty.
Again, we need more context
It really depends
Yea, Moreso that it just sparked some creativity in me in using evolved recipes for hax 🙂
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.
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
Also thank you for providing canning options that don't depend on non-renewable resources
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.
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
What food items do you want to put in ? Any food item ? Whole food items ? Partially eaten ?
I think the best idea to do it here is what moons mentioned, with mod data holding the food item informations
You can definately store data in the objects moddata, and that gets saved/loaded and is all nice and persistent, its just a lot of extra work if you can find a better way to do it like Jvla suggests.
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
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)
any item ideally put inside, only certain tagged items would be "modified" on the canner being "cooked"
The tagged items were meant to be evolved recipes (or items generated from evolved recipes) that get modified
so I was going the container approach as it was evolved recipes inside already that were getting modified
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)
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
yea if you wanna do evolved recipes too, id recommend moddata for sure so you have total control over things.
are there docs for what can/cannot go in mod data, I assumed this was just extra data in the script txt, but would it support an array of a bunch of variable item data to use to recreate them
I don't know if your explanation is confusing or you are confused about what things are
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!)
Maybe the jaring process can spit the bowl/pot/whatever back out when its done?
What evolved recipes are you talking about here ?
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
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)
Why use the bowls directly ?
Why not the pot/saucepan ?
Or accept all of these ?
Option A: jar is a container, you stick item into jar, have some crafting recipe or rightclick menu for 'can object' and it spits out bowls in the process
Option B: jar is a regular item, you use rightclick jar to open context menu to add stuff to jar. spits out empty bowl/pot/etc immediately.
Just directly use a craftRecipe
Less confusing for players
(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)
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
then yea, Id likely make a process that converts them to moddata
So just soup ?
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...
lets say yeah for now
I guess might as well store happyness/boredom/etc too..
No lol bcs it might just change the whole thing if it can accept just more than soup 😅
What items can be put in it ?
Make a list
Can i physically stop items being put in a container? cause if not it doesn't matter cause the user will stick anything in so it would have to support any item
if I can physically stop it it will only be my custom CannedFood item that will work the same as soup bowls, thats why i'm saying soup bowls for now
You can stop items over X weight, and there is also:
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
theres a way to inform the user on screen of stuff like that?
Although I can always just have my new Items be a new category I suppose
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
I just use player:say() to inform them of stuff like that, pops open text above their head, does not alert zombies
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)
thanks so much, now just gotta write the moddata function
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 😛
gunna start with just soup, but should be easy to extend from there once I get it working
unsure whether to make the canner craftable or just make it something you have to search for
Both is always good too :0
I used to be able to put my mods into my local mods folder to use them. Can I not do this any more?
you can still do that, yes
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)
There is a vanilla building export shared by the TIS on their forum. There they included all the buildings from the b41 map, excluding Louisville.
Thanks!
Though this question would better fit in the mapping chat, but no worries
just one about recording/replaying routines
as anyone manage to change the firerates of fully automatic weapons?
im looking to make an ak shoot slower than an m16
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)```
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```
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
What does this mod do ?
What scenario are we talking about here ? Like CDDA ?
Yea like you have already configured scenario and you just select it while creating new save
I've idea that player gone on 2month survival challange in the woods and he have to get back do civilisation. The starting point would be some simple shelter far far in the woods. Of course there would be some starting items but i will figure out it later.
Maybe 10 years later mod with less erosion would be nice with it.
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"
I don't remember ever seeing custom scenarios
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
nevermind this pls, i'm passing a stupid playerNum to the timed action and not player
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
what error?
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)
illegal argument, the function exists but you're passing something weird to it
Ah wait ...
hmm, i'm passing the same value got from getWeight (added to modData then read and tried to write to new item)
search doesn't include inherited members? weird
Classic the search doesn't show inheritance
i never lost the habit of ctrl-f so i didn't even know that
I always used ctrl f before, but I found this searching bar to be quite useful
Tho I guess it's quite unreliable lol
Yea that caught me up a few times before. like trying to find the get position functions that are all part of the base object.
(that are called, so helpfully, getX and getY)
omg i'm so stupid, i was referencing totalCalories not itemData.totalCalories for all the moddata
thanks for everyone help
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.
Not done in myself but there are good resources in the mapping channel
I didn't realize there was a whole channel dedicated to mapping, thanks :D
There's mapping youtube video guides
Check the Mapping wiki page
A lot of them are pretty old, so I was just wondering if map making has become more intuitive since they were posted.
Should be mostly the same, unless you're looking at very old videos
The blackbeard videos are up-to-date from my understanding
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.
Yea, but the video tutorials are good
Thanks, will do.
<@&671452400221159444>
It’s crazy how many spam/bad messages there are, feels pretty frequent I see a deleted message like this
thanks for your service 🫡
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
Also as it’s cooling etc I guess
Or (a probably les performant option) is there an OnTick or something similar for an inventoryitem
Not to my knowledge
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
Me blind? Me not see the difference.
good news, I'm not blind ! (I have other problems though)
So what's your thought ? 😅
put both views. they both have uses depending on user need.
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.
Yea it's a problem with wiki tables
There's sadly not any solutions regarding that, besides modifying your wiki page view settings
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
Yea it's definitely a problem
that synthetic view is still awesome. so keep both views
Thinking about it more, do users even need to see which params are in common between classes ?
It can be VERY usefull to save time at code analysis time to know what Item type to go check when working on one specific param
I guess
to be honest, i find the new version really hard to use
Yea that's why I wanted feedback, bcs I knew it was 100% pratical
I think I'll keep both version like Tcherno suggested
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
i want to make a skills/profession mod for a personal server of mine, how would i go abouts doing that? any tips?
Back at it again 
I’ve not done professions myself, but when I did traits the best resource I found was download a mod that adds an occupation (a trait mod in my case) and look through the code to see how it does it
ohh i didnt think about that, thank you
no worries, good luck
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"
Found a simpler way, I can just use the age of the "sealed" container item and add this instead
Are there any mod that let you type and run lua script?
Can you do that with Cheat Engine rebirth Lua interpreter?
Directly in-game ?
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
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
What function ?
the entire file btw
<@&671452400221159444>
Heya folks. I took a summer break from Zomboid and Modding. Happy to be back 🙂
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 😆
yeah, they generate their scripts now so organisation isn't a concern anymore, pretty annoying for us 😅
Didn't realize that
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.
add a common folder too
it doesn't have to have anything in it but it does have to exist
Yeah, I've got one of those too. Sorry, forgot to mention it.
oh, it shouldn't be in the main pz directory, those mod folders are fake
it should be in %UserProfile%/Zomboid/
Hey, does anyone know if I can check how fast a player is driving using getSpeed()
getSpeed ?
Yes, getSpeed() from VehicleHitField
Did you test it ?
Is there a way to change an item's display name ?
setDisplayName("Name")
doesn't work
setName("Name")
works
Anyone knows how to actually register this / command?
I don't get why it is unknown command when I type this in chat console
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.)
have you tried doing the recipe with the actual ingredients in your inventory and not the debug function ?
I made sure to spawn them into my inventory before attempting the recipe.
You have dots
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
TIL: With two small helper functions we can trigger Zone Stories from lua. https://pzwiki.net/wiki/Randomized_stories
Road Stories would probably function similar, while survivor stories seem too building-specific.
Neither do I, but it seems to work now. Though I wish it wouldn't create full gas cans, as that's a little bit OP.
You can modify that
I assume using Lua? Because I've tried the [IsEmpty] and [ForceEmpty] flags, but neither worked.
OnCreate, Lua yes
Aren't there outputs flags tho ?
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.
I tried the obvious ones but they didn't work.
outputs
{
item 1 PetrolCan flags[ForceEmpty],
}```
Pretty sure your gonna have to use onCreate script to empty it, or create a new item.
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
See the later comments in https://theindiestone.com/forums/index.php?/topic/86011-allow-lua-to-edit-recipes-in-b42/#comment-441055
So I have been trying and trying, and can't find much to edit recipes (aside from adding/removing possible ingredients to an existing ingredient slot) There is no 'setAmount' on the InputScript or OutputScript and I can't seem to add/remove InputScript's or OutputScript's It would also be nice if...
b41 pre-fluid container items
ah.
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.
Have you tested with the 0.6 version your scripts ? I don't remember
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 😅
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.
Figured as much. I guess I'd better start reading up on how to do that. 😅
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
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```
function Recipe.OnCreate.CreateJarredFood2 calling a none function ie remove the 2 i thing is the only thing i can see but i am still learning so please correct me if wrong
The function itself runs, and other property setters on the items work, just the weight functions don’t seem to work
i am in a VC if you have time
Sadly not but thanks for the offer
For PZ World Ed where does the config / settings file save on Windows?
Also can i compile a map via batch?
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
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
<@&671452400221159444>
How are you setting the weight of the new item? trying to figure out what I’m doing wrong with my mod
Currently nothing, weight of the weapons are gonna be 0 with it being entirely determined by the attachments
Ah fair, not as relevant for the jar of soup in my mod haha, thanks tho
@vast pier So, looking into it.. I see things like: setActualWeight
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
it should be abstracted more than this, but if an item's display name equals its full type, it is a hidden item and not meant to be shown anywhere or weigh anything (so that it should not be noticeable that the item exists at all)
Ahhh.
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
Oh i wasn’t needing anything, was just answering their question lel
The attempt to help is acknowledged and appreciated though
Oh, I thought you where also wondering about setting weapon weight (at some point in the future) so I thought id mention you into the convo as well.
Shouldn’t need to since the weapon attachments get transferred to the melee version and vice versa
only works in multiplayer
(apparenty hugolibby is the random name of the character im playing as)
Ad
Ah okay, I hadn’t added names or translations yet, so the item name is the full type still, so I guess when I’m setting custom weight and it’s setting it to zero it’s because of this, it’s late for me but will give it a try in the morning thanks
Thanks all
lol fun.
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
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
TIL about zombie scars.
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
Yes, but it will get resized possibly
ah
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,
}
}
what do you see ingame?
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
Wouldn't that be Tooltip_Tooltip_GSplanting ?
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.",
...
}
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
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
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
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
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
is anyone familiar with fluid container names, specifically a way to not add "Empty" or "Water" before the container name
actually I can't see a way to trigger a function when something has burned, can't see an OnBurned like OnCooked or anything like that unfortunately
I could do it onCooked but that seems mean haha
Any ideas why blood level value number is not getting over 4, no matter how much zeds I hit?
hey, any idea how I should do this, I have a sandbox var (will be a multiplier to the default values)
What's the best way to apply it to my jar items, without doing individually item per item on creation
can I update the type from the var in someway?
You'd do some work in the recipes oncreate, I think
set daystorotten (or whatever it is) to be item:getScript():getDaysToRotten()*sandboxvar
ah okay, so I do have to do it per item instance, cheers
Yea, theres no magic to link new sandbox vars to anything
thanks for your help, mods almost done, just gotta figure out the best way to trigger an explosion now (might not include this feature tho tbh)
Id look into whatever pipebombs do, since thats a nice fire-free explosion
(Since B42.12)
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?
I know. This is why I am asking here.
I am new to modding this game but not to programming.
I get co-pilots concern that if the function gets called again it could, technically(?), run the init twice. But I don't know if that is even possible with how the game engine works.
Have left out the explosion for now but my mod is published!
https://steamcommunity.com/sharedfiles/filedetails/?id=3582404497
And I released a fix for ExtraMapSymbols so that it works with ShareYourMapSymbols 
https://steamcommunity.com/sharedfiles/filedetails/?id=3582404075
What does your extra UI function do ?
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
Good point! It was already calling it in the original mod. It was only the non UI that needed update
When you stare at a problem for too long 
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.
👋
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
out of curiousity, does anyone know where i'd find the gif for the loading icon of the zombie walking?
Yea, you'd have to update the image texture
Check mods that replace it
It might give you some insight
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.
they seem to use junit internally but it's not packaged with the game
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.
i was asking for the sake of circumventing that process but i shall do it
i just wanted to add the zero hour loading screen gif
https://www.youtube.com/watch?v=y9MuaNeBGZU
Started up Zero Hour for the first time and was met with what I think is the coolest and most original loading screen I have ever seen
i wonder if i'd be able to get the full size but i'll just try to swap the gif first
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
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
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
I see, I just don't want someone to pull a virus from it, I appreciate your help, thanks
Nice!!
ok how is a gif a png?
the loading icon isn't a gif, it's an animated png
great, how do i make one of those?
should i just use a website like https://ezgif.com/apng-maker
Probably yea
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!!
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
fixed the file sizes
although the weird looping issue eludes me
and it looksbetter at a lower resolution
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
<@&671452400221159444>
danke
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 😭
inputs need [] around them, like item 1 [Base.EmptySandbag], IIRC.
o ty ur prob right, testing RN
only the inputs need it according to wiki ig
Yea.
in their infinite wisdom they made input and output syntax differ
i mean superficially it makes sense ig since u can't add flags to outputs?? but idk lol
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
Yea
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
try referencing it as GrapesGravel.SmashGravel in your craftRecipe
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
fair ig since it should be referenced as Base.x but wtvr erm hopefully the game will get there, ty for help
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
Mine are in my 42 folder
i prefer to keep them in common
Check the craftRecipe wiki page
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. 
ah ok ty
yeah ur right, the syntax is right there, i just stopped actually thinking critically after running into too many problems 💔
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
This is a tool for adding tattoos to Ellie tattoo parlor created by me which will make adding tattoos even faster
thats so cool very user friendly
Doing work in my Powell again (looks better now, older screen shot)
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.
thats so cool
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.
Now thats what I call a weapon!
does it degrade your gun or the chopper to cut down a tree?
Chopper
Gun durability and attachment durability are tracked separately
same with sharpness
❤️ 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)
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)```
this is just to make sure the sharpness value is at least vaguely accurate when leaving and rejoining
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)```
Interesting! nice work and spirit Zumi. 🫶
Question: Do I assume correctly that the extra map symbols can be accessed from lua in the ISWorldMap context same as the vanilla ones? self.symbolsUI.symbolsAPI:addTexture(symbolname ..) is what I use to place vanilla map symbols.
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()```
Thank you 
I have no idea. I just figured out that the mod was breaking other mods and fixed that.
You'll have to try I guess
so this is what it looks like when you dont resize your images lol
HUNT SHOWDOWN WEAPON UPGRADES!!!
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
There’s a lot of info on the wiki pages (in pinned messages)
And I mostly learned by looking at how other mods did it and asking for help in this chat
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
idk anything about that game
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
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?
Check pinned messages
np
The best guide is to look at mods similar to what you plan to make
i think that will be my next move
You'll find Lua to be .. quite different to those typed languages :D. Try to find your enjoyment. And remember arrays start at 1.
the powell has been fixed :D
More Powell work
Did the modeling and part of the texturing for the utility wagon
Have you considered adding a pinch of noise or grime to your textures?
That is actually something i considered early on, but then i realized i didn’t like it much
This looks the exact same to me lol
yea, its hard to tell, but there is a slight difference. IMO the noise/grime should be hard to actually notice at first.
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
Yea that is why I was thinking just a pinch of subtle noise might help
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.
this information is very valuable :D ty
if i get any problems i'll be here
Colors look sligly less vibrant but even for me who is pretty got at seeing small difference in color the change is relly small.
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”
the "triforce" thing indicates top, left-low, right-low ? I haven't used the mod so I assume directions are by mouse coursor?
is there a reason you're not using the vanilla radial menus?
more or less, the triforce is a framework in the ui for owning multiple tamed wolves. I can add a flag to each wolf like “Tamed1”, “Tamed2”, etc
at the moment, the player can already tame several wolves, but there is some jank lol 😂
with this approach tbh, it was easier for me to hook in the custom commands system
plus the ui is fully customizable when we have more assets 😄
Hehe ok. So as I am not a user I am not very qualified to give feedback. I just wonder:
- How would that be for a number not 3
- How does the user select. hotkeys or mouse or cursor?
for example, wolves can help the player carry items. currently if say you tamed 2 wolves — they both would share the same inv
The radial menu can do exactly that tho
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
neato!!
Can even have the wolf render inside the radial options to show clearly which wolf you're selecting
this new menu will definitely have a submenu
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
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
I may consider it, but because of how messy my UV’s are and stuff idk if it would look all that good
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
on item creation I checked this value and its nil, but just added a setOnEat to the OnCreate function and now it works fine
does anyone know if its possible to disable a craft recipe via sandbox option?
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
The first folder, then in the main folders for the main mod and submod
Also in my 42/ folder
Why the. Britas armor abd guna dont load on thr game?
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
in your script did that line end with a comma?
i did not
lines have to end with a comma to be parsed
knew it would be something stupid i was missing, thanks
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
Sadly, no -_-;
https://theindiestone.com/forums/index.php?/topic/86011-allow-lua-to-edit-recipes-in-b42/#comment-441055 Heres what we know so far about editing B42 recipes via LUA
So I have been trying and trying, and can't find much to edit recipes (aside from adding/removing possible ingredients to an existing ingredient slot) There is no 'setAmount' on the InputScript or OutputScript and I can't seem to add/remove InputScript's or OutputScript's It would also be nice if...
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
yea, at best you can set the 'learned' state via LUA
Iirc there you can do ontest or oncanperform to make them not available. You can also set needlearned and possible hide them in the recipe script but that was b41.
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.
Look at the scripts for other trait mods
i tried that but i dont exactly know how to
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
thank you so much!
Np!!!
<@&671452400221159444>
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.
The code is there for it in ISShovelGround.shovelGround. maybe the mod data isn't getting set correctly
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.
Please go make a bug report on the forum, because yea, its just dumb and wrong that last I checked, you can't even turn a farmer field of grass into one of dirt tiles for farming on with a shovel, without tons of weird bugs making you unable to plant/move dirt/etc
I literally have to use debug mode to do it
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.
Yea, hence, bug -_-;
Bugs go here. Please save us the time to translate all the posts in different languages and post them in English instead.
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
also gimme the name of that mod if you know it, lol
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)
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
thats fine
just so long as I don't need to load up into debug mode just to plant another damn row.
very early wip — radial menu overhaul 🐺
i’m considering changing the text color from white to black. Thoughts?
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
Check the timed action of making an evolved recipe
I’ll take a look thanks
don't know if i'm just being stupid, but where would I find that
You're going to have to search for it in the Lua
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
thought this would be the case but was struggling to find anything that seemed related to evolved recipes
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.
When putting your cursor on the mod, does it give you any info ?
When I click the mod, its image, description, location, and other details are displayed.
Simply hovering my cursor over it doesn’t show anything.
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...
You likely need to change the Y position and the position in the table, for scrolling to work correctly?
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...
You can also try just hooking/replacing the code that creates the button table in the first place
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...
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
not done any traits since b41
but this was how I did it then
so yeah that looks like the place to me
local function AddTraits()
local Bearclaws = TraitFactory.addTrait("Bearclaws", getText("UI_trait_bearclaws"), 2, getText("UI_trait_bearclawsdesc"), false, false);
Bearclaws:addXPBoost(Perks.Nimble, 1)
end
Events.OnGameBoot.Add(AddTraits);```
thank you, i havent really made a mod ever and id like to make a trait mod first. do you have any tips?
I only ever added a trait once and it was very a simple trair so nothing specific to that, for general modding there is great info on the wiki, and take a look at existing mods (like you are already doing)
thank you, will do
Yeah Y position is just visually and table the scrolling but sorting the table kinda broke it in terms that every button worked, except when I click the garbage bag it actually clicked the floor which is kinda confusing... and then every button after that kinda opened the inventory before
Yea, don't use sort then, consider just manually sorting and swapping elements
Floor also might have some kinda special index? dunno
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
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
try hardcoding it to
item:DoParam("EvolvedRecipe = "..name..":10");
Id also throw a print in your innermost loop just to make sure its executing
(or I guess debuglog statement)
yeah did prints all the way down and it is executing
no luck, but might just completely rework how i'm doing this tbh to not use an evolved recipe
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. ?
no its in my module
can someone explain what the orange circle mod icon means compared to the blank mod icon? (b42)
Ahhh, then add the module prefix 🙂
(these, for context)
item:DoParam("EvolvedRecipe = HiemCanning."..name..":"..(0 - item:getHungerChange())); or something :0
still no luck, but think I might go another approach tbh
that sucks, though I dunno if thats your module name exactly. shrugs
module is HiemCanning haha, you were right
so i tried following a github page and this is what i have. all im trying to do is get the trait in the game, not for it to do anything yet. i dont rlly know lua or any coding, i took one python class 2 years ago but thats it. would you mind helping?
i'm not 100% sure
maybe try this?
local function initSuperTraits()
local MyTrait = TraitFactory.addTrait(
"MyTrait",
getText("UI_trait_SuperTrait"),
-8,
getText("UI_trait_SuperTraitdesc"),
false,
false
);
end
Events.OnGameBoot.Add(initSuperTraits);```
nope didnt work, thanks for trying tho
ah sorry, not super familiar with the traits stuff
thats okay, i appreciate the help
figured it out:
orange circle shows up if the icon is named "icon.png" (no idea why)
blank shows up if no icon is found
this may potentially be a linux-exclusive issue but i'm not sure
tmk naming the icon icon.png shouldn't be a problem
Oh my god, thank you so much, you are the best😍
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?
hooks aren't standard practice unfortunately due to their extremely limited scope (there's like 5) and being really hard to work with
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; }
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
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 ^^
<@&671452400221159444>
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?
Only if my hook returns true, i just want to redefine ddamage for a particular case
no, that's not what hooks do
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
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 ?
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
that's why it may be lighter to just use hook : XD
that's why there aren't really any mods that do stuff like that
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
i think i figured it out...
i figured out half of it
Does the craftUI use OnTest in craft recipe to determine if a craft is possible (enable the craft button?)
Yes
Nop 🥲
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
Don't hesitate to tell me what you thought about it
Does anyone have any idea why my icon and world model for an item is not working
It could be a problem in the scripts
I can share pictures of them but it all looks fine to me
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.
Yeah, just with the question you asked, I don’t think anyone will be able to help you.
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
Maybe with the OnGameStart event
When they finally work, it’s even better
It’s always good when it works, I think I just misplaced a file but I cannot find it
I've redone my script a couple times and now its completely broken my crafting menu.
Yes b41.
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
Oh, I don’t know, what I was talking about was for build 42.
I can spawn them in so I figured making a crafting recipe would be a simple fix using jewelry.
Maybe it’s missing the final comma after maxTime
so maxTime = 60,
}
maybe yes
Could the text program I'm using be the issue? Should I try making it on somethign else like Notepad++?
use Vscode not np++
result shouldnt have quotes
where did you get this? ingredients??
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
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.
I moved it into Vscode and this is what it looks like now.
My brain is a little fried. Ive been trying to work on this for like 8 hours now. What would that look like?
this looks right now
/* 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.
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.
I have made progress.
I think I need to fix the item Id's
base.GoldBangle etc
thats what i stole the overlay concept from. and yeah ive learned i can do that since then. when im not swamped with work i need to go back and make a few mods work better
if the recipe is in the base module then it shouldn't need the module reference
The items I'm using for it are base, but the Gold Coin is from a mod.
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
you need the id
you're using the display name
so goldbangle would be Bracelet_BangleRightGold
and Bracelet_BangleLeftGold
it is still not working ughhhh
both scripta
I win! Thank you for all of your help.
PEAK!!
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
do you wanna throw it, place it, what?
I want to spawn the entity of a bomb by code
Basically the entity of a bomb after you throw it
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)
I don't know where it is located, that is the problem
Ok so heres how you find it
get programmers notepad, or some IDE,or anything else with find in files
Not necessarily, i am trying to create an explosive zombie by spawning an aerosol bomb on it's feet
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
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.
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.
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:
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.
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
There is a vanilla debug function for car spawning.
play in debug ang right click anywhere on road it will be available
i wanna make mod for this. playin with debug is unfair
