#mod_development

1 messages · Page 339 of 1

open drum
#

it gets stuck on download pending

#

so i suggest those who are planning on uploading the mod today

#

to wait till the problem is fixed.
it's fine on single play but only problematic for dedicated serverss

tawny pendant
#

I need a bit of help, im trying to make a cheat class for personal use, but the SOTO compatibility I added isn't working, cause it's not adding the traits I want it to add. any chance someone could take a look and let me know what could be going wrong? this is for B42 if it makes a difference at all here.

require ("MainCreationMethods")

RRProfessions = {}

function RRProfessions.DoProfessions()
-- REPUBLIC RANGER
local reprangerocc = ProfessionFactory.addProfession("reprangerocc", "Republic Ranger", "icon_reprangerocc", 10);
reprangerocc:addFreeTrait("NightOwl");
reprangerocc:addFreeTrait("Burglar");
reprangerocc:addFreeTrait("Desensitized");
reprangerocc:addFreeTrait("Marksman");
reprangerocc:addFreeTrait("Handy2");
reprangerocc:addFreeTrait("Axeman");

if getActivatedMods():contains("SimpleOverhaulTraitsAndOccupations") then
reprangerocc:addFreeTrait("AdvancedForaging");
reprangerocc:addFreeTrait("BreakinTechnique");
reprangerocc:addFreeTrait("HeavyAxeMyBeloved");
reprangerocc:addFreeTrait("UsedToCorpses");
reprangerocc:addFreeTrait("DemoStrongGrip");
reprangerocc:addFreeTrait("GasManagement");
reprangerocc:addFreeTrait("BladeTools");
reprangerocc:addFreeTrait("MinersEndurance");
reprangerocc:addFreeTrait("ImprovisedCleaning");
reprangerocc:addFreeTrait("PriestSpirit");
reprangerocc:addFreeTrait("EnjoytheRide");
reprangerocc:addFreeTrait("CommDriver");
end
end
Events.OnGameBoot.Add(RRProfessions.DoProfessions);

pulsar pagoda
#

anyone know why if i change the weapon sprite of a firearm it no longer shoots?

autumn bluff
#

how difficult would it be to implement, in lua, a conditional that checks if the character has a specific name?

main pasture
autumn bluff
#

sweet, thanks!

#

just checking, is that gonna work on b42?

bright fog
main pasture
#

I tested it in b42. I used b41 documentation, so they should work the same

bright fog
#

Sorry double slash

#

getActivatedMods():contains("\\SimpleOverhaulTraitsAndOccupations")

#

For B42

muted garnet
#

I don't quite understand, can you please explain in more detail?

edgy notch
#

I'm working on a simple mod (this is my first experience with modding), so i add a challenge to start on brandenburg prison, give the player certain clothes and weapons, so far is working, my question is if there is any way to change the sandbox settings, particularly I want to change the months after the apocalypse option

granite ginkgo
#
        {
            itemType = Base.DaciaHood,

            table install
            {
                recipes = Classic Mechanics,
            }

            table uninstall
            {
                recipes = Classic Mechanics,
            }

            model Default
            {
                file = PapucbodyBase_hood,
                offset = 0.0000 0.0000 0.0000,
                rotate = 90.0000 0.0000 0.0000,
            }

            anim Close
            {
                anim = JDR_HUMVEE_HOOD,
                reverse = TRUE,
                rate = 1.0,
            }

            anim Open
            {
                anim = JDR_HUMVEE_HOOD,
                rate = 1.0,
            }

            anim Closed
            {
                anim = JDR_HUMVEE_HOOD,
                animate = FALSE,
            }

            anim Opened
            {
                anim = JDR_HUMVEE_HOOD,
                reverse = TRUE,
                animate = FALSE,
            }
        }```
#

Is this the right way to assign custom animations of parts when I'm not using the standard ArmatureAction way?

#

Also, here is the def

#
    {
        mesh = vehicles/papuc|Js_Standard_Humvee_Hood,
        shader = vehicle,
        static = FALSE,
                invertX = FALSE,
        scale = 1,
                boneweight = JDR_HUMVEE_HOOD 1.0,
    }```
tranquil kindle
#

HMMW?!

#

I was about to one after my Vodnik

#

Dang you beat me to it

granite ginkgo
#

yeah, but it's not mine, I'm helping a fellow modder who makes clothes to make his first car and his animation system is different

#

I always used the standard armatureaction, he is using custom names for each part

tranquil kindle
#

I do use that single guide about making animated vehicle parts and if you do follow it, it works correctly

#

But yeah.. i do make custom names too

granite ginkgo
#

Man,I'm lost with custom names

tranquil kindle
#

Sadly in my case is usually trial and error untill i figre it out

#

As im only starting on animated vehicles. That would be my 3rd

granite ginkgo
#

I asked him for the obj file so I'm gonna make it my way

pulsar pagoda
#

hey guys could anyone help me with this?

#

it doesnt matter which animation i use, the weapon sprite is the issue

bright fog
#

Uh no

#

Check the modding Discord, people are working on this currently and found fixes

#

The model doesn't matter, you sure those two items are using the same script tho to properly compare ?

pulsar pagoda
#

the only difference is two lines

#

WeaponSprite = Knife, SwingAnim = Handgun,

pulsar pagoda
#

@bright fog

bright fog
#

Tho I'm fairly certain the animation is not what actually defines it to be a gun

#

But here that might be your issue yea

pulsar pagoda
#

so do u have an idea on how to fix the fact that the knife model cant be used to shoot?

#

im thinking maybe using the handgun sprite on code but show the knife model in game

#

i found PrimaryAnimMask in the wiki

#

maybe something like that

bright fog
#

Sadly I don't have your script or can't check it fully

#

Check the firearm guide, might explain some bits regarding that

#

But the model has nothing to do with the shooting

pulsar pagoda
pulsar pagoda
bright fog
bright fog
#

Later maybe

orchid marten
#

is there a function for (visually) updating an inventory after adding an item to it via script? i'm using AddWorldInventoryItem() and it doesn't show the item in the ui until i shift+scroll

bright fog
#

Give me a sec to make sure what it is exactly, you need to trigger an event

#

triggerEvent("OnContainerUpdate")

orchid marten
#

okay, thanks

tranquil kindle
# pulsar pagoda the working one was sprite handgun and swing anim stab

Go to media>Scripts>models.txt or something like that. You're looking for one that has Knife model script you're intrested in. Find it and Copy it into your mod but change it's id to something diffrent, Once you have that use this guide, go to "adding your attachments" and it will show you how to add muzzle attachment to it

ancient grail
tawny pendant
grizzled fulcrum
#

hey if anyone does Java modding, im in the *testing phase for a modloader and friends™. here's some details:

- it's a fork of FabricMC/fabric toolchain but instead for Project Zomboid, since fabric is pretty hardcoded for minecraft. once leaf is installed into the game folder, clients and servers (servers are still a WIP, work for the most part but some features are missing) can download leaf mods through the workshop and when their game is restarted, the mods will be loaded.
- most people writing lua shouldn't be concerned about this yet, because it's only intended for java modding. Think things like engine changes, NPC mods, etc. This is not a lua library. it will be relevant in the future though, as you could for example add some java functionality for npcs, and then allow customisation and modifying further through lua (kind of like an api)
More information is pinned in the discussion thread in the modding discord (https://discord.com/channels/908422782554107904/1379702489250529280) if anyone is curious, or go to the example mod (https://github.com/aoqia194/leaf-example-mod) and do some fun stuff idk
* testing phase only because it's not on the verge of breaking 😂 its decently stable right now

#

I don't usually like to "sell it"/advertise but im pretty sure like 99% of people who do java modding for this game have no idea what I was doing for the past 1.2 years 😂

silent zealot
#

I gave up after 2 minutes of trying to get leaf working at 3am, I'll have a proper go of it.

#

I downloaded installer-1.1.0 from the leaf-installer repo, ran it, and added Zomboid64.exe -debug -pzexeconfig leaf-1.2.0-42.10.0-unstable.30053.json to the zomboid shotcut. When I run that it creates leafloader.txt with one line:

[12:15:30] [INFO] [LeafLoader/GameProvider]: Loading Project Zomboid 42.10.0-unstable.30053 with Leaf Loader 1.2.0

and that's it - Project Zomboid doesn't start up at all.

#

I'm not sure that's the correct way of installing it though

rancid tendon
#

hey folks! anyone have any experience with adding new weather events to pz? perchance a guide or a good mod to learn from?

silent zealot
#

I've got some note son triggering existing weather, but not on adding new stuff - you'd have to figure out if what you want is easy to do via lua or if it's all in the Java code.

#

What sort of weather do you plan to add?

bronze yoke
#

there is some explicit support for modded weather stages (literally a weather stage named 'modded') but i've never seen a mod that uses it or much indication of how it's supposed to work

silver garden
#

Can i request a mod?

#

I need a mod that makes empty caned food store water and can also be boiled by fire
If the water bottle holds about 10 water units the empty canned food should hold 4-5 water units

bright fog
bright fog
neat walrus
#

Hey Sir Doggy Jvla, you around by chance?

bright fog
neat walrus
# bright fog Yea ?

I've had a couple people ask about integrating your infected skins from the last of us infected into my tlou bandits integration, but there's some sort of conflict between your mod and bandits, to my understanding that stops me from just making it traditionally. Any chance I can get your permission to pack the infected clothing items into my bandit integration? w/ credits, ofc.

bright fog
neat walrus
bright fog
#

The B42 version, the compatibility should have been improved

neat walrus
#

ah

bright fog
#

But I still don't get what's the point of bringing the infected clothing into a Bandits addon 😅

neat walrus
#

It was something a few people were asking for. having the infected use bandits ai

bright fog
#

But they would then act human

neat walrus
#

yeah, I couldn't tell you anything beyond what was asked lol

bright fog
#

Imo there's no point to it however, my TLOU mods are fully open source for the most part currently

neat walrus
#

but considering you seem to be working on compatibility of some sort, I'm going to let you handle that

bright fog
#

I'm not working on my TLOU mods anymore

#

My TLOU mods are open source, and locked in open source (meaning if you use any assets, you need to leave those at the very least open source and public)

#

Only requirements is to give credit for any assets used

stiff fiber
#

Does the problem with workhop downloads and updates still persist?

bright fog
#

Also no point asking in every channels

stiff fiber
stiff fiber
bright fog
bright fog
#

It's a Steam issue, not a game issue

stiff fiber
bright fog
#

Steam made changes to their API

#

Fix to servers not updating or downloading mods properly

The issue is caused by the steamclient being outdated.
The fix is simple: replace it with an updated version.

For Linux:
Delete the old steamclient.so.
Copy the new steamclient.so into both:
/serverfiles/
/linux64/

For Windows:
Delete the old steamclient.dll, steamclient64.dll, tier0_s.dll, tier0_s64.dll, vstdlib_s.dll, and vstdlib_s64.dll.
Copy the new ones into:
\serverfiles\

Where do you get the updated files?
Just download and run SteamCMD once (it auto-updates).
Then grab the files from the SteamCMD folder:

Linux: steamcmd/linux64/steamclient.so

Windows: steamcmd/steamclient.dll - steamcmd/steamclient64.dll - steamcmd/tier0_s.dll - steamcmd/tier0_s64.dll - steamcmd/vstdlib_s.dll - steamcmd/vstdlib_s64.dll
Copy and paste them into the correct folders, and that’s it—problem solved.

bright fog
#

@granite valve can you confirm this is the last working version of the fix ?

bright fog
#

It's the last pinned message in the modding DIscord

#

👌

granite valve
#

Can I get a cool role cat_Blush

bright fog
#

Uh, that's not up to me lmao

granite valve
bright fog
#

👌

granite valve
#

These are pre-compiled SteamCMD binaries by me, applicable for windows or linux

bright fog
#

Fix to servers not updating or downloading mods properly

-# Provided by @granite valve
The issue is caused by the steamclient being outdated. The fix is simple: replace it with an updated version.

Linux

Delete the old steamclient.so.
Copy the new steamclient.so into both:
/serverfiles/
/linux64/

Windows

Delete the old steamclient.dll, steamclient64.dll, tier0_s.dll, tier0_s64.dll, vstdlib_s.dll, and vstdlib_s64.dll.
Copy the new ones into:
\serverfiles\

Where do you get the updated files?

The files are uploaded alongside this message, simply download the ones needed for your server OS. Alternatively, you can download them manually by using SteamCMD. Then grabbing the files from the SteamCMD folder:

  • Linux:
steamcmd/
└── linux64/
    └── steamclient.so
  • Windows:
steamcmd/
├── steamclient.dll
├── steamclient64.dll
├── tier0_s.dll
├── tier0_s64.dll
├── vstdlib_s.dll
└── vstdlib_s64.dll

Copy and paste them into the correct folders and your problem should be solved.

granite valve
#

There ya go!

bright fog
#

I'll rewrite that message a bit too

stiff fiber
granite valve
#

I am now forever memorialized

#

oh hi Ben

stiff fiber
#

Wait. Cat?

granite valve
#

LMAO

stiff fiber
#

Hey dude!

bright fog
bright fog
granite valve
#

You can also write in it that I'm available to be DM'd regarding this for help

stiff fiber
#

Especially Dawn of the Dead. God I wish I could have two different versions of the game on PC one Build 41 and one Build 42 so I could play multi again while developing mods on build 42

bright fog
bright fog
granite valve
#

Just be patient

stiff fiber
#

Anyway, thank you both for the answers

#

Looks like my car mod's release will be delayed until this whole thing blows over

#

☹️

granite valve
#

Just full send it

granite valve
#

Majority of servers are now aware of the fix, and my reddit post has gotten a lot of traction

stiff fiber
#

That's good

bright fog
granite valve
stiff fiber
#

I should really learn lua... but ehhh...

bright fog
stiff fiber
#

Thank you!

silver garden
bright fog
#

You can already fill empty tins

silver garden
bright fog
#

Which game version ?

silver garden
#

I'm in build 41.78

#

Is it a thing in 42?

bright fog
#

Idk but I'm fairly certain I remember filling up tin cans when playing

#

In B41

silver garden
#

Well maybe it was not a can

bright fog
silver garden
#

I'm certain

bright fog
#

Or I used a mod

silver garden
#

Ok so lets assume its not really a thing how much time or how hard is it to make such a mod?

bright fog
#

Shouldn't be too hard

#

It most likely doesn't require much

silver garden
#

I mod fallout 4 using xedit and ck
So to mod PZ what should i do?

#

Im asking because really i want this so bad

bright fog
#

You should be able to easily do it yourself

silver garden
#

Ok great but i don't know where to start

bright fog
#

Check the pinned messages to learn how to mod, your mod will either involve scripts or a simple patch from Lua

silver garden
#

If i want to ask about a detail that i don't understand should can i dm you?

bright fog
#

No you ask here or in the modding Discord

silver garden
#

Im not in the moding discord

bright fog
#

Then join it

#

Read the pinned messages

#

Seriously

granite valve
#

click the clan tag Jvla has too, either way

stiff fiber
#

There's a modding discord?

bright fog
#

Read the wiki page regarding modding

bright fog
silver garden
#

Ok

#

Thank you

dreamy crystal
#

@cyan flame have you developed a sheep mod yet?

bright fog
bright fog
#

@sour island this is linked in the wiki page "Uploading mods"

sour island
bright fog
#

This is just to send news about major changes to the modding wiki that might interest modders

red tiger
stiff fiber
open sierra
#

I've placed a mod I am creating in the appropriate location for single player games, but it is not showing up in-game. I believe the file structure and all files are correct, but does anyone have any ideas?

icy sail
#
  1. Where do you place your mod? Exact path
  2. b41/b42?
open sierra
#
  1. C:\users\my_login\Zomboid\mods
  2. b42
rancid tendon
# silent zealot What sort of weather do you plan to add?

apologies but i got totally sidetracked so here i am hours later--in the process of making a trailer for another mod, using the weather debug tools to set scenes really made it apparent to me the kind of interesting atmosphere you can build with certain arrangements of those settings, so i wanted to introduce slightly more variably color-graded storms and also a rare wildfire smog event

silent zealot
#

Ash has done some fancy recolorings

#

And look into the "flare" function

#

It gives a colored tint to the light outside/different tint inside

#

possibly in an area, I'm not sure on that

#

(Assuming B42)

icy sail
bright fog
#

Mod structure wiki page

icy sail
#

Me? 🙂

rancid tendon
#

they're asking those to someone else

bright fog
#

Wait sorry, thought you were asking a question mb

rancid tendon
open sierra
bright fog
icy sail
#

Nope, I'm trying to help @open sierra to find out what's happening with his mod

silent zealot
rancid tendon
#

that may well have been using the debug tools, it's super easy to change the weather in all sorts of ways with the debug tools in game

silent zealot
#

There were much more extreme reshades

rancid tendon
#

you can do pretty extreme ones with the tools in game, you could essentially color the whole screen flat red if you really wanted if i recall

sonic needle
silent zealot
#

One I recall was all desaturated but reds, opthers had very interesting color shifts

#

from the game.

sonic needle
#

oh 1 s

rancid tendon
#

oh these are cool! i assume these are just edited photos though, not in game weather, yeah

sonic needle
#

nope thats ingame

#

0 edit.

rancid tendon
#

oh really??

#

weather debug tools then?

sonic needle
#

no tools.

rancid tendon
#

well that can't be right

#

under what conditions could the first screenshot have occurred in game otherwise lol

icy sail
#

I may be mistaken, but you can recreate admin tool's weather colors via code approx. easily

sonic needle
#

Red Lamp, Kicks off Light. Reshade Preset to Crank it to Pro Grade Color scheme

rancid tendon
sonic needle
#

still in game, you cant rehsade out side of PZ?

#

its binary injection.

silent zealot
#

Reshade is ingame, but with an external tool modifiying the game.

rancid tendon
#

i would consider reshade a tool but whatever we're into pedantry at this point

sonic needle
#

for what pz is, its nowhere near capable in b42 of modern lighting

rancid tendon
silent zealot
#

So it can produce effects that you can't get from screenshot manipulation, since it it working on the rendering instead of an iamge of colored pixels with no context

icy sail
rancid tendon
#

thank you very much! :3

silent zealot
#

From B42 Plumbing Fix by ightja

local function lightja_createtropicalstormtest()
    if isClient() then
        getClimateManager():transmitStopWeather();
    else
        getClimateManager():stopWeatherAndThunder()
    end
    local clim = getWorld():getClimateManager();
    if clim then
        clim:triggerCustomWeatherStage(8,48);
    end
end

8:24 PM]Glytch3r:
to start rain
lua local mgr = getClimateManager() mgr:transmitServerStartRain(0.1); mgr:transmitGenerateWeather(0.1, 1)
to stop
lua local mgr = getClimateManager() if isClient() then mgr:transmitServerStopWeather() mgr:transmitStopWeather() else mgr:stopWeatherAndThunder() end

#

from my notes on weather

sonic needle
#

tuning it correct, reshade's Lovely at what it does

red tiger
#

=)

sonic needle
#

SAI GREY 300 BLACKOUT SBR
Pixel Perfection Conversion

icy sail
#

So, I'm back, @rancid tendon

#

I did some research on climate manager and colors/desaturation:

  1. Ye, it's possible to change colors via code, without admin enabled
  2. It's a bit tricky, not as easy as I thought before
#

Everything you need to do is:

#
local color = ClimateColorInfo.new(1, 0, 0, 1)
local climateManager = getWorld():getClimateManager() -- due to climateManager is a singleton instance getClimateManager() should be the full alias for this, but I'm a bit tired rn to check, mem addresses at tostring() should be identical if so

climateManager:getClimateColor(0):setFinalValue(color) -- to change color 0 is a GLOBAL_LIGHT id, check out ClimateManager javadocs for full const list

climateManager:setDesaturation(1) -- full desaturation, syntax sugar over climateManager:getClimateFloat(0):setFinalValue(1), both works the same
#

But here's a few tricky parts

#
  1. It was surprising for me, but PZ colors are floats for some reasons. So red is not 255, it's 255 / 255, 1 in that case. Same for other colors and alpha
#
  1. You may not change the final value, but Modded and Override one's, but at this point you'll face built-in interpolation issues, but PROBABLY it will give more natural output. Override priority is Modded < Override < Final. Admin values are top priority over all of that but seems to be working only if you have an admin access level (not sure)
#
  1. I've noticed that colors are client-only feature and haven't found any transmit functionality to send colors from the server to clients. Flat climateManager call won't give any results on events such as OnClimateTick. Seems like those are for transmitting weather changes only. But there's a good side out of it - you doesn't have to deal with transmitting at all, it's not needed in this context
bright fog
#

That colors are floats

icy sail
#
  1. For some reasons (I'll do additional research later) it doesn't work on oneshot events like OnCreatePlayer, even if there're client-sided. Screenshot made with OnPlayerUpdate handler engaged. Not sure if it's the most efficient way to implement gfx-related features, but it is what it is
#

That's it. There's a huge chance that my conclusions have some mistakes, it's a result of a short research. Maybe guys with more experience with climateManager will add something here, if needed. Hope I've helped you at least

icy sail
bronze yoke
#

floats are generally used at the actual rendering level

icy sail
#

Ah, and the most important thing I should add - I've tested it on b41. There's a possibility that b42 code will be a bit different

#

Not sure

bright fog
#

Which then the rendering system does the job of using the full color render of your screen or some shit like that ?

icy sail
#

I'm not complaining about floats, it just may look weird for someone unfamiliar with that sort of syntax

icy sail
bright fog
#

That's why I'm not too shocked about it

#

Bcs you're feeding those colors to the rendering system of the climate system at the end of the day

red tiger
#

You can do so much with shaders when using uniforms

icy sail
red tiger
#

You're not limited to what TIS provides for most shader input

red tiger
icy sail
#

Ah. At this point I should mention that I'm not experienced enough in gamedev/rendering stuff, so I may miss some understanding of terminology like that

bright fog
#

Yea dw about it, Jab getting technical 😭

icy sail
#

True, but at the same time heavily time-consuming

red tiger
#

I'm about to get lost in it again

#

Gonna resume writing a html renderer using shaders with a framework.

#

Needed scalable rules and strict OOP personally.

red tiger
azure comet
#

is it possible to make a condition like depression cause wounds to appear on the body?

#

got an idea and i dont want to start having a crack at it if it isnt possible

true nova
azure comet
#

was playing Obenseuer the other day and my dude wouldnt stop trying to kill himself lol

#

gave me the idea

pastel wolf
#

iiiii still could use some assisstance in setting up a loot table, I never quite got it to work

true nova
# pastel wolf iiiii still could use some assisstance in setting up a loot table, I never quite...
    local itemList = {
    "PowerNodes.OrangeExtensionCord",
    "PowerNodes.YellowExtensionCord",
    "PowerNodes.GreenExtensionCord",
    "PowerNodes.RedExtensionCord",
    "PowerNodes.BlueExtensionCord",

    }

    local locations = {
    "DrugShackTools",
    "CrateTools",
    "EngineerTools",
    "FactoryLockers",
    "GarageTools",
    "GigamartTools",
    "JanitorTools",
    "MechanicShelfTools",
    "MetalShopTools",
    "ToolStoreMisc",
    "ToolStoreTools",
    }

    local insert = table.insert
    local list = ProceduralDistributions.list
    
    local function addItems(dist,loot)
        for i = 1, #loot do
            insert(dist,loot[i])
        end
    end
    for _,i in pairs(itemList)do
        for _,x in pairs(locations)do
            addItems(list[x].items,{i,2.0,}) --adds all chances as 2%
        end
    end
#

here is an example from a mod of mine

#

this is really simple since they all have the same roll chances but that can be changed per item

pastel wolf
#

yeah thats completely different than what i had, that's using for loops and stuff huh

true nova
#

if you want to change the roll chance i'd just do it like this instead

#
    local itemList = {
        {"PowerNodes.OrangeExtensionCord",15},
    }

    for _,i in pairs(itemList)do
        for _,x in pairs(locations)do
            addItems(list[x].items,{i[1],i[2],})
        end
    end
pastel wolf
#

i'm just trying to even get my stuff to spawn at all but I think i'm using the wrong naming convention...

true nova
#

show your code

pastel wolf
#

yup, sec

#
require "Items/ProceduralDistributions"

table.insert(SuburbsDistributions["all"]["fridge"].items, "ProFishingRods.ProFishingRod")
table.insert(SuburbsDistributions["all"]["fridge"].items, 4444)
#

i just gave it a wack ass high number to even get it to show up

#

but

#

should I maybe be calling it Base.ProFishingRod?

true nova
#

yes since its in the Base module

pastel wolf
#

Okay, time to see if it shows up in the fridges with lootzed

true nova
#

i wouldn't set it at an extremely high level either

pastel wolf
#

no thats kinda unnessecary thhat was just what i was doing before i realized lootzed would show all possible spawns

true nova
#

thats made thing snot show for me

pastel wolf
#

yeah i got a stack trace on the debug scenario startup

#

lemme fix that too

#

huh

bronze yoke
#

click errors to see the actual error

pastel wolf
#

I have angered the coffee liquour gods... kahlua is mad at me

#

Is this an issue with how im setting up my distribution table?

ancient grail
bronze yoke
#

there is no such table SuburbsDistributions["all"]["fridge"].items

pastel wolf
#

i think the like

#

distribution table maker tool thing i used might be like, busted and old or something

#

would
table.insert(ProceduralDistributions.list["FridgeGeneric"].items, "Base.ProFishingRod")
Be more kosher? maybe i was using the old, wrong format or something

#

ayyy! no stack trace this time

#

so yeah i was using a weird wrong format or something

#

Ayyy there we go! perfect

#

i'll set up the table now, thanks a bunch!

pastel wolf
#

unexpected symbol near a closing bracket?

bronze yoke
#

usually that means the closing bracket is the unexpected symbol

pastel wolf
#

ahah

#

im lacking ;'s after each line i think?

bronze yoke
#

no, semicolons are optional in lua and don't actually do anything at all, most people don't use them

pastel wolf
#

oh! So then I'm not quite getting what's wrong here

#
require "Items/ProceduralDistributions"

table.insert(ProceduralDistributions.list["ArmyHangarTools"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["ArmyHangarTools"].items, 1)

table.insert(ProceduralDistributions.list["ArmySurplusMisc"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["ArmySurplusMisc"].items, )

table.insert(ProceduralDistributions.list["ArmySurplusTools"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["ArmySurplusTools"].items, )

table.insert(ProceduralDistributions.list["BedroomDresser"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["BedroomDresser"].items, 0.03)

table.insert(ProceduralDistributions.list["CrateCamping"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["CrateCamping"].items, 2)
#

i'd post the whole thing but thats how the section i've got so far is set up and that's basically how it all goes

#

but i teleported over to the bait and tackle and despite

table.insert(ProceduralDistributions.list["FishingStoreGear"].items, 3)```
true nova
#

you're not inserting anything at some parts

#

line 8

#

table.insert(ProceduralDistributions.list["ArmySurplusMisc"].items, ) its probably breaking there and so doesnt insert all the other stuff

pastel wolf
#

oh! weird

#

nvm same issue

#

I now know how to read this error message so yay, one less thing for me to pester you all about

grizzled fulcrum
#

in any case, I dont even think thats valid syntax???

bronze yoke
#

it's not, that's why it errors

silent zealot
#

I would like to take this opportunity to express my hatred for tables of multiple data types in sequence where they could have just made a table of tables, or defined a proper object to used. {"base.item", 1.0,"base.item2", 0.5,"base.item3", 2.0} -> {{item="base.item", chance=1.0},{item="base.item2", chance=0.5},{item="base.item3", chance=2.0}}

#

When you're already 5 layers deep in nested tables why avoid going one layer further?

bronze yoke
#

it's just legacy reasons, as it typically is

#

item picker used to be lua so every marginal speed increase counted

#

now it's java and the lua tables aren't even used as is so their format can be whatever it wants to be and it wouldn't really affect anything

#

in fact, your idea is closer to the way java ends up representing them, since there's no real overhead to it there 😅

silent zealot
#

I know there are points where java does the sequence thing too

#

Like when shooting a shotgun, there is a 36 element array to hold pellet information which is why it crashes when you fire too many letts because it writes past the end of the array.

#

Since each pellet needs four numbers.

somber drift
pulsar pagoda
#

hey guys im trying to make a firearm that has no visible muzzle but i need a muzzle attachment so it fires, do you guys know which script calls the muzzle textures so i can replace it with a trasparent png?

sonic needle
muted garnet
#

how to replace the player's walking animation during the game? For example, by pressing a button to switch the player's walking animation to the zombie's walking animation?

silent zealot
silent zealot
#

Try with one first, because there are a lot of separate animations, and you'll have to figure out the way conditions work/how to pass appropriate values to the animation system

#

If you can think of a mod that has conditional overrides you can look at that. In vanilla I know of reloading double barrelshotguns/override for sawnoff to change the visual prop, and holding an umbrella overrides your arm.

#

The Kickscooter/skateborad/bicycle mods would be good to look at too, since they work by holding a "weapon" and changing the animations

silent zealot
#

Good luck! Are you on B41 or B42?

#

If B42, be aware of a bug that requires your animsets to be duplicated and in both the B42 folder AND the B41 folder.

muted garnet
#

b42, thanks

bright fog
#

Check the animnode wiki page

muted garnet
#

@bright fog @silent zealot

please tell me, I'm trying to simply change the walking animation, but the character freezes in place and doesn't move, why is that?

<?xml version="1.0" encoding="utf-8"?>
<animNode>
    <m_Name>defaultWalk</m_Name>
    <m_AnimName>Zombie_Walk</m_AnimName>
    <m_BlendTime>defaultWalkBlendTime</m_BlendTime>
    <m_SpeedScale>defaultWalkSpeedScale</m_SpeedScale>
    <m_Scalar>WalkInjury</m_Scalar>
    <m_Scalar2>WalkSpeed</m_Scalar2>
...
silent zealot
#

Sorry, I don't enough about the animation system to do more than point you in the general direction of solutions. Unless you want to swap weapon models during an animation, which is the very very specific thing I spent time working on.

muted garnet
# bright fog What are those scalars ?

these are the default scalars, i just changed the animation speed and blend time:

Vanilla walk xml:

<?xml version="1.0" encoding="utf-8"?>
<animNode>
    <m_Name>defaultWalk</m_Name>
    <m_AnimName>Bob_Walk</m_AnimName>
    <m_BlendTime>0.20</m_BlendTime>
    <m_SpeedScale>1.04</m_SpeedScale>
    <m_Scalar>WalkInjury</m_Scalar>
    <m_Scalar2>WalkSpeed</m_Scalar2>
#

I want to make the player walk like a zombie, but the player freezes in place

bright fog
#

Wait

#

You modified the vanilla file ?

#

Don't do that

muted garnet
#

yep

#

why not?

bright fog
#

Bcs that's not your goal ?

#

You want to have both animations ?

#

Also there's a few mods that add the ability to the player to walk like a zombie

muted garnet
#

I just tested it but the player gets stuck in place when trying to move forward

muted garnet
bright fog
muted garnet
sour island
#

for i=1, #table, 2 do Embarrassed

silent zealot
#

I'm sure we all have lots of code we look back on and say "what the heck was I doing!"

sour island
#

I should probably change it...

#

For some uses I wanted optional values, so I don't even go by 2... I check if the entry is a string and if the next 2 are numbers 😅

silent zealot
#

for (int i=0;i<table.getSize();++i++) {...}

#

😛

bright fog
#

Wtf

sour island
#
for i=1, #table, do
   if type(table[i]) == "string then
      ---do thing
      if type(table[i+1]) == number then 
         ---do additional thing
      end
      if type(table[i+2]) == number then 
         ---do additional thing
      end
   end
silent zealot
#

oof

sour island
#

I was cooking

silent zealot
#

What about...for (int i=0;i+=2<table.getSize();true) {...}

#

Anyway these are all terrible ideas

bright fog
sour island
#

Forgot to include the fact I was checking if the second 2 values were numbers

#

I won't bother to include that I verified they exist

sour island
#

See: Distributions

silent zealot
#

Questions AI is qualified to answer! Hey ChatGPT, what's the most conusing way to interate through a lua table?

local X = { "a", "b", "c" }

local function z(y)
    local M = { __index = function(_, p) return rawget(y, p) end }
    setmetatable(y, M)
    local Q = {}; for k in pairs(y) do Q[#Q+1] = k end
    local J = 0
    local function W() J = J + 1; return Q[J] end
    while (function() return true end)() do
        local K = W(); if not K then break end
        for _ = 0, 0 do
            (function(V) print((function(H) return H end)(V)) end)(y[K])
        end
    end
end

z(X)
sour island
#

Both confusing and costly.

#

How many function calls are in there lol

silent zealot
#

At least 1.

bright fog
#

Wait you can give a function to the while ?

sour island
#

So obfuscated even the CPU will struggle to read it

ancient grail
frank elbow
bronze yoke
#

you can give any expression that evaluates to a boolean

frank elbow
#

I think it can be any type, coerced into a boolean

bronze yoke
#

ah yeah, what i meant was 'any expression the result of which can be evaluated to a boolean' but that wasn't really clear

#

which come to think of it is literally every expression so i guess it's a meaningless qualifier 😅

sour island
#

I told chatGPT that was my first code ever written and to tell me what it thinks, it comforted me and said it was really 'creative' and impressive for a first code, but that I should consider not doing that.

agile vigil
#

Animal trapping and food spoilage tooltip additions coming soon, to a B42 installation near you!

But for real, though, anyone know how I can achieve automatic line breaks in inventory item Tooltips?

I have an annoying bug (see last image), and I'm not sure how to resolve it.

sour island
# agile vigil

in B42 they added linewrapping (I faintly recall) prior to that you had to write your own

agile vigil
sour island
#

TextManager:WrapText

agile vigil
#

Will check it out, gimme a sec.

sour island
#

To clarify, they added this, sorry.

#

If that doesn't work I use this for Skill Recovery Journal - I don't remember why I don't use the textManager one...

local function wrapWarningMessages(warningMessage, fontType, maxWidth)
    local warningWidth = getTextManager():MeasureStringX(fontType, warningMessage)
    if warningWidth > maxWidth then
        local words = warningMessage:gmatch("%S+")
        local rebuilt, currentLine = "", ""
        for word in words do
            local currentLineWidth = getTextManager():MeasureStringX(fontType, currentLine)
            local wordWidth = getTextManager():MeasureStringX(fontType, word)
            local inBetween = ((wordWidth+currentLineWidth > maxWidth) and "\n") or (currentLineWidth>0 and " ") or ""
            currentLine = currentLine..inBetween..word
            rebuilt = rebuilt..inBetween..word
            if inBetween == "\n" then currentLine = word end
        end
        warningMessage = rebuilt
    end
    return warningMessage
end
#

I should have left a comment...

agile vigil
#

MeasureStringX used to be the B41 strategy I saw a lot of folks using, and then they just re-sized the tooltip width.

#

This might also let me put all the catchables in a single line, similar to the zone tooltip 🤔

sour island
#

I mean... ok but that looks ugly 🗿 (to make the tooltip massive)

agile vigil
#

Oh yeah, making it super wide is ugg 😄

sour island
#

I'm sure what I wrote isn't the most efficient - idk

agile vigil
#

Lmao, I haven't stolen code from Skill Recovery Journal since B42's release, so I don't even have it subscribed..

bronze yoke
#

i'm not entirely sure how you're adding to the tooltip, but the way starlit does it just works

#

i never had to add any code to handle things like this

sour island
#

For wrapping text?

bronze yoke
#

the tooltip handles it automatically, i think it just extends it to fit

sour island
#

Yeah, I think he's rendering over the tooltip and dropping it's height down-- if you add it to the tooltip it will extend to fit, but it's also ugly for it to be so wide.

#

This isn't that much space though

#

Depends how long these sentences can get I suppose

agile vigil
#

I'm rendering over the tooltip so I can get perfect match with regards to padding etc.

It works on all font sizes and UI scales I've tested so far, just need to fix line breaks.

sour island
#

And you've tried to just add it to the tooltip's text directly too?

agile vigil
#

Probably laugh

Haven't touched the code for a bit, so I could've done all sorts of things back when I started this.

#

I am adding directly to the text for the zone tooltip, but I don't recall a way to do that for inventory items, there was always some blocker with Java code iirc.

sour island
#

They may have tweaked it but I think you can just apply a tooltip to the item itself?

agile vigil
#

That didn't give a very nice visual result iirc.

#

Or maybe overwrote some of the default stuff?

sour island
#

In it's item script - or dynamically

#

Yeah if there's vanilla stuff there, you may have to modify the dynamic addition

#

Probably nuked the fishing line?

agile vigil
#

Okay, the text manager approach works, but I gotta check how many lines it outputs 😄

bronze yoke
sour island
bronze yoke
#

i don't think that happens anymore iirc

agile vigil
sour island
agile vigil
# sour island Are you measuring the font height already?

Yeah, I have all the height info I need here:

    local unmodified_height = nil;
    local line_spacing = self.tooltip:getLineSpacing();
    local original_setHeight = self.setHeight;
    self.setHeight = function(self, height, ...)
        unmodified_height = height;
        return original_setHeight(self, height + #lines * line_spacing, ...);
    end
#

But I normally arrange my data on a per-line basis, so when a single line breaks over, I need to adjust.

sour island
#

If you do: getTextManager():MeasureStringY(fontType, currentLine) it will return the height of the string, including linebreaks

#

But honestly, check out starlib 😅

#

We need to start using these libraries more often

agile vigil
#

I'll make it work on my own, then check the lib to see if it has any issues 😄

This is all working now, assuming my new way of measuring height works.

#

Yeee, I got it working.

#

Also missed opportunity to name Starlit Library as Starlib sad

#

This is gucci.

#
-- because we no longer call the original function, this may affect mod compatibility
-- there isn't really any way to avoid that though

This comment in Starlit Library (and many other mods doing similar things when making custom tooltips) is why I went with a custom approach.

bronze yoke
#

a big benefit to the library is that mods that use it are compatible, where multiple mods doing the same thing couldn't be

agile vigil
#

I wrote my approach while running code from a few other tooltip mods originally, exactly so I didn't break cross-mod compatibility and other approaches.

#

So it works fine with Starlit, for example.

#

(Starlit looks perfect in the tooltip by the way, sorry for being antagonistic and vague with what might've been why I didn't select it earlier when I wrote the start of this mod)

bronze yoke
#

no it's cool, there were actually a lot of visual issues in early versions of that module like the one you pointed out

#

fwiw the theoretical mod incompatibility here is incredibly niche but i left that comment so that i don't forget and get confused in the tiny chance that it actually happens

agile vigil
#

And I wasn't compatible with Eris' Food Expiry mod, which is why I added my own spin on it, so I don't really have a perfect solution either.

#

Might just swap to Starlit tbh, Chuck is right. We should use libraries more often, if I have an issue, I should forward a fix.

#

Think Starlit needs linebreak support laugh

bronze yoke
#

oh, it doesn't extend the vanilla parts of the tooltip? i thought i'd fixed that

sour island
#

Try running it into manager:wrap line ?

#

No it extends - he wants it not to

bronze yoke
#

you can see the vanilla parts of the tooltip are still right-aligned as if the new line wasn't there though

#

not that that's really undesirable here but it's undesirable in some more reasonable cases and i thought it'd got it to stop doing that

#

maybe it just doesn't care about labels

#

that would be fine

sour island
#

Oh, I think we're talking about different things

#

Wrapping the line is more desirable though imo

bronze yoke
#

i agree, not sure if i want to make it mandatory though (and any optional api i could add would be the same as just calling WrapText)

#

but when it's key-values like vanilla tooltips mostly are, there isn't really an option whether or not to wrap so width needs to match

sour island
#

Yeah, that makes sense. But if he's adding tooltips dynamically already - he can just call wrap text then? I think it manipulates the string-- and if it doesn't that's probably why I still use mine...

#

Do you know how firing off code in the console works? I have very little experience doing that as I usually write in feature or events for this but I need to spitball code faster

bronze yoke
#

what do you want to know about it exactly?

sour island
#

Oh it is working, I just didn't have anything returning to compare 😅

#

The output is also hard to parse as it includes the inputted lua

bronze yoke
#

yeah it's a little annoying 😅

#

the only unintuitive thing to keep in mind about it is that unlike most interactive interpreters, everything you input is considered a new chunk (equivalent to a file) so locals only exist for that one entry

#

but obviously there's not nearly as much risk to using globals

sour island
#

Yeah, I'm just trying out differnt ideas for something

#

The console is still java based or is it UXI now?

bronze yoke
#

it's still java based

sour island
#

and the text input is still broken for long texts

bronze yoke
#

XUI is only used for printed media and some newer debug menus

sour island
#

so making a lua interpreter wouldn't be feasible

bronze yoke
sour island
bronze yoke
#

the character limit seems intentional but there's no obvious reason for it and copy-pasting longer text gets past it and works fine

sour island
#

Yeah that's the other issue too

bronze yoke
sour island
#

Thats true.. I don't really need to display it

#

I also wanted to revisit Aiteron's file reloader to setup successive or chained reloads to better handle modulized code

bronze yoke
#

it's weird, the game seems to have some code specifically to make reloading modules work properly, but it... doesn't

sour island
#

I've gotten into the habbit of doing it manually

bronze yoke
#

and they don't even use modules so i can't imagine why they even thought to try

sour island
#

it's fairly annoying 😅

#

anything related to context menus usually breaks anyway

#

but you have to almost work backwards from execution - which kind of helps understand the code better

#

But yeah, I have an idea to make the reloader have a drag and drop to form routines(?) I guess I can call them

terse delta
lapis moth
#

no it should be 20.90000000000000000000001

#

🤣

sonic needle
muted garnet
#

and what should be done in this case?

hollow raven
#

Hi! Haven't been doing models for zomboid for a while. Any tips why those models may have those "holes"? My first thoughts was that it may be wrong facing, but in blender everything is ok, all textures are facing outside. Textures are also full Opaque, max alpha. I was doing those in 41 build, and they were working just fine, so my guess is it is something that changed in 42.

tranquil kindle
hollow raven
tranquil kindle
#

You can select all faces in edit mode and "triangulate" them

#

Easiest way

#

Thought in some rare cases it might change shading, so then i'd reset all vectors in normals

hollow raven
tranquil reef
#

What could be making only some specific .lua files not load by a mod

#

Is there a script amount limit or something?

bronze yoke
#

there's nothing like that

#

the files could be in the wrong folder or not using the .lua extension

#

other than that it should always try to load every lua file in a mod

tranquil reef
#

That's what I thought. It was fixed when I deleted the emojis I had though PensiveCowboy

tranquil reef
#

is this the proper way to do this

bronze yoke
#

looks good

wet sandal
#

I'm sitting here staring at the java docs for RoomDefs asking myself
"Why are these things 4D"

#

It took me 20m to realize the W stands for width

red tiger
red tiger
#

=)

tranquil reef
red tiger
tranquil reef
#

I didn't realize visual studio would give me info errors without having any point of reference towards what's wrong. no wonder

tranquil reef
red tiger
tranquil reef
#

Oh, didn't realize it was per project

#

Anyway thank you. Now that I know it's not just broken, I hate it ever so slightly less lol

craggy delta
#

is there any way to figure out why my mod shows a red x on the mod menu? I can't figure out what is wrong

bronze yoke
sonic needle
thin swan
#

Has anyone messed around with building on z 1 while being on z 0?
Having this annoying bug when I build a roof on a room but it doesn't hide the roof when entering. (vid 1)

If I build the roof while on the same z level as I'm building on, then it works fine and sometimes fixes other roofs that were glitched. (vid 2)

If I reload the save it works, and sometimes (like 30%) if I build stairs to go up one z level, and then go back down it will fix a glitched roof, but most often it doesn't and only reloading or rebuilding it will fix it.

I tried:

  • Setting the z 1 squares as seen after creating them
  • Setting "ConnectedToStairstrue" = true in the squares mod data
  • cell:ConnectNewSquare(sq, true);
  • sq:RecalcAllWithNeighbours(true);
bright fog
#

There's an addon for the Build Menu mod in B41 to build roof from the floor below

#

Check it out maybe

thin swan
thin swan
# bright fog Looks to me like you're probably using the wrong method for that

I tried to make it as similar to vanilla build as possible:

                        local above = base:getSquareAbove() or cell:createNewGridSquare(x, y, z+1, true)
                        local newCeiling = ISBuildIsoEntity:new(pzPlayer, objectInfo, 1, containers, BuildLogic.new(pzPlayer, nil, nil))
                        getCell():setDrag(newCeiling, 0)
                        newCeiling.player = 0
                        newCeiling.Type = "fishingNet"
                        newCeiling.maxTime = 1
                        newCeiling:tryBuild(above:getX(), above:getY(), above:getZ())

Figured that would minimize issues, but nope lol

mellow frigate
#

If you are using the later, you'll need to be in a room for the ceiling to be hidden.

#

You can check the room integrity with the dedicated debug menu. (dev > IsoRegions)

#

build Roof mod will not help you for this, but Architect mod will as it looks a lot like what you are doing.

mellow frigate
shy mantle
#

how does the new, ignoreZombieDensity = true/false, work? Does it just increase the rolls rolled for loot to spawn?

bronze yoke
#

loot spawn chances are usually modified by the spawnrate of zombies in that area, you can use that to disable that

hybrid edge
#

How hard would it be to make a mod that adds a single webbing attachment to Chest rig and tarp Chest rig

tranquil kindle
#

It's easy when you know what/how to do it

#

Sadly there is not a single guide about adding attachment slots to clothing

#

At least not any i know of.

#

I do know how to make it, but my first 3 mods with it were trial and error kind of thing

#

@hybrid edge

thin swan
# mellow frigate map buildings are VERY different from tiles built by the player.

I basically just made a copy of the wooden floor script, but using the "ceilings_01_0" sprite instead, but I don't actually check for rooms, I just use specific sprite names to check for walls that connect to form boxes (the mod is for disassembling/reassembling those big military field tents), so no need for a lot of complexity.

Then I grab all the squares inside the box, create new squares on the z level above them, and then just use the same build function that DoTileBuilding uses to place the roof (which is technically a floor), which is what's used in the vanilla build menu in b42 as far as I can tell, so it should just behave like building directly from the menu.

So it's not really sophisticated at all haha, just annoying that it almost works 😭

crystal canyon
#

which file dictates animal spawns?

hybrid edge
tranquil kindle
#

I might do guide about it, but not anytime soon as i'm stretched thing across multiple projects

tight elm
#

<@&671452400221159444>

pulsar pagoda
#

hey do you guys have any idea how to make an ammo-less firearm? meaning that it can shoot without bullets?

flint parcel
#

trying to do something very specific, anyone happen to know how to get this to um... work ?

#

or where i should look for reference

bronze yoke
#

in this case you're probably looking for setSpentRoundCount

sturdy salmon
#

Good evening. Is there any way to obtain and find out what information is stored in the database, in the binary field? I've seen that items, skills, and character status are stored there, but I'd like to know if I can obtain all the information and, more specifically, if it can be modified from Lua and re-stored/updated.

bronze yoke
#

it cannot be accessed from lua

sturdy salmon
#

Is it known if they'll continue adding hooks?
Sometimes I feel like I need a little more freedom to achieve certain results.

#

Will we continue working in Java? Should I suggest using another language someday?

#

Switching languages probably won't be easy, especially if all developers are familiar with the current language. However, due to player limitations—I've seen that it's currently 32 in 41.78.16 (I don't know if the limit will increase in 42)—and also given the high performance of the servers, especially memory requirements, I was curious to know if there was an attempt at some point to migrate to another language.

bronze yoke
#

i wouldn't expect them to ever do something like that

#

limited parts of the game are already written in c++ for better performance though

sturdy salmon
#

In World of Warcraft, C++, Lua, and SQL are used. Lua can be done on the client, but also on the server. And with the same resources, I can have 500 to 1,000 players, but I couldn't do it here. In fact, I have a scheduled task to reboot the machine twice a day to free up resources.

#

I hope they add MySQL, so I can have some tables, and be able to add certain information to them.

#

Is it possible to "suggest" modifications to event invocations? For example, the OnExitVehicle event fires after the player exits the vehicle. So, if we want to access the vehicle, we no longer have that information. We would only need to modify the location where it is invoked, moving it one or two lines higher (before the player exits).

#

Can these types of changes be discussed and asked to be taken into account or do we have to overwrite the files/methods?

bronze yoke
pulsar pagoda
#

could someone please help me with this? im trying to make it so if you have "ThrownHuntingKnife" equiped then the bullet context menu doesnt show up

drifting ore
#

I keep getting an error that crashes my game when I start it with my mod.

It's supposed to be a simple mod that allows the creation of nails from scrap.

pulsar pagoda
drifting ore
#

kk

#

This is the only error I'm getting that seems at all related to my mod.

drifting ore
pulsar pagoda
#

im not to bright but maybe i find something

tranquil reef
#

Is there a list of fluid color options that aren't already used by fluids in-game?

drifting ore
#

I looked at the "Make Clay" mod and used it as a template. And it was working before, but then when I made my copy and then made my own mod on top of it it failed.

drifting ore
pulsar pagoda
#

can you think of any recipes that use scrap metal? you can look at those aswell for reference

simple wraith
#

Could someone tell me how to put a container in a building and have it have specific loot with 100% spawn rate and the specific amount of each one?

pulsar pagoda
#

in yours it says

#

item 1 tags[Base.SmallSheetMetal

#

chat gpt says it shouldnt have the tags line before the sheet metal

#

could be that

simple wraith
#

I have the building and everything created, but if I add a container with a new property, I don't see it. Is there a way to add an existing container but still specify the above question?

drifting ore
#

Lemme try that!

pulsar pagoda
#

alrighty

drifting ore
#

I saw it somewhere in a mod like more guns and smokes.

#

I copied that method and was able to use it to add random stuff. I think you just need to define the correct location.

lunar island
#

hey guys, i need help

#

I'm having a crash problem with my game, where it shows the following error in the console

LOG : General f:0, t:1752712714428> ERROR: IntegerConfigOption.setValue() "MaximumRatIndex" 100 is greater than max=50
LOG : General f:0, t:1752712714432> ERROR: IntegerConfigOption.setValue() "MaximumRatIndex" 100 is greater than max=50
Any idea which mod messes with something related to rats in the game?

queen oasis
pulsar pagoda
#

anybody see the issue?

drifting ore
bright fog
#

Also check the wiki page for Lua API if you haven't yet

craggy delta
#

So I know I can do this to get an item by name, where k is the item name
ScriptManager.instance:getItem(k)

Does anyone happen to know a similar for craftingRecipes? to be able to get by name?

thin swan
#

Oh wait, this is for building stuff using just the sprite name

craggy delta
#

you have the right idea.. but I don't think I need to go through sprite config to get a recipe.. I think there has to be a more direct way

thin swan
#

For crafting you should just need to do ScriptManager.instance:getCraftRecipe("name of recipe")

#

ah but you're trying to get the craft recipe from the resulted item?

craggy delta
#

that is what I thought too.. but that gives nil

thin swan
#

Hmm

craggy delta
thin swan
#

I guess first I should ask if you're on b41 or b42?

craggy delta
#

42

#

I am building an api for modders.. to make it easier to edit base game things without all the overloading.. I have it working for items.. if I can find a reliable way to get craftRecipe by name I should be able to the same thing for craft recipes too

thin swan
#

This is working for me: local craftRecipe = ScriptManager.instance:getCraftRecipe("WeaveCloth")
It gives the correct result when I test

bright fog
#

Overloading ?

#

You don't need any of that, the game already provides the tools for modders to modify existing scripts without a complete rewrite

#

Also you can retrieve craftRecipe in B42

#

You can find the functions in the Java docs

craggy delta
bright fog
#

You don't know about the JavaDocs ...?

#

Wait how did you manage to make anything in your API ? 😭

craggy delta
# bright fog Overloading ?

say I want to change the craft time of a recipe or the display category of an item.. I have to create a .txt and overload that item or recipe with the new value.

bright fog
#

You don't need to do that

craggy delta
#

reading mods on the workshop.. same as any other game really.. didn't expect docs lol

bright fog
bright fog
craggy delta
#

yea, this is basically what I have done for items

bright fog
craggy delta
#

so to change the display name I just need to

ModderAPI.Items.updateProperty("Item", "DisplayCategory", "New Cateogry")

craggy delta
craggy delta
bright fog
#

I would simplify the whole thing

craggy delta
bright fog
#

Aaah the first string is the item id nvm

bright fog
craggy delta
#

yes

#

the one used to declare the item.. not what you see ingame

#

I am learning lua.. so yea, my structure is probably weird.. I appreciate the feedback

#

my goal was to build out as such

ModderAPI.Items.updateProperty()
ModderAPI.Items.appendCategory()
ModderAPI.Items.appendTag()
ModderAPI.CraftRecipe.updateProperty()```
#

I am thinking in an oo structure and that probably doesn't fit lua

#

this way.. after you have built out your stack of mods, say you want to to change on little detail or two about some of them.. this will allow you to also update things added by other mods too

#

I have the first 3 working and tested.. I was trying to start doing recipes next.. this has been a huge help!

bronze yoke
#

fwiw not sure why you couldn't find examples of mods already doing this, using the script manager to modify items is extremely common already

craggy delta
bronze yoke
#

there was actually already a library mod to do this that we had to yell at everyone to stop using because of its poor implementation 😅

craggy delta
#

what was bad about its implementation?

#

so I don't fall into the same trap

bronze yoke
#

it printed every 'tweak' it made, but prints are insanely expensive in pz so this significantly impacted startup time

#

a server host i knew removed the print locally and found it improved start up times by around 9 seconds

craggy delta
#

yes, I think I found that.. but that is not what I am doing

#

I am gathering all 'tweaks' together.. then loop through the tweaks, call each item and applying them

#

the to append functions take into consideration that category and tag are semicolon delimited lists.. so instead of treating the list as a single string.. it allows you to add a new to the end of said string

#

so that appending won't overload other mods also trying to add a tag

bright fog
craggy delta
torn igloo
#

So I hav this itemcontainer, how do I get the item object of this itemcontainer?

lapis moth
#

getItems

craggy delta
#

object = ScriptManager:getItem("id of container")

bronze yoke
#

container:getContainingItem()

amber crown
#

Im getting into modding however i know some lua since before. I was just wondering if theres any good documentation on (custom) Ui. I checked the github doc but i dont believe its added there yet (might be wrong)

bright fog
#

That's the best UI guide you can find rn

amber crown
#

Haha might have been completely off

bright fog
#

Also check the wiki, tho rn the wiki doesn't cover UI stuff for now

bronze yoke
#

fenris's guide is pretty good but a little old

bright fog
#

Yea

amber crown
#

Alright thank you

bright fog
#

Most stuff you can find in his guide can be found on the wiki now

#

In an updated format with updated informations

normal belfry
#

trying to just make a little mod for me and friends, using the base biker leather jacket

bright fog
normal belfry
#

hell yeah! thank you!

normal belfry
#

haha i cant figure it out. everytime i boot up PZ and then enable the mod the main menu goes away and doesnt come back

thin swan
bronze yoke
#

if you solve this please let me know, i have a persistent similar issue with one of my mods

#

i've investigated it enough to the point of giving up so someone else finding the solution is my only hope 😅

thin swan
#

Haha well shit, that doesn't give me a lot of hope 😂 But I'll poke around and try some shit

bronze yoke
#

if you don't already, you should call square:invalidateRenderChunkLevel(FBORenderChunk.DIRTY_OBJECT_ADD) on the square you add the object to

#

my issue is not exactly the same so it's likely that things i've already tried might work for you

thin swan
finite scroll
#

Сan anyone explain how zomboid's "ticks" work? I've seen some people say it's a fixed rate based off real time, some people say it's each frame, and some people say it's fixed rate based off ingame time so now I just don't even know what to think.

bronze yoke
#

it's every frame

#

there are some very specific systems that have their own tickrates but 'tick' in general is synonymous with frame

finite scroll
#

gotcha, thanks!

#

what system, then, do moodle use to keep their change at a consistent pace? is it based off ingame time or maybe some deltatime variable done each frame?

bronze yoke
#

it's deltatime yeah

finite scroll
#

gotcha

#

is that exposed to lua?

bronze yoke
#

yeah, the GameTime class has about a billion 'multipliers' which are deltas in slightly different formats

finite scroll
#

alright, i'll look into that

bronze yoke
finite scroll
#

great, thanks!

gloomy hatch
#

This is a question for those with experience in PZ modding.

Let’s say I wanted to make my own road texture. In simple step by step terms, how would I:

  1. Find the road texture/textures (where is it located?).
  2. After editing the texture, how would I upload it as a workshop mod?

So, how would I find the texture -> upload new replacement texture as a mod on steam workshop?

This should be as simple as it gets, right?

bright fog
fiery bough
#

Hey everyone!

I’ve created a custom vehicle mod for Build 42 — a drivable Ford F150 Raptor SVT. The model works fine in-game, but for some reason, the textures are not loading — the truck appears only as a black shadow, or invisible in the editor. No errors are thrown during the script load, but the console gives me this:

ERROR: model texture "vehicles/Vehicles_FordF150.png" wasn't found

However, the texture does exist at this path:
FordF150/42/media/textures/vehicles/Vehicles_FordF150.png

Here’s a portion of my mod setup:

mod.info

name=Ford F150 Raptor SVT
id=FordF150
description=Adds a drivable Ford F150 Raptor (Build 42)
poster=poster.png
version=1.0

(FordF150\42\media\scripts\vehicles\f150raptor.txt)
Script (f150raptor.txt):
module Base
{
model FordF150Base
{
mesh = vehicles/Vehicles_FordF150_body,
shader = vehicle,
invertX = FALSE,
scale = 1,
}
model FordF150frontwheelleft
{
mesh = vehicles/Vehicles_FordF150_wheel,
texture = vehicles/Vehicles_FordF150.png,
shader = vehiclewheel,
}
...
}

tranquil kindle
#

You didn't show that part, or my phone is playing tricks on me

fiery bough
#

to make everything work in game

faint lichen
#

is it possible to check which seat of a vehicle the player is on through lua?

faint lichen
#

Looks good to me

#

Thanks

tranquil kindle
main pasture
#

Maybe test without file extensions in the texture paths?

tranquil kindle
# fiery bough yep

So either your texture has a typo, or the fact that some of your paths start with small letter "vehicle" and some with capital letter, or what Tunes said.

main pasture
#

Yeah maybe check the paths because I think the models should load even if the textures can't be found (the shadow is defined separately so it doesn't correlate with the model)

red tiger
#

I've sat on deciding to rewrite / revise / upgrade Kahlua for nearly four years. I feel like this might be my next project.

#

If I do I'd upgrade the version of Lua to 5.4 and probably support Luau type syntax.

#

The main thing holding me back was not knowing if TheIndieStone would adopt forks and fixes to their 3rd party libraries.

#

Honestly if the upgrades are good enough, I'd imagine they would. Worst case people could patch the game.

#

Thought I'd post this here in-case anyone finds interest in such a project.

#

@grizzled fulcrum

#

Thought I'd tag ya because it would be possibly relevant to your Java adventures.

drifting ore
#

Where can I find a guide for making item in build 42?

#

I'm trying to port an abandoned mod from B40 to B42.

fair wigeon
#

I hope this sound less stupid then it does to me right now but i wanted to ask if anyone has any idea where the crop trample is being handled if a car/trailer drives over it, specifically how i can prevent it, is it a separate thing to zombie trampling or are both the "same". I've gotten a little frustrated since it is the only thing preventing me from finalizing my tractor gx_pain^

found the respective .class, decompiled, set nocropkill to true and recompiled now cars wont kill my crops praygeshine

fiery bough
grizzled fulcrum
low nexus
#

Greetings!
Is there anyone who tried to create a custom generator mod or similar? I've got some questions, or maybe ideas, and I'd like to find someone to share thoughts and collaborate about it?

crystal idol
#

Hi, I've been playing for years and I always have the same problem in multiplayer: hoarding players who stop playing and lose valuable items in their inventories. That's why I would like to make a mod to COPY VHS tapes.

  1. Create the audio and video cable item so it can be found or crafted.
  2. 2 TVs that can play VHS tapes.
  3. Add a high-speed tape sound.
  4. Set a crafting time.
  5. Click on the source VHS tape and have the recipe select a destination VHS tape from the inventory, similar to the materials list when you turn on an old-fashioned stove.

I do know how to solve those points. My problem is that I've never understood what the item ID of a VHS tape is. Can anyone help me with this?

  1. Obtain the source VHS tape ID.
  2. Duplicate it without the game crashing or triggering an anti-cheat due to duplicating the item
viral spire
#

How tough is it to create new animation sets for zombies/players? I haven't done animations in years, but I'd like to play around with zombie AnimSets and try to attempt a mod that makes them sprint more like the Infected from 28 Days Later.

bright fog
bronze yoke
#

it's no harder than the basic difficulty of creating animations

bright fog
#

If yes, that can take a while but it's definitely doable

bronze yoke
#

you probably won't need to touch the animsets at all so there isn't much you'd need to change on the game side

bright fog
#

Possibly not yea

#

Maybe the animation speed tho

viral spire
#

Most animations would probably have to be altered, as well as speeds.

The Infected are pretty twitchy and sporadic even when idle, except maybe when resting (Church Bois).

Plus, the idea of making noise and the Infected just snapping in my general direction would instill such fear in me.

#

Definitely curious if multiple animation speeds are possible to mimic that some Infected are faster or slower than others.

bright fog
#

Would basically be like my TLOU Infected but 28 YL version

bronze yoke
bright fog
#

Yea there's already variations but the game switches between the various variations

#

So you can't use the default system for that

#

Unless you want an infected to constantly switch speed

viral spire
viral spire
bright fog
bright fog
viral spire
#

Still great with what's there, either way.

bright fog
#

But you can redefine the animsets to use a variable for speed that then can be set

#

That way you can set how fast individual infected are when loading in the world

#

Only person I know that did that was Glytcher, and maybe Slayer too

#

This should have sandbox options to set the speed of the goose using that system

#

And you could easily use it

modest oak
#

theres are 100% the zombie sounds? nothing hidden away elsewhere?

bright fog
modest oak
#

D:\steam\steamapps\common\ProjectZomboid\media\sound

#

just making sure since i wanna replace the male sounds and the way its set up in the script .txt makes the file format look different

bright fog
#

These are not the sounds used by zombies

modest oak
#

flip!

bright fog
#

The zombie sounds are located inside bank files

bright fog
#

And to replace zombie sounds, you have to replace the entire bank files, which you mean you have to unpack the bank file, modify the sounds, then repack the whole thing again and upload literally every single sounds of the game and your sounds that are in the bank file

modest oak
#

tragic

#

only options now are disabling the groans which makes it dead silent or just deal with the generic zombie groans map_facesad

main pasture
gloomy hatch
#

Anyone know why it’s doing this? (I’m on Linux, with a steam deck)

fiery bough
#

how can i fix that?

main pasture
#

Not sure if it causes issues, but you don't need the "texture" in "model FordF150Base"

rain dock
#

If only there was a mod that allowed a matching knob and key set into a box.... If only I knew anything about this process.. I could finally lock my front door.

bright fog
rain dock
bright fog
#

You could do two crafts, one to have a key fit a door knob, and another one to have a door knob fit a key

rain dock
#

I wouldn't even begin to understand the process

bright fog
tranquil kindle
# fiery bough \

He meant to remove this

 model FordF150Base
    {
        mesh = vehicles/Vehicles_FordF150_body,
texture = vehicles/Vehicles_FordF150.png,  ---right here.
        shader = vehicle,
        invertX = FALSE,
        scale = 1,
    }

Also does it still give you error?

#

Previously you had not even checkered texture, now you do

autumn bluff
#

playerObj:remove("SmirkStuff.Hat_Name")

whats the correct method for deleting a worn item in b42, under this context?

#

also
local playerObj = getSpecificPlayer(playerIndex)

finite scroll
#

i tested b41 and b42 and both always returned exactly 48/fps (0.8 at 60fps) with no scaling based on day length

#

the only one i tested that seemed to scale at all was getGameWorldSecondsSinceLastUpdate()

bronze yoke
#

that seems correct yes, not sure how i got those results

#

i checked some places i remembered getMultiplier being used and they have additional explicit handling for day length

#

from a quick read of the code it also looks like getTimeDelta should be 1/s, not 1/m

#

thanks for pointing that out, sorry if it wasted much of your time 😅

tranquil kindle
# fiery bough

Now you need to repair it . Since you lack masks for damage ect.

bright fog
#

<@&671452400221159444>

#

Isn't it always the same freaking images ?

#

Like, they use media links, so couldn't that be used to possibly detect them ?

#

Do they use the same media links everytime ?

supple briar
#

I’d imagine they have like 3 or 4 different ones they rotate

bright fog
supple briar
#

In theory, though I wouldn’t be shocked if the links themselves are some sort of IP grabber or something

finite dune
supple briar
bright fog
#

Those are not external links

#

Those are Discord media links

#

If you post an image, then right click it and copy the link, you can share that same media elsewhere

supple briar
#

Ah I thought they were external embeds

bright fog
#

And it's not like you're reposting the image

bright fog
#

So the message content doesn't show the Discord media link ?

#

Bcs technically you don't need to check the attachment itself, only the message that links those images possibly

supple briar
#

Shame seeing how many people get got by those scam DMs and have their accounts stolen

finite dune
#

There is no text to the message, it's basically an empty string with attachment objects, and automod can't look at those attachment objects, and we can't filter out empty strings

bright fog
supple briar
bright fog
supple briar
#

That account that just posted had been here since 2022, but only had 4 posts

#

I find that kinda interesting

bright fog
#

Usually it's poorly secured accounts

#

I got a friend who got hacked back to back multiple times, his Discord account and Steam account

#

Bcs that idiot didn't activate the 2fa

#

Like he got his Steam account hacked twice in a week I believe lol

supple briar
#

This, friends, is why you don’t click sus links

bright fog
#

Or just activate your fucking 2fa lmao

#

So inactive accounts getting hacked, not being used a lot, I'm not too surprised, since it's very likely those aren't properly secured

supple briar
#

I do that for steam but I refuse to give anything else my phone number

bright fog
supple briar
#

Just a general statement though

bright fog
#

yea

supple briar
#

For a split second when I loaded back in, the “you need to verify with a phone number” text was there, and I was scared, lol

fiery bough
#

LOG : General f:2628, t:1752941522266> ERROR: model texture "vehicles/Vehicles_FordF150" wasn't found

bright fog
#

Jesus default notepad ? 😭

forest fractal
#

Good morning everyone! does anyone know by chance which bin save file the time/weather/temp is stored at?

bright fog
forest fractal
bright fog
#

Ah you miss typed "chance" to "change" so I thought that's what you meant 😂

#

Uh well idk sadly

forest fractal
#

oh shoot! my bad! I've been awake for officially more than 24 hrs now haha

bright fog
#

💀

forest fractal
#

its agiht. I'll try to check each one lol

tranquil kindle
tranquil kindle
# fiery bough

I have black mask as a placeholder as im still working on it. HOWEVER if you spawn vehicle without mask file, Damage and blood texture assigned IT WILL break texture displayed UNTILL you fix car with debugmode/mechanic's

#

ALSO you can notice i dont have my "model Vodnik " having any "texture" as it is applied with "skins" in vehicle script itself

fiery bough
#

i recreated the texture file and got this. My texture is 1200x627 pixels

tranquil kindle
#

Make the texture even, 1024x1024, 512x512 etc

#

Then adjust UV's

fiery bough
main pasture
#

BTW you should have the left and right sides separated in the texture. You can't have the sides working independently with removed parts, damage and blood if they aren't separate in the mask

bright fog
queen oasis
bright fog
#

oof

queen oasis
#

in my solo game, I built a fenced in pen to shuffle them in to

bright fog
#

You can't kill them too ?

queen oasis
#

You can only push them around or lead them with noise. No interactions at all.

#

I haven't checked if it's present without ragdolls active tho

bright fog
#

I doubt that's the reason

queen oasis
#

I doubt it too. I'm sure the grapple system is the issue.

#

There are zero errors

bright fog
#

I mean I already see the reason why this happens tbf

#

Bcs the corpses are revived into zombies to be animated entities that can be interacted with, and they are set as reanimated players to keep the data of the corpse most likely (such as items)

#

And they are probably set useless or some shit like that, or have a bugged stated that isn't reset upon reloading the save

#

But your character and zombie animation state are reloaded, thus they "disassemble"

bronze yoke
#

they're grappled

#

grappled entites can't do anything and their animations are controlled by the grappler

bright fog
#

I see

queen oasis
#

it loses the grappled state but keeps the "reanimated" state. I've tried goofing with the animation states with no success.

bright fog
#

I don't think albion is refering to an animation state here tho

#

Try setting that on the zombie perhaps

queen oasis
#

There's really nothing I can do once the game freezes. It's been confirmed by several people it's not my mod causing the freeze, it just takes longer without it because you're not dragging dozens of corpses one after the other. I guess I could check if any useless zombies are standing around after a game start, but that would certainly cause issues with other mods.

#

I'm finally playing with craft recipes and I have this thing that if I make a recipe to craft log bundles with less rope, the vanilla craft recipes for making log stacks disappear - and I don't know why. My recipe works fine but I can't unbundle them even though the result is a Base.LogStacks4

module AutoLoggingRecipes {
  craftRecipe MakeFourLogStackLessRope
  {
    timedAction = Making,
    Time = 60,
    OnCreate = Recipe.OnCreate.CreateLogStack,
    Tags = InHandCraft;CanBeDoneFromFloor,
    category = Carpentry,
    inputs
    {
        item 4 [Base.Log],
    item 1 tags[Rope],
    }
    outputs
    {
        item 1 Base.LogStacks4,
    }
  }
}
#

fun fact: if you overwrite the vanilla recipes, they won't show up

#

it must be nap time

azure rivet
#

so Steam API still not updated?

bright fog
#

If you mean the server download issues, it's now the game devs to update their game

#

And also server providers to update their shit

bronze yoke
#

the issue has always been on the game end

bright fog
bronze yoke
#

it's not valve's fault the game uses a version three years old 😅

#

if you want to keep improving your software you have to break compatibility someday

bright fog
#

I mean, I agree of course

azure rivet
#

yep, are inconveniences that arise.

bright fog
#

Just maybe making an announcement to the game devs telling them "ok in 30 days we update this shit"

#

Or at least I haven't heard about a Valve announcement updating their SteamCMD

azure rivet
#

IDK, I just find it curious that its been a few days.
and persists.

bright fog
#

Yea well that's what happens when the devs end up having to fix this out of nowhere lol

#

Also that's if they even properly keep track of their game versions and didn't completely lost previous version files that makes it impossible to properly make a new B41 version drunk

bronze yoke
#

we know they use version control 😅

bright fog
#

Yea I would have been surprised but you never know 💀

#

But yea Idk, it's true that this shouldn't be too much of a hassle to fix ? I doubt they changed majorly how any of it works anyway Steam side

gloomy hatch
#

What’s the default directory on Linux, for uploading mods to the workshop?

bright fog
#

Find where you need to manually install mods

#

And that should be enough

#

But you can do like me and define a custom cache folder too

#

Game launch params:
-cachedir="<folder path>"

gloomy hatch
#

I don’t have a Zomboid folder in my cache folder.

The only PZ folders I can find are under primary > steamapps > common > Project Zomboid

bright fog
#

That's why I set a custom cache folder

#

Bcs I couldn't find it too

#

Just do that already seriously, save you the hassle --'

#

Just you'll have lost your configs, that's the only downside

gloomy hatch
#

Okay, I ‘ll try doing what you did.👍

gloomy hatch
gloomy hatch
#

My last and final issue that I need to resolve.

Any idea how I can fix this error, when attempting to open tileZed?

bright fog
#

Didn't someone literally give you a solution the other day ... ?

#

You sent the exact same screenshot

#

You got an answer from Alree

#

AND the unofficial mapping Discord

gloomy hatch
#

In simple terms: I have to move “what” where?

bright fog
#

This issue is not caused by TileZed itself, but rather by how the Steam Deck's operating system handles file systems.
the error:
Invalid cross-device link

means that the application is trying to rename or move a file between two different mounted file systems, something that Linux doesn’t allow using a simple rename() system call.

on the Steam Deck (SteamOS), this often happens because:

  • The temporary files are written to /tmp (which is a tmpfs in RAM),
  • While the target file is located in your home directory (e.g., /home/deck), or on a microSD card formatted in exFAT or another file system.

Since these are mounted as separate devices, a direct rename across them fails.
So yes, official linux builds works on Linux, just put all files on same partitions

BTW, you're posting on #1322524023992619039 for problem with B41 tools

#

Alree's message

#

While the target file is located in your home directory (e.g., /home/deck), or on a microSD card formatted in exFAT or another file system.

#

Find your file

#

Use tools to find where your file is located

gloomy hatch
#

What file, in particular?

bright fog
#

If you're new to Linux, a simple search and you'll there's plenty of tools to search for files, directly with a simple command paste

bright fog
gloomy hatch
#

I moved that one. I’ll try again.