#mod_development

1 messages Β· Page 19 of 1

calm depot
#

hm, one thing stands out as suspicious

weak sierra
#

?

calm depot
#

the bpack value it saves in moddata

weak sierra
#

yeah

calm depot
#

AFAIR, there is only a limited set of types you can successfully save in modData

weak sierra
#

the way that's handled as if there's only one backpack ever

#

really seems wonk

calm depot
#

and I'm pretty sure all those types have to be lua builtins

#

e.g. numbers, strings and tables

weak sierra
#

hm

#

tries to think back through all the moddata she's seen

#

that seems to fly with what i've seen yeah

#

usually ids or strings for names of items and whatnot

calm depot
#

at runtime you can do whatever you want, but it'll never persist across a save and reload

deft jacinth
#

I am using a military semi truck

weak sierra
#

the item data isn't stored on the player presently though it's stored on InventoryItem's mod data

deft jacinth
#

It has the highest HP

calm depot
deft jacinth
#

Still slows down on the road and I have to keep tapping W

weak sierra
#

that's how it's gonna be

deft jacinth
#

It took 2 hours to get home

#

and I am still not home

#

I am maybe 4 minutes from home now

calm depot
#

cool story bro

weak sierra
#

yeah that's really the wrong channel tho

calm depot
#

yeah, seems so

weak sierra
#

which is CONTAINERS! and i guess ki5's oshkosh semi mod

#

if my assumptions are correct

#

but yes that's pretty much ur best case scenario

#

game engine limitations blah blah

deft jacinth
#

but an empty gasoline tank was a nightmare

#

Not in a realistic way

weak sierra
#

report to mod maker

#

keep it out of this channel

#

this is for mod makers to talk to each other about making mods

deft jacinth
#

I could get up to like 10 MPH, then it drops instantly to 0

#

And I would have to keep tapping W

#

to keep it somewhat steady

deft jacinth
#

I was just wondering if maybe somebody had more insight into the ISO container mods and knowing vehicle was the right one to use

weak sierra
#

still #mod_support , but the answer from people with insight is just "there is no right vehicle"

#

it's gonna suck no matter what

#

@calm depot won't this "waiter" thing get screwy running from a server context in the first place? am i wrong or does this need a redesign to have like.. a waiter/player combination registry'

#

how does it work when a bit of code is in shared and it's of this nature

#

i really need more insight into how what code gets run where

#

i get the basic idea, client on client, server on server, shared on both (and loaded earlier)

calm depot
#

yeah, I don't quite understand why the operation needs to live in OnPlayerUpdate

#

I guess it's because you don't immediately get the hotbar item available

#

but even so, why not queue up the event function when the conditions are met and have it remove itself after the job is done

quaint mirage
#

Hey random question, when using

context.addOption, how does one make it appear above Drop and Place item

calm depot
#

execute it before those do

weak sierra
#

the rate im going i guess ill be writing my own mod instead of fixing this one

#

eh

quaint mirage
#

So i take i need to hook into another event?#

calm depot
#

if you really want to be particular about where it goes, you'll have to hook the function that adds those items

#

and do some clever interception of the addOption function to inject your own element

quaint mirage
#

Yep its me being a little ocd i think, i want it to be neat aha

#

Ill look some more into it, pretty minor one though xD

weak sierra
#

im aware u can add and remove functions from events

#

i've used adding them before for things

calm depot
#

seems to me there is no point in having the OnPlayerUpdate function firing until OnClothingUpdate has set the moddata for it

weak sierra
#

yeah

calm depot
#

and once all its conditions are met, it can dequeue itself

weak sierra
#

but how does it dequeue itself

#

just removing it from the event?

calm depot
#

declare a local which will hold the function before assigning the function to the local

weak sierra
#

ahhhh

#

that makes sense

#

then u can have unique copies of it

#

right?

calm depot
#

actually, I think you can also just use local function blahblah()

weak sierra
#

could as long as we save the reference? i think that's how it works?

calm depot
#

AFAIK, that is internally equivalent to first declaring local blahblah prior to assignment

weak sierra
#

im from C#-land, still adjusting to lua

calm depot
#

in Lua, this is called an upvalue

weak sierra
#

so if there's a lot of players

#

all taking a backpack off

#

u need these queued events to not get mixed up on server end

calm depot
#

the lua code runs single threaded and only once per tick

#

it's impossible for events to just interleave themselves simultaneously

#

because the lua state does not support multithreaded execution

weak sierra
#

i mean though, if you have one person take a backpack off

#

why doesn't it save someone else's attachments

#

if it's in shared or server

#

PZ java backend player stuff?

calm depot
#

because the event receives that player argument

weak sierra
#

ah ok

#

yeah

#

yeah yeah that seems obvious now :p

#

hard to remember everything at once sometimes xD

#

thanks, when i do this i'll put a thanks to you in the description

#

gonna defer this to later since it's not just a quick fix though.

#

to do it right

#

no reason the reattaching code can't be on the client actually

#

that'd make uh.. more sense

#

lol

echo sentinel
#

is there a first person mod

eternal garnet
echo sentinel
#

make one

gilded hawk
#

How does weight reduction works? I did set it to 90 and doesen't seem like to do notthing to the weight of the container

calm depot
#

ah yes, just make one, I wish I'd thought of that

#

@gilded hawk the weight reduction bonus only applies when it's on your back as a backpack or in a primary/secondary slot

echo sentinel
#

just set the camera to first person

#

dune

gilded hawk
calm depot
#

ah sorry, I should have said when it's in a worn slot

bleak patio
#

so, I hate to sound as new as I do here but I'd like to know before I rabbit hole for a week. Is there support for building our own lua modules to use in mods?

calm depot
#

yes, though I wouldn't really call it "support"

#

everything executes in the same lua state

bleak patio
#

gottcha but it can still call external libraries as part of those events?

calm depot
#

you can make your mod.info depend on other mod IDs which will ensure their lua executes before yours does

#

when you upload it to the workshop, you should also edit it to depend on whatever the workshop item(s) you require are

#

that part is all done from steam's website

gilded hawk
jagged ingot
#

Good evening.

#

Debug-testing a mod that's about to be updated that enables RCON for singleplayer.. basically for Twitch integration custom commands.

#

πŸ™‚

calm depot
#

isn't that a bit overengineered? There's nothing stopping you from just running a server instance on your own computer and connecting to localhost

jagged ingot
#

It was a heavily requested feature since a lot of streamers play on singleplayer maps.

zealous wing
#

Question: How do you create/define custom tags for modded items? E.g., like the 'Milk' and 'Egg' tags for food items.

calm depot
#

I get it, but I'd have said "yeah, so fire up the server instance on your PC" - it's still basically single player if you're not exposing it to the internet πŸ˜‰

jagged ingot
calm depot
#

in pure lua?

jagged ingot
#

Java with a lua mod.

calm depot
#

yeah, and there's the rub

jagged ingot
calm depot
#

the catch

jagged ingot
#

Not a catch if it comes from a trustworthy source. πŸ™‚

calm depot
jagged ingot
#

If you're interested in close to 8 years of Java modding tools, you might be interested in this too: https://asledgehammer.com

calm depot
#

I don't know which repo you want me to look at; my app lets you patch methods at runtime; doesn't matter if the game classes get changed by an update (unless the function signatures change, of course)

jagged ingot
#

That'd be the tool WoodGlue.

#

Dynamic patching and sandboxed environment.

#

premain jazz.

calm depot
#

so it's using a Java agent

jagged ingot
#

And Kotlin.

calm depot
#

my approach is that you do it by defining annotations that tell it what to target

jagged ingot
#

It's for servers.

#

Oh. Reflection stuff is avoidable. I'd rather edit the main bytecode.

calm depot
#

PZHook will work for any setup

jagged ingot
#

Back to debug testing so this mod can get the green light for the update.

zealous wing
#

Dumb question: Is there a way you can use, say, a water source like a sink or rain barrel in a crafting recipe, rather than a water source like a water bottle already in your inventory?
I am ashamed to admit I've never given it thought before. TBF I never thought to try before now though. πŸ˜›

calm depot
#

you could if you have a custom isvalid/perform function, but you won't be able to make it show up as a requirement in the recipe

zealous wing
#

I figured I'd have to make something in lua? Either that or just make the item drainable like any other portable water source.

#

Tl;dr, I'm trying to hack together a way to make ice. I want to fill a tray with water at the sink, rather than from a bottle or mug.

calm depot
#

you can define a lua function that's called for every input item to test if the recipe is allowed and a lua function that is called with all inputs and the output item when they perform it

#

alternatively, instead of making it only a recipe, add a right-click context action

#

so, the recipe will just use some container with water, the context action will only show up if they click a moveable that supplies water

zealous wing
#

Blegh, headache inducing.
I'd have to define timed actions and stuff.
I just wanna fill an ice tray. 😭

quasi kernel
#

I return

bleak patio
#

Delta that's exactly what I'm about to work on

#

any advice for API access?

quaint mirage
#

I've recently made a mod similar to that, i transitioned from a simple recipe from Empty lighter to a fuelled lighter, to setting the usedDelta to 0 manually and allowing it to be filled via a custom context menu item, then it hooks into a timed action and runs the logic inside

#

Though not quite sure how you would freeze the water, but i can imagine where you might start by getting water into the tray, by making it drainable etc, you could pretty much take the code from existing Water bottle item in media/ and go from there

calm depot
#

it would be simpler to make it a food item with a ReplaceOnRotten

dapper tulip
#

I was thinking that creating a museum to display all you collect would be superb like the skyrim mod legacy of the dragonborn

cedar anvil
#
    {
Base.WristWatch_Right_DigitalBlack/Base.WristWatch_Left_DigitalBlack/Base.WristWatch_Right_DigitalRed/Base.WristWatch_Left_DigitalRed,
       keep ATTS.Barcodereader,
       Result:Money=5,
       Time:30.0,
       Category:Zamazon Trading,
    }```
#

I have another question about the recipe. I made a recipe that sells digital watches. But It sells favorite(The yellow star) watches as well. Is there any way to protect favorite items from this recipe?

calm depot
#

what happens if you prefix it with destroy

cedar anvil
#

destory? Oncreate?

calm depot
#

you'll probably need =1 at the end, too

#

destroy Base.blah/Base.blah2=1

cedar anvil
#

I thought destroy was for Oncreate only

#

Thank you so much, will try it now

calm depot
#

what?

cedar anvil
#

umm like this one

calm depot
#

OnCreate is for running a lua function

cedar anvil
#
    {
        destroy Zasawkit,
        Result:Base.Needle,
        Time:100.0,
       OnCreate:Zasawkit,
    }```
#

I know it might be a dumb question. but can I ask what does destroy do?

calm depot
#

yeah, that's not a thing, unless you defined a lua function called Zasawkit

#

it destroys the input item

cedar anvil
#
    {
destory Base.WristWatch_Right_DigitalBlack/Base.WristWatch_Left_DigitalBlack/Base.WristWatch_Right_DigitalRed/Base.WristWatch_Left_DigitalRed=1,
       keep ATTS.Barcodereader,
       Result:Money=5,
       Time:30.0,
       Category:Zamazon Trading,
    }
calm depot
#

"destory"

cedar anvil
#

πŸ¦•

#

I love storybook

cedar anvil
#

Oh It still destroys favorite items. But I think I found some hints from original recipe file

#
    {
       Shotgun,
       keep [Recipe.GetItemTypes.Saw],

       Result:ShotgunSawnoff,
       Sound:Sawing,
       Time:200.0,
       OnCreate:ShotgunSawnoff_OnCreate,
    }```
#

This recipe takes favorited item

#
    {
       [Recipe.GetItemTypes.DismantleDigitalWatch],
       keep [Recipe.GetItemTypes.Screwdriver],

       Result:ElectronicsScrap,
       Time:30.0,
       OnTest:Recipe.OnTest.DismantleElectronics,
       OnGiveXP:Recipe.OnGiveXP.DismantleElectronics,
       Category:Electrical,
       AnimNode:Disassemble,
       Prop1:Screwdriver,
       Prop2:CDplayer,
    }```
#

but this one is not. because of OnTest..?

calm depot
#

most likely, it's a function

#

so you can make it do whatever you want

#

it gets called for every input item in the recipe

zealous wing
#

So I found that recipes can require items be hot via the Heat parameter.
E.g.: Heat:-0.22,
Does anyone know what value would correspond to something being cold?

calm depot
#

you'd have to use AllowFrozenItem:true and implement custom logic in OnTest to check that it's currently frozen

zealous wing
#

What does the parameter for that look like? Ctrl-F recipecode.lua turns up nada.

#

For the OnTest bit I mean?

cedar anvil
elfin stump
#

Hey I am curious if anyone has ever had a problem where sounds play sometimes and other times they do not. I have tested it just now and how it goes is - load up game - mod sounds don't work - reload game - sounds work. Recipes and eating.

#

It may be all mod sounds but that is all my mod has - any ideas what would cause that?

frail dagger
#

Does anyone know a mod that adds a temporary effect? I'm trying to figure out how to add a temporary effect in multiplayer.

drifting ore
#

Was curious about some opinions on a couple professions I was thinking of.
Caveman: 10 fitness, 10 strength, 5 foraging, but you can not drive, you can not read, you learn every skill at a reduced speed, and you panic indoors.
I thought of this for people who either want a challenge and want to live exclusively off the land or for people who want to do some RP using the 10yrs later mod.

Plumber: Starts off with 3 in short blunt, 2 in maintenance, would be a -5 profession.
Not that β€œplumbing” per-se is in the game as of right now but they have most other trades as professions except plumbers. That and to cater more to people who main with short blunt.

Rural Hermit: 3 farming, 3 foraging, 2 tailoring, 2 axe, 3 trapping but your stress, unhappiness, and boredom increase around other players and you get the sunday driver perk but would still make it a -6 profession

elfin stump
frail dagger
#

Never mind, I think I've figured out lua tables are just hash tables.
I should be able to use that

elfin stump
quasi kernel
#

Would be cool to have the traits "People Person" and "Antisocial" with corresponding effects.

calm depot
frail dagger
#

Question:
How can I add/remove firearm accuracy without manipulating the firearm skill or firearm stats?

shadow geyser
#

you probably can't. but you can just modify the stats back and forth if you want

frail dagger
#

I suppose I could just set the firearm level, but I don't want to trigger the xpgain event

#

I'm essentially trying to make a high accuracy temp effect
But also trying to not touch OnPlayerUpdate Event

#

Maybe OnEquipPrimary will be useful, I just don't want to touch the firearm because I want this to be compatible with any other mod.

#

I don't see an Unequip event though...

stark coyote
#

Anyone knows where I can find the code for hot drink recipe ? I made a mug and I would like to be able to make coffee or tea in it tea

shadow geyser
# frail dagger I don't see an Unequip event though...

you don't really need to unmodify it specifically when the weapon is unequipped. it doesn't really matter what stats the gun has when it is just in a container. those stats will only be used when equipped again, so you can just modify it to what it should be at that time.

frail dagger
shadow geyser
#

yeah the gun would have the stat when the other player picks it up, but when they equip it, your OnEquipPrimary function would run again, and you just set it back to the correct stats

frail dagger
#

But I'm not checking everyone, only those with the buff because that's all I care about πŸ˜…

shadow geyser
#

actually, looking at the java, it looks like OnEquipPrimary does also trigger when unequipping from your hands

frail dagger
#

Oh, really?? Can you link me that please?

shadow geyser
#

sure, but that OnEquipPrimary is going to be run on all clients, regardless of if they have the buff or not

#

sure you can technically add and remove from the event list, but that is so much more complicated than just having a check in the function if the current player has the buff

#

so

if player has buff then
    buff gun
else
    set gun to default
end
#
   public void setPrimaryHandItem(InventoryItem var1) {
      this.setEquipParent(this.leftHandItem, var1);
      this.leftHandItem = var1;
      if (GameClient.bClient && this instanceof IsoPlayer && ((IsoPlayer)this).isLocalPlayer()) {
         GameClient.instance.equip((IsoPlayer)this, 0);
      }

      LuaEventManager.triggerEvent("OnEquipPrimary", this, var1);
      this.resetEquippedHandsModels();
      this.setVariable("Weapon", WeaponType.getWeaponType(this).type);
      if (var1 != null && var1 instanceof HandWeapon && !StringUtils.isNullOrEmpty(((HandWeapon)var1).getFireMode())) {
         this.setVariable("FireMode", ((HandWeapon)var1).getFireMode());
      } else {
         this.clearVariable("FireMode");
      }

   }
    public boolean removeFromHands(InventoryItem var1) {
      boolean var2 = true;
      if (this.isPrimaryHandItem(var1)) {
         this.setPrimaryHandItem((InventoryItem)null);
      }

      if (this.isSecondaryHandItem(var1)) {
         this.setSecondaryHandItem((InventoryItem)null);
      }

      return var2;
   }
frail dagger
#

Wait, is this the actual code from the game files?

shadow geyser
#

yeah its the decompiled java

frail dagger
#

Is that public somewhere? Or did you decompile it yourself?

shadow geyser
frail dagger
#

Oh shit.. I didn't realize that was a decompile tutorial.... I glanced at it earlier and was like "interesting library" and moved on πŸ˜‚

ashen star
#

where are "furniture" containers defined? Is it possible to change the capacity?

calm depot
#

TileZed

marble lynx
#

I'm looking to make a halberd-like weapon(s), any suggestions on which vanilla weapon I should be referencing for the best results?

calm depot
#

referencing?

marble lynx
#

Yeah

#

In the sense that people making axe-like weapons would look at the vanilla axe to learn how to set it up, what size to model it, etc

calm depot
#

the only thing you might care about is recycling animations

ashen star
calm depot
#

TileZed is the tile editing tool

#

it's part of the PZ modding tools

#

you can download it either on steam or from the forums

ashen star
#

ty

marble lynx
#

How do I open .x format models?

#

nvm i figured it out

calm depot
#

either use an old ass version of Blender, or get something to convert it to FBX

marble lynx
#

yeah i looked it up in this channel and saw you saying that haha

calm depot
#

oh and just so you know, you don't need to put weapons in .X format

#

the game will handle an FBX just fine

marble lynx
#

Thank you, yeah I'm planning to do that

#

One question though, I've opened the Vanilla Spear with Machete and also Scavenger's Bushcraft Bat

#

I noticed that the spear is laid out horizontally while the bat is upright

#

πŸ€”

#

So which orientation am I supposed to adhere to

calm depot
#

given the ease with which you can translate a weapon, who cares?

#

make the model, translate and rotate it till it looks right

marble lynx
#

Yeah I did see a translation script thing in the mod files, I'm just wondering cause I wanted to know which is the "default orientation" that doesn't require more adjustments

calm depot
#

I believe it depends on the anim to determine the origin point

#

I'd wager the spear and the bat are using different ones

marble lynx
#

Makes sense πŸ€”

#

Aite I'll give it a shot now then

#

Since I'm making a halberd-y thing I'll follow the spear

calm depot
#

I think that's going to be a mistake

#

the anim for the spear is a stabbing motion

marble lynx
#

Oh I meant the spear with the machete

calm depot
#

I mean, sure it's legit since it has the spiky point, but swinging it seems more "fun"

marble lynx
#

That's a swinging one right?

calm depot
#

I think all the spears are a stabbing motion

#

something like the sledgehammer or fire axe strikes me as a better fit

marble lynx
#

Hmm actually yeah, it's weird cause I'm in game now and the spears do a swinging animation

#

But when I look at stuff like these

#

It's stabbing

#

Admittedly I don't use spears much so I don't quite know how they work

marble lynx
gilded hawk
#

How do I make a recipe that get's an item in input and returns different item but with a similar name?

Like, I have Bag_MedFannyPackFront that if put into a recipe it will return Bag_MedFannyPackFront_Spec, how can I do this? πŸ€”

calm depot
#

why is that relevant?

#

it's a different name, you make a recipe in the usual way

gilded hawk
#

It is relevant because I have 10 items, with 10 spec version, and I don't want to make 10 recipes

calm depot
#

well, if you don't care that the user won't be able to see what they're really getting, add an OnCreate function - nuke the result from its container when you're called and give them whatever they're meant to have

#

alternatively, you could programatically define the recipes

gilded hawk
calm depot
#

yeah

gray steppe
#

quick question, is mod options dead?

gilded hawk
calm depot
#

you build the recipe string and feed it in through a function call

gilded hawk
halcyon dagger
#

hey πŸ‘‹ maybe someone knows this: how can I allow debug enabled cients on my dedicated server? ty 😊

calm depot
#

@gilded hawk ScriptManager has a ParseScript function

#

you can get the class instance with getScriptManager()

#

the ParseScript function expects a string, which should look the same as a recipe script file

gilded hawk
#

So, I should give a string like this one from AZ?

module AuthenticZRecipes {
  imports {
      Base
  }

recipe Open Pack of Glowsticks
   {
     AuthenticGlowstick_Pack,

     Result:AuthenticGlowstick_Blank=3,
     RemoveResultItem:true,     
     Time:120,
     OnCreate:OpenGlowStickPackage,
     StopOnWalk:false,
     AnimNode:RipSheets,
     Tooltip:Tooltip_GlowStickPack,       
   }
}
calm depot
#

yes

gilded hawk
#

Wait, would this work even with items????

calm depot
#

items are a little different

gilded hawk
calm depot
#

you can just call createNewScriptItem

gilded hawk
calm depot
#

that gives you an instance of the new item, then you use DoParam

#

it absolutely does work, I have used it myself

gilded hawk
#

I spent last week working on createNewScriptItem, and it only gave me problems

calm depot
#

well, evidently you didn't do it right

gilded hawk
#

Do you have a github repo where you used the createNewScriptItem?

calm depot
#

what's more likely, the game function is broken, or you made a mistake?

#

anyway, it's irrelevant, I used exactly this API for dynamically generating items

#

didn't have any issues

#

what I suspect you missed is that you also need to emit a script file

gilded hawk
calm depot
#

otherwise when someone reloads the game, the world dictionary will not have the entries

calm depot
#

see the script in lua/shared

#

you'll see how it's done

gilded hawk
#

Okay thank you

#

Holy moly that's a lot of stuff to look into, thank you olipro

calm depot
#

you think that file is a lot? you should see the metatable code I had to write to coerce it into using the alternative gasoline containers

halcyon dagger
alpine scroll
#

Has anyone ever tried to make a mod that reads twitch chat messages and events?

calm depot
#

yeah, I believe there's one that interacts with the server RCON

alpine scroll
calm depot
#

no, you'll have to google it

halcyon dagger
#

can I trigger setGhostMode (dedicated) server side? I'm doing it but it doesn't seem to populate to the client or has any effect at all

quasi kernel
#

@calm depot I did it!!

#

It does the funny now!

#

Only thing is the action seems to sometimes get stuck in the crafting anim even after it's finished but that's just a nitpick

#

Also, I need to find a way to dynamically add items with the tag into the recipe for removing batteries

#

(Because otherwise it won't recognize the hand crank)

#

@weak sierra You on?

calm depot
#

and, if they do have privileges, there's no need to do it server side

calm depot
quasi kernel
#

Nono I mean

#

I want to adjust the default recipe to use the tag

#

But I don't wanna edit the script so it can be more compat

halcyon dagger
calm depot
#

the server can definitely synchronise the bit flags when a client connects

#

never checked whether it can be manipulated from lua though

quasi kernel
#

Is there a way to translate "[Recipe.GetItemTypes.BatteryItem]" into the items or am I able to just plug it in as-is?

#

I doubt I'll be able to just plug it in since vanilla scripts go brr, I'll probably have to loop through the items with the tag and add them

#

I imagine getScriptManager():getItemsTag("BatteryItem") works but idk

crimson ore
#

Ui, is it possible? I can find some icons but the rest are hidden in packs I cannot open

quasi kernel
#

Editing UI is possible, just has a lot of incompatibilities since they tend to override the same file.

crimson ore
#

Any tips

#

And how does one open those dirty pack files

quasi kernel
#

I haven't had a reason to open them personally, but I'm sure someone knows.

sour island
#

You can even grab some by a global clientside instance

quasi kernel
#

Oh? I was thinking stuff like moodles.

#

Though that could still apply for all I know

crimson ore
#

Yeah moodlets, widgets icons sorts thing

#

I tried it with the ones available outside packs and it worked of course

sour island
#

Oh those use shared textures

#

I'd have to double check how those are loaded but conceivably you should be able to include a file matching the expected file name

#

It's different for everything unfortunately -- I know items require specific format to filenames and you can't use vanilla names but that could've changed/I misunderstood

quasi kernel
#

I think I got it working

calm depot
#

might be one of the things you have to reference from your mod.info

#

but don't take my word for it

quasi kernel
#

OLI I DID IT

calm depot
#

nice

quasi kernel
#

Look at me go, learning things!1

calm depot
#

now your character can really build that right arm strength

#

😏

quasi kernel
#

fear

calm depot
#

could add a shake weight, but it'd be rather anachronistic

quasi kernel
#

Ok so I found a minor but, bug other than that it's perfect

#

Apparently one can insert a battery into the crank when a battery is already in it, so I gotta patch that

drifting ore
#

im fairly sure this will fall on deaf ears (no pun intended lol(but i just had an idea ima share with you two words hearing aids

calm depot
#

hm, sounds like your isValid has an issue

#

yeah, that'd kinda nerf the deaf trait

#

but considering that batteries for those things in the 90s were probably good for a day or two at best, not that bad of an idea

quasi kernel
drifting ore
#

I used hearing aids my self battery nowadays can last for ages

calm depot
#

on the other hand, if someone is profoundly deaf, hearing aids are useless

drifting ore
#

This be good for the hearing loss trait

#

and more hearing traits be good in zomboid

calm depot
#

recipe Drill Cochlear Implant into head { ... } 😏

drifting ore
#

lol

quasi kernel
#

I'll patch the bug later, but am very proud of what I've managed to accomplish with some help

#

Now I understand the inner workings of zomboid a bit better in regards to items

#

Next up: funny couch searching

calm depot
#

of course, that's the point of modding: the satisfaction you get when it all works

drifting ore
quasi kernel
#

You figure it'd be better to make couches into containers for a couch searching mod or something like a timedaction?

#

Imo timed action might be better but idk

#

Could introduce a "failing" factor where you don't turn up anything.

tender chasm
#

Hey all, I’m new to PZ and the discord server. This seems like the right place to ask: I’ve only played vanilla PZ up to this point and am curious if there’s a list somewhere of some recommended or β€œessential” mods the community know about?

drifting ore
#

dylans car mod

tender chasm
#

I realize this is subjective, but I’m not sure quite where to start when it comes to modding.

calm depot
#

go to the workshop and sort by most popular/downloaded over the past year

calm depot
#

also, any mod I've made is obviously a must-have

tender chasm
calm depot
#

I'm mostly joking, though chances are you'll pick up the 4-colour bic pen

tender chasm
#

Oh nice

#

Fuck yes

calm depot
#

my most popular mod is the one that was the least technically challenging to make, go figure huh?

tender chasm
#

I’m big on mapping in solo games so that would help

tender chasm
#

I guess simple and obvious*

#

But still, someone has to see it

calm depot
#

well, I think it had more to do with the fact someone suggested it on reddit, so I made it and linked it there and it blew up overnight

tender chasm
#

Nice

calm depot
#

normally I chuck it on the workshop and leave it at that

tender chasm
#

I figured it’s best to learn the vanilla game first before diving into mods

#

I can imagine there’s a lot of good enhancements from the community

calm depot
#

you might enjoy the steam powered generator, if you like the idea of using wood/charcoal for electricity

tender chasm
#

Sweet

#

Haven’t quite gotten that far out in my solo games yet, so I’m not sure what kinds of electrical generation you can do unmodded?

calm depot
#

just the regular generator, it runs on gasoline

tender chasm
#

Oh right

#

Okay, yeah seems like additional power sources would be a good addition

#

Maybe find solar cells on some houses or buildings

#

Or build a windmill

#

Steam is a good one though

calm depot
#

I think someone on here was working on solar power - dunno if they ever got it done though

tender chasm
#

Apparently there was a working steam engine in the old Library of Alexandria before it got destroyed the first time…

#

Random thought

calm depot
#

I've been tempted to do it myself but I don't really do pixel art; I make a 3D model and take isometric renders of it which gives it a bit more of a "Factorio" feel

tender chasm
#

But still, humans naturally gravitate towards steam as an energy source it seems

tender chasm
#

Solar is pretty prevalent across the US now

halcyon dagger
#

how can I add noise tokens?

lone spade
#

Could someone identify this log? I'm getting tons of errors while selecting any type of vests, and I'm unable to verify which mod is causing it (doesn't show up which one even in mod list)

Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@957c2b63 function: render -- file: ISToolTipInv.lua line # 108 | Vanilla. [29-08-22 19:01:54.190] ERROR: General , 1661792514190> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at GeneratedMethodAccessor2044.invoke.. [29-08-22 19:01:54.190] ERROR: General , 1661792514190> DebugLogStream.printException> Stack trace:. [29-08-22 19:01:54.203] LOG : General , 1661792514203> ----------------------------------------- STACK TRACE

knotty saddle
#

To anyone still having issues with a missing mod titled "Summer Car," it appears to be due to this mod having been removed from the workshop. I posted here about this a few weeks ago, but I've been getting messages from people asking if I ever fixed it.

lone spade
#

At first it showed Night Vision Chuckled and Named Literature as reason of these errors, but it still appears even after turning them off, and only goes away after disabling all mods

knotty saddle
#

Idk if that's your issue, but I also had a bunch of issues with tooltips giving errors, or just straight up overlapping so I can't read them

lone spade
#

Yeah, not using using anything from soul filcher's except for learning time, might try disabling it

#

Still weird that it doesn't show it as the reason

#

Really wanted to use Shark's uniform mods, but now that it requires Night Vision Chuckled, it breaks all vests in game

#

Well, anything that modifies tooltips seems to be messing up vests

#

Really weird

#

Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@957c2b63 function: render -- file: ISToolTipInv.lua line # 78 | Vanilla function: render -- file: namedLit - ISUI_overwrite.lua line # 211 | MOD: Named Literature function: render -- file: eris_inventoryTooltip.lua line # 44 | MOD: Night Vision Chucked. [29-08-22 18:32:39.658] ERROR: General , 1661790759658> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at GeneratedMethodAccessor2044.invoke.. [29-08-22 18:32:39.659] ERROR: General , 1661790759659> DebugLogStream.printException> Stack trace:. [29-08-22 18:32:39.661] LOG : General , 1661790759661> ----------------------------------------- STACK TRACE

This is the log I get with Named Literature and Night Vision being the issue

lone spade
#

Thankfully I still had it on PC, so I just copied it to my mods folder

#

And I found the issue, if anyone has it, disable "Undo mask exclusion" mod, that's the cause of this problem

ancient grail
normal oxide
#

What's the mod that returns tools to their respective bags once you're done crafting something?

grim rose
#

hello can anyone help me with typical distributions?

#

i don't know how to really do them

shadow geyser
#

best way to learn is to look at code from existing mods

quasi kernel
grim rose
normal oxide
grim rose
grim rose
#

okay i found a work around

#

but now

#

how do i make option for those?

#

like, i add a lot of plushies to game. A shiton in terms of zomboid, but i want to give choice if you want them to spawn or not

#

anyone could help me make a function/option to disable them from spawing in world

heady crystal
#

Is it possible to get an item from the player's inventory through it's DisplayCategory? Or make a custom item type?

heady crystal
#

Like clothing has Type = Clothing

#

But when I write my own type in an item's definition I get errors

grim rose
#

display category is one thing
type is strict

heady crystal
#

I have a bunch of items in the mod and I want to filter through the player's inventory to get specifically those items

grim rose
#

so you can display category = clothes

but you can;t

type = clothes

#

so don't change anything in type

heady crystal
#

Yeah but I only found getItemsFromCategory and getItemsFromType

grim rose
#

so why not

getItemsFromCategory = YourCategory```?
heady crystal
#

I cannot declare a category it seems

#

Only DisplayCategory which doesn't work with getItemsFromCategory afaik

grim rose
#

i think its hard coded for 16 main sub categories

heady crystal
#

Oof

zenith smelt
#

processSayMessage();

quasi kernel
zenith smelt
#

How do I add messages in the chat box, but in a way so other players don't see it?
How do I make a message appear above player and stay for longer?

heady crystal
quasi kernel
#

It be like that

thorn musk
#

is britas weapon pack and arsenal gun fighter not working rn?

zenith smelt
#

Works on my machine

zenith smelt
# zenith smelt How do I add messages in the chat box, but in a way so other players don't see i...

How to make messages in the chat box so that other players can't see them?
message in chat box:


-- At least 1 message required
processSayMessage(" ");
function My_FakeMessage (_Msg) 
    local _Chat = ISChat.instance;
    local _TabID = 0;
    local _Tab;

    for i,tab in ipairs(_Chat.tabs) do
        if tab and tab.tabID == _TabID then
            _Tab = tab;
            break;
        end
    end
    
    local _FoundMessage = nil;
    for i,msg in ipairs(_Tab.chatMessages) do
        if (msg and not _FoundMessage) then
            _FoundMessage = msg;
        end;
    end

    local _NewMsg = _FoundMessage:clone();
    _NewMsg:setText(_Msg);
    _NewMsg:setServerAlert(false);
    _NewMsg:setServerAuthor(false);
    _NewMsg:setLocal(true);

    ISChat.instance.addLineInChat(_NewMsg, 0);
end;

I found a fix for this issue

quasi kernel
#

Ok so, I think my mod is basically done for now.

#

So that's nice.

#

Any idea as to how I can make a "submod" for patching BetterBatteries until they update?

#

Or perhaps I can wait on them to update-

#

Better question, is there a way to differentiate between a modded and regular recipe?

pearl crest
#

hey yall, im trying to add the mod called firearms b41. i only have one other mod with it. i'll show you the screenshots of what im doing in a moment. basically, when i add it, it says this:

#

-2 more

pearl crest
#

ok

#

thank

cyan basalt
#

this channel is for making mods

#

np

quasi kernel
#

gilbz, what is your wisdom

cyan basalt
#

haha wdym i have no wisdom

quasi kernel
#

aw hush you have plenty

cyan basalt
#

did you end up figuring out your battery mod?

quasi kernel
#

For the most part

#

Stuck trying to differentiate between modded and regular recipes, but I dont know if thats possible

cyan basalt
#

hmmm yeah idk if it is either

quasi kernel
#

Can't check if it inherits from Base since most recipes inherit from Base anyways-

cyan basalt
#

ahh yeah i was literally about to suggest that haha

quasi kernel
#

Might just have to override "Remove Battery" behaviour entirely, but that can and will cause some incompatibilities

cyan basalt
#

when do the recipes get added? if your mod fires first could you store the vanilla recipes somehow?

#

or you could literally have a list of vanilla recipes and check if it's not those lol. i know that's a super naive solution though haha

quasi kernel
#

Might just have to deal with the incompats tbh

#

It's an easy patch on their end, they just gotta fix it lol

#

wait, idea

#

yeah no, just gotta deal with incompats for now

grim rose
#

just made them rare

#

in normal spawns (houses etc)

#

in toy shop they spawn like other ones

quasi kernel
#

am thonk

quaint mirage
#

(also my first ever mod for any game) aha

quasi kernel
#

What're its snazzy features?

quaint mirage
#

It's not a recipe to refuel and it uses a smaller amount of delta

#

You can refill while it's equipped and before it destroys itself, that's when the Empty lighter logic kicks in and you can refuel that in the same way

#

It creates a new lighter for the cost it would to fill the original Lighter from the Empty Lighter

#

It runs the Craft animation, no sound yet. But i have some ideas for that

#

It finds the first Petrol type in the inventory for now it keeps the UI clean xD

heady crystal
#

@sour island Sorry for the ping, but do you know if it's possible to fetch the emitter that's used when you call PlayWorldSound ? I'd like to pause / stop it if possible

cedar anvil
#
    if sourceItem:hasTag("Barcodereader") then return true end
    return not sourceItem:isFavorite()
end```
#

does anyone know how to add a custom item into hasTag?

#

I've tried ("ATTS.Barcodereader") or just ("Barcodereader") but none of them worked

calm depot
#

yeah, you have to define Tags on the item

#

take a look at any of the in-game pens, they all have tags

#

also, tags are not module-qualified

proper nimbus
#

Question my modded server is having errors with Clothing and dropping items to the ground. the items to ground is the big one every time an item is dropped to the floor it disappears

calm depot
proper nimbus
cedar anvil
#

Tags = SewingNeedle,

quasi kernel
#

How's this look for a makeshift hand crank?

cedar anvil
#

Thank you so much! I had no idea what Tags were for

calm depot
#

pretty good, what art app do you use?

quasi kernel
#

Aseprite

calm depot
#

interesting, thanks

quasi kernel
#

Yeye!

#

Should makeshift be essentially equal to regular or should it get a buff / nerf?

calm depot
#

depends, what are the components you need for the makeshift?

cedar anvil
#

@calm depot Thank you so much. Now it detects my custom item.

crimson ore
#

Apart from the icons does anyone know what the ui is comprised of

#

I suspect it’s just code with some pngs for the icons

calm depot
#

code and images, yeah

#

I mean, what else would it be?

soft cargo
#

Hey, so im messing with some code, how would i tell the code to use units of wire instead of full things of wire?

calm depot
#

I don't remember if it's a drainable, if it's not, you can't. if it is, setUsedDelta is what you're looking for

quasi kernel
#

Any idea why it wont let me craft it?

calm depot
#

do you have a custom OnTest?

quasi kernel
#

oh mfw

#

im dumb

jagged ingot
#

Does anyone have an issue with RCON where the message for the previous command is returned?

calm depot
#

eh?

jagged ingot
#

Not sure if this is a consequence of my RCON client.

#

I'm using MCRCON to perform tests using PZ's RCON utility.

calm depot
#

what do you mean by "message for the previous command is returned"

jagged ingot
#

If I fire two commands in sequence, the first command (if after connecting), returns nothing. If I fire a second command following that, the return message from the first command populates the next line in the console.

#

Both commands fire nominally however it appears as if PZ is returning the wrong order of executed commands by one.

calm depot
#

nah, that sounds more like it's buffered and the buffer hasn't been drained

#

I would be inclined to blame your RCON client

ancient grail
#

yeah why use mc rcon

jagged ingot
#

I'm asking the same thing. I should check the client first. Thought to ask here to possibly save the trouble.

crimson ore
jagged ingot
#

Everything not rasterable is essentially procedurally drawn.

#

So frames, text boxes, text input fields (mostly) is code.

crimson ore
#

ah right

#

so how much is moddable

calm depot
#

I don't understand what you would do with the answer anyway. Say someone had found some hyper-efficient syntax to minimise the amount of code required to draw a dialog, that doesn't change anything

jagged ingot
#

Quite a bit. Things like the clock, Moodles, and a couple other components are not modifiable via Workshop.

crimson ore
#

more of adding some personal flavour rather than destroying the whole thing

calm depot
#

what?

jagged ingot
#

RCON can be listened to by any software.

calm depot
#

say it just used very high-def images that were several megabytes in size, the images would dwarf the code in terms of byte count. again, not useful information

jagged ingot
#

πŸ™‚

#

I had to deal with radial menu API from a mod today that's pretty locked down where it doesn't have to be. =/

#

Commission work.

quasi kernel
#

For drainables, do I just do DuctTape=0.1 to only make it use some?

crimson ore
#

yeah i dont wanna remove anything or drastically change things just swap some colours and add some things to my liking

jagged ingot
#

So you'd like to "CSS" the game's UI.

calm depot
#

you can certainly try it, but I'm not sure if the recipe syntax will accept a float

quasi kernel
#

Oh wait I see

#

nvm

jagged ingot
#

It seems a large part of the commissions that comes through my market are either 3D models or UI-based extensions / additives.

#

UI stuff is king rn.

jagged ingot
crimson ore
#

ty ill have a look see

jagged ingot
#

πŸ‘

crimson ore
calm depot
#

TileZed

crimson ore
#

also a question about the texture folder and texturepack folder

#

do they comprise the same textures or is textures just a collection of individual images

calm depot
#

texture packs are a collection of one or more images, each image is an atlas

#

the textures folder is obvious, you can see what it is from browsing it

#

I would suggest you visit the tutorials section of the forum

crimson ore
#

hmm i checked out the tilezed .pack tool

#

know idea why i didnt think of that ty

crimson ore
quasi kernel
#

Well, the hand cranks are done.

#

I just gotta figure out how to modify loot distribution now

#

So I can make the regular ones spawn rarely in, say, electrical-related areas.

#

@calm depot any ideas as to how I could go about this?

calm depot
#

yep, poke through ProceduralDistributions.lua and perform table.insert operations into the appropriate keys

quasi kernel
#

Oh huh, underwhelming hehe

#

Thank you!

calm depot
#

also, it's not really "areas", it's container types

quasi kernel
#

I figured

#

What would you say is a good rarity?

calm depot
#

heh, well that's a matter of personal taste

quasi kernel
#

I guess "1" works

calm depot
#

you can turn on LootZed in-game to inspect spawn chances

#

and also get it to re-roll a container's contents so you can get a feel for how often it'll spawn

crimson ore
#

what to do when .pack tool fails to output images

calm depot
#

you turn off the computer and contemplate your life choices that have lead to this point

crimson ore
#

😭 am i doing the prefix wrong or what

calm depot
#

how would we know?

crimson ore
#

okay start from scratch

#

would shoud the prefix be

calm depot
#

I don't know what you're extracting, but if I leave it blank, it works fine

quasi kernel
#

I need to find a way to make Better Flashlights compatible with Better Batteries

#

Only way I can think of doing it is modifying their recipes dynamically.

#

Is there a way to only get recipes from a specific mod?

drowsy tusk
#

Question for anybody else that uses Dynamic Traits. Any way to tone down the deadliness of catching a cold a bit? Kills you pretty quick in the mod.

#

Some of the folks I play with are pretty put out by how fast it can kill you.

calm depot
#

@quasi kernel getScriptManager():getRecipe

#

requires fully qualified recipe

quasi kernel
#

I see

#

Thing is, they also have a recipe named "Remove Battery" for all of their flashlights

#

Would getScriptManager():getRecipe("Remove Battery") just return a table of both?

calm depot
#

no, it will return the first one it finds

quasi kernel
#

Knowing the game, that's probably the vanilla one.

calm depot
#

sounds like it would be better to convince the mod author to clean up their shit πŸ˜„

quasi kernel
#

If they're lazy they could always just make their mod dependant on mine

calm depot
#

lazy? that's the best way

#

if you really want to go down this route, look at my Bic pen mod - it does this recipe shit for the skills journal mod

quasi kernel
#

Oh trust me I wanna avoid it if I can

calm depot
#

I absolutely loathe to do this sort of thing though

wheat granite
#

Man, I would love to see an in depth medieval armor mod, with different helmets and stuff.

calm depot
#

I should probably see if I can remove it, hopefully the skills journal dude started using tags

quasi kernel
#

Only thing I'm worried about is the Better Flashlights dude seems kinda inactive

calm depot
#

you could alternatively release a separate mod that depends on his and patches it

quasi kernel
#

How would I do that?

#

Like, if I can patch it in a seperate mod I might as well do it in the main mod-

#

Unless it's just copy pasting scripts with minor edits

calm depot
#

well, the point is separation of concerns

#

why should your main mod care about another one that not everyone uses

#

it also spares people from unnecessary updates to the main mod

quasi kernel
#

I see

#

Well then, should I just publish my mod then?

calm depot
#

if it works and you've done what you set out to do, why not?

#

worrying about other mods is what we call scope creep πŸ˜›

quasi kernel
#

I'm actually somewhat familiar with that term from game dev

#

Always pleh to deal with

calm depot
#

oh it's absolutely not a term that gamedev owns

quasi kernel
#

Oh nono I'm not saying it's exclusive to game dev

#

I'm just familiar with it because of game dev

#

Anyhow, time to try and figure out how to upload mod

calm depot
#

that's the easiest part

#

main menu

quasi kernel
#

Oh wait I should prob work on a proper description and like icon-

severe storm
#

in my game I recently made a bunch a spears, and I wanted to trash the poor quality ones I made by using them as fuel. I noticed I cannot add a spear as fuel to a grill. (I assume fire based things is the same)

I also notice there is no mod for one. Any know what files I'd need to update to allow it to be a fuel source?

severe storm
# cosmic condor recipe?

no, I want to right click the grill or other fire related thing, and add spear as fuel. Like I can with books and twigs

cosmic condor
#

maybe tag

calm depot
#

nah

#

it's ISWorldObjectContextMenu

cosmic condor
#

better that way

calm depot
#

it would be, but I dunno if they tagged wood items like they did for petrol

bleak patio
#

are zombie IDs on the server the same on client?

calm depot
#

given that they have to synchronise between the two, I would imagine so

bleak patio
#

I'd check myself but I haven't figured out where in the library I can get that info just yet

#

I had assumed NPCs.UI but I think i'm up the wrong tree here

cosmic condor
severe storm
cosmic condor
#

yes, give it a try πŸ‘πŸΌ

severe storm
calm depot
#

all items are in media/scripts distributed across a few different files

cosmic condor
severe storm
quasi kernel
#

I HAVE DONE IT

#

MY FIRST MOD

calm depot
#

there's an example mod that comes with the game

heady crystal
#

Anybody know a good bit about mod data?

quasi kernel
#

Happiness noises

#

very lazy thumbnail and idc

calm depot
#

you mean modData ?

heady crystal
#

Ye

calm depot
#

it's just a lua table

quasi kernel
#

Lua tables go br

heady crystal
#

One of my values isn't saving

calm depot
#

you can only save lua builtins

#

strings, numbers, other tables

heady crystal
#

I assume a square doesn't fit

severe storm
#

for moding ProjectZomboid\media\lua\server\Camping\camping_fuel.lua in my mod. Do I only include my changes i.e. to campingFuelType, or would I replace the contents of the entire file. Not sure if I need the Delta from basemod of I just need to overwrite

calm depot
#

patch the code as minimally as possible

#

all code runs in the same lua state

cosmic condor
zealous wing
#

Evolved recipes: Literal headache inducing MADNESS

#

Fuuuck this shit. Been at it for hours trying to debug some nonsense

quasi kernel
#

I'll get a better thumbnail made and 3D models soon

#

Just wanted to get the mod out

severe storm
calm depot
#

write a script that require's the file you're patching from the base game and override/wrap the functions as needed

zealous wing
#

Is there a way to make changes to a base game item's evolved recipe parameter value with a mod that isn't ItemTweaker?

calm depot
#

huh?

#

anything that a library mod can do is achievable without it

thorn bane
#

Is there a function that allows me to make the player speak similar to the Conditional Speaking mod? or am I going to have to dive into the source code for that mod?

calm depot
#

I don't know what that mod does - there are functions to play sounds, there is no text-to-speech built into the game if that's what you mean

severe storm
# calm depot write a script that `require`'s the file you're patching from the base game and ...

I understand what you said, but I am not sure I understand how to do it the best way to implement my change.

I want to add 2 lines to \media\lua\server\Camping\camping_fuel.lua
If rename it so something like <ModNamehere>-camping_fuel.lua it wouldn't get called. If I simply overwrote camping_fuel.lua I suspect it would work but would not be the proper way. If I made a media/scripts/ script. I wouldn't know what do in order to get my ModNameHere script to get called instead of camping_fuel.lua.

Ultimately I want to add:

    BaseballBat            = 1.25,``` to campingFuelType
calm depot
#

scripts and lua code are two entirely different things

#

when creating a mod, you can name your lua files whatever you want, the game doesn't care

#

ditto for naming script files

severe storm
#

I am following a guide from blackbeard (on youtube) on how he created a mod to add nuka cola. That works for items, but not sure how to implement a pure lua change

thorn bane
calm depot
#

well, you only put in a lua script and nothing else

#

that's about it

#

@thorn bane yeah, look at how the game does sneezing

thorn bane
#

thanks!

severe storm
calm depot
#

it doesn't matter, the file names are completely arbitrary

#

the game just loads lua files into the lua state and executes them

#

that goes for vanilla game code and your own

severe storm
hearty osprey
#

I’ve recently been working on a massive mod for my server.
I’ve been getting a error for the mod saying.
IP.Transfer not reachable.
Any help?
Dm me for more detail about the mod

calm depot
severe storm
#

@calm depot Mod is working as intended, thank you

pine gulch
#

Do Weapons have some sort of scale value? I don't see any in the game files, and the model I made is just massive.

heady crystal
#

They do

#

it's in a .txt file

#

Called staticmodels iirc

#

or worldmodels

#

There you define the model and you can define the scale too

#
model ModelName
{
  mesh      =   mesh/directory/here,
  texture   =   texture/directory/here,
  scale     =   1,
}
#

An example

pine gulch
#

peeking through items_models, I don't see the scale value for spears anywhere

heady crystal
#

Does anyone know if one can create a sound emitter?

#

I am back to the 0 here, I really need a way to stop a sound emitter and I couldn't find a possible way to do it when using PlayWorldSound

quasi kernel
#

Hecc

heady crystal
#

Yeah I am giving up

#

I don't think it's possible to add a proper jukebox mod atm

#

Too many issues with sound emitters

#

Can't create an emitter, can't make a radio apparently and even if I could, can't mod the interface so it'd be ridiculous. And PlayWorldSound completely ignores volume, loop, etc. and doesn't return any emitters or transmits it to the OnWorldSound event

#

Funny that people complained about this 6 years ago and the devs never addressed it

quasi kernel
#

Everything about that sounds painful

heady crystal
#

I managed to make it work, but it has too many little issues that make it unusable to the public

#

There's no way to adjust volume, radius, set the sound to loop, stop the sound, pause it, nothing. So you either play it in full or you don't

quasi kernel
#

I feel like there's gotta be some way- you considered consulting True Music's code?

#

They figured out something that works well enough.

#

I wouldn't doubt you have already, but it doesn't hurt to check.

heady crystal
#

No because they use tsar's lib and their disc player is broken

quasi kernel
#

Ah.

heady crystal
#

So basically it's just a modded car radio... on a car.

#

So it doesn't even apply to this use case.

calm depot
#

is that still not fixed?

#

I made a patch for the broken music players a while back

heady crystal
#

Idk I tried it like a month ago and it was still broken

severe storm
calm depot
heady crystal
#

Thanks!

#

Guess it's on to the next mod idea

quasi kernel
#

That reminds me, I had an idea for searching couch cushions.

#

How painful would something like that be?

calm depot
#

a bit awkward, you've have to change the tile definitions for all the couches

quasi kernel
#

Not as like containers tho

#

As a context action

calm depot
#

oh, if you want to fake it so that it uses something that's totally separate from the real container logic, sure

quasi kernel
#

Cuz I imagine it'd be as easy as making a small loot table, adding a context action to whatever tiles are counted as couches, randomizing some items when you interact with the couch for the first time, then just pull random items / occasionally fail from there.

calm depot
#

it isn't, it won't

quasi kernel
#

Agony

calm depot
#

oh, you don't mean the game's loot table

quasi kernel
#

Yeah I mean a static one

calm depot
#

yeah, you can do that, but you'll need to also either roll your own UI or cannibalise the game's one for picking out items

quasi kernel
#

I'm just thinking it'd be like

#
  • Right Click Couch
  • Check Couch Cushions
  • Roll random number if we get an item, then roll a random number to see what item.
  • Make the player say something according to what happened
  • Give the player the item if it was obtained
  • Remove item from couch's current loot
crimson ore
#

ive extracted the images from a pack file now how would i put them back into its original state so its read by the game?

#

i tried the .pack tool but cant figure the create a pack out, is there a link in one of the channels here

calm depot
#

there's a tutorial on the forums for working with pack files

crimson ore
#

the indie stone?

calm depot
#

@quasi kernel OK, that's relatively trivial if it's just one item. very doable

quasi kernel
#

Yeah I'm just thinking we generate a random "storage" for a couch when you initially interact via modData, then you just grab from that storage one at a time.

#

Primitive, but less intrusive I imagine.

jagged ingot
#

Good evening / morning.

quasi kernel
#

Hihi!

calm depot
#

not sure I'd even worry about storage; just set an isLooted flag

#

or if you particularly want a couch to have a few runs until it's empty, give it a counter to decrement from upon the very first loot action

quasi kernel
#

Oo smart

#

I like that idea

#

Then I can just randomize items on a per-action basis

calm depot
#

yep, no need to give it an actual inventory - players will never know the difference anyway

jagged ingot
#

I periodically see people posting questions about projects or commissions here so if someone sees this and needs work done for server or personal mods, feel free to DM me. I also run a market for people who do the same thing so DM me if you want a link to that.

#

(LFW) πŸ™‚

calm depot
#

a market?

jagged ingot
#

A simple thread setup with rep channel for people to post projects or small jobs for people looking for that sort of thing.

#

It's a part of the network / org server I'm a part of.

#

People already posted work and some of that work is already completed too.

ancient grail
ancient grail
quasi kernel
ancient grail
#

im not familiar with timer mod can you giv eme an example ? lets say you can only interact once a day

#

or you have to wait 24hrs or somethign

quasi kernel
#

Timer mod I'm not quite familiar with either.

#

I just used TimedAction

ancient grail
#

im such a newb but in theory its probably like this ??

#

local function ISlooted()

return

if not ISlooted() then
performLootAction()
end end

if timer = timer then
local ISlooted() = false
end
end

local function performLootAction()
getPlayer():getInventory():AddItem("thread")
end

#

or am i waaaay offf?

quasi kernel
#

Also, for ref, I don't really need a cooldown since there's finite items in the couch anyways

#

But to entertain the idea, we'd likely have to find a time value that is affected by game time.

ancient grail
#

SendCommandToServer(string.format(""/servermsg" .. getPlayer():username() .. "took from the couch!""));

#

and to send the msg

#

im so not sure if thats correct lol

frosty hull
#

When I subscribe to a mod if im using a laptop and go to my pc, will all the mods I've subscribed download themselves once steam boots?

quasi kernel
#

How does one translate recipe names?

#

Nevermind, it's already formatted for you, you just have to match up the names.

#

Okay so better question, is there any particular reason why the action keeps playing even after it's completed with a custom TimedAction?

#

It's specifically the animation, everything else works perfectly fine.

drifting ore
#

for custom outfits

#

can i use itemGUIDs from other mods

#

or do i have to create my own

#
            <probability>0.3</probability>
            <itemGUID>bd83cfe9-e3c9-4281-be7d-f2a054c94a5c</itemGUID>
        </m_items>        ```
marble lynx
#

Do I have to upload to the workshop in order to test my mod? Or can I load it in locally

drifting ore
#

you can do it locally

#

in zomboid/mods

shadow geyser
marble lynx
ivory gyro
#

Hi, someone have fix for Cannot create recipe for this movable item: Base.MandoDBPoster ?

My code :

module Base
{
    item MandoDBPoster
    {
        Weight    =    0.2,    
        Type    =    Moveable,
        WorldObjectSprite =    oxum_posters1_01,
        DisplayName    =    MandoDB Poster,
        Icon    =    Poster,
    }    

}
drifting ore
#

Cant i just use the GUID provided byvthe mod

shadow geyser
#

oh I see, I thought you were making one for your own item. yes in that case I think it is appropriate to use the existing GUID. I don't think it is possible for the item to have 2 of them, one for your mod to use as a reference, and one for the existing mod to use.

drifting ore
#

dope

ivory gyro
#

Someone know why my poster is too big ?

#

in tilezed is not too big

marble lynx
#

Regarding step 3, what is this cached directory for?

marble lynx
#

am i missing a certain step πŸ€”

crimson karma
#

Train mod, me want drive big loud metal choo choo

gilded hawk
#

I get this error when I click to open the items list.
This happened after I added a new recipe and items

ERROR: General     , 1661873204273> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: missing argument #1 to 'sort' at KahluaUtil.getArg line:380.
ERROR: General     , 1661873204273> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: missing argument #1 to 'sort'
    at se.krka.kahlua.vm.KahluaUtil.getArg(KahluaUtil.java:380)
    at se.krka.kahlua.vm.KahluaUtil.getStringArg(KahluaUtil.java:330)
    at se.krka.kahlua.stdlib.StringLib.sort(StringLib.java:1501)
    at se.krka.kahlua.stdlib.StringLib.call(StringLib.java:130)
    at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
    at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
    at zombie.ui.UIElement.onMouseUp(UIElement.java:1228)
    at zombie.ui.UIElement.onMouseUp(UIElement.java:1183)
    at zombie.ui.UIManager.update(UIManager.java:809)
    at zombie.GameWindow.logic(GameWindow.java:261)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:764)
    at zombie.GameWindow.run_ez(GameWindow.java:680)
    at zombie.GameWindow.mainThread(GameWindow.java:494)
    at java.base/java.lang.Thread.run(Unknown Source)

Does anyone ever seen this?

drifting ore
#

Not the installed location

grim rose
#

KahluaUtil.getArg

line:380

Check this one

gilded hawk
grim rose
#

i have some spare time, i can see your items and crafting recepies

#

to help ya

marble lynx
#

Thank you!

winter thunder
#

Is it possible to have a vehicle that runs on electricity and not gas? I am not super familiar with the code limitations for vehicles, but would love to see about implementing a way to build an electric bike

gilded hawk
gilded hawk
grim rose
#

change it to time:30,

gilded hawk
#

It's commented at the moment

#

but I'll try

gilded hawk
#

There is something wrong in here:

item Bag_MedFannyPackFront
    {
        DisplayCategory = Bag,
        WeightReduction    =    50,
        ClothingItemExtra = Bag_MedFannyPackBack,
        ClothingItemExtraOption = FannyPack_WearBack,
        clothingExtraSubmenu = FannyPack_WearFront,
        Weight    =    0.2,
        Type    =    Container,
        Capacity    =    1.5,
        DisplayName    =    Medical Fanny Pack (Front),
        Icon    =    MedFannyPack,
        IconsForTexture = MedFannyPack;MedFannyPack_Red;MedFannyPack_Blue,
        OpenSound   =   OpenBag,
        CloseSound   =   CloseBag,
        PutInSound   =   PutItemInBag,
        BodyLocation = FannyPackFront,
        ClothingItem = Bag_MedFannyPackFront,
        CanBeEquipped = FannyPackFront,
        RunSpeedModifier = 0.98,
        WorldStaticModel = FannyPack_Ground,
    }
#

On the left is the vanilla fanny bag

grim rose
gilded hawk
#

Yeah

grim rose
#

aka comment it

gilded hawk
#

trying

#

Nopr

#

Oh

#

wait

#

Capacity = 1.5,

#

😐

#

Apparently I can't put 1.5

#

only an integer

grim rose
#

go with 2

gilded hawk
#

iswtg this is bullshit

grim rose
gilded hawk
#

Why can't I put 1.5 πŸ˜–

gilded hawk
jagged ingot
#

RIP.

gilded hawk
#

I swear I hate non-standard files so much, why is this not yaml, or JSON or anything common pain pain pain pain pain

quasi kernel
#

Is there a way to remove a recipe?

#

I found a way to make Better Batteries compatible, even if it's a bit lazy.

cosmic condor
#

Better use this app instead of using the TIS default image cherrypie

marble lynx
#

How do I make sure that updating local mod reflects the changes in the game I'm playing in

#

Do I need to disable and re-enable it?

cosmic condor
#

If your mod is published on the steam workshop, unsubscribe that mod

marble lynx
#

It's just a local mod

#

For now

cosmic condor
#

test your mod in -debug mode

marble lynx
#

I'm not sure if my changes are taking effect since it's just a weapon mod and I'm tweaking the damage and stuff

cosmic condor
#

and reload lua

marble lynx
#

Yeah that's what I'm doing

#

What's the fastest way to reload lua?

cosmic condor
#

click the button at the bottom right corner on the main menu screen

#

also depends on what your mod can do

marble lynx
#

Just a mod that adds a weapon(s)

cosmic condor
#

reloading lua should do it

#

also when pausing the game with ESC key, you can see your active mod list

marble lynx
#

thank you πŸ‘

quasi kernel
#

I'd prefer not doing that if I can-

cosmic condor
#

I don't see the bigger picture of your mod though

#

maybe what I understand is not what you are trying to do πŸ˜…

quasi kernel
#

I'm wanting to add a specific tag to all of the flashlights of another mod, add them to the base game "Remove Battery" recipe, and remove their custom "Remove Battery" recipe

cosmic condor
#

I guess if you want to add compatible support like this, you may have to put those mods as requirements to ensure loading order

#

but I may be wrong, if there are other ways to implement this

quasi kernel
#

I think you can require iirc

cosmic condor
#

Yes, but that will require the users to subscribe to those mods even if they don't want to

#

if you are willing to do that, I believe replacing recipe txt files with removed recipe txt files with identical names can do the job

marble lynx
#

If I drastically increased the damage of the weapon (just to see if there's any difference) and nothing changed even though I reloaded the lua + tried closing and reopening the game, what's going on

cosmic condor
#

vanilla item?

marble lynx
#

Modded weapon

#

Been troubleshooting for the past 1.5 hours to little success

#

Maybe it's because I need to start a new game/scenario or the mod values don't update?

quasi kernel
cosmic condor
quasi kernel
#

I see, oki

#

Thank u tho!!

marble lynx
#

It seems that it really is the case

#

my time.....

cosmic condor
#

you should be happy that you found the cause πŸ˜€

tight bough
#

could someone help me?

cosmic condor
#

I would if I could. what's your problem?

quasi kernel
#

Oh wait

#

I can make a sub mod for Better Flashlights tweaks

cosmic condor
tight bough
cosmic condor
tight bough
#

the black screen

#

when u enter on any server

cosmic condor
#

hmm, no idea. never see anyone doing it

tight bough
#

do you know where can i find the black screen on files?

cosmic condor
#

no clue at all

#

great idea though

tight bough
#

thanks, i wish i could make an old pics on my server's loading screen

cosmic condor
#

but you can change those texts on the loading screen

tight bough
#

ikr

shadow geyser
quasi kernel
#

Will mod load order affect things or should I be okay?

#

There's technically loads after mine, but their scripts point to a diff function that I can probably modify.

#

And would a sub-mod be overall better or just complicate things?

shadow geyser
#

so scripts should all be loaded before lua stuff, so won't be necessary, unless they are also manipulating the recipes in lua code. If it is just like and Oncreate or Ontest that is belonging to a recipe, you should be able to just overwrite their function if you want to.

quasi kernel
#

That's what I figured

marble lynx
#

Regarding scripts, must recipes and weapon stats be on separate txts? Or it's ok to put them in the same one as long as they're probably denoted?

shadow geyser
#

nah you can put them all together tmk. I think it's more of a modders preference how to organize them. There isn't any technical need to seperate them TMK. I've seen people separate into items files or recipes files. or putting related recipes and items together so maybe you have a big mod. you have all your farming related items and recipes in one txt. then all your clothing related stuff in another etc.

marble lynx
#

Yeah I personally rather have it all in one place πŸ€”

quasi kernel
#

Is there a way to get an item from it's FullType?

#

Think I found it

#

ScriptManager:getItem()

vagrant rampart
#

Hi all! I've got something that has me perplexed with my first mod: Is it possible to make an attachment for an item that is NOT a weapon or clothing? I want to be able to attach one electronic item to another without having to make a separate model of the two conjoined objects (like the spear weapons) to save on memory, similar to the way you'd put a scope on a gun. Do I have no other way of doing this besides making a recipe for a separate model with its own separate texture? I couldn't think of or find any items I've encountered either in the base game or the workshop thus far that let you do something like this.

quasi kernel
#

If you really want to avoid the Recipe route, I believe manipulating Context Menus and ModData is your best bet. @vagrant rampart

blissful shard
#

Hello fellow modders, I am wondering if it's possible to add a custom moderator role with limited commands to my dedicated multiplayer server. I do know about each role such as Admin, Moderator, Overseer, GM, and Observer. I also read the forum post about it which someone stated that we will be able to customize it in the future. Going back to what I said, is it possible to make a mod specifically for making custom moderator roles right now?

jagged ingot
halcyon dagger
#

would I be able to change zombie speed from server script? πŸ€”

tranquil reef
#

Would it be possible to override the death animation? So I could create new ones for specific deaths?

zenith smelt
#

Anyone know about
getServerOptions():getInteger("ResetID")
DDoes it work in shingle player?

astral dune
#

One mod I want more than anything is to be able to actually pull engines out of cars, rebuild them with different selections of parts that modify its properties (horsepower, quality) and possibly the transmission as well to change things like number of gears or type of shift.
Seems so obvious that the fact it doesn't already exist and people live with the boring "spare engine parts" mechanic tells me its probably not possible with the current code.
Am I onto something?

zenith smelt
#

I dunno, I think that might work

gilded hawk
#

How can I add a new retextured crate to the game?
I know how to add clothes and how to code, but never worked on furniture

calm depot
#

Tilesheets in .pack files

gilded hawk
calm depot
#

Then, what is it you want to do

gilded hawk
# calm depot Then, what is it you want to do

I'm looking to do the following, you pickup a container as example the Green_Wall_Locker and thanks to a Recipe, you can turn that container into a specialized container who has 50% more capacity, but can only get one kind of on item, eg: Ammo

#

I'm already doing this for some bags, and backpacks, but I need to do it for furniture too

calm depot
#

yeah, you'll need to create a new tile definition

#

if you're not recolouring it or anything then you don't care about the texture pack

#

unless things have changed, there is sadly no lua API for changing container size

gilded hawk
#

Oh, damn.
If I want to use the texture pack, Can you pass me an example or send me a guide?

calm depot
#

see my Craft Metal Drums & Rain Barrels mod

#

I added custom metal barrels that can be used as storage

#

(and also a recipe for turning them into drums with the lid cut off)

gilded hawk
#

Dude I will kiss you one day

#

Thank you

#

I assume I need to use an external tool to edit 2744974916\mods\CraftMetalDrumRainBarrel\media\tiledefinitions.tiles right?

calm depot
#

TileZed

gilded hawk
#

Alright thank you

calm depot
#

so, external, but also official

gilded hawk
#

Oh very nice

calm depot
#

you can just download the PZ modding tools on steam to get it

gilded hawk
#

I will thanks!

sour island
#

Is there a way to read a player's ping?

fiery pecan
#

anyways, was a way to define multiple textureLights for a vehicle, based on the skinIndex found?

calm depot
#

@sour island getServerStatistic() will return everyone's ping, but I suspect the server will boot you for querying it if you're not admin

#

see client/DebugUIs/DebugMenu/Statistic/ISGameStatisticPanel.lua

#

well, admin/privileged to some level

sour island
#

isoplayer has a getping apparently

calm depot
#

so it does - I imagine that'll be the ping from you to them, rather than them to server