#mod_development

1 messages · Page 534 of 1

drifting stump
#

off the top of my head i think its ISPanel

faint jacinth
#

alright, i'll start looking into it

#

thank you

#

you're literally the first and only one in days that was able to point me atleast somewhere

drifting stump
#

its ISInventoryPane and ISInventoryPage which are derived from ISPanel

#

one is player inventory the other is loot inventory

faint jacinth
#

ISInventoryPage for loot inv got it

drifting stump
#

they are both an ISPane doesnt really matter which you look into

#

probably look into both for a better overall idea

faint jacinth
#

My goal project is a inventory organization tool so I been looking for something to manually create a inventory display.

inland crater
#

iss there an addLineChatElement for yelling?

unborn radish
#

Would anybody be willing to give me some guidance with .lua stuff? I am trying to do something for my mod which is otherwise finished, but i've never coded in this language before, so i can't quite get it right. I don't think I'll figure it out without assistance

dire edge
#

hey I want to make a mod to add bicycles, I have limited experience coding using JavaScript, a subscription to Codecademy, and a desire to do this shit. I realize this is going to be a 6 month+ project and my limited knowledge will be a hinderance but is anyone here willing to help me get up and running?

late hound
dire edge
chrome egret
#

vision

junior raven
#

Why does OnServerCommand() never get called?

/media/lua/server/server.lua

local function SendCommand(playerObj, message)
    local args = { message = message }
    sendServerCommand(playerObj, "MyModule", "MyCommand", args);
end

/media/lua/client/client.lua

local function OnServerCommand(module, command, args)

    -- THIS LINE IS NEVER EXECUTED
    print ("Server command received")

    if module == "MyModule" and command == "MyCommand" then
        print ("Success!")
    end
end
Events.OnServerCommand.Add(OnServerCommand)
#

This was in a self-hosted server. The game client was both the server and the client.

junior raven
#

It should work, shouldn't it? Everything is correct.

drifting stump
#

and is that all the code?

junior raven
#

I have a menu command that calls the SendCommand function, but that's about it. I confirmed SendCommand function is being called

drifting stump
#

what do you mean a menu command

junior raven
#

And I confirmed the arguments passed to it are PlayerObj, string

#

In-game right-click menu

#

Just an event to trigger this test code

drifting stump
#

and that executes that server function?

junior raven
#

Yes

drifting stump
#

thats the issue

#

its running on the client not the server

junior raven
#

but... it's in the server folder, how is that possible?

drifting stump
#

from that menu youd have to sendClientCommand and server side handle onClientCommand to execute that

junior raven
#

Ohh.. okay

drifting stump
#

clients still load server files

junior raven
#

So the folders enforce nothing. Client and server are separated by logic only

drifting stump
#

a server doesnt load client

junior raven
#

Oh

drifting stump
#

its because a client can be a server

#

if you want to prevent it entirely from loading on a client you can add this to the very top of the file

junior raven
#

And it still loads and runs the server code when you connect to a remote server?

drifting stump
#

if isClient() then return end

junior raven
#

Will that break the mod when run in single player or self-hosted?

drifting stump
#

single player is neither considered a client nor a server

#

so not isClient() and not isServer() == true means its singleplayer

junior raven
#

So is this true:

Remote Server

  • Client loads client code, shared code, and server code
  • Server loads shared code and server code

Local Server

  • Client loads client code, shared code, and server code
  • Server loads shared code and server code

Single Player

  • Loads client code, shared code, and server code in the same instance
drifting stump
#

think so yeah

junior raven
#

Thanks. It's confusing

drifting stump
#

it shouldnt matter if the clients loads server code anyway because youre only going to run server side code there

junior raven
#

You mean you're only going to run client side code there?

drifting stump
#

in your case you called sendServerCommand from a client and that does nothing because its not a server

junior raven
#

That makes sense

drifting stump
#

and events you register inside server files are usually only called by a server

#

so never get triggered on a client

junior raven
#

Riiight

drifting stump
#

also note sendClientCommand does not work in singleplayer because it is not a client

junior raven
#

How do you keep it from breaking in single player then?

drifting stump
#

what do you need to do server side?

junior raven
#

Suppose anything... Do you just duplicate the code to server side?

#

Like, that system message I asked about earlier

#

Server sends a message to client to display in chat window (though single player has not chat window)

drifting stump
#

if youre accessing globalmoddata which is on the server then in singleplayer its already local so can access from client code

#

tbh in that case its a bonus code isnt ran and wont cause issues with a missing chat window

junior raven
#

So if you need to send a command to a client, sendServerCommand won't trigger OnServerCommand

#

You would need an if (singlePlayer) somewhere to ensure client side code gets run

drifting stump
#

i dont recall if sendServerCommand works in singleplayer

#

but yeah you can have a check

junior raven
#

Cool, thanks, @drifting stump

junior raven
#

The code doesn't work from client-side either:

/media/lua/client/client.lua

-- This function is called when the player clicks a command on the right-click menu
local function SendSomeCommandToServer()
    sendClientCommand("MyModule", "MyCommand", {});
    print ("Command sent")  -- This text DOES print
end

/media/lua/server/server.lua

local function OnClientCommand(module, command, player, args)
    print ("Server command received")  -- This text does NOT print to the command console
end
Events.OnClientCommand.Add(OnClientCommand)
#

Again, this is self-hosted locally (not single player or remote).

drifting stump
#

it would print on the server console not client

#

iirc host runs a headless server

junior raven
#

Does that print in the Zomboid root folder because I don't see it printed there

#

@#$%#$^

#

Wrong file

drifting stump
#

check User/Zomboid for server-console.txt

junior raven
#

It's not writing to that at all

#

Ah, it uses coop-console.txt now

#

AAHHH IT WORKS .....PARTIALLY!

#

Thanks again, @drifting stump!

drifting stump
#

np

junior raven
#

I must be getting sleepy

zenith smelt
# junior raven I must be getting sleepy

I once had probelm debugging too.
It got easier when I made a custom log file and then I could see if stuff is happening



function Custom_DEBUG (message)
    if (type(message) ~= "string") then
        message = tostring(message);
    end;
    local file = getFileWriter("MyCustomLogFile.log", true, true);
    if (isClient()) then
        message = "Client:" ..  message;
    else
        message = "Server:" ..  message;
    end;
    file:write(message .."\r\n");
    file:close();
end;

Something like that

junior raven
#

Cool, thanks

#

I just realized EveryHours doesn't get called server-side. I need some sort of timer event.

inland crater
#

Does anyone know of a way to limit the range of ProcessSayMessage?

#

in ISChat?

odd notch
#

if they ever expose it to lua, we can change it

inland crater
#

hmmm maybe you could use the processPM function but get the players standing on nearby tiles and have it send a pm to all of them

junior raven
#

Does the server setting VoiceMaxDistance not affect /say range?

odd notch
#

make it

#

it would make me happy

#

@sour island hello friend with your uhhhhhhhhhhh moodles yelling mod thingy where the player goes 'brr' when its cold and stuff. does that broadcast to other players?

drifting ore
#

Is brackets good enough for modding?

craggy furnace
odd notch
#

think he uses Say()

#

which i think? is client side?

craggy furnace
#

you may be correct

#

it currently just has a selector for zombies hearing it

#

take that as you will

odd notch
#

say() is rather useless in MP unfortunately

#

would love that selector to affect things like the global processaymessage

#

but alas

drifting ore
#

Im looking for someone with modding expirence

#

Because I want to edit one mod

#

But i don't have any expirence

#

But i know what i want to achieve

#

So please if anyone is willing to help

#

Then please dm or ping me

torn cypress
#

What are some mods to make my game more scary.. not in the way to make it harder or a horror game.. just like a sadder world... Or small changes to zombies and or models?

drifting ore
#

Well my mod would be great for something like that

#

IF SOMEONE COULD HELP ME

#

But seriously

#

Check this video

smoky meadow
#

i can help you with script but not in LUA

drifting ore
# torn cypress What are some mods to make my game more scary.. not in the way to make it harder...

In prep for october! I thought Id cover a new modlist, but this time it focuses on the more horror-themed mods out there! Anyways, I hope you all enjoy and stay tuned for the actual series coming up real soon!!!

0:00 Intro

0:29 Afraid of Monsters Zed animations/Skins:
https://steamcommunity.com/sharedfiles/filedetails/?id=2590814089
https://st...

▶ Play video
drifting ore
smoky meadow
#

i currently making a mod. i want to bring Rust to Project zomboid.

drifting ore
#

I don't know the difference but I'll need any help

drifting ore
#

I always thought that Zomboid would be great for something like Rust or Escape from Tarkov

#

I'm trying to edit one mod

smoky meadow
torn cypress
smoky meadow
drifting ore
#

I want to give zombies even worse sight than poor sight in sandbox options

drifting ore
#

It makes you more or less visible

#

depending on various factors

#

And

#

I want to edit that mod

#

So it'll give me permanent Camouflage

#

But

#

From what i understand

#

It works in a way

smoky meadow
drifting ore
#

That there's a value how much you're visible to zombies

drifting ore
#

But thank you for your willingness to help

smoky meadow
drifting ore
#

Good idea

#

Where i can contact him

smoky meadow
drifting ore
#

Steam?

drifting ore
smoky meadow
#

discord

smoky meadow
torn cypress
#

Imagine a mod that makes * and players have a chance to fall over dropped items.. and that u can use small furniture as a weapon on push zombies over them so they trip.. idea from "all of us are dead".. I have a small feeling that this game is missing that kinda of realistic combat

smoky meadow
drifting ore
#

And I want to change that mod

#

So the camouflage won't expire

#

But be permanent

#

And set at some certain value

torn cypress
drifting ore
#

So zombies won't be too blind

#

Also I'm not sure if if affects their hearing

#

But i want them to have pinpoint hearing

glacial ore
#

Workshop ID: 2335368829
Mod ID: AuthenticZBackpacks+
Mod ID: Authentic Z - Current
Map Folder: AZSpawn

#

Should I write AuthenticZ instead of Authentic Z?

obtuse pelican
#

If im modifying a base item, does my file in scripts need to be a full replacement of the item or does it only need to append?

#

example, if i wanted to double the usage rate of thread, would i do it like this:

item Thread
    {
        DisplayCategory = Material,
        Weight    =    0.1,
        Type                =            Drainable,
        UseWhileEquipped    =    FALSE,
                UseDelta            =    0.2,
        DisplayName    =    Thread,
        Icon    =    Thread,
        ConsolidateOption = ContextMenu_Merge,
        SurvivalGear = TRUE,
        WorldStaticModel = Thread,
    }

or like this:

item Thread
    {
                UseDelta            =    0.2,
    }
#

all my prior interactions with game modding were done by appending and not just clobbering so im just a lil confused here on the conventions

lunar cloak
#

I need some small assistance when it comes to adding maps to the world. Can someone aid me through it? 😄

fallen mural
#

So I want to make zombies normal during the day and absolutely ridiculous at night. How would I go about that in sandbox settings?

#

Or is there any mods for that

chrome egret
chrome egret
celest crane
#

I.... don't get Brita's Weapon Pack

#

Other firearm mods like AR-15 specifies the gun model and various attachment points

#

Brita's has.... nothing

#

it only specifies the model of the parts like the magazines but none of the gun itself

celest crane
#

I'm trying to extract MG42 out of Brita's weapon pack (I'm not interested in anything else really, especially not the gunplay changes) but for the life of me I can't figure it out. I don't see MG42 game data described anywhere beyond the model

#

When I do a grep of the whole brita weapon pack folder, this is all I get

#

I'm super confused

#

what the actual fuck, it's fucking split between Brita providing the models and Arsenal(26) providing the gun data

#

why would.... why would you do that? tech_jesus

coarse wind
#

does anyone know how to get brita to work i cant get to work on hosted servers or my single player games?

drifting ore
#

Who doesn't like bloated libraries

wintry crown
#

brita moment

unborn radish
junior raven
#

Is it possible to create a new slash command and capture it in a lua script?

tawdry moss
#

How to I make it so a crafting recipe requires a certain skill? Like a recipe requiring X metalworking or such

strange sequoia
plucky valve
#

i dream about a mod that replace zombies by velociraptors X)

#

i think i need more sleep

inland crater
#

Hi guys, what's the point of setting local variables like this at the top of files?

#
local getPlayer = getPlayer;
local isOutside = isOutside;
local getStats = getStats
#

isn't this redundant in lua?

#

I understand global scope but I don't seeeeee where that is

#

ah

#

Can be used in other files?

quasi geode
#

eh local at the top of files provides everything in the file access to the variable (all functions and blocks of code) but keeps it contained to that file only, where global provides access to all files. Ideally you want to keep variables in the smallest scope possible (ie: local instead of global)
in that instance above, its taking global variables (getPlayer) and assigning them to local, theres several reasons for doing this

  1. performance. its faster to lookup local variables over global (thus faster to call a local function)
  2. consistency. if something were to replace the global function getPlayer, then the local still has access to the original, instead of calling the replacement
#

likely they've done that for performance reasons, i do this as well, and pull all globals into local namespace at the top

violet grove
#

Just realized why they used lua language to mod

#

lua is pretty easy to code compared to Java

junior raven
#

Is it possible to capture a command from the chat window?

zenith smelt
#

I think it's better to make all the functions in your files global so other mods can overwrite or copy them.

#

And also add a custom PREFIX for every mod so other people using same function names won't overlap

drifting torrent
#

So I was thinking of getting into making a car mod, is there any tutorials on this particular process? I have searched but come up with nothing so far. Would perhaps the best approach perhaps be to study others car mods to see how they work?

chrome egret
zenith smelt
#

What do you mean by your class file can be overwritten?

chrome egret
#

If you create a file "HCThingDoer.lua" and write a function "HCThingDoer:makeMagicHappen" then another mod can come along and write a replacement for just HCThingDoer:makeMagicHappen.

zenith smelt
#

Ohh so making like a thing like this:
HCThingDoer = {}
???

chrome egret
#

Sure, or derivation

#
require "TimedActions/ISBaseTimedAction"
SearchRoomAction = ISBaseTimedAction:derive("SearchRoomAction");
zenith smelt
#

Ahha, yes that makes sense.

Definitely that's the best way

chrome egret
#

I'm not saying to never use globals btw, just to avoid

#

There are other ways to make your code configurable/overwritable

zenith smelt
#

So the class should be global, all functions shoulld be local to that class

chrome egret
#

That's how I do it, and seems to match what I see in the vanilla code/other mods

zenith smelt
#

I haven't done it like that, so I just make function myclass.myfunction () ???

#
myclass = {};
function myclass.myfunction ()
end;
#

I'll keep this in mind from now, it does make sense and also organizes way better, so I don't have to have prefix on every function, but only on my class

#

Thanks

chrome egret
#

np

#

Here's a small example for you, notice in this case I don't make the class globally available, I export it

#
local collectionUtils = {};

local Set = {};

function Set:add(key)
    self[key] = true;
end

function Set:contains(key)
    return self[key] ~= nil;
end

function Set:merge(otherSet)
    for k, _ in pairs(otherSet) do
        self:add(k);
    end
end

function Set:count()
    local count = 0;

    for _ in pairs(self) do
        count = count + 1;
    end

    return count;
end

function Set:new(list)
    list = list or {};
    
    local set = {};
    setmetatable(set, self);
    self.__index = self;

    for _, v in ipairs(list) do
        set[v] = true;
    end

    return set;
end

collectionUtils.Set = Set;

return collectionUtils;
#

Then in another file I can use it like so:

local collectionUtil = require("PZISCollectionUtils");
local Set = collectionUtil.Set;
zenith smelt
#
local collectionUtil = require("PZISCollectionUtils");

I didn't know about this one.
Ahhhhh. I tried just using require and couldn't edit local stuff

edgy sparrow
#

hey guys, anyone know the character max health value? is it 2000?

chrome egret
zenith smelt
#

Would be cool if zomboid wiki had something like CODING BEST PRACTICES or/and guidelines for modding lua

chrome egret
#

Pretty darn helpful

zenith smelt
#

Ahh I didn't even know about this

#

I kinda only skimmed the modding page on the wiki and saw no code blocks so I never found that

#

I can't read much, it makes me tired and bored

chrome egret
#

Between that and the Lua fundamentals you can go pretty far

#

plus MrBounty's tutorials are very straight to the point

inland crater
drifting ore
#

Does anyone know how long it takes to quit smoking with Dynamic Traits mod?

dark rover
#

does anybody do clothing mod commissions?

hot patrol
#

How hard would it be to make a mod like Improved Hair Menu but for clothing? I've been using Fashionista for more clothing customization in the character creator without the OP stuff but I going through the dropdown menues is miserable.

stray kestrel
#

hey guys

-----------------------------------------
function: prerender -- file: ISEquippedItem.lua line # 127.
[01-04-22 22:17:59.287] LOG  : General     , 1648865879287> 339,177,717> -----------------------------------------
STACK TRACE
-----------------------------------------
function: prerender -- file: ISEquippedItem.lua line # 127.
[01-04-22 22:17:59.287] ERROR: General     , 1648865879287> 339,177,717> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in prerender at KahluaUtil.fail line:82..
[01-04-22 22:17:59.287] ERROR: General     , 1648865879287> 339,177,717> DebugLogStream.printException> Stack trace:.
[01-04-22 22:17:59.290] LOG  : General     , 1648865879290> 339,177,721> -----------------------------------------
STACK TRACE
-----------------------------------------
function: prerender -- file: ISEquippedItem.lua line # 127.
[01-04-22 22:17:59.312] LOG  : General     , 1648865879312> 339,177,743> -----------------------------------------
STACK TRACE
-----------------------------------------
function: prerender -- file: ISEquippedItem.lua line # 127.
[01-04-22 22:17:59.312] ERROR: General     , 1648865879312> 339,177,743> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in prerender at KahluaUtil.fail line:82..
[01-04-22 22:17:59.313] ERROR: General     , 1648865879313> 339,177,744> DebugLogStream.printException> Stack trace:.
[01-04-22 22:17:59.315] LOG  : General     , 1648865879315> 339,177,746> -----------------------------------------
STACK TRACE```
#

so i am getting a crap ton of these on my client of a server that my guys are trying to start up

#

what is it actually complaining about?

teal slate
#

what mods do you have

grim kiln
#

Are there any mods that allow more...I guess realistic...ways of maintaining weight? Like, by just keeping oneself fed through the day should be enough to keep one's weight stable, rather than gorging on 100 potatoes a day?

peak narwhal
#

theres a few advanced settings mod might be in some of those rather then that idk

peak narwhal
#

Does anyone know a mod to raise max height?

stray kestrel
#

i am already turning them off as i go to check lol

teal slate
#

whew

#

it's something messing with the UI it looks like

stray kestrel
#

ISEquippedItem.lua?

teal slate
#

The line in that file, yes.

#

Though.

#

Ugh. What PZ version are you on @stray kestrel

#

This file was changed recently

stray kestrel
#

41.68

teal slate
#
    if "Tutorial" == getCore():getGameMode() then
        self.movableBtn:setVisible(false);
        self.invBtn:setVisible(false);
        self.craftingBtn:setVisible(false);
        self.searchBtn:setVisible(false);
        self.healthBtn:setY(self.invBtn:getY());
    end
#

This shouldn't be running. I think one of your mods might be outdated and just replaces this file entirely?

#

With, presumably, an older version

#

local versionInfo = getGameVersionInfo() Makes me think this function was removed.

#

Yep.

#

It no longer exists.

stray kestrel
#

well i'm slowly running out of mods to turn off

#

so for the most part

#

what's happening is

teal slate
#

Are you sure you're on 41.68?

stray kestrel
#

yes

teal slate
#

Whatever mod causes this is badly-written.

stray kestrel
#

one of my server hoster isn't able to pay for his server anymore

teal slate
#

Replacing entire vanilla files is VERY bad.

stray kestrel
#

so another player is hosting for the crew

teal slate
#

and you're certain they're hosting on 41.68?

stray kestrel
#

yes

teal slate
#

and you're playing on 41.68?

stray kestrel
#

yes

teal slate
#

and you've double-checked both

stray kestrel
#

we pretty much picked out 180ish out of 240 mods that was running on the original server

teal slate
#

that's still quite a bit

stray kestrel
#

but for some reason the new server is just spewing a crap ton of errors

teal slate
#

maybe search in the mods folder for files named that

#

and figure out which mods have those files

stray kestrel
#

this is stupid if this works

#

cause the only one with it is disable admin ui

#

but that's the thing

teal slate
#

that is in fact it

stray kestrel
#

it was working on the previous server

#

yeah

teal slate
#

was the previous server on 41.68

slow graniteBOT
#
Kaileris#9999 has been warned

Reason: Bad word usage

teal slate
#

huh

stray kestrel
#

bcaShrug1 rtar is censored

teal slate
#

then don't say it :v

stray kestrel
#

but yeah that was it

teal slate
#

yeah

#

outdated mod, presumably

stray kestrel
#

glad to know how to quickly narrow down errors now

#

thanks jade

trail lotus
#

Can anyone create me a mod that bascially when you die all you do is respawn, (your stats saves, everything in your key ring would save) but you’d loose all your items.

#

It would have to be mp compatible, and obviously I’d pay need it as soon as possible

faint jewel
#

that exists already

#

@trail lotus feel free to send me a steam game lol.

trail lotus
#

Yooo.. wait can it save your keys? Though

#

Bro I’ll buy you a new game haha.

faint jewel
#

keys = items.

#

so sadly no.

trail lotus
#

Hmmmm this may work though

faint jewel
#

BUT if you find your zed. you cang et your keys back.

#

it's what i use.

trail lotus
#

Hmmm I like it it’ll work I think send me your steam thing on disc and What game you want lmao I gotchu cause I been needing that

faint jewel
trail lotus
#

Will it save your skills though? if so that’ll be nice.

faint jewel
#

it does and doesn't.

#

if you are level 8 and 500xp.

#

when you respawn you will be lvl 8 and 0xp.

trail lotus
#

Ohh ok lmao bet 😂

faint jewel
trail lotus
#

I’m at work now I’ll get back with you later

faint jewel
#

aight

drifting torrent
#

Is there any tutorials out there on making vehicle mods? So far i cannot find any

chrome egret
#

@faint jewel has done a bunch of vehicle modding, maybe he can point you in the right direction

chrome egret
#

I could use some help, perhaps @quasi geode you know what might be going wrong here. I'm trying to get my character to progressively walk to cells and search containers. I appear to be able to queue the walk and my search action (SearchRoomContainerAction) initially (from my ItemSearchPanel), but my intention is for each search to then queue the next walk + search if the item isn't found. It seems ISTimedActionQueue:add borks out, by attempting to call the begin function and erroring that the new instance of the action doesn't have one My expectation was that it would inherit begin due to deriving from ISBaseTimedAction

chrome egret
chrome egret
quasi geode
#

for the ISTimedActionQueue.add

#

thats why it triggers fine the first time in that top snippit at line 340 but fails after...the arguments get thrown out of whack

hallow turret
#

They got a zombie clean up script or mod?

thorn lion
#

Does anyone know how to add exercise fatigue to the legs?

chrome egret
woven wren
#

I'm horrible at managing change notes LMAO.

#

Made two change notes by accident

chrome egret
#

Core behavior achieved! Need to clean a few things up, then ItemSearcher will be released on the workshop 🙂

visual island
#

These are nearing completion.

vocal cargo
#

ooooh

#

very nice

odd notch
#

what's the way to run lua when a player uses an item

#

like after they use it to run a function

fallen mural
#

Someone needs to create a mod that zombies who have guns can shoot you. Like resident evil. I’m not sure if that’s even possible but would be scary

mild notch
#

would authentic Z work with AOM animations and zombie skin?

hallow turret
#

There a way to clean up zombie bodys with admin or script?

serene token
#

there a more affective way of transporting bodies? one by one is so tedious

teal slate
#

the things I have to do to get around radio code not making two simple calls to parseStringForChatLog and parseStringForChatBubble:
authorPlayer:addLineChatElement(luaParseStringForChatBubble(message:getText()), textColor:getRedFloat(), textColor:getGreenFloat(), textColor:getBlueFloat(), UIFont.Medium, chatRange, chatType, true, true, true, false, false, true)

#

this is just one single line

#

i had to manually reimplement the parsing as well

teal slate
teal slate
#

If errors were cash, I'd be a billionaire. Alas,

#

This is what happens when you mess around with metatable hacking too much.

#
oldGTWP = oldGTWP or __classmetatables[ChatMessage.class].__index.getTextWithPrefix
__classmetatables[ChatMessage.class].__index.getTextWithPrefix = function(self)
    local oldTWP = oldGTWP(self)
    local _, _, prefix, msg = oldTWP:find("(^.-:)(.+)$")
    print(oldTWP)
    print(prefix)
    print(msg)
    local msg = luaBubbleToLog(msg)
    local textColor = self:getTextColor() or Color.new(1, 1, 1)
    if textColor then
        msg = string.format("<RGB:%.2f,%.2f,%.2f>%s<RGB:1.0,1.0,1.0>", textColor:getRedFloat(),textColor:getGreenFloat(),textColor:getBlueFloat(), msg)
    end
    return prefix .. msg
end
hidden compass
#

In MP, to what extent is the following ModData shared?
Perhaps all players share the same data?

local modData = ModData.getOrCreate("xxxxxx")
unborn radish
#

Finally uploaded the first iteration of my car pack! Also my first mod

vocal cargo
#

pog

#

those are some litto vehiculars

unborn radish
#

by 80s american standards, they really are little!

teal slate
#

had to generate allowedChatIcons and allowedChatIconsFull by hand

#

well, a subset anyway

worldly notch
low yarrow
faint jewel
#

LOL @trail lotus ran off

chilly ferry
#

Can someone help with finding the compatibility problem of mods? When building walls on the server, there is a crash with spam errors.

trail lotus
# faint jewel LOL <@!304696446655922177> ran off

I just moved into my house yesterday so I haven’t even set my pc up, I promise if it gets added to my server I’ll make sure I get you that game. You can ask soulfilcher, coach, or browser8. I always pay haha or donate if I use a mod 🙂

late hound
#

The Funeral Zs are finally getting their bouquet of flowers I always intended for them.

autumn sandal
#

The world is healing ♥️

#

Looking good!

jolly tinsel
#

Anyone know any guides on how to make / port vehicles into the game ?

spark fulcrum
faint jewel
#

@hollow shadow you here? i got some freaking questions.

faint jewel
#

you made the scrap armor mod.

#

that's why.

hollow shadow
#

Oh no

faint jewel
#

why the hell can i not make my own scrap sheild that has the sheild options.. examine etc.

hollow shadow
#

The way I made the mod is very not good

faint jewel
#

really?

hollow shadow
#

I don’t recommend you learn from me

faint jewel
#

lol i get it. but it's what they want.

#

did you hard code them by name?

hollow shadow
faint jewel
#

the people man, the people.

hollow shadow
#

I stopped modding a few weeks ago since I don’t have that much free time anymore so I don’t remember

faint jewel
#

for real?

hollow shadow
faint jewel
#

they want a custom scrap sheild.

hollow shadow
#

What’s wrong with the original >~<?

faint jewel
#

le sigh. they want a CUSTOM TEXTURE on a scrap sheild.

serene token
faint jewel
#

making a new one, it does not load as a scrap sheild. it loads as just another item.

#

where are the bottom two configured at?

restive quest
#

Is there a program that's used for creating custom car mechanics overlays?

pearl prism
#

@faint jewel hey man, have you done animations on vehicles?

faint jewel
#

way too many lol.

#

just updated the mower with animations.

pearl prism
#

LOL

#

thats so cool

#

please

#

can u give some tips

faint jewel
#

animate them.

#

then export.

pearl prism
#

How do you export fbx???

faint jewel
#

LOLOL

#

from what program?

pearl prism
#

I am using blender

#

and have some paid addons

faint jewel
#

do you have the fbx import export plugin?

pearl prism
#

Yeaaah

faint jewel
#

ewww paid addons

pearl prism
#

yeah

#

"Better Fbx Importer & Exporter", what is the way

#

???

faint jewel
#

eww?

chrome egret
#

When you just have to find that summer wear item

faint jewel
unborn radish
#

le sad

#

i use them in all my worlds

smoky meadow
#

guys it is possible to damage the man made walls with guns, like in doors?

chrome egret
#

Does anyone know of a better way to get a friendly name for an object which has a container? Once I have the container, I can call container:getParent(), but the IsoObject returned appears to store nil/null for its name (at least that's what I receive from parent:getName())

#

As you can see in the above, I can grab the container type, but it's not friendly reading

inland crater
#

Is it possible to create a new piece of mod data for a specific player by just doing this

player:getModData()["poison"] = poisonDose
chrome egret
#

I think there's a setModData function you'd need to call

edgy sparrow
#

any weapon modder here can help me out? I saw some weapon has critchance and critdmgmultiplier stat and some weapon has only critchance. What does critchance do if the weapon doesnt have a critdmgmultiplier stat?

thorn cipher
#

So they don't put it in their inventory when it's found, right?

chrome egret
thorn cipher
#

Nice! Works perfect, just gave it a 👍 up!

chrome egret
#

Thank you very much!

thorn cipher
#

Makes sense especially if the item is too heavy, and the person left their character to search through a bunch of containers

pine jolt
#

How can i make a mod

#

and do models or edit some

undone crag
pine jolt
chrome egret
pine jolt
#

So i can give accuarate ones

#

Btw imma use the mod rn in a new play trough

chrome egret
#

Awesome!

#

I will get the strings compiled for you. I believe even for the English I should be using a file rather than hardcoding, so I need to get it done anyhow.

pine jolt
#

Sure

sonic helm
hollow shadow
#

I will continue when I get more time

unborn radish
#

:D

#

make the sword sheath work with backpacks I can't wait! :D

tranquil reef
#

Is there any document I can read to figure out how to give the player any effect?

#

I need to do things like add nausea and tiredness, also lowering health over time

viral spire
#

Is there a mod out there that allows you to base the activation of mods on the amount of days passed? Say I want Sunburn to activate on Day 3, Project Monolith to activate on Day 5, and Cryogenic Winter to activate on Day 15. Would that be possible, or would the game be unable to process that without returning to the main menu?

dense spade
quartz lark
#

is there any way to add the destroy option to any item other than sledgehammers?

viral spire
polar warren
#

Yo guys, is there any beginner guide for making mods around here?

#

I was looking forward to making a mod that'd let you sleep when offline a server, you think that'd be doable?

#

What I'm thinking is saving the time of your pc somewhere, and upon rejoining doing some math and giving you back sleep time

chrome egret
autumn stump
#

Hey guys. I'm trying to fix a bug in one of the mods I made. It has a GP5 gas mask (Sunrise Suit mod). Having issues with the beard been seen through the mask when it grows longer. Now I've been testing and apparently the same thing happens with the full balaclava. I believe it is a game thing but I'm not sure if there is any way to fix it.

I have used the HatCategory on the clothingItem of nohairnobeard, but it only hides the hair. I have also tried having two hat categories, nohair and nobeard, but the beard is always visible.

Any ways to fix this? Since the balaclava also has it, it feels like it is a game issue, but I am not sure.

chrome egret
#

Very cool!

thorn cipher
fallen pelican
#

i want man controlled mounted turrests

#

like there not automatic

#

you use them

#

but you cant move

robust bluff
#

I beg you someone, create a mod where you can eat a soap

#

i beg you

void oxide
#

can someone send the health bar mod for zeds? for some reason i cant seem to find it

chrome egret
celest crane
#

Wait, when making a fixing recipe, it has to follow a specific syntax?

#

fixing fix itemName{ requires:itemName?

#

I thought the fix itemName is just localized string

robust bluff
#

And it will cycle between diarrhea and explosive diarrhea (that's 100% random) if i could i'd code this but i don't have the skills

chrome egret
#

Whyever would anyone eat soap if it's nothing but negative? xD

robust bluff
#

Dude i literally drank bleach 4 times with my friend for pure fun XD

chrome egret
#

You got that chaos energy

fallen mural
#

Is there a mod that has a corpse vechicle that I can move large amounts of the undead to graves

wintry vortex
#

Already slapped it into mapping, but I'll risk the spam xD Anyone got some pointers for me? Placed all kinds of foraging zones, followed Dirkies guide, sitting ingame. My parking lot works fine, cars there and it counts as Road to forage. Anything else I've set (deep, forest, farmland etc.) do not - the famous 4 ? ingame 😦 Anyone run into that and can tell me what I've overlooked or messed up?

fallen mural
#

Guys how often does helicopters happen from expanded helicopter mods? It’s day 8 and not a single one has yet to spawn is that normal

late hound
#

Is there a way to prevent a clothing item (such as a jacket or pants) from spawning damaged on a zombie?

civic galleon
#

You would want to capture server time though, not the users time

polar warren
#

Ye, exactly what I was planning, server running 24/7 synced up with our timezone, and mandatory 8 hours sleep so that everyone doesn't stay on until too late xD

civic galleon
#

I like that idea, only thing is I doubt anyone would ever reach that point of playing that long time wise. They woukd instead have their characters fatigued

polar warren
#

I've seen that there are some "on join" and "on disconnect" event triggers to look into, I just gotta understand how to structure a mod...

civic galleon
#

So maybe setting a timer for how long a player must be logged off to reduce X fatigue

polar warren
#

Ye that's the plannnn

civic galleon
#

My brain cannot remember the other stat that you need to also chanve when playing with sleeping in PZ

polar warren
#

I'd have to have people get tired wayyyyyyy slower though x)

civic galleon
#

I admittedly have been very busy with IRL stuff and other projects, not even playing PZ too often 😭

polar warren
civic galleon
#

I believe fatigue and stamina should scale with day length, but I could be 100% wrong

#

Hold on let me look at my code so I can stop being a dingbat trying to go off memory

#

Fyi if you wanna look at what code I wrote for the mod Sleep With Friends here is the github

#

Yup fatigue and endurance.

#

So basically, you will need to figure out how to:
•Capture server time and save it as a variable (hopefully as a string of numbers that can have math easily applied to it)
•Calculate the sum of the difference between the log off and log on "server time" variables
•Determine how much Stamina and Endurance is recovered based on that sum
•Apply said recovered amount. For recovery of these stats, you actually reduce Fatigue from 1.0 down to 0.0, but raise Endurance from 0.0 to 1.0. (Also note: these stats do not recover at the same speed in vanilla PZ!)

polar warren
#

Yoo thanks for all this info!

#

I'll start working on it asap!

vernal island
tacit bobcat
#

anyone here who has experience with horde night mod and here they come ?

zenith smelt
#

Does anyoine know where I can find all the text inline commands like <line> and such?

zenith smelt
#

I hate discord and it suck that the normal forum is so slow

#

Why does this not wokr?

#

While on the modding wiki

#

How is mine different?

chrome egret
#

What are you trying to do with it?

#

I wouldn't try to wrap the table property names in quotes

#

If you're not getting enough feedback from your editor, I highly commend you try to run short code snippets like this in replit.com

quasi geode
# zenith smelt Why does this not wokr?

remove the " quotes as DecentTech suggests, or if you need to use them (in case your key name starts with a digit or contains spaces etc) then you need to wrap them in square brackets ["key"]

AOBJ.MyTable = {
  ["getWeight"] = 1,
  ["getEquippedWeight"] = 2,
}
zenith smelt
#

Ooh okay, thanks

#

I have another thing I've been seraching for but cannot find any thing for

MyClothingItem:setWeight(111); -- does not work
#

Why does setWeight not work?

#

The SEO for anything zomboid related sucks and I blame their slow forum 😡

#

Sometimes took me over 10 seconds to load a page

#

Anyway, isn't the entire point of Clothing being inherited from inventoryitem to use the same functions?

quasi geode
#

it will inherit the method, cant say whats going wrong "doesnt work" is entirely too vague to even guess.

chilly beacon
#

whats the bug report? "doesnt work"
what did you expect to happen? "for it to work"
what actually happened? "didnt work"

zenith smelt
#

It errors

chilly beacon
#

sounds like my clients 😛

#

... whats the error?

zenith smelt
#

That's all it says

chilly beacon
#

... can you not crop the error please

quasi geode
#

you'd need to show the whole callstack

#

but i can tell your issue now

#

you used . not :

chilly beacon
#

that is all it says, when you screenshot only one word out of the whole error, yes.

zenith smelt
#

ohh yes that's true my bad :DDD

#

But that doesn't change the fact that setWeight is the only command that does not work

#

When I run it like this

#

Everything except setWeight works

#

I was just doing .setWeight (meant to be :setWeight) as a test to see why is the command broken

#

How come setWeight does not execute from this?

#

All the other stats have changed, except the weight

#
    if (not instanceof(t_Item, "Clothing")) then
        print("Not clothing");
        return;
    end;
    t_Item:setWeight(6.9);

#

Still not functioning
😕

#

It's annoying me so much, sorry 😭

quasi geode
#

again though, need to see the actual stacktrace to actually debug the error

zenith smelt
#

this one does not error, it silently fails

tame mulch
#

no error, no stacktrace?

zenith smelt
#

Yes I can demonstrate

tame mulch
#

Try item:setActualWeight(6.9)

chilly beacon
#

If i wanted to tweak the item of another mod, in the form of an addon to that mod, do have to reimplement the entire item or can I somehow reference the original and only change what I need to?

zenith smelt
#

Ohh my god thanks

#

Yeah that was it. But how is anyone supposed to find out about this.

chilly beacon
#

example: a modded weapon is cool but its a bit overpowered, and i wanted to tone it down a bit

tame mulch
#

and maybe need use getActualWeight

chilly beacon
#

or a mod has a broken recipe and I'd like to fix it

zenith smelt
#

I really wish there was a wiki for all the commands like arma has so we could write comments for setWeight now so when anyoen else has the same problem they could find a solution faster

#

Thanks a lot, I have been pulling my hair out so hard

quasi geode
chilly beacon
#

ah awesome!

#

thanks 😄

#

that makes life a lot easier

#

does that same system work to add in a different texture or model for example?

quasi geode
#

should, cant say i've tested though.

chilly beacon
#

fair enough

quasi geode
#

just make sure to put it in the shared folder (not client)

chilly beacon
#

perfect, thanks

polar warren
#

I've started coding on the offline sleeping mod, so far so good, your code has helped me a lot, I'll keep you updated

civic galleon
#

Im gunna blush 😊 haha! Im glad I and my mod could help! Very excited if you make it happen, cause I think many people would love to never load into a server needing to sleep already again

faint jewel
polar warren
#

but juuuust if you don't got anything better to do!

floral nexus
#

Question: I'm trying to add a container to the game. It's more complicated than just that, but I can't even figure how to make something like Crate. What files handle world containers? And where is the build menu for things like Crates?

thank you in advanced.

pearl prism
floral nexus
#

Really? I'm trying to add a totally new container.

#

I mean, I'll go ask, thank you. I'm just double checking

craggy furnace
#

you see ivan, if you have have your hatches float on your right

#

you will not be distracted from the things on your right and will always make perfect left turns

civic galleon
polar warren
#

oo okii, no problem!! xP

trail lotus
#

anyone know how to change the loadup screen? like where it says this is where you died. can that be changed to a custom image. if so and you know how maybe i could pay someone to create a simple mod that does it? for me and you could set this image as it

quasi geode
random orbit
#

So is there a mod for using a gun to suicide with?

#

Just started playing on blood+saliva and been getting wrecked.

tranquil reef
#

How can I decrease weight over time using an if statement

chrome egret
#

Which part are you struggling with? Decreasing weight, making something happen over time, or doing so conditionally?

tranquil reef
#

Isn't there a built in method for doing something once every 10 minutes? or was that exclusively made by multiple modders

chrome egret
#

There's an event for that

tranquil reef
#

Yeah okay, that's what I thought, but I'm not still sure how to decrease the weight by a degree every time though

chrome egret
#

Usually you want to look at existing code which does something you want and see how that is accomplished.

#

Either vanilla functionality, or if you know of a mod that does what you want.

#

Are we talking item/equipment weight, character weight?

tranquil reef
#

I've been doing that, but I haven't found anything in relation to getting and decreasing the weight value

#

Character weight

#

Also is there an easier way to search through vanilla game code? At one point I spent like 30 minutes putting every lua file from the game into one visual studio project, so I could use Ctrl+F lol

chrome egret
#

I just open the media directory in VS Code

#

it's usually fast enough although the text files can slow things down

tranquil reef
#
local function onPlayerUpdate(self.character)
    FunnyEffects();
end```
#

would this be right when using onPlayerUpdate

#

there's an error around here and I'm not sure what it is, but I might have tried to call the FunnyEffects function weirdly

#

too used to C# lol

#

Parasites.lua:28: ')' expected near '.' is the error

quasi geode
#

self.character thats your error. cant use a table.key as a argument name

#

just use character or something

tranquil reef
#

will it know what I'm referring to lol?

quasi geode
#

eh your defining a function + arguments.
character will become a local variable in the scope of that function

tranquil reef
drifting ore
#

I try to play a sound but nothing append, someone did it ?
I don't get an error but I hear nothing.
I tried that in lua : getPlayer():playSound("PagerSound") and getPlayer():getEmitter():playSound("PagerSound")
And my script look like that:

module Base {

  imports
    {
        Base
    }

  sound PagerSound {
    category = Pager,
    loop = false,
        is3D = true,
    clip {
      file = sound/BeepSound.ogg,
            distanceMax = 20,
    }
  }
}
#

Also I try to add a 3d model for an item, I made it work one month ago but forgot.
With that script, when I add the item on the ground, it's his icon but not his model
This is my script:

module PagerMod
{
    imports
    {
        Base
    }

    item Pager
    {
        Type = Normal,
        Weight = 0.1,
        DisplayName = Pager,
        DisplayCategory = Item,
        Icon = Pager,
        Tooltip = Tooltip_Pager,
    WorldStaticModel = PagerGround,
    }
}

module Base
{
    imports
    {
        Base
    }

    model PagerGround
    {
        mesh = WorldItems/Pager,
        texture = WorldItems/PagerTexture,
        scale = 0.0003,
    }
}
tranquil reef
#
function OnEat_FunnyWorm(food, character, percent)
    local chance = ZombRand(0,100);

    if chance > 50 then
        print("GOT FUNNY WORM VIRUS HAHA FREAKING IDIOT!");
        character:getTraits():add("funnywormInfection");
    end
end
#

This all works, except for the adding of the funnywormInfection trait lol

#

The print message is listed randomly, so I know the randomizer & the print screen both work fine, however, it just doesn't add the trait

fleet snow
#

Incredible

inland crater
#

The EveryOneMinute event is called every 27 seconds right?

#

or is EveryTenMinute event not called every 1 out of game minute?

#

that means if I wanted something to affect the player every second I'd have to compensate for those 27 seconds

#

or am I out of wack

inland crater
#

-snip- mixed up some of the math i was doing

stone owl
#

hi if i want to change distribution values do i need to do a world wipe or will it spawn as valued after next loot respawn?

burnt pebble
#

is making your own music pack for TrueMusic easy if you're like basically only starting coding let alone lua

zenith smelt
#

Does anyone know how these stats, such as getBiteDefense are evaluated for combat?

#

Does damage evaluation still get the values correctly as long as it displays like that on my client?

queen leaf
#

Hello all! I heard this was the place to discuss mod ideas and requests. Any best way to go about it?

drifting ore
vernal island
#

Is there any documentation on the order of Lua event calls and what events are called by whom (server, client or both)?

frosty falcon
gilded hawk
#

Can anyone provide me with a blank-non solid clothing item source please? something like the belt or keychain

chrome egret
random orbit
#

So anyone here playing with this mod.

#

Question I have on it is if it is red outside is it doom town? Haven't figured out exactly what it does but from hints I have gotten the raid burns you to death.

shut valley
random orbit
#

I went out in it fir a split second and only did a little damage.

shut valley
#

rather than a big storm of radiation/magic that goes through the map and if you get caught at that point you die

random orbit
#

So works as I hoped. Some comments made me believe as soon as one drop of the rain touched you you dropped dead.

paper steeple
#

It would ruin the point of the game if it did that. Almost all zombies are outside after a while (as noises get them out and about), so one storm could effectively clear the map, and all you'd have to do is hide at the right time.

shut valley
tawdry moss
#

How complex is it to have a recipe give you multiple results for the same thing? I know how to make a recipe that gives different quantities of one thing, but if I want a recipe to give 2 different objects how would I do that?

vocal fox
#

can someone make a mod that lets you sleep all night in mp

stray kestrel
#

i got a modding question

#

so i made a recipe that has multiple valid material as one of the ingredient

#

for example banana or apples are valid

#

so the problem i am having is

#

when i am bulk crafting this recipe

#

it would take all the apples in my inventory first, and then bananas

#

even though bananas are in the main inventory and apples are in a bag

#

it would still move the apples to my main inventory

#

so i'd like to know if it's possible to make it only take from main inventory

#

or make it take from the stack that was right clicked to craft with instead of going from 1 banana to all apples

craggy furnace
#

dumbo BRDM

late hound
drifting ore
#

if i were to edit the files of a mod and then try to use the edited files on a server i host, how would i go about that? I am using Brita's weapon pack if that helps. i want to reduce the spawns of the weapons from the mod.

drifting ore
lusty ingot
#

What does error code 6 mean?

fiery pecan
#

howdy fellas. I uhhh, I've got a longstanding issue with a feature in my mod. It's an issue I've still yet to find a fix for...
So in essence, I want to dynamically replace specific cars and zombies within an XYZ range, say A police car and a police zombie in Rosewood, with a respective version from my mod. It works perfectly fine in singleplayer, right? Well, on Multiplayer it refuses to save the change. But only once. In a nutshell the car will replace twice, then be fine. Though the second time occurs when it's unloaded.
Help with this would be greatly appreciated.

Code snippets:
lua/server folder:

function stzo_stevvpl_override()
    -- Coord Stuff
    -- Rosewood
    local GetRWXMin = 7865;
    local GetRWXMax = 9350;
    local GetRWYMin = 11250;
    local GetRWYMax = 13500;

    local GetVehicleScript = GetVehicles:get(i):getScriptName();
    local GetVehicles = getWorld():getCell():getVehicles();

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

            -- RosewoodSD
            if GetVehicleX >= GetRWXMin and GetVehicleX <= GetRWXMax and GetVehicleY >= GetRWYMin and GetVehicleY <= GetRWYMax then
                if GetVehicleScript == "Base.CarLightsPolice" or GetVehicleScript == "Base.PickUpVanLightsPolice" or GetVehicleScript == "Base.85vicsheriff" or GetVehicleScript == "Base.87capricePD" or GetVehicleScript == "Base.91blazerpd" or GetVehicleScript == "Base.92crownvicPD" then
                    GetVehicle:setScriptName("Base.CarLightsPolice_rosewoodpolice");
                    GetVehicle:scriptReloaded();
                    GetVehicle:updatePartStats();
                end

stray kestrel
#

amazing

#

modding a recipe to give half a drainable item doesn't work

stray kestrel
fiery pecan
#

That's the mod in question

#

I'm the coauthor of SmallTownResponders. Lol

#

Here's a snippet from my above post. The part that's giving me trouble
It works perfectly fine in singleplayer, right? Well, on Multiplayer it refuses to save the change. But only once. In a nutshell the car will replace twice, then be fine. Though the second time occurs when it's unloaded.

quasi geode
queen leaf
#

Nice! I had a couple of mods that I’d love to have to compliment my particular play style, if they sound interesting to anyone here.

fiery pecan
queen leaf
#

One would to build spawn-points in game. I enjoy starting out in the towns but I never like having to trek out to the base I built after I move towns. I think a great compromise would be to construct something like a diegetic radio tower that would “broadcast coordinates for other survivors” with high Electric/Metalworking skill and like a ham radio or something. That way, the new character could respawn within like 50 units of distance from the radio tower or something. (And if spawn points must be predetermined to work, then maybe one could scatter radio towers in other popular towns that would need to be “reactivated” or something)

#

The other idea I had would be to create your own radio station using the CDs you find scattered in the world. You no longer need to carry a CD player to lower your boredom, just swap to your personal channel. Would also give a reason to search for a new supply of CDs, to increase the effectiveness

#

(Finally, just a personal request— if someone could somehow do a quick fix to the “Buy Skyrim” mod so that the Todd Howard mask can be worn with helmets as well, that’d just be awesome. Thanks!)

fiery pecan
#

oh!

#

DERP

queen leaf
#

Change the code so that the Todd Howard mask only occupies the “mask/Glasses” slot, basically (I can’t code a lick but I imagine that’s what it involves)

fiery pecan
#

yeah, I'd say I could do that for ya

queen leaf
#

As is, it’s like the Welder’s mask

fiery pecan
#

but it won't go on the workshop

#

I'll just DM you a zip with the files

queen leaf
#

Understandable, it is someone else’s mod

fiery pecan
#

for the zomboid/mods folder

queen leaf
#

Thanks! The mod author promised to update it but I haven’t heard a peep from him for a few months

fiery pecan
#

ah

stray kestrel
#

well i finally got my personal mod working

fiery pecan
#

noice!

stray kestrel
#

gunfighter's ammo crafting is too hard, especially on top of the fact you can't make primers brass and projectiles

#

and kitsune's ammo crafting is too easy, missing a few recipes, and exchange rate is unbalanced

fiery pecan
#

less go. Will this work? @queen leaf

queen leaf
fiery pecan
#

DM me

#

my DMs are open

craggy furnace
# fiery pecan less go. Will this work? <@233768557371064330>

You're watching the official music video for Fleetwood Mac - "Little Lies" from the 1987 album "Tango In The Night". The new Fleetwood Mac collection '50 Years – Don’t Stop' is available now. Get your copy here https://lnk.to/FM50 and check out North American tour dates below to see if the band is coming to a town near you.

Subscribe to the cha...

▶ Play video
#

i forgot that mod existed

#

amazing

tranquil reef
#
local function EveryTenMinutes(character) --error in this, fix tomorrow
    GainThing(character);
end

Events.EveryTenMinutes.Add(EveryTenMinutes);```
#

why does this have an error at the "GainThing(character);" part lol

#
function GainThing(character)
    local clothing = nil
    local bodyLocations = {"Shoes", "Socks"}

    for i = 1, #bodyLocations do
        clothing = character:getWornItem(bodyLocations[i]) --if player has clothing on one of the     bodyLocations categories
        if (clothing ~= nil) then
            break
        end
    end

    if clothing == nil then --if you're not wearing shoes or socks
        local chance = ZombRand(0,100);

        if chance < 50 then --5% chance every 10 minutes
            character:getTraits():add("traitNameOne");
            print("This worked haha")
        end
    end
end
#

It worked when I had it in onPlayerUpdate so I think it's an issue with EveryTenMinutes, but why

quasi geode
#

EveryTenMinutes event doesnt pass any arguments (ie: character will always be nil)

tranquil reef
#

What can I do as an alternative then

quasi geode
#

if your running it client side use getPlayer()

#

if its serverside, then you'd have to parse the list of active players and trigger for each one

tranquil reef
#

One other issue I'm having is "character:getTraits():add("traitNameOne");" does nothing, no error, just doesn't give the trait lol, is there a reason for this? "character:getTraits():remove("traitNameOne");" works perfectly fine though

fiery pecan
#

also how on earth does one parse the list of active players?

quasi geode
tranquil reef
quasi geode
fiery pecan
#

I see

#

so, in a nutshell. getWorld = more lag?

#

also. I'm pretty new to lua in general. Literally started around last summer.

#

what does "loop through the array list" look like?

#

oh, and a quick search through this channel shows everyone using getSpecificPlayer(0)

quasi geode
#
local players = getOnlinePlayers()
for i=0, players:size()-1 do
    local player = players:get(i)
    --- do something
end
fiery pecan
#

I see

quasi geode
#

ya that works too if you know the player index already

fiery pecan
#

ahhh

#

thanks for clarifying!

quasi geode
#

sry had to edit that example. only half here atm lol

fiery pecan
#

it's fine

#

oh, btw

#

is "i" just an example thing? Like, am I able to change it to "p"?

quasi geode
#

sure

fiery pecan
#

awesome

quasi geode
#

i is just a common used variable in for loops (often short for index)

fiery pecan
#

I see

storm finch
#

Having some trouble with the game crashing and wondering if anyone can help. We were playing on Cherbourg and got annoyed with the map so switched back to normal map. We are playing with mods but only thing we changed was removed Cherbourg and added Raven creak now the game is crashing no matter what I do. I checked the log and it's giving me an error saying it can't find recipe for rotten canned food.

fiery pecan
#

any other mods?

storm finch
#

Playing with 90 mods it ran fine before but now it's not

#

Only thing we changed was the map mod

fiery pecan
#

I see

storm finch
#

Sorry it's not crashing it's saying connection to server was lost

#

heres one of the lines
LuaManager.getFunctionObject> no such function "RottenCannedFood".

#

I tried removing the mods that do stuff with food and it hasn't helped

drifting ore
#

Anyone have a mod that makes sound from lua? That I can take as an example

stray kestrel
#

anyone have any idea about my modding question earlier?

#

or am i going to have to make a recipe to use each individual fruit

#

so that it doesn't just use up whatever is lined up first in the code?

proud spruce
#

Quick question for in case anyone knows: There's no way to split ItemName strings across multiple files, is there? Since it basically just looks for "ItemName_EN.txt" and doesn't load from anything else?

chrome egret
#

Now that I've placed my mod in its Workshop folder, singleplayer only seems to load that version of my mod code. Is the only way to circumvent this removing the Workshop folder or updating that location while testing locally?

drifting ore
zenith smelt
#

nosteam allows using the mods in the <user>\Zomboid\mods folder

chrome egret
#

I see

#

So does the Steam version, but the Workshop mod versions seem to take priority

#

Appreciate the tip!

zenith smelt
#

Ahh. I mostly play on the nosteam version, didn't even know that's a thing 😄

chrome egret
#

Interesting. I assumed nosteam is the minority, could be wrong on that.

zenith smelt
#

Probably 😄 I just use it because I can make copies of the mods and then I don't ahve to worry about mod updates on my playthrough

quasi geode
#

its mostly a minority except with GoG users and people with pirated copies, but its handy for testing and playing without dealing with mods auto-updating (good for servers sometimes)

#

i do the same, play on nosteam always so nothing updates during my playthroughs

celest crane
#

How do I decide how much a fixing recipe would repair?

chrome egret
#

Passing fancy?

celest crane
#

what?

#

I have the recipe up and running but IDK how to make that recipe specifically repair a certain amount

chrome egret
#

I just mean it's your system, you would be choosing whether it's a minimally or fully effective repair

#

ah I see

celest crane
#

I've seen multiple car repair mods repairing different amounts even with the exact same materials used

chrome egret
#

Have you tracked down a client command where the work is truly being done? For example with engine repair:

#

Those args gotta go somewhere and be interpreted

sleek saffron
#

Hey guys, this might be a dumb question, but I can't think of a mod that already does this. Is there a way to check for a loaded map mod? For example: if (IsRavenCreekLoaded) then end

Or is this not possible to begin with?

quasi geode
#

getActivatedMods():contains("SomeModID")

sleek saffron
#

Aha that should do the trick. Thanks.

celest crane
floral nexus
#

Hey, I know where Zomboid keeps the chat log of all your multiplayer sessions, but any kind of radio (text) communications I can't find a log for. Does anyone know where the game puts that?

zenith smelt
floral nexus
#

did, that has the standard chat logs, but i annot find the stuff that another player would /say that would make it to me over radio

zenith smelt
#

ooh, then I cannot help

floral nexus
#

DAmn, thanks mate

fair frost
dusk saddle
#

Hey Zomboid moddin' folk, I was wondering what ways are best for making items more rare regarding distribution.
In my mod (Pomp's Items), it adds in a bunch of different stuff, mostly food and plushies. The issue I've encountered is that the pony plushies still seem to spawn extremely often, even after setting the amount to numbers real low such as "0.005." I'm assuming that because there are 50+ that would be the reasoning, but even so it still seems way too common.
Posting a pic of the distribution layout, each item has the distribution stuff listed out for it, I'm not sure if this is a proper way or is causing issues. I wouldn't imagine it to be so, but do let me know if it would be causing issues!

tawdry moss
#

Is there a way to make a recipe that requires certain temperature ingredients? Like needing frozen fruit specifically or hot water?

tranquil reef
#

If I want to make something happen if you eat any type of raw food, do I need to make a list and actually specify every item that's raw in the game, or is there another way?

tranquil reef
#

getPlayer():getTraits():add("traitName"); this doesn't work for some reason, no error or anything but it actually just doesn't add the trait, I've tried looking into it but I have no clue why lol. Other mods use this line and it seems like it works

dawn lintel
#

anyone know if theres a mod that brings the 0.2.0f music into the game? itching for some nostalgia

chrome egret
#

Also I have some demo screenshots now

tepid hearth
#

that looks sick

austere pecan
weary crypt
#

Hans get ze Tiger

#

What's the technical feasibility of making rechargeable normal batteries for flashlights and other devices?

chrome egret
swift seal
thick narwhal
#

lul 2km more like 500m

#

now that we know its possible to make turrets, cant wait for era appropriate AFV's

faint jewel
#

jesus they need to animate that turret

thick narwhal
faint jewel
#

reefer is done.

#

just dont wanna release it.

#

also working on another trailer.

#

but you aint allowed to see it!

chrome egret
#

You tease

thick narwhal
thick narwhal
faint jewel
#

all of it.

thick narwhal
#

good.

marsh cosmos
#

Hi, I would like to get into modding PZ but don't know where to start for a lot of the tutorials related to this seem quite old.
Is there a reliable and up-to-date source where I can learn to do it?
I know how to code but at an amateur level and have not modded anything yet.
Thanks in advance.

undone crag
#

You are welcome in advance.

marsh cosmos
#

Thx

faint jewel
craggy furnace
faint jewel
#

huh?

craggy furnace
#

that shit is just a pain to get working

#

specifically just getting it working right

faint jewel
#

what shit?

#

i am so lost.

craggy furnace
#

have fun down tight streets lmao

faint jewel
#

it works just fine lol.

craggy furnace
#

got a video?

faint jewel
#

the onyl thing i MIGHT want to do is have levels of logs, and make it so it ONLY holds logs.

craggy furnace
#

is it just those wheels and the physics boxes at the front?

#

size and trailers ends up being annoying for me

faint jewel
#

i'm just making some trailers for the ata truck mod.

craggy furnace
#

nice, i look forward to using them block stuff

#

too bad those bounders prevent just cutting the lines

faint jewel
#

if only this game had REAL physics.

craggy furnace
#

maybe some day 🥲

#

atleast ill get to play with ragdoll physics later

dreamy ermine
#

having some trouble getting an inventory icon to show. making sure that it isn't anything in the code that might be mussing it up somewhere.

craggy furnace
#

is it Item_HomemadeWine ?

dreamy ermine
#

Item_HomemadeWine

#

best i could find was the file itself needed the _items suffix as well

#

the above s/s file i mean. its 32-bit and everything. seems like its something really stupid somewhere that's not having it show

craggy furnace
#

zip me your mod

#

ill fix it

paper steeple
#

Anyone know how or difficult it is to make a vehicle mod?

craggy furnace
#

if you wanna make a simple car its going do be easy

#

if you want to make a high fidelity vehicle with animations thats going to be more of a process

paper steeple
#

Ah,I remember seeing that thread and did search for it a bit ago, but couldn't find it. Thanks for the link!

craggy furnace
#

👍

paper steeple
#

I only want to do simple vehicles. No special animations or interiors, to fit better with vanilla. Animated vehicles with interiors are nice, but that feel oddly out of place when vanilla vehicles don't have that.

craggy furnace
#

for now, thats true

#

the vanilla cars have limited support for it so its only a matter of time

radiant ginkgo
#

This is not right tutorial

shut valley
thorn cipher
#

Does anybody have a 'container distributions' list? Thanks!

craggy furnace
#

nice to know now

shut valley
#

ringo's guide still has some important info like the actual color numbers for each part of the damage mask

craggy furnace
#

ive only conferred with that specifically for the hex codes

undone crag
# marsh cosmos Hi, I would like to get into modding PZ but don't know where to start for a lot ...

There's the project zomboid modding wiki page that has links, like the github thing that says things about the specifics of Lua as a coding language. There are also the different classes and their functions https://zomboid-javadoc.com/41.65/. You would also need to look at the base game files to see how the game works. If you are looking for a specific thing you can use media\lua\shared\translate, and notepad++'s function to search all files in a hierarchy.

marsh cosmos
#

Thank you @undone crag

short shell
#

so i've installed a bunch of mods this morning and I'm trying to figure out what mod is causing this to show on the top right. Any ideas?

pearl prism
teal slate
short shell
shadow bough
#

Anyone working on a mod to invite player to your safe house, even if the already have one?

azure rivet
#

Hello, I forgot the location of the clothes generation file in the zomboid folder, does anyone remember me?

trail lotus
#

any way to disable the ability to destroy doors, or does anyone have a mod for it.

next root
#

jetstream sam mod when? 👀

dusk saddle
#

Gonna' go ahead and post again here real quick, been trying to get items in my mod to spawn much more rarely. Even with fairly low chances they still seem to pop up a little too much. Would there be any reason why? I can supply a pic 'er whatnot of the distribution stuff if need be

hybrid marlin
#

Hey, I know this is quite late but was searching back for stuff and accidentally went to my message and yours was right under it, then I checked further and saw you got no replies to this AFAIK

When I fixed a tourettes syndrome mod for our server (porting it to MP) I have this bit involved for saying the phrases:

if isClient() then
    processShoutMessage(phrase)
elseif not isClient() and not isServer() then
    player:Say(phrase)
end

With the processShoutMessage coming from ISChat.lua (in lua\client), from line 506 at if not commandProcessed then onwards where I noticed how the chat UI is handling sending messages, not sure if there's a better way but this works just fine for us with no downsides as far as I noticed - I'm using the one for shout but the other channels are right there too in that section

drifting ore
#

LADS

#

I have a proposition

#

I mean my warhammer 40,000 LADS

#

WE REPLACE the zombies with skinflayers/necrons

#

and we add in the dawn of war model bits for armor pieces

#

THEN we make custom sprites and vehicle models for 40k junk

#

Low programming effort necessary, just figuring out the modding tools tonight and this is probably what I want to do as a bigger project

#

but I think I should like chop this into small pieces first rather than a large conversion scale thing

#

I'm going to mess around quite a bit this month and see what is possible with mods and figure out what scale this idea could be in

#

alot of vehicles fly in 40k but it's so doable lmfao -- going to get to checking this out more tomorrow

#

not a bad idea

drifting ore
# drifting ore not a bad idea

A custom map and scenario could be possible with this. Basically a Tau crashes on earth -- but it's after entering a worp storm, so it's not exactly the same earth, the Tau time traveled and all of their crew is dead. Or it's like, a defecting gue'vesa flew through and time traveled back and crashed

#

That could squeeze into zomboid's world easily lmao. And not to mention most of it is just cosmetic junk, so the game updating likely won't break anything

#

when i think of that, it reminds me of a diorama this dude is making with a tau manta

drifting ore
#

Squidmar?

#

Yup

#

yep

#

I was just looking through my 8th edition codex and was thinking "damn necrons are fucking horrifying to the Tau" and happened to be playing Zomboid at the time.

#

It sort of works out because I can legit just make a set of cosmetic mods people can download separately if that's what they want.

#

true

#

Another idea is a custom starter class that spawns you with the Tau Gue'vesa armor and other junk could just be something to be found.

#

Idk something to chew on tbh. I'm totally going to figure out making custom Tau tiles though jc. A total conversion scenario could be doable but like again, time is a major nemesis lmao

#

indeed

#

Idk I'm messing around tomorrow with some custom clothing junk and seeing how it functions to kick the project off. First step is likely getting T'au armor going.

#

Oh no I'm a plunger

wet dune
#

I atleast wanna know what the death korps of krieg is

vocal fox
#

Mod that makes it so you can claim safe houses at spawn zones

chrome egret
#

Does anyone have any pointers on creating a new server option for a mod?

chrome egret
vocal fox
#

That would be fine it’s just a cool construction site that I wanted to base in

#

Also suggestion on how this could work it could be a spawn zone and then when you claim it as a safe house it removes it as a spawn point making to do you don’t need to have a specific mod for each spawn

quasi geode
# chrome egret Does anyone have any pointers on creating a new server option for a mod?

possibly, depends on what your trying to do. I have a module for it you can browse through, based on some old stuff i did but its entirely untested since the refactor and rewrite... its also completely overkill. https://github.com/FWolfe/Zmulib/blob/master/media/lua/shared/Zmu/Config.lua

GitHub

Zomboid Mod Utilities Library. Contribute to FWolfe/Zmulib development by creating an account on GitHub.

#

theres some components in the client and shared folder too for handling syncing

#

(note its also semi-incomplete, no GUI aspects)

chrome egret
#

I've had a feature request to limit Item Searcher capabilities-- a server option which would allow searching to be restricted to safehouses

#

I was hoping for a life cycle of creating the custom server option, initializing it with a default, updating it.

quasi geode
#

atm its more geared towards dedicated servers since it loads and saves its options via .ini settings instead of using GUI elements, but thats on my todo list (i still have to rewrite that part of the code)

#

it does the ini parsing, data validation (to protect vs bad ini values), and syncing the options to clients, would be easy enough to have it resync on value changing (i should actually add that) since it triggers a custom event on changes

#

i wouldnt really recommend using it atm since its unfinished & untested still might beable to pull some helpful stuff from it

chrome egret
#

Alright, thanks! Will take a look.

drifting stump
#

Sandbox options can be used for that

quasi geode
#

ya that could work for your use case too lol

drifting ore
#

Worst case you can pickup dawn of war 1

wet dune
#

what

trail lotus
#

any modders who can remove the ability to create a new character after dying. (simply only allowing respawn) and making it where when they respawn they only have their clothes they were wearing, their skills, and the keys they had on their key ring? it will be used on a custom server. willing to pay a solid amount of money for it just name your price.

drifting ore
# wet dune wait I thought it was a video game

It's a tabletop miniature wargame lol. You build models for the units, paint them and jazz it up and then play games against other people's armies. Orks, Tau, Necrons, Tyranids, Gene stealer cult, Space marines, there's alot of factions lol. Doing a total conversion scenario can be hard to do and make sense, however just doing Tau or space marine stuff couldn't be hard to mod in.

blazing radish
#

hi, anyone knows if it's possible to check with OnTest if a certain recipe is known to do the "pass" test to show another one? for example, I want to show recipe A only if recipe B is unknown

#

I know how to check if a recipe is known or unknown, but it doesn't work with OnTest for some reason

placid hinge
#

Hey any native Chinese speakers wanna help me with a few translations for I don't butcher this stuff through google?

trail lotus
#

is there a way to make keys like a virtual item for server use, that way when a player dies others cant pick their key up and use it to access the deceased players safehouse.

drifting ore
#

Is there a mod which overhauls the soundtrack of the game cant seem to find any

trail lotus
shadow bough
trail lotus
#

Yeah I just need to find a modder to commission something like that haha

drifting ore
weary crypt
#

If an article of clothing is set to not have holes and also has 100 protection am I correct to assume it makes that body part unable to be damaged?

zealous wing
#

Does anyone know how to add custom items as bait/lures for fishing? I wanted to be able to give players the ability to use a trash item from one of my mods as fish bait/lure, but I can't get the game to recognize it. I tried adding it using the same method asm in fishing_properties.lua, via tables for each fish, but that isn't working. Any advice?

blazing radish
#

hi, anyone knows if it's possible to check with OnTest if a certain recipe is known to do the "pass" test to show another one? for example, I want to show recipe A only if recipe B is unknown

I know how to check if a recipe is known or unknown, but it doesn't work with OnTest for some reason

quasi geode
blazing radish
#

thank you very much mate

quasi geode
#

ya OnCreate passes the player arg, but OnTest doesnt

willow estuary
#

There's also OnCanPerform which is basically OnTest but is passed the player object 🤪

function Recipe.OnCanPerform.GetMuffin(recipe, playerObj, item)
    return item and item:isCooked();
end
blazing radish
#

so, it should be something like

  local p = getPlayer();
  local r = p.getKnownReipes();
  if not r:contains("Recipe B") then
    return true
  end
end```
#

I saw oncanperform and Ithought it wouldn't work lmao

#

thanks to both of you ❤️

quasi geode
blazing radish
#

and I need to pass the true if recipe B is unknown

quasi geode
#

ya, sorry you'd want to negate that

blazing radish
#

not works there too?

willow estuary
#
function recipeA(sourceItem, result)
   return not getPlayer():getKnownRecipes():contains("Recipe B")
end
blazing radish
#

fantastic

#

thanks again

#

so many days wondering what the hell I was doing wrong x.x

blazing radish
#

well, after testing that function doesn't work, sadly, it keeps showing the Recipe A even if Recipe B is known :/

#

I'll keep trying, at least the game doesn't send errors now

willow estuary
#

Oh, OnTest/OnCanPerform only determines whether a recipe can be performed, not whether it's displayed.

You can use the IsHidden parameter to "hide" a recipe from the crafting interface, so it only shows up on right-click, like so

    recipe Open Package
    {
        pa_CokeBrick2,
        Time:25,
        Result:pa_CokeBrick2,
        RemoveResultItem: true,
        OnCreate:Recipe.PA_CokeBrick_OnCreate,
        Prop2:Source=1,    
        IsHidden:true,
        Sound:MapOpen,
    }
blazing radish
#

they basically do the same but the title of the recipe A plus the tooltip doesn't make sense after one use

#

IsHidden is such a blessing tho, a lot of utility recipes aren't bloating the craft window now thanks to that

#

it would be possible to remove that recipeA?

#

I know you can add them with :add

willow estuary
#

You should be able dynamically modify recipe scripts themselves as such

recipe:setNeedToBeLearn(true) -- will make a recipe dissappear if the player doesn't "know" it
recipe:setNeedToBeLearn(false) -- will remove the need to know a recipe for it to be visible
recipe:setIsHidden(true) -- makes a recipe IsHidden
recipe:setIsHidden(false) -- makes a recipe not IsHidden

But I've never fucked around with doing any of that, and implementing what's you're proposing would entail an fancy little ballet of coding to implement.

blazing radish
#

that's unvaluable info mate

#

thank you so much

#

gonna save that

shadow geyser
#

Is there a way to make the game load in/generate cells in the distance? I've been trying to make a mod that would kindof work like a library system. So like from one library in game, you would be able to check what books are available in another library like the mall. So far I just have a table defining the library locations so I can check the shelves, but it wont work for cells that haven't been generated yet by a player going there, which kind of defeats the purpose.

willow estuary
#

Aside from some stuff like abstract handling of stuff like off-screen zombie movement and such, Cells just straight up don't "exist" without a player being present in them, and I don't believe there is any way to instance Cells without a player being present in them.

shadow geyser
#

hmm. I wonder if it is possible to create a fake player that would teleport there

#

would it maybe be possible to create an Isoplayer object and move it there? Not really sure how the loading of cells works

willow estuary
#

I'd be surprised if it was possible/feasible, but hey, who knows?

shadow geyser
#

yeah I just took a look online at the java docs and I can see there is a load function for the isocells. maybe I can try to see what happens with that

#

I guess worst case I could also just teleport the player there and gather whatever info I need when it is loaded, then teleport them back. Seems like a really bad solution though XD

willow estuary
#

Teleportation is problematic in MP FYI.

#

It really puts the server through the wringer.

shadow geyser
#

hmm ok good to know

chrome egret
chrome egret
chrome egret
#

Ok, I see sort of initial creation here, and accessing that values through the client. I don't see any events that imply being able to catch when the values change, so is the expectation more like checking the value each time my code runs on the client?

#

And can I simply set the values directly when an admin takes the appropriate action?

trail lotus
#

this mod works perfect, how ever it when you save your character it respawns you at the location that you saved the character at.. how do i fix this? i want to keep the options just make it where it doesnt save the respawn location

viral spire
#

So how would a Scorching Summer (Opposite of Cryogenic Winter) mod work? CW utilizes the cold mechanic and forces you to find shelter and warm up or risk freezing to death, but I imagine the opposite doesn't have much opportunity in this game, at least with how the game works right now.

rancid tendon
#

hey folks, i'm trying to privately upload a fork of a mod for use in a server and i'm struggling with something