#mod_development

1 messages · Page 47 of 1

swift sequoia
#

Its a shame you can't make hallucinations happen.

sour island
#

Who says you can't?

#

Audio hallucinations would be easy

#

Visuals would just take more work

summer rune
sour island
#

I wonder if you could create a desyncd zombie

#

Like client side only

summer rune
#

u can make a zombie chase a player only client side afaik

sour island
#

Barotrauma has a really robust hallucination system

summer rune
#

i think this desyncs the zombie

sour island
#

My favorite is just seeing fires everywhere

#

SS13 also has a good hallucination system

#

They have clientside players attack you

#

So you'll possibly go out and attack the real one

#

But honestly audio in PZ would be enough

#

Zombie sounds, doors rattling

#

Foot steps

#

Etc

#

Basically the meta events but only 1 player and spooky

#

I might make a dream/nightmare system

echo apex
#

@thorn cipher Your union mod is 10/10 spiffo

ancient grail
#

Yahoo im done with my meth buff lua code!
Hopefully by tommorow i can code the crashing part or the trait for it
Woot finally learned moddata! So happy

rustic jungle
#

hey guys

#

can anyone give me a solid modlist

#

as in, what mods do you guys enable

#

in your playthroughs?

alpine scroll
#

Just to share, I still am not able to update the overlay on the containers when its relevant. Still managing to understand how to do

#

Also, as a different problem, has anyone sucessfully made a freezing container that works on MP?

#

AFAIK every mod that deals with this have the problem of insta-freezing the item instead of working as a regular refrigerator/freezer

alpine scroll
rustic jungle
#

thank you!

ancient grail
#

what does DoSpecialTooltip do?

alpine scroll
#

@sour island Hey, you are the expanded heli person, right?

ancient grail
#

just curious

alpine scroll
#

@ancient grail I checked the mods I have on my server and one of them, MoreBuilds(515555911) use it when you try to build a well. So maybe its that Tooltip like "Dont have enough planks"

alpine scroll
# sour island Yeah

Is it intentional that the heli vests spawn at the Military shop and drop from the heli but you cannot wear them?

#

@drifting ore Sorry, I think I dont understand what you did. AFAIK you subscribe to the mods and then start a sandbox playthrough, where you go to the Mods tab and select them

sour island
#

Try double clicking

vapid atlas
#

So I've been making a vehicle mod, everything on it more or less works ingame, but I've noticed that no matter what I do with the suspension variables, its either stiff as a doornail or collapses in on its weight

#

is there something specific im supposed to put for it, or is it something else?

alpine scroll
#

Which engine power are you using?

#

4400?

vapid atlas
#

4500

#

just a little above

ancient grail
alpine scroll
#

Every time I want to do something I look in the workshop folder

#

Not even sure if it was on my server or some server I joined tbh

alpine scroll
sour island
#

I meant to sit down and figure that out

#

I think it's cause it's using the bag features

alpine scroll
#

Maybe thats why Authentic Z treats bulletproof Vest as two items?

#

You can convert one to another

#

But you cant wear it when its a bag or hold as a cointainer when its armor

sour island
#

Ah, yeah no I hate that lol

#

I'll probably mess with the context menu and give peach stuff

radiant ginkgo
#

What could be the problem? I added items for my car and that only they were put on it, but for some reason the game complains about the condition

#

Nothing help

mellow frigate
#

your item is nil the create failed

sour island
#

Yep

radiant ginkgo
#

nil?

mellow frigate
#

Hi everyone, anyone knows how I can declare a mod dependent to many other mods ? (ingame, not on steam) when I use require=mod1 and require=mod2, only mod2 is required. while require=mod1;mod2 is rejected by the game.

mellow frigate
sour island
# radiant ginkgo nil?

The console says Item = nil, and the highlighted line is trying to check the Condition max of Item

#

Somewhere your item is getting deleted

radiant ginkgo
#

Why? What do I need to do to have in session?

sour island
#

You're not messing with Lua right? Just writing scripts?

radiant ginkgo
#

So yes

#

Just scripts

#

How can an item be deleted if it is registered in the script?

#

Something on the level of incredible

mellow frigate
#

The item type is not available. It is not the instance that is deleted. so somehow item NivaGasTank1 is not part of Base list of items. it probably does not exist at all but it could be part of another item list.

radiant ginkgo
#

Before that, everything worked perfectly, all the items were available to me

mellow frigate
mellow frigate
radiant ginkgo
mellow frigate
#

@ruby urchin also thanx a lot fot the custom moodle exemple I used as a basis for MoodleFramework

radiant ginkgo
#

If I add the digit 1 in the script of car, then the game in can add another digit 3 at the end and there will already be error a Base.NivaGasTank13

#

I don't understand how it all works at all

#

Or it can add 1

twin basalt
#

hey guys, i have another issue im trying to figure out.
in the clothing.xml file, im trying to have an item in an outfit have a static color to it and not be randomized.

i checked with this reference:
https://projectzomboid.com/modding/zombie/core/skinnedmodel/population/ClothingItemReference.html

and came to the conclusion that randomdata should be the field that would correspond to that type of thing

<m_items> <!-- Face -->
    <probability>1</probability>
    <itemGUID>a3a1ca7b-4ded-43fe-be01-dacfdfef68aa</itemGUID>
    <RandomData>
        <m_Tint>lightGray</m_Tint>
    </RandomData>
</m_items>

but it dosent seem to really work...
can anyone help me?

radiant ginkgo
#

I solve my problem

sour island
#

Oh you figured the solution out? What was it exactly?

radiant ginkgo
#

Some parts have a different category

#

I do not know, but the main thing is that it works

sour island
#

Im hoping that guy making a script editor finishes soon

#

I still can't figure out how templates in vehicle scripts work

#

I understand how they should work and what they should be able to do

#

But I have no idea about the specifics

radiant ginkgo
radiant ginkgo
#

Look

sour island
#

I assumed the template needed to be it's own file

#

And that subsequent files calling on it borrowed it's definitions and applied it's own changes rolling forward

radiant ginkgo
#

I have this long text, but I could create a separate file and just write template= NivaWindows\part\NivaWindshieldRear

sour island
#

So the template at the top is defining a new template ?

radiant ginkgo
#

I only see such a plus in these templates

radiant ginkgo
sour island
#

Hm

#

Wouldn't you just be able to override the part?

#

Is 'template =' needed here?

radiant ginkgo
#

And these settings will be on my car and not on others either, template is template, where the example or settings come from

radiant ginkgo
#

It creates basic settings for my car and indicates that this car has this part

#

Part it is not needed

sour island
#

Oh this part is from inside another vehicle script

radiant ginkgo
#

No

viral spire
#

Is it possible to create a version of zombies that are totally blind but have good hearing and can kill you in one hit? Straight up Quiet Place type threat?

sour island
#

The vision code isn't very exposed

radiant ginkgo
sour island
#

I think I'm misunderstanding or there's a confusion

#

Doesn't seem intuitive

radiant ginkgo
#

I don't explain well, sorry, I don't speak much English

viral spire
sour island
#

You can turn their activity off

#

Until there is noise made but it's like they then can see

#

So it wouldn't work in MP the way you'd want

#

I.e. staying still and letting other people attract them

#

The zombies would just see everyone

#

Unless they change how vision works

#

Scent of blood may provide a better way I suppose

#

But that may also be buffing zombies to all near by players accidentally too

dim geode
#

whoops posted it in wrong place lmao

vapid atlas
#

So with my current vehicle mod, apparently the car features zero suspension sway of any sort no matter what I change in its parameters compared to the vanilla car. What on Earth even dictates vehicle sway with the game engine?

tardy wren
#

Hmmm... Center of mass perhaps?

#

Assuming the cars are an attempt at modelling realistic physics

vapid atlas
#

I only moved the thing up a bit, it doesn't seem to change much when I move it higher, apart from the collision going into the stratosphere with it

bronze yoke
#

does anyone know if there's a benefit to packing items and textures into a texture pack? i think it's mandatory for tiles, but does it save memory/performance/anything for other textures?

sour island
#

@hearty dew

tbc56 commented 16 hours ago
after recent update any normal chat in /say is no longer displaying for anyone other than the speaker. Chat isnt recorded in the log and it seems to be treated as speech done from the mod

#

Why would this be happening?

#

I have this at the top ```lua
if isServer() then return end

#

other than that this shouldnt be breaking say/

--- Apply filters to process say
local original_processSayMessage = processSayMessage
function processSayMessage(command, ...)
    command = ConditionalSpeech.Speech(getPlayer(), command)
    return original_processSayMessage(command, ...)
end
``` I would think?
#

hmmm

velvet copper
#

Are there any other car pack mods like filmbusters?

sour island
#

a case of user error?

#

ah it was a sandbox option issue

radiant ginkgo
vapid atlas
#

bad news:

radiant ginkgo
#

Uh

#

You didn't have to change the size parameters

vapid atlas
#

apparently thats how it works now

#

everything else except the size parameter did nothing

coarse nacelle
#

hey, is there a way to define recipes using lua instead of the .txt scripting system?

summer rune
#

is there a mod or easy script to prevent any damage to player build structures (doors, windows, walls) by other players?

coarse nacelle
#

also does anyone have an example of a mod adding a foraging item that works in the latest version? I'm comparing my code to the game's code and I don't see why my items aren't showing up

coarse nacelle
# summer rune is there a mod or easy script to prevent any damage to player build structures (...

I don't think there's a good way of doing this without causing a ton of lag. In theory you could do like injury mods do and track every structure's HP and check if it was damaged by a player every tick by comparing its old state to its current state, but that would probably be laggy. Ideally there would be a onHit hook that we could use that had the target and dealer passed in for stuff like this but without a hook like that I think itll probably be a laggy onTick hook even if there is a way to implement it

summer rune
coarse nacelle
summer rune
#

But u can hook into the java functions. I just dont know how the one for damaging player structures is called

coarse nacelle
#

these are the hooks exposed to lua, you can't (easily) hook into java functions

#

there is one for when an IsoGameCharacter hits another... I don't remember if constructions are IsoGameCharacters though

summer rune
#

IsoBarricade maybe?

coarse nacelle
#

that's probably what it is, but there's no hook for onHitThumpable (which would be what you want)

summer rune
#

WeaponHit​(IsoGameCharacter gameCharacter, HandWeapon handWeapon)

coarse nacelle
#

🤔

#

ok how about this

#
  1. save the state of all player constructions
  2. hook onWeaponHit and whenever it fires, search for all player constructions within range of the weapon's range
#
  1. compare the saved state with the new state, and if there's a difference revert the state to the old state
#

that might get laggy if there's a bunch of players shooting with long range rifles close to player bases, but better than doing that same logic in an onTick

summer rune
#

is the following not possible?

#
IsoObject_WeaponHit = IsoObject.WeaponHit

function IsoObject.WeaponHit(self, gameCharacter, handWeapon)
    local thisObject = self

    if instanceof(thisObject, "IsoWindow") or instanceof(thisObject, "IsoDoor") or instanceof(thisObject, "IsoBarricade") then
        return
    end

    IsoObject_WeaponHit(self)
end

coarse nacelle
#

someone who knows better than me would have to comment, but I don't think you can override java functions from lua like that

#

ah, and I answered my own question about foraging

#

it got moved(?) to forageDefinitions.lua

astral dune
summer rune
astral dune
#

not without modding the java directly

coarse nacelle
weak sierra
#

anyone tell me why this doesnt show the translation strings in-game?

#

file on the right is at UdderlyVehicleRespawn/media/lua/shared/Translate/

#

looks at one of her other mods

#

oh.

#

EN folder.

#

shakes head in annoyed

bronze yoke
#

oh that is a cool fucking text editor

weak sierra
#

hehe i like it yeah

coarse nacelle
#

is there a place for feature requests?

swift sequoia
#

I just use notepad++. I followed the guide in chat history for using IntelliJ to decompile the game java, but frankly I don't like IntelliJ. I'm more of an Eclipse user.

#

I'm sure my aggravations are just ignorance for using IntelliJ, but damn does it aggravate me.

green berry
#

hey guys maybe a dumb question but does anyone know what is the unique identifier for a given BaseVehicle ?

#

nvm i missed the getId()

astral dune
#

keep in mind that doesn't persist between loads

green berry
#

does any does ?

astral dune
#

uhh, I think there is an SQL ID, which should be persistent I imagine

green berry
#

true ! getSqlId()

#

thanks (again), i'm going back 🙂

coarse nacelle
#

is there a debug option for the foraging system so I can see hidden items and just walk to them?

#

so I can test the foraging tables that I just made

#

ah I think I found it nvm

swift sequoia
#

omg that zombie just instant killed me.

coarse nacelle
#

hey, so I added some foraging items, but when I gather them it shows up as <somepath>.png not the item in the overhead bubble

#

how do I get it to show a friendly name?

river geyser
#

Hello! I'm sorry to ask what is probably a repeat question. Google searches for the issue often ended with 'ask on the discord!' with no follow up, and a search here hasn't uncovered the solution either.

I'm attempting to make a simple mod to add some alternative food items. In this case, cans of soda. I have added the first item and I am able to find it in the world, I can manually spawn in it in debug mode, it has an icon, and when I drink the soda, it appears to have the custom texture I have provided. However, if I place the soda on the ground, it is invisible during the placing. Once I click to place the item it shows up as the icon image instead of the 3D model.

Is can someone help me understand what I am doing wrong?

{
    imports    
    {
        Base
    }

    item BeefAid
    {
        DisplayName            =    Beef-Aid,
        DisplayCategory        =    Food,
        Type                =    Food,
        Weight              =    0.3,
        Icon                =    BeefAid,
        FoodType            =    SoftDrink,
        DisplayCategory        =    Food,
        CantBeFrozen        =   TRUE,
        EatType             =   popcan,
        Packaged            =   TRUE,
        ReplaceOnUse        =   PopEmpty,
        HungerChange        =    -10,
        ThirstChange        =    -70,
        UnhappyChange        =    -12,
        Calories            =   140,
        Carbohydrates       =   39,
        Lipids              =   0,
        Proteins            =   0,
        CustomContextMenu   =   Drink,
        CustomEatSound      =   DrinkingFromCan,
        StaticModel         =   BeefAidCan,
        WorldStaticModel    =    BeefAidCan,
    }
}```
#

I do have the model and texture named appropriately as far as I can tell
[MODPATH]\media\models_X\BeefAidCan.X
[MODPATH]\media\textures\BeefAidCan.png

Also, the model is copied from ProjectZomboid from PopCanRed, so I don't believe the model is corrupt, but I don't know if it needs something else to define the texture on the model. Since it shows up during drinking I think not... but I'm pretty lost. Thanks for any help in advance!

ruby urchin
#

You can see examples on ..\ProjectZomboid\media\scripts\models_items.txt

river geyser
hearty dew
hearty dew
hearty dew
ancient grail
hearty dew
#

Can use this to patch java class methods @summer rune

ancient grail
undone crag
#

Can you patch a java method before the base game Lua loads? (without overwriting a base-game file, which I think might work)

coarse nacelle
#

you can add things to a building's right click menu right?

undone crag
#

Yes, there's either a lua event for it here https://pzwiki.net/wiki/Modding:Lua_Events, or an event-like thing in a lua file for the building right click menu. You could use it something like this

function myFunction(however_many_arguments)
  --stuff
end
Events.Whatever_it_is_called.Add(myFunction);

(unless I made a mistake or something. farewell.)

coarse nacelle
#

ok tyvm, I'll look into this and see if there's something that does what I want

hearty dew
#

see the lua load order

coarse nacelle
#

ok, I can copy what the generator does. ty @undone crag

undone crag
#

Alas, for I was thinking about changing BodyLocations.getGroup("Human").getOrCreateLocation. 😔 which is used in base game shared

undone crag
coarse nacelle
#

nope, what I want to do is exactly what the generator already does

undone crag
#

:o

ancient grail
#

Cars tiles players item weapons containers

What else can we use to store moddata

If i have a delay timer that i want to be persitent even if people login and out or if the server restarts

How can i do this?

hearty dew
#

Can use global moddata for the timer

#

For individual moddata, you can look at all java classes that derive from IsoObject. IsoObject implements the moddata methods

humble oriole
#

Is anyone familiar with how the herbalist magazine applies the trait to the character? I'm looking through the code and I'm not seeing how it does it.

#
    herbalist:getFreeRecipes():add("Herbalist");
#

I found that, but it's part of the character creation page

#

I want to create a magazine like The Herbalist that applies a specific trait to a character.

hearty dew
#

Traits, as far as I remember (someone please correct me), are just a data structure with a list of strings representing the player's active traits. The magazine probably just adds the trait to it

humble oriole
#

I'm sure that's the case, just trying to figure out how it does it xD

#

Same with the generator mag

    {
        DisplayCategory = SkillBook,
        Weight    =    0.1,
        Type    =    Literature,
        DisplayName    =    How to Use Generators,
        Icon    =    MagazineElectronics02,
        TeachedRecipes  =   Generator,
        ReplaceOnUse    =   ElectronicsMag4,
        StaticModel = Magazine,
        WorldStaticModel = MagazineElec4Ground,
    }```
#

TeachedRecipes = Generator,

#

Is that calling something in the lua or even Java, or does that just naturally apply the trait

bronze yoke
#

doesn't the magazine just teach you the recipe, not give you the trait?

humble oriole
#

For the Herbalist and Generator it provides a trait

bronze yoke
#

all the functionality comes from the recipe, the trait just gives you the recipe

humble oriole
#

After reading the herbalist mag

bronze yoke
#

oh hmm

hearty dew
#

Most of the other code checks if the player has the recipe

#

to determine whether a herbalist or not

#

but, indeed there is a trait too

hearty dew
#

And is also the electrician trait that teaches the Generator recipe

humble oriole
#

yea, I saw that too

bronze yoke
#

i can't work it out - can't find anything special about the herbalist recipe, the trait, or anything that would do this in the functions for reading a book

humble oriole
#

I wonder if there's a Herbalist recipe like the generator.

bronze yoke
#

one thing i'm thinking about actually

#

i remember there was a bug before where the new foraging system checked for the herbalist trait, not the recipe, so the recipe didn't work for a while

#

so maybe the trait you're seeing is fake?

#

i don't see how that could have happened if the magazine actually gave you the trait

#

unless that's how they fixed it, i guess

humble oriole
#

How to use Generators gives you the Generator Expert trait as well

hearty dew
#

Oh, hey, albion. Didn't recognize you with the diff avatar until now 😅

humble oriole
bronze yoke
#

haha yeah i don't usually have an anime boy profile picture

#

you're running a mod, that's not vanilla

humble oriole
#

Herbalist is Vanilla though

bronze yoke
#

i would suspect it doesn't give you the trait in vanilla

#

i'll have a look for you

humble oriole
#

hmm

bronze yoke
#

yeah, it doesn't

humble oriole
#

damn

bronze yoke
#

if you want to have a book grant a trait, the public version of my literacy mod still has a book that removes a trait

#
ReadLiteracyMag = ISReadABook:derive('ReadLiteracyMag')

function ReadLiteracyMag:update()
    local pagesRead = math.floor(self.item:getNumberOfPages() * self:getJobDelta())
    if pagesRead >= self.item:getNumberOfPages() then
        self.character:getTraits():remove('Illiterate')
        if ISCharacterInfoWindow.instance then
            ISCharacterInfoWindow.instance.charScreen:loadTraits()
        end
    end
    ISReadABook.update(self)
end
```probably should have put that on perform() not update()... but still
#

and then i had a custom context menu option that would trigger my time action instead of the vanilla book reading one - since this was to get rid of illiterate i didn't have to work out how to hide the old one, though

weak sierra
#

it's a hidden recipe

bronze yoke
#

this is honestly not that well written so i don't know if i should be sharing this code as a guide LOL

humble oriole
weak sierra
#

the trait gives you the recipe as does the book

#

mk

#

wish i was here to let u know sooner lol

humble oriole
#

I see how Hea did it in SOTO

#

hmmm

weak sierra
#

self.character:getTraits():add('Something') i think is probably what they need tho

#

today i learned you can use single quotes in lua for a string

humble oriole
#

in linux that usually helps with special characters I'd imagine it does the same

bronze yoke
#

yeah i exclusively use single quotes because i'm annoying

weak sierra
#

if only it were so easy to remove a trait from the selection screen

#

i come from C# land so single quotes means char to me

#

as it does for those who live in similar places

#

'a' and "apple"

#

etc

humble oriole
#

I'm a heathen and come from bash/perl :p

weak sierra
#

bash ain't a damn language

#

;p

humble oriole
#

YOU CAN WRITE FUNCTIONS "FUNCTIONS"

weak sierra
#

uh-huh

bronze yoke
#

i'm from c++ (with some healthy python) but i've been working on zomboid stuff almost exclusively for the last year or so

weak sierra
#

me too

#

and last year it was rimworld

#

lol

#

the last year bit, not the c++ bit

#

C++ is the only c family language i havent gotten to

#

ive poked it, but that's about it

bronze yoke
#

to be honest, i was probably pretty crap at c++, i don't remember actually doing too much with it, i guess i'm just from python

#

but in *theory* c++ is my main language

weak sierra
#

python was where i started

#

well

#

gamemaker 5.3a was where i started

#

but

coarse nacelle
weak sierra
#

oh just "and the entire class system"

#

lol

bronze yoke
#

i got started messing around with toontown stuff, which is an mmo programmed in python 😨

humble oriole
#

I think I took C++/VB at the same time in college before I took Java, C++ as a first language was tough

weak sierra
#

when i did C i did C89 tho

coarse nacelle
#

you can still write classes in c btw

weak sierra
#

so it's a bit more of a leap

bronze yoke
#

oh yeah i suppose i did a bunch of vb in college

humble oriole
weak sierra
#

but yeah between C and C# i can probably fudge my way through C++ at this point

bronze yoke
#

yeah i've used c# a bunch for unity and i never got deep enough to care about the difference

#

other than syntax of course

weak sierra
#

C# is the most beautiful language ever written fight me

bronze yoke
#

yeah i can't say i love c++ syntax

coarse nacelle
weak sierra
#

caveat: i haven't tried rust and go yet

#

yeah

#

i hear they are very similar

#

and good

#

i do plan to try them

coarse nacelle
#

idk, their underlying structure is pretty different

weak sierra
#

i've had ppl tell me it's similar enough

#

i wouldnt know

coarse nacelle
#

like go doesn't have classes for instance

weak sierra
#

might have been morons lol

coarse nacelle
#

I'm inclined to think they might not know what they're talking about, but that's just me

weak sierra
#

yeah

bronze yoke
#

line terminators bug me more than they should

humble oriole
#

hmm, is there an "OnRead" for books like there is an "onCreate" for recipes?

humble oriole
bronze yoke
#

i can't say it's too hard for me to get used to using them, but i just don't like how they look

humble oriole
coarse nacelle
bronze yoke
#

you could use the dark arts

coarse nacelle
bronze yoke
#

actually it's a bit overkill, you can just hook ISReadABook:perform()

humble oriole
#

SOTO does it by doing a everyoneminute check

humble oriole
coarse nacelle
#

soto?

humble oriole
#

Simple Traits and Occupations

coarse nacelle
#

there's nothing outside what are you talking about?

bronze yoke
#
local old_perform = ISReadABook.perform

function ISReadABook:perform()
    if self.item:getType() == 'Mod.Whatever' then
        -- add a trait or something
    end
    old_perform(self)
end
coarse nacelle
#

oh, I was talking about more traits not simple traits

humble oriole
coarse nacelle
#

yeah, I think most mods right now use really bad triggers

bronze yoke
#

yeah i don't know the exact workings of that mod but that doesn't sound like the best way to do things

coarse nacelle
#

I was working on more traits recently and I think there's is an on tick for things like evasive, there's probably a better trigger for that

humble oriole
#

Sorry, I'm still really new to modding

bronze yoke
#

every time you finish a book

humble oriole
#

oh, that's not bad

bronze yoke
coarse nacelle
humble oriole
#

Honestly, I just want to create a magazine and apply a trait from a different mod

bronze yoke
#
local old_perform = ISReadABook.perform

function ISReadABook:perform()
    if self.item:getType() == 'Mod.Whatever' then
        self.character:getTraits():add('TraitName')
    end
    old_perform(self)
end
weak sierra
#

is there a tool to visualize vehicle zones in debug mode?

#

i almost never use debug mode

humble oriole
#

yes

weak sierra
#

cool

#

where is that

#

:)

humble oriole
#

it's janky

#

but so is debug mode lol

weak sierra
#

i wrote a whole vehicle respawn mod blind

humble oriole
#

function ISReadABook:perform()
    if self.item:getType() == "APBPack.Locksmith_Ledger" then
        self.character:getTraits():add("Locksmith")
    end
    old_perform(self)
end```
weak sierra
#

i dont even know where zones line up

#

i should uh

#

look at them

#

:)

humble oriole
weak sierra
#

yeah i meant to do that today but other things happened

#

i did just fix some bugs

#

planning to get to that tomorrow

humble oriole
#

you'll get it done when you get it done lol ¯_(ツ)_/¯

weak sierra
#

yeah

#

im really.. chaotic and work in spurts

humble oriole
#

are you going to add scene cars to a built in blacklist?

#

they're completely nonfunctional

weak sierra
#

scene cars are their own vehicle scripts? i thought scenes were just normal vehicle scripts

#

or do u mean wrecks?

humble oriole
#

I'm pretty sure it was a scene car. You couldn't get in it, but it was like max health and you could take parts off it

#

it was a vanilla car

weak sierra
#

i was unaware that that was a thing

#

:|

humble oriole
#

I should've taken a picture of it, sorry

#

it had a special name that I wasn't familiar with

#

let me jump in debug and see if I can duplicate, I don't want to talk about of my ass xD

#

does anyone know how hard ZombRand() hits the system?

#

usually 1-100 or so

hidden jungle
#

so. i enabled a bunch of mods and now the game is just a black screen. relaunching didnt work.
is there a way to launch zomboid in a safemode that doesnt use mods?

bronze yoke
#

like performance-wise? i wouldn't worry about it

humble oriole
#

yea

bronze yoke
#

in general i wouldn't worry too much about performance in that way, if a mod runs poorly it's probably because of some silly loops or running more often than it needs to than the actual function

#

not that you shouldn't optimise, but only the big things really matter

humble oriole
#

I wrote a lootbox mod for our server, and you can imagine I've got a lot of calls to ZombRand, but they're segregated into functions so they only get called when the recipe to open that specific lootbox is called.

bronze yoke
#

generally, the most efficient way to do things is also the one that's easiest to write and follow

#

(or close enough, anyway)

humble oriole
#

@weak sierra

#

except when the mod spawned it, it was 100%

weak sierra
#

PickUpVanLightsFire

#

so what are these, special things for challenges or something?

humble oriole
#

nah, they're vehicle scenes

tardy wren
#

You mean for stuff like car crashes you find on the road?

humble oriole
#

from Debug

weak sierra
#

what's wrong with those spawning

humble oriole
#

sorry the game calls them "storys"

tardy wren
#

Sure

humble oriole
#

they don't act like normal vehicles

weak sierra
#

if they're on the map naturally

tardy wren
#

But you can still scrap them

weak sierra
#

why should i care if they are on the map unnaturally

weak sierra
tardy wren
#

They're still potentially a bit of loot/parts/fuel

weak sierra
#

they will despawn like any other vehicles

#

if you see them then ignore them

#

so i dont think it's a problem?

#

i do need to add condition stuff to the respawn mod

tardy wren
#

Maybe you can slap that into the options you're making?

weak sierra
#

yeah

#

if i can find a way to identify these that'd be nice

#

cuz if they just appear in with NORMAL cars

#

oof

#

i imagine they're in with burnt or wrecks

humble oriole
#

oh, you know what I bet happened

weak sierra
#

?

tardy wren
#

No

humble oriole
#

I have that crashed cars mod, and one of these spawned, but it was a "wrecked car" so it was a scene car, but "wrecked"

ancient grail
#

i can only do the emote ive been trying to figure out how to use setvariale

weak sierra
ancient grail
#
function SearchJunkTimedAction:start()
    self:setActionAnim("Loot")
    self.character:SetVariable("LootPosition", "Low")
    
    self.character:reportEvent("EventLootItem");
end
weak sierra
#

so that in the future one can identify by looking at mod data

ancient grail
#

doesnt work

weak sierra
#

i guess u'd have to have a tool to look at the mod data for that

#

i do tho

#

:p

#

others can look in debug ig

humble oriole
#

it doesn't matter either way, cause if I'm running respawns I'd have salvage on and I'd just tell them to salvage it.

weak sierra
#

yup

#

or ignore it and it'll go away if nobody sees it in a while

#

built-in solution there

#

drag it into the woods lol

humble oriole
#

oh, I was going to ask, does it count "wrecks" as a car or does it spawn another wreck

bronze yoke
weak sierra
#
- Option for toggle between whitelist vs. blacklist
- Option for percentage chance of a vehicle being a wreck/burnt vs. normal.
- Tag vehicles with moddata if they are spawned by the mod so that admins can id them if necessary for troubleshooting/reporting bugs.```
weak sierra
#

it has an even chance to spawn any vehicle at any place anytime one is spawned

#

at present

#

i could add a bias toward more wrecks when removing wrecks and more normal cars when removing normal cars

#

but

#

that would be annoying cuz every salvage/dismantling mod i support has its own code block

#

and will have its own code for grabbing which car it was

#

hah

#

hopefully not that bad

#

but yeah

#

anyway if that's desirable i could make it happen

#

as an option

#

i think there should always be a chance of one or the other though

humble oriole
#

nah, I don't think it's a big deal

humble oriole
#

the main issue with cars in general is that there's X amount of cars in the world, which means, there's X amount of metal in the world from cars

weak sierra
#

yeah

#

not with my mod tho :P

humble oriole
#

exactly

weak sierra
#

im moving my server to use Vehicle Repair Overhaul i think

humble oriole
#

yea, we did

weak sierra
#

it seems more balanced re: salvage

#

i just pushed support for that tonight btw

#

sorry it took so long

#

xD

#

wasn't hard, just so busy

humble oriole
#

he's also super responsive, I asked him to give us a sandbox option to disable salvage and he had it like 2 days later

weak sierra
#

so u cud yeet it temporarily?

#

hehe

#

that's good

#

well no need now, it's in place

#

tested it

#

if u want me on hand on ur server to chat up about stuff

#

feel free to invite me

#

if u have a modding section or etc

#

then if u have issues it'd be easier to get in touch

#

up to u ofc

humble oriole
#

Sure, I'll make a segregated area.

weak sierra
#

most pz servers have a developer section of some kind

#

in my experience

#

then u can request things and ping me to report things, etc.

#

oh god i looked away and it's 2:30am

#

big f

humble oriole
#

Yea, I'm on nights right now, so I've got another 6.5 hours of work haha

weak sierra
#

gn

humble oriole
ancient grail
#

it works now

#

you want the code

#

?

#
function SearchJunkTimedAction:start()
SearchRecyclables()
    self:setActionAnim("Loot")
    self.character:SetVariable("LootPosition", "Low")    
    self.character:reportEvent("EventLootItem");
end
#

it actually worked

#

the thing is i forgot to call the function for doing the stuff

#

lol

ancient grail
#

What is agood approach to coding something that stops hunger from increasing without overwritting function?

ancient grail
weary matrix
#

Hi there, just to let you know the domain zomboid-javadoc.com is going to expire on the 23rd of december. If you're using the website please consider making a donation on my ko-fi (see my discord profile). If no one cares I'll just drop the website.

lunar robin
#

Is setName() suitable for changing character's name?

#

I'm currently trying to implement a function to automatically change character's name and surname on OnCreatePlayer event trigger.

white perch
#

Anyone else having any issues making music for the music mod? when i tried to ran the exe file to add my music to the mod for MP it caused my entire PC to essentially die and all the mod could tell me was there was a problem with the files

civic lava
#

Once again, & very seriously so, you have helped me a huge amount allowing me to code what i wanted without errors, i was so close & i knew it, you simply gave me the wording & THATS HUGE! i would've prob given up before coming up with those exact "phrases" so a serious thankyou for helping me when noone else would!

#

my 2 traits will be refined, unlisted, & you allowed me to play with my friends under the conditions they desire aswell, so u helped more then just me

#

big thanks!

ancient grail
ancient grail
#

depends on what you need change

#

i just tested this now using debug and it worked

deft falcon
ancient grail
#
hazmatList = hazmatList or {}
if getActivatedMods():contains("aSampleModWithHazmatSuit") then
table.insert(hazmatList,"Base.HazmatSuitFromSampleMod")
end
#

if you are a server admin and you have ideas of mods with hazmat suit pls assist 🙂

#

i just need to put all posible hazmat suit from diffrent mods

#

into one table

sour island
deft falcon
#

ppl do
x = x or {}
because if x doesnt exist, it makes {}
BUT if it exists, it wont reset it

#

is that true

#

that makes so much sense now lmao

sour island
#

Ye, very handy trick

sour island
#

For the NVG stuff I did, I did both

ancient grail
#

hmmm well its not patching their mod actualy its just enabling theirs to be used as hazmat for my mod i dont think i need to ask everyauthor abt that since im not doing anything with their mod.
im simpling adding their items if the mod exist on the server

deft falcon
#

sweet

ancient grail
#
hazmatList = hazmatList or {}

table.insert(hazmatList,"Base.HazmatSuit")

if getActivatedMods():contains("AuthenticZLite") then 
table.insert(hazmatList,"AuthenticZLite.CEDAHazmatSuit")
table.insert(hazmatList,"AuthenticZLite.CEDAHazmatSuitBlack")
table.insert(hazmatList,"AuthenticZLite.CEDAHazmatSuitBlue")
table.insert(hazmatList,"AuthenticZLite.CEDAHazmatSuitRed")
table.insert(hazmatList,"AuthenticZLite.NBHHazmatSuit")
table.insert(hazmatList,"AuthenticZLite.HazmatSuit2")
end

if getActivatedMods():contains("Authentic Z - Current") then
table.insert(hazmatList,"AuthenticZClothing.CEDAHazmatSuit")
table.insert(hazmatList,"AuthenticZClothing.CEDAHazmatSuitBlack")
table.insert(hazmatList,"AuthenticZClothing.CEDAHazmatSuitBlue")
table.insert(hazmatList,"AuthenticZClothing.CEDAHazmatSuitRed")
table.insert(hazmatList,"AuthenticZClothing.NBHHazmatSuit")
table.insert(hazmatList,"AuthenticZClothing.HazmatSuit2")
end

if getActivatedMods():contains("TheyKnew") then
table.insert(hazmatList,"TheyKnew.MysteriousHazmat")
end
ancient grail
#

but i havent seen it used on other types excpt table

#

and array i think

ancient grail
#

i wonder if i really need to put the getactivated mods cuz it might not trigger an error if it only checks if the player is wearing 1 of the suits

#

so if it doesnt exsist then it might not trigger error?

#

anyone knows a code to check two tables if theres a match .. so basically i want to check all of getPlayer():getWornItems():getItem()
and check if one of the items is from the hazmatlist

fast galleon
#

yes pretty much saves you a line of if
another popular one is
x = TrueOrFalse and A or B

ancient grail
#

How is it something whilebeing something else?
X = gettype() and x == true or x ~= nil.

#

Haha just guessing

fast galleon
#

it's like

if x then x = A else x = B end
ancient grail
#

Ahhhh

#

Thnx for the info

honest oar
#

What's the mod where people can carry ingame stuff? I want plants in my house :c

ancient grail
#

Try the pushcart mod

thorny marsh
#

How hard is it to code in lua

deft falcon
#

you could make a loop of ur table that uses that function

ruby urchin
deft falcon
#

t is table

#

e is the thing u look if that table has it

ancient grail
#

im kinda stuck lol

#

ow ok ok

#
for _, value in pairs(t) do
if tableContains(hazmatList, getPlayer():getWornItems():get(i):getItem()) then
return true end
end
#

is this correct? @deft falcon

deft falcon
#

no

deft falcon
#

then do

#
for _, item in pairs(hazmatlist) do
if tableContains(getPlayer():getWornItems():getItems(), item) == true then
break
[code for when character has hazmat]
end
end
#

@ancient grail

#

i think u can break from for loops

#

yea so do that

ancient grail
#

i just need to return true

#

its an ontest

fast galleon
#

it looks like wants to iterate through an array though, so

my item = array:get(i)
...
deft falcon
fast galleon
#

I'm behind on them messages

ancient grail
#
function Recipe.OnTest.isHazmat(item)
for _, i in pairs(hazmatList) do
if tableContains(hazmatList, getPlayer():getWornItems():get(i):getItem()) then
return true 
break end
end
end    
deft falcon
#

oh that works too

ancient grail
#

yey thnx alot man

#

now for the oncreate which is me for the first time modding setused delta

fast galleon
#

is tableContains Lua?

ancient grail
#

function Recipe.OnCreate.ProduceMeth(items, result, player)
local tank = nil;
for i=0, items:size()-1 do
if items:get(i):getFullType() == "Meth.FreonTank" then
tank = items:get(i);
end
end
result:setUsedDelta(tank:getUsedDelta() + result:getUseDelta() * 30);
while result:getUsedDelta() < 1 and tank:getUsedDelta() > 0 do
result:setUsedDelta(result:getUsedDelta() + result:getUseDelta() * 30);
tank:Use();
end
if result:getUsedDelta() > 1 then
result:setUsedDelta(1);
end
end

ancient grail
#

cuz looking at the pz lua it doesnt have anything of that sort

#

ow snap i did

#

so if this doesnt work then im back to square one ill try it now on debug hehe

#

or i think i just need to make 2 for loops

deft falcon
#

add this to top of ur code

#

local function tableContains(t, e)
for _, value in pairs(t) do
if value == e then
return true
end
end
return false
end

#

@ancient grail add this at the top of your code

neon bronze
#

anyone knows how you get the text from those translate filess? Apparently calling getText doesnt work always?

ancient grail
#
function Recipe.OnTest.isHazmat(item)
    for i = 0, #hazmatList - 1 do
        for c = 0, getPlayer():getWornItems():size() - 1 do
            if hazmatList[i] == getPlayer():getWornItems():getItemByIndex(c):getFullType() then
                if isDebugEnabled() then
                    print(hazmatList[i]);
                    print(getPlayer():getWornItems():getItemByIndex(c));
                end
                return true;
            end
        end
    end
end

#

got it to work

#

figured that 2 for codes will work and also my variable was off

#

i needed getFullType()

#

first i tried getClothingItemName()

#

it prints but it wont match the one from the table i did

#

sinc ei did use fulltype

#

tableContains just doesnt work btw

summer rune
#

when I use thisObject:getHealth() to get the current health of the door, it works. if a zombie starts hitting it, and I call the method again, it also works. it shows the new reduced health. however if I, as a player, start hitting it, then the value from thisObject:getHealth() does not show any changes. HOWEVER if I keep hitting it, I destroy the door nonetheless. Meanwhile it still showed max HP. How? What am I missing

ancient grail
#

since there is the zombie door damage sandbox so it might be cuz of that

#

like if its disabled for zed to destroy doors

#

but thats just my guess

fast galleon
deft falcon
#

to add that piece of code i sent

ancient grail
#

and when i read that part of the chat i had success with the code i did

#

let me check it again

#

ahh wow this works too

#

nice

#

thnx

#

can i keep it as a util ? 🙂

deft falcon
#

mhm

#

wait what does util mean

lyric bolt
#

Hey could someone point me in the right direction of making arsenal attachments compatible with another weapons mod? Just am curious how you would even add one to a new weapon

ancient grail
deft falcon
#

yea u can

ancient grail
#

im reading about pairs and ipairs im not sure if i truely understand the concept.. but for me as long as for i works then thats where im going haha

summer rune
#

this is the call in the java door class on the weaponhit event from players this.Damage((int)(handWeapon.getDoorDamage() * 2.0f * n));

and this is the damage method in the door class:

void Damage(final int n) {
        this.DirtySlice();
        this.Health -= n;
    }
dusk sonnet
summer rune
summer rune
ancient grail
#

ahhh gotcha

jaunty marten
# ancient grail ```lua function Recipe.OnTest.isHazmat(item) for i = 0, #hazmatList - 1 do ...

better to do (optimized way)

local hazmatList = {
  ["item1_class"] = true,
  ["item2_class"] = true,
  ["item3_class"] = true,
}
function Recipe.OnTest.isHazmat(item)
  local items = getPlayer():getWornItems()
  for i = 0, items:size() - 1 do
    local item = items:getItemByIndex(i)
    if hazmatList[item:getFullType()] then
      if isDebugEnabled() then
        print(hazmatList[item:getFullType()])
        print(item)
      end
      return true
    end
  end
end
ancient grail
#

right

#

why does it have to be optimized tho

#

i dont think its a havy code anyways since there are only a few gasmask and only a few items on a character

jaunty marten
#

u can use ur method but it's good to u as dev to know optimized ways to do iterations and etc

ancient grail
#

Isee ok then

swift sequoia
ancient grail
#

Yep thats what i thought so i noted your version down

Perhaps ill change to it later on but for now i want to proceed with the usedelta part as i dont know a thing about it yet
Im still far from finish woth this mod. But im certain i get this mods lua code done within 3days

ancient grail
deft falcon
#

what r u trying to do btw

ancient grail
#

A drug mod
Includes weed meth heroin

swift sequoia
ancient grail
#

Including production
The weed part for now is unsure if we continue

#

ownalso cocaine
I have the meth effects done

#

Iwas suppose to do the heroin effect but ended up starting with the proccess of ontest haha just cuz i thought it would take a long time to gather data of mods with hazmats

#

My idea of the heroin effect is to allow player to go afk without worrying about logging out
So basically it will make the player not be able to move
And then hunger and thirst moodles stop increasing
Then other moodles like stress and fatigue gradually reduce till the player wakes up
So its an alternative to sleep but has a diffrent way to it
I plan to have the dosage set to 5mins 10mins 15mins

#

The meth effect i did was the player gets 4 traits
Fast reader ,speed demon,light eater and dexterous

Then after the drug wears off reverts to the players original traits like if they have the negative mutual of these traits
And made sure that if a player decides to logout they will revert back to their setting preventing potential exploit

#

Im not sure if someone else had the same ideas for afik my concepts are original 🙂

dusk sonnet
#

You should include fentanyl and all it does is make the player immediately OD and die lol

ancient grail
#

Idk what dat is but
This is a comission mod btw so i have a scope to follow and limited creative freedom
I dont with to add to the scope if its alot of work but if a budget would be approve to do this then why not

#

Heroin can overdose right i should add that

dusk sonnet
#

Fentanyl is an opioid that is becoming increasingly common to mix with heroin and cocaine. It's a pretty big problem where I live. You can definitely OD on heroin and coke, though

ancient grail
#

But! Wait logicaly its imposible

Since you cant move once u took the dose
.. not unless i make the effect of not being able to move a bit delayed

#

Ah havent heard about it. Not sure if kentucky has that too
Since the server im doing the mod for is RP server and they are set to kentucky

dusk sonnet
#

I'm sure it is, but it really began to become more prominent in the past few years, so if they're sticking to the 90s theme then it's irrelevant

ancient grail
#

Yep that too

#

Any ideas how useddelta works as far as i know its 0-1 1 being full

#

But this is probably easy to figure out
Im stuck on the animation part really. I cant seem to make the player lie down without staggering

#

I should probably require trueactions

summer rune
#

how can i easily print out all values/properties of an IsoDoor ?

ancient grail
#

Have u tried getProperties()

#

What r u trying to do to a door btw

summer rune
#

i am hitting a door with an axe, and i want to implement a feature that players can see the remaining HP of their build structures

ancient grail
#

Wow

summer rune
#

so they can prepare for raids

#

i already increased the Max HP of all structures. now they need to hit a wall for like 20 minutes.

ancient grail
#

There might be a chance that it resets tho

summer rune
#

the door breaks after hitting it for 2 minutes with an axe. however the displayed HP never changes. only if trigger a zombie and the zombies hits the door, then the hp value goes down.

ancient grail
#

Back when i was i still playing this game i noticed that some zed hit the same door but i manage to stop them everytime so it dodnt break but the other door broke with i think less hits if i add all the dmg the first took from diffrent occurance of atk

summer rune
#

but i can still break the door. and increased Health value works as well, i need to hit it longer

fast galleon
ancient grail
#

I would conduct experiment

Try making a new door count how many times a zombie hits before breaking

Then doing the same thing with just half dmg then teleport away then go back
Then count again

If my theory is correct then it will reset the hp

summer rune
ancient grail
fast galleon
#

yeah no idea

summer rune
#

and if a zombie hits the door , then the value goes down

#

totally weird

civic lava
#

so i think i got this, untill i start to fail for 5 days in a row & get tunnel vision again

#

for now, looks nice & things are going slowly but well

ancient grail
#

Congrats man

snow beacon
#

Any modder want to come work for us?

PZFG - 600+ members.

ancient grail
#

How many modders do you need i can recommend those who i know takes commission too

lunar robin
ancient grail
# swift sequoia lol

Your zeds are modified right?
Must be cool to do crazy things with them
Haha i discovered before that you can reanimate a corpse but on multiplayer it wont work. Howver when you grab it and drop it it will produce both a corpse and a new reanimated zed

civic lava
#

I don't wana be the guy asking dumb questions, but yet i am a dumb guy, with dumb questions
_
local endr = _player:getStats():getEndurance();
^
this results in a print() that =0.9-0.1 rather then what i expected which is 1-100, im willing to tinker for a few hours on it but if anyone has a quick answer it would save me some time!

#

now i dont understand LUA (yet) in full.. but can i do " local endr = _player:getStats():getEndurance( * 100)); "?

#

dont laugh

#

lol

swift sequoia
#

local endr = _player:getStats():getEndurance( ) * 100;

swift sequoia
#

Your mileage may vary. I'm extremely tired and prone to mistakes.

civic lava
#

i assume that means yes? ill give it a try! i instead first am trying
endr = endr * 100;

civic lava
#

thanks again!

swift sequoia
#

I also think lua support endr *= 100 but again, I'm tired and might be mixing up my languages.

civic lava
#

sorry if its looked down upon for a non lua man to request random help when i run into issues, but i do get help from some of you, so until told by a mod that im not allowed to ask the questions i ask ill be seen around these chats from time to time asking relatively simple things

civic lava
#

ty again

swift sequoia
#

Righto. And with that, time to stare blankly at my wall in a vain attempt to sleep with my eyes open. Byebye

ancient grail
#

Be warned redflag

#

Claims to be founder of pz but checked with staff he is not
And he wants me to do the work first before he pays it

#

This is straight up redflag

mellow frigate
#

What is PZFG ? a server community ?

ancient grail
#

So if anyone wants to go proceed with his mod project then the risk is yours and i did my social duty to warn people

The other case i didnt name drop because i wanted to protect him from being shamed on the modding chat as he is a fellow modder
But this case is different as it is straight up scam like
If im wrong then i take full responsibility of doing this person harm
But i take the risk as i want fellow modders to be safe

ruby urchin
#

lol I didn't realize, he took the discord custom URL, probably devs should contact discord support

coarse nacelle
#

I mean, commissioned zomboid mods seems kind of like a red flag already to me

civic lava
#

_player:HasACold ----- means the player is sick right? not just, a level of cold? temperature?

#

as in the player is ill

snow beacon
#

Do your research before trying to work with someone

#

Smh

#

Go ahead y'all. Click it

civic lava
#

lmfao

snow beacon
#

It's to my fan group for pz

#

Not this server

#

Why are people idiots

#

Smh

coarse nacelle
#

<@&671452400221159444> can one of you take a look at this?

snow beacon
#

Yes please do

#

It's not to this server

#

It's to my fan server?

#

PZFG stands for Project Zomboid Fan Group. The name is Project Zomboid Fan Group

#

Nowhere do I claim to be the creator of project Zomboid

#

Nowhere in my discord either

#

It's some idiot taking it out of proportion

coarse nacelle
#

I mean.. it looks like you do unless project zomboid is the fancy link to your fan server

snow beacon
#

It is

#

Should I add to my bio it's a fan group?

#

Cause that's literally what it is

coarse nacelle
#

okay, but wouldn't it do the community more good if you gave that fancy link to this server and picked a new one?

snow beacon
#

Project Zomboid never took it. It was available way after Project Zomboids discord was even made

#

If PZ wants me to change it I can

#

But I won't change it till otherwise told to

coarse nacelle
#

idk, seems pretty suspicious to me not going to lie

snow beacon
#

Im not trying to be PZ. I don't even want be them. It's only a fan group

river geyser
coarse nacelle
#

they're not going to lie, you're doing a poor job of communicating that it's a fan server and should consider changing it on just that alone

river geyser
snow beacon
#

There I changed my bio to make it easier

#

Trust me, I'm not trying to immitate Jack shit

iron salmon
snow beacon
sour island
snow beacon
gleaming sequoia
gleaming sequoia
summer rune
#

Does anyone has a small snippet that prints all properties of an IsoObject like IsoDoor, when i pass it the object ?

#
function printAllInfo(obj)
   print("DEBUG - printAll() - start")
   for key, value in pairs(obj) do
      if value then
         print("["..key.."] = "..tostring(value))
      end
   end
   print("DEBUG - printAll() - end")
end

i wrote this real fast, any better ideas?

coarse nacelle
coarse nacelle
summer rune
#

i want the values of the object, printed out. sorry if i did not explain it well enough

coarse nacelle
#

ah ok, I thought you were looking for keys My bad

#

you can still get the types from documentation if that helps

summer rune
#

is there a way to check if a value can be converted to a string without raising an exception?

summer rune
summer rune
#

it is awesome that everything is a table in lua. such a breez. need a function? just get it from the table hashmap. done 😄

snow beacon
granite scarab
#

anyone know this mod to glow containers?

summer rune
#

it is no mod

bronze yoke
#

that's the unstable build

summer rune
#

comes with the new 41.78 version of PZ

deft falcon
#

basically treat it as if 0.5 was 50

summer rune
snow beacon
summer rune
#

any idea?

snow beacon
#

Or if you're trying to run too much at once that could also be it

deft falcon
#

nah its because door is not a table

#

or whatever object hes trying to check

snow beacon
#

Could be it

deft falcon
summer rune
deft falcon
summer rune
#
if thisObject["getHealth"] then
    local health = thisObject:getHealth()
end

this is working, specifically this row thisObject["getHealth"]
so why can i not use it as an table then.

summer rune
deft falcon
#

there you go

#

thats why u cant use it as a table

summer rune
bronze yoke
#

you're trying to print all values on IsoDoor right?

summer rune
#

yes. without putting them all in one by one.

bronze yoke
#

IsoDoor has moddata, so your code is breaking when it reaches moddata which is a table, is what they're getting at

quasi geode
#

KahluaUtil.luaAssert(o instanceof KahluaTable, "Expected a table");
yes you can use object["method"] but its not specifically a KahluaTable. just because it looks like a duck and quacks like a duck doesnt actually make it a duck

summer rune
bronze yoke
#

oh i didn't see that 😅

#

i feel like tyrir had something like this, but i think that was specifically for inspecting the metatables - probably doesn't work on objects if they don't count as tables

summer rune
quasi geode
#

offhand i dont have a solution and not really in a position to test for one atm (i may have solved this at one point ages ago, can dig through my stuff later)

bronze yoke
#

maybe you can make a table of members from the metatable and then loop through that on the object

swift sequoia
#

@quasi geode A bit back you gave me the code for your Buyable Traits mod. I have a few more adjustments I'd like to make to it, but once I do may I post it? And if so, what kind of accredidation would you like since the original on the workshop no longer exists?

fast galleon
#

Search for tyrir and printr or what it's called.

fast galleon
#

he has a very detailed print function

quasi geode
bronze yoke
#
local metatable = __classmetatables[zombie.iso.objects.IsoDoor.class].__index
for k,_ in pairs(metatable) do
  object[k] -- ...
end
```i think would work
summer rune
quasi geode
#

you can probably bypass nils if desired but i'm pretty sure your going to want to output those falses.

summer rune
summer rune
hearty dew
#

Try this

#

It will print out the static and instance fields in addition to methods

#

If you have the output in an ANSI terminal and set ANSITerminal to true, it will do the coloring too

summer rune
#

UdderlyEvelynUtils.inspectJava(isoDoorObject, "[Ii]nventory") what do i have to put in the second parameter for the IsoDoor object

hearty dew
#

The second parameter is optional. It is a lua pattern to match against the field/method name

ancient grail
#

Yep more wizardry

hearty dew
#

e.g. if you want only the 'name' field, you'd put 'name' as the 2nd arg. If you want all fields printed, pass no 2nd arg

hearty dew
summer rune
hearty dew
#

right

#

it is printed

astral dune
#

Have you tried comparing the health of the door on the client vs the server? I've noticed some desync issues on vehicle damage from players vs zombies

summer rune
astral dune
#

for my side of things, trying to manage vehicle damage, I'm going to verify the actual issue and report it on the bug forum, then probably manually handle updating the vehicle with a command until the bug is fixed.

#

what I've been seeing is parts on a vehicle can be "destroyed" on the client by zombies, but reloading the game or just getting out of the car and hitting the part myself with a bat will make it reappear with only the damage from the bat

summer rune
#

the magically bat repair.

#

the russian way of fixing things. 🙂 that is at least what the brother of my wife taught me. hit the computer a few times and then it works again.

astral dune
#

just have to hit the right resonance and everything falls into place

ruby urchin
#
---@module 'JSON Database'
local DB = require 'JSON Database';
DB.Connect("default")

local result = DB.execute("SELECT name, displayname FROM players WHERE name = Test2 AND id = 3;");

--[[for k, v in pairs(result[1]) do
    print(tostring(k) .. ": " .. tostring(v))
end--]]

for i = 1, #result do
    for k, v in pairs(result[i]) do
        print(tostring(k) .. ": " .. tostring(v))
    end
end

omg +200 lines only SELECT statement, but I'm happy :)

summer rune
#

did u reimplement sql for json text files?! or what is a JSON DB ?

ruby urchin
#
{
  "test" : [
    
  ],
  "players" : [
    {
      "name" : "Test1",
      "displayname" : "Tes1",
      "id" : 1
    },
    {
      "name" : "Test2",
      "displayname" : "Test2",
      "id" : 2
    },
    {
      "name" : "Test2",
      "displayname" : "Test2",
      "id" : 3
    }
  ]
}
summer rune
snow beacon
#

Anyone want to make a mod for me? I want to get a t-shirt launcher

astral dune
#

make sure when it hits a zombie it knocks it down, but when it gets back up its wearing the tshirt

summer rune
astral dune
#

🤔 if you strip the zombie after you can repack the tshirt to shoot it again

twin basalt
#

m_Tint's type is ImmutableColor
does anyone know if this is correct to write an xml file like this?
<RandomData>
<m_Tint r=0 g=0 b=0/>
</RandomData>

summer rune
#

u could be decorating zombies from a distances, with shirts, pullovers, hats and all kind of things

#

perfect for the christmas time 😄

snow beacon
#

So stop trying to lie to people

#

As I was asking earlier...

snow beacon
summer rune
#

sorry guys and gals, i have another question. i know i am shooting them out today. But it is all part of a big mod.

local square = getWorld():getCell():getGridSquare(12759,4956,0)
local objs = square:getObjects()

for i=0, objs:size() - 1 do
    ... some stuff ...
end

somehow my square is null? Exception: lang.RuntimeException: attempted index: getObjects of non-table: null at KahluaThread Any idea why? It is called on the ServerSide in the OnTick Event. Do I have to use getOrCreateGridSquare instead?

snow beacon
#

The indie Stone said it was ok

#

@iron salmon I'm really sorry for pinging you, but he's still going on about this..

#

I changed my bio too

#

And that's for my server? Not this one

#

He said I could keep my invite link

#

I'm the founder of MY server. The fan server

#

You are just misunderstanding

frank elbow
#

Why is this in the modding channel

ancient grail
#

Its misleading and you dont wanted people to work first then pay. . Ok ill just let you be

#

Ill remove my post

snow beacon
#

So that is suspicious as hell

#

I even changed my bio after you misunderstood me

#

But one of the Indiestone said I was all good

ancient grail
#

Im not reputable? Somekne said that? When did i ever scam anyone

snow beacon
#

Not that you scammed, but that your work is trash

#

Not trash, but just not good

#

For the price you were charging

ancient grail
#

Imoght not be as good as alot of the modders but i do the work

snow beacon
#

I've had mods similar done alot cheaper

coarse nacelle
#

<@&671452400221159444> you probably want to step in here

iron salmon
#

I think the two of you either take this to DMs or just flatout stop

mellow frigate
snow beacon
ancient grail
#

Yep im stopping

snow beacon
#

I am too

summer rune
coarse nacelle
#

anyway, is there a way to add a foraging item to the map in lua?

snow beacon
ancient grail
coarse nacelle
snow beacon
coarse nacelle
#

no, you're being an asshole

snow beacon
#

???

coarse nacelle
#

lay off me okay, I told you to get out of my DMs and now you're harassing me in this server

#

just lay the fuck off asshole

snow beacon
#

I'm trying to help??

coarse nacelle
#

no, you're posing as someone trying to help just fuck off

iron salmon
#

I have no real skin in any of this. I think people could easily mistake the bio still, and I think you two legit just got each other on the wrong foot due to a discrepancy in expectation on what it'd be like to work with each other.

I understand trying to warn others of each other, but as long as it's not legit a scam, it's not really going to be any sort of "impartial review" or the sort and as such should be kept away from here 🙂

As I said, we're reaching out to Discord about the possibility of switching to "projectzomboid" as the vanity URL while still keeping "theindiestone" to prevent the potential of someone pretending to act in any official capacity, but as far as I understand it - and I didn't check yet - Keepie's server is just a fan group as they said, and they mentioned they're open to free up the URL too if need be, so I'm intended to believe there's no malicious intend there.

snow beacon
#

Ok..

summer rune
iron salmon
snow beacon
#

I like that idea

twin basalt
#

sorry guys for quite spamming about this but i am having serious trouble understanding why this wont work
im trying to get a static color to appear on an outfit

<m_items> <!-- Face -->
    <probability>1</probability>
    <itemGUID>a3a1ca7b-4ded-43fe-be01-dacfdfef68aa</itemGUID>
    <RandomData>
        <m_Active>false</m_Active>
        <m_Tint r="0" g="0" b="0"/>
    </RandomData>
</m_items>

for some reason the clothing item still wont have a static color and will just pick a random color

snow beacon
twin basalt
#

sure

ancient grail
civic lava
coarse nacelle
summer rune
coarse nacelle
#

I'm working on a change to hydrocrafts hunting system and I thought it would be cool to integrate it into the foraging system, but I would need to Make a animal track item spawn nearby the player if they are holding dung

summer rune
ancient grail
summer rune
coarse nacelle
ancient grail
#

You might want to check how it triggers
So i guess if you could first forcefully trigger the forage with just any items then next step would be to replace the item.. im not really sure but thats howni would approach it mostlikely but im sure there are better ways

coarse nacelle
#

so in theory I can just jam my own items in the same way that it does probabilistically

coarse nacelle
ancient grail
#

Does it have to be part of the forage system? If not then yeah you could probably just replicate the function then instead of it relying on chances it will be triggered by your event (the force spawn function) then instead of it looking for items on the table it will just show the item u want to spawn

#

Its like reverse engineering it to something else but looks similar sorta

summer rune
ancient grail
summer rune
coarse nacelle
#

there's a TON of stuff to fix before I get to it, but just wanted to know if it was possible for when I get around to it

#

I hate how current HC is just stand next to random item and rub hands together lol

summer rune
ancient grail
coarse nacelle
#

oh yeah, I mean it doesn't fit thematically with HC (or zomboid really), but seeing that there was a "on the apex of a swing" event, I immediately thought it would be great for a magic mod 🙂

summer rune
coarse nacelle
#

swing a wand at someone and fire comes out, that would be cool

ancient grail
#

RP collection?

summer rune
ancient grail
#

Owww shiiiiz thats unique

summer rune
#

u can combine cards in their evolution class to make them more worthwhile and different gimmicks

ancient grail
#

Do they have rarity?

coarse nacelle
#

that's actually a good mod damn

ancient grail
#

How many cards did u manage to turn into items? Sounds like alot of work to be able to catch em all

coarse nacelle
#

🤔 you could probably use a drainable and modinfo to make a pokemon deck too

summer rune
#

there is a pokemon card mod published on the workshop. it is not mine. but it is only the items and 3d models. i patched in all the funktionality

ancient grail
#

Damn imagine making some of them admin spawn only and u make it as a prize for events
Daaamnn thats gonna make players login for the event

summer rune
#

yeah i have all that with automated events, where u get notified ingame before hand 😄

ancient grail
#

Ow wow so you have an inproved servermsg mod? Sounds cool

summer rune
#

overhauled chat system, radio system and other things. yeah ton of work. but sadly i dont have enough time to implement all my ideas

ancient grail
#

I wish we had that sort of thing before . Its pretty hard to make players read discord updates . Players tend to rely on faction members to tell em upcomming event

summer rune
#

but i am fairly certain at that point the HP data on the IsoObjects is not always in sync with the server.

deft olive
#

Hey , I have never modded anything but I’ll like to start. could you tell me what do i need learn (I do know python and c++)? the mood that I would like to accomplish is a "training whistle (amulet)"
1.- should be droppable from killing zombies
2.- character stats such as: hunger, thirst, weight, stamina should be displayed(on bars) at the top right corner of the screen, once the whistle is equipped
3.- should increase wearer xp yield by 1% on everything

So, maybe I could manage learning 1 and 3 on my own, but I have no idea how to do 2 (bars that reflect current stats)

coarse nacelle
ancient grail
#

Hmm if theres a problem with that why not make another hp bar that you control
Just make the doors unbreakable but then your hp bar lowers then just trigger the door breaking by force

coarse nacelle
coarse nacelle
summer rune
ancient grail
coarse nacelle
ancient grail
coarse nacelle
#

#1 is just adding the item to a zombie loot table btw, there's plenty of examples in the zomboid vanilla folder (which is another great place to look for modding cheat sheets)

ancient grail
#

Now the doors will then have dor example 10hp
Then if a player strikes it 9x then zed will just need to hit 1x to destrooy it

#

Just make it so that the door hits orginal function is disabled excpt for the animation

summer rune
deft olive
#

thanx for everything, I’ll give it a try

ancient grail
#

Goodluck 🫡

coarse nacelle
#

I wish the PZ hooks for stuff like "on hit" could return false if we wanted to block the hit event

coarse nacelle
#

so true/nil return is "let the thing happen", false return is "stop this from happening"

ancient grail
#

I suggest trying to create an item first using vanilla resources
Then try recipe .once you have done that then proceed to lua 🙂 thats where i learned

ancient grail
#

Ah wait nvm i know the answer its based on the weapons range

summer rune
#

i think they calculate the apex of the hit animation and then go by collision from that point. with weapon range and other factors.

coarse nacelle
ancient grail
#

Nope its just the weapons range

coarse nacelle
#

idk if that's how it actually works

summer rune
ancient grail
#

I made a weapon with long range but its melee and its just basically the catfish sprite

#

And the sound i used is the flute

coarse nacelle
#

XD

ancient grail
#

Just for the sake of tryng out stuff

coarse nacelle
#

I should make a mod where if you crouch over and over it spawns a red brick at the player's feet

summer rune
#

whyyy. all i do is crouching

ancient grail
#

What is the purpose of the brik

coarse nacelle
#

make it a silent throwable bomb that spawns no fire ¯_(ツ)_/¯

#

and has a 1 tile range

#

so you can throw it at zombies

ancient grail
#

Lool 1 tile throwable

coarse nacelle
#

explosion range that is

ancient grail
#

Its like you tried to smash it but its heave so you dropped it lol

coarse nacelle
#

XD

ancient grail
#

Seems like this is a parent mod for a future mod that uses this

coarse nacelle