#mod_development

1 messages · Page 240 of 1

thick karma
#

I'm Burryaga on Workshop

jovial sparrow
#

Was actually able to get a context menu item to show up in game
feels nice to just have something simple appear lmao, even if it doesnt actually do anything

thick karma
#

Some of the mods on my page are mods I just help with like Blackouts, and I can't speak to refactoring the code of original authors if I haven't talked to them about it.

#

Although I doubt Joy would mind either

jovial sparrow
#

ill have to look at some more things to see how I can make some better use of it all but
its nice to see it appear in game

thick karma
#

Progress!

jovial sparrow
#

Any progress is good progess

#

I just have to learn... what everything means in context of the game lmao
but in due time

slender snow
#

Hi ! Do you know if it is possible to have a cinematic that launches into the game? that is to say it is possible to put for example a YouTube video which starts when I want it which takes up the whole screen and which would act like a cinematic (sorry for my writing I am French)

thick karma
#

Never tried to inspected code for a way to do it but that seems like something somebody would've done if it were doable.

slender snow
thick karma
#

That is most definitely possible

#

You could make a screenswide black background and add whatever text you want and use maths for fadeins and fadeouts and scrolling text and such.

#

That much would be very doable

#

@slender snow

#

You could have cycling background images too

#

Just not 60fps video.

slender snow
slender snow
thick karma
#

You could send out a command from server to all clients that tells them to play the "video" at a specific game time and it'll be pretty close to synced

slender snow
thick karma
#

I could send you a file you could use as a starting point, give me a few minutes to get on my PC

#

I have a deprecation warning that shows messages in a series and then fades out when user connects

#

Just gotta change the size of the popup to match screen size

slender snow
thick karma
#

For examples of client-server comms, feel free to refactor True Music Jukebox's client and server files

frank elbow
#

"Doesn't work" or "won't run" aren't enough detail—you should explain exactly what is or isn't happening & check console.txt for relevant errors

#

The latter could also help you narrow it down so you don't have to send the entire file as an external link, which also makes help less likely

cinder finch
#

Thanks Jab spiffo

muted garnet
#

How can I stop player when moving?

spice edge
#

I started by asking GPT, but then figured that starting there without knowing anything else previously was a bad idea. Then I went into the wiki at https://pzwiki.net/wiki/Modding, it has some good resources and explains the basics and overview of modding. I know my way around programming already which helps, so I was able to basicaly skim through the wiki to find what I needed to start changing some Lua code and start to see things in Debug mode 🙂

red tiger
#

Welp, now I can third-party document the Java API for PZ. =D

jovial sparrow
#

that seems insanely useful

muted garnet
#

How can I stop player when moving?

burnt quartz
#

-- DoorBlocker.lua

Events.OnDoorToggle.Add(function(door, character)
local doorSquare = door:getSquare()
local frontSquare = doorSquare:getAdjacentSquare(door:getDirection())
local backSquare = doorSquare:getAdjacentSquare(door:getDirection():opposite())

if frontSquare and frontSquare:getCorpse() then
    character:getPlayer():getUI():showText("is there something in front of the door.")
    return
end

if backSquare and backSquare:getCorpse() then
    character:getPlayer():getUI():showText("is there something behind the door.")
    return
end

end)

Is this code correct? If there is a body in front of or behind the door, it should prevent the door from closing.

surreal wave
#

use ` three times followed by the language extension name and then close it off with three more to make a code block

#
//looks like this
if (true) then {//Code};
zinc epoch
#

Also like for context, i know a bit of LUA.

surreal wave
#

How do you run functions in zomboid?
Let's say I make a godmode mod.
I go to zomboid > mods and create STB_godmode
Inside I create mod.info ```txt
name=STB_godmode
id=stb_godmode
description=test mod
author=player1
version=0.1

and the folders media > client
inside I create STB_godmode.lua ```lua
--test mod to add godmode to player
local function stb_godmode()
  local player = getPlayer()
  player.SetGodMod(true)
end

how would I even run this correctly? What's the standard and good practices? The wiki is kind of hard to navigate imo and most of it (including unofficial ones I've found) leaves a lot of guesswork.

#

do you just run ```lua
Events.OnGameStart.Add(stb_godmode)

??
#

what's the init order of client/shared/Server and does it just run everything unscheduled in there or?? So I can add a init.lua maybe and throw in the functions elsewhere and make them global, but then does that cause lag and is it better to make everything local or??

#

Ideally I'll just have the strucutre like
fn_stb_godmode.lua
fn_stb_teleport.lua
and then inside add functions
and then init.lua runs everything. But idk..

mellow frigate
#

player:setGodMod(true)

surreal wave
#

or is that some third party java library that isn't in zomboid?

coarse sinew
#

In Lua, you should use the colon (:) instead of the dot (.) when calling methods on an object. This is because the colon syntax automatically passes the object itself as the first argument to the method, which is required for proper method execution.
https://projectzomboid.com/modding/zombie/characters/IsoGameCharacter.html#setGodMod(boolean)

local function stb_godmode()
    local player = getPlayer()
    player:setGodMod(true)  -- corrected syntax
end
#

Using local functions is generally better for performance and avoiding global namespace pollution. Define your functions as local within their respective files and expose them if necessary.

As for file load order, see this message #mod_development message

#

As for calling that function on OnGameStart event, chances are that the player is not initialized.

surreal wave
#

That's what I've found so far ^^ Thanks btw

surreal wave
coarse sinew
surreal wave
#

Is it better to do ```lua
local function stb_godmode()
local player = getPlayer()
player:setGodMod(true) -- corrected syntax
end
local function init()
Events.OnPlayerLoaded.Add(stb_godmode)
end
Events.OnGameStart.Add(stb_godmode)

or should I just throw it directly on playerloaded or whatever it's called (surely there's an event for that somewhere but I'm lazy atm I hope you guys get what I'm saying)
#

I'm guessing you can't suspend inside functions

#

I literally have 0 idea wtf I'm doing here btw lmao I've never touched lua thank god or looked into zomboid much before

coarse sinew
#

Events.OnCreatePlayer.Add(stb_godmode)

surreal wave
#

also thank god that's for vscode some people like to hate on vs which is objectively the best for anything windows thx no fitin

#

yeah I'm not trying to make a godmode mod

#

well, in this example I am just to get started lol

abstract topaz
#

oh my god i just realized

#

has anyone tried making a plants vs zombies mod for zomboid?

surreal wave
#

how would that even work?

abstract topaz
#

idk im not a coder

muted garnet
#

How can I stop player when moving?

surreal wave
#

spamming this won't give you an answer.

muted garnet
#

so tell me the answer and I won't write this message

surreal wave
#

alt + f4

#

player stops movign

muted garnet
#

true method

#

Naturally I ask how to do this through code

surreal wave
#

Describe your problem a bit more in depth and include whatever you've made so far in the message and you're more likely to get a response.

muted garnet
#

I need to stop the player when player is walking towards some object using luautils.walkadj in the middle of the action or get the way to make player going to dynamic object (other player like)

surreal wave
#

I didn't mean to be rude earlier but now you're more likely to find someone who can help. I obviously can't because I'm an idiot myself lol

#

jc everyone here use camelCase for zomboid?

ancient grail
#

The 3rd one i think is what i used

ancient grail
# surreal wave spamming this won't give you an answer.

Actually it is encouraged that you ask again if you didnt get the answer first time around
Its cuz people who are willing to help might have missed the first messages

And i dont think its spam if its not sent multiple times and there are no other messages in between

ancient grail
thick karma
#

Java has clear standards and many people follow those in the absence of standards declared by the creators of Lua, which, again, do not exist.

surreal wave
#

99% of the time people will use pascal or camel and I just want to match to make it easier to read just assumed camel was the "standard"

thick karma
#

PascalCase so to speak is intended for classes in Java, so most people who have given this any thought at all use that for the names of class-like modules.

#

YourModule.yourFunction is derived from standard Java. yourInstanceOfYourModule.yourMethod is also standard

#

Instances of modules (well, classes, in Java, but functionally it's very close to the same idea) are punctuated like any other variable generally in Java

#

And, also reflecting Java, IS has set the standard of primarily using THIS for constant case

thick karma
#

Introducing C standards in a game that's entirely Java e.g. would be much weirder

#

Or at least further from context

surreal wave
#

PascalCase is king unless you're a leetHaxor in my mind lol

thick karma
#

Lol well nobody here read your book before deciding how to write Kahlua for Zomboid

#

They read books that are in publication

#

😎😉

surreal wave
#

I've published a book (actually fact)

#

(it has nothing to do with this)

thick karma
#

In which you declared PascalCase is king?

#

Haha

surreal wave
#

I should've

thick karma
#

That's all I'm sayin

#

Hahaha

#

But regardless even if someone wrote it in a book I would consider it inferior advice to that of other books. Using consistent variation in how you name different kinds of structures in programming makes it easier for people to immediately recognize what kind of thing a variable name is, and how it's meant to be used

#

If everything is PascalCase, there's no immediate way to guess about its purpose, and it just slows things down

surreal wave
#

fair but pinky on shift takes a day or two to reprogram

#

I just like using whatever everyone else is using

#

I hate whne someone needs to be an induvidual in a team etc

thick karma
#

Why would a capitalization variation take days to reprogram? You can just refactor the exact pattern across whole projects...

#

Find and replace is extremely fast

surreal wave
#

no I mean when actually writing

#

pinkie is automatic

thick karma
#

Ohhhhhhhhh

#

You mean mentally reprogram yourself got it

surreal wave
#

I'll end up using both unless I focus

thick karma
#

Yes that's fair that's fair

surreal wave
#

FOCUS

thick karma
#

Old habits die hard

surreal wave
#

good thing I grew up knowing that leetHaxors use camelcase

#

the one true indent*

thick karma
#

Lmfao

surreal wave
#

(i am actually really haxor guys trust)

thick karma
#

Peas don't hax me 😭

#

Don't hax the messenger

slender snow
#

@thick karma yo bro i have make my mod but i have a problem, when i strat my command in the console that tell me : console1: '=' expected near '<eof>'

#

i have ask to chat gpt look in forum but I don't see where the problem comes from maybe you know ?

thick karma
#

The line number should be in the error

slender snow
thick karma
#

Oh you just typed startcinematic in debug to try it?

#

And startcinematic is a function I assume?

#

If so, you need startcinematic() @slender snow

slender snow
slender snow
thick karma
#

Need parentheses to invoke a function even if it has no input parameters

#

Also if that function is local you're gonna need to make it global (delete "local ") to test it in debug console

slender snow
thick karma
#

I personally encapsulate everything I do in modules

#

If you review the file I sent you'll see what I mean.

slender snow
thick karma
#

Everything in the file is in local JukeboxDeprecationWarning iirc

#

So when I declare local JukeboxDeprecationWarning = {} I declare a Lua table that I intend to use as a classlike object, which we call a "module"

#

When I declare a function in the file, I declare it as part of the module, e.g. JukeboxDeprecationWarning.display

#

At the end of the file I write return JukeboxDeprecationWarning

#

The advantage of all this is that if I want to debug console test a file that is entirely local and written this way, I can type JukeboxDeprecationWarning = require("JukeboxDeprecationWarning") and turn the formally local JukeboxDeprecationWarning into a global module for ease of testing

#

Without changing the file at all

#

So I would recommend following that approach to make your life easier

#

Also, to be clear, everything in the local module is automatically also local

#

You don't e.g. write "local JukeboxDeprecationWarning.display = function()"

#

Local is not necessary at the beginning of that line because JDW is already local

#

Follow? @slender snow

slender snow
# thick karma Follow? <@450011828097908756>

Yes thanks for help me ! i call a friend tomorow , So that he can help me because I don't understand everything about coding . If I can make something out of it I'll show you!

thick karma
#

Just realized I actually made JukeboxDeprecationWarning global since it's not meant for gameplay anyway... so in theory if you had used that skeleton it would have been callable without importing... that said, if you WANTED it to be local, you would change the first line to say local JukeboxDeprecationWarning = ISPanel:derive("JukeboxDeprecationWarning") and then return JukeboxDeprecationWarning as the last line.

#

Wasn't on PC so couldn't review my code

#

@slender snow Good luck

jovial sparrow
#

if im looking for the tile the player right clicked, is it clickedSquare? just seeing it around a bit and wanted to double check

thick karma
#

Sounds familiar... I think that might be right

#

Make sure it's accessible outside of the function in which it exists

#

Idr if it's declared local or not

jovial sparrow
#

gotcha 👍

#

well, im happy with my testing so far lmao

muted garnet
#

I mean, how can I interrupt the walking action in advance and start timedaction?

#

or is there a way to go to dynamic objects rather than static ones?

ancient grail
muted garnet
# ancient grail try ```lua getPlayer():PlayAnim("Idle"); ```

not working, maybe I need to make some changes with walkadj?

local function moveToEachOther(player, clickedPlayer, args)
    luautils.walkAdj(player, clickedPlayer:getSquare())
    luautils.walkAdj(clickedPlayer, player:getSquare())

    local function onTick()
        if checkDistanceAndStartAction(player, clickedPlayer, args) then
            getPlayer():PlayAnim("Idle");
            -- player:setIgnoreMovement(true)
            -- player:setIgnoreAimingInput(true)
            -- player:setIgnoreInputsForDirection(true)
            ISTimedActionQueue.add(someTimedAction:new(player, clickedPlayer, args))
            Events.OnTick.Remove(onTick)
        end
    end

    Events.OnTick.Add(onTick)
end
ancient grail
#

Im using mobile rn but look at vanilla timed action and check how they force stop it
And make it fail?

Im not quite sure what you are trying to do.. can you explain more about what you said

I need to stop the player when player is walking towards some object using luautils.walkadj in the middle of the action or get the way to make player going to dynamic object (other player like)

muted garnet
#

I need 2 players to approach each other, but as far as I understand, walkAdj accepts the players’ locations only at the beginning of the function and the players will go to the squares they were on, but I need to make them approach each other

muted garnet
#

As far as I understand, when the player moves, his location is not updated for walkAdj

#

or for similar methods

#

That's why I'm asking about how to stop walking action when the players are close to each other

ancient grail
#

Ahhh
Try using collide then setreaction or something

muted garnet
#

Can you explain what do you mean it more details pls?

#

or maybe I can clean walking timed action queue and start new?

thick karma
#

He just needs to clear timed action queue and start a new one

muted garnet
#

can you pls explain how to make it?

thick karma
#

I don't have the code handy but there is a clear function referenced in many places in vanilla

ancient grail
bright fog
#

nvm maybe not it's not to clear queue

bright fog
muted garnet
bright fog
#

👌

thick karma
#

I just wanted to prevent him being sent on a wild goose chase

thick karma
sonic ibex
#

I would like to make some changes to the boredom system, it seems silly to me that one would be bored so easily in an apocalypse. My last game I had just been shot and had to escape from zombies, I finally found somewhere safe to rest and heal but I was bored. I feel like that wouldn't be the case 😅

frank elbow
sonic ibex
#

thanks

bright fog
#

It's not tweaked correctly and whenever I use that mod I never see the boredom moodle ever again

#

It's not properly balanced

frank elbow
#

This does not change my statement

#

I've certainly still seen the moodle with it enabled, so I know that part to be false unless an update changed it. I don't have an opinion on how balanced it is 🤷 but regardless it's a resource

bright fog
bright fog
frank elbow
frank elbow
#

I haven't used it in SP for a long while though, just MP

lavish plume
#

running a dedicated server on linux with steamcmd. Keep getting an error in my console. Looks like set_mempolicy: Invalid Argument anyone seen this before?

frank elbow
lavish plume
#

ok thank you

thick karma
#

Alright, last time I'm going to mention this before I make a decision (I promise). For anyone who missed it, I am releasing a mod that prevents modded key bindings from being reset to their default values when people switch between servers that do not run the same mods (and therefore do not require or add the same modded key bindings). I have been having a lot of trouble finalizing the name because there are good arguments in favor of lots of different names. *

In light of a myriad of considerations, I have narrowed it down to this list of names that I can emotionally accept:

  • Eternal Key Bindings
  • Immortal Key Bindings
  • Keys Stay Bound
  • Keys Stay Rebound
  • Bind Keys Forever
  • Rebind Keys Forever
  • Keep Custom Key Bindings
  • Save Custom Key Bindings
  • Remember Key Rebindings
  • Persistent Key Bindings
  • Key Bindings Remain
  • Persistent Rebinding
  • Permanent Key Bindings

If you have the slightest interest in sharing your opinion, I would love to see your top 5 choices from this list. I plan to count votes via instant runoff to decide what the most popular options are.

Feel free to recommend your own unlisted choice; if it's too good to pass up, I'll definitely consider a name that is not on this list.

Thanks for any feedback you have. If you have no interest in this, thanks for tolerating this rather long message about something that means nothing to you.

* Short names are more fully visible in the Workshop search (which only shows 18-19 characters of a name in some places), but long names can be more clear about what the mod does (although they can be truncated on larger fonts in the vanilla server setup UI); cool or fun names can be more ambiguous or vague, but literal names can be painfully boring to me; other conjugations of "binding" (like "bound") or alternative phrases (like "bind keys") can feel nice to native English speakers, but they don't match the vanilla menus, so their meanings may be more likely to get lost in translation; etc.

#

@ancient grail Mainly this, to answer your question that I was too busy to answer earlier. This and trying to brainstorm a way to fix Blackouts' quirks.

#

(Sorry to anyone who really wants it to be Keyper but I just don't want to make it hard for people to find later.)

ancient grail
thick karma
#

Got it! If you don't mind giving your top 5, your vote may be more likely to factor into things in the end.

thick karma
sour island
#

Persistent Custom Keys

ancient grail
#

Just trying to suggest shortest possible name thats also clear

daring swallow
#

I like that one

hearty estuary
#

i like "Keys Stay Bound"

ancient grail
#

KeyBound

hearty estuary
#

if i had that problem, that's likely something i'd search for and recognize as a solution

ancient grail
#

UndyingKeys lol
Since you mentioned immortal

thick karma
# ancient grail KeyBound

Not gonna exclude spaces from the title, and don't really love the ambiguity either tbh, but I appreciate the effort.

ancient grail
#

Just ZombRand from the list lol

thick karma
thick karma
hearty estuary
#

what about "[BUG FIX] Woah! That's a Keyper! (Fixes A Bug That Makes Servers Forget Your Custom Keybinds) Patch"?

thick karma
#

Blocked.

#

😉

#

❤️

hearty estuary
#

😛

thick karma
#

Nah but f.r. if I were going to pick a ridiculously long joke name

#

Center for Mods That Can't Bind Good and Want to Learn to Do Other Things Good Too would have already won

hearty estuary
#

honestly, if your mod does one really specific thing it isn't always a terrible idea to name it exactly what that thing is

thick karma
#

But within those limits, that is a goal.

ancient grail
thick karma
#

Server setup menu limits visible characters quite a bit if people aren't running Wookiee Server Options

#

Which most people don't

hearty estuary
#

ah yeah, i've noticed that with my own servers

thick karma
#

Which is not an impression I want the title to make

hearty estuary
#

spaces in your titles generally makes them more legible (not that i'm one to talk with a name like this lmao)

thick karma
#

Plus your name is classic

hearty estuary
# hearty estuary i like "Keys Stay Bound"

this one feels the most concise to me but my next top 4 in order of what i'd search for as a fix to my issue would be:

  • Keep Custom Key Bindings
  • Remember Key Rebindings
  • Permanent Key Binding
  • Keys Stay Rebound
ancient grail
thick karma
#

Keys Stay Bound is pretty popular so it's got a good chance. Eternal Key Bindings and Permanent Key Bindings seem to be the current runners-up.

#

Also Persistent Key Bindings has a couple votes (one from Chuck and one from a private convo).

sour island
#

Subsistence

thick karma
#

The rest of the votes are pretty scattered right now

hearty estuary
#

now that i think about it, "Keys Stay Bound" is what i'd search but i think "Permanent Key Bindings" might be much more clear that it is a fix to a technical issue and not actually related to any form of key in game

thick karma
sour island
#

I'd say persistent is more technically correct than permanent

hearty estuary
#

i agree

thick karma
#

That is fair.

hearty estuary
#

i preferred Keep over Save because Keep implies that they are lost, which is more accurate than unsaved

thick karma
#

Some of them are consciously hyperbolic but still on topic.

sour island
#

Metal Gear 3: Snake Eater: Subsistence is one of the better in the franchise tho 😦

ancient grail
#

Couldnt help myself lol

thick karma
#

Haha fair

#

I updated the list to offer Persistent Key Bindings over Permanent based on above feedback.

#

Also added Persistent Rebinding (PR) as an option in place of less popular ones

thick karma
#

haha

hearty estuary
ancient grail
#

Luadroid

brittle dock
thick karma
#

I fear it'll be too hard to remember for a lot of users

brittle dock
#

My heart is broken, but I understand.

thick karma
#

Only 2 people have voted for KCKB so far.

brittle dock
#

You don't need to apologize to me, but I think you know who you need to have a word with. He's going to be upset, and remembering things for an eternity is sort of his thing.

thick karma
#

Lmao I think I'll still use that actually.

brittle dock
#

😛 Let me know if you actually plan to use it, I'll tidy up the extra finger on the right hand to prevent the inevitable crowd of mouth breathers from wasting a comment on that instead of how awesome the mod idea is.

thick karma
#

Lmfao why does AI do that so often?

thick karma
# brittle dock

Would love to see this with more of hysterical laughter vibe tbh, if your generator can make it happen.

#

I might try feeding it to Leonardo AI tomorrow and try to get lucky

brittle dock
thick karma
#

Well to be specific the mouth of this particular wizard is rounded and his eyebrows are angled sharply down toward his nose, which gives the strong sense of angry screaming. This form of "madness" (craziness) also looks "mad" (angry) which is not quite the ideal face for me. If his eyes were more neutral and his mouth were more of a crescent moon shape (upturned at the edges as though he were partly smiling, or perhaps actively laughing) that would be preferable.

#

@brittle dock

#

Not the art style I want obv but this is an example of the kind of laugh I'm thinking of

daring swallow
#

I've got a quick question, I'm hoping to make a small addon mod for More Traits that adds additional textures to the packer bag/big hiking bags. I've watched a bunch of tutorials on modding PZ in general but I don't have a background in coding myself some I'm unsure of the feasibility of affecting a seperate mods items. Would this be possible to do or would I have to essentially create a fork from the original more traits mod in its entirety to affect items from that mod.

undone wren
#

anyone has any "example mod" with the folders template?

jovial sparrow
#

great resources
that being said, im looking around for it but it may be faster to see if anyone knows
like, the text when you try to get out of a moving vehicle and it tells you that you cant, is that just, for example,
playerObj:Say("exampleText") or is there a different like, method for that?

#

or well, I guess I SORTA? found it?
something along the lines of ContextMenu_VehicleMechanicsStopCar but just need to find where that is, but I have a good idea where it may be

coarse sinew
jovial sparrow
#

oh, I took myself on a bit of a wild goose chase I think 😅

jovial sparrow
#

ah ok so it is still playerObj:Say

#

beautiful thank you

half remnant
#

GM guys, I made my own custom frying pan and a wrench ingame but now I cant use the tools for cooking and mechanics stuff.

Does someone know where the creating stir fry logic for frying pan and uninstalling / install car part logic for the wrench are in the vanilla code?

half remnant
hybrid zephyr
#

Someone needs to create a "layer viewer" for project zomboid, such that when you are driving or othwerewise travelling through the map, the isometric view of the game doesnt impede your gameplay when buildings overlap the road or whatever is blocking your view. For example, in the town of Louisville and pretty much anywere where theres more one story too a building, the "layers" or "floors" fade in and out of view, someone needs to create a mod where you can hard lock the "layer" your viewing, so you dont drive your car into things that are on the road you cant see because a building is being rendered in front of you.

#

what would it take to create a mod like this im desperate ;-;

#

someone who knows java or Lua I think can do this, right?

brittle oyster
#

nah but a feature to scroll floors in and out of view would be epic

hybrid zephyr
#

its actually necessary for the game in my opinion

#

ive been gushing to everyone about how need this is ;-;

#

its in so many games except this one, that are isometric

vestal gyro
#

Go to the modding discord you can commision mods there or ask for advice how to do it

hybrid zephyr
#

okay I will

#

godspeed to myself

#

can you link me?

bright fog
#

There's a community post link to not send the invite directly in case

vestal gyro
#

👍

bright fog
#

For the modding Discord

thick karma
#

Did you see that error in mod support? @bright fog

bright fog
#

No I don't think so

knotty path
#

i want to start developing mods for zomboid, which language should i learn and which programs should i use for making models etc.?

bright fog
#

I'll look at it later I can't rn

knotty path
#

Java too?

bright fog
#

We have addons for modding in it

bright fog
#

You can learn how to read it however to understand better how the source code works

#

When you decompile the java

knotty path
#

cool, i think blender should be helpful too, ty

bright fog
#

Yeah

#

If you plan on doing animations or models

knotty path
#

have some great ideas for mods, wonder why nobody made mod for homemade butter

#

haha

#

good for gaining weight

bright fog
#

Hmmm there is but the issue is that it requires milk

#

There's a Fauna mod but the animals are just static tiles or some shit like that

thick karma
thick karma
#

Oh sorry

#

Didn't know if you knew where it was after you said you didn't think you saw it

bright fog
#

Np

#

The guy posted it here and on the modding Discord

thick karma
#

Oh gotcha gotcha

#

Missed that

bright fog
#

Nurver pinged me for the report in the modding discord too

#

Yeah np

#

I answered in the discord, didn't bother to do it here too

#

It could be an oopsie on my end tbf

karmic wedge
#

Is it possible to edit base game tiles?
I'd really like to darken the snow, it's migrane Inducing being this bright

coarse sinew
#

I'm not aware of whether you can overwrite vanilla tiles, but I do know that you can change the color of tiles/attached sprites(what snow is) on tiles.

bright fog
#

You can overwrite them yes

#

I believe so bcs Manik's tiles does that

cinder finch
#

Hello, I would like to ask for those who have been developing plugins /mods for years. What is the best way to understand the concept of developing plugin/mods ? Especially for people that already had programming experiences. Tbh developing plugin for games is a new things for me and i felt it just tired to just getting started without guidance. Any guidances ?

hollow current
#

That, and asking for help here if you ever find yourself stuck. The modding community is so friendly and you'd get your question answered in a short time

cinder finch
hollow current
cinder finch
#

Thank Arenda 😄

hollow current
#

My pleasure :)

civic tree
#

anyone knows how to modify or create these preset "suits" for the npcs?

civic tree
bright fog
#

You need to create a fileGuidTable.xml within /media

#

Check out what to write from the base game

#

Or from a mod that adds outfits

undone wren
#

do anyone know a good tutorial to initial project zomboid modding?,(creating items

vestal gyro
#

@undone wren

undone wren
#

ty

zenith igloo
#

unedited tutorial video ded

vestal gyro
#

it definitely didn't need to be 2 and a half hours long

zenith igloo
#

yep 😭

undone wren
#

yep kkkkkk

vestal gyro
#

but yeah its a good starting point, like we said don't need to watch all of it but its very helpful for getting your first mod done 👍

undone wren
#

I already added the item in the .txt,added a model in the /model but its not showing in game items viewer

vestal gyro
#

can you send your .txt and the one where your model is defined?

vestal gyro
#

huh

#

is ModTemplate in your Contents folder?

#

ok I'll dm you for the tips

main gull
#

hello, is there a way to get the user's font size setting?

#

for more context, im trying to add some text to the Information tab of the player but i cant get the alignment just right on different font sizes

thick karma
#

Just fyi you really wanna change file names and folder names before you upload that 😉 otherwise you'll conflict with the live runnable version of the tutorial mod

thick karma
#

Also for alignment purposes you may want to be aware of getTextManager():MeasureStringX(font, text)

#

Tells ya how wide stuff is and factors in font size and font type

thick karma
frank elbow
#

I like Keys Stay Bound & Keep Custom Key Bindings

thick karma
#

❤️

#

Keys Stay Bound is currently winning so there's a good chance I'll go with it. Thank you for the feedback.

rigid thorn
#

Is there a mod out there for picking which skills level up faster than others. Like a Nerf to cooking and Carpentry but a buff to electronics and trapping?

brittle nacelle
#

there used to be a couple winnable scenario mods- science lab to find a cure and restarting an electrical plant, anyone know these mod names?

ancient grail
rigid thorn
civic tree
#

is there any way i can tweak the colors for the clothes in the game? theres some i want to either alter or remove so they dont spawn clothing with that color

mint onyx
#

Is there a way I could use OpenGL inside of project zomboids modding api? I am trying to create a mod to add anti aliasing support to project zomboid

bronze yoke
#

no

mint onyx
#

well shit

bronze yoke
#

sorry for such a short answer but that is pretty much it 😅

#

the official modding support will not let you do anything like that

mint onyx
#

thats alright thanks anyway

wet sandal
#

I'm finally debating turning off comments on my mods...

civic tree
wet sandal
# civic tree why is that

There's just many zero effort bug reports and complaints with no details or just trolling.
Just annoys me, but the actual good bug reports make it worth it I guess.

autumn garnet
bright fog
#

Skill issues ShibaNom

#

I understand why you'd want to do that, I personnally don't have such a problem with comments

thick karma
#

I just delete the useless garbo. That's my revenge. They take the time to write it and then I retroactively waste that time. When the troll wastes far more of their own time than yours, you win.

wet sandal
civic tree
#

bro i see you playing fallout go work angry

thick karma
#

In my defense, not my mod, I was just added as contributor.

#

(The issue is minor, lol they'll find some spoiled food in new areas, they'll live.)

half remnant
ancient grail
light stirrup
glacial thorn
#

anyone who is experienced with map mods dm me

glacial thorn
red tiger
#

Glad to see the official anti-cheat system likely to be more effective in B42.

#

Having options for what to do based on each check has worked out well for a couple years for my anti-cheat so that should help people when it releases.

autumn garnet
drifting ore
#

having some trouble, the game cant load my model

#

getting error "failed to load asset"

drifting ore
#

the file paths are all correct, i think the issue might be with the model im trying to add a new food but the model i got is just some random from web

drifting ore
#

fixed it

solar rover
#

Hello all! I had a question about how Literature items worked? What controls if a book/magazine is removed on use? The only thing I noted from the basic code was that recipe books had a ReplaceOnUse line but nothing else does? I want a skill boost book to be removed on reading and not sure what script determines removal on completion.
Thanks for the time and info!

drifting ore
solar rover
#

Well that'll save me a lot of time, excellent thanks!

drifting ore
#

or what i did if u want in future to keep a book when read, ReplaceOnUse = (Book Name)

solar rover
#

Yeah I saw that with the recipe mags, I just needed the code for Destroy

drifting ore
#

yea np

thick karma
#

So I'm flipping through mods, expanding my mod list, reading up on clothing mod issues, and seeing that many people apparently (feel a) need to override BodyLocations.lua to get custom clothing locations to render in the correct positions. Am I understanding this correctly?

drifting ore
midnight prism
#

I think that works yeah

civic tree
#

im trying to do outfits for superb survivors, and for modded items i understand i have to write "modID.ModItem". so that mod id is just the steam workshop id right? ill send an example:

(this is how it is rn)
SurvivorRandomSuits["Normal"]["Scavenger16"] = {"ClothMask", "Trousers_ArmyServiceTUCK", ||"Base.Vest_DefaultTEXTURE", "Base.Shirt_CamoUrban", "Base.Socks_Long", "Base.Shoes_BlackBoots", "Base.Vest_Hunting_Grey"}; ||

and this is how it should be (maybe?):
SurvivorRandomSuits["Normal"]["Scavenger16"] = {"Susceptible.ClothMask", "SpnOpenCloth.Trousers_ArmyServiceTUCK", ||"Base.Vest_DefaultTEXTURE", "Base.Shirt_CamoUrban", "Base.Socks_Long", "Base.Shoes_BlackBoots", "Base.Vest_Hunting_Grey"};||

the || ||s are me covering irrelevant stuff, you can see it if you want but it doesnt import anything to the question

rare token
#

Hi! I'm making a mod and just noticed that Events.OnDusk is deprecated. What should I use instead?. Should I just hook a function to Events.EveryHours and check if the hour matches dusk time? or is there a better way?. 🙂

red tiger
#

I don't think that the game deals with daylight-savings time shifts.

#

If the event doesn't fire, you could recreate it using triggerEvent('OnDusk') and hook into EveryHours.

#

I wouldn't because it would be wasteful but if you wanted that it's doable.

rare token
red tiger
#

(Removing Events.OnDusk)

#

I hope that one day, Project Zomboid will have a fully realized Actions API for transacting with an associated origin source enum or string identity for making things like anti-cheat more friendly to mods.

#

For instance, if I trigger some action like sledgehammerDestroy I can provide a source of this action so that the engine can recognize that it came from the loaded client mod ID instead of some ambiguous code that could be cheating.

#

I'll keep this topic close to my chest as I continue to work on my own anti-cheat solutions. I think it's important enough to bring up here for possible discussion.

civic tree
#

can someone that knows about npc outfit mods give me a hand?

slender hazel
#

Does anyone know if it's possible to access the SandboxVars in the main menu? It only gives me the default value for some reason.

thick karma
#

I've tried to use them for trait management and they aren't ready in time for that.

slender hazel
#

@thick karma Okay, thanks! That was my plan as well 🙁

jovial sparrow
#

Is there a way to get, say, text to appear over a zombies head?
been trying to mess around with that, wasnt sure where to look exactly to start however

civic tree
#

anyone knows what is wrong with this? its code for a superb survivors outfits but it doesnt work

#

location is good, used other mods as example

red tiger
#

I need to see if Project Zomboid has a Java API call for Regex.

#

I need this.

jovial sparrow
coral lava
#

Hello kings! Does anyone know how to make it so a recipe produces two items instead of just one?

#

I am doing a custom mod, and to make it work properly I'll need to have an item turn into two seperate things

mellow frigate
mellow frigate
#

If you ask if they forward it to lua, then it's a no. They use this and they do not forward it. I seriously doubt they'll forward something else. But there may be some lua regex.

red tiger
#

Something that's incredibly useful, much like bitwise operations.

trail isle
#

Goodnight people, I don't speak English so I had to use the translator to try to see if anyone could help me with a problem I have.
I'm not a lua developer, in fact I don't understand anything, but I'm challenging myself to get to know the language better to be able to resolve some issues on the server I'm on.

I have the vending machine mod that works perfectly when you have money, however, I need to create a similar machine, but I won't have any money to destroy, because I created a card that only a few people will have and this is the premise for the machine release the item.

Currently my code is this:
recipe Milk
{
keep drinks cabinets,

    Result: Base.Milk,
Keep VIPCard,
    CanBeDoneFromFloor: true,
    Category: Food,
    Time: 0,

}

When executed, it works, the card is not destroyed, but it presents two options: take 1 item or take them all.
The problem is getting them all, as infinite items come out, which is not the objective, because whenever an item is selected, only one should come out.

I tried to make a function with a simple count, where if the number of items is greater than one it should return false, and it did, but it didn't help, as countless items still left the machine.

When I placed the function I used oncreate and called the function.

I would like to know if anyone has any idea how I can fix this problem.

Thank you and sorry for the bad English.

jovial sparrow
#

Trying to make like, a simple test to cause a custom food item to spawn
I have the item configured right but im a bit confused on the distrubutions side

would I just be cutting out one thing in each category andd changing the name to the new item name?

Distributions = Distributions or {};

local distributionTable = {
    conveniencestore = {
        isShop = true,
        counter = {
            procedural = true,
            procList = {
                {name="StoreCounterBags", min=0, max=2, weightChance=100},
                }
        },
        fridge = {
            procedural = true,
            procList = {
                {name="FridgeOther", min=1, max=99, weightChance=40},
                {name="FridgeSnacks", min=1, max=99, weightChance=100},
                {name="FridgeSoda", min=1, max=99, weightChance=100},
                {name="FridgeWater", min=1, max=99, weightChance=60},
            }
        },
    },
}

table.insert(Distributions, 1, distributionTable);

--for mod compat:
SuburbsDistributions = distributionTable;
#

or am I way off on adding this new item

#

I only ask since I know it used to be like this but I assume its this different system now ?

#

oh no wait, I see where stuff like that is

my only issue is like, I cant find a reference like that anymore for like, food shelves and fridges

edgy cloak
#

Hi, I want to use getparttype() but the item type is Inventoryitem, not Weaponpart. What can I do?

jovial sparrow
#

maybe im just not understanding the procedural part of it all? maybe someone does though

#

like gasstore has this:

fridge = {
            procedural = true,
            procList = {
                {name="FridgeOther", min=1, max=99, weightChance=40},
                {name="FridgeSnacks", min=1, max=99, weightChance=100},
                {name="FridgeSoda", min=1, max=99, weightChance=100},
                {name="FridgeWater", min=1, max=99, weightChance=60},
            }
        },

is it possible to add a custom item into procList for it or would it have to be something non-procedural

jovial sparrow
#

I actually figured it all out!
How procList works and all that!

cobalt mauve
#

i tried to google but i can't find how to export character animations from blender to the game, https://steamcommunity.com/sharedfiles/filedetails/?id=3035712003 this is the only guide i found, and the exporting part is completely missing, where do i put the fbx file, from looking at the files it seems that game uses .x files for animations, so it seems that the fbx file i got is completely useless

Welcome to this guide, where you will finally make your own animations and you will learn basic concepts about animations on Project Zomboid.
(Original Author: Dislaik)...

jovial sparrow
#

from the readings I have done, which may be helpful (or not), it seems mods only need to use *.fbx files

#

but thats only for models so im not sure personally

#

from the guide you posted it seems like, the export it talks about is just a single little line at the bottom of the Animation tab, but it does say
(Export -> FBX (.fbx) -> Export FBX)

cobalt mauve
#

it's just how to enter the export window in blender, it doesn't say where to put the file, but looking at authentic poses it seems like fbx file can be used, but now i wonder if it can be used to replace x files, because i wanna make a replacement animations

jovial sparrow
#

ahhh I understand, I hope
yeah looking at where it says the animations are saved it seems to just be a lot of XML files... weird

cobalt mauve
#

animations are seems like are satored in anims_x

jovial sparrow
#

I see

cobalt mauve
#

tho there is atleast 3 folders in the game that could store animations but don't

jovial sparrow
#

ah ok I think I see how it works

#

so if you're replacing an animation, yes the file you export is stored in the anims_x, but they are refered to between the XML tag <m_AnimName>

like, the default idle for example is <m_AnimName>Bob_Idle</m_AnimName> with a matching Bob_Idle.x file I believe

#

I would believe that you can reference a .fbx file as well

#

but I have only started modding... 2 days ago

cobalt mauve
#

trying that now

jovial sparrow
#

so godspeed, and I really hope it works

cobalt mauve
#

same, i wanted to make cool melee animations for so long

#

for this game that is

jovial sparrow
#

I wanted to make my own Plumbing mod. I know like 1-2 good ones already exist, but I saw it as a cool challenge

but for now, to get my foot in the door, I'm making some kind of Fallout-inspired mod

#

which is just basically Nuka-Colas lmao

cobalt mauve
#

based

jovial sparrow
#

but yeah I assume it will still read the .fbx

or at least I hope so. The wiki says it should as well

cobalt mauve
#

it's defo does for new animations, but i'm not sure about default ones

jovial sparrow
#

I think if you name it the exact same name, it will overwrite the old one

#

since it loads mods last

cobalt mauve
#

ok, it does read the animation, but applies it weirdly, gonna look in to it more

jovial sparrow
#

godspeed
im heading to bed but I wish you luck, and hope we both can get our stuff working lol

cobalt mauve
#

yeah, good luck and sweet dreams

tranquil kindle
#

And this one is working one for me

tranquil kindle
cobalt mauve
#

ah, nah, i don't have that problem, but thank you

#

my problem was that the idle played during the unarmed idle, but i figured out it's cuz i named file wrong and game just applied the animation to the default idle

solar rover
# drifting ore yea np

Finally had time to edit some scripts but after I finish reading my modded book the DestroyOnUse = TRUE doesnt seem to do anything?

ionic sentinel
#

If all I wanted to do was make it so the "Base.HandTorch" item can be attached to the players belt, I would need to change the items attachment type to something like a knife, correct?

#

I've done it before but it doesnt seem to be working now for some reason.

calm horizon
#

I'm attempting to make a "simple" change to candles: they remain lit if placed in the world. It does need to work serverside. The most bare-bones functionality is all I'm concerned with. I'd like to keep it as "vanilla" as possible, modifying the candles in-place: i.e., use the original candle item without creating any new items. If necessary, update any existing candle objects in the world.
I've been taking a look at the Lantern mod as it's the only mod I've found that actually takes an item that can be lit in hand and if placed. I've just started this endeavour today and definitely have no idea what I'm doing (with respect to PZ at least).

Anyone have any tips, a better starting point, or even a mod that already does this?

solar rover
#

Hmmm do I need anything else set to get DisappearOnUse = true, to work? I was hoping I could make that fit when Destroy didnt work.

ancient grail
solar rover
#

Ill try to test it real quick, its just killing me that I cant figure out why a magazine is remove when a skill book is not, where is that difference >_<

ancient grail
#

It doesnt usually happen unless you force it i guess?
Not really sure. Probably even turn on and off some items
But i haven't tried this cuz i believe theres also setActive or maybe im wrong

Cuz its been along time since i did stuff with scripts and items
So im just stating guesses and not facts

ancient grail
solar rover
#

More so when I can look over Bianca's clothing mod, her magazines are removed after use, I copy her code and mine stay. /flipdesk lol

thick karma
#

Maybe someone will spot an idea in the comparison

bronze yoke
#

magazines are removed whereas books are not because it is hardcoded to do that

#

iirc it checks if the book trains a skill and only removes it if it doesn't

solar rover
#

Sure, this is the magazine code from her BWardrobe_Crafting.txt
item Fashionmancer-Earrings {
Weight = 0.1,
Type = Literature,
DisplayCategory = Literature,
DisplayName = Fashionmancer: Earrings,
Icon = Fashionmancer_Earring,
TeachedRecipes = Make Earring:
StaticModel = Static_Fashionmancer_Earrings,
Tooltip = Tooltip_Fashionmancer_Earring,
WorldStaticModel = World_Fashionmancer_Earrings,
}

solar rover
bronze yoke
#
if not SkillBook[self.item:getSkillTrained()] then
    self.character:ReadLiterature(self.item);
#

the ReadLiterature method eventually removes the item

#

you can avoid this by hooking IsoPlayer.ReadLiterature and checking for your item

solar rover
#

Excellent, gonna screenshot this and go to bed, been up 36 hours and Im drained! Thanks all for the support!

agile vigil
#

Is there any way in Lua to save an InventoryItem so I can recover it later?

I am storing, e.g. several potatoes in a custom sack, and I want to recover them with the exact values (and item IDs, if possible) that they had when the player put them in.

bronze yoke
#

no

#

you can of course manually save every important property of the item to moddata somewhere but there isn't a simple way to save an entire item

agile vigil
#

Yeah, I've been doing every important property "by hand" so to speak for now, but I just hoped there'd be a simpler way 🙂

elder stream
#

In regards to the wiki

Are there specific serverside events or are these all mixed between client and server events?

I'm a little confused coming from the perspective of garry's mod and working with net messages
e.g Lua Events/ServerPinged

local function ServerPinged(ipAddress, user)
    -- Your code here
end

Events.ServerPinged.Add(ServerPinged)
coarse sinew
red tiger
coral lava
#

Does anyone know how to make crafting recipes produce biproducts? I am currently trying to create a mod that allows players to split jewels from jewelry. If anyone could assist with it that'd be great!

jovial sparrow
fleet bridge
#

You need an OnCreate function

jovial sparrow
#

even for like a food item? I know there is ReplaceOnUse but would I actually need to go through the OnCreate function?

#

oh im silly, apologies, i see what you mean

#

I think, anyhow

jovial sparrow
# red tiger https://github.com/asledgehammer/Umbrella

question about this:
I was working on a little test mod and it seemed to work fine, showed me the definitions and all

but on a new one, it doesnt seem to recognize the module at all, even after restarting VSCode and all that. The old one still works fine but stuff like Events.* wont even show me the definition for events, even with the requires

bronze yoke
#

if you're using the addon manager you need to enable umbrella for every workspace you use it in

jovial sparrow
#

oh im

#

yeah

#

maybe i should sleep and get my head back together 😵‍💫

#

totally forgot to even check

bronze yoke
#

don't worry, you're not the first one to miss it

austere sequoia
# coral lava Does anyone know how to make crafting recipes produce biproducts? I am currently...

You need a lua that looks like this(straight in server):

function Recipe.OnCreate.DISMEMBERJEWELRY(items, result, player)
player:getInventory():AddItem("Base.YOURJEWEL");

Then add a line to your recipe like this:

OnCreate:Recipe.OnCreate.DISMEMBERJEWELRY,

And you need an item for the jewel (in this case called YOURJEWEL, in the Base module)

Everything written in caps is what you can replace freely and name it as you wish.

vague raven
#

I'd also recommend looking at recipecode.lua in ProjectZomboid/media/lua/server for examples

austere sequoia
# coral lava <3

In case you write it in your own module, replace "Base." with your modules name

jovial sparrow
#

just trying to figure out this 2 item spawn after drinking something
I dont think OnCreate would work though in the scenario because the empty bottle can be used for water and then it makes the empty bottle again, then it would create the item again no?

tranquil kindle
#

Try using "destroy" for bottle that you dont want to produce empty one?

jovial sparrow
#

well
to lay it all out, since its my first real time modding this game, i decided to make a nuka cola mod because it sounds fun and I love fallout

I got the item spawning and the drinking item to work, but i'd also like it to be able to give you a bottle cap the first time you drink it completely, as well as the empty bottle so it can be used as a water bottle

austere sequoia
jovial sparrow
#

yeah thats my issue
i tried doing ReplaceOnUse = NukaCola_Empty;NukaCap, and it threw an error out to me that NukaCola_Empty;NukaCap was the full item name

adding a 2nd ReplaceOnUse was not good either

austere sequoia
jovial sparrow
#

Cant hurt to try, worse it can do it throw an error

tranquil kindle
jovial sparrow
#

where would I add that, so it only runs once when the drink is first fully drank?
(also the ReplaceOnDeplete did not work unfortunately)

austere sequoia
tranquil kindle
#

Wait, you want to make your nuka cola depletable?

#

Like water bottle?

jovial sparrow
#

no not the nuka cola itself
that just acts like a normal drink

austere sequoia
jovial sparrow
#

So its like a pop bottle, in function

jovial sparrow
jovial sparrow
#

lmao

#

worse case is I just do that..

austere sequoia
tranquil kindle
#

The simplest things tend to not be so simple

jovial sparrow
#

just when I got some things working, have to rework around half of it lol

well, not really. I can just add a new item and make that the one that is in the Distributions instead of the opened bottle

#

Unfortunate since if I add all the Nuka-Cola variants I'd have to do it to ALL of em.

austere sequoia
jovial sparrow
#

(I'll just make the closed bottle and opened bottle be the same icon texture lmao)

tranquil kindle
#

And you could add cool caps sound to recipe and even hide it so it does not clog recipe menu

jovial sparrow
#

actually

#

I have a good idea for that

austere sequoia
jovial sparrow
#

ooo I saw the standing items mod yesterday

I will definitely check it out, thank you

#

I guess opening the bottle would be similar to opening canned food

austere sequoia
jovial sparrow
#

where instead of base its the module it comes from

#

hm

#

lemme try

#

before I start trying to mess with recipes

austere sequoia
jovial sparrow
#

yeah, it imports Base but its module NukaColaDrinkExpansion

austere sequoia
#

So use "NukaColaDrinkExpansion" instead of "Base"

jovial sparrow
#

well, lets see if this works

austere sequoia
#

Like this:

ReplaceOnUse = NukaColaDrinkExpansion.NukaCola_Empty;NukaColaDrinkExpansion.NukaCap,

jovial sparrow
#

yeah, threw the same error again

#

that's fine
lemme try this recipe stuff

austere sequoia
#

Was worth a shot. Playing around with the dark magic that is code works more often than not 😛

jovial sparrow
#

do I need to include recipes in a module as well?

austere sequoia
#

Since vanilla recipe scripts start with "module base", I would say yes

jovial sparrow
#

just to be safe I'll import Base again here

tranquil kindle
#

If someone could help with figuring out how i could make that if my gun has Cannonslot (barrel attachment) removed, it changes sound to "MSR788Shoot". Right now it does change to said sound only if i attach anything else but suppressor, but if player removes said suppressor and does not attach other barrel attachment or reload save, it keeps silienced sound. 3rd If statememet ("if not Cannonslot then") is one of my many attempts to somehow make it work, but no luck.

    if inventoryItem ~= nil then
        if inventoryItem:getStringItemType() == "RangedWeapon" then 
            if inventoryItem:getCanon() then
            local Cannonslot = inventoryItem:getCanon():getFullType()
                if Cannonslot  ~= "Base.TLOG_BottleSuppressor" then        
                --inventoryItem:setSoundRadius()  -disabled for now
                inventoryItem:setSwingSound("MSR788Shoot")
                return
                end
                if Cannonslot  == "Base.TLOG_BottleSuppressor" then        
                --inventoryItem:setSoundRadius() -disabled for now
                inventoryItem:setSwingSound("TLOGSilencedSound")
                return
                end
                if not Cannonslot then        
                --inventoryItem:setSoundRadius() -disabled for now
                inventoryItem:setSwingSound("MSR788Shoot")
                end            
            end
        end
    end
end
Events.OnEquipPrimary.Add(TLOGSILIENCER)
Events.OnGameStart.Add(function()                                             
    local player = getPlayer()
    TLOGSILIENCER(player, player:getPrimaryHandItem())
end)
jovial sparrow
#

weird, the recipe isnt showing up hm

drifting ore
#

can i use .fbx models for guns?

#

instead of .x

austere sequoia
jovial sparrow
#

well, I have two Items now, NukaColaSealed and NulaColaOpen

and the recipe block so far is:

module NukaColaDrinkExpansion {
    imports 
    {
        Base
    }

    recipe Open Nuka-Cola
        {
            NukaColaSealed,

            Result:NukaColaOpen,
            Time:30.0,
            Category:Cooking,
            Sound:NukaOpen,
            OnGiveXP:Recipe.OnGiveXP.None,
        }
}
jovial sparrow
#

should the file just be called recipes.txt

austere sequoia
drifting ore
#

do the models contain anmations?

jovial sparrow
austere sequoia
austere sequoia
jovial sparrow
#

nula? where i cant see it..

austere sequoia
jovial sparrow
#

oh

#

that was me tryping

#

typing*

#

they both are spelled right

drifting ore
jovial sparrow
austere sequoia
austere sequoia
jovial sparrow
#

sure, lemme just check there isnt something I need to do to the item

jovial sparrow
#

yeah, not sure why this isnt working :/

austere sequoia
jovial sparrow
#

i appreciate it immensely

coral lava
#

@austere sequoia

okay, do i need to do anything to the variables here? This is how it looks but it apprently doesn't work

function Recipe.OnCreate.DISMEMBERJEWELRY(items, result, player)
player:getInventory():AddItem("Jewels.FD_GoldScrap");
end

recipe Remove Gemstone
{
    BellyButton_StudGoldDiamond,

    Result:FD_Diamond,
    OnCreate:Recipe.OnCreate.DISMEMBERJEWELRY,
    Time:20,
}
vague raven
#

That looks fine

#

Uh where are you putting the function?

coral lava
#

The function is in FD_recipecode.lua

vague raven
#

in lua/server?

coral lava
#

correct

#

there is other code that functions in that file, so I did something wrong with the line of code somewhere

#

the Module is also Jewels

austere sequoia
coral lava
#

🫡

vague raven
#

Did you import base in the recipe script?

coral lava
vague raven
#

like this, at the top of your recipe script

{
    imports
    {
        Base
    }```
floral saddle
#

I can't find my message where I previously asked this and I cant remember the response I got so

What does everyone use for java mod development to decompile?

bronze yoke
#

otherwise, whatever decompiler works

floral saddle
#

thank you

drifting ore
#

in which .lua are the crafting/recipes callbacks located

#

im looking for BSItem_OnCreate

#

nvm found it

floral saddle
#

What is a good mod to reference if I want to add music to the game via an external api

#

I was gonna take a look at the time period accurate music (its called something like this not sure if this is the exact name), but is there something else similar to this I can reference as well?

drifting ore
#

well gota new question, how do i add multiple results to a recipe?

thick karma
floral saddle
#

Are there complication with copyright and these types of mods being taken down? I was going to use an api from somewhere that is less restrictive

thick karma
#

I have used True Music mods for years and none of the ones I use has ever been taken down

#

And they have a whooooole lot of music that could probably justify taking them down lol

floral saddle
#

oh ok good to know

thick karma
#

I mean there are no guarantees when sharing copyrighted content like music

#

No matter how you share it

#

But it's a risk the True Music Add-On makers take for love of sharing music pseudophysically in a video game and I love them for it.

#

Keeping your packs limited in how many artists they add might be a good way to play it safer, but tbh I use multiple packs with 500-1000 tracks and they've all managed to dodge the copyright bullets.

floral saddle
#

Now what if I make music and i want to add it to the game? Are there already APIs for adding, say a folder of .mp3/.flac, or is this something I'll have to develop myself

thick karma
#

If you want to add music played BY the game (i.e., change the theme music and such), you have to overwrite game files. Otherwise you use something like True Music or Lifestyle (or True Music Jukebox which depends on True Music packs but plays sounds in its own way) to package .ogg files in the instructed way and those mods handle playing the sounds.

#

I don't know how Lifestyle works but I believe True Music has an exe for converting your song list into the required format and creating item scripts for the music you add

#

It's included in the files they provide for making add-ons

floral saddle
#

oh interesting ok

#

thanks for all your help!

thick karma
#

Good luck!

drifting ore
#

i cant open the crafting menu, i get a long error after i tried adding a callback function

the complete .lua file

Recipe = {}
Recipe.OnCreate = {}

function Recipe.OnCreate.DismantlePistol1(items, result, player)
    player:getInventory():AddItems("CG.SpareGunParts", 2);
    player:getInventory():AddItems("CG.MetalSpring", 1);
    player:getInventory():AddItems("Base.ScrapMetal", 1);
end

DismantlePistol1 = Recipe.OnCreate.DismantlePistol1
thick karma
#

Recipe is a vanilla table

#

By saying Recipe = {} you just emptied it.

#

Which would break who knows what

#

Everything?

drifting ore
#

oh lol

thick karma
#

See recipecode.lua in the vanilla game files

#

At the top you'll see

#

Look familiar?

#

It does that before doing stuff like this

drifting ore
#

yea i followed that

thick karma
#

Now all of that is gone

#

haha

drifting ore
#

didnt know i should remove it

coral lava
thick karma
#

Yes definitely remove the first two lines

thick karma
#

Unless your goal is to erase all recipe data

drifting ore
#

it was also an issue in the recipe file i had

#

didnt know i had to add at least 1 result

#

but after fixing those 2 things all works now it seems

thick karma
#

This is also most likely not necessary:
DismantlePistol1 = Recipe.OnCreate.DismantlePistol1

#

If it IS necessary, then Recipe.OnCreate.DismantlePistol1 is not

#

Most recipe on create functions point to something like Recipe.OnCreate.DismantlePistol1

#

Btu they are perfectly allowed to just point to some global function called DismantlePistol1 (though I wouldn't)

#

But if you ARE pointing to DismantlePistol1 directly, then Recipe.OnCreate.DismantlePistol1 is pointless... just set DismantlePistol1 equal to the function definition.

drifting ore
#

il remove it, i just added it because i saw the base game has the same

thick karma
#

Since the base game does not put local in front of those tables, they are implicitly global

#

And can therefore be accessed from any code that runs after they do.

#

If you try accessing Recipe.OnCreate from one of your files and it doesn't exist, try moving your code to server

#

But I am thinking that shouldn't be necessary because afaik all the vanilla folders in client, shared, and server should be loaded before anything you do in those folders... At the very least I am 100% sure that vanilla server files load before mod server files.

#

Not 100% sure whether vanilla server loads before modded shared but I thought it would.

thick karma
#

@marsh idol You might also want to share a zip to make sure your directory structure is right

marsh idol
#

Would someone mind taking a look at this for me? It is a mod that is supposed to modify a players calories. This is my first mod ever so bare with me. I am also having a problem where it doesn't show up in the sandbox settings. Not sure why that is. Any help is appreciated!

thick karma
#

lol this is your issue

#

😉

#

@marsh idol

marsh idol
#

Hahahaha I noticed that right after sending, Im a little embarrased about that😂 Thank you sir! However I did correct with this and it still wont appear?


option CustomCalorieSettings.CaloriesBurnedMultiplier
{
    type = "double",
    min = 0.0,
    default = 1.0,
    max = 100.00,
    page = "Custom Calorie Settings",
    translation = "CaloriesBurnedMultiplier",
}```
marsh idol
#

Quotes around "CustomCalorieSettings.CaloriesBurnedMultiplier"?

#

Or I shouldnt put quotes at all?

thick karma
#

No quotes

#

and page = CustomCalorieSettings because it points to Sandbox_CustomCalorieSettings which is the translation for the page name

marsh idol
thick karma
#
VERSION = 1,

option CustomCalorieSettings.CaloriesBurnedMultiplier
{
    type = double,
    min = 0.0,
    default = 1.0,
    max = 100.00,
    page = CustomCalorieSettings,
    translation = CustomCalorieSettings_CaloriesBurnedMultiplier,
}
velvet forge
#

Hello, could anyone help me? I'm creating a torch mode and I'm having trouble getting the torch to generate heat for the player. I wanted the temperature near the torch to be positive if it's cold. I don't know which class to use.

`local function applyHeatToEnvironment(player, item)
if (player:getPrimaryHandItem() and player:getPrimaryHandItem():getType() == "Torchlit") then
--I would like to know which function I can change the temperature around the torch
end
end

Events.OnPlayerUpdate.Add(function(player)
applyHeatToEnvironment(player)
end)

`

marsh idol
thick karma
marsh idol
thick karma
#

You're calling a function that expects an item, but giving it no item

#

@velvet forge

thick karma
velvet forge
#

Could you give me an example of how I should do it? @thick karma

thick karma
#
heatSourceMagic = IsoHeatSource.new(getPlayer():getX(), getPlayer():getY(), getPlayer():getZ(), 1000, 1000)
getCell():addHeatSource(heatSourceMagic)

This is how you died.
@velvet forge

ancient grail
#

I saw it a few times but never deep dived
But thats where i would start incase i need something related to body heat

Also check moodles and player stats

thick karma
velvet forge
#

@thick karma , In the item's script I tried to add the temperature tag but it had no effect on the heat source, I'll test here what you gave me, I believe it will solve the problem. thank you very much

coral lava
velvet forge
ancient grail
#
setTemperature()

also saw this

getTemperatureChangeTick()
#

goodluck

velvet forge
#

nice..

#

tks @ancient grail

thick karma
#

If so, you do not want to use player temperature functions to set player temperature. You need to use a heat source.

#

Making player warmer will not make the area around them warmer, despite what physics may have to say about that.

velvet forge
#

Yes, I'm using the heat source, as you showed in the example, but when I walk the previous cell I passed keeps the temperature high, I'm seeing how to remove it and keep it only where the player is. @thick karma

thick karma
#

remove instead of add

#

addHeatSource / removeHeatSource

#

You can remove the old one before you add the next every update

#

Store the cell it was in and the prior heat source and remove the prior source from the prior cell before getting current cell and generating a source for current position

velvet forge
#

humm... well thought out I save the position and temperature and before generating the new one I change the previous one... I believe it will solve the problem. thank you very much @thick karma

thick karma
#

Good luck

velvet forge
#

Tks

wet sandal
#

Pockets confirmed

#

Now I just gotta assign sane defaults based on bodyslot for mods then go through every piece of clothing in the game...

verbal yew
austere sequoia
#

Is the workshop down or is my steam bugging?

polar gyro
austere sequoia
coarse sinew
austere sequoia
civic tree
#

is it uploaded to ws already? pls tell me when it comes out if not

bright fog
autumn imp
#

does new denver mod no longer exist?

#

this mod

solar rover
#

I remember it behind south of Raven Creek now but could be wrong.

autumn imp
#

ahhh thanks man

solar rover
#

would love it if Winchesters creator would pass torch or update his to have MP respawns. I'm tired of refreshing those map files.

vast flint
#

Hello considering getting the game. Id like to know what technology is used to make custom UI/GUI in mods for the game and what are the limit for mods (like can you just add stuff before or after existing java methods from the base game or you can overwrite them too or peoples uses things like mixin/asm/reflection ??

bronze yoke
#

you can't usually hook java methods like that at all

#

a pretty significant portion of systems are implemented in lua though which you can patch or overwrite that way

vast flint
#

what about the GUI ? How much can you do ?do custom guis only work in SP ?

bronze yoke
#

you can go pretty much as far as you want with gui, all the vanilla gui is either fully lua or easy enough to replicate with the lua gui

#

there shouldn't be a singleplayer restriction on anything gui related

vast flint
#

so like you can make a button place it where you want and write custom lua for it right ? And in mp it would send the gui to connected players or theyd have to have the mod ?

#

sorry for the questions Im just checking my assumptions

bronze yoke
#

the game forces all players on a server to use the same mod list as the server

vast flint
#

thanks you have convinced me to buy the game. Looking forward to modding it once I understand the mechanics a bit

bronze yoke
#

i hope you enjoy it!

solar rover
#

Hey albion, i posted the hook i tried last night but no luck. Have a sec to look at it?

small topaz
#

Hi! Does anyone knows at which time exactly the beard growth for male characters is triggered? Or alternatively, which files in the vanilla code controll beard growth? (I guess it is not in lua but not sure...)

vast flint
#

do we have a possibility to write to a file inside our mod folder during the game like Im wondering about the possibility to copy items from a savegame to another in case I have to restart if mods break my savegame

coarse sinew
# small topaz Hi! Does anyone knows at which time exactly the beard growth for male characters...

Beard growth is checked every player update cycle by comparing the current hours survived to the last recorded beard growth timing. If the character is asleep or if sleep is not required (in MP settings), and more than 120 hours have passed since the last beard update, the next beard growth stage is triggered, after that the event OnClothingUpdated is triggered. And the code is in Java, specifically updateBeardAndHair function in IsoGameCharacter class.

hollow lodge
#

do they loose condition?

small topaz
#

Does anyone knows whether having selecting stubble for head during character creation will affect in-game hair growth? For example,

bald+stubble -> hair growth
bald+ no stubble -> no hair growth (staying bald during the whole game)

bright fog
#

I don't think so

grim cedar
#

Hey!
Does anyone know how to change the icon and model of the empty petrol can? I can change the full petrol can but i dont know how to change the empty one.

vast flint
#

:bump: "do we have a possibility to write to a file inside our mod folder during the game like Im wondering about the possibility to copy items from a savegame to another in case I have to restart if mods break my savegame"

#

ie for instance generating a json with all the loot

#

and loading it from another savegame

thick karma
#

I didn't understand the question

#

You can see it used in my latest mod if you need an example

vast flint
#

like is lua io blocked etc

#

and if its blocked does the game provide an alternative to write and read files

thick karma
#

Yes and yes.

#

See Keys Stay Bound

vast flint
#

are your mods on github or something ?

thick karma
#

Steam

#

I am Burryaga there as well

#

You can search author names as well as mod names

vast flint
#

?? these comes with source so I can see like you said ?

thick karma
#

Yes

#

Any mod you dl from Project Zomboid Workshop puts its source on your pc

#

In Steam/steamapps/workshop/content/108600

#

Iirc

vast flint
#

oh I thought it bd encrypted or something like starbound

thick karma
#

Newp

#

You can read the code of any mod you have unless perhaps it's a Java mod that has a compiled class file for you to manually overwrite game files with it

nocturne kiln
#

Hello, I want to create a collection of clothes from the game, I have the PNGs but I don't know how to finish assembling it, could someone help me or explain how to do it? Any tips? Thank you in advance

solar rover
#

Was hoping I could use Def's lua for turning read books into used literature items in my mod to delete/change skill books after reading but still won't trigger to alter or remove them. Albion pointed out that it's coded not to remove them and I was hoping this would do the trick. What am i missing?

drifting ore
#

What do people use to make map mods and will I need to learn how to program in lua to use it

thick karma
#

I would call this the nuclear option

solar rover
#

If it's make the book an apple instead i tried that 😅

thick karma
#

You wish

#

You can decorate the update function of book-reading such that when you complete the book, you also call a function that replaces the book in player inventory with a different item.

solar rover
#

Isnt that similar to this from Def?
`function Adjust(Name, Property, Value)
Item = ScriptManager.instance:getItem(Name)
Item:DoParam(Property.." = "..Value)
end

Adjust("Base.Book", "ReplaceOnUse", "CASM.LTSUsedLiterature");`

thick karma
#

I have never seen that but if that works, great. I am not sure if you can DoParam books into becoming used books or not.

solar rover
#

It works to turn the regular book, magazine, crossword ect into a used paper

#

But if i edit the script to point at a skill book, nothing

thick karma
#

Oh well then sure go with that if that's all you need

#

Ohhhhhhhhh

#

Oh

#

Right well what I'm suggesting would 100% work

#

Not just maybe

#

But it's more work

#

Because it bypasses vanilla use functionality of skill books entirely.

solar rover
#

Ahhh gotcha, that's probably going to be out on my league but I'll team up with AI and see if we can work it though! Thanks Burryaga!

thick karma
#

Good luck with that lol

#

If ChatGPT figures out what I mean, that would be interesting

thick karma
#

I think you're likelier to figure out what I mean than ChatGPT tbh. Lol believe in yourself. @solar rover

solar rover
#

I'm just confused why it feels so hard coded to skillbooks. I guess because you didn't want to lose it before all pages are read?

thick karma
#

I think wanting them to become garbage just because someone read them is honestly a highly unusual desire they never considered

#

Almost everyone would not think it makes any sense for a book to become useless because someone read it

#

It's a very odd goal

verbal yew
solar rover
# thick karma It's a very odd goal

It very much is I'll agree. My goal is to use the modified skill books to train things like weapons, stealth, sprinting and stuff like that on a long-term multiplayer server. Making these One-Shot use items lets me as an admin, add them into the game as perks or benefits to treasure hunt or things like that where a player can benefit, but it doesn't become this one book that gets passed around to an entire faction. Something that that person can then find rarely and put in their own personal vendor to sell the new players.

vast flint
#

Id help but I cant even figure out what file to decompile to understand how the game works

solar rover
#

Sorry kERHUS, reading that now

#

Ahhh that makes sense, i don't want everything getting hit, just that player. I'll test that as soon i get the kids to bed lol

thick karma
#

So e.g. if the translation is UI_NameOfSomeTranslation, I go searching for UI_NameOfSomeTranslation in all the game files and then I figure out what the code is doing from there.

#

I don't refer to Java that often, unless I cannot find something in Lua and suspect it's only handled Javaside.

#

Because ultimately Java is for me a dead end because I don't have any interest in Java modding this specific game

vast flint
#

I wanted to do this to know what is hardcoded

thick karma
#

Also reading decompiled code is pain and I just usually don't have the time and energy.

solar rover
#

Mine is probably really common, find the closest thing I can to what I want in a different mod. Dig through everything. See how it works. Pull the parts I need and throw everything at the wall. See what sticks

vast flint
#

cuz nobody here seems to be using mixin/asm so this would probably be odd for most here

thick karma
vast flint
#

?

#

I dont even know in what .jar the code is

thick karma
#
  1. Read instructions.
  2. Do instructions.
  3. Profit.
vast flint
#

well that is good to know already: import zombie.inventory.types.Clothing; import zombie.inventory.types.Drainable; import zombie.inventory.types.DrainableComboItem; import zombie.inventory.types.Food;
import zombie.inventory.types.HandWeapon; import zombie.inventory.types.InventoryContainer; import zombie.inventory.types.Key; and that the base game is a mod called pz-vanilla

#

seems that besides types not much is hardcoded for inventory items

thick karma
vast flint
#

No I wasnt I mostly wanted to get a vague idea of how hgardcoded things are

#

Still have to find what gui framework the game uses and what widgets are available

thick karma
#

ISUIElement ISPanelJoypad ISCollapsibleWindowJoypad etc.

north drift
#

So two questions, does anyone know about ItemZed status. Eg Is there a working copy? OR is the original owner still around OR is there some source code somewhere?

#

Is there any community 'mod api' or mob libraries that are good / standard

tiny stirrup
#

How does "scratchSpeedModifier" work, exactly? Specifically within the BodyPart class?

#

I assume it's either a percentile multiplier for the amount of time it takes to heal, or a multiplier for healing speed, but those are opposites and I don't know which...

cinder finch
#

What is ZombRand(MaxValue) ? Is it generating Zombie randomly ?

#

Nvm its for generating random numbers lol

cinder finch
# bright fog Yeah numbers lol

Sir may i ask how to debug or print a value within the game ? For example i would like to print(getPlayer():getStats()) in game.

wet sandal
bright fog
#

Don't bother using the debugger lol

#

It's terrible to navigate

wet sandal
#

It a bit dodgy and could be better, but it supports break pointing your code and viewing data while on a break point.

#

Definitely use it if you want to do some actual debugging

bright fog
#

I just can't figure out how to go through it

#

So no it's not that great

cloud breach
#

Hello 👋
I am looking for someone who know if it is possible to get a cinematic on every screen's players on serveur multiplayer

cloud breach
red tiger
#

AFAIK no. You'd have to draw each frame as an image and then somehow sync a sound you play to achieve the affect and I'd imagine it'd desync and be far from ideal.

#

A technical yes but at what cost, sorta thing.

cloud breach
#

Possible but hard to pull out ?

red tiger
#

Is it a high-definition video file attempting to be played somehow? Is it a lo-fi, low framerate series of sprites?

#

Every effect in PZ is sprited and some sequenced with audio.

#

No video format is supported to this day AFAIK.

cloud breach
#

Yeah that's what i thought, the things is to have few séries of pictures, pop up on every screen like "Thanks to play" and other pictures

#

Maybe 3 or 4

red tiger
#

Try it out. Heck, I'd like to know how far you can stretch the game's resources on an average computer for this.

#

Either way you're faced with this obstacle.

#

It's not impossible no, just annoying.

thick karma
#

Seconding Notloc, debug is extremely useful

#

It may not be the best debug tool in history but it is very effective if you learn to use it.

thick karma
#

Clientside the sync will be fine if you start the sound first and figure out how many seconds to wait to change image

#

They're talking a slideshow for clarity

#

Not a true cinematic

red tiger
thick karma
#

Word missed that

#

I thought you were still uncertain about whether it had the resources due to not knowing what they really intended to do

red tiger
#

I'm also mad now because I was in my coding zone and then the power went out.

thick karma
#

NOOOOOOOOOOO

red tiger
#

Now I just sit here

thick karma
red tiger
#

Power is back but now it's sus

thick karma
# cloud breach Is it hard to set up ?

Not like beyond what a normal human being should be capable of learning to do through persistence hard, but not have a snack and pass out easy either. 😉

#

I would make the UI using ISPanelJoypad, take in a set of pictures, a sound, and timestamps for picture changes as input to the UI, play the sound when the UI first opens, and then on prerender change the picture you plan to render in accordance with timestamps

#

Probably not a 1-day job if you've never done UI before, within the month I would say most people could make it happen through persistence

reef wren
#

Hello I want to add procedural distribution for a item that i have create, a refillable lighter. I want to add the possibility to find it on zombies body but I don't find how to.

table.insert(ProceduralDistributions["list"]["allInventoryFemale"].items, "Base.RefillableLighter");

I tried with many thing like AllIventoryFemale, allInventoryFemale or allinventory female. What is the correct way to do that ?

I check with lootzed and i don't see my item in the list. When I try with this for exemple i see it in the item dropable :

table.insert(ProceduralDistributions["list"]["BookstoreBooks"].items, "Base.RefillableLighter");
table.insert(ProceduralDistributions["list"]["BookstoreBooks"].items, 1);
thick karma
# cloud breach Is it hard to set up ?

You need to break your goal into small doable tasks to make this realistic.

  1. How do I make a mod with proper directory structure?
  2. How do I make a player say something when I trigger a specific event to prove this worked? How do I even attach a function to an event?
  3. How do I make an empty UI derived from ISPanelJoypad that people can close using a button or by hitting B on controller.
  4. How do I resize it?
  5. How do I play a sound?
  6. How do I draw an image? How do I resize that?
  7. How do I track time passing?
  8. How do I figure out when X seconds has passed?
  9. How do I change the image this UI is choosing to draw when X seconds has passed?
  10. How do I make the UI change the image again after Y more seconds has passed?
  11. How do I trigger this event at the same time for everyone on the server? Is setting it to fire at a specific time of day good enough? Or do I need to manually trigger this using client-server commands?
  12. If I need to use client-server commands, how do I send a simply command to make every player talk using client-server commands? Where can I learn more about PZ client-server commands?
  13. If I need to use client-server commands, do I need to trigger this from some kind of client activity (e.g., an admin firing the command)?
  14. If I don't have testers, how do I test multiplayer behavior on my own PC by myself?

If you break your broad and difficult-sounding goal into lots of little goals, it will become doable for you. You just need to break the goals down into small enough steps that you can figure them out.

tame raft
#

can someone help me start making pz maps? i know its ALLOT to ask for but i am really looking into map creation and mod creation, (and yes i have watched tons, AND tons, of tutorials)

cloud breach
brittle dock
#

☝️

#

Piecing random pieces of code together is nice and all, cool to make it work.

Actually grokking what you're doing, and gaining a full understanding of the limited scope of the skills required for each step? Testing each subsequent step against the foundational knowledge that you've worked hard to achieve from each previous "plateau", allowing you to continue to test, learn, and grow with each experiment? Oh shit, that's the good stuff.

#

If the second part sounds cool, we want you to hang out with us. ❤️

No previous knowledge required, just a willingness to learn, some willpower, and preferably a good sense of humour.

thick karma
#

Persistence is key.

#

Good luck!

tiny stirrup
#

I'm working on a mod, and what I really need to do is modify a few lines of code in IsoPlayer.class. Really simple stuff, just change a couple of formulas. Is there a relatively straightforward way to do this?

I'm getting some conflicting information just googling, where it seems to be possible just with Lua like a normal mod, but I also see people saying it requires something more complicated with recompiling the class and injecting it somehow.

Can anyone help me understand what to do?

#

Ideally I'd like to have mod options in sandbox settings for some of the changes to be tweaked, exposing a few variables basically.

red tiger
#

S o o n (TM)

#

Life is better when modding API is documented. :D

coarse sinew
#

But sir, didn't they say they were going to change the UI API in B42? You'll have to redo that when it launches.

red tiger
karmic niche
#

I need a pet mod, like a dog you have to take care of but also can die from Zeds

coarse sinew
red tiger
#

It'd be best if the design were remade because the design was a patch-work for over 10 years.

#

Short-term gains but a hell of a development trap long-term.

#

What I want are two things:

  • Full shader API which includes the ability to modify uniform values in real-time and
  • shader support for UI elements.
#

If we can render textures using UI elements and cache inactive / static UI elements the render-times for UI would be insanely better.

#

Wishful thinking though. :D

#

B42's render engine is going to be the biggest surprise of the update. I see a lot of promising things coming for it.

#

🤘

solar rover
# tame raft can someone help me start making pz maps? i know its ALLOT to ask for but i am r...
The Indie Stone Forums

Here you will find a (hopefully) comprehensive guide to map modding using TileZed, from scratch, to uploading to Steam Workshop. Step 1) Installation and setup Spoiler - Download the latest version of TileZed here: https://theindiestone.com/forums/index.php?/forum/64-mapping/ 3 Step 2) Creating a...

thick karma
#

@drifting ore in Steam/steamapps/workshop/content/108600

austere sequoia
#

Does anyone know about a mod that allows me to connect raincollector barrels that are 2 floors above a sink (instead of one)?

solar rover
#

Search Google for Zomboid workshop plumbing, i don't remember the name right off.

austere sequoia
solar rover
#

All I did was read the description, you would have to test it as I've never used it.

"You can transport water from rivers, lakes, wells, rain collectors and deliver it directly to barrels, connect whole houses to restore water"

austere sequoia
#

If anyone has any other Ideas, I still would be thankful 🙂

solar rover
#

Isn't the only difference getting the iso region to know it's a house?

red tiger
#

Doesn't power & plumbing have a general issue with self-built structures in general? The metadata for the map isn't present for things like IsoRooms and connections.

solar rover
#

Honestly i just figured he could use the mod to pipe from roof barrels to a lower barrel, the entire house was a secondary thought on my end.

red tiger
#

Ah okay.

austere sequoia
solar rover
#

Ah, no I've always had to build a platform on each floor and just build sinks and such in the north and west wall so it's hidden from view 😅

austere sequoia
small topaz
#

Hi! Can anyone confirm that those graphic glitches as shown in the screenshot occur for them as well in unmodded games?

#

The gltiches I mean are those white vertical lines you can see in the upper part of the house.

For me, some houses have them while other not. There are similar effects on some furniture sprites for me.

Just asking this here to make sure that this is not called by any modding stuff I am working on...

tiny stirrup
#

I think that's just dirt. I've seen similar stuff on like, parking lot pavement near sidewalks as well.

small topaz
#

hmm.... doesn't really look like dirt or other intentional stuff for me. Especially the marked line on the right hand side looks as if it was part of some canvas like structure (white and grey chessboard).

tiny stirrup
#

Ohhh, sorry, I was looking at the black streaks left of the window

#

That, to me, looks like a misalignment in tiles, maybe a line of alpha at the edge of a tile, or the tile being slid over by one pixel in the image or something.

#

Is that a house that's in vanilla?

#

What is your mod doing?

small topaz
# tiny stirrup Is that a house that's in vanilla?

Yeah, house is in vanilla and this occurs for me without any mod enabled.

The house is in Muldraugh, coordinates: cell: 36,22, square: 10860, 9895

Since I have no mods enabled, I guess it is not a mod issue. However, it might still be that I accidentally changed smth in the vanilla game files while working on my current mod.

The mod I am working on does not change anything about the buildings or sprites. Still mysterious...

tiny stirrup
#

Hmm... I mean, you'd know if you changed those files. They're pretty distinct, with all of a building type's wall segments in a single file, which I assume the game pulls on a coordinate basis as needed.

One of those lines even appears on the Map Project image of that house, in exactly the same spot.

austere sequoia
tiny stirrup
#

Is anyone around who knows how to edit a class (or replace it with an edited one?)

small topaz
tiny stirrup
#

Or... maybe sort of spoof a return to a call a built-in class makes?

#

Yeah, I don't think that's a code thing, more of a graphics editing thing.

drifting ore
thick karma
#

That's where mod files are

#

Each one in a folder named for its Workshop ID number

echo rune
#

Sorry guys, but anyone know how to add a new recipe to a mod folder?

#

I'm trying to add a "make a wand" recipe, but just using a branch and a knife to make a branch (just testing) and the only time it works all the survival recipes disapeared alongside the general recipes and them the game crash

thick karma
#

Most likely you are redeclaring Recipe table and thereby emptying it

#

You don't declare it again because it's global. You just use it

bronze yoke
#

make sure your file recipe file doesn't share a name with a vanilla file

#

all file paths in your mod should be unique unless you are intentionally overwriting a vanilla/other mod's file

sonic ibex
#

Hey would it be difficult to make a mod for footcare as described here? #pz_b42_chat message

So wearing wet socks and shoes could lead to infection on your feet or something?

echo rune
small topaz
bronze yoke
#

(also infections don't do anything in vanilla)