#mod_development

1 messages · Page 354 of 1

queen oasis
#

and how did I end up here? I thought I was in another channel drunk

bright fog
queen oasis
bright fog
#

:o

glossy mist
#

MMMMM

ho do u not make ur guy point a reolver at his head

#

ded been trying to fix CJ firearm since 25 hours ago

topaz tangle
bright fog
shy mantle
#

Has anyone made a cooking use for animal blood yet? Blood sausage, blood bread, the sorts? This is such a random ask, but I just had some blood bread (which I haven't in a while) and I thought about how PZ blood has no use.

#

Or does anyone know if blood is getting an update in B42 to have some use at all lol

bronze yoke
#

presumably it exists for a reason but i haven't heard anything

thin swan
#

Oh man I could go for some blood pudding with lingonberry jam and bacon right about now, haven't had it in like a decade but that shit slaps

willow tulip
#

(feel like = 50/50 chance my memory is incorrect)

topaz tangle
#

ive just had a crazy idea for if engines using different fuel types gets figured out for b42

willow tulip
topaz tangle
#

i think it wouldnt be too difficult if ill be honest, id like to figure it out sometime but not today

icy night
#

There's a mod for it in 41 I think. Treads Fuel Types or something

topaz tangle
distant fractal
#

how difficult would it be to make a mod that hides items that are attached on the player's hotbar from showing on their in-game playermodel?

#

or allows players to hide specific hotbar slots?

sour island
distant fractal
#

does it work for modded items? and where can i find that mod

#

like what's it called

bright fog
#

Transmog

distant fractal
#

i have transmog but I've tried hiding attached items and it doesn't work

bright fog
sour island
#

True, but that mod could help

distant fractal
#

so there isn't a mod that does that

sour island
#

Not exactly

bright fog
#

Pretty sure attached items don't use item visuals

sour island
#

I worked on transMog, worn items and attached item visuals are independent lists but identical in function

#

You should be able to do the same remove - update - add (don't update) trick

sour island
# distant fractal ?

The visuals for items are held in a list - for transMog you remove a visual and call the update - but the systems needs to still functionally have the visual present so it's readded but not updated

distant fractal
sour island
distant fractal
#

sick

#

and the mods are in what language?

#

this'd be my first time doing any sort of modding for any game

thin swan
willow tulip
rich reef
#

Does anyone know of a simple OnTest or OnCanPerform function that checks if the recipe item is on the ground?

rich reef
#

I've used this to make it work

function OnCanPerform_ItemOnGround(recipe, player, item)
    
        if not item:isInPlayerInventory() then
            if item:getType() == "CustomBox" then
                    print("Found Custom Box")
                return true
            end            
        end
end

But this spams the check non-stop across the debug console. Is there a way to check for the item once and not constantly re-check?

Right clicking on another item in the recipe then throws an error if it's in my inventory.

bronze yoke
#

because you don't return anything if it's in your inventory

rich reef
#

Ahh.. Stupid oversight.. lol

#

I accidently removed that line once I got it working, forgot to re-add it.

#

I'm basically trying to 'box up' some simple items in the game with this code. I just want to check that a box is on the ground near the player instead of their inventory, solely for visual reasons.

OnCanPerform seems to cause Crafting Menu / CraftHelper to fail as well. Maybe I'm not doing things right.

It still constantly checks during the entire action, spamming print statements hundreds of times. Is that how OnCanPerform works?

Maybe OnTest would be better to use? Do I have to iterate through all items, and just check if that box item is found and then do a check for it prior to doing the action?

rich reef
#

I seemed to have figured it out. OnTest works much better for this, and functions like I'd expect.

But, when using debug print statements, during the entire Timed Action/Recipe, it spams that debug constantly. Is this normal behavior for all recipes? I'm just wanting to be sure it doesn't lag or cause issues.

bronze yoke
#

yeah that's normal

willow tulip
#

But thankfully people can only do 1 ontimed action at a time, and they are generally very busy doing them so controls/FPS don't matter so much

rich reef
#

Thank you! Glad to know it's working as intended. Appreciate the help!

glass cloud
#

Hi everyone. I’m new to this server so I’m not sure if this is the right place to post it, but I’ve been working on a mod for PZ and have been tracking the progress through videos.

The TLDR is I use some of the event hooks to track the characters actions, feed it to a local LLM which generates a diary entry through the survivors lens, then add the note to the inventory.

If this is something that interests you all, and it’s not against the rules, I’d be happy to post a link to the channel

willow tulip
glass cloud
#

AWARE - Project Zomboid AI Mod
https://youtu.be/ZmwgJQmCqfc
here is the link for those interested.

The purpose of this video is to showcase the initial inception and playthrough of AWARE.

AWARE is a Project Zomboid mod intended to give the player insight into the characters thoughts and feelings. The characters actions are logged throughout the day, and upon awaking the character recollects the previous day.

I will try to post at least once...

▶ Play video
glass cloud
#

It’s definitely in a very early stage, as you’ll see there’s a lot of tweaking to be done and I’m already started to build out a separate UI for it. But the point of the channel is to track the process

finite scroll
#

how do I get specifically this parameter of a HandWeapon in lua? the javadocs tell me I can check the AmmoBox parameter with getAmmoBox() but I couldn't find an equivalent for AmmoType

knotty stone
finite scroll
#

it's funny there's not just a normal way to do that but there is for the AmmoBox lol

#

AmmoBox seems like it would be used way less often

finite scroll
bright fog
bright fog
#

Do a ctrl + F search of keywords on the JavaDocs pages

delicate solar
#

Hey, please i have a question... i want to start a world sound using an emitter created with world:getFreeEmitter(x,y,z) (play sound is ok for all players around).
When i call emitter:stopSound(soundID) the sound stops correctly client-side, but other nearby players still hear it.
What is the correct way to start and stop sound on x,y,z ? 😢

#

should i :
[Client UI] sendClientCommand >> [Server] stop sound, then broadcast Stop command >> [Clients] stop the sound locally

finite scroll
#

does anyone know of somewhere i could see a list of the current timed actions?

#

from what i can see they seem to be scattered among the game's lua

thin swan
# finite scroll does anyone know of somewhere i could see a list of the current timed actions?

I'm pretty sure they're all in folders named TimedActions, so a bunch are in lua\shared\TimedActions, some are in lua\shared\BuildingObjects\TimedActions etc.
So just do a search for folders named TimedActions and you should find at least like 99% of them. I don't think there's like a compiled list of them all anywhere, but maybe @bright fog would know if something like that is on the wiki somewhere?

thin swan
finite scroll
bright fog
#

I'll work on that like the UI guide once I finish work on the horse mod Horse_AQHP

small osprey
#

You are the best Sim 🫶

willow tulip
silent zealot
bronze yoke
#

you could scan for calls to ISBaseTimedAction:derive()

willow tulip
#

What do you guys think, improvement over vanilla engine sounds?

willow tulip
#

Thanks. It should also support mods adding their own vehicle sounds without .bank files

topaz tangle
#

yea i wanna learn how to do sound stuffs one of these days for airbrakes

#

We got fire trucks !!!

#

The longer ones are new, shorted ones are the old ones

bright fog
bright fog
#

I have a mod called WikiTools

delicate solar
frank slate
#

Just had an idea for a mod. It could be done in b41, and in b42 when multiplayer releases:

Being close to another player who is dirty or bloody increases your unhappiness.

Incentivize bathing!

frank slate
topaz tangle
frank slate
#

pumper truck that lets you knockback zombie hordes with the water cannon would be cool too

#

once

topaz tangle
frank slate
#

Apply the push mechanic to all the zombies it hits, perhaps. Wouldn't kill them but it might make handling a horde easier in MP if someone used a water cannon while others used melee weapons.

#

of course, useless in single player

subtle rover
#
player:PerformAnimAction(IsoAnim.Loot)

this animation is correct or i am wrong? didn't know how to execute animation on vanilla game

silver delta
#

mod idea! change floors with sheet rope. like scaling a skyscraper from the outside by going from floor to floor using sheet rope, where you need to escape a situation without going to the ground

bright fog
subtle rover
bright fog
#

I must say what I think it is bcs I'm fairly certain this is what it is, but that's just AI code

subtle rover
bright fog
frank elbow
#

AI cannot generate Project Zomboid mods. There is, to my knowledge, no AI out there that will generate a correctly working Project Zomboid mod (using an LLM or otherwise). Use AI if you want, I do not care, but bear in mind that if you use it for PZ modding you'll be generating worse than useless code

subtle rover
# bright fog Do you know what a wrapper is ?

yep, i know what it is. AI generated that like "tryin' to guess" or explain to me. That's why im asking here because i feel ignorant about how to make execute animations on vanilla. Not sure if this the correct thread to talk about this too, i already check that url to gettin' start at modding

subtle rover
bright fog
#

What animation are you trying to trigger exactly ?

subtle rover
#

when you took a book

#

or the one when you loot on the floor

bright fog
subtle rover
subtle rover
bright fog
#

If you check some of the vanilla animations, you'll see functions used to set the timed action animation

#

Takes a string in input which refers to a timed action scripts

rich reef
#

Does anyone know where I can locate the files/scripts for items that are built with the Masonry, Metalworking, or Carpentry modes? Trying to change some of them is possible, and cannot find where they are located at.

Also, does anyone know where to find the 'Dissassemble' recipes/result items for the same items, or other moveables?

Thanks!

true nova
noble summit
#

can someone show me the way to remove bits from item code without overriding it completely?
i know how to edit stuff via lua but id like to remove the durability mechanics from the homemade metal helmets
dunno how to properly remove the ConditionMax and ConditionLowerChanceOneIn

tranquil kindle
noble summit
#

uhuh
i want it to work the same way other 100/100 helms work

tranquil kindle
#

Can you elaborate on that?

#

I assume were talking B42

noble summit
#

as far as i know, the helmets in general cant be damaged (at least in b41, didnt have a head wound in b42 yet)
worst case scenario some helmets can fall off exposing you
the metal and scrap metal helmets however have durability mechanics and will get damaged every time they block a hit and can eventually break

tranquil kindle
#

In b41 helmet took one bite and that was it, it was unequiped and while you could wear it again, it no longer protected you

#

Or it could fall of depending on helmet

#

B42 armor however has protection BUT also conditon and as long as it has condition it will keep protecting you

#

So it can take multiple bites, i assume even in same area, where B41 if you got bit in lets say Upper chest having bulletproof vest, it made hole there and next bite in that area would go through

#

I haven't yet tested fully B42 armor as i'm not really armor user myself, but i belive thats how it works

#

Overall armor is alot better in 42 than in 41

#

So overall Helmets can be damaged, but you can do them Not Damagable in B41 by adding "CanHaveHoles = False," or something like that

#

It will keep protecting head and if you remove chance to fall, that should make it so head is always protected

#

If defense is set to 100 though

noble summit
#

most helmets have the CanHaveHoles = False by default, but homemade metal ones dont
i can add this code but i dont know how to remove the durability mechanic from the helmets without overriding the entire code bit

tranquil kindle
finite scroll
#

i cannot count the amount of times i've spent like a full hour or two trying to figure out what could possibly be causing errors and it turns out a function i thought returned an array was actually giving me an ArrayList

#

it's like TIS has an obsession with them 😭

finite scroll
#

and your console fills with errors in practically unrelated parts of the code

#

anyways i don't like ArrayLists that's my tedtalk

bronze yoke
#

what do you mean when you say 'array'? lua can't even interact with java arrays

finite scroll
#

which honestly i don't even know how they've done that because i don't think lua has ArrayLists

#

but they're definitely returning them

#

and i have to use :toArray() to convert them to normal arrays

bronze yoke
#

you need to keep in mind that this game doesn't have much 'lua api', it has java api that lua can access

#

they use arraylists because that's what makes sense to use in java

finite scroll
bronze yoke
finite scroll
#

i get zero warnings or anything for my code i've just been going by the ingame console and error thing

#

i really ought to install a proper IDE

#

hah i think i fixed it with some shenanigans

rich reef
bright fog
finite scroll
#

does anyone know what this weapon parameter (found it on a gun, but maybe it's compatible with melee as well) does? it doesn't seem to be listed on the wiki

finite scroll
bright fog
cursive veldt
#

Im making a mod

Ever get tired when you make a 2nd character on solo play your 1rst character is nowhere to be found?

Well im making a mod where when you make a new chracter
It gets tomeet and team up with your first or other characters in game.

cursive veldt
cursive veldt
bright fog
#

Use only one

cursive veldt
bright fog
cursive veldt
bright fog
#

Bandits has friendly NPCs, Superb has hostile NPCs

#

So that doesn't make any sense

cursive veldt
bright fog
#

Which one I prefer you'd use ?

#

I mean that's your choice, i'm personally of the thought that Bandits is way better and way more up to date

bright fog
#

That's your first mod ?

cursive veldt
#

Now

frank elbow
# cursive veldt Yes brb gnna test it nlw

This is not to discourage, but so you can temper your expectations for your first modding experience: currently, since NPCs are not in vanilla, mod implementations are necessarily complex (clunky might be an appropriate descriptor, too). It will likely not be a very straightforward experience

icy night
#

Anyone know how I can change the damage dealt to zombies, as it's being dealt?

bright fog
fleet bridge
bright fog
#

A cheese

#

But might be a decent one

fleet bridge
bright fog
#

Actually

bright fog
#

That means you can't adjust to per target

#

So nevermind that doesn't sound like a decent cheese

fleet bridge
#

Not sure what they're trying to do so shrug

#

If it's on an individual basis then no

bright fog
#

Usually you want to do that for custom zombies

fleet bridge
#

Suppose that is true

glossy mist
#

does anyone know how to upload files to workshop? like, i know to set up the Contents/ folder in the workshop folder, but after stuffing my mods in it's still having error

#

what am i doing wrong

bright fog
glossy mist
bright fog
#

Your additionnals folder should not be in your mod folder

bright fog
#

It's easy to fix, just put it in your cj_vfe folder

#

The problem is that this folder where it's placed currently will get uploaded in your mod, and you really don't want that

#

Also that's a cool folder view, is that Mac or Linux ?

#

I'd say mac ?

glossy mist
#

also it's still giving me error

bright fog
#

What error ?

#

If you want us to help you need to tell us what error you're getting

glossy mist
bright fog
#

Can you show the error ? And where does it say that ?

#

Make sure you don't have hidden files in the Contents folder

glossy mist
#

and this is the current strcture of the folder

bright fog
#

You have an invisible file in there most likely

#

idk how it works on Mac tho to show invisible files

#

Try CTRL + H or whatever the equivalent could be

glossy mist
bright fog
#

Just show invisible files

glossy mist
bright fog
#

bruh

#

well look it up then I guess

bronze yoke
#

yeah mac adds some stupid invisible crap to every folder

#

i don't remember how to get rid of it

glossy mist
#

also i am just gonna nuke the content folder and redo it

bright fog
glossy mist
#

the game still think that i am doing something illegal

#

and giving me the unreconizeable content thing

bright fog
#

Look into what albion said

#

Mac adds invisible files in every folders

#

So you need to look into deleting those

glossy mist
#

like, also used termnial to check as well

bright fog
#

There is tho, the game doesn't lie

glossy mist
#

litterary nothing in there

#

makes me wonder if pz just doesn't like mac os uploads

bright fog
#

Do a Discord search to find if others got the problem

#

If that's the case then results will show up about this exact issue

glossy mist
bright fog
#

Did you search here for messages on the subject

glossy mist
#

already reported this as a bug, let's see what indie stone gotta say

#

probabbly because no one is coding + modding on a mac

bright fog
glossy mist
#

i am going to try sending the file to my window laptop, hopefully that thing opens up

glossy mist
bright fog
bright fog
glossy mist
upbeat turtle
# glossy mist does anyone know how to upload files to workshop? like, i know to set up the Con...

hiya! to fix this, it will require a very specific command in your terminal. Mac creates these files whenever you view a folder’s contents in Finder.
… I do my dev work primarily on mac and this is one of its annoying quirks 😭
find /Users/YOURNAME/Zomboid/Workshop/YOURMODFOLDER -name '.DS_Store' -type f -delete
^^ be sure to replace “YOURNAME” with your username & “YOURMODFOLDER” w/your mod folder.
… keep in mind, if you run the command and then go and make edits to the mod, you’ll likely need to run it again before being able to publish. I hope this helps! 🙂

upbeat turtle
#

happy to help! i’m glad it worked for you 🥳

glossy mist
#

although, my friend said that he did not see any of the .DS_store files on his end when i sent him the mod

upbeat turtle
#

so long as the output didn’t return anything like “no files found at this path”, it should’ve cleared them up. but yeah, this is one of the weird things about mac Xd

glossy mist
glossy mist
upbeat turtle
#

ooh, that sounds super interesting! I’d totally be down to collab, feel free to shoot me a dm 😄
as for me, my main focus has been on animals. i’m about 500 hours into my current project. developing my own custom api for animals from the ground up, and a few mods to go with it xd

glossy mist
shy mantle
#

Chat, what is this guy talking about drunk

upbeat turtle
glossy mist
spring iron
upbeat turtle
#

his name is Muggy and he wants your coffee cups 😆

spring iron
upbeat turtle
#

it’s possible ngl 😂

spring iron
#

lol couild you make the librety prime bot? lollll

#

gosh this games modding scene is so awesomeee

upbeat turtle
#

chances are we’ll be focusing on the earlier fallout games first

spring iron
#

oh yea- sounds right

upbeat turtle
#

but tbh so much is possible with the animals system

spring iron
#

fr

upbeat turtle
#

our api also fills in a lot of the gaps where they’re missing stuff at the moment. once it’s to a point where we like it, planning on releasing it to the community so folks can go wild with their own custom animals 😆

spring iron
#

lol. wait are there like hostile animals? because that could be great

#

im not that up to date on b42

bronze yoke
#

there aren't

spring iron
#

awwww

upbeat turtle
#

custom animals can spawn naturally in the wild as well

spring iron
upbeat turtle
#

we’re planning on having them be extremely rare just like fallout… but like the older games if you see one you’re pretty much dead lol😭

spring iron
#

can u kill em? lol

upbeat turtle
#

they are indeed killable, extremely tanky though 😆

#

guns are probably the only way you’d survive that encounter Xd

#

or if you have a car mayhaps

spring iron
#

lol. ooo how easy do you think Rads would be to mod in?

upbeat turtle
#

hm in theory, it shouldn’t be too insanely difficult to implement. I’ve played a few mp servers back in b41 which had rads systems. for pre-defined zones it would be easier to make I think.
however if we’re talking more explorative modding, it would be super cool to see dynamic weather using a rads system

#

like random radiation storms for example xd

spring iron
#

REAL like the rainwater you collect in buckets being radiation filled because the storm was a rad storm

upbeat turtle
#

fr fr!!

#

that would really give another layer of depth to longterm survival playthroughs

spring iron
#

or if its a radstorm you cant go out into wet areas without mustiple layers on

spring iron
#

and then youd have to try like cure your radiation poisoning?

#

or suffer the effects?

#

sorry im excited at the idea, it sounds so sickkkk

upbeat turtle
#

it sounds like absolute cinema, lol😆

#

what’s so much fun with lua is it’s super flexible with what we can create modding-wise. anything which isn’t privated in the java code is accessible xd

spring iron
quartz ibex
bronze yoke
#

you can add new genes, but any effects will have to be implemented by you, there isn't a system for them

muted garnet
#

B42, why my items with Type = Normal, has a weight of 0.0 and has no condition, although I added it

bronze yoke
#

you need a name translation

muted garnet
#

thanks

willow tulip
#

I hate 'hidden' flags...

bright fog
#

Private fields are accessible, and a class needs to be manually exposed to be usage Lua side

#

I've just made a video about the suggest, I suggest you go watch it

#

This guide explains how the Lua is able to communicate with the Java, how to use this behavior for your mods, and how to set up a basic Lua mod structure. It will also teach you how to use the JavaDocs, LuaDocs, how to search the game files and decompiled code to find what you're looking for, and also searching Lua events to implement specific b...

▶ Play video
bright fog
#

I worked on addons for such a mod, check out Hazardous Zones

bright fog
bright fog
rough veldt
#

who can create a mod for me (i pay)

sour island
flint hinge
#

Hey y'all, does anyone know how to parse and modify apop data? Not much info on it, but I figured out the files are separated into chunks and found the chunk with my animal. I can see most of the data in plain-readable text, but I'm unsure how the file is actually structured. My goal is to transfer one animal to another save.

flint hinge
#

the files in the apop folder

#

has animal info afaik

bright fog
#

Idk what that is then sry shrugs

tardy mural
#

Has anyone any idea why no models are shown for my two new items when placed on the ground?

This is from the console.txt:

ModelScript.check                   > no such model "SurvivalFix.model_IronKnuckle" for SurvivalFix.IronKnuckle```

This is my model skript:
```module SurvivalFix
{
    imports 
    {
        Base
    }

    model model_IronKnuckle {
        mesh = WorldItems/mesh_IronKnuckle,
        texture WorldItems/texture_IronKnuckle,
        scale = 0.5,
    }
    
    model model_FlintAndSteel {
        mesh = WorldItems/mesh_FlintAndSteel,
        texture = WorldItems/texture_FlintAndSteel,
        scale = 0.6,
    }
} ```
bright fog
#

What are the model file paths and what is your item script ?

tardy mural
#

Item skript:```
module SurvivalFix
{
imports
{
Base
}

item IronKnuckle
{
    DisplayCategory = Material,
    Type = Normal,
    Weight = 0.4,
    Icon = IronKnuckle,
    StaticModel = SurvivalFix.model_IronKnuckle,
    WorldStaticModel = SurvivalFix.model_IronKnuckle,
    SurvivalGear = true,
}

item FlintAndSteel
{
    DisplayCategory = FireSource,
    Type = Drainable,
    Weight = 1.0,
    WeightEmpty = 0.2,
    Icon = FlintAndSteel,
    UseDelta = 0.25,
    ReplaceOnDeplete = SurvivalFix.IronKnuckle,
    //ReplaceOnDeplete = Base.SharpedStone,
    StaticModel = SurvivalFix.model_FlintAndSteel,
    WorldStaticModel = SurvivalFix.model_FlintAndSteel,
    Tags = StartFire;LessFull;Lighter,
    SurvivalGear = true,
}

}```

#

The textures are in common/media/teaxtures/WorldItems
The meshs are in common/media/models_X/WorldItems

#

All scripts are in 42/media/scripts

bright fog
tardy mural
#

Yes that is a typo, the folder is of course named "textures"

bronze yoke
#

/* comment */ block comments only

tardy mural
#

The file names are texture_FlintAndSteel.png, texture_IronKnuckle.png and mesh_FlintAndSteel.FBX, mesh_IronKnuckle.FBX

tardy mural
#

Update: it sadly didn't change anything. Both models of both items are still not displayed correctly.

#

(Also there is another issue with the flint and steel having 0 encumbrance, that sadly also didn't change. And yes I do have translations for both items. That at least fixed the 0 encumbrance for the fire striker (iron knuckle))

violet glade
#

How do i get the simplest mod possible that i am trying to test show up in game? The mod.info is right but nothing shows up

sterile mauve
#

Hi! I'm working on a mod for Build 42 and need to check if global electricity is shut off in the world.

In Build 41, I could use world:isElecShutOff(), but this method doesn't exist in Build 42
I've tried square:isNoPower() and square:haveElectricity(), but these conspicuously only check local electricity (generators), not global state.
I need to know when the global power grid shuts down .

What's the best way to check if global electricity is currently shut off in Build 42? Is there a new API method, or should I use a different approach (like checking active appliances, time-based checks, etc.)?
Thanks in advance!

bright fog
#

Maybe look towards the black out mods ?

#

Tho I've got a feeling they change local electricity ?

willow tulip
#

(in vanilla source)

#

note its paired like carBatteryCharger:getSquare():hasGridPower() and carBatteryCharger:getSquare():getRoom()) so it doesn't check if the square is in a room and should actually have electrical outlets/etc available, it likely just checks if the shutoff date has been reached or not.

thin swan
peak furnace
#

small question, i'm looking to change a recipe ingame, specifically the "cast ingot" recipe. where would i find the data for it?

#

i'd also like to know how i would go about overriding default recipes in a mod, as i don't like just tweaking lol

#

i've done modding before so i'm fairly familiar with the scene, just need pointers

thin swan
peak furnace
#

fabulous, thank you

#

i figured it was just an override like that

tardy mural
#

Is there a flag to specify a craftrecipe input has to be stale?

#

(Or is there a complete list of flags somewhere?)

foggy finch
#

So i kinda need help since i ran out of stuff to try, How can i get my mod to either communicate with the outside world(http or websocket or just sockets) and for info, im on the latest build of version 41.
For more context, im trying to develop a archipelago mod for pz, but i tried stuff that was on stack overflow, and more but to no avail, there was simply no way that i found to get the mod to talk to the outside world or just a socket.

#

In case someone ends up replying to me, just ping me since i dont always have notifications turned on

bronze yoke
foggy finch
peak furnace
#

ive been meditating on a more indepth health system. specifically i don't like how it's HP-based. i was considering what i'd term "humors" as an implementation strategy; an underlying measurement of certain things that, in composite, creates neat emergent behaviours

#

specifically those "humors" would be extrapolated to outward vitality markers like blood pressure, pulse, oxygen saturation... stuff in that vein. not necessarily tracked, but just invisible stats that go on to determine those things. so if you have high weight that'll be correlated with high bp and high heart rate, for example

#

i'd probably select stats that already exist in the game and just kinda bolt this stuff on top

foggy finch
#

So i found a Java public object that id like to be able to use, but i dont know how i can interect with java code using lua. That function being zombie.network.RCONClient

bronze yoke
#

a class has to be exposed to be interacted with by lua, anything to do with networking definitely won't be

lethal tulip
#

Hello everyone! I am making a mod that does these:

  • Double-click a corpse icon in the loot window to mark or unmark it with a yellow tint.
  • Automatically reorder loot window icons for clarity:
    • Unmarked corpses (normal) appear at the top, sorted by ID (last killed on top, usually).
    • Non-corpse items remain in the middle, preserving their natural order.
    • Marked corpses (tinted) move to the bottom, sorted by ID (last killed on top, usually).
  • Marked state for each corpse persists across game sessions.

I already have a working script. I just want to make sure that the mod hooks to the most appropriate function and is efficient. The function it hooks to right now is ISInventoryPage:refreshBackpacks(). Here is a pseudo version of the script:

#

local ISInventoryPage_pre_refreshBackpacks = ISInventoryPage.refreshBackpacks

function ISInventoryPage:refreshBackpacks()
ISInventoryPage_pre_refreshBackpacks(self)

if self.onCharacter then return end  -- skip player inventory

for _, button in ipairs(self.backpacks) do
    -- Create overlay once if not exist
    -- Set overlay invisible (handled by refreshAndReorderButtons later)
    
    -- Hook double-click once
    if not button._dblClickMarkCorpseHooked then
        local origOnMouseDoubleClick = button.onMouseDoubleClick
        button.onMouseDoubleClick = function(selfBtn, x, y)
            -- if it is a corpse and a double click, toggle tinted flag
        end
        button._dblClickMarkCorpseHooked = true
    end
end

-- Reorder and refresh overlays on every refresh
refreshAndReorderButtons(self)

end

function refreshAndReorderButtons() {
for each button:
-- Set visibility according to tinted flag
-- add button to a group

-- sort the group in order of unmarked / non-corpse / mark
-- stack buttons vertically in this order

}

Please have a look and let me know if anything can be improved, flow-wise. Thank you so much in advance!

bronze yoke
#

i'm not sure if we have a public list anywhere of what classes are exposed?

foggy finch
#

well just found it while i was waiting for an awnser

#
#

its the second post

#

marked as a spoiler

bronze yoke
#

this is twelve years old 😅

foggy finch
#

oh

#

i didnt check the age

#

welp

#

i think i ended up in the far far end of the forums

bronze yoke
#

most modding information you find by google or the forums is going to be older since unfortunately most modding discussion happens on discord these days

foggy finch
#

yeah thats fair

bronze yoke
#

the only online source i'd say is pretty reliable is the wiki and anything it links to

#

if you have a decompile you can see the classes being exposed in LuaManager.Exposer.exposeAll()

bright fog
#

Also check out my Lua API video guide, I explain the Lua API concept

#

This guide explains how the Lua is able to communicate with the Java, how to use this behavior for your mods, and how to set up a basic Lua mod structure. It will also teach you how to use the JavaDocs, LuaDocs, how to search the game files and decompiled code to find what you're looking for, and also searching Lua events to implement specific b...

▶ Play video
foggy finch
# bright fog Also check out my Lua API video guide, I explain the Lua API concept

alrighty ill go watch that, since all networking is disabled sadly, ill just rely on files to transmit data, since archipelago being a multiworld randomiser, it relies on networking, since this didnt have networking id have to make a client that would interact with zomboid. its possible, just not viable by times since id need to do communications between python and pz

bronze yoke
#

what exactly are you planning to randomise? i've definitely considered APing various games i like but i couldn't really imagine it'd work great for zomboid

foggy finch
#

Since we love to randomize games between us, but he also thought of zomboid and gave me some idea, so i wanted to try some stuff

#

thats pretty much why im trying this in the first place since he kinda would appreciate if it were to be possible

#

but the real restriciton which i find a bit disappointing is the communications part, sure doing it by files is not that hard but its still an issue for me in my opinion

#

sorry for this, i just am asking since i kinda also wanted to do that, it would be nice if id work, so ill go back on working on it while watching the video

bronze yoke
#

i'd love to see how it turns out

foggy finch
foggy finch
# bronze yoke i'd love to see how it turns out

i do seem to have encountered an issue, i tried some io stuff to write to files but seemed to have failed to just use io since it doesnt exist, i dont know if it is possible but i couldnt find anything in the java code. did you manage to ever write or read to a file for modding in pz?

tardy mural
# bright fog The wiki

I may be blind. But I looked there before and now again and there is a list of parameters for the recipe itself, but I can't find a list of flags for the inputs of the recipes.

drifting ore
#

Here are all of the flags though

tardy mural
#

Thank you a lot, it seems like I truly am blind

tardy mural
#

I missed the existence of hat one, thank you again

drifting ore
#

I updated those messages if you still need

neat spire
#

Is there a respectable place to find vanilla map exports? Or do I have to trust one of these random uploads on one of these various forums?
Sorry this feels like such a dumb question but I'm very new to this, and can't find any info.

bronze yoke
#

not really

neat spire
#

ah rip, alright.

bright fog
#

Only a single one exists to my knowledge

#

Or at least that's the last one available

#

And that's onky for B41

bronze yoke
#

tools to create these exports aren't publicly available so there's limited sources to get them from

neat spire
neat spire
bright fog
#

Yea the tools the mapping community has are private because they don't want to see their maps stolen from the Workshop to be forcefully updated to B42

rich reef
#

Hello everyone,

I was wondering if there is an event or a hook I can use to determine when someone dismantles a tile/moveable item? Trying to run some code when someone performs that action. Been digging and looking for something that work from but not having much luck.

lethal tulip
#

@rich reef I don't know either. But if I were you, I will have look at the mods that allow dismantling containers even with items inside to find something relevant.

rich reef
#

I've found most of the code regarding dismantling containers, including the moveabledefinitions, return item types, etc. Just can't figure out how to hook into the action itself so I can run code before/afterwards without having to override entire chunks of base game code.

rich void
#

Anyone know how I can satisfy alcoholic trait ?

can be done for smoker via character:getStats():setStressFromCigarettes(0);

#

Couldn't find an equivelent for boozers CryingManAnimated

#

or even if there's way to trigger more than one function from item script when consumed?? hoping not at dead end here 😂

OnEat = OnEat_Cigarettes;exampleFunction ??

#

thanks albion

willow tulip
muted garnet
#

How to add items to the created container? getOutermostContainer() and getContainer() returns player's inventory

dry oar
#

Hello, can someone tell me where the code for recipes related to blacksmithing is stored? I didn't find anything related to this in the recipe folder. Thanks!

muted garnet
dry oar
#

Oh, I was looking for them in the wrong folder. Thanks you!

muted garnet
#

you're welcome :3

willow tulip
muted garnet
willow tulip
#

Shouldn't, I use it a lot.

#

lemme double check.

muted garnet
#
local toolbox = inventory:AddItem("Base.Toolbox")
toolbox:getContainer():AddItems("Base.TirePiece", 8)

It adds tire pieces in the player's inventory, not in the toolbox

willow tulip
#

Hmm nope I use vehiclepart containers and they are different.

#

ah k nm it is the same

#

getItemContainer()

#

you'll also ideally want to check IsInventoryContainer() before if your not 100% sure if its a container

#

toolbox:getItemContainer():AddItems(...)

#

What your actually looking for, is that your inventoryItem is actually the derived type, InventoryContainer and has the above API

#

that shows you all the extra functions you can access when it is ( IsInventoryContainer() == true)

muted garnet
willow tulip
#

np

drifting ore
#

Hi good day! Is there any other way to empty out a lua file through a mod without having to copy paste (override) the lua file and just empty out its content?

thin swan
drifting ore
#

Thanks man

sonic needle
sour wave
#

Same with dependencies.

sonic needle
#

the override is usually standalone with these

sour wave
#

Modifications of code generally are accepted as modifying the mod itself and releasing a modified version

#

Exterior mods changing something isn't the same

sonic needle
#

Depends what code you mod and how much you take,

someone not asking and doing it that way with my code, Nets you DMCA without hesitation.

sour wave
#

If I make a mod that requires your mod as a dependant and change one value, it's not going to net you a dmca strike against me

#

I'm not redistributing YOUR code

sonic needle
#

that is usually fine for example yeah

sour wave
#

Obvious copy and paste of code is a completely different matter and doesn't seem to be what they are discussing

bronze yoke
#

it basically comes down to 'does what you're uploading contain something not made by you'

sour wave
bronze yoke
#

if it does and you don't have a license to redistribute/modify it, that could be risky, if it doesn't you're probably fine even if your mod does heavily interact with another mod

sonic needle
#

indeed, some modders dont mind, Others Hate even Small edits

sour wave
#

Yes it does because it's a modification you're making, but no because it uses another mods functions

#

This is the same argument that's been around at least the last 20 years I've been modding games

bronze yoke
#

you're saying that calling a function from another mod could be a violation of copyright?

sour wave
#

If you're modifying the functionality someone could push that

sonic needle
sour wave
#

Modifying the intended functionality of a mod could and has made people mad enough to push copyright

#

Whether it's a standalone mod making the changes or not

bronze yoke
#

well to me that's less about copyright and more about the secret we all have to ignore which is 'actual copyright law does not really apply to mods because nobody making mods has the resources to get a lawyer over it/if they did it wouldn't be worth it'

sour wave
#

Depends on what game we are talking

#

There are 100% modders who make enough to both afford and use a lawyer

bronze yoke
#

true, but for zomboid steam deciding to honour a DMCA is basically the extent of copyright law

sour wave
#

True

sonic needle
#

DMCA strikes stack permanently, Net too many, and Bye Bye Steam account / File posting, for workshop globally. for good.

sour wave
#

Unless you get a lawyer and try to overturn them

#

But then, we are back to the modders not affording an attorney thing

#

Though, I know of a lawyer that plays pz... Soo hmmm

sonic needle
#

someday, when someone does, i wish to watch, and laugh

sour wave
#

The thing that always make me laugh is when someone says "no backwards engineering my mod/code" yeah, try stopping me. If my code in no way reflects yours, you can't do anything

bronze yoke
#

from what i've heard you can dispute a dmca through steam and valve basically just gives up and drops it and tells everyone to lawyer up if they care that much

#

but i've only really heard of cases where they were obviously fraudulent so maybe it's taken more seriously when it's not

sour wave
sonic needle
#

real ones are solved damn quick, depends on overwhelming evidence, credibility, previous infractions, past mods made/uploaded/popularity

sour wave
#

That's a terrible metric to use really. I've seen people with hundreds of mods with a few thousand subs each, and people with one mod with 500k+

#

Like the newest gun mod released, dudes mod has 400+ guns, but his last mod had like 12, and the works definitely far different qualities and styles, but no one's called him out for it yet

sonic needle
#

Pirulin's?

sour wave
#

Starts with a g I think, maybe it idk

sonic needle
#

considering i helped the lad dev that, questions / info etc, ( gael gun store )
yeah its real

sour wave
#

That's the one. It looks like ai slop

sonic needle
#

how many mods have... you made?

sour wave
#

For pz, none, for many other games, hundreds

bronze yoke
#

i didn't really look at it with much suspicion since this kind of just happens with gun mods, gun nerds are crazy

sonic needle
#

PZ < 0 means you dont really understand the effort people go to

sour wave
sonic needle
#

feel free to... showcase this monumentus singular mod

sour wave
#

The only difficulty in modding pz is the required file structure which is arguably one of the most horrendous modding requirements I've ever seen

#

I've never modded a game that requires you to follow a strict, dev decided file/folder structure like pz has. With really, pretty shitty documentation

sour wave
sonic needle
#

if someone mods it better, faster, then they have motivation, thats about it

sour wave
#

Nah, not true. Intellectual property laws exist for a reason

#

If I have a years worth of proof that the idea was mine, and haphazardly make mention of it, and someone develops it sloppily in a week, I can fight that with intellectual property laws

sonic needle
#

unless you are nintendo, with evilness by default, i dont think you can IP Motivation

sour wave
#

You're apparently not accustomed to US IP laws

#

Or haven't been in the modding scene long

#

Or both

sonic needle
#

my guy, you got some PFP steam perusing to do.

bronze yoke
#

it depends on the mod, most mods aren't really eligible but some would be

sour wave
bronze yoke
#

if it's something that takes a year to make then it probably is eligible

sour wave
#

It's irrelevant to the conversation, much like saying "just Google it"

sonic needle
#

doubt you would defend stuff either, with that motivation level

sour wave
#

I'll defend plenty. But scouring a site and taking that time, takes away from actual productive conversation.

#

If it's something important, typically someone would provide that information themselves, not leaving it to the one they are speaking to to find it

#

This is general debate 101

#

Though, I believe debating is gradually being taught less and less, so it doesn't surprise me much when people fail to remember that

frank elbow
#

I don't know if most modders are interested in debating copyright law

#

Usually they like talking about modding

sonic needle
sour wave
#

Typical "this is blah and I have nothing else productive to say" shenanigans.

frank elbow
#

You can have productivity or you can have discord (pick one)

sour wave
#

You can have both, they are not mutually exclusive

sonic needle
#

i get... so little done reading discord

sour wave
#

I've been painting my kitchen this entire time

frank elbow
#

I should clarify I'm partially poking fun, but just saying it's not a conversation most would probably want to engage w/ here

frank elbow
sonic needle
#

indeed, basically what i am doing also

#

adhd makes, doing the thing, quite hard

sour wave
#

It's a conversation everyone that mods should be prepared to have, as there's been numerous cases of both stolen IP and copyright infringements in the past

#

Maybe not with pz yet

sonic needle
#

go type "Casette" in steam, its like IP hell

frank elbow
#

Well when that day comes I'll point to the modding policy, point to the relevant licenses, and move on

sour wave
#

I'm moderately surprised steam allows all the music mods it does, that are direct game rips

bronze yoke
#

recently somebody copy pasted a mod i was working on's entire source code and called it their own so it's not like it never comes up 😅

frank elbow
#

I think for most people who aren't doing clearly not okay stuff like that it's not something to worry about

#

I suppose I wasn't thinking about the other end of it, but again that's what licenses are for so 🤷

sour wave
#

You say that, until the point it's necessary. Over the two decades of modding, I've seen numerous cases of someone with the same mindset getting the shaft. Since then I've taken the CMA standpoint

#

To the extent that I keep timestamped documents for proof of IP anymore

rich reef
#

Quick question:

If I make a global table/module, does it require a return at the end of the file, or just when making the table local? Any advantage to that, other than making a local copy?

bronze yoke
#

it is better to keep it local and return it because globals are globals and could be accidentally interfered with by another mod

#

also if local it has to be explicitly required which prevents load order issues and many would say is clearer code

frank elbow
#

I am one of the many who would say that, but to answer the question about a global table: no it does not require that

#

The advantage would be not having to worry about requires, but the disadvantages outweigh that advantage (and you'd have to worry about load order instead anyway, like albion said)

rich reef
#

Alright, just wanted to confirm. Also, specifically I am trying to run script functions from a table, and it doesn't seem to work with a locally returned table/module. Thats when I would need it to be global, right?

#

I'm working on cleaning up a lot of my code and using modules whenever I can, so just trying to figure some things out and when using a module is good and when its a waste of time.

peak furnace
#

how might i go about replacing or modifying an item in scripts/generated without completely overriding other parts of the item? would be nice if there was something like a .patch extension that just lets you soft-override for definitions you changed while leaving other things alone. i ask because i'm thinking about cross-compatibility

tranquil kindle
peak furnace
#

so like:

module Base
{
  craftRecipe MakeCoolCharcoal
  {
    ...
  }
}

wouldn't completely override recipes_blacksmith_woodcharcoal, it'd just add onto it?

tranquil kindle
#

Name your files differently than vanila

#

But in case of recipes... i don't think overriding like that work

#

Recipes are unique in this kind that i myself don't know a way to override or disable vanila recipe, at laest not in easy way

peak furnace
#

i managed to by replacing the .txt in a mod

tranquil kindle
#

But i honestly never had reason to do so, so maybe someone else can help with that

#

You don't really want to replace WHOLE vanila file, as it can cause issues with other mods

peak furnace
#

i'll poke around but i think i'm starting to understand the structure here
when i declare module Base, i'm effectively ringing it up and saying "hey, i'm about to make some definitions here"
when i declare craftRecipe MakeCoolCharcoal i'm defining Base.MakeCoolCharcoal with my definition

#

i imagine doing something like craftRecipe MakeWoodCharcoal might cause a problem because i'm defining something that already exists, like adding a key that already exists to a dictionary; instead i might want to do MakeWoodCharcoal = new craftRecipe or something akin to that

#

my lua is very very rusty

bronze yoke
peak furnace
#

sorry for the interjection, by the by

bronze yoke
# bronze yoke if you return the table, you can retrieve it from another file using require
---lua/shared/MyModule.lua
local MyModule = {}

function MyModule.foo()
    print("bar")
end

return MyModule

---lua/shared/SomeOtherFile.lua

-- the argument is the path to the file with the module in it, starting after shared/client/server (you cannot specify which, game will scan each in order until it finds a file), not including the .lua extension
local MyModule = require("MyModule")

MyModule.foo()
tranquil kindle
# sour wave That's the one. It looks like ai slop

It might be the way the models look. They don't seem to be made with Zomboid in mind and instead the amount of details would suggest other games. It's just my assumption when i loaded some of those guns into blender. If people like it, thats great for them, but for me personally its a bit too much and doesn't fit the game.

peak furnace
#

M9K vibes

#

i'm telling ya

tranquil kindle
#

I understand both sides, some people like high details, some like closer to vanila like VFE/B41/B42 Firearms

#

What i learned though is that you can apparently have multiple models in FBX file and they're perfectly usable separetly. Thought it's only the case for cars. I had a feeling it might be the case, but never really tried it. I feel like having every gun/model separetly is better in case you want to override single model

bronze yoke
#

also keep in mind that steam's smallest download unit is a file: when you update, if you have multiple smaller files the user will only have to redownload the ones that have changed, if everything is one file then they have to redownload that entire file even if you only changed (or added) one model

tranquil kindle
#

So not much really changes for me as I prefer it that way, but it's good to know for the future

waxen marsh
#

how can i make a mod tha lets me change the face of my character mid game?

rich reef
bronze yoke
#

scripts can only read globals unfortunately

#

they're the one exception to the 'never use globals' rule because you have to 😅

rich reef
#

Gotcha! So the script from another mod should be able to call a global recipe script from another mods global script table?

bronze yoke
#

yeah, globals are global, the game doesn't know or care where they come from

sour wave
thin swan
# waxen marsh how can i make a mod tha lets me change the face of my character mid game?

Try https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/core/skinnedmodel/visual/HumanVisual.html#setSkinTextureName(java.lang.String)
(player:getHumanVisual() to get it)
I know that the same setter on the AnimalVisual works, but haven't tried on the player.
So you'd basically just have several different faces as skin textures and use that to apply them whenever you want.
If it works and actually changes the texture that is

lethal tulip
#

Hi everyone!
An comic book during OnBoot has type Literature (itens = getAllItems(), then loop through items).
But during OnFillInventoryObjectContextMenu, the same comic book has type ComicBook. The type is changed somehow, I believe.
If I want to detect all items that has type ComicBook to change their display categories, which is the best event to hook to, after type already changes to ComicBook from Literature?
Or is there a way to detect ComicBook instead of Literature early on?

bronze yoke
#

you're getting confused by two different things called 'type'

#

on the item script, type refers to the class of inventory item as set in the script with Type = Literature

#

on the item instance it refers to the name of the script

lethal tulip
#

Thank you for your answer @bronze yoke !
So I guess I can use Icon then.

lethal tulip
#

Another question, if I may! How can I see debug print during onBoot phase?

#

I meant OnGameBoot phase

knotty arch
#

so i pulled myself into something that might take me a while to figure out on sapphs cooking mod with the conversion recipe, (specifically turning juice bottles back into base water bottles) its in the game and obviously "works" but when i search throught the mods files and scripts it seems to just not exist there, not sure what to do there yet

#

like i dont understand how theres a recipe to convert the bottle yet i cant find its line of code anywhere in the files

#

other than that 4 other recipe issues have been fixed and i found a 5th one recently but that one makes me wanna really figure out whats wrong and if i have to simply make a new recipe for the conversion of juice bottles back into regular water bottles

#

or if its something deeper

#

that might take a while though

rich reef
#

Hey, @bronze yoke

Just following up about what I was talking about earlier:

If I create a global table for re-using Script Functions (OnGiveXp, OnCanPerform, OnTest, OnCreate), do I need to make those script functions global within that table, or do they need to be declared as local? For instance:

myTable = {}
myTable.Recipes = {}

local myTable.Recipes.OnTestSomeThing(item, result)
  -- Do Stuff
end

-- OR

myTable.Recipes.OnTestSomeThing(item, result)
  -- Do Stuff Again
end

Which of these is the correct method? I am not returning this table as a module, as much as using it as a global table for my constantly re-used recipe functions. Trying to figure out all this stuff. So many layers of complexity trying to convert my mod/code over to this structure and want to start off with a good footing. Thanks for your time!

bronze yoke
#

should be function myTable.Recipes.OnTestSomeThing(item, result)

#

you can't have locals inside a table

rich reef
#

Just if it's a global table? Or even if it's a local table, you can't do so?

bronze yoke
#

either way, no

rich reef
#

Alright. So if this was a local table / module, you'd be declaring a local variable to store the table, which would make everything inside local, correct? So the scope doesn't need declared in that case?

bronze yoke
#

yeah

rich reef
#

Interesting

#

I've come to the point where I've re-used a bunch of small bits of code constantly and it's been annoying to have to re-write them in any mod I make. So I've been wanting to convert over to this module pattern to make things sustainable and easier to deal with.

I was looking into making some functions to use for events that could be called from a table, but most of those run some local function in that specific mod, so I wasn't sure how or if I could pass that function reference into the module's event function.

For instance:


-------------------------------
-- Module Code myModuleCode.lua
-------------------------------
local myModule = {}

local someFunction(_somePassedFunction)
  -- Do module Stuff then  
  -- Run Passed Function from Mod
  _somePassedFunction()
end

return myModule

-------------
-- Mod's Code
-------------
local myModule = require("myModuleCode")

local thePassedFunction()
  -- Do Things
end

Events.OnZombieKill.add(myModule.someFunction(thePassedFunction))

I believe you cannot pass parameters/functions this way, is that correct?

Not sure if this is a good use case for re-using this type of code in a library, since the function I'd run with that would need to run from the Mod's own code.

bronze yoke
rich reef
#

Alright. Kind of like how you forward declare a variable/function using that syntax?

#

Didn't know that worked that way.

tardy mural
#
local TinCan = ScriptManager.instance:getItem("Base.TinCanEmpty")
if TinCan then
    TinCan:getTags():add("SmeltableIronSmall")
end```

Hello, has anyone an idea why this doesn't make tin can smeltable in a furnace? I followed along with this indie stone post: https://theindiestone.com/forums/index.php?/topic/53019-details-on-the-improved-modding-tag-system-in-4169/
bronze yoke
rich reef
#

Ahh, I see it now. So, is there anything needed to pass a function as a parameter correctly?

bronze yoke
#

nah, functions are first class in lua so they just act like any other variable

rich reef
#

Okay, well that makes things convenient. This module pattern stuff is really cool, but not sure how to implement everything quite yet. Any tips or things to look out for? I've kind of browsed at your Starlit Library a bit to see what you've got going, but trying to figure out best use cases and all of that still.

rich reef
bronze yoke
#

if you need to remove it later then just define it as a function in a variable the normal way

rich reef
#

Alright, I'll try that.

#

Hmm.. Not sure if I'm doing it right. This seems like it may me more complex doing this as a Utility Function than it's worth. May just leave the Event stuff to each file and just deal with some code re-use.

#

I'm actually testing this out with some code that you helped me with a while back, an event that delays the game by one tick to then run code that wouldn't load normally.

Trying this to see if I can remove the event, but it doesn't seem to work.

-- Module Code

local testModule = {}

local delayed = false

function testModule.sendCommandWhenReady(_functionToRun, _eventCallerFunction)
    if not delayed then
        delayed = true
        return
    end
    _functionToRun()
    Events.OnTick.Remove(_eventCallerFunction)    
end


return testModule


-- Mod Test Code
local testModule = require("testModule")
local codeLoader = testModule.sendCommandWhenReady

local function testFunction()
  print("Testing 1 2 3")
end

Events.OnTick.Add(function()
codeLoader(testFunction, self)
end)

This runs the Event from the Module, and then runs the correct code that is passed as _functionToRun, but it doesn't remove the Event afterwards. I must be missing something.

knotty arch
#

im trying to do a recipe for sapphs cooking in attempts to fix something

#

and im clearly doing something wrong

#

has to be with the item mapping

#

i presume

bright fog
bright fog
#

Also your module needs to be local not global

rich reef
# bright fog What exactly are you trying to achieve by doing this exactly ?

Yes, that was just a typo while copying code over to the Discord. It was set to a local module. Fixed the code here.

For now, just testing this code to see if I can re-use this type of event code in multiple files, but still pass a function to them.

Usually this would be hardcoded to run a function from within the mod itself to load it on game start.

But in this case, using it as a module function, I'd need to pass the function to run to make this module event function generic and open ended. But trying to remove the event handler afterwards is what I'm trying to figure out now. I've tried a few different things, but it continues to run after firing the function for the mod.

I'm not sure if this is really a good use case at all for a module function, with how much extra complexity it adds, but just trying to figure out what's possible at the moment. Been trying to learn as much as I can about Lua and improving my mods so it's been a fun journey so far. You all are a wealth of knowledge, so trying to pick everyone's brains and improve my abilities.

rich reef
#

But yeah, any ideas on how to properly remove that event in that code I posted?

bright fog
#

Self refers to the table the function is part of, more commonly used to have access to the class instance that function is part of

#

In this case, self is in a simple function you define directly in the event add

#

It's not part of a module, its table

rich reef
#

Ahh, alright. That was just one thing I tried that didn't work. I also tried passing the local function codeLoader, and that didn't work either.

bright fog
#
local mdl = {}

function mdl:testFct()
    self -- referd to mdl here
end
#

Here you're trying to run a timer on tick number 1

rich reef
#

Within the module Event function code I tried Events.OnTick.Remove(self), and that didn't work either. Same issue?

bright fog
#

Like I just said

rich reef
#

Its the table

#

Gotcha

bright fog
#

You can just use the tick event

#

It returns the number of ticks

#

This number of tick increments, so you could just have a fct in an event, and from within it call remove on the variable it's stored in, when checking if tick = 1 or 2 whatever you need, after running the code you want to run at that specific tick

rich reef
#

So the code that Albion sent me works great as is, I'm just trying to convert it to be used to run a passed function from any mod that I try to use the module in. In this case, I have to run the Events.OnTick.add in a different way to pass that parameter. And that's what I'm trying to figure out, is how to remove the reference to that event. If that makes sense.

bright fog
#
local function test()
    Events.OnTick.Remove(test)
end
Events.OnTick.Add(test)
#

You might want to look into Lua timers for PZ

rich reef
#

Yes, this is the original code that I usually use. Which I was trying to adapt.

local function sendCommandWhenReady()
     if not delayed then
         delayed = true
         return
     end
     -- Do Stuff
     Events.OnTick.Remove(sendCommandWhenReady)
end

Events.OnTick.Add(sendCommandWhenReady)

This has always worked great. But if I wanted to make this into a module, I needed to pass the function to run at the -- Do stuff portion of the code.

But this means the Events.OnTick.Add function has to be changed.

Events.OnTick.Add(function()
codeLoader(_passedFunction)
end)

It's confusing, but the original function is fine. Just trying to figure out how to get the reference to that event, since isn't it considered an anonymous function when made that way?

rich reef
#

Alright. I've got it to work by doing this. But only part way to what I'd like it to do.

-- Code Loader
local codeLoader = function() testModule.sendCommandWhenReady(testFunction) end

local testFunction()
  print("Testing 1 2 3")|
  Events.OnTick.Remove(codeLoader)
end

Events.OnTick.Add(codeLoader)

This works now, but I was hoping to have the Module Event perform the entire function as before, by removing the reference to the mod's function.

This would let me use the module code anywhere, and just pass a function and it would take care of the entire process. In this case, I have to remember to add the Events.OnTick.Remove call on the mod side of the code, which isn't the end of the world by any means. But trying to figure out how to make the module structure work to my benefit the most.

Again, just tinkering around here and seeing what is possible.

Can a function pass itself as a parameter? For instance:

local testFunction(_functionToBeRan, _thisFunction)
  -- Do Stuff
  return _thisFunction
-- OR
  Events.OnTick.Remove(_thisFunction)
end

testFunction(anotherFunction, testFunction)

Update:
Okay, so this works as I intended, but you have to declare the function as global to pass itself, which kind of defeats the whole purpose.

codeLoader = function() testModule.sendCommandWhenReady(testFunction, codeLoader) end

Working Solution:
Alright, just had to change the style of function declaration, and now it all works as I originally planned.

local function codeLoader()
  testModule.sendCommandWhenReady(testFunction, codeLoader)
end

Well, that was a fun experiment! And I'm not entirely sold on whether it would even be worth using this type of thing in a module or not. Saves maybe a few lines of code though per .lua file that uses it, and I suppose it would be less overhead for that one function. But having to create a 'passthrough' function just to call it seems pointless too. Oh well.

Thanks for the help!

tepid skiff
frank elbow
# rich reef Its the table

Slight correction/elaboration on the syntactic sugar explained here: self isn't necessarily mdl, it's just the first argument passed to the function. When using the corresponding call syntax on mdl it'll be mdl, otherwise it'll be whatever it's called with. This is how “class” systems tend to work, by using metatables to point to a table for method lookups, which are then called on instances (cc @bright fog, relevant to what you said up there)

e.g.,

local t = {}
local other = {}

function t:method() end

t:method() -- self = t
t.method() -- self = nil (usually not a proper call for functions defined this way)
t.method(other) -- self = other
#

In other words, the t:method(...) call syntax is effectively t.method(t, ...)

muted garnet
#

How to add category text to sandbox settings, like in b42?

drifting ore
bronze yoke
#

you can't without hacking through the ui lua manually

muted garnet
muted garnet
bright fog
#

I hope to make a library to do that in the future

bright fog
#

Usually people make empty options

muted garnet
#

got it, thanks

drifting ore
#

Yeah pretty unfortunate they didn't get no love but vanilla sandbox options did

#

I've seen at least one person working on an improved version but I'm not sure where that's at

bright fog
#

I have a custom event in my lib to hook to the panel UI to modify it

bronze yoke
#

i've been meaning to give mods access to the advanced options toggle but it turned out to be way more of a pain in the ass than i was expecting

frank elbow
#

I got so tired of working around sandbox options via overrides that I gave up and just made separate configuration stored in a file on the server (with a UI for editing it ingame)

#

Maybe not applicable for every use case but I do not miss sandbox variables

sour wave
#

@sonic needlewhat program do you use for modeling, because .x model files aren't by default supported by blender

bronze yoke
#

.x files are not really used

tepid skiff
sour wave
bronze yoke
#

for original models fbx or glb are greatly preferable, if you need to edit a vanilla model there's a tool that converts them to gltf

sour wave
#

gotcha,

bronze yoke
#

i'd recommend going with fbx since glb support was only added recently and you won't find much help if you run into an issue

sour wave
#

noted thank you

sour wave
bronze yoke
# bright fog Why that ?

the vanilla game defines this in a lua table, but it's local and not really possible to hook into as far as i tried, so i think you would have to intercept the actual ui creation and mess with the ui elements which would be wayyy more complex

frank elbow
#

And duplicating the initialization code for new settings, but that wouldn't be as bad as having to do the whole UI

bronze yoke
#

i think i was having some frustrations with overriding getSandboxSettingsTable, don't remember exactly what it was

bright fog
#

I mean that was my idea to implement this for modders to use 😅

peak furnace
#

so i understand that it's now very difficult to modify existing recipes in the vanilla game without completely overriding files

#

kinda puts a cap on my plans for now

#

would rather not do something that sweeping

sour wave
#

Guess nows a good time to learn modeling xD

empty bramble
#

Is this guide outdated, or is it still useful for learning how to create maps for PZ?

#

It was last updated in 2022.

lethal tulip
#

Could someone tell me the event that fires when a container's loot generated for the first time? Is there such an event or "Events.OnContainerUpdated" is used everytime, including loot generation?

sonic needle
#

i dont use .x either

modest arch
bright fog
#

You can modify some stuff

#

Via Lua

bright fog
lethal tulip
#

@bright fog Thank you so much!

upbeat turtle
#

<@&671452400221159444>

drifting ore
#

Finally. My chance to get rich

bright fog
#

Been waiting for that my whole life

left plank
#

Thank ya

sour wave
#

@sonic needle question for you, do I actually "need" animations or anything as far as bones and such for firearm models, or will completely static models be fine?
Off top of my head, I've never really noticed actual reloading animations for firearms other than the player model itself, though it could be that I never played zoomed in.

sour wave
#

And anims?

sour wave
thin swan
sour wave
bright fog
thin swan
#

But there is a way to do visual reloads fairly easy, I worked with Nik on a G11 recently, and we added a visual magazine using the attachment system

bright fog
#

Yea

#

Attachments allow you to animate things

sour wave
#

I know all the coding side for the most part as far as adding/creating it in game

#

the modeling portion's the new part to me

bright fog
sour wave
#

What..... firearm guide

sour wave
knotty arch
#

okay so i was muted so im returning with some info, im making a patch for sapphs cooking doing what ever i can find, i got to a part where when you convert a bottle of watermelon juice or any juice bottle from the mod back into a regular water bottle it would do is fill it full of water despite there being no liquid from the juice left, so it should be empty. so i ASSUMED i could just find the recipe in the script files and be able to do something about the liquid amount after its produced, wrong. im assuming it has something also to do with the new liquid system. i couldnt find this recipes script ANYWHERE i literally searched the entire mods files

#

so i thought i could make a new recipe to convert juice bottles back to water bottles that are empty

#

obviously im doing something wrong so heres my code

#

i never finished working on it because i went to bed but heres the in progress code that i was working on for the new recipe

craftRecipe Convert Bottle
{
timeAction = Making,
time = 10,
category = SapphCooking,
Tags = InHandCraft;Cooking;CanBeDoneInDark,
inputs
{
item 1 [SapphCooking.BottleofLemonJuice;SapphCooking.BottleofOrangeJuice;SapphCooking.BottleofAppleJuice;SapphCooking.BottleofWatermelonJuice;SapphCooking.BottleofPeachJuice;SapphCooking.BottleofPineappleJuice;SapphCooking.BottleofGrapeJuice;SapphCooking.BottleofStrawberryJuice] mappers[resultType],
}
outputs
{
item 1 mapper:resultType
}
itemMapper resultType
{
SapphCooking.BottleofLemonJuice
SapphCooking.BottleofOrangeJuice
SapphCooking.BottleofAppleJuice
SapphCooking.BottleofWatermelonJuice
SapphCooking.BottleofPeachJuice
SapphCooking.BottleofPineappleJuice
SapphCooking.BottleofGrapeJuice
SapphCooking.BottleofStrawberryJuice
}

#

but the mapping is what im mostly confused about

#

because obivously i need it to be able to take every juice bottle

#

but now im not sure if thats how this conversion recipe even works

#

like i said i couldnt even find the original recipe for that

#

im hoping a new recipe could rectify this but unsure

#

and ive never done a new recipe yet

#

been only tweaking things

knotty stone
#

if you just want to be able to convert any sapph botte to that one bottle you dont need mapping

knotty arch
#

you dont?

#

i had to use mapping to fix this recipe so i just assumed

#

lemme check that out

bronze yoke
#

mappers are used when an input item changes what the output item should be

#

it maps inputs to outputs

knotty arch
#

oh

#

ive been making it harder on myself huh

#

okay let me work on that

bright fog
#

I advise you read the wiki page regarding CraftRecipes @knotty arch

knotty arch
#

thanks was looking for that

lethal tulip
#

Could someone help me with a map definition question?
On the map at b42map.com, there are the small green squares (which look like 8x8 tiles) and then the big yellow squares. Are the green squares chunks? Are the yellow squares cells?

bronze yoke
#

yes

#

it may be worth keeping in mind that the IsoCell is not the same thing as a map cell

lethal tulip
#

So a cell is not 256x256 tiles like Google AI tells me, isn't it?

bright fog
#

Don't use AI

#

It'll be wrong

bronze yoke
#

it is correct in this case, 8x8 square chunks, 32x32 chunk cells = 256x256 square cells

bright fog
#

IsoCell isn't a 256x256 tho

knotty arch
#

OKAY so thanks you guys i was able to get the recipe created and i can now start working on what i intended which is making the bottle get returned empty, which appears to be the harder part. i ASSUMED i could just add flags with is empty but im wrong i guess

heres what i did
craftRecipe Convert Bottle Patched
{
timedAction = Making,
time = 10,
category = SapphCooking,
Tags = InHandCraft;CanBeDoneInDark,
inputs
{
item 1 [SapphCooking.BottleofLemonJuice;SapphCooking.BottleofStrawberryJuice] mode:destroy,
}
outputs
{
item 1 Base.WaterBottle flags[IsEmpty], (< doesnt work to make it empty)
}
}

lethal tulip
bright fog
#

Usually you just retrieve the square the coordinates you want loaded and check if the square exists

#

You can also maybe verify that the coordinates are within the player cell

bronze yoke
#

you should use chunks, they are the smallest unit the game loads in

bright fog
#

Technically it does load in squares still but loads the squares in the chunk

bronze yoke
#

you can have only part of a cell loaded, but a chunk is either loaded or not

#

you can't have half a chunk

bright fog
#

When you check a chunk load the squares aren't loaded yet if I remember my tests

#

So you can actually catch a chunk that should technically be loaded but isn't actually fully loaded yet

lethal tulip
bright fog
bronze yoke
#

i assume you're working in b42 if you're looking at b42map.com of course but to be sure

#

b41 has slightly different rules about this stuff and no event

lethal tulip
#

Thank you so much @bronze yoke and @bright fog ! The event page is a treasure trove!
I am working on b42 only, btw.

drifting ore
#

Good choice

lethal tulip
#

I need some more help

Here is my code

-- Triggered when a chunk is loaded
local function onChunkLoad(chunk)
print("=== Chunk Loaded ===")
print(chunk)
end

The info printed is a hex number 8 character long. I am looking for a way to associate the chunk with the coord on b42map (1027, 2460 for example). Is there a way to do this? I have looked through IsoChunk data but found nothing useful. wx and wy is nil when I try to print them out. getLoadID() is also not the right data.

Please point me in the right direction! Thank you!

bright fog
#

Math

#

wx and wy are fields

#

So you need to access them like other fields

lethal tulip
#

@bright fog I ended up using Starlit for quick and easy access to wx and wy! Thank you again, good sir/madam! 👍

bright fog
#

Np

stable hearth
#

Totally inexperienced in PZ modding (somewhat familiar with Java)... But structurally speaking, what are the challenges with making a mod multiplayer compliant?

bronze yoke
#

mostly it's working out what this game's weird netcode wants done on the client and what it wants done on the server, and then communicating between client and server when you need to do something on the opposite end

knotty arch
#

does anyone know how to make the water bottle that i have as an output get returned empty?

#

its always returning full

#

and its not what i want

shy mantle
knotty arch
#

empty water bottle still has the same base ID as a full one i dont think i can seperate such without fluid nonsense

shy mantle
#

Good point

knotty arch
#

so im trying to reduce its fluid to 0 when the recipe is crafted

#

because its inputs are the sapphs juice bottles

shy mantle
#

Would it be so bad to use the soda reskin lol

#

I'm just messing

bronze yoke
#

have you tried flags[IsEmpty]

knotty arch
#

yeah i believe i did dont think it did anything

#

still returned full bottles

stable hearth
bronze yoke
#

it's pretty basic, you send POD-only lua tables between client and server with a 'module' and 'command' which are just arbitrary strings for you to identify what to do with the table, typically module would be named after the mod

shy mantle
#

@knotty arch Does it need to be a water bottle or can it be just water?

bronze yoke
#

if you want to identify objects for example you'll be sending their pos and index

shy mantle
#

I think the game just uses liquid + container sperately when it needs to do things like that

knotty arch
#

so i was trying to fix such

#

and apparently the fluid system will make me sad

shy mantle
#

Yeah this sounds like an oversight lol

knotty arch
#

yeah im making a patch for sapph that fixes a bunch of recipes and then this walked on my plate

#

prolly gonna regret it

#

cause it seems like the fluid system is a pain

shy mantle
#

@knotty arch You should just add a new bottle for this purpose only that is just a near identical copy, but with PickRandomFluid = false instead lol

#

And obviously all the other necessary changes to take it from full to empty

#

Did the remove the normal empty bottle? I thought I saw it had its own script...

knotty arch
#

yeah they did

#

and i thought about doing that

#

and meddled with it

#

but it becomes its own item and that ruins its ability to be used in other recipes unless i add that to every single recipe that uses bottles

shy mantle
#

Welp, at least there is A way... So strange that they removed it though, at least make sure the flag works before doing that lol

#

Tedium or acceptance

knotty arch
#

another issue with the tedious route is that if lets say sapph updated the mod or someone removes my patch and i have all that, and they have MY bottle in their save it breaks the save trying to remove it

#

soo its best to try and be as vanilla as possible with this

shy mantle
#

Understandable

knotty arch
#

literally just did this btw

#

broke my save

#

had to load a back up

shy mantle
#

Wait so... This must mean it's impossible to spawn in an empty bottle?

#

Like, in the debug items list

knotty arch
#

from what i can tell so far

#

yes?

shy mantle
#

Since the beginning of B42 I'm assuming, that's kind of insane. But I guess it goes unnoticed until it's needed for a vanilla recipe.

knotty arch
#

yeah idk what to do yet

shy mantle
#

What's the difference between PopBottle and PopBottleRare?

#

@knotty arch BottleCrafted is used in recipes (obviously, it's player made) and comes empty, try that? Obviously it's a slightly different looking, glass container, but still, it's pretty close functionally.

knotty arch
#

well what i CAN do

#

it kind of allows what i want

#

but i DO have to remove the fluids from the vanilla water bottle

#

youll never be able to spawn a water bottle with water anymore

#

but it does what i need in the conversion aspect of the mod

shy mantle
#

I wonder how that would affect other things though like spawning in water and seltzer

#

My seltzer!

knotty arch
#

ah shit random spawns

shy mantle
#

Crafted glass bottle it is

knotty arch
#

what im thinking is what if zomboid devs removing the ID for the empty water bottle is an actual issue

#

and it might not be possible to do what i want without either breaking random spawns as they would now spawn empty

#

or i look into fluid mechanics more

#

which not much info on it

bronze yoke
#

recipes can still have oncreate functions right

#

you can just drain the bottle if you have to

knotty arch
#

hm

#

forgot about this

#

ill look into that and see if it works

shy mantle
#

Emptying it after creation would be the only way at this point

#

Good luck

drifting ore
#

OnCreate will never let ya down

stable hearth
#

Would it be fair to say the PZ infrastructure is utterly incapable of supporting multiple body models simultaneously?

bronze yoke
#

it's less 'utterly incapable' and more 'one really specific bottleneck that prevents mods from doing this even though the engine is absolutely capable of it'

stable hearth
#

Huh, are you able to elaborate on the bottleneck? (I am in no way going to be "The Guy ™") but I'm interested in it from a technical standpoint.

bronze yoke
#

there's just nothing to set the model a character should use

#

there is a method that looks like it should do that, but it's ignored

#

by java modding it's been confirmed if it wasn't ignored it would just work

#

no, it returns the internal name of the category

#

you can get the name in the current language with getText("IGUI_ItemCat_" .. item:getDisplayCategory())

#

it's probably in english but it's not necessarily the same as the name you would see while playing english

noble summit
#

could someone please show me how to edit the workstation recipes please?
trying to make blacksmithing recipes more reasonable skill-wise so i wont have to become a self-taught master blacksmith just to make a steel block on a stick (sledge)
tried doing the basic txt override of the whole recipe but the game just crashes that way

tepid skiff
#

Ragdoll physics have now been added to combat!

#

Ignore the exaggerated reactions and random fall directions. Just a quick showcase.

#
  • Shoves that stagger zombies but keep them upright still do (vanilla behaviour)
  • Shoves that knockdown zombies now ragdoll
  • Melee attacks that flinch zombies but keep them upright still do (vanilla behaviour)
  • Melee attacks that knockdown zombies now ragdoll
  • Ragdolled zombies can get up from the ground
  • Zombies can now be injured and killed during ragdoll
  • Zombies transition to 2d sprites upon death during ragdoll (allowing them to be looted and will stay dead upon game reload)
  • Zombies dynamically ragdoll depending upon the direction you and them are facing
  • Zombies can now be thrown off rooftops, down stairs, and collide with objects such as vehicles
raven epoch
#

chat can anyone see where could cause the __sub not supported error?

#

brain is burnt

bright fog
#

The error log tells you where it happens

raven epoch
#

no idea where line 82 is

#

oh mb mb

#

well 82 is a return

bright fog
#

You've got to kidding me lmao

raven epoch
#

my brain is a bit burnt so sorry

bright fog
#

Show the full error

raven epoch
#

alright my bad again old error

bright fog
#

"GetClosestVisibleTarget"

raven epoch
#

there we go

bright fog
#

Stop cutting the whole thing, show the whole error log with everything around it

bright fog
# raven epoch

This is the most useless part of the error besides the first line

#

But there's other stuff, show it

raven epoch
#

ERROR: General , 1765114059793> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: __sub not defined for operands in unknown at KahluaUtil.fail line:82.
ERROR: General , 1765114059793> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: __sub not defined for operands in unknown
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:676)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:92)
at zombie.gameStates.IngameState.updateInternal(IngameState.java:1624)
at zombie.gameStates.IngameState.update(IngameState.java:1333)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
at zombie.GameWindow.logic(GameWindow.java:298)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:765)
at zombie.GameWindow.run_ez(GameWindow.java:681)
at zombie.GameWindow.mainThread(GameWindow.java:495)
at java.base/java.lang.Thread.run(Unknown Source)

this is the whole error no?

#

this is my first time modding so i apologise

#

the rest is just this same error being spammed

bright fog
#

This is going to be impossible to debug

#

Right now you need to install VSCode, use that

#

Install Umbrella

raven epoch
#

huh didnt think of that

#

ur right

#

been suffering with notepad++

bright fog
#

And do proper typings of your code because you are sending wrong types to a function or something like that

raven epoch
#

its because im subtracting something like a table from a number or smth

#

just cant find out where

bright fog
#

That's an internal error of the engine

#

Bcs somewhere you give the wrong type of variable to something else

raven epoch
#

huh

bright fog
#

And the stracktrace is in the Java

#

Which doesn't paste the stacktrace for the Lua that triggered that Java

raven epoch
#

DistToSquared works with

#

IsoZombie yes?

bright fog
#

For that check the JavaDocs

#

If it's a Java function, if it's a Lua function, maybe the LuaDocs but not sure how viable that is

#

Else search the game files where it is defined or used to see if zombies can be used

raven epoch
#

ok actually

#

i narrowed it down i think

#
local TargetPosition = {NearestTarget:getX(), NearestTarget:getY(), NearestTarget:getZ()}
            local Distance = IsoUtils.DistanceTo(NPCObject:getX(), NPCObject:getY(),NPCObject:getZ(), TargetPosition[1],TargetPosition[2], TargetPosition[3])

is this correct?

bright fog
#

idk

#

There's a lot of different variables that I don't know what they are

raven epoch
#

nearesttarget is

#

isozombie

#

npcobject is isoplayer

#

im using isoplayer for npcs by the way

#

hopefully that wont cause problems

#

OOPS

#

turns out i forgot to send tick

#

💀

bright fog
#

Nice good start

raven epoch
#

still doesnt pathfind for some reason

#

ty for ur help btw

stable hearth
bronze yoke
stable hearth
bronze yoke
#

no, there's some projects like that but it's not possible through the official modding api so they require manual installation

stable hearth
#

Ahhhh. That makes sense.

raven epoch
#

does pathfindto2 need something else for it to work?

#

anims and facing and stuff all work its just that the npc itself doesnt move

bright fog
#

Welcome to the hard part of modding zombies: controlling them drunk

raven epoch
#

not modding zombies tho

#

trying to make npcs with isoplayer

bright fog
#

Oh, well idk how IsoPlayer modding works at all

raven epoch
#

i tried the

#

superb survivors's approach

#

not working tho

bright fog
#

I really don't know a single thing about IsoPlayer modding here so I can't help you more

raven epoch
#

ah quick question then

#

is there an easy to way delay something happening?

#

or do i have to do it with tick

bright fog
#

You can create timers using OnTick

#

You can use timestamps to know how much time passed too

raven epoch
#

aw more work

bright fog
#

You can use delta times to know how much time passed from a tick too

#

But better to use timestamps overall

raven epoch
#

how can i use delta times?

#

i was just using tick difference

#

but i realised that can cause bugs with different fps i think

bright fog
small osprey
#

mhh, small question, zombies always target players, never "vehicles" directly hm? zombie:getTarget()
I can probably get the car via the player.

bright fog
#

Nop

#

I mean

#

Yea they don't target vehicles yea

#

But if they target a player inside a vehicle, you can check if that player is in a vehicle

small osprey
#

yeah thats what I mean. Ok. thx

bright fog
#

You can't detect when they attack a vehicle directly, or at least I hadn't found a way back then tho back then I didn't know about anim states and shit like that so you can most likely detect if they are playing an animation related to attacking a vehicle, if there's one