#mod_development

1 messages · Page 298 of 1

silent zealot
#

Decide to compare zoom vs. no zoom because a few people have said B42 looks better with zoom disabled. A quick MyZoomEnabled=not(MyZoomEnabled);getDebugOptions():setBoolean("Visibility.UseNew", MyZoomEnabled);getCore():setOptionZoom(MyZoomEnabled);getCore():zoomOptionChanged(true) later... the difference is much bigger than I expected.

#

I don't think non-zoom rendering that can still zoom is moddable though, even if I was willing to do a java mod - looks like non-zoom completely changes the way things are buffered and I can't find a simple "render with these settings if zoom is disabled"

silent zealot
#

Is there a way to access fields of a java object? The specific thing I want is: https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/core/Core.html#SafeMode
which is in the Javadocs as static boolean SafeMode and in the java as public static boolean SafeMode, but getCore().SafeMode is nil. I can use the various static methods of GetCore() just fine, like getCore():gotNewBelt() but can't figure out how to access the fields.

#

I know the value inside the java object is not nil, because when java accesses it from within Core to print a debug message it works fine.

slim swan
#

anyone knows about the soundmap?

#

SoundMap = SpearStab SpearHuntingKnifeStab,

#

i can't found any file about it

silent zealot
#

How do I make use of that? local SafeMode = <getCore()>.<SafeMode>?

#

Or is it that if I have Starlit running getCore().SafeMode will work?

silent zealot
winter bolt
#

player:isStomping() and player:isShoving()

#

if you make it a clothing item without a display name you can equip and unequip it in lua without the player being able to touch it

#

its how makeup works

umbral raptor
#

i cant seem to find the ground model for a beanie

#

can someone tell me where to find it?

#

also in vanilla files, the world static models for beanies are not defined and there is nothing in models files

true plinth
#

it's not deliberate 😄

vast pier
#

If I wanted to increase the max capacity of a tile, such as a campfire.
How would I do that? Can I do that?

#

My fluid containers mod increases the capacity and thus the weight of things like the cooking pot, causing it to be too large to put in wood stoves and camp fires to boil tainted water

silent zealot
vast pier
#

storage capacity. Can't put large objects in campfires, barrel stoves, or antique stoves

#

Cooking pot full of water in my one to one mod weighs 22.5

bright fog
#

Helps read a bit

silent zealot
#

but I don't know where defaults are set for container type campfire.

vast pier
#

I think you need to use the modding tool to edit tiles, but idk how to do that

silent zealot
#

Look what I found:

#

\media\lua\server\Camping\SCampfireGlobalObject.lua

#

Looks like it checks for :getIsoObject():getSprite():getProperties():Val("ContainerCapacity") and if it doesn't get that, defaults to 10.

umbral raptor
#

haha the cooking pot has a capacity of 10 L and each L of water weighs abouts 1KG

silent zealot
#

That's half a normal sized fish. 😂

vast pier
#

Well it actually weighs the pot weight + water weight so it would actually be over 22.5 I'm pretty sure

#

If I wanted to, we could make it even worse by trying to guess what the actual weight of the pot while empty is irl

vast pier
#

which is roughly 22.5 liters

#

math could be wrong, idk

umbral raptor
#

oh are u making a new cooking pot?

#

or is it the one used ig?

vast pier
#
This was done by using a water bottle as a baseline at 1 liter.
Assuming the water bottle is actually a standard 500ml water bottle and your character isn't just chugging liters of water in an hour, I based item fluid values off double their irl values.

Due to the nature of this change, many fluid containers will hold much more than their vanilla counterparts.
An extreme example is the cooking pot, holding a whopping 22.5 liters irl and 45 fluid units in game.
This is somewhat balanced due to how fluid weight works, but definitely makes stocking up on water way easier!

Changed it so the fluid values are edited using Lua instead of replacing the items, meaning this should be compatible with other mods that affect the items!

This workshop post includes two separate mods.
The original fluid changes where I value things off 2 times their irl value for game balance. -GB
And a new version where i value things directly off their irl value, regardless of game balance. -OTO
#

It's a mod I uploaded awhile ago

vast pier
#

Or would I need to replace the object lua

silent zealot
#

Probably no to DoParam() - that is a method for items

#

I think world items don't inherit from items at all.

#

Add a postfix patch to SCampfireGlobalObject:addContainer()

#

so it runs the original code, then your code says "now set the capacity to 50"

#

Trickiest part is dealing with all the "self" $#@^ lua does to pretend it's object oriented.

#

Behold the forbidden knowledge that those in power would keep from you!

#

Or just copy the entire function, put it in your mod to overwrite the original, change the 10 to a 50 and accept if they ever update the way campfire containers get made you'll have to update the mod.

#

...which feels pretty low-risk to be honest.

coarse sinew
vast pier
coarse sinew
#

You can also find the campfire sprites in brush tools. In Debug Menu > Cheats > Brush Tool, then right click on the ground > Brush Tool Manager > Choose tile and in the search entry box search for camping. From that panel choose the campfire sprite and place it on the ground.

#

the code I linked, would look something like this for your case:

Events.OnLoadedTileDefinitions.Add(function(manager)
    local sprites = {
        "camping_01_4", "camping_01_5", "camping_01_6"
    }

    for _, sprite in ipairs(sprites) do
        local props = manager:getSprite(sprite):getProperties();
        props:Set("ContainerCapacity", "100", false);
        props:CreateKeySet();
    end
end)
whole swan
#

How do you resolve background/text disappearing when using the prerender() method?

coarse sinew
whole swan
#

thanks 🙂

bitter scroll
#

Question about these lua events https://pzwiki.net/wiki/Lua_event. It looks like most of these get handled client side..? Or should I be able to handle these from a server side script (media/lua/server) too?

silent zealot
#

the client/shared/server is more for organization than functionaliy

#

#mod_development message
[1:24 PM]DrStalker: Does using the client/server/shared folders actually change anything, or is it a best-practice to keep code organized?
[1:24 PM]albion: mostly the latter, but it does have a couple effects
[1:24 PM]DrStalker: hahahahah of course there are some special cases
[1:25 PM]albion: the client folder doesn't load on the server (but the server folder does load on the client) and they load in separate stages
[1:25 PM]albion: all shared files -> all client files -> all server files
[1:25 PM]DrStalker: translation might be special too?
[1:25 PM]albion: translation is just a hardcoded location, it has to be in shared, it's not even lua
[1:25 PM]DrStalker: Since you use the same filenames there, but it doesn't overwrite existing translation files.
[1:25 PM]albion: it shouldn't even be in there but i'm guessing from the syntax it used to be lua or something and that was the simplest way to convert it over to their new system
[1:26 PM]DrStalker: nods just a bit more technical debt.
[1:26 PM]albion: also, server files don't load on the main menu, they only load when you join a server or start a singleplayer game (the only interesting consequence of this that i've found is OnGameBoot happens before server files load most of the time)

#

So if you attach code to an event, it will run on either teh server or client depending on what the event is.

plush wraith
#

Am I able to play part of an animation? I have a TimedAction and have a animation declared and played within it but can I play the last half of it?

bright fog
#

It's the full animation, you can't chose a specific point in the animation

plush wraith
#

Dang, can't avoid doing some animating at some point then 😂

bright fog
#

Some are only client

bright fog
silent zealot
#

Has there been a fix for the issue with animsets that people were struggling with?

bronze yoke
#

no

lethal dawn
#

There's a tag for being able to use a crafting recipe in darkness right? feeling lazy so I'm hoping I can avoid having to search for it myself

#

alright never mind it took like 2 seconds to find

sturdy salmon
#

Good afternoon. I'm trying to make a mod, that by typing "/westpoint" in the chat, the character can be teleported to that city. But when I try to use the command, it doesn't recognize it. Is there a guide or mod that performs a similar action?

#
local teleportLocations = {
    westpoint = {x = 11700, y = 7000, z = 0},
    muldraugh = {x = 10600, y = 10400, z = 0},
    riverside = {x = 6200, y = 5300, z = 0},
    rosewood = {x = 8100, y = 11700, z = 0}
}

local function teleportPlayer(player, location)
    if not teleportLocations[location] then
        return
    end

    local coords = teleportLocations[location]
    player:setX(coords.x)
    player:setY(coords.y)
    player:setZ(coords.z)
end

Events.OnClientCommand.Add(function(module, command, player, args)
    if module == "patagoniateleport" then
        if command == "teleport" then
            local location = args[1]
            teleportPlayer(player, location)
        end
    end
end)
#

That is more or less the code I am using, but as I mentioned, it does not work for me, since it does not recognize the command.

vague marsh
#

the workshop is gone dang..

gilded hawk
#

We finally solved the issue of people not reading mod descriptions! No more mods!

vast pier
#

no collections either

gilded hawk
#

Peace happened, no more "when are you going to update your mod to b42" comments lol

lethal dawn
#

that said, hopefully it's not going to stop me from updating it

#

I assume it won't

vast pier
#

they just, don't show on the main workshop page

lethal dawn
#

that's good

#

genuinely in that minute I thought about it and started thinking "shit it might"

vague marsh
vast pier
#

you can also just click the content button up here

vague marsh
#

its back tho

#

😆

fathom dust
# winter bolt player:isStomping() and player:isShoving()

Those seem promising, but the player var appears to be null during OnPlayerAttackFinished. Is there another way to hook in to add an effect to a stomp (but not a shove)? I guess I could check isStomping every tick but that seems like a waste

winter bolt
#

it triggers on shoving and stomping

#

i think thats the event name but its from memory so it might be wrong

fathom dust
#

does that only trigger when hitting an enemy? i'd like to catch "empty" stomps too (i.e. no enemy hit or targeted)

winter bolt
#

you could try this one maybe?

#

ive not used it so im not sure

fathom dust
#

worth a try

#

nope, attacker is null in that callback as well

winter bolt
#

you might just have to check it in OnPlayerUpdate then

#

i think just doing a small check like that is fine

fathom dust
#

ok, i'll give that a go. thanks for the help!

#

ok i must be doing something wrong...player is null in OnPlayerUpdate as well

winter bolt
#

wtf lol

fathom dust
#
    print("isStomping "..player:isStomping())
end

Events.OnPlayerUpdate.Add(OnPlayerUpdate)```
#

that's it...but i get an exception right away and player is null in the debugger

winter bolt
#

what does the error say?

fathom dust
#

it was empty before let me check

#

oh it's subtly different than before

#

concat error this time

#

i yearn for automatic coersion from bool to string

#

i think i was misunderstanding the debugger before. going to re-try those other hooks.

silent zealot
#

print("isStomping " .. (player:isStomping() and "true" or "false")) is ugly.

#

especially since print(player:isStomping()) works.

fathom dust
#

such is the price we pay as modders

frank elbow
#

Could always throw it in tostring or string.format (although in this case since it's running on player update the and/or is ideal... although this is clearly a debug statement so that doesn't matter all that much anyhow)

silent zealot
#

I'll put in a feature request to move everything to C#. 😂

fathom dust
#

i do love me some c#

gilded hawk
#

I'd be happy with Typescript for mods ngl (without having to go through asledgehammer/PipeWrench)

silent zealot
#

Learning C# reflection was painful, but then it clicks and it's suddenly easy to manipulate all the private and obfuscated things.

gilded hawk
silent zealot
#

"Must be with the documentation on the Generator function"

winter bolt
silent zealot
#

But I first did this as "why doens't lua have a ternary operator when it has so many other janky hacks" and it just kinda stuck for me

silent zealot
winter bolt
#

zomboidcoins

gilded hawk
silent zealot
#

Who else remembers "$2.50 for cosmetic horse armor is going to turn into a slippery slope of holding back content to sell it for extra money"?

#

Because we were right.

#

(Not for Zomboid, but for AAA games)

gilded hawk
#

🫴 💸

fathom dust
#

unfortunately OnWeaponSwing doesn't fire for shoves and stomps, and both isStomp and isShove return false during OnPlayerAttackFinished

silent zealot
#

I'll take TIS being slow over them rushing stuff so they can sell the next DLC

jovial valley
#

if i set ConditionMax = 0 will something auto break when created? and if i set a lua OnBreak command to put something on the floor when it breaks should i put the spawned in item in HeadHandler or HandleHandler i think i know this one but i just want to make sure

#

I know its an odd question...

winter bolt
#

idk the bedrock marketplace and bethesda paid mods are kind of cringe but at least modders are getting paid for it i guess

fathom dust
#

where should i be looking to get all zombies within a certain distance of the player? it's a relatively short distance if it matters, a few squares or so

sinful parrot
#

Maybe a silly question, but we have a custom mod on our server that does a lot of utility functions. One feature we'd like for it to accomplish is overriding loot distribution for some of the other mods we load in. For example, Brita's armor. From my understanding, we just need to duplicate the same files, in the same path in our mod, with the distributions set to zero. We've done this, but the items still spawn. Is this possible? (Our mod is loaded after Britas)

jovial valley
#

Because ConditionMax = 0 dont worky

jovial valley
#

leme see

fathom dust
#

i feel like there's also an item def property for an OnCreated hook

undone elbow
undone elbow
sinful parrot
#

I was under the impression that it overwrote the original file when it is loaded in.

undone elbow
#

You still just add new distributions.

#

Unless the file author adds compatibility with its own copies or duplicates within the file itself.

#

The better way is to work with tables I guess.

bronze yoke
#

if your mod has a file with exactly the same path and comes later in the load order, it will run instead of the original

#

it wouldn't be necessary to change the numbers to zero in that case, you could just make the file blank entirely

sinful parrot
onyx valve
#

Hi, I am trying to make a damage multiplier for certain melee weapons and testing, only knife and spear work but not for one and two handed weapons such as fire axe or hand axe, etc.

onehanded and twohanded are correct?

undone elbow
#

Let's assume, purely hypothetically, that you have different values ​​in the table.

    modData["WeaponDamageMultipliers"] = {
        knife = 6,       --knife
        onehanded = 7,   -- One HandWeapon?
        twohanded = 8,   -- Two HandWeapon?
        spear = 9       -- Spears
    }

And let's say there are two spears in the game. One is two-handed and the other is one-handed. What multiplier should be used?

#

Also there may be two-handed knife. Why not?

#

And even there are only one-handed knifes, you still have 2 values: 6 and 7. Which one should be chosen?

bronze yoke
#

i'd infer from this that the knife/spear entries are meant to override the other ones

#

otherwise it doesn't make sense for them to exist, since every knife/spear is either one or two handed

onyx valve
#

So I'm using only 2 values ​​in the table, because knife and spear are one and two handed?

undone elbow
#

spear/knife/other and onehanded/twohanded are two different pieces of info about a weapon.

onyx valve
#

Hmmm ok ok i think i understand.

silent sky
#

You guys think there is a way to make like a baby zombie

#

??

jovial valley
#

is there a way to have a item's condition degrade by just existing?

undone elbow
#

Yes, in inventory

#

I'd use a workaround by adding modData field like "last_updated". So if an item is just looted and there is such a field, you can just update it like
(delta_degrade * years_passed) 🙂

jovial valley
# undone elbow Yes, in inventory

I appreciate the consideration on if I wanted the item to be generated naturally in a way that makes it world sit around for a bit before a player picks it up, however, the items I'm making are debug items that'll use the build 42 feature of items breaking into other items to make it when an item would normally be inserted directly into your inventory, it gets put on the ground instead. If you would like an explanation of what I'm trying to do with this item then I can tell you

undone elbow
#

I guess "degrade" (a kind of logic/mechanics) and "at a certain point in time to put it on the ground" (a kind of logic/mechanics too) are different. So they should be considered separately, even though they may be related.

jovial valley
#

basically upon generating ither through foraging or crafting, it immediately 'breaks' into what the player found/made, just not into their inv, as someone should not be able to hold/move a entire mineshaft or the undergreound recourses befoer they'er mined

#

i know that code is crazy but the alternatives are beyond my skill, or also crazy

#

i say immediately 'breaks' because its durability is 1

native swift
#

Had a question about what is required to be weighted. I did a beanie mod where the model didn’t have to be weighted to the body or anything, but my buddy did a vest and a bag mod where both required weights. What clothing items are required to be weighted?

winter bolt
#

the straps of bags need to be weighted otherwise they'd just clip through the shoulders when they move

#

anything thats just on one bodypart can be static like hats

native swift
#

What about shoes

#

The shoes mod I did just reskinned the feet in the character model lol so I didn’t need it but wasn’t sure if real shoes would need it

winter bolt
#

modelled shoes would have to be weighted because they need to be on both feet but static clothes can only be parented to one bone

jovial valley
#

quick question, that lua file can i see ConditionLowerChanceOneIn or whatever is responsible for Condition degradation in

#

I've been searching for longer than I've asked the question, and still haven't found it. So if any of you know @ me.

onyx valve
silent zealot
#

Actually that won't do the immediate break you're after

silent zealot
jovial valley
#

If I use it onitemfound I think I can remove one durability with that but I need to know how to use that Lua functionality to remove one durability. I can't find the code on removing durability anywhere in the files. Thus, I can't figure out what it looks like and how to use it

silent zealot
undone elbow
#

Sorry, I mixed topics. I was talking about "degrade" mechanics of an item somewhere in the world.

jovial valley
#

Well for the foraging items, I think that might work, and if there is some sort of onitemcreate then I might use that instead.

silent zealot
#

There is, per object

#
{
    item NepDIYBSToolsSchematicBook
    {
        DisplayName = DIY Blacksmithing Notes,
        DisplayCategory = SkillBook,
        Weight    =    0.1,
        Type    =    Literature,
        Icon    =    Book8,
        OnCreate = NepDIYSpecialLootSpawns.NepDIYOnOnCreateBSToolsSchematic,
        NumberOfPages = 220,
        StaticModel = BookBrown,
        WorldStaticModel = BookBrown_Ground,        
        Tags = DIYSchematic,
    }```
#

that will call NepDIYSpecialLootSpawns.NepDIYOnOnCreateBSToolsSchematic(item) when the item is created.

#

So your onCreate function could look like

  item:destroy()
  x,y,z=player location
  spawnOnGround ("Other Item",x,y,z)
end```
#

(but with the actual function names)

#

To be multiplayer safe you'd have to figure out which player is holding the item, I think item:getContainer():getParent():getUsingPlayer will get that for you but getPlayer() will do for testing.

vast pier
native swift
#

I’m doing a toy mod and am referencing structures from a toy plushie mod and a toy dinosaur mod. I noticed both of them have a line in each item that says “scale = 0.3” or whatever number. I made my models to be the correct size already and they don’t need to be scaled. Do I need to write “scale=1” or just omit the scale line altogether?

vast pier
#

scale line isn't needed, it just lets you rescale the model without editing the model directly

native swift
#

Gotcha I didn’t realize that lol I’ve been resizing them all in blender manually 😂😂

vast pier
#

Hey for your use specifically, you could make small and large versions of the toys this way!

#

:P

native swift
#

I recently became a dad and am basically making baby stuff in game and just calling them “toys”. More so just to decorate. Made a crib and a baby and some baby Nike shoes and stuff just to decorate. They’re not functional or anything but they’ll look cool 😂

#

Probably will just spawn them in or make a really easy recipe for them

bitter scroll
#

Can you make a zombie baby?

vast pier
#

I mean you can add skins to zombies n' stuff but idk how doable a child zombie would be due to hitboxes n' animations

silent zealot
#

Don't add actual babies to the game, but add the various items that exist around babies.

native swift
#

No babies?

#

Also my buddy is actually working on a zombie baby 😂😂

silent zealot
#

...because zombie babies are terrifying, but a baby's bottle full of whiskey is just right for exploring the apocalypse.

#

...

native swift
silent zealot
#

I am glad it will be a mod and not part of the base game!

#

A prop baby? that's fine, it's zombie babies I don't want to deal with.

native swift
#

Oh gotcha yeah it’s just a prop so it doesn’t look empty

silent zealot
#

(Also, my personl preferences shouldn't stop you from making a mod.)

native swift
#

I was just making sure it wasn’t like an unwritten rule or something 😂

#

I think the baby zombie my friend is doing is also just a prop tbh. We, or at least I, am nowhere near good enough at this stuff to skin a zombie

silent zealot
#

I think the unwritten rules are "mods involving sex go to Lover's Lab and not Steam, mods involving sex and children are 100% not acceptable in any way"

#

...I'm probably going to regret this, but I've not looked into the state of lewd Zomboid modding for years.

native swift
#

The fact that that’s a thing 😂

#

I’m rlly just decorating at this point 😂 I got the collectible car mod and went to a toy store and got like 100 cars and they’re just laid out on my floor 😂

silent zealot
#

" ZomboWin Being Female (ZWBF) is a mod that connects some other mods to ensure a more in depth play for female characters. With this mod you now will have a menstrual cycle and the possibility of being pregnant by zombies 😨. "

silent zealot
#

I think there's a mod that replaces drag down and kill with drag down and... not kill.

#

But they don't have clear descriptions of game mechanics up front and I'm not going looking for more details or trying this out.

#

I can see the appeal of lewd mods for a lot of games, but not Zomboid. It's so very unsexy.

bright adder
#

I am not a modder but I have an idea. It might be dumb but I am throwing it out there. I think it would be cool to have a Call of Duty style prestige system for your skills. Obviously the prestige icon system of CoD does not apply here but for like say for first prestige of strength, P1 level 1 would be like 1.1x whatever buffs you get from non-prestiged level 1. P2L2 would be 1.2x and so on and so forth. Just a thought, would be cool to see!

silent zealot
#

How does the CoD prestige system work?

#

To break it down for modding purposes:
How do you earn prestige levels?
What do prestige levels do?

#

Also, all modders are former not-modders. You start making a simple mod to tweak something, turns out you have fun modding, and then you're neck-deep in someone else's code trying to make it do something different without making the entire thing explode in a flaming mess.

native swift
#

In COD it’s like for example say max level is level 100. Once you get to level 100, you can “prestige” and start back over at level 1. But you’ll be first prestige level 1. And then u make it to 100 again and then can start over and be second prestige level 1. And work up again and again. 15th prestige was master or max prestige I think

#

I haven’t played cod since black ops 2 tho

#

So I assume he’s saying like if you reach skill level 10 you can prestige and start over but you’ll have an extra multiplier for being prestiged

#

This would make the xp progression exponential after multiple prestiges however so I feel like it should have some other reward for prestiging.

#

Because if you got more xp boosts every prestige, you would level through levels 1 through 10 faster and faster every time u prestige

#

I’ve got a question. I’ve noticed some mods that the texture png is 512x512, but sometimes it’s smaller like 256x256 or 128x128. Does the size matter?

#

Heh heh

silent zealot
#

I think you'd be better off getting to ten, then you can go directly into unlocking very XP-intensive prestige levels.

#

so short blunt 9, short blunt 10, short blunt 10 prestige 1, short blunt 10 prestige 2 etc.

#

But resetting a skill to zero is possible.

#

Harder would be choosing what the prestige levels do, and limiting to things that don't happen deep in the java code. Some things you could do by modifiying a weapon stats on equip to get the base stat for weapon & add prestige modifier & then set the weapon stat.

#

Idea: you have some sort of meta-progression and if you die and make a new character in the same world they benefit from that.

ashen mist
#

is there like, a guide for making armor mods

#

because i wanted to make a cool ass armored jacket but got told about the harsh reality i was gonna face if i kept at it the way i was

#

but i’m really unsure how to move forwards in a way that’ll work

bronze yoke
#

what problems are you expecting?

ashen mist
#

see i’m tryna compress an armor set into four pieces to make it simpler, as i’ve looked at the complex ones like scrap armor and have concluded i’d go insane setting all that up

bronze yoke
#

unless i'm misunderstanding there is no cap to vertices that you could ever reach

ashen mist
#

idrk either, i’m not experienced in this part of modding

#

i’m literally kitbashing an armor set

crimson panther
#

anyone has any idea why when I export a vehicle model with animations, the doors either spawn in the middle of the car, or if I export with better fbx I get this error?

ashen mist
#

all that? vanilla with minor edits by pulling on polygons

bronze yoke
#

if you're using multiple textures in your model here (it looks like you're using multiple vanilla textures) that will be a problem, in pz models can only have one texture

vocal vector
#

trying to have the player equip a holster that ive added but it goes to the hand instead, how stupid am i?

#

elseif (professionItem:IsClothing() or professionItem:IsInventoryContainer()) and (professionItem:getBodyLocation() or professionItem:canBeEquipped()) then
ISWorldObjectContextMenu.equip(player, professionItem:getBodyLocation(), professionItem, false);

ashen mist
#

and i doubt i’ll be able to kitbash a good texture with vanilla pieces like this

#

buddy said the UV would have to be perfect on it

#

which sucks cuz damn, it looked like a cool idea, using the wires to have like, segmented limbs with protection secured by it

#

i’m contemplating if it would be better to just draw the armor onto the texture

#

but part of me is also really wanting to make an armored jacket that’s visibly bulked up a little bit

#

i’ve been inspired by scrap armor and the FORGE set from Abiotic Factor

#

and that’s probably also why i wanna make it as 3D as possible, to be up to par with my inspirations

bronze yoke
#

abiotic!!

#

i should've been able to tell

ashen mist
#

yeah lmao, it was my main set for so long

#

lemme pull up the wip helmet

#

couldnt find the hard hat texture :(

bronze yoke
#

i stuck with the composer set for the movement... honestly putting some abiotic stuff in zomboid would be cute

ornate sand
ashen mist
#

tryna make it look enclosed with sheets, just can't get it to look right though

#

i should never question myself ever again

#

it just needs a definite shape

#

the best part of its nature as improvised armor is that being hacky looking is the name of the game

#

i'm kinda happy with it, i think

silent zealot
#

I like it.

#

And saves time when welding not having to swap to the welding mask!

young trellis
#

I want to create a mod that allows me to say take jewelry and melt it into gold bars using a craftable mold. Kinda like the "Workshop" mod by DJ with the metal molds being used a a reusuable tool, are there any good videos or documents out there to help me out?

ashen mist
silent zealot
fathom dust
silent zealot
#

The system for melting glass is closest to what you want I think. If jewelry is already tagged to say hasGold/hasSilver its probably easy to do.

#

I hope they change from "a crucible of molten glass is an item that never cools down" to some sort of fluid system approach that includes cooling into a chunk of solid <stuff> of appropriate weight.

young trellis
# silent zealot Have a look at making a recipe to do it, but worth mentioning B42 crafting is st...

I've made a clothing mod prior, and I've found the models for the new ingots etc I basically want to create a gold ingot. I've ripped this straight from the blacksmithing section from scripts and I've put my texture and the model into my mod folder label as "Ingot_gold". Eventually I will use something else as a crafting recipe but what would be the next step in actually putting this to action?

{
    craftRecipe Forge_Ingot_gold_From_Iron_Chunk
    {
        time        = 10,
        SkillRequired = Blacksmith:0,
        timedAction = Making,
        tags = PrimitiveForge,
        category = Blacksmithing,
        inputs
        {
            item 1 tags[Charcoal],
            item 4 [Base.IronChunk],
            item 1 tags[Hammer;ClubHammer] mode:keep flags[Prop1],
            item 1 tags[Tongs] mode:keep flags[Prop2],
        }
        outputs
        {
            item 1 Ingot_gold,
        }
    } ```
silent zealot
#

The inputs.

#

That recipe turns 4 iron chunks into a gold bar.

#

That's probably not what you want!

#

Have a look at how smelting does item selection, and you might find that none of the existing items have useful tags in which case you'd need to add the tags

young trellis
#

No not at all, I'm getting back into modding I just wanted to test this out to see if what I had so far ACTUALLY worked. I want to smelt rings and stuff eventually as the inputs

young trellis
#

Funny enough I missed the gold ingot texture, its in but doesn't look like its smeltable yet? (I think)

vagrant scroll
#

Morning all, I have a question, im trying to make a recipe use the onCreate function to add an item to a player inventory, ive confirmed the function ive added is being called but it wont add the item. whats wrong with:

function Recipe.OnCreate.DoThing(items, result, player)
player:getInventory():AddItem(Base.Money);
end

#

Build 42 btw

#

this worked in b41

bronze yoke
#

the signature of OnCreate functions has changed:

vagrant scroll
#

ahhh thank you, all the searches for oncreate here are showing build 41 type code, assumed it hadnt changed but people still making 41 mods I guess.

#

where is that page btw?

#

is that the pzwiki?

bronze yoke
vagrant scroll
#

oh it is the 1 result in google 😄

#

function Recipe.OnCreate.DoThing(recipeData, character)
character:getInventory():AddItem(Base.Money);
end

still doesnt work, am i minsunderstanding, the recipe is deffo getting inside this function, just refuses to add the item.

#

Recipe is just doing:
OnCreate = Recipe.OnCreate.DoThing,

#

getInv still exists on the character I checked that

true hearth
#

you mean getInventory? xD

vagrant scroll
#

yeah was just lazy in typing it here

#

it all looks right, it just wont spawn the item

true hearth
#

no logs?

vagrant scroll
#

if i do something silly in there, debg stops inside the function, but no, nothing in the logs for the above code

#

i just get this:
[30-01-25 09:17:25.676] LOG : Lua f:724, t:1738228645676> =========== starting craft ===========.
[30-01-25 09:17:36.093] LOG : Lua f:1350, t:1738228656093> ISInventoryPaneContextMenu.OnNewCraftComplete -> Craft action completed.

true hearth
#

what exactly is Recipe.OnCreate? i dont find it

ornate sand
#

How about

player:getInventory():AddItem(Base.Money);

?

vagrant scroll
#

thats what I had before

#

but the params passed to this function changed, as above

#

so ive updated it

ornate sand
#

How's about self.character?

vagrant scroll
#

was going to try that, saw a post on here with that in, but wasnt sure it was 41 or 42

vagrant scroll
ornate sand
#

Some of my lua uses self.character and works alright

vagrant scroll
#

I saw someone mention its not performant, not that I think it matter in my instance

#

ill try it, give me 2 mins

#

function Recipe.OnCreate.DoThing(recipeData, character)
self.character:getInventory():AddItem(Base.Money);
end
also does nothing

#

Recipe:

craftRecipe Do Thing
{
timedAction = Making,
Time = 30,
Tags = InHandCraft;CanBeDoneInDark,
category = Survivalist,
OnCreate = Recipe.OnCreate.DoThing,
inputs
{
item 1 [Base.Money],
}
outputs
{
item 1 Base.Money,
}
}

#

obviously the items are nonsense here im just trying to prove the chain works

#

Can see build 42 recipes still use onCreate the way I am so its not that side, its something in the addItem bit for sure

#

found the recipe lua in core:
function Recipe.OnCreate.OpenWaterCan(craftRecipeData, character)
if not character then return end
local item = character:getInventory():AddItem("Base.WaterRationCanEmpty")
-- local item = character:getInventory():AddItem("Base.TinCanEmpty")

-- item:setTexture(getTexture("Item_CannedWater_Open"))
-- item:setWorldStaticModel("WaterRationCan_Open")
-- item:setStaticModel("WaterRationCan_Open")
-- item:getFluidContainer():addFluid(FluidType.Water, 0.3)
item:getFluidContainer():addFluid(FluidType.Water, 0.3)
end

#

the only thing i can see is i havent wrapped the item in a string...

wind rock
#

Im trying to add a duty belt to the police zombies in the clothing.xml but when I tried doing everything and making sure everything is working properly, I tested it and it somehow did not spawn on them. If anyone could help i'll post the clothing.xml and fileguidtable.xml right here

silent zealot
#

And if not nil, print(character) and see if it's being silly and passing the player number instead of the player object or some such foolishness.

vagrant scroll
#

hmm nothing is printing at all in that function, wtf

#

yet if i put dodgy code in there it breaks on that line in debug

#

but printing a string doesnt even come out

#

ive compared it to core recipes that do the same thing, they are the same, I cant see a difference

jolly epoch
#

so is there a way to add fluids to recipe output?

vagrant scroll
#

using onCreate you can do stuff like:
bucket:getFluidContainer():adjustSpecificFluidAmount(Fluid.TaintedWater, (taintedAmount - amount));
bucket:getFluidContainer():addFluid(Fluid.Water, amount);

#

ive also seen a simple recipe output using something like:
fluid 10.0 [Water;TaintedWater] as an input/output

#

No there is something fundementally broken here, I copied a core recipe and oncreate function and it still doesnt work, lua is in 42/media/lua/server folder as per core as well

#

ok removing everything and only having this 1 recipe now works, so maybe a syntax error thats not logging somewhere else.....time to put code back until it dies

fathom dust
vagrant scroll
#

in the debug log here: C:\Users\yourname\Zomboid\Logs ?

#

well ill be.....yep its there, so it wasnt even loading the file in due to a parse error further down

#

I assumed the recipe name would be in the log, should have looked for the filename, my bad, lesson learned

vague marsh
#

can someone take a look at my beanie hat spawn distribution? I'm trying to balance the spawn rates (default values since this can be adjusted using sandbox options) so they make sense, to make sure beanies don’t appear too frequently or in unrealistic locations. just want to know if its good enough or need adjustment

require "Items/ProceduralDistributions"

local function addSandboxLoot()

    local SpawnRateBeanies = SandboxVars.MetroBeanie.SpawnRateBeanies;

    if (SpawnRateBeanies == 6) then
        SpawnRateBeanies = 0;
    end

    local itemsToAdd = {
        "MetroBeanie.BurntSunset",
        "MetroBeanie.GlitchGrid",
        "MetroBeanie.InfernoLuxe",
        "MetroBeanie.MidnightInferno",
        "MetroBeanie.PhantomGrid",
        "MetroBeanie.ShadowBlaze",
        "MetroBeanie.ToxicHaze",
        "MetroBeanie.VoltageSurge",
    }

    local locations = {
        "ZippeeClothing",
        "CampingStoreClothes",
        "SportStoreAccessories",
        "BedroomDresser",
        "BedroomDresserRedneck",
        "BedroomSidetable",
        "BedroomSidetableRedneck",
        "LivingRoomShelf",
        "LivingRoomShelfRedneck",
        "LivingRoomSideTable",
        "LivingRoomSideTableRedneck",
        "WardrobeGeneric",
        "WardrobeRedneck",
        "ClosetShelfGeneric",
        
        "ToolStoreOutfit",
        "GasStoreSpecial",
        "WildWestClothing",
        
        "CarSupplyTools",
        "LibraryPersonal",
        "SchoolLockers",
        "ClassroomMisc",
        "ClassroomSecondaryMisc",
        "UniversitySideTable",
        "UniversityWardrobe",
        "GymLockers",
        
        "BandPracticeClothing",
        "MedicalStorageOutfit",
        "MedicalClinicOutfit",
        "MorgueOutfit",
        "DrugLabOutfit",
        "PoliceLockers",
        "FireDeptLockers",
        "SecurityLockers",
    }
    
    local multiplier = {
        -- Primary sources (Very High Probability)
        ZippeeClothing = 1.5,
        CampingStoreClothes = 1.2,
        SportStoreAccessories = 1.0,
        BedroomDresser = 1.1,
        BedroomDresserRedneck = 1.1,
        BedroomSidetable = 0.8,
        BedroomSidetableRedneck = 0.8,
        LivingRoomShelf = 0.6,
        LivingRoomShelfRedneck = 0.6,
        LivingRoomSideTable = 0.5,
        LivingRoomSideTableRedneck = 0.5,
        WardrobeGeneric = 1.2,
        WardrobeRedneck = 1.2,
        ClosetShelfGeneric = 1.0,
        
        -- Common locations (High Probability)
        ToolStoreOutfit = 0.5,
        GasStoreSpecial = 0.3,
        WildWestClothing = 0.7,
        
        -- Less likely locations (Medium Probability)
        CarSupplyTools = 0.3,
        LibraryPersonal = 0.2,
        SchoolLockers = 0.6,
        ClassroomMisc = 0.4,
        ClassroomSecondaryMisc = 0.3,
        UniversitySideTable = 0.4,
        UniversityWardrobe = 0.8,
        GymLockers = 0.5,
        
        -- Rare locations (Low Probability)
        BandPracticeClothing = 0.5,
        MedicalStorageOutfit = 0.3,
        MedicalClinicOutfit = 0.6,
        MorgueOutfit = 0.2,
        DrugLabOutfit = 0.3,
        PoliceLockers = 0.4,
        FireDeptLockers = 0.5,
        SecurityLockers = 0.4,
    }
    
    for _, location in ipairs(locations) do
        local locMultiplier = multiplier[location]
        
        ProceduralDistributions["list"][location].items = {}

        for i=1, #itemsToAdd do
            table.insert(ProceduralDistributions["list"][location].items, itemsToAdd[i]);
            table.insert(ProceduralDistributions["list"][location].items, SpawnRateBeanies * locMultiplier)
            
        end
    end

    ItemPickerJava.doParse = true
end

local function parseTables()
    if ItemPickerJava.doParse then
        ItemPickerJava.Parse()
        ItemPickerJava.doParse = nil
    end
end

Events.OnInitGlobalModData.Add(addSandboxLoot)
Events.OnLoadedMapZones.Add(parseTables)
winter bolt
umbral raptor
#

Is it possible to add tents right now?

#

I don't think TileZed is for B42 rn

#

So I'll have to mess with the tiles manually.

vague marsh
silent zealot
vast pier
silent zealot
#

Saves me so much time on stupid typos.

vast pier
#

I feel like silver/gold will have more purpose when npcs are added

silent zealot
vast pier
silent zealot
#

Everyone loves 9mm ammo.

#

...that was a joke but I think that's correct.

#

The flag is only used in a few item files: carpentry, medical, tailoring and ammo.

vast pier
# silent zealot Everyone loves 9mm ammo.

NPC dying of thirst and hunger, their base full of guns and ammunition that they're trying to trade for life support supplies.

gets handed 9mm box
+Reputation
Collapses
trader takes the 9mm box back

silent zealot
wind rock
#

how do I create an icon for a new item

#

I can't seem to get it working

ornate sand
#

Put it in media/textures and name the 32x32 png like so
Item_YourItemName.png

And in the item's script have it as
Icon = YourItemName,

umbral raptor
#

in the item script

#

sometimes there is a syntax error or whatever it's called where u forget a , or misspell or the name in the script is different from the name in the texture file.

#

if it's B42 its Icon =

#

if its B41 it's Icon: , I think

ornate sand
#

Yeah thirteen attempts to get my own advice right lol

wind rock
ornate sand
wind rock
#

thanks both of you for helping out

vast pier
#

Is there a way to make it so wearing sneakers/boots/dress shoes gives you discomfort when not wearing socks?
And in addition to that, discomfort if not wearing the correct socks?
Like wearing short socks would be fine with sneakers, but to not be uncomfortable in military boots you would need heavy socks?

umbral raptor
#

I need help making a simple script for a mod.

#

I want to make it so that when an item had the tag “splint” it essentially works in the medical tab exactly like a splint would.

#

Could someone help me with that?

frank elbow
# umbral raptor Could someone help me with that?

If you're looking to modify or extend existing vanilla functionality, a good first step is searching the Lua source for code related to it. I'd recommend checking out ISHealthPanel & looking for code related to splints

rapid flume
#

Hey modders funkers,
modding for b41 for the moment, (but you can answer for both)
I ran into this: I managed to import and makes my tiles appear and spawnable brushtool I made the items and recipes using vanilla tiles so my code there is solid, only got issues with new tiles and a couple other points to address.

I tried both
item NewItem { }
and
item Mov_NewItem { }

I can't pick-up my tiles

(I used to be able with the same itemscripts but using vanilla tiles), the animation works, the time to pickup is progressing, but nothing adds to inventory or remove the world tile after the progress. no errors.

The tooltip of the world tile: weight shows normal values: the ones I've set in .tiles. + there's a nice render of the tile in mini-avatar-icon-thumb.

am i missing something ?

other points: Edit: checking answers posted earlier.
my new tiles/moveables inventory icon is
nil ? (using .png names in ui/ or textures/)
or invisible (using "default" as a value)
How to link a fonctional icon ?
EDIT: OK I read a post from 2h ago , gonna try about icon.

native swift
#

ive got a question. I have been able to get the hammering sound to work for crafting my rocking horse, but the animation is still the same as like ripping clothes. how and where would i add that into this recipe so that i can have a hammering animation? here is the script:

module BabyItems

{
imports
{
Base
}

recipe Rocking Horse
{
  Nails=5,
  Plank=5,
  keep [Recipe.GetItemTypes.Hammer],

  Result:RockingHorse,
  Sound:Hammering,
  Time:100.0,
  Category:AcidItems,
}

}

vast pier
mossy fog
#

Hi, i've a problem testing my mod, i cant' find the mod to enable it inside the game

ornate sand
#

Check pins

mossy fog
#

I've put in folder C:\Users\ \Zomboid\Workshop

#

Is it right this folder?

bright fog
vast pier
bright fog
#

Check this

vast pier
# ornate sand Check pins

You work with weapon mods, know where the pushing/stomping logic is stored? I wanna make your feet hurt from wearing boots and no socks when stomping n' stuff

ornate sand
vast pier
#

Tragedy

#

I'm looking at "a stomp nerf mod" and it ports over to build 42 with zero issues.
I wonder if I could jam in a check for socks and make the player get scratched/pain from stomping without socks

#

Cuz I mean, it already does majority of the checking for me.
The shoes n' stuff only take damage if the attack hits a zombie on the ground, no random durability damage from shoving a zombie

#

So theoretically I would just need to copy the check and convert it to check for socks, and if none are present, have it apply pain/damage to your feet based on rng

native swift
#

how do i add a vanilla animation to my crafting recipe? trying to add the hammering animation to the recipe. i got the hammering sound to work, but my player just does the ripped sheets animation

hot plinth
#

maybe?
timedAction = MakingHammer_Surface,

native swift
#

i cant find a single line of animations in any recipe in the vanilla files which confuses me. like building or upgrading a wall does this animation, but i can't find the animation or a call to the animation anywhere in those scripts

ornate sand
#

That would be

timedAction   = BuildWallHammer,
rapid flume
# native swift i cant find a single line of animations in any recipe in the vanilla files which...

in the script.txt recipe {} not recipeCode.lua (and b41):
AnimNode:Welding, note1 -> like welding picking apple hand up high
AnimNode:Dismantle, -> mumbling stuff at waist level.
AnimNode:Hammer, -> look for it not sure the term.

add this to have an item in hands:
prop1: item, -> default primary
prop2: item2, -> the other hand

note1: maybe AnimNode:Welding doesn't exist but the anim auto select if prop1 (primary) is used and has an animation. (prop1:Blowtorch)

native swift
lime wolf
#

I've been trying to figure out for a long time how to change the Action Time of my Mod but Everytime I do it just plays the same time. Any Help on what I did wrong?

ornate sand
plush wraith
#

The media folder contains lots of good reference material in general

native swift
#

yeah i use the media folder and use visualstudiocode to search through it. i dont have anything called entites in my scripts folder?

native swift
#

yeah

ornate sand
#

Whoops my bad lol

plush wraith
native swift
#

u good

#

im just surprised i cant find any animations in any recipes for the entire game. like how do the crafting recipes know which animation to do?

rapid flume
native swift
#

i figured there would just be a line that calls for a certain animation

rapid flume
#

..

native swift
#

oh i see this now sorry about that

rapid flume
plush wraith
# lime wolf I've been trying to figure out for a long time how to change the Action Time of ...

This is how i set the time for the TimedAction in my mod:

    local o = {
        stopOnWalk = false,
        stopOnRun = true,
        stopOnAim = true,
        forceProgressBar = false,
        character = character,
        item = TrueSmoking.Smokable.item,
    }
    setmetatable(o, self)
    self.__index = self

    --if passiveSmoking then o.maxTime = 80 else o.maxTime = -1 end
    o.maxTime = -1
    return o
end

changing o.maxTime will change the length (im using -1 for infinite)

native swift
#

im only finding Animnode:Disassemble , SawLog, and RipSheets. ima keep looking for a hammering one

lime wolf
native swift
rapid flume
#

did you try hammer ? I know there is an anim for bashing nails down with a hammer

I think I just tried Welding, or I found it somewhere but haaaard.

winter bolt
ornate sand
#

in ISBarricadeAction
lua/client/TimedActions

native swift
vast pier
plush wraith
# native swift this is the search for "AnimNode:" in the ENTIRE media folder

Is this not what you are after?

craftRecipe FireHardenSpear
    {
        Time = 100,
        NeedToBeLearn = true,
        OnCreate = Recipe.OnCreate.FireHardenSpear,
        OnTest = Recipe.OnCanPerform.OpenFire,
        ToolTip = Tooltip_Recipe_OpenFire,
        Tags = InHandCraft;Survivalist,
        category = Weaponry,
        timedAction = CraftKnifeSpear,
        AutoLearnAny = Spear:6,
        xpAward = Carving:5,
        inputs
        {
            item 1 [Base.SpearCrafted] flags[Prop2],
            item 1 tags[SharpKnife;MeatCleaver] mode:keep flags[Prop1;IsNotDull],
        }
        outputs
        {
            item 1 Base.SpearCraftedFireHardened,
        }
    }

The field timedAction specifies the animation to carry out during the TimedAction

native swift
ornate sand
#

Because I found "Build" in those

native swift
winter bolt
#

even when stomping or shoving weapon is always the weapon equipped so this mod only works if the player stomps while unarmed

#

this whole line should just be player:isStomping()

native swift
#

like would it be "timedAction = Build"? or would it be "self:setActionAnim("Build")"? because ive never seen the second format in a recipe ever

winter bolt
plush wraith
#

you could try "MakingHammer_Surface" for timedAction

ornate sand
vast pier
#

cuz you can force a stomp attack with Alt + attack

winter bolt
#

no OnWeaponHitXP happens at the end of hitting an enemy

vast pier
#

Oh alright, I didn't make the lua

#

I just know it functions lol

twilit zealot
#

is it possible to make a mod to change the animation of holding a two handed firearm like a M16 like this

#

instead of this

twilit zealot
#

because i think it's would be better for the game to have an idle animation like this than the current one ingame

native swift
vast pier
lime wolf
twilit zealot
# ornate sand Yep, idleanim

i'm not someone that can make model or animation because i suck in blender but i hope someone will take my idea to make a real mod

winter bolt
#

i spent a few days recently messing with the weapon events and i have no idea why they did it like that

vast pier
winter bolt
winter bolt
vast pier
#

would it be owner instead of player since the function references owner, weapon, hitObject, damage
?

native swift
plush wraith
winter bolt
native swift
#

it also looks like AnimNode is only used in disassembling objects from what i see in the recipes.txt. and the other thing i thought of was the multiastagebuild.txt would for sure have a hammering animation (like for upgrading walls etc.) but there NOTHING about animations in that file XD

#

im getting close to leaving it as just the normal ripped sheets animation lol. i just thought it would be cool to be hammering since its a recipe for building a rocking horse

vast pier
# winter bolt yeah

Just tested without changing any of the code.
While holding a screwdriver, the boots still took damage. Meaning it still registered as BareHands

native swift
#

im starting to think that you cant add an animation to a recipe itself, and that it is somewhere else entirely. because the AnimNode is only in dismantling objects and only 3 types exist. and timedAction isnt in a single recipe in the vanilla files.

vast pier
# vast pier

stomping triggers barehands, and using the screwdriver triggers screwdriver_old

native swift
#

yeah

winter bolt
#

oh

#

b41 doesnt use timedactions for recipes lol

bright fog
native swift
#

that would explain that XD

bright fog
#

bruh

native swift
#

other than the normal one that looks like ripping sheets or something

vast pier
#

I would assume you still can, it just doesn't use timedactions

native swift
#

the only way im seeing would be to use AnimNode:SawLog and combine with the hammering sound and that would be as close as i can get

#

because i dont think i can use the actual hammering animation in the recipe

winter bolt
#

im not sure if b41 even had any hammering anims

native swift
#

when you upgrade a wall or barricade

#

pretty sure no?

lime wolf
native swift
#

I think ima have to just try the AnimNode for sawlog and it’ll be as close as I can get to actual hammering lol

bright fog
#

Can YOU tell us what is not working ?

umbral raptor
#

I'm trying to essentially implement an item called Orthopedic Cast that works exactly like a splint

#

it doesn't and the splint is now bugged

#

im essentially trying to piggy-back off the splint script by making my item use it

bright fog
#

No errors ?

#

Do you understand every parts of your code too ?

#

Or at least the big lines

umbral raptor
#

hmm

bright fog
#

Also did you just copy pasta the original file ?

umbral raptor
#

i do understand most of it

#

i did copy and paste it

#

lemme try it smthin else

bright fog
#

So it's going to mix with the original one or replace the original one if you do that

#

That's definitely not what you want to do, going to cause some major incompatibilities

umbral raptor
#

how can I do it then?

#

my goal is to create a new tag, this tag would make an item work as a splint

#

like the many tags that do similar things.

coarse sinew
#

Have you tried to use the tag Splint for your item ?

bright fog
vast pier
#

I don't think the splint has a tag like that though?

ornate sand
#

The function HSPlint:checkitem should be a lot of help

coarse sinew
vast pier
#

Is there a way to check if the player has anything equipped in a specific body location?
getClothingItem_Feet specifically checks the shoe slot

vast pier
ornate sand
#

Nevermind it's a bit more complicated, but I'd suggest looking through ISHealthPanel.lua for the splint stuff. Probably won't be as simple as tagging it.

native swift
#

i think i was searching for something tht doesnt exist XD

ornate sand
#

Those anims definitely exist in B41 because you know, craft floor tile has you hammering a floor, barricading a window has you hammering a plank, building a wall had you hammer at air, etc.
I just have zero idea what calls those, where or how 😄

vast pier
stoic gulch
plush wraith
winter bolt
#

getWornItem("Socks") should work but idk the exact name of the bodylocation

stoic gulch
vast pier
vocal vector
#

hello, i am trying to equip a holster with a script, but it goes into the players hands instead of the beltextra slot

winter bolt
vast pier
#
        if SockItem then
            print(SockItem)```
Isn't printing anything when doing the stomp, so I'm guessing it's returning a nil despite me wearing socks
stoic gulch
vast pier
#

wait I never added an end, that may be related

#

lemme check

winter bolt
#

thats it

vocal vector
#

the code is:

#

if (professionItem:IsClothing() or professionItem:IsInventoryContainer()) and (professionItem:getBodyLocation() or professionItem:canBeEquipped()) then
ISWorldObjectContextMenu.equip(player, professionItem:getBodyLocation(), professionItem, false);

#

it seems like getbodylocation is always putting things in the off hand

#

it does this with bags too

vast pier
#

build 41 or 42?

vocal vector
#

b42

vast pier
#

"This script will check the player's inventory for the firefighter pants. If the item is in the player inventory when spawning in, it will delete the starting belt, and equip the pants."

vocal vector
#

it runs 1 tick after the character is made

vast pier
vocal vector
#

i tried setwornitem and couldnt get it to work right, but i will try setting it up like that, thanks 🙂

vast pier
#

Yours would probably be
player:setWornItem("BeltExtra","Base.HolsterSimple")

native swift
# ornate sand Those anims definitely exist in B41 because you know, craft floor tile has you h...

Yeah I have spent HOURS looking for them. The problem is when you right click and hit carpentry, I don’t think that’s technically considering “crafting”. It pulls the hammering animation from a lua or something similar to barricade or upgrade walls. But as far as specifically crafting something, there’s not a single recipe with an animation for hammering in the entire game files. Closest I could get is the AnimNode that is in some recipes but there’s only three of those that exist: sawlogs, disassemble, and ripsheets. And saw logs combined with the hammer sound is the closest I can get in a recipe as of now

vast pier
#

How would I go about adding pain to a body part?

#

I can probably figure out the math part by reverse engineering the code used to damage boots in the mod I'm messing with, just don't know how to apply body pain

mossy fog
#

Hi, the clothing script i created does not display the model and textures, a similar problem happens with the ground object, maybe is the xml file but i dont have experience with coding

vocal vector
vast pier
#

Thanks

mossy fog
silent zealot
#

Ghille Suit upgrade?

mossy fog
#

HEV Suit from half life

#

The helmet work but i cant make the armor work

vast pier
# silent zealot Ghille Suit upgrade?

reminds me of that experimental camoflauge that was designed to bend light around you, sorta making you see through but not really.
I think it was too expensive/easier to spot due to pattern seeking brains, and so never went anywhere.

umbral raptor
mossy fog
#

fbx

umbral raptor
#

also check the model file, compare model names

#

ensure the clothingitems file is also error free

#

its 100% a spelling error or reference error

mossy fog
#

i use other mod as reference to make it

umbral raptor
#

did u add it to fileguidtable?

mossy fog
#

yep

umbral raptor
#

can u ensure that the model's name and texture name are exactly like the clothingitem file states.

winter bolt
#

the model is loading it just looks like a material or weight thing

umbral raptor
#

put a space between </file> and <file> in the first and second item

winter bolt
#

make sure it only uses 1 material because anything else will be invisible

mossy fog
#

maybe that was the problem, i tried use 2 textures to simulate a metallic texture

#

i'm gonna fix the texture and try again

vocal vector
#

ok progress

#

elseif professionItem:IsClothing() and professionItem:getBodyLocation() then
player:setWornItem(professionItem:getBodyLocation(), professionItem)

#

this equips the holster but no hotbar slot appears

#

looks like i need to update the hotbar slots, when i take off the belt, the slot appears

vocal vector
#

ISHotbar.update() is throwing an error tho

#

index: playerNum of non-table

vast pier
vocal vector
#

' local professionItem = instanceItem(professionItemType)

#

'player:getInventory():AddItem(professionItem)
if professionItem:IsWeapon() and not professionItem:IsClothing() then
ISWorldObjectContextMenu.equip(player, player:getPrimaryHandItem(), professionItem, true);
print ("1")
elseif professionItem:IsClothing() and professionItem:getBodyLocation() then
print ("2")
player:setWornItem(professionItem:getBodyLocation(), professionItem)
elseif professionItem:IsInventoryContainer() and (professionItem:getBodyLocation() or professionItem:canBeEquipped()) then
print ("3")
ISWorldObjectContextMenu.equip(player, professionItem:getBodyLocation(), professionItem, false);
end'

#

it is a "Base.HolsterSimple_Black"

old ginkgo
old ginkgo
# native swift Yeah I have spent HOURS looking for them. The problem is when you right click an...

Regardless of your intent; they're stored under the same file as all other animations regardless of it's crafting or not. Which is Anims_X -> Bob folder under Media.

They're considered Bob_IdleHammering and Bob_IdleHammering_Low. They're normally triggered by TimedActions (as are most other things in the game.)

They can be triggered outside of this as well, and you can also change the equipped item during them by making your own timed action with your own event trigger and your own parameters within the timed action.

If you intend to modify them; vanilla animations are a bit of a headache to modify in any extensive way outside of the code or .XML scripts.

If you have any other questions let me know.

#

If you wanted to use them yourself in a crafting recipe; you need to reference the 'string' value in the animation's XML.

Here's an example of what the 'Build.xml' is:

<?xml version="1.0" encoding="utf-8"?>
<animNode>
    <m_Name>Build</m_Name>
    <m_SpeedScale>0.80</m_SpeedScale>
    <m_AnimName>Bob_IdleHammering</m_AnimName>
    <m_deferredBoneAxis>Y</m_deferredBoneAxis>
    <m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
    <m_BlendTime>0.40</m_BlendTime>
    <m_Conditions>
        <m_Name>PerformingAction</m_Name>
        <m_Type>STRING</m_Type>
        <m_StringValue>Build</m_StringValue>
    </m_Conditions>
    <m_SubStateBoneWeights>
        <boneName>Dummy01</boneName>
    </m_SubStateBoneWeights>
    <m_SubStateBoneWeights>
        <boneName>Translation_Data</boneName>
    </m_SubStateBoneWeights>
</animNode>
#

You would reference the 'Build' string in your action anim name for your craft recipe's timed action.

You can just make your own custom XML for your own needs as well while still referencing the vanilla animation name and make your own string.

random finch
#

Where are all the available key maps? I forgot.
IE: getCore():getKey("Forward")

#

Nvm, they are in keys.ini

silent zealot
ashen mist
#

do y'all know if there's anybody around doing clothing mod commissions

#

i'm getting my ass beat by modelling n' shit

mellow frigate
#

Am I the only one who checked 3 times PZ blog in the last hours ?

bronze yoke
#

they already said there wouldn't be one this month

ashen mist
#

hey albion, i got a question, would you know where i can find modders to commission?
(NO LONGER NEEDED AS OF 2/5/25)

ashen mist
#

thanks a ton

rapid flume
#

Lua command console:
pickup testnilzombie.iso.objects.isoThumpable@xxxxxx

Still can't pick-up my tiles (maybe my tiles def (Tilezed) are outdated) or something missing ?

stoic gulch
#

Whats the best way to test a multiplayer mod if you need a second player but don't got a second Steam account/person handy? Shit outta luck?
Working on a name recognition system
Tried the old running two clients on a local server, but the second one said user is already connected.

bronze yoke
crimson panther
native swift
old ginkgo
native swift
#

just a normal crafting, where the animation is the hammering animation thats it

old ginkgo
#

Yeah so you can still reference it; it's just a 'string' in the files for the recipe. You just might have to make your own .xml for it to reference the string. Crafting recipes are timed actions themselves.

native swift
#

well now whenever i carry out the crafting, which has the hammering sound, most of my game sound disappears. no footsteps etc

#

just started happening

#

it worked fine earlier and i didnt change anything?

#

the only sounds coming through are rain and wind now. all other sounds are muted in my game

#

Restarting the game brings back sounds. But as soon as I craft it again, my sounds go away

#

here is the recipe in question

#

recipe Rocking Horse
{
Nails=5,
Plank=5,
keep [Recipe.GetItemTypes.Hammer],
Result:RockingHorse,
Sound:Hammering,
Time:100.0,
Category:AcidItems,
AnimNode:SawLog,
}

#

earlier this worked fine, and now it breaks my game sounds

#

any idea why?

#

crafting anything is now making my game not have sounds wtf

#

sounds are fine and when i craft something they just go away

#

verified game files and now it works lol im trippin

atomic hare
#

anybody has (or is working on) a mod that make coolers functional?

native swift
#

now theyr ebroken again dude ugh

#

Does anybody have any idea why crafting would take away game sounds. I can hear zombies and environmental sounds. But no sounds of my footsteps or my actions

gritty oracle
#

anyone know where the map textures are?

#

for like choosing your spawn

native swift
#

so ive come to the conclusion so far that if you spawn in beer bottles, and only beer bottles, and use them to craft something, it breaks your game sounds. i just tested a whole bunch of stuff. something about spawning a beer bottle in admin mode and using it to craft something in a recipe breaks it

#

so its any drinks. if you have a recipe that has drinks or drink bottles, and if you spawn them in using admin mode, they will break your audio. crafting with the drinks in my fridge works fine. but when you craft using spawn in drinks, they break. such a weird issue

hidden compass
#

I am trying to play an SE with the following code, but when the sound is played while the character is moving, the sound source moves. When I listen with headphones, the first 5 times it sounds the same from left to right, when character runs to the left, the sound runs to the right, and when character runs to the right, the sound runs to the left. This seems to be a production where the sound is played at the coordinates of the player at the moment the sound is played. However, since what I want to sound is an SE related to the UI, it does not need to be audible to other players, nor does the sound need to be staged. Can someone please suggest this?

getSoundManager():playUISound("SOUNDNAME")
hidden compass
#

I found this Java method in SoundManger.

   public Audio PlaySound(String var1, boolean var2, float var3) {
      if (GameServer.bServer) {
         return null;
      } else if (IsoWorld.instance == null) {
         return null;
      } else {
         BaseSoundEmitter var4 = IsoWorld.instance.getFreeEmitter();
         var4.setPos(0.0F, 0.0F, 0.0F);
         long var5 = var4.playSound(var1);
         return var5 != 0L ? new FMODAudio(var4) : null;
      }
   }

And I also found playSound method in IsoPlayer, so I tried call this.

getPlayer():playSound("SOUNDNAME")

In both cases, the sound is now as intended even if the character moves. However, my concern is whether the sound is heard by other players in multiplayer. Off course, I want to play sound only me. Does anyone know?

hidden compass
#

It appears that the playUISound specifications have changed for B41 and B42. Given these changes, which method should we use to play UI sounds (location-agnostic, not audible to other players)?

   // B42.2.0
   public long playUISound(String var1) {
      GameSound var2 = GameSounds.getSound(var1);
      if (var2 != null && !var2.clips.isEmpty()) {
         GameSoundClip var3 = var2.getRandomClip();
         long var4 = this.uiEmitter.playClip(var3, (IsoObject)null);
         if (var4 != 0L && IsoPlayer.getInstance() != null) {
            if (IsoPlayer.getInstance().getReanimatedCorpse() != null) {
               this.uiEmitter.setPos(IsoPlayer.getInstance().getReanimatedCorpse().getX(), IsoPlayer.getInstance().getReanimatedCorpse().getY(), IsoPlayer.getInstance().getReanimatedCorpse().getZ());
            } else {
               this.uiEmitter.setPos(IsoPlayer.getInstance().getX(), IsoPlayer.getInstance().getY(), IsoPlayer.getInstance().getZ());
            }

            this.uiEmitter.setParameterValue(var4, FMODManager.instance.getParameterDescription("FootstepMaterial"), 2.0F);
            this.uiEmitter.setParameterValue(var4, FMODManager.instance.getParameterDescription("FootstepMaterial2"), 0.0F);
            this.uiEmitter.setParameterValue(var4, FMODManager.instance.getParameterDescription("Inside"), 0.0F);
            this.uiEmitter.setParameterValue(var4, FMODManager.instance.getParameterDescription("RainIntensity"), 0.0F);
         }

         this.uiEmitter.tick();
         javafmod.FMOD_System_Update();
         return var4;
      } else {
         return 0L;
      }
   }
#
   // B41.78.16
   public long playUISound(String var1) {
      GameSound var2 = GameSounds.getSound(var1);
      if (var2 != null && !var2.clips.isEmpty()) {
         GameSoundClip var3 = var2.getRandomClip();
         long var4 = this.uiEmitter.playClip(var3, (IsoObject)null);
         this.uiEmitter.tick();
         javafmod.FMOD_System_Update();
         return var4;
      } else {
         return 0L;
      }
   }
plush wraith
#

How does one manually call a crafting option from the context menu on an item with lua?

tacit pebble
#

@young trellis #mod_support message
How's folder structure? I mean, where's your media folder located?

tacit pebble
#

\mods\[UniqueFolderName]\42.2.0 ?

young trellis
tacit pebble
#

yep i'm not 100% sure it's the reason tho

#

oh wait

young trellis
#

Thanks I will give it a try 👍

tacit pebble
#

common should be here

young trellis
young trellis
#

256x256

tacit pebble
# young trellis

There's a poster= parameter in mod.info
also preview.png should be placed with workshop.txt

undone elbow
#

What files are always loaded when the game starts? And what files are loaded only on demand?

tacit pebble
#

so preview.png is for workshop
poster parameter is for in-game thumbnail in modlist i guess (I always use same png file for both so only guessing)

tacit pebble
young trellis
tacit pebble
#

please follow this guide first and let's see if there's any problems still

young trellis
#

Yeah I'll rebuild it before adding anything else in and see where we get. idk why the new structure is throwing me off from 41 lmao

tacit pebble
hidden compass
young trellis
#
└── mods/
    ├── MyMod1/
    │   ├── common/
    │   │   └── media/
    │   │       └── ...
    │   ├── 42/
    │   │   ├── media/
    │   │   │   └── ...
    │   │   ├── mod.info
    │   │   └── poster.png
    │   ├── 42.1/
    │   │   ├── media/
    │   │   │   └── ...
    │   │   ├── mod.info
    │   │   └── poster.png
    │   ├── 42.1.5/
    │   │   ├── media/
    │   │   │   └── ...
    │   │   ├── mod.info
    │   │   └── poster.png
    │   └── ...
    └── MyMod2/
        └── ...

So for this, do I have two copies of the media folder between my mod folder and the 42 folder?

#

Or is this for having multiple mods in one singular pack?

hidden compass
#

If there is no need to separate the mods in the minor version, you can prepare only 42 folders and copy the files there.

#

This is an example of my mod that supports both B41 and B42. the Common folder is another consideration and is not covered in this case.

└─P4AlarmSyndrome
    │  mod.info          <--- for B41
    │  poster.png        <--- for B41
    │
    ├─42                <--- for B42
    │  │  icon.png      <--- for B42
    │  │  mod.info      <--- for B42
    │  │  poster.png    <--- for B42
    │  │
    │  └─media         <--- for B42
    │
    ├─common            <--- Common use
    └─media             <--- for B42
young trellis
#

Also now having an issue with just rebuilding with the proper structure that when saving mymod.info file its staying as a text document and not becoming the proper info file

hidden compass
#

That is a matter of how you use the editor. Just make sure you correctly name the file when saving from the editor or rename it on Explorer.

young trellis
#

I used a tool to convert it to an info problem solved there 🙂

young trellis
#

So I've got it uploaded back to the wrokshop and all now, it displays the proper preview image on the mod page however it keeps bricking my game, when I relaunch it loads to a black screen and eventually closes out, the only thing the mod adds is textures so I'm not sure what the deal is, the same mod was working on B41 yesterday when I took a look

hidden compass
#

Which mod is yours? I'll try running it on my setup to help narrow down the issue.

hidden compass
#

Yes, I confirmed just now that problems lol

young trellis
hidden compass
#
31-01-25 14:35:51.802] ERROR: General      f:0, t:1738301751802> ExceptionLogger.logException> Exception thrown
    java.lang.Exception: Item not found: Ingot_gold at OutputMapper.getItem(OutputMapper.java:114).
    Stack trace:
        zombie.entity.components.crafting.recipe.OutputMapper.getItem(OutputMapper.java:114)
        zombie.entity.components.crafting.recipe.OutputMapper.OnPostWorldDictionaryInit(OutputMapper.java:121)
        zombie.scripting.entity.components.crafting.OutputScript.OnPostWorldDictionaryInit(OutputScript.java:398)
        zombie.scripting.entity.components.crafting.CraftRecipe.OnPostWorldDictionaryInit(CraftRecipe.java:664)
        zombie.scripting.ScriptBucketCollection.OnPostWorldDictionaryInit(ScriptBucketCollection.java:188)
        zombie.scripting.ScriptManager.PostWorldDictionaryInit(ScriptManager.java:1723)
        zombie.iso.IsoWorld.init(IsoWorld.java:2614)
        zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:301)
        zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:251)
        java.base/java.lang.Thread.run(Unknown Source)
young trellis
#

Interestingly even without the mod loaded my game is bricked after a fresh install with stuck on loading scripts on the unstable branch

hidden compass
#

The game fails to load the recipe and cannot start because there is no item definition “Ingot_gold”. Is this item from another mod?

#

Excuse me, but was this mod developed by you? I suggest you test it thoroughly locally and upload it.

young trellis
#

The mods not intended to be public just for a private server, this is a first attempt at making something past just retexures of clothing and vehicles that I've made in the past

tacit pebble
hidden compass
#

To begin with, there is no item called "Ingot_gold" in vanilla either (yes, there is a texture with that name, but there is no item setting).

young trellis
#

Yeah that was prior to me finding out the item existed I took the texture of the iron ingot and just threw color onto it to test in game if I could at least pull the item up, then I found out there is an actual gold ingot texture and item already

hidden compass
#

The items defined in vanilla are “GoldBar” and “SmallGoldBar”, which indeed use the icon “Ingot_Gold”. If you are referring to these items, then coolfish2 is correct, they need to be specified in the recipe with Base.( Base.GoldBar or Base.SmallGoldBar)

    item GoldBar
    {
        DisplayName = Gold Bar,
        DisplayCategory = Material,
        Type = Normal,
        Weight = 16,
        Icon = Ingot_Gold,
        StaticModel = GoldBar,
        WorldStaticModel = GoldBar,
        Tags = IgnoreZombieDensity;HasMetal,
    }

    item SmallGoldBar
    {
        DisplayName = Gold Bar - Small,
        DisplayCategory = Material,
        Type = Normal,
        Weight = 2,
        Icon = Ingot_Gold,
        StaticModel = GoldBarSmall,
        WorldStaticModel = GoldBarSmall,
        Tags = IgnoreZombieDensity;HasMetal,
    }
#

Ingot_Gold” is the file name of the 3D model or icon image, not the item ID of the item setting. You have specified as the item ID “Ingot_Gold” in the recipe (and without the "Base." modifier), which causes an error on recipe load, and worst of all, the game will not start in this case.

young trellis
#

Awesome, I'll give it a try

fading horizon
#

anyone know the difference between context:addGetUpOption() and context:addOption()

tacit pebble
# fading horizon anyone know the difference between `context:addGetUpOption()` and `context:addOp...
function ISContextMenu:addGetUpOption(text, target, onSelect, p2, p3, p4, p5, p6, p7, p8, p9, p10, ...)
    if select("#", ...) > 0 then
        error("only 9 additional arguments are supported")
    end
    -- Any of these may be nil, so we can't take advantage of "..." syntax :-(
    return self:addOption(text, self, self.onGetUpAndThen, onSelect, target, p2, p3, p4, p5, p6, p7, p8, p9, p10)
end

function ISContextMenu:onGetUpAndThen(onSelect, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, ...)
    local nArgs = select("#", ...)
    if nArgs > 0 then
        error("only 10 additional arguments are supported,")
    end
    local playerObj = getSpecificPlayer(self.player)
    local action = ISWaitWhileGettingUp:new(playerObj)
    action:setOnComplete(onSelect, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)
    ISTimedActionQueue.add(action)
end
function ISWaitWhileGettingUp:start()
    if not self.character:isSitOnGround() and not self.character:isSittingOnFurniture() then
        self:forceComplete()
        return
    end
    self.character:setVariable("forceGetUp", true)
end

function ISWaitWhileGettingUp:update()
    if not self.character:isSitOnGround() and not self.character:isSittingOnFurniture() then
        self:forceComplete()
    end
end

so i guess it's literally force getup when player is sitting?

round thorn
#

What is the fomula for durrability on tires? and does running over bodies hurt them as well?

#

I knwo speed and tire pressure matter, just not sure how.

rapid flume
#

Reposting for morning and noon here EU.

[b41] I made custom tiles with tilezed from steam.
My tiles are brushtool able and appearing fine.
BUT I can't pick them up...
Lua command console posts:

pickup testnilzombie.iso.objects.isoThumpAble@xxxxxxx

**SOLVED ** leave field: Item (full name) [...] blank ! <1>
I know why I could not pick my tiles, I gave all Item (full name) to my sprites/tiles and removing it, leaving blank, solved my pickup problem.

Now I don't have a nice display name, but I can pick up my tiles.

<1>The Item (IDname /not rly full name doh!) is used to link the tile to a script item.
(if not using script item link, gotta be carefull how you name the groupname and customname for a clean output display name)

EDIT: I solved the rotations below:
[b41] And how do you make a tile have N and W facing..
I made 2 sprites per "item/object".
for the moment I can only place my item/tile and not pick up, + I can't rotate it 90° (switch N and W) (facing N and W in .Tiles doesn't work, and vanilla tiles I used as ref for tile def aren't even using them. I will look at other tiles which do rotate.)

Solution for rotation of tiles:
So it's about how we name the values groupname. don't use spritpos. and custom name is actually for the group of object name the same. it's not the other way around (from my divergent mind at least)
and .Tiles facing N or W or S or E is working as intended if you use the groupname correctly.
Must use the same groupname ("poor quality" for exemple) for that rotating item, called the same on Custom name, the custom name is the group actually.. like "chair" or "barrel", and the groupname is for the tile(same) facing diff.direction grouped or linked togheter for those sprites to identify as one item.

so we could have 1 custom name for the 3 items and 3 groupname for 3 variants of that custom item... (from poor to rich qualities for ex.)

vast pier
fading horizon
#

Im a little confused on item models and such. Im updating my water straw mod for B42. Currently the animations work fine when using bottles or containers, but since the model is rotated 180 degrees on the prop1 attachment, when i go to use that same model with the drink from hand animation, the model is not placed correctly.

I've currently fixed it by making a placeholder item with the correct rotation and getting that items static model for the timed action that calls the drink from hand animation, but this doesnt seem like the proper way to do it.

Is there a better way to have multiple model definitions for the same item?

#

my model script looks like this

 model waterFilterStraw
    {
        mesh = WorldItems/waterFilterStraw,
        texture = waterFilterStraw,

        attachment Bip01_Prop1
        {
            offset = 0.0000 0.0000 0.0000,
            rotate = 0.0000 0.0000 180.0000,
        }
    }

    model waterFilterStrawFromGround
    {
        mesh = WorldItems/waterFilterStraw,
        texture = waterFilterStraw,

        attachment Bip01_Prop1
        {
            offset = 0.0000 0.0000 0.0000,
            rotate = 0.0000 0.0000 0.0000,
        }
    }
#

in the timed action that handles drinking from bottles, self:setOverrideHandModels(self.straw:getStaticModel(), self.item:getStaticModel()); works perfectly with the 180 z rotation

#

but using that on the drinking water from hand timed action (what im using to simulate drinking from puddles and lakes), i dont need that rotation

#

so on that timed action i instead have
self:setOverrideHandModels(getScriptManager():FindItem("waterStrawFullPLACEHOLDER"):getStaticModel(), nil)

#

hopefully that explains what im trying to ask. Im very confused

#

this currently works it just doesnt feel like the correct way to go about it

small topaz
#

Hello! In B42, does anyone know how the command "addScrollBars()" work when applied to a UI panel (like "panel:addScrollBars()")? Specifically, I cannot figure out how the position of the scroll bar is determined by the game. Seems to be completely random for me (sometimes it is shown on a seemingly random position, sometimes it is not shown at all...).

hard nova
#

Wish we could hang zombies on the butcher hook

#

Idk if that’s a mod already

#

I wanna Vlad the impalerify my base

frank elbow
# small topaz Hello! In B42, does anyone know how the command "addScrollBars()" work when appl...

I don't see changes specific to B42 for that, so I'm assuming you just mean as of B42. ISUIElement.addScrollBars adds an ISScrollBar to an element and sets it to the vscroll field (and a horizontal one to hscroll, if the flag is passed for that). The position and size are initially set in ISScrollBar:instantiate, but they'll change based on the parent size due to the values of the anchor fields

#

The anchor calculations live in Java, UIElement.onResize

#

Also, re. "sometimes not shown at all": see ISScrollbar:render (depends on the scroll height value of the parent)

small topaz
# frank elbow Also, re. "sometimes not shown at all": see `ISScrollbar:render` (depends on the...

I also found out that it is somehow related to parent position and size but I haven't yet been able to find out what the exact rule for position calculation is. Pbbly have to reverse engineer the vanilla code more.

Btw. this happens when I simply addScrollBars() to the shown panel. An additional complication might be that the game somehow changes smth about the panel position and size without me noticing and thus messing things up...

frank elbow
small topaz
#

I already tried to add it afterwards. My code goes smth like this:

vanilla: create/adjust panel (size, position etc), add scroll bars -> my mod: delete scroll bars, change position/size of panel, addScrollBars() again

So, anytime vanilla touches the panel, I run my modded code to adjust it and re-add the scroll bars after I've set up anything. One possibility is ofc that I overlooked some part of the vanilla code where it changes it and forgot to apply my method although I checked the vanilla code pbbly 100+ times by now XD

tulip valve
#

ERROR: General      f:0, t:1738345755213> ExceptionLogger.logException> Exception thrown
    java.lang.RuntimeException: attempted index: items of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).
    Stack trace:
        se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1667)
        se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:479)
        se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
        se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
        se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1790)
        se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
        se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
        zombie.Lua.Event.trigger(Event.java:81)
        zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:281)
        zombie.gameStates.IngameState.enter(IngameState.java:811)
        zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
        zombie.GameWindow.logic(GameWindow.java:377)
        zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:76)
        zombie.GameWindow.frameStep(GameWindow.java:924)
        zombie.GameWindow.run_ez(GameWindow.java:817)
        zombie.GameWindow.mainThread(GameWindow.java:615)
        java.base/java.lang.Thread.run(Unknown Source)
LOG  : General      f:0, t:1738345755213> -----------------------------------------
STACK TRACE```
Why do I get error?
This is what I have on line 33:

table.insert(VehicleDistributions.PoliceTruckBed["TruckBed"].items, "RE3Gunpowder.ReloadingTool")
table.insert(VehicleDistributions.PoliceTruckBed["TruckBed"].items, 2)```

frank elbow
#

Did you mean .Police["TruckBed"] (or .PoliceState, .PoliceSheriff, .PoliceDetective)? There's a PoliceTruckBed, but it's a table containing items directly

tulip valve
#

I'll try just Police, thanks 🙂

trim quartz
#

Hey all, trying to make sense of this code

ISComboBox is a standard class in the lua, what is this doing?

if ISComboBox.SharedPopup then
    self.popup = ISComboBox.SharedPopup  

Is it setting this for any existing instance of this control globally or just any new instances, or sometghing else?

function ISComboBox:createChildren()
if ISComboBox.SharedPopup then
self.popup = ISComboBox.SharedPopup
else
self.popup = ISComboBoxPopup:new(0, 0, 100, 50)
self.popup:initialise()
self.popup:instantiate()
self.popup:setFont(self.font, 4)
self.popup:setAlwaysOnTop(true)
self.popup.drawBorder = true
self.popup:setCapture(true)
ISComboBox.SharedPopup = self.popup
end
end

#

not seen this done anywhere else in the lua and struggling to make sense of it

frank elbow
# trim quartz Hey all, trying to make sense of this code ISComboBox is a standard class in th...

It's setting it for all instances, but technically just any new instances (so both options are correct). The first ISComboBox created will assign its ISComboBoxPopup to ISComboBox.SharedPopup, so it can effectively be thought to be shared by all instances. The point of it is that only one combobox popup should be visible at one time, so it's just sharing the one instance and changing the values it includes (via ISComboBoxPopup.setComboBox)

#

The "combo box popup" being the dropdown options that show when you click a combo box

#

Also, you can format code blocks on Discord by wrapping them in two sets of ``` (with ```lua on top for Lua-specific formatting). So:

```lua
print("Hello world")
```
Becomes

print("Hello world")
trim quartz
#

Perfect, thank you, appreciate the explantaion

bronze yoke
drifting ore
#

Why doesn’t lemongrass consistently lower food sickness? If the player eats lemongrass, it lowers sickness once, and not again until I reload the world. I am trying to make a custom item that removes a little sickness when consumed with ReduceFoodSickness = 12
Is it necessary to use lua scripting to bypass this?

bright fog
#

My guess is they tried to reduce the above from it or idfk

drifting ore
#

Any item with that stat. I looked up a mod specifically for food sickness and they used lua, so I guess that is the route I'm taking as well

bright fog
#

yup

bronze yoke
rapid flume
#

I know why I could not pick my tiles, I gave all Item (full name) to my sprites/tiles and removing it, leaving blank, solved my pickup problem.
now I don't have a nice display name, but I can pick up my tiles.
just need to retouch the names for better display, I get it now. xD just needed to unlock the pickup function.

tranquil reef
#

anyone know how i'd go about custom animations for specific zombie types?

true plinth
small topaz
#

Not a specific modding question but in B42, has anyone else the problem the character customisation screen in the vanilla game is quite laggy at times? For me, sometimes the character avatar does not appear immediately when the screen is opened and the "Random" button is laggy and unresponsive (becomes better when screen is open for a longer time). Moreover, when I play with all-clothing-unlocked, the screen shows a consistent fps drop (from 60 in default mode to ~50 when all-clothing-unlocked enabled).

bronze yoke
#

i should probably add a way to just pass regular vineflower arguments in anyway

true plinth
#

yeah, and then you can launch PZ with this option :
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
so you can remote debug in live at port 5005, very usefull

bronze yoke
#

i had no idea you could do that, very cool!

#

i'll likely try that out soon

true plinth
#

that's way you can debug with breakpoint, conditional breakpoint, watch expression, etc. (for my part i disassemble with vscode but i debug with intellij)

bronze yoke
#

yeah, that'd be extremely helpful for me, thanks a lot

#

there's something i've been messing around with for a while that just prints a blank stack trace so i've been kind of at a loss for debugging it

true plinth
#

the most difficult part is to find a good java disassembler, most of the time the line of disassembled is not aligned with the .class linetable, so if you put a breakpoint into a "incorrect output", the debugger is "in space" and you're blind.
For example, i linked 2 files from a decompilation of PropertyContainer.class file : a "bad" decompilation with incorrect line number, and a "good" with correct line number.

bronze yoke
#

yeah, i'm pretty certain i've seen an argument in vineflower (which ZomboidDecompiler uses) that maps bytecode lines 1:1, ZomboidDecompiler just doesn't set that argument currently

true plinth
#

thanks for your job and keep going, your mods and your works are wonderfull

#

if you need tools, I've created a little python script to easily decompress .pack files

knotty stone
#

is there no way to use vanilla items in self created vehicle parts? if I want to use itemType = Base.PetrolCan I have to create the item, item PetrolCan1. is there a workaround for that?

hidden compass
true plinth
hidden compass
true plinth
#

well, it seems that UISound always follow position of player :/

   public long playUISound(String var1) {
      GameSound var2 = zombie.GameSounds.getSound(var1);
      if (var2 != null && !var2.clips.isEmpty()) {
         GameSoundClip var3 = var2.getRandomClip();
         long var4 = this.uiEmitter.playClip(var3, null);
         if (var4 != 0L && IsoPlayer.getInstance() != null) {
            if (IsoPlayer.getInstance().getReanimatedCorpse() != null) {
               this.uiEmitter
                  .setPos(
                     IsoPlayer.getInstance().getReanimatedCorpse().getX(),
                     IsoPlayer.getInstance().getReanimatedCorpse().getY(),
                     IsoPlayer.getInstance().getReanimatedCorpse().getZ()
                  );
            } else {
               this.uiEmitter.setPos(IsoPlayer.getInstance().getX(), IsoPlayer.getInstance().getY(), IsoPlayer.getInstance().getZ());
            }
hidden compass
#

Yes, I know. So SoundManager#PlaySound seems to be the right choice for this case, but I am asking for best practices.

   public Audio PlaySound(String var1, boolean var2, float var3) {
      if (GameServer.bServer) {
         return null;
      } else if (IsoWorld.instance == null) {
         return null;
      } else {
         BaseSoundEmitter var4 = IsoWorld.instance.getFreeEmitter();
         var4.setPos(0.0F, 0.0F, 0.0F);
         long var5 = var4.playSound(var1);
         return var5 != 0L ? new FMODAudio(var4) : null;
      }
   }
true plinth
#

So you should probably use

getSoundManager():PlaySound("XXX") 
#

in the ISGameSounds.lua, this method was used :

function ISGameSounds.onPlaySound(args)
    if not MainScreen.instance.inGame then
        getSoundManager():StopMusic()
    end
    local self = args[1]
    local gameSound = args[2].gameSound
--    getSoundManager():PlaySound(gameSound:getName(), false, 1.0)
    self:onStopSound()
    GameSounds.previewSound(gameSound:getName())
    self.previewControl = args[2]
end
hidden compass
#

I am currently using PlaySound and am experiencing a problem. I want to play a sound that is independent of the character's position. 😦

true plinth
#

playSound with the global instance of "getSoundManager()" ?

dull moss
#

then its not heard by others

#

I believe so

hidden compass
hidden compass
# true plinth playSound with the global instance of "getSoundManager()" ?

I think getSoundMangaer():PlaySound(“XXX”) (only String argument) is not defined. I would like to know if its overload, PlaySound(String, boolean, float), is suitable. I see that it is commented out in the ISGameSounds.lua that you taught me. However, the second and third arguments of this method are not used, so it looks like it is not a problem, and it is making me wonder if maybe this method itself is deprecated.

true plinth
true plinth
hidden compass
#

Anyway, thank you all for your replies, as far as I can see from the Java implementation, SoundManager#PlaySound(String, boolean, float) can play “position independent sound”, “sound not heard by other players”, “sound played even in Ghost mode” for the following reasons I think I will use this method because I think it can play those sounds for the following reasons

-- SoundManager.java
   public Audio PlaySound(String var1, boolean var2, float var3) {
      if (GameServer.bServer) {
         return null;
      } else if (IsoWorld.instance == null) {
         return null;
      } else {
         BaseSoundEmitter var4 = IsoWorld.instance.getFreeEmitter();
         var4.setPos(0.0F, 0.0F, 0.0F);
         long var5 = var4.playSound(var1);
         return var5 != 0L ? new FMODAudio(var4) : null;
      }
   }
  1. return null in case of server
  2. fix the emitter position at (0,0,0)
  3. there is no check logic for Ghost mode(0L)

If you have any best practices for sound effects for these uses, please let me know.

frank elbow
hidden compass
bitter scroll
#

Not seeing any getters in GlobalObject that would get me there.

bronze yoke
#

you can't, it's not exposed

vast pier
#

what would I use to check a player's skill? I wanna check the player's maintenance and tailoring skills for a script

fathom dust
#

anyone know how to retrieve the zombs within a short distance of the player?

#

I think you meant this for @vast pier

true plinth
#

sure, sorry, tired 😢

true plinth
# fathom dust anyone know how to retrieve the zombs within a short distance of the player?

you can use something like that :

radius = 10 -- example
x = playerObj:getX()
y = playerObj:getY()
z = playerObj:getZ()
 for _x = x - radius, x + radius do
        for _y = y - radius, y + radius do
            local sq = getCell():getGridSquare(_x, _y, z);
            if sq then
                for i = sq:getMovingObjects():size(), 1, -1 do
                    local movingObject = sq:getMovingObjects():get(i - 1);
                    if instanceof(movingObject , "IsoZombie") then
                        -- Do what you want
                    end
                end
            end
        end
    end
fathom dust
#

ah interesting, so manually checking each space

fading horizon
finite scroll
#

just found out my mod was broken for 5 days and i hadn't even gotten on the update to realize

#

it's so over

#

where are the annoying people yelling in the comments when you need them

finite scroll
#

moodle replacement one, Classic Moodles

#

they fucked with all the file structure for no reason

#

made it take like 4x more storage space for arguably worse effectiveness

jaunty gate
tacit pebble
#

Is there any way to create grayed out options when disable specific option in sandbox?

for example, you only can change specific skill multiplier value when you disable global option.

bronze yoke
#

no

#

vanilla options don't use the same system available to mods so they can do a lot of things we can't

native swift
#

How would I go about making an item that I’m makin in a mod into a container? Like having storage space etc. is it as simple as adding another line in a script?

vast pier
rich reef
#

Hey everyone, I have a question.

I have an object in the world that I would like to click on directly and have it show a context menu with any recipes it may work for, similar to how you can do so in an inventory window and right clicking an item>action.

Is this possible?

I have figured out how to make a context menu and run a function from that previously, but not sure how to show the available recipes for the item.

For reference, the item is a machine/workbench type of item. Please let me know if anyone can give some help, thanks!

fathom dust
#

Is there a quick summary of the cell/grid/square relationship?

bronze yoke
#

cell: 256x256 square area (300x300 in b41) made up of 8x8 square (10x10 in b41) chunks

#

the isocell object has nothing to do with an actual cell, it is just the entire currently loaded area, any functions that return one return the same one (there is only ever one)

fathom dust
#

okay so the 8x8 chunks are represented by IsoGridSquare?

#

offhand IsoGridSquare looks like an individual space (i.e. player-sized space)

bronze yoke
#

a chunk is an 8x8 square area

fathom dust
#

oh there's an IsoChunk too okay i see that now

#

thank you

silent zealot
#

Would it be inappropriate to make a mod that plays "Pumped up Kicks" when you enter a school?

silent zealot
#

I assume that is a property of the worlditem, but if not have a look at hose they do the context menu -> crafting menu code for those.

rapid flume
# rich reef Hey everyone, I have a question. I have an object in the world that I would lik...

My mod need this otherwise, player would have to pickup the tile to craft recipe.... I looked into it.
I think we need to make a MULTIBUILD recipe (like chairs(no sure actually) but like walls for sure, you can upgrade with context menu and you can't pickup the wall) not the inventory recipe

or use workbench function (I have not yet tried to work with this, I have just tried once and nothing.... dunno if you can make any tile a workbench and if you did, how would you make it appear as source item for the recipe ? i know we can use lua Recipe.OnCreate to remove/destroy the tile or object source and replace it with the result)

In inventory, the context menu auto shows recipe available for crafting, no need to create those function with standard "inventory" recipe..
Although, with canBeDoneFromFloor, only items are sourced, I have not been able to source a tile from floor(placed), I rly need to pick it up.

crisp fossil
#

is it possible to edit these values in game?

silent zealot
#

Oh wait those might not work - mutlilien sub-section thingies

#

Try this from Very Salty Oreos:

#

local item = ScriptManager.instance:getItem("PipeBomb")
if item then
item:Load(item:getName(),
[[{
MaxRange = 10,
ExplosionPower = 0,
MaxDamage = 60,
ExtraDamage = 150,
AttachmentType = Hammer,

}]])

end

crisp fossil
#

Sorry I mean I want to tinker the values in game. Every time I need to change the values I had to reload

silent zealot
#

That seems to be a way to load bits of script over the existing script, and hace multiline support, so may do what you need.

silent zealot
crisp fossil
#

I see. I thought there's a debug feature that I can manually change the values so I can just copy it to my txt file

thorn abyss
#

hi I'm totally new to modding this game so sry if I ask rlly stupid questions

#

is there a way to get a players limb/bone location in world space?

silent zealot
#

I don't think so, but if you can explain what you need that info for someone may have a suggestion on how to do it.

thorn abyss
#

I'd like to add player/zombie footprints on snowy grounds

#

obv I need the players feet location for that :/

silent zealot
#

Nice idea. No idea if there's going to be any practical way to do it.

#

Also, if you do it for zombies as well it's going to be a lot of footprints.

thorn abyss
#

they would all vanish overtime

silent zealot
fathom dust
#

I'm having trouble identifying the code for knocking a zombie back. I've found combat code and damage code and I see variables like isStaggerBack being set to true in certain circumstances but I can't find the code that actually moves the zombie back

vast pier
ornate sand
#

When I was making my mod that inserts all the skillbooks into every bookshelf I had to remind myself "oh yeah, no Aiming books in schools".
Could've been an oopsie.

vast pier
ornate sand
#

I'd say that would be in bad taste, for obvious reasons.
Might as well put AR-15s into school lockers. Same reason as to why not.

vast pier
#

Smh.
Though finding an aiming 4/5 book in a school locker might turn some heads, I feel like aiming 1/2 could be reasonably explained to show up in a school library

ornate sand
#

Aiming books aren't all that rare because they spawn at gunstores, police stations, military spots, etc.
I've never not found Aiming 3-4-5

vast pier
#

Yeah but 1/2

ornate sand
#

Don't even need the books for those 1-4 levels. Just score hits. 😄

vast pier
#

Uses less ammo if you got em tho

vast pier
#

Or a pistol?

#

Something a kid would reasonably be able to access in 90s Kentucky due to neglectful parents

ornate sand
#

I'll not partake in this discussion 🙂

vast pier
#

😔

vast pier
ornate sand
#

But I might as well give some extra spawn chances for the Aiming and Reloading books in gunstores, PDs and stuff now that I think about it. To the endless to-do list it goes.

ornate sand
vast pier
#

I still feel like library wise it would make sense to have an archery book

vast pier
#

I could be wrong but I’ve always used AStompNerfMod to accomplish that function.
Maybe the mod is old enough to be redundant?

ornate sand
#

Back in B41.78 I remember my military boots or just boots always losing Condition and I thought it'd be because of me stomping.
Why else would they? Passive Condition loss from running?

vast pier
#

I think shrubbery too?

ornate sand
#

Lol, I have never in my 2700 hours been bitten in the boot

vast pier
#

I have. It’s an embarrassing way to die

#

Fence zombie lunges can damage your boots i think

vast pier
silent zealot
#

Doesn't mean it's an appropriate thing to add in 2024 though

ornate sand
silent zealot
#

Even if it is historically accurate.

#

Yeah

#

Oh yeah it's 2025 now

ornate sand
#

Ikr

silent zealot
#

I feel I'm still trying to get a handle on the start of 2020

ornate sand
#

20 years ago was the 80s and you can't change my mind

vast pier
#

Roleplay context > Modern context

#

I would rather appeal to the realism of the time the game is set in, instead of letting modern taboos hold back content/concepts

ornate sand
#

Feel free to mod it in then. 😄
Those would be simple as a handful of table.inserts

vast pier
#

Does the school library not spawn aiming books currently?

ornate sand
#

Universities may, I'm not sure. Bookstores do.

silent zealot
ornate sand
#

Some youngling: "How old are you?"
Me: "Yes"

silent zealot
#

How many people here learned to program using BASIC?

ornate sand
#

What is "learned to program"?

silent zealot
#

😂

ornate sand
#

I make cubes and cylinders in Blender and then twist 'em around until they sorta look like guns and then I type some text.
That is all. 😄

vast pier
#

Self taught people are so funny cuz they’ll just do shit until it works right and then people will ask what tutorials were used

#

Tutorial? What’s that??

#

It’s me, im self taught people.

ornate sand
#

I mean this is literally that. I stared at an M60 on my other monitor and made cubes and cylinders.
I was so proud after I managed to put those rounds at the feed too lol

silent zealot
#

I should learn basic texturing in blender.

#

I can do a lot with 3D shapes due to 3D printing, but never looked into textures since those are useless for things you will 3D print and paint.

vast pier
#

So when are we getting a random chance for a home to have tainted water in the plumbing due to lead pipes? 😎

silent zealot
silent zealot
vast pier
#

/j I know it’s important for jobs

silent zealot
#

You could make a mod that does nothing, say it implements cancer from smoking and no one will live long enough to know it's a scam.

silent zealot
vast pier
ornate sand
silent zealot
#

Since I dropped out of engineering and got a job I have never been tasked with "solve these short unrelated problems without talking to any colleges or accessing any reference material" but that's what uni based grades on.

silent zealot
#

Nicotine poisoning though....

vast pier
spring jasper
vast pier
#

Spongie is just playing the long con. Soon their clothing will eat the player

ornate sand
#

And I'll introduce catastrophic failures to my guns.
Imagine being out there just sniping at a few zombies with your 7.62x51 sniper and KABLOOEY

#

Like that time when Kentucky Ballistics had a .50 BMG literally explode into his neck and chest

#

Don't trust cheap self-reloaded surplus ammo that's 20 years old

vast pier
#

Me when i trust cheap self-reloaded surplus ammo that’s 20 years old

silent zealot
#

Was all very stupid

vast pier
#

Oml thats so childish

ornate sand
vast pier
#

Minecraft modpacks aren’t what zomboid players refer to as modpacks

silent zealot
#

Yeah, that's a valid complaint but actively destroying saves isn't the right response

ornate sand
#

Ah. Well I haven't played MineCraft mp so I wouldn't know. But yeah.

vast pier
#

Minecraft modpacks are usually more like workshop collections, not reuploads of mods crammed into one mod file

#

It’s like if you got mad your mod was added into a collection pack

#

That’s the equivalent

ornate sand
#

That makes more sense. Yeah then the dev was just being a brat

vast pier
#

100%

vast pier
silent zealot
#

I'm pretty sure that happened to some people

vast pier
#

Hit by the crossfire for no reason

thorn abyss
#

at least I got snow detection done rn

vast pier
#

Would it be possible to add in new padding/patch materials? or is that java side

thorn abyss
#

this is confusing me, if I understand this right, instead of returning the vec3 it wants to store it in a var?

vast pier
rugged dome
#

hello im salvatore producer, I Want to Add My Own Music to Project Zomboid Version B42.2 as the Main Melody creating a Mod. How Do I Start? Can Someone Provide a Link or Explain the Folder Structure and Where to Test the Mod? This Is My First Mod.

#

my current structure looks like this, but at startup it is not displayed in the mod menu of project z SalvatoreColor/
│── media/
│ ├── sound/
│ │ ├── Future_Days.ogg
│ ├── lua/
│ │ ├── client/
│ │ │ ├── SalvatoreColorMusic.lua
│── mod.info
│── poster.png

#

C:\Users\abc\Zomboid\mods\SalvatoreColor

jaunty marten
umbral raptor
#

does anyone know how to make a recipe not lose items stored in container when being crafted from one container to another?

winter bolt
umbral raptor
#

im trying to make a carrier vest that can changed colors

#

but when i try crafting one form into another it causes loss of inventory

#

is there any way this can be prevented and all items transferred to the new vest?

#

at-least an option to empty the container before crafting

#

or smthing

silent zealot
# winter bolt im assuming its hardcoded in java

From memory there's a field in clothing objects for cotton/denim/leather, but you'd need to test what happens if you make up a new value (or at least look in the lua for how that property gets used)

#

Might work, but might also crash the game when the parser is confused or if it's an enum in java

thorn abyss
#

ofc this is only in SwipeStatePlayer

silent zealot
vast pier
silent zealot
#

good news: I have found exactly where.

#

Bad news:

vast pier
#

Nestled in java?

#

Think it's possible to create a new value outside of java?

silent zealot
#

That is for tailoring patches though

vast pier
silent zealot
#

Actually that makes sense - before tailoring 8 you get just the patch, ater 8 you repair and use the base objects's protection

vast pier
#

I'm pretty sure the values are also used for padding so

vast pier
silent zealot
#

Interestingly the fabric typoe is stored as a string.

#

Or maybe an int... so it's possibel it won't crash if you add a new type, but it's not going to work properly.

round thorn
#

So last night I was talking about modded cars spawning at prestine condition and fuel, even though settings are setup to only spawn very low condition, apparently the issue is that if the modded vehicles dont have a wrecked version, and the system want to spawn one, it spawns a prestine version 😐 PZK VLC is doing this to me.

silent zealot
#

Does it apply to burnt versiosn too, or just wrecked?

jaunty marten
umbral raptor
jaunty marten
round thorn
umbral raptor
#

im not that good with lua tbh

round thorn
umbral raptor
#

yeah, scripts were super ez to figure out

#

i could pretty much do everything related to the scripts file

#

but lua fries my brain. i understand what it's trying to do, but idk where/how the commands come from

#

like is there commands/code specific to PZ or is it normal lua?

#

im so confused bout it

lethal dawn
#

Is there a way to add custom clothing to existing zombie outfits or do I have to make all my own?

jaunty marten
# umbral raptor im not that good with lua tbh

try this
p.s. rename Recipe.OnCreate.ChangeContainerStyle to Recipe.OnCreate.KeepItemsInContainer

function Recipe.OnCreate.KeepItemsInContainer(items, newContainer, player)
  local currentContainer = items:get(0)

  local newContainerInventory = newContainer:getInventory()

  local currentContainerItems = currentContainer:getInventory():getItems()
  for i = 0, currentContainerItems:size() - 1 do
    local item = currentContainerItems:get(i)

    newContainerInventory:AddItem(item)
  end
end
umbral raptor
#

testing it rn

thorn abyss
#

is CombatManager.getBoneWorldPos accessible in lua?

winter bolt
# umbral raptor does anyone know how to make a recipe not lose items stored in container when be...
local visual = item:getVisual()
--    local newItem = instanceItem(itemType)
    local newVisual = newItem:getVisual()
    newVisual:setTint(visual:getTint(item:getClothingItem()))
    newVisual:setBaseTexture(visual:getBaseTexture())
    newVisual:setTextureChoice(visual:getTextureChoice())
    newVisual:setDecal(visual:getDecal(item:getClothingItem()))
    if newItem:IsInventoryContainer() and item:IsInventoryContainer() then
        newItem:getItemContainer():setItems(item:getItemContainer():getItems())
        -- Handle renamed bag
        if item:getName() ~= item:getScriptItem():getDisplayName() then
            newItem:setName(item:getName())
        end
    end
--    newItem:setDirtyness(item:getDirtyness())
--    newItem:setTexture(item:getTexture())
    newItem:setColor(item:getColor())
    newVisual:copyDirt(visual)
    newVisual:copyBlood(visual)
    newVisual:copyHoles(visual)
    newVisual:copyPatches(visual)
    if newItem:IsClothing() then
        item:copyPatchesTo(newItem)
        newItem:setWetness(item:getWetness())
    end
    if instanceof(newItem, "AlarmClockClothing") and instanceof(item, "AlarmClockClothing") then
        newItem:setAlarmSet(item:isAlarmSet())
        newItem:setHour(item:getHour())
        newItem:setMinute(item:getMinute())
        newItem:syncAlarmClock()
        -- Network stuff
        -- FIXME: is this done when dropping the watch?
        item:setAlarmSet(false)
        item:syncAlarmClock()
    end
    if newItem:getFluidContainer() and item:getFluidContainer() then
       newItem:getFluidContainer():copyFluidsFrom(item:getFluidContainer())
    end
    newItem:setCondition(item:getCondition())
    newItem:setFavorite(item:isFavorite())
    if item:hasModData() then
        newItem:copyModData(item:getModData())
    end
    newItem:synchWithVisual()

this is the code the vanilla game uses for this when using clothing extra actions so you can copy it to your own function and then use it for the recipe

#

im not sure how the current recipe functions work but you'd have to grab the original item from the recipe inputs at the start

#

the container part is here but the rest is normal clothing stuff