#mod_development

1 messages · Page 540 of 1

pulsar charm
#

I had a hunch. Encrypting would not help with speed at all

broken fulcrum
#

hahahaha

tame mulch
#

Good idea with path draw, but do this will be pain in the ass. For my RP mod I will add just numbers for each house and districts for easy navigation

broken fulcrum
#

But I understand his/her idea, I can see why

#

he/she thought about compiling the program

#

it could help not being tremendously big

pulsar charm
#

i don't know lua enough to know for sure how it gets handled and turned into machine code

broken fulcrum
#

be careful, mods will probably not like that panic

noble siren
pulsar charm
pulsar charm
tame mulch
noble siren
broken fulcrum
noble siren
#

whatcha mean?

pulsar charm
#

idk u just got those vibes

noble siren
#

its coz i emote

pulsar charm
#

that is one of the reasons yes

noble siren
#

im gud at it tho

#

it helps me express myself

#

if i was an AI i would be amazing and loveable

#

imagine me being in pz lol

#

it's a horde! RUUUUNN!!!!!!

#

lol

#

anyweez, i gtg
everyone hf💖💋🌛

undone crag
#

Is there a way to teleport vehicles or do I have to give them force impulses to fly them to the destination?

pulsar charm
#

I feel like we need another chat for people looking for or requesting mods, and leave this one for chat for people who make them

silk wadi
#

i think a more basic pointer that doesnt take pathing into account would be more doable tho? ive noticed exp heli events has this, it could still be helpful i think

#

also bumping this i legit just wanna know if its hard/soft capped at 5 or someth bc ive never seen anyone add more skintone slots or anything

pulsar charm
#

where can i find the check for if a gun has a round racked in the chamber?
essentially i want to allow a gun to shoot without ammo in it

spice finch
#

What's the game file/files that determines the zombie clothing? I want to determine the average spawn rate of clothing items per body part on a zombie

pulsar charm
undone crag
silk wadi
#

ye i wish u gl

drifting ore
#

Gonna do a play through as a police officer any mod suggestions ?

noble imp
#

hey vhats the best map mod

#

or island mod

lunar robin
#

Sorry for tagging. I guess it's the right part?

function ISMoveableSpriteProps:getObjectHealth()
    local matHealth = ISMoveableDefinitions:getInstance().getHealthDefinition( self.material ) or 1.0;
    return self.rawWeight * matHealth;
end
weary forge
#

Can we create new Item Tags or can we only use the ones added in the patch?

dapper vector
#

Hi, does anybody know a mod with custom context menus?

#

So I can learn a little how to make one

drifting ore
#

where to find normal lua guide?

fast galleon
exotic fox
violet kelp
#

i've been trying to understand this mod and how it spawns items

#

what is CrateAntiqueStove ?

violet kelp
#

i've found this but i still have no idea to what does it actually correlate to ingame

tame mulch
# violet kelp

Is distribution table. It will roll item from item list (here list with 1 element) with 100000% chance in crate

#

Some cars from mods and vanilla 😄

violet kelp
tame mulch
violet kelp
#

is there any way i can find out which crate that is?

tame mulch
violet kelp
#

where can i find the crate list distributions

tame mulch
#

Try check CrateAntiqueStove in ProceduralDistribution

violet kelp
tame mulch
violet kelp
#

so one of the crates in any factory can have that tag>

#

?

#

or well, 5% chance

#

also which file is this? I'd like to look through it aswell

tame mulch
violet kelp
#

ahhhhhhhh

#

alright

#

well thank you

#

you've been of great help

cinder vault
#

Hey guys, how would I go about creating a timer that executes a function when it finishes?
I'm mostly having trouble understanding how to count the time passed.
I saw another mod using getGameTime():getRealworldSecondsSinceLastUpdate() is that the best way?

cinder vault
#

what value does that return exactly? Is it the time since the last update or something else?

tame mulch
#

Use diff for check how much time last

cinder vault
#

alright, thank you

native shore
fluid kite
#

is there a setting or mod that allows us to access sewing or first aid kits without equipping?

#

could've sworn I done it before 🤔

atomic crow
#

Would be nice, just accessing containers inside of containers would be good.

quartz marsh
#

Hello everyone (sorry for my bad english is not a native language).
I have a little question regarding the mods a week ago and I have not been able to find the solution, could you help me x.x?
more or less the summary: My partner and I started a world in PZ, it is not a dedicated server (I am the host), this new world has several mods installed (The world and the mods were configured in v 41.68), it happens about what; We recently decided that we want the world to last as long as possible, but I am aware that maybe at a certain point; either due to incompatibility between game versions or mod versions, it can get corrupted.
So I've been searching for days to find a way to disable PZ steam updates, start the game without steam, and create a backup of my workshop items (just in case one gets updated). to a future version after 41.68, and my world is still on that version).
The problem I have is in the last point, I made a backup copy of my workshop articles, and I unsubscribed from them from steam, but when I "manually" place the files back in the corresponding folder, the mods don't recognize me, they know how could i make it work?

drifting stump
quartz marsh
#

oh, thanks!, I'll go ask there

steel jackal
#

if im adding mods to a server and its a mod that needs to be installed on the main mod screen lik ehorde night or become desensitized. does that mod also need to be added on the server as well?

steel jackal
#

kk thanks

cinder vault
#

is there a way to check if a function is already registered in an event?
for example:

if not Events.OnTick.Exists(self.update) then
  Events.OnTick.Add(self.update)
end
tame mulch
frail flame
#

wait I just realized this is about making mods

#

my mistake

tame wigeon
#

Does everyone on the server have to have the players on map for it to work for them?

pulsar charm
#

what do the setJobType and setJobDelta actually do?
I'm making a timed action and these are in base files but it doesn't look like they ever really get used for anything

hollow totem
#

I'm trying to troubleshoot which mod might be causing a system freeze.
Does anyone know what the "receiveObjectModData: index=-1" translates to? The coordinates are usually player locations.
LOG : General , 1652235206316> 1,334,231,513> receiveObjectModData: index=-1 is invalid x,y,z=9332,11306,0

steel jackal
#

anyone playing online using map moods? looking for a list of map mods that are confirmed to work. i slapped like 10 on and as you can imagine they arent all working.

dapper vector
#

Actually, does anyone know where are the lua files of the Food Type and the lua files of the drink context menu?

left lintel
#

Anyone got any recommendations for a "Multi-Tool" Mod? Only found one that adds a can-openner, knife, scissors and screwdriver together, which is amazing and all^
But I want to take it a step further. Like, sledgehammer + axe + hoe kind of multitool. Or Wrench + PipeWrench + Hammer.

tame mulch
tame mulch
tame mulch
tame mulch
dapper vector
left lintel
#

Sorta reminds me of Rimworlds Tag System. Makes modding/editting items so much easier

drifting ore
#

how many parts should a car have?

weary forge
#

Is there a possibility to modify the crafting UI? In particular regarding the size of the material window: There is a huge blank space on higher resolution that i would like to show since Hydrocraft often have many components

tame mulch
weary forge
#

Oh Nice. Well that will be probably be my weekend then 😄

#

Welp of to a good start

dapper vector
#

That's why I think that the Food Type would be a good start to implement that

weary forge
#

I guess you wan't to make an Icepack that can cool other things down? (or an heater for MRE?) An direct example would help

weary forge
#

Is the function ISCraftingUI:render() constantly triggered while the window is open or only once? Is it recalled when the window is resized?

#

File: media\lua\client\ISUI\ISCraftingUI.lua

atomic stream
drifting ore
#

Is there a mod that make zombies live again after a while?

buoyant sky
#

They respawn i guess?

little iron
#

Hey guys

#

is there a modder here who accept commissions?

#

it would be for creating an armor/model.

drifting ore
#

Are you making a mod for the crafting UI ? Cause the dev work on it if I remember well

fiery pecan
#

welp. I'm 99% sure I figured out why the vanilla debug menu's "setvehiclescript" doesn't work on the server. I've narrowed it down to "scriptreloaded".
Now to find an alternative way to refresh the vehicle for use in my mod

cinder vault
#

hey guys, how can I check if a lua table is empty? I found out that next(myTable) == nil doesn't work in Zomboid's Lua :
Also is there a list of all the differences between pure Lua and Zomboid's Lua?

weary forge
wet sandal
#

#myTable returns the size, an empty table would give you 0

fast galleon
wet sandal
#

quote the entire block with ```

cinder vault
cinder vault
wet sandal
#

another reason to hate lua

quasi geode
#

# only works for tables that use number index keys, and only counts the highest index

#

pz's kahlua is based off 5.1, so use that manual instead of the 5.3

#

its also missing a few modules, io.*, os.*, and math.random are invalid for pz

#

(was unaware next didnt work though, so there maybe a few others i havent listed)

cinder vault
#

ah alright, that's good to know. Thanks!

quasi geode
#

oh math.randomseed as well

wet sandal
#

Any other insane gotchas in lua?

quasi geode
#

probably a few, depending on how well you understand tables lol. the fact they can be a sorted list/array, unsorted list/associative array, and a pesudo-object.. including all 3 at the same time probably counts as a gotcha lol

#

also depends on how far you want to go down the metatable hole, and when you start applying them to sorted lists etc.

gaunt pendant
quasi geode
#

indexing starting at 1, thats defiantly a 'insane gotcha' (though a well known one)

wet sandal
#

no continue is a good one

#

1 index, yea

quasi geode
#

no continue is insane, theres a work around though

gaunt pendant
#

And yes, that ^
Tables being lists and dicts at the samd time is a pain

quasi geode
#

as long as you dont need break at the same time lol

wet sandal
#

tables never give me too much trouble because i've always viewed them as dictionaries

quasi geode
#
for key, value in pairs(someTable) do repeat
   if (condition) then break end -- break now functions as continue
until true end
wet sandal
#

oh, it breaks the repeat?

quasi geode
#

ya

wet sandal
#

neat

quasi geode
#

the repeat stops after the first iteration anyways with the until true

gaunt pendant
#

Yea but that is just excessive markup 😩

quasi geode
#

dont blame me, blame lua lol

gaunt pendant
#

For a thing that should be so simple

wet sandal
#

I just code loops to not need continue, but next time i forget and get an error, I'm using this

gaunt pendant
#

I'm sure they have their reasons, but it's one of those annoyances I have with it

quasi geode
#

idk why they didnt add a continue, its bizarre

wet sandal
#

I think i vaguely remember a Prof explaining why in University. They said something along the lines of it being because of the regular language lua uses making it impossible to implement in the parser.

#

Maybe not, googling seems to imply they just didnt wnat to add it

quasi geode
#

not wanting it seems more likely.. its meant to be minimal language without a pile of bells and whistles

wet sandal
#

2nd answer

gaunt pendant
#

Yet we have for, while, repeat .. until 🤣

quasi geode
#
Continue, on the other hand, is a real feature. (It even changes the
syntax and the lexical.)  Our main concern with "continue" is that there
are several other control structures that (in our view) are more or
less as important as "continue" and may even replace it. (E.g., break
with labels [as in Java] or even a more generic goto.) "continue" does
not seem more special than other control-structure mechanisms, except
that it is present in more languages. (Perl actually has two "continue"
statements, "next" and "redo". Both are useful.)
#

no issue, they just didnt want to XD

gaunt pendant
#

So basically: yup it's important. We won't add it because fuck u. 😂

wet sandal
#

If you read the proceeding paragraph:

At the time we "added" the local scope for repeat it really seemed
innocent. And it was not really an "added" "feature", we just changed a
scope rule. Unless the fact that it is different from other languages,
it should be neither simpler nor more complex than the old rule.

and note

Continue, on the other hand, is a real feature. (It even changes the
syntax and the lexical.)```
#

I think its was just work they didnt want to do

astral tendon
#

Does anyone know to make the tires on my modded vehicle larger? I legit have no clue what I can do to change them

faint jewel
#

it shold be in your script for the car.

#

though those wheels are adorable.

astral tendon
heavy radish
#

lol tinywheels

astral tendon
wet sandal
#

go smaller, commit

faint jewel
#

well first. i bet ya that you are scaling the model via the script and NOT the actual model.

#

and that breaks things.

astral tendon
faint jewel
#

scaling the model, scales the wheels.

astral tendon
#

mmmm

#

nah, i've got it all to 1

#

scale = 1

faint jewel
#

are they custom wheels?

astral tendon
#

no

#

just did template = Tire

faint jewel
#

or existing ones

#

the template might have scaled wheels

astral tendon
#

Is there a way for me to rescale them?

#
            model InflatedTirePlusWheel
            {
                file = Vehicles_Wheel,
            }

and just add scale = 1.5 for example?

faint jewel
#

you can try that?

astral tendon
#

yeye, just doing it rn.

#

sadly, no 😦

boreal vigil
#

Hey guys! I need help from someone experienced. Can I add a new attribute to an item? Example: item.isOnline=true. I need to set and get the value.

faint jewel
#

send me your vehicle script.

little iron
#

for a car i'd like?

#

i can only add a generic "car key"

#

not a specific one

tame mulch
hexed arrow
#

how can I look for a specific item in the players inventory?

#

okey got it

bitter nymph
#

Question: in VehicleZoneDefinition.lua it says that for spawnChance, "the total for a zone should always be 100" -- what happens when I add modded cars (e.g. Filibuster Rhyme's) and that value increases?

quasi geode
bitter nymph
#

Gotcha, that's what I thought but I wanted to confirm. I saw a patchnote that also said that the value was changed from an int to a float, so that means I could put, say, 0.5 for a vehicle's spawnChance to make it rarer, right?

quasi geode
#

sure, that patchnote specifically has to do with the original normalization function was converting the numbers to ints instead of floats (causing mutlitple issues), but yes, you can use a low float for extreme rares

bitter nymph
#

great, thanks for the help!

fiery pecan
#

ok, so. Coding question:
How does one "reload", or "update" a vehicle in the world, using lua?

sharp crystal
#

Hello. How to make a very simple recipe where:

#

I can clean the dirty rag, bandage etc. with water and soap / Cleaning Liquid pls?

#

recipe Clean Rag
{
RippedSheetsDirty,
Water,
** Soap/CleaningLiquid **

    Result:RippedSheets,
    Time:40.0,
    Category:Health,
    OnTest:Recipe.OnTest.NotTaintedWater,
}
#

This is what I did but this isn´t working..I mean...I can clean rags without soap or Cleaning Liquid

#

Within the context menu when next to the sink or any other source of water

fiery pecan
#

did you copy from vanilla?

sharp crystal
#

yes

fiery pecan
#

hmmm

#

wait

#

did you put a comma after soap/cleaningliquid?

#

it might be skipping that line due to a lack of a comma...

sharp crystal
#

yes

#

in the crafting window....there is the option with cleaning rags with water AND soap ONLY

fiery pecan
#

ah. Sorry I'm a bit daft

sharp crystal
#

but I need to apply this also to the context menu when you stand next to the water source and can right click it and choose CLEAN RAG

fiery pecan
#

oh, the context menu?

#

one sec

sharp crystal
#

yes

fiery pecan
#

ok, so

#

just a hunch

#

but how much water units does it ask for as it is now?

sharp crystal
#

1

fiery pecan
#

ah

#

oh!

sharp crystal
fiery pecan
#

yes, but I might be VERY wrong here.. I'm pretty sure the context menu's applied automatically?

sharp crystal
#

It says it needs Water (1 unit) and soap. But it cleans the rag anyway...

#

without any soap

fiery pecan
#

oh, yes

#

that's normal

#

the soap just speeds it up

sharp crystal
#

the crafting menu is OK

fiery pecan
#

yes, yes

sharp crystal
#

how to disable the cleaning within the context menu WITHOUT any soap

#

?

fiery pecan
#

well

#

idk the answer

sharp crystal
#

😄 OK

chrome egret
#

Essentially you will have to look for that vanilla code and create a new version which prevents populating that option if soap isn't present

sharp crystal
#

The question is where to look for it?

chrome egret
#

You will be much better off opening the lua dir (from within your PZ install\scripts\media dir) in an editor/IDE and learning to search these things for yourself

fiery pecan
#

ok, so. Coding question:
How does one "reload", or "update" a vehicle in the world, using lua?

chrome egret
sharp crystal
#

great..will look at it

azure rivet
#

Hi, Where can I see Traits in the game files?

bitter nymph
#

another VehicleZoneDistribution question: I see lots of mods use "trafficjamw" for traffic jam spawns, sometimes other directions, but the base lua has a "trafficjamVehicles" matrix that it distributes to all 4 directions. Does this mean that modded vehicles will only spawn in the specific direction they've been added to the distribution (i.e., cars in only trafficjamw will only spawn in west-facing traffic events) ?

hexed arrow
#

how do I actually call a costum timed action?

#

I basically copied the grab corpse action and dont know anything about adding a context menu and call the function itself

chrome egret
pulsar charm
#

new to lua, and using base game files and other mods to help me
when am i supposed to use a semicolon or not? it seems so random in the game files.
I come from java where it is everywhere

#

ok nevermind idk why i didnt just google it in the first place
they are optional, unless you want to seperate multiple statements on the same line

azure rivet
#

Does anyone have a help so I can create a trait for the occupation?

fair frost
#

Raccoon City Part 6

#

DPW logo was made by my friend, Naratibet

strange ocean
#

hey guys so does the this variable increase or decrease my hunger?

        HungerChange    =    -100,
shrewd ether
#

are questions about running a dedicated allowed in the section?

#

i really wnat to know how to run a dedicated but i never get a question answered with in the hour here

strange ocean
#

idk why my mod wont appear in the mods section

#

nvm i fixed it

craggy furnace
vapid arrow
#

is there a way to create a mystery bag which gives you a random item like food?

drifting ore
#

how in the fuck do i add maps to gportal hosting lmao

undone crag
#

Can someone help me with Vector3 plz? I am trying to apply an impulse to a vehicle to make it move in a certain direction, but I do not know how mathematically to put the global vector3 direction onto the vehicle's local axis so that the impulse is applied in the right direction.

small hatch
#

How do you determine if an item belongs to a mod in lua?

drifting ore
#

Anyone know of a mod that adds like a portable cassette player like the Walkman?

#

ive downloaded some music mods and id like to listen to music with headphones doing looting runs

woven wren
#

Not too bad for a mod right?

strange ocean
woven wren
strange ocean
#

yeah

woven wren
#

It's a music pack?

pulsar charm
#

when calling my modded TimedAction, the game (in debug mode) breaks and gives me this output:
attempted index: StartAction of non-table: null
it also points to lines in my code that queue or startaction the timedevent
how can i start to fix this?

#

i presume this means I am somehow calling startaction to early?

dapper vector
#

That item is called mate, which is a regional drink in some countries of South America

fast galleon
weary forge
fast galleon
#

I mean there is one but it's not something you need to do. Not part of guide.

dapper vector
#

I know that you can make multiple items from making only one recipe, but the mate should be unlimited to drink, as long as you have water in the thermos.

#

Thats why I decided to see if I can make a new type based on Food, with this little things I have to consider

weary forge
#

you could just make the recipe and define the mate as "keep mate" that way its not used up. and tedious is relative you could make a "bigger" serving to drink (like -100 water) that way you could drink it partial

#

or make the mate a drainable item with like 100 uses (since even mate is not endless ;)) and use "mate=1" for the recipe

dapper vector
#

I like what you suggest, but after some uses the mate should turn into a version with almost no flavor, which changes its nutritional value and such, while its still drinkable (as long as you have water)

weary forge
#

at some point it is basically just water with maybe some color 😄

chrome egret
chrome egret
chrome egret
undone crag
hard crypt
#

Hey all. I was thinking of trying my hand at modding pz. I read that all the documentation is old and depreciated tho. Is that true or was that just some salty guy?

native shore
# hard crypt Hey all. I was thinking of trying my hand at modding pz. I read that all the doc...

So far, this is what I've found:

  • Lua as a language is well-documented... but for the Lua applicable to the game, you kind of have to rely on the media\lua folder in the game directory
  • There are javadocs for the game, but from what I understand they are superseded by the game's files (which makes sense, if you think about it), and while many working mods make calls to Java functions, this is apparently no longer in vogue? Not 100% clear on this point, but if it works, don't fix it 😄
  • Surprisingly (or not?), many of the old guides still have many nuggets of good info, but there is some sifting you have to do on your own

The rest is trial and error.

hard crypt
#

ah so that seems about on par with what they were saying. would be sweet if the java docs were up to date, but I suppose with everything being as open as it is you cant complain too much about needing to dig into source. Thanks for the info @native shore

native shore
#

I am become plunger

#

huzzah

hard crypt
#

does that mean you leveled up in the server?

native shore
#

yeah I guess I blabbed enough 🙂

hard crypt
#

Nice! good work lol

#

Now I just need to come up with an idea for a mod to add. I was thinking maybe making the showers function so you can clean yourself off faster

native shore
#

interesting

#

well, good luck and godspeed 🙂

hard crypt
#

tyty, take care!

smoky meadow
#

guys is there a mod where you can temporary increase your health bar?

eager terrace
#

hey guys, is there a decent smoking mods ? (like one that either removes the trait as someone " would quit smoking ") or one that allows you to grow tabacco and make your own cigarettes ? Thx

languid sonnet
eager terrace
languid sonnet
#

Np

distant rapids
# hard crypt tyty, take care!

I just recently started but I didn't realize they had a discord. I'm on day 3 and I'm understanding how to string this stuff together. Granted ill go on 12+ hour scripting sprees. zombie. Otherwise, id say it's easy to get with time

#

Also, I had a question about the channel. Is it possible to get info on a zombie that died on the OnZombieDead LuaEvent? For example, I want to know which player killed a zombie in that event.

hard crypt
hard crypt
#

not sure about which player. maybe you could add that variable tho

eager terrace
languid sonnet
#

It should just be jiggas green fire. It let's you grow tobacco

undone crag
undone crag
#

The Towing Cars mod uses Vector3 in it, and the game's online Java documentation mentions two different Vector3's and a number of other sorts of Vector3 whatever they are.

pulsar charm
chrome egret
pulsar charm
#

I fixed my issue. No more errors but the timedaction doesn't actually work yet lol

chrome egret
#

lol I feel ya

native shore
civic vine
#

Anyone got any decent mod lists for steam that don’t stray too far from vanilla and definitely don’t use Brittas?

chrome egret
#

There is nothing inherently wrong with calling Java functions, and many of the classes are exposed for that very reason.

native shore
#

no disagreement here; like I said, if it works, don't fix it lol 🙂

undone crag
native shore
#

IntelliJ IDEA doesn't seem to have any knowledge of it, despite picking up the rest of the Lua library I added to the Project Structure

#

e.g., I can do this:
local myCoolPanel = ISPanel:derive("myCoolPanel")
with no problems, but if I try
local myCoolPlayer = IsoPlayer:derive("myCoolPlayer")
or anything like it, I get nothing

#

but I can just wave my hands around and boldly type IsoPlayer:getBodyDamage() and get back a functional BodyDamage object 😄

#

(assuming IsoPlayer refers to a validly passed/assigned instance, of course)

pulsar charm
fast galleon
pulsar charm
fast galleon
#

nice :)

pulsar charm
#

thanks though

fast galleon
#

so I take it doesn't work because of something else?

pulsar charm
#

yeah, I'm figuring that out right now

undone crag
native shore
#

yeah there's some tools that help with that for sure, but they're seemingly far out of date; I actually joined to ask about them and was told unequivocally that those are NOT to be used anymore as that paradigm is passé 😦

#

c'est la vie 😄

#

maybe when the game is stable

undone crag
#

Do you mean you wanted to modify the Java?

native shore
#

nah, just have it available for doc comments and autocomplete and stuff

undone crag
#

That would be nice T_T

native shore
#

having all the lua files is fine and I can just open the LuaManager.class file and use that when I need it

#

I synced it with the javadocs, for whatever that's worth, to get annotations

#

it's kludgy, but it works

undone crag
#

I just use Notepad++ :(

native shore
#

hey, nothing wrong w/ that, it's a fine editor

#

I prefer Sublime myself, but to each their own

undone crag
#

When you synched something with javadocs was that with IntelliJ or Sublime?

native shore
#

IntelliJ IDEA for sure lol, I know Sublime has an EmmyLua plugin, but probably not much else 😄

#

I'm so spoiled now, I want all the shinies

#

also, after trying to set up the EmmyLua extension in VSCode, I'm gonna stick with JetBrains lol

undone crag
#

Hmm okay okay maybe I will download the hundreds of megabytes of IntelliJ if I start coding something tricky for Zomboid.

native shore
#

JetBrains' tools have a very consistent feel, so if you're used to them they're great, but man... they're really handsy and they tend to "suggest" stuff a lot that doesn't make much sense

undone crag
#

What's the Emmy in EmmyLua or what's EmmyLua?

native shore
#

dunno where "Emmy" comes from, but EmmyLua is a doc comment framework, kind of like JSDoc or XML doc comments in .NET languages

#

it's handy for IntelliSense-type stuff, auto-completion, etc.

#

shiny

#

😄

undone crag
#

Does it tell you if you put a string as an argument that was meant to be a number, and things like that?

native shore
#

It does! It's like this:

--- Transforms a value in [0, 100] to one in [0, 1].
---@param value number the value to transform
---@return number the fractional value
function utils.fractionalValue(value)
  return scaleValueToRange(value, 0, 100)
end
undone crag
#

Microsoft Visual Studio has a lot of features but it also takes up a lot of RAM (C# in Unity).

native shore
#

on mouseover you get that, and while typing the call it tells you what the type of input is

#

yeah!

#

exactly

#

that's just the same thing

undone crag
#

Hmm okay so I may try out Sublime with EmmyLua oh actually maybe not because it doesn't get the Java documentation thing.

chrome egret
#

VS Code is lighter than full-blown Visual Studio

undone crag
#

Actually for non-zomboid Lua I could use that.

native shore
#

VSCode hates EmmyLua (or the other way around) lol

#

I love it for TypeScript stuff though

#

changed my life

undone crag
#

Hmm excellent. It will be nice to be able to have three (RAM-heavy/light) programs open at once (Web browser, code editor, Unity, a second Unity for multiplayer)

native shore
#

haha! That's the spirit! 🙂

#

what did you buy all that RAM for anyway?

#

to use it

undone crag
#

I typed something illogical and corrected it.

#

I meant I use
Unity, Notepad++ and Firefox
or
Unity and Visual Studio
for lack of RAM

#

so
Unity, VS Code, and Firefox
if VS Code is better than Notepad++ THAT'S WHAT I ACTUALLY MEANT

native shore
#

oooh I'm looking now and it seems like the EmmyLua package for Sublime is no longer on PackageControl 😮

#

I hope you have better luck than me if you try it in VSCode

#

I couldn't get it to recognize my OpenJDK

fiery pecan
tame mulch
fiery pecan
#

I'm dynamically replacing certain vehicles.

tame mulch
#

As idea, create command, send to server and on server side remove vehicle and spawn new

fiery pecan
#

is it possible to update/reload a vehicle without using scriptReloaded?

#

also

#

what about the keys that spawn on the ground?

fiery pecan
#

well, sort of

tame mulch
#

update not possible. Only replace

fiery pecan
#

setScriptName(NAME) runs just fine. When I unload the cell the vehicle's in, and return, it's what I'm wanting

#

but my issue is

#

I don't know how to "reload" the vehicle in real time?

tame mulch
#

Maybe try do this on server side and client side?

fiery pecan
#

hm?

chrome egret
#

I might have missed the context, what script are you reloading?

fiery pecan
#

a vehicle script

chrome egret
#

And that's because you're dynamically altering its content?

fiery pecan
#

GetVehicle:setScriptName(arg); GetVehicle is the vehicle in question, arg is the new script name

tame mulch
#

Maybe need send command to server, on server run ScriptReloaded for vehicle, and then run it on client side

fiery pecan
#

GetVehicle:scriptReloaded(); "Updates" the vehicle, so the change can be seen on the client, but it reverts the scriptname change.

fiery pecan
tame mulch
#

like that

fiery pecan
#

k

tame mulch
#

And on server side:

distant rapids
#

How do i create a new type of zombie for a zone? IE. in a CarRepair zone there is a mechanic. I want to make a new type of zombie with a specific outfit

distant rapids
#

Nvm i did find it, however if anyone else is curious it will be in this file steamapps\common\ProjectZomboid\media\lua\shared\Definitions\ClothingSelectionDefinitions.lua

vapid arrow
#

is there a way to create a item bag when you open it (like food cans) gives you a random item?

hushed cloud
#

Could anyone make a mod where if you have base protection on, turning PvP would allow you to steal from their base?

Im my head if you have offline raid protection enabled pvp wouldnt allow you to take anything. But if you wanna enter and steal from someones base you would have to enable PvP

pulsar charm
languid gulch
#

Hi guys
I was just wondering if Indie Stone is going to add a tape recorder/CD player to the game?
It would be nice to have time to paint during a trip by car and some routine work)
Maybe there is some kind of mod, but I did not find it
(written with google translate)

tame mulch
proud python
#

hi guys i have a quick question

hot patrol
hushed cloud
#

I've been using it for a while now on my server. My players enjoy it and I think its fair. But sometimes players will be minding their own business in their base and a PvE player will come and snatch loot from people and theyll generally not be able to enable PvP.

hot patrol
#

Ah yea that would be a problem

#

Good call

hushed cloud
#

PvE on and you wanna take loot from player players haha

#

Guess like a pvp zone around bases

hot patrol
#

You would think entering claimed space would enable pvp by default

hushed cloud
#

would work then they could make factions

hot patrol
#

Good idea.

#

Should be a legit feature an not a mod

#

Maybe try reaching out to a dev.

#

Totally shouldn't be able to raid bases with pve on

mint jolt
#

Hi! Does some one knows how can I provide translation for my mod?

unreal mortar
#

Is it possible to mod the size of the map. So not just add into it but expand the area of the original map?>

unreal mortar
#

Like I know some popular mods add new cities to the existing map but could you actually expand how many cells are in the map? giving more area to create.

tame mulch
mint jolt
distant rapids
#

A question so i made a clothing.xml then i pushed a zombie outfit to the zombie zone definition table. The zombies appear in the horde debugger function. but when they spawn they are naked. Does anyone know why?

mortal widget
#

what mods currently work with the unstable build?

inland bone
#

Why

#

Is there only peterbelt semi mods?

oblique aspen
#

Is there like a reference for PZ? I keep looking through mods and they are using functions like

    ISTimedActionQueue.add(VACCHOnInjection:new(player, item));```

and idk where to find these even in the original game files.
winter bolt
distant rapids
winter bolt
#

the paths as well i think

#

i just copy the entry from the vanilla table lol

distant rapids
#

Awesome thanks bro I've been trying to find a solution forever

agile swallow
#

Hey guys, is there somewhere I can see all of the variables I can add/change to items? I'm talking about these not sure what to call them.

lean plaza
#

does anyone happen to know what the prepper house spawns are labeled as in the distribution tables?

hot patrol
languid gulch
golden ocean
#

Completely new to modding but have some experience in RW modding. Been considering making a mod that would create certain custom items to specifically spawn in certain buildings. Is this possible/is this currently done in any other mods that I can use as a reference?

lunar robin
dire oracle
#

👁️

tame mulch
lean plaza
#

Could anyone point me to where I would find the loot tables for toolboxes having a chance to have items in them on spawn (I've already found the actual tables for spawning of items themselves). I'm attempting to make a new container, and using the toolbox as a basis

glass ocean
#

Hi would change some coordinates of spawning helicopter in the mod better helicopter but I don't know where find the file of the coordinates

calm depot
#

where is the new UI that shows you loot spawn probabilities?

#

found it, all good

distant rapids
#

Hey guys is there anyway to give zombies certain properties on spawn if they are a part of a certain clothing group?

wet coral
#

so I looked at the code of the Oshkosh P19A

#

and from what I can tell the code for the windows is the same as the code for the Gage Commando's windows

#

but the firetruck windows break after a certain period of time

#

is there some other file that causes this?

jovial peak
#

guys how do i get my mods to download it wont everytime i click install

steel jackal
#

anyone know what the difference in cryo winter and eternal snow is?

oblique aspen
#

Does anyone know what

_item:getContainer():setDrawDirty(true); does?

native shore
#

saves time to not re-render things that haven't changed

native shore
#

I mean it could literally be "draw this as though it has dirt on it" 😄

oblique aspen
#

lmao I hope so. I'll do some testing ig lol It's in UI files though so your first guess seems more reasonable lol

keen frost
drifting stump
#

@native shore

oblique aspen
#

Does Anyone know where I can find Game/GameOver from sounds_player.txt?

    {
        category = Player,
        clip
        {
            event = Game/GameOver,
        }
    }```
broken fulcrum
#

anyone know any wig mod? 😔 Paw Low Loot has wigs, but the mod is too big and has some bugs (invisible groin for example). It can be vanilla hair, modded anime stuff, anything. Craftable or found in wardrobes, I don't mind

steel jackal
#

anyone know how to transfer singleplayer mod presets to a server preset with the mod manager mods? its really annoying that the presets dont carry over

fallow bridge
#

At least I think that’s it’s name

#

It’s a mod

#

Only way to use presets for MP

steel jackal
#

i have the server version but the presets dont transfer over. so if i make a sp preset i cant then select that preset from the server version

fallow bridge
#

No

#

You gotta make a new preset

#

They are technically two different mods so they can’t carry over each other

steel jackal
#

yeah i know i was asking if there was a way, maybe a setting i wasnt seeing that would allow me to do that.

fallow bridge
#

No

#

There isn’t

#

But it beats the alternative

steel jackal
#

ok its annoying but better than it was without the two mods

fallow bridge
#

It’s only a minute or effort making a mp preset

#

While without it you’d need at least 3 minutes each time you wanna make a new server with different mods.

steel jackal
#

the issue im finding is how some mp mods requre to be active in the sp mod screen and it gets confusing what i ned to leave on for mp and what i dont want to run in sp. so i just wanted to have a single preset to swap to and from

fallow bridge
#

PZ servers are essentially GMOD

#

Where any mod the servers use is automatically set up

steel jackal
#

mods like horde night wont show up if theyre only active in the server version. needs to be added in the main screen as well

fallow bridge
#

Anything that’s enabled in the server gets enabled on the Client

fallow bridge
#

Then again I don’t think horde night was designed for MP

#

I haven’t ran a server in a hot minute

#

But if it does require the client to have it enabled, just enable it on your normal mods tab the set it up in the server

#

Should be perfectly fine

steel jackal
#

i think the helicopter mod is the same way, become desensitized and they knew are a few more off the top of my head. i dont get settings for them unless they are activated in the sp section as well

fallow bridge
#

Huh

#

Well then just have you and all your buddies install the mods and enable them on your default mods section

steel jackal
#

i mena it works wor them not having to add it im just saying for me the host i need it added to my sp mods. but my issue with that is swapping between sp and server gameplay is a pain to keep track of what mods i have installed cause for my server i need mods active i dont want in my sp game and im having to swap them off all the time and it gets confusing. and im always finding new mods and adding them so having just one set list isnt really happening

fallow bridge
#

Yeah I advise not having a clusterfuck amount of mods for your MP

#

I have a set amount of specific mods for my server whenever I make it that’s just going to spice it up a bit more

steel jackal
#

eh if i cant mod the game the way i want then i lose interest in playing. pretty much every mod i have installed is a must have or i just dont wanna play

fallow bridge
#

But, what if it’s not how your buddies wanna play?

#

When your playing in MP you’ve gotta make sacrifices

steel jackal
#

theyre alot less picky than me. but believe me sacrifices have been made

#

i want extremely rare loot, no brittas, and hardcore cryo winter and none of that is happening

fallow bridge
#

They wanted brita’s?

#

Yeesh

#

Get new friends SadBuddy

#

(J)

steel jackal
#

i mean i lik ethe content of brittas but its just a shit show sometimes

fallow bridge
#

But yeah, it sounds like you’ll probably just have to suck it up, as you can’t port over, or set up a dedicated mod list and never change it

#

Otherwise your kinda shooting yourself in the foot

#

You also shouldn’t really be adding mods to ongoing saves anyways

steel jackal
#

oh i mean yeah ill deal with it was just hoping there was a secret setting or some shit that i was missing.

fallow bridge
#

It’s usually recommended to restart when a new mod is added

drifting stump
#

mods always get reloaded when entering a game be it single player or multiplayer

steel jackal
#

oh yeah im aware but i just risk it and if it fucks something up ill remove it and if its still fucked then well restart.

drifting stump
#

that means having them active on the menu doesnt matter unless youre making a new save

steel jackal
#

too many cool mods come out like everyday

#

except map mods. i know they need a new save

small hatch
#
local allItems = getScriptManager():getAllItems()
    for i=0,allItems:size() - 1 do
        local item = allItems:get(i)
        if item:getModID() == "Arsenal(26)GunFighter" then
            print(item.SubCategory)
        end
    end

Why do I get nil for all objects if firearms have a subcategory?

quasi geode
#

cant access object fields that way. you'd need to use the getter/setter methods :getSubCategory(). but you'll also have to check if its a HandWeapon instance, since that method doesnt exist for all InventoryItem types

small hatch
# quasi geode cant access object fields that way. you'd need to use the getter/setter methods ...

Hrm, i'm doing something wrong then. I tried checking if they were instanceof(item, "HandWeapon") but yielded nothing.
I'm trying to script functions that parse all available items for Arsenal's guns, magazines and melee weapons so that it can be placed into recipes without manually crawling through all the files and getting ids.

function Recipe.GetItemTypes.ArsenalGun(scriptItems)
    local allItems = getScriptManager():getAllItems()
        for i=0,allItems:size() - 1 do
            local item = allItems:get(i)
            if item:getModID() == "Arsenal(26)GunFighter" and instanceof(item, "HandWeapon") then
                if item:getSubCategory() == "Firearm" then scriptItems:add(item) end
            end
        end
end

function Recipe.GetItemTypes.ArsenalGunMagazine(scriptItems)
    local allItems = getScriptManager():getAllItems()
        for i=0,allItems:size() - 1 do
            local item = allItems:get(i)
            if item:getModID() == "Arsenal(26)GunFighter" and item:getDisplayCategory() == "GunMag" then
                scriptItems:add(item)
            end
        end
end
#
    {
        [Recipe.GetItemTypes.ArsenalGunMagazine],
        keep MetalWorkbench,
                ...
    }
    
    recipe Disassemble Arsenal Gun
    {
        
        [Recipe.GetItemTypes.ArsenalGun],
        keep MetalWorkbench,
                ...
    }```
Like so.
small hatch
#

Ah, I guess I got it. Feels roundabout but:

function Recipe.GetItemTypes.ArsenalGun(scriptItems)
    local allItems = getScriptManager():getAllItems()
        for i=0,allItems:size() - 1 do
            local item = allItems:get(i)
            if item:getModID() == "Arsenal(26)GunFighter" then
                local itemInst = instanceItem(item)
                if instanceof(itemInst, "HandWeapon") and itemInst:getSubCategory() == "Firearm" then 
                    scriptItems:add(item) 
                end
            end
        end
end
quasi geode
#

oh, my bad, didnt full read before haha, missed the part you were checking script Item class, not InventoryItem.. thus the instanceof HandWeapon not being needed, should be item:getType() == Item.Type.Weaponi believe

#

though probably not needed to check the type at all really, since all script Items should support :getSubCategory() (defaults to a empty string for non-weapons)

#

if item:getModID() == "Arsenal(26)GunFighter" and item:getSubCategory() == "Firearm" then should be sufficient

pulsar charm
#

why wouldn't this work?
the game breaks and tells me the problem is on line four
I guess maybe result is not defined but I'm just imitating the base game recipe to refill a blow torch

sharp plover
#

Ay can anyone recommend some mods to me? (I've only done vanilla)

tame mulch
cinder vault
#

hey guys, how would I go about adding a tooltip to an item?
I'm pretty new to modding and right now I'm learning from what other mods do and what I've figured out so far is this

  1. I write something like this Tooltip = Tooltip_TestItem, inside the item definition
  2. Inside shared/Translate/EN/Tooltip_EN.txt (for the english version) I define a table called Tooltip_EN and inside of it I add Tooltip_TestItem = "my tooltip"
    Some questions I have:
  3. Does the file need to be named Tooltip_EN.txt or can it be anything I want?
  4. Does the file get overwritten by other mods?
  5. Similarly does the table have to be named Tooltip_EN and will it get overwritten by other mods if it's the same?
  6. Assuming someone else in his mod also named his key Tooltip_TestItem is it going to overwrite mine?
  7. is the Tooltip_ prefix required for each key?

Sorry for the long list of questions, I'm just trying to figure out the best way to do this so my mod doesn't break anything in other mods.

winter bolt
# cinder vault hey guys, how would I go about adding a tooltip to an item? I'm pretty new to mo...

I think it has to be called Tooltip_EN.txt but I'm not super sure. The table does need to be called that though.
Mods will just insert their own stuff into the translation tables so it won't replace anything that isnt a key with the same name. You can prevent conflicts by putting your item in a module called something other than "Base" so you'd do "Tooltip_TestModule.TestItem" instead.
The prefix is required

cinder vault
#

ah thanks! that answers my questions.
So I guess what's happening is the Tooltip_ prefix is telling the game to look inside the Tooltip_EN table for my Tooltip_TestItem key
I've seen tooltips in other mods being defined inside the UI_EN table and they do Tooltip = UI_TestItem which I guess would be another way to do it

frail charm
#

Hi everyone.
I am currently working on a translation for some mods and wanted to customize tooltips to make a few things more clear.

What I noticed is, that <br> doesnt seem to always work to create a break rule in the ingame tooltips? Is there a limitation of the number of br's or rule to keep an eye out for when creating longer tooltips in Zomboid?
And how can I make some letters in the "positive green" or "negative red" colors of zomboid? To give the reader a quicker indication of whats good and bad about this particular item.

fast galleon
frail charm
lean plaza
#

can anyone point me to any references on inserting a filled container (similar to how toolboxes can spawn with items in them) into the distro table. I've already been able to insert the container into procgen and whatnot empty, but now i need to populate certain places with it filled with x items as well

fast galleon
frail charm
#

Oh okay!

tame mulch
frail charm
#

Does that formatting work in the .txt files for tooltip translations? Or is that formatting only for luas?

tame mulch
frail charm
tame mulch
frail charm
latent orchid
#

when should I use getSpecificPlayer(player) rather than directly referencing the param 'player' itself in a function?

#

Im a bit confused as to getSpecificPlayer's purpose

fast galleon
#

if type(player) == number then getspecificplayer I imagine

#

depends if you want / have player object

drifting stump
#

so whenever the player variable is a number you want to getSpecificPlayer

cinder vault
#

If I'm changing item tooltips is there a way to see the changes without having to restart the game each time?

tame mulch
cinder vault
#

yeah that works 👍

gleaming pagoda
#

im having problems adding mods to my new server,i enabled them both in menu and settings,i even tried ONE mod like Raven Creek just to see if a certain mod was causing problems and even Raven Creek did not show as a spawn location

pulsar charm
tame mulch
#

maybe need swap places of func param

pulsar charm
#

alright, thanks

old blade
#

i would love a pagan / wiccan themed or just any witchcraft themed mod that would be really cool

#

it could go well with foraging

#

grow certain herbs like sages or hops

#

could give u mental health buffs n stuff inside your home or something

#

make ur own candles

cinder vault
#

I'm trying to add a custom option to the context menu for an item I made and I figured the best way is to use either the OnPreFillInventoryObjectContextMenu event or the OnFillInventoryObjectContextMenu event. (correct me if I'm wrong)
However I have trouble understanding one thing, those events have an items parameter but they're not the actual items(I think) even though it works since I see another mod doing this items = ISInventoryPane.getActualItems(items) and I'm trying to figure out why that is or if it's necessary.

fair frost
#

Raccoon City Part 7

mint jolt
#

Hello, sorry for asking here, I don't know where else to go! Does some one know what does this parameters do? I have an insane amount of respawning zombies on the server and I think it might be something with this?

mint jolt
#

Thank you!!

#

Oh

stuck sable
mint jolt
#

Yes no problem! ❤️ thanks a ton!

stuck sable
weary crypt
#

Not sure if this is necessarily the correct place, but is there a way to spawn a specific type of zombie in multiplayer? Like the soldier zombie, or doctor zombie, or something added by AuthenticZ, etc

mint jolt
#

Yeah no worries!:))

stuck sable
weary crypt
mint jolt
#

Or you could type in chat /spawnhorde 5 (or any number, being the number the amount of zombies)

#

But to spawn an specific zombie I don't know

mint jolt
weary crypt
#

I thought debug didn't work in multiplayer

lost spear
#

So I have a workaround for the workshop mods always updating fucking my clients joining. Im tryingto update the pack of mods whats the mod.info? This must be new since its now telling me I need it compared to last time when I didnt need it

#

nevermind im dumb

tame mulch
tame mulch
weary crypt
#

Sweet, thanks. Didn't know that

stuck sable
#

Anyone know a fix for the guns/icons to show up for Brita's mod on a dedi? I've followed all troubleshooting I am able to find and no dice

pulsar charm
#

how could i check if the player is standing on a powered tile?

steel jackal
#

what happened to the general container mod on the workshop?

tame mulch
pulsar charm
#

thanks

drifting ore
#

Does anyone have function to drop all inventory items?

pulsar charm
#

i did find that getSquare was inherited, but if I have to use getX, getY, and getZ I will

tame mulch
pulsar charm
cinder vault
#

hey guys, I see a lot of mods are adding their mod id as prefixes to their files to avoid conflicts with other mods but can't you also just create a new folder with a unique name(mod id) and put everything in there without having to add prefixes to every file?
eg. client/Mod/TimedActions/myTimedAction.lua, client/Mod/Context/myContext.lua etc.

fast galleon
#

Is it possible to use java that takes argument Predicate?
getRandomSquare(Predicate <IsoGridSquare>)

#

I tried passing Lua function, with no success

#

Just curious, I did it another way.

pulsar charm
#

in lua, how can i get the player from an item
as in i have an item variable, and i need to use the player object that has the item
the only functions that i see that return a character object are getPreviousOwner() and getEquipParent() but idk if those are what i want

pulsar charm
#

found my answer

local player = container:getCharacter()```
mint jolt
#

Hi! I build a mod for ATM's but I made them 3D objects, is there a way that when placing them in the ground, people cannot traspass them? Is like they weren't there, or how can I do that?

mint jolt
harsh prairie
#

Has anyone ever tried to make a level system similar to the one in 7 Days to Die? tldr level ups give skill points and there are multiple skill trees with perks that have multiple levels.

silk vapor
#

Anyone have a good rundown on britas guns and armor? Trying it in an existing world any tips?

latent orchid
#

Probably a silly thing I am not understanding, but can anyone advise why I cant do a ':size()' check on this table? It seems to throw an error when attempting to get the size of the table. If i try '#matUsed' it doesn't work either ignoring the fact the table has a size of 2. 🤔

quasi geode
#

but since your next line after the size check there is to call pairs on the table anyways, the size check is probably redundant. (it wont iterate over a empty table, and wont error)

small hatch
#

Huh, are recipes not supposed to care where the user decides to execute them?
I have this recipe that disassembles guns. I have different guns in my inventory and choose to disassemble a specific pistol by right clicking it and using the recipe directly from it, but it decides to disassemble some other gun.

pulsar charm
#

do you have one recipe to dissasemble several types of guns?

small hatch
#

Yeah.

pulsar charm
#

that's your problem. look at the base game's dissasembly of spears, they have a recipe for each one

small hatch
#

... Well shit.

pulsar charm
#

I'm not sure if you can avoid that problem while still using one recipe

small hatch
#

I guess the user could favorite them or leave them somewhere. Arsenal has around 100 guns... Kinda oof.

hot patrol
pulsar charm
#

local container = item:getContainer() sometimes stores multiple values, like if i am standing over a backpack. how can i get just the first value and store it?

pulsar charm
pulsar charm
#

I fixed my problem by avoiding it

dense tinsel
#

anyone have a dedicated server using Arsenal(26) GunFighter Mod and brita, and when ur admin to custom options there is a drop down scroll bug? anyone have this problem?

mint jolt
late hound
dense tinsel
hot patrol
mint jolt
# dense tinsel ok thank u for quick answer 🙂

I found that you could edit the arsenal files but when people tried to join the server it said they had a different file, and caused an error... Then I found that you had to put that same file in two different locations on your server files so that when people joined it would overwrite their file, but never tried it, just stopped using it xD sorry

mint jolt
smoky meadow
#

guys how to make your own custom animation in PZ? i just made a Bullpup Assault rifle.

tropic dirge
drifting ore
#

hello guys!

#

화이팅! fighting!

smoky meadow
#

is this a server advertisement?

drifting ore
#

몇사람에게 DM 줬지만 너무 많아서 그냥 올립니다.I gave direct DMs to a few people, but there are so many that I just post them.

#

so my englisg skill

smoky meadow
drifting ore
runic bear
#

Hey, would it be possible to mod vanilla trash bags so that they're burnable in a fire like corpses? I would like to burn bags as a garbage disposal

urban hawk
#

hi, looking to make a mod which brings in more food.
did some research, can't find what the nutrients in PZ are measured in. Grams?
if someone could answer my question it would make my day, thanks

runic bear
#

I thought it was in calories but not positive

latent orchid
#

Which java file contains the context menu code? I'm looking to understand how context:removeLastOption() works.

drifting stump
#

thats lua

#

client\ISUI\ISContextMenu.lua

tame mulch
spare burrow
#

Hey people, is there any specific guide or procedure to completely wipe out loot tables from vanilla + mods of certain areas? want to alter weapon spawns for a mod and i would prefer to start with a clean slate

urban hawk
#

I want to add a can opening sound effect to a mod of mine that im creating. Is there a way to import a custom can opening sound effect and possibly change the time it takes to open it?

tame mulch
smoky meadow
#

I'm making an add-on for Vanilla Firearms Expansion.

tepid crown
hot patrol
#

I don't see why not. in the reddit thread that was posted in someone sai that a brass knuckle mod uses it.

#

can't confirm tho

tepid crown
#

it doesnt

#

it uses an invisible hammer type thing

hot patrol
#

ah

#

well Other than the fact that it isn't being used officially I can't see why someone couldn't use it for another weapon.

#

I imagine the only reason it isn't already in the game is because the devs would want to add proper repercussions to fighting with your bare hands like getting scratches or fractures and it is too much work atm to put people to work on.

sage shard
#

I have a scripting question..
If I want to change something about an item, let's say a good old "Book"
Do I have to put in everything about the item, or just the bits I'm adding or changing about it?
My gut says I need to put in the whole thing, but I just want to be sure.

#

Like, if I wanted to change "UnhappyChange" to -50, I'd have to put in everything, and not just

{
UnhappyChange = -50
}```
undone crag
#

SOmething like getsctiptitem and doparam

wintry finch
#

How would I go about adding in occupation-specific foraging bonuses? Or know of an occupation mod that does already include the bonuses to foraging? So I can look at how they coded it. In the midst of creating a new occupation for learning purposes.

drifting stump
fervent yarrow
#

Hi guys, I remember seeing a video with a zomboid mod, that adds a van or a caravan in the game, where you can actually walk inside of it, but cant find it on the workshop. Anyone know what it is?

lunar robin
#

Does DisplayName overwrite ItemName in any way?

lunar robin
#

It ovewrites the item ID.

crimson spindle
#

In the console.txt file I get the following warnings when loading my mod:

WARN : Script      , 1652597084550> ModelScript.checkTexture> no such texture "WorldItems\HTFACNotesPatient" for HTFAC.HTFACNotesPatient
WARN : Script      , 1652597084550> ModelScript.checkMesh> no such mesh "WorldItems\HTFACLiterature" for HTFAC.HTFACLiteratureCadavers
WARN : Script      , 1652597084550> ModelScript.checkTexture> no such texture "WorldItems\HTFACLiteratureCadavers" for HTFAC.HTFACLiteratureCadavers
WARN : Script      , 1652597084550> ModelScript.checkMesh> no such mesh "WorldItems\HTFACLiterature" for HTFAC.HTFACFileGeneric
WARN : Script      , 1652597084550> ModelScript.checkTexture> no such texture "WorldItems\HTFACFileGeneric" for HTFAC.HTFACFileGeneric```
this happens for every item in my mod. The items have textures and meshes and load up fine when I'm playtesting. How do I get rid of this warning or can I just ignore it?
#

I have my mod structure such that the items script and model scripts are in separate txt files. Could that be the reason?

cinder vault
#

is there a way to check if the game is paused or event that happens when the game gets paused/unpaused?

tame mulch
cinder vault
#

thanks!

crimson spindle
#

what do you mean?

#

the mesh names need to be lowercase? This is what my model script looks like:

    {
        mesh = WorldItems\HTFACSheetPaper,
        texture = WorldItems\HTFACNotesPatient,
        scale = 0.75,
    }```
#

here is the item:

    {
        DisplayName = HTFACNotesPatient,
        Icon = HTFACNotesPatient,
        WorldStaticModel = HTFAC.HTFACNotesPatient,
        Tooltip = Tooltip_HTFACNotesPatient,
        DisplayCategory = Literature,
        Weight = 0.05,
    }```
#

everything else follows this general format

sage shard
#

@drifting stump Thanks, guess I need to read up on how to Lua if I want to make this thing I'm thinking of, but doing it through Lua makes sense if it lets you just add/remove things from items

spare hinge
#

Howdy, I just wanna ask if I understood something right

#

getGameTime():getMultiplier() gives back just the speed at which the game is currently playing, i.e. 1.0 for normal speed and higher if the game is running faster

#

so if I wanted to get the time that passes in one tick, do I divide by 60?

pulsar charm
spare hinge
#

ahh good call

#

the framerate is locked by a constant however though right?

pulsar charm
spare hinge
#

getFrameRate seems to just fall back onto getLockFPS

#

s_uncappedFPS looks entirely unused

#

no idea whats going on here tbh

pulsar charm
#

getAverageFPS might be your bet then
i dont have the java files so i didn't know it existed

spare hinge
#

ill sick with getLockFPS for now

#

that seems to actually drive logic

cinder vault
#

on this note ^ does the OnTick event run at a constant rate or is it dependant on frame rate? if it's dependent on framerate then it would be the same as OnRenderTick right?

spare hinge
#

i wouldnt bet on it

#

it could just be very inconsistent language used

#

if logic tick and render tick were the same, the game would slow down every time you had fps hitches

pulsar charm
#

ticks should not be tied to framerate because that would mean someone playing on 30fps played twice as slow as someone on 60fps

spare hinge
#

I think FPS is used interchangably here for tickrate

undone crag
#

There is getGameTime():getMultiplier()

tame mulch
crimson spindle
#

does the mesh name need to be lowercase in the model file? or the actual mesh file in the directory? I'm looking at how the vanilla items are set up and they don't seem to use lowercase for their meshes or in the script so I guess that's what's tripping me up

#

they are all working so i know its not a huge deal was just curious what was causing the warning

crimson spindle
#

thank you!

drifting ore
#

Question, do gates open both ways or one particular way?

willow estuary
#

Just one way, toward the viewer.

drifting ore
#

Gotta redo it otherwise the panels have magically swapped sides 😂

willow estuary
drifting ore
crimson spindle
#

@tame mulch I found the problem! It was because i used backstrokes in the model script instead of strokes
This throws errors:

texture = WorldItems\HTFACNotesPatient,```
This does not:
```mesh = WorldItems/HTFACSheetPaper,
texture = WorldItems/HTFACNotesPatient,```
#

thank you again for your help! Use / not \ 🙂

cinder vault
#

I just did some tests, OnTick runs once every frame so if you're playing at 60 fps it's going to run 60 times etc @pulsar charm @spare hinge
same thing happens with OnRenderTick

#

so it's tied to framerate

spare hinge
#

oof

runic bear
#

If a container burns do the contents get destroyed?

runic bear
#

I see this getTexture(filename);, would that work to get and set the texture?

undone crescent
#

hey im new here! i wanna make a notebook with notes in it allrdy. any idea what to put in the script to make it work?

undone crescent
tame mulch
runic bear
#

I would want it to set whenever the vehicle spawns, I'm really just trying to disable a few camo skins that I don't like, but I think the real easiest way to do it is to just rename the textures

trail lotus
#

hey can anyone do a little project for me and my server. you'd basically be working on a existing mod that was ravamped from a older mod, and id like for it to be revamped again haha. you'd be compensated for your time 🙂 i dont think it would be difficult just something i need adjusted

cinder vault
#

@spare hinge just pinging you because you had a similar problem with me and I figured it out. To get the time that passes in one "tick" with the same end result for any fps you can do one of the 3

getGameTime():getRealworldSecondsSinceLastUpdate()
getGameTime():getMultipliedSecondsSinceLastUpdate()
getGameTime():getGameWorldSecondsSinceLastUpdate()

the last two automatically handle different game speeds, however keep in mind that if the game is paused these 3 will still return as if the game speed was set to 1, not 0

spare hinge
#

hell yea

#

thanks

#

another unrelated question

#

is there any way to "draw" onto the screen directly in any way?

#

I want to draw stuff around the cursor

runic bear
#

I would think change the cursor icon temporarily?

charred dune
#

Hi, is there a way how to disconnect a player using server side lua script? I didn't find anything on the internets.

pseudo lake
#

Could you not just kick them?

#

😄

charred dune
#

@pseudo lake Sure I can, but we would like to have a script which will automatically disconnects all players when less then X players are online.

pseudo lake
#

you could do it with a bash script, wouldn't even need a mod

#

run the players command to check how many players are currently connected, and then kick them based on the parms u set

#

assuming running under linux

charred dune
#

We can't run bash scripts unfortunately 😦

pseudo lake
#

You COULD do it with RCON, but I found mixed results using that

charred dune
#

On client lua I can disconnect player, but cannot figure it out in server lue script

#

Probably I can stick with client mod then, since we are a small group.

pseudo lake
#

There is an event OnDisconnect

#

You might be able to hook into that. OnDisconnect if players < playersRequired Do some shit

#

I dunno how accurate this source is tho 😄

charred dune
#

Right now I just listening for event EveryTenMinutes, but will use something like OnDisconnect in the end

pseudo lake
#

OnDisconnect would make more sense, because then your code doesn't need to run in the background.. It'll evaluate every time a player disconnects

charred dune
#

Sure, is there something like timeout function which will run provided fn after some time?

#

If not I am still stuck with EveryX events anyway

pastel loom
#

Hello, I'm using snake's mod pack. No actual problems. I was curious. is the check weather button from that mod or is it base game now?

#

I'm looking on the list. Theres nothing there.

#

Found the answer.

burnt matrix
#

Hello, does anyone know if I can add mods to an on going multiplayer server hosted by me without messing things up?

pseudo lake
wintry finch
#

Is there references behind the code for traits already in the game that I can draw on for adding in new custom traits to an occupation? Not too advanced with lua, and first time modding this game. For example, wanting to do a lesser version of organized. And was trying to find the code for how that trait works.

pulsar rock
#

I guess it's not technically modding. But for any server owners out there; How much interest is there in a Discord bot for PZ server management?

I've made one for our own server, but it's perfectly capable of being reused for other servers.

It simply uses rcon to fetch info / run commands remotely, and has some neat features like nickname matching, logging & graphing player counts / calculating prime time, etc...

true jolt
#

there is a depressing lack of l4d mods

#

part of me just wants to learn how to make them myself

pseudo lake
#

@pulsar rock could have been my shotty code, but I found if I created a lot of sessions to rcon, it would cause issues (this was maybe a couple months ago when MP released). If you're running it on a linux vm, use a screen session and pass directly to the screen session would be my only suggestion

runic bear
#

Turn on sprinters, highest ammo loot and weak zombies, bam

pseudo lake
#

Probably my shotty code 😄 but just thought I would tell ya what I encountered

true jolt
#

i do wanna run a l4d mode with infection turned off

pulsar rock
#

And RCON's responses are honestly so nice to handle

#

Rather than grabbing stuff from the screen session

true jolt
#

but stuff like special infected would be a dream

pseudo lake
#

Yeah fair cop 🙂 Looks dope either way 👍

runic bear
#

NPCs and animals are coming like next update, so I'd wait until then. I'm planning to make some monsters myself.

true jolt
#

i know the tank would be nigh impossible but like the witch would be cool

runic bear
#

I saw a mod that added screamers

true jolt
#

the cut enemy?

runic bear
#

A zombie that screams, drawing zombies towards it

#

Isn't that what the witch is?

true jolt
#

i wanna see if I can mod in the red safe room door myself

runic bear
#

I dunno I never played L4D

true jolt
#

screamer was a cut enemy type yea

runic bear
#

How long has this game been around and nobody has attempted a grappling hook mod?

true jolt
#

fr

runic bear
#

I'd say I'd do it myself but realistically it's going to be me asking somebody else step by step how to code it lmao

fast galleon
#

hooks exist

runic bear
#

Hooks?

faint jewel
#

hookhausen

runic bear
#

Where?

#

I looked and turned up nothing

fast galleon
#

Ninja Science has one

runic bear
#

Is that one of those mods that has zero explanation of what's actually in it?

#

Yup algol

fast galleon
#

kinda 🤣
but it's planetalgol's mod

runic bear
#

Before I waste my time, does it actually let you climb to higher levels?

fast galleon
#

it should, but he had tooltip on wrong item and I was testing wrong item

runic bear
#

Hmm alright, guess I'll take a look.

true jolt
#

if theres any good stock racing car mods there needs to be a jiimy gibbs jr mod

runic bear
#

Maybe if that guy would put explanations of what his mods have people might actually use them

fast galleon
#

he's actually pretty good, if you don't look at that

runic bear
#

Yeah I like the idea of most of his stuff, but the whole "too cool to contact" bullshit is infuriating

#

And the fact he refuses to say what's actually in half his mods, or how it works

#

Like if you don't want to ruin "the surprise" for yourself, don't read the description. Or spoiler it.

#

I'm using Even Worse Searching and found Intel Documents and some other crap. Ended up having to mine his stupid mod to see what they were for, and guess what! They're for nothing at all. I loooooove getting useless items that give me recipes you can't actually make in my mods, especially when they're not at all related to the mod itself

true jolt
#

ppl need to tag their shit

runic bear
#

Grappling hook works which is cool, wish you could break windows with it or use it to climb onto flat roofs

pseudo lake
wintry finch
#

@pseudo lake Not exactly. I am sorry, I shoulda' specified more. I already have a full occupation done from learning today thus far, fully works in-game, etc. But I was looking to expand upon it further by adding in occupation-specific traits. Closer to something like Desensitized, from Veterans. what I had in mind, was combining together Organized, Low Thirst and Light Eater. But lessening the value of each, so that Organized only gives a 110% value increase in inventory capacity rather than than 130% increase. Low Thirst 15% and Light eater 15%. So I can't use the traits in the game already. But I wanted to see how the traits in the game were implemented, so that I could perhaps re-work them out in my own traits with different values.

pseudo lake
#

I don't know if they're exposed in lua

wintry finch
#

They might not be. I'm at a loss for going further with it right now though. lol.

runic bear
#

How does the game identify ledges that can be sheetroped?

umbral heron
#

hey guys

#

oh wrong channel

wintry finch
#

@pseudo lake I did find a modded occupation that has a custom trait touches resilience akin Thick Skinned/Prone to Illness. Looking through his lua files, nothing stood out that would immediately help for what I am looking for. Though I just started today with this stuff. Not entirely sure if where he found those values would be in the same place or not but I did write him a comment. Nothing back yet.

spare hinge
#

so im struggling to get my custom ui element to actually run its render function

#

i didnt make a new class for it, ive just overriden the render method field directly, but it should work in theory

#

but it dont

#

(also it didnt work when i did do this one more conventionally)

#

the prints dont show up in the log at all

drifting stump
spare hinge
#

that seems to have done the trick hell yea

#

cheers

slow graniteBOT
#
Axebeard#4144 has been warned

Reason: Do not lash out, harass or attack other users.

runic bear
#

I'm trying to see if I can get algol's grappling hook to work on ledges too, but I'm having some trouble identifying what counts as a ledge, as in what the game would let me use an Escape Rope on. Looking through Throw Them Out the Window I got this bit but it doesn't seem to be working
object:isHoppable() and object:canClimbOver(player)

fair frost
deft falcon
#

is there a way to see what profession/occupation player chose?

drifting ore
#

anyone know of a mod which adds a military urban camo jacket

rancid barn
deft falcon
#

no i mean in modding

willow estuary
deft falcon
#

thanks

heavy turret
#

Hey, I'm trying to fix a mod for myself, after some update I get errors 'attempted index: of non-table: null', does this mean that parameter type I'm using was changed? The line was _item:getSprite():getName() .If someone could help me understand where to dig that would mean a lot, thank you.

tame mulch
heavy turret
#

if I removed the getSprite it was throwing errors at getName, it's related to radios

tame mulch
#

I mean need check _item:getSprite() ~= nil then ...

heavy turret
#

Is there anyway I can check what changes were made to a specific lua file?(from indiestone)

tame mulch
#

What changes?

#

You can compare files from build 68 and 71 for example by winmerge

heavy turret
#

uhu, so I need to download previous versions right? The changes are not documented anywhere?

tame mulch
#

In posts about pathes you can check main changes, but not all lua changes

heavy turret
#

so I originally had _item parameter that comes from ISRadioWindow.activate(pl, obj, true) in the ISWorldObjectContextMenu.lua, can it be that before the update it originally passed item, but now it passes IsoRadio and therefore I cannot access these methods mentioned above?

tame mulch
heavy turret
tame mulch
heavy turret
#

well the code is there, it's just the update that broke the check

fiery pecan
#

welp

#

I tried what Aiteron said, about the client/server thing. Using the vanilla code in VehicleCommands.lua as a reference. Keep getting this blasted error: file: STEV_VehicleOverrides_Server.lua line # 8. [16-05-22 12:46:56.943] ERROR: General , 1652723216943> ExceptionLogger.logException> Exception thrown java.lang.IllegalArgumentException at NativeMethodAccessorImpl.invoke0 (Native Method).. [16-05-22 12:46:56.943] ERROR: General , 1652723216943> DebugLogStream.printException> Stack trace:. [16-05-22 12:46:59.410] LOG : General , 1652723219410> ERROR: sendClientCommand: can't save key,value=vehicle,zombie.vehicles.BaseVehicle@dd32576.

#

my client code:

function stzo_stev_override(vehicle)

    local GetVehicles = getWorld():getCell():getVehicles();

    if GetVehicles ~= nil then
        for i=0, GetVehicles:size()-1 do
            local GetVehicle = GetVehicles:get(i);

            local args = { vehicle = GetVehicle:getId(), name = "Base.85crownvic_rosewoodpolice" }
            sendClientCommand(getPlayer(), 'vehicle', 'setScriptNameSTR', args)
        end
    end
end
#

server code:

require "Vehicles/VehicleCommands"

if isClient() then return end

local Commands = {}

function Commands.setScriptNameSTR(player, args)
    local vehicle = getVehicleById(args.vehicle)
    if vehicle then
        vehicle:setScriptName(args.name)
        vehicle:transmitScriptName()
    end
end

Events.OnClientCommand.Add(Commands.setScriptNameSTR)
vapid wind
#

anyone know of any mod that adds any kind of mining smelting system?

quasi geode
#

also, your server side code / Event needs some reworking. its doing no validation on the module & command args, which are also missing from your function defined there

#

thats going to be incorrectly firing on every ClientCommand received.

fiery pecan
#

ah

fiery pecan
# quasi geode theres a discrepancy between the error message, and the code your showing. speci...

I see why. I sent the error message that occurred when I removed getId()

function: setScriptNameSTR -- file: STEV_VehicleOverrides_Server.lua line # 8.
[16-05-22 15:35:47.784] ERROR: General     , 1652733347784> ExceptionLogger.logException> Exception thrown java.lang.IllegalArgumentException at NativeMethodAccessorImpl.invoke0 (Native Method)..
[16-05-22 15:35:47.787] ERROR: General     , 1652733347787> DebugLogStream.printException> Stack trace:.```
timber moat
#

any thoughts on how to randomize the amount of water left in sinks/baths/toilets? Or else to make them tainted water sources? I'm very new to pz modding and want to make my one year later start even more punishing :p

pseudo lake
#

So current multiplayer works by send command to clients? Do they need a rec and send? and timed actions?

mint jolt
# tame mulch Create files like this and add translates

Hi, Aiteron! Do you know (or some helpful soul here) how can I translate recipe names? I have some recipes on the scripts folder and I'm wondering how could I translate them? Thanks a ton for all the support provided 😄

hard crypt
#

Ayyyy.. nothing fancy but first mod works 🙂 just a really really overpowered machete to test the waters

calm depot
#

does PZ have any tools that let you profile the game as it's running to figure out where/why stutters or lag are occurring?

hard crypt
calm depot
#

are you referring to -debug ?

hard crypt
#

yee

calm depot
#

that's not what I'm asking about

hard crypt
#

gotcha. like I said im new so im not sure what all you can and cant do with that yet.

#

it looked pretty extensive tho

calm depot
#

there's a debug option I turned on that will write to the debug log if any lua events take too long, but unfortunately, that does not complain about anything

#

there is also an option that writes a bunch of profiling data in the form of CSV files, but judging by its format, it's clearly intended to be fed into some external tool, which I don't think gets shipped with the game

hard crypt
#

maybe theres something in the modding tools package? you probably checked that already tho :/ I dont think I can be any help to you sorry lol

calm depot
#

no, that's just the tiles and world editors

hard crypt
#

gotcha. I will have to start digging into all that soon

calm depot
#

ah, I just realised, I can run VisualVM on the game

hard crypt
#

so far all I did was add a modified version of an existing item, just getting a feel for the game

calm depot
#

Did they make a change in the unstable version of PZ so that it doesn't load translation strings on the server?

runic bear
#

How could I get the number of items inside a container? Or if there are any items at all? I really just need a yes/no if it contains something

#

Would it be if container:getItemCount() > 0 then ?

#

container.getItemCount() > 0 crashes too lol, I'm pretty confused over when to use : over . but that's another issue

#

if container:getInventory():getNumItems("name") > 0 then am I on the right track here?

calm depot
#

table:function(arg1, arg2) is just a convenience that saves you from doing table.function(table, arg1, arg2)

#

if you don't care how many items there are, use isEmpty()

#

if you do need to know exactly how many, use getItems():size()

#

@runic bear ^

hybrid mica
#

Hey guys. I have a dedicated server and am using a few custom mods, britas armour and some vehicle mods. However I haven’t seen any of it spawn anywhere. Do I need to start a new world,

#

Any advice?

runic bear
hybrid mica
#

I couldn’t find anything even in the military base.

#

No vehicles either

#

Is there a way to check if it’s spawning in the world without just running around ?

runic bear
#

I'm pretty new to modding PZ myself so I'm not sure.

calm depot
#

@hybrid mica yeah, log in with -debug turned on and enable the LootZed cheat

#

find any container it should spawn in, click on its icon (in the inventory screen) and a window will pop up

hybrid mica
#

I’ll give it a try thanks so much

#

Yeh I only saw that channel after I posted that.

calm depot
#

with that said - does anyone know if localisations for DynamicRadio on the server side got broken recently/on 41.71?

#

I have a DynamicRadio_EN translation that works fine via getRadioText() on the client, but not on the server... which is a bit useless because obviously it's the server that sends the translated strings

strange pewter
#

hey guys, anyway to modify armor so that it cant get bloody? bloodlocation=null or something??

polar gyro
#

Maybe someone can tell me where I can find vanilla traits code?

willow estuary
strange pewter
#

hmm gotcha. i was mid replaceall with the bloodlocation and you just saved me some time hah

willow estuary
polar gyro
#

@willow estuary I know about traits costs. I need deeper exploration of trait mechanics

#

And thank you of course

fast galleon
#

Anybody know why sometimes I can't barricade window, this usually happens when I have a bunch of walls, windows and some doors cramped together.

#

ok, the problem is that window is nil when I right click

#

there is a sweet spot, when I can not see door and click above wall that lets me barricade, but when text only says barricade it's really hard to find. I tried this before and sometimes I find the spot, sometimes I don't.

calm depot
#

@cunning canyon are you still maintaining Save Our Station?

fast galleon
calm depot
#

seems fine to me

#

couple of Lua related things though:

  1. and square is unnecessary, it is impossible for it to evaluate to false
#
  1. you don't really need squares since it's just used for iteration, it can be reduced to ipairs({a, b, c})
#

if you're wondering about point 1: a Lua table cannot have keys with nil values

fast galleon
calm depot
#

however, this then might create a problem for you, consider {"stuff", nil, "morestuff"}

#

if you iterate using ipairs() it will only go as far as "stuff"

fast galleon
#

making it from 1 to 3 again

calm depot
#

or, if the order you process them in doesn't matter, just use pairs() instead

fast galleon
#

also good :)

calm depot
#

just to clarify, {x, nil, y} results in a table with only [1] and [3] - pairs() will serve up 1 and 3, 2 simply doesn't exist so you still don't need the and square check.

ripe vector
#

Is there any good mods for admins

undone crag
#

3D world items are depreciated in 41.71. Is there a way to draw models apart from using vehicles (ps and apart from using a 2D image)?

shadow geyser
#

is there a proper way to catch java exceptions to handle them in the lua. I have some code that occasionally will do an attepted index of an non-table, and in that case I would want it to just skip the rest of the function with a return, but I can't figure out how to catch java exceptions. im using pcall to catch lua exceptions, but it doesnt work on java exceptions.

hard crypt
#

oh.. in the lua.. my bad. no clue

#

sorry about that if I could learn to read lol

calm depot
#

@shadow geyser no, because you would have to write Java code to catch them and pass back into the lua state

calm depot
#

Also, deprecated whaaaaat?

undone crag
#

In that case I should have specified that I meant rendering the models during the game like with vehicles and people and items, which can let you show them at different angles and intersect with other models.

calm depot
#

How are they going to deprecate it

#

If I drop an item, I get a 3d model

undone crag
#

It generates a 2D image from the model, not taking the World attachment into account.

calm depot
#

The game does?

undone crag
#

The game does.

calm depot
#

Then I don't understand what the issue is

undone crag
#

The game does generate a 2D image from the model, not taking the World attachment into account.