#mod_development

1 messages · Page 220 of 1

rancid panther
#

i think if you're treating someone else

cosmic ermine
rancid panther
#

i mean, for it to count as work

cosmic ermine
#

I'll do that in the multiplayer patch, I have no way to test the mod in multiplayer right now so I'm focused on singleplayer.

rancid panther
#

however, first aid is kinda weird in terms of defining it as work, since it is basic survival rather than doing tasks towards a main goal

cosmic ermine
#

I won't count crafting because of stuff like "Put Nails in Box" and "Open Box of Nails" lol

rancid panther
#

yea ofc

#

are the tasks weighted or do they all reset the non-working stress once you perform an action?

cosmic ermine
#

But there's too many crafted items.

rancid panther
#

if it just resets, it might be wise to exclude it completely, since all first aid can be done on the go repeatedly as long as you have an injury to treat

#

for example, removing a bandage and putting it back on, or stitching and unstitching a wound

cosmic ermine
#

Yeah.

#

There are stuff I've patched before to avoid exploiting it such as:

function ISAddGasolineToVehicle:perform()
    -- Avoid spamming siphon and add fuel options.
    local minCapacity = self.part:getContainerCapacity() - 0.5
    if self.part:getContainerContentAmount() <= minCapacity then
        ISTPManager.Workaholic:finishWork()
    end
    return ISTPISAddGasolineToVehicle.original_perform(self)
end
```and
```lua
function ISTakeGasolineFromVehicle:perform()
    -- Avoid spamming siphon and add fuel options.
    local minCapacity = 0.9
    if ISTPISTakeGasolineFromVehicle.initialItemUsedDelta <= minCapacity then -- Cannot use self.item:getUsedDelta() here because this is when the action is finished.
        ISTPManager.Workaholic:finishWork()
    end
    return ISTPISTakeGasolineFromVehicle.original_perform(self)
end
#

I'm not sure I can do that with stiching and unstitching even though I have a solution because it's quite complicated and I'm lazy.

rancid panther
#

there's a variety of ways you can balance it, so it's up to you to decide which way is best for your mod

cosmic ermine
#

This single trait is so tedious lol

rancid panther
#

one such way could be to set a daily limit per action

cosmic ermine
#

Nah, Workaholics have no limits.

rancid panther
#

so u can only do the same action once per day to decrease stress

cosmic ermine
#

They'll work until they die if they want.

cosmic ermine
rancid panther
#

yea i mean workaholics feel more productive if they actually complete necessary tasks right? they wouldnt cheese their condition by repeating the same task that isn't productive after doing it the first time

#

so if you set a daily limit it could simulate a workaholic's need to do everything throughout the day

#

but that is just an example. i dont know how you would personally balance it, and you probably have better ideas already

cosmic ermine
#

Nah, too tedious.

rancid panther
#

and here's a really dumb idea, but you could give them a daily task list 😂 and make them go out and do certain things every day to manage their stress

#

(until the impostor comes and eats them alive)

#

but yeah, it would take a LOT of work to make the trait feel accurate to how a workaholic would behave

cosmic ermine
#

This trait has been tedious so far, 80% of it is just copy-pasting code, renaming stuff, and testing.

rancid panther
#

I feel you

#

When I made my first mod, all it did was let you spawn with skill points and weapons

#

And then I wanted to make a Bitten trait as a joke

#

which required me to actually do some coding

#

and after that, I ended up making an Immunity trait mod to go with it

cosmic ermine
#

Hehe, I got a 300 points award.

rancid panther
#

speaking of which, i just realized I fixed the immunity system module of my mod, but not the lone-standing trait module panic

#

i have to fix it!

#

nice! awards are nice to receive

#

oh wait past me did fix it phew 😅

cosmic ermine
#

This are the last few ones I haven't coded yet.

rancid panther
#

nice

#

ur getting there

cosmic ermine
rancid panther
#

i see

cosmic ermine
#

Alright, I've pasted in the codes, all I have to do is test now.

#

Then Workaholic trait is finally actually done.

cosmic ermine
rancid panther
#

that's a pretty cool one

#

i think a lot of traits r unique and different so it's cool seeing everyone's ideas

cosmic ermine
#

I'm not sure about this one, it was suppose to make you clumsy and then gain the strength modifiers but decided to remove the clumsiness since it's hard-coded into the Java.

#

What other name should it be called?

rancid panther
#

what does this mean? you gain stats when ur in panic mode but then get tired really fast?

cosmic ermine
rancid panther
#

some of these names might be taken already, but I think of Adrenaline Rush, Fight or Flight

#

also, it seems like a trait that would be more beneficial to weak and unfit players, as stronger and more fit players would get capped earlier (unless you can actually go above 10 with this trait)

bright fog
cosmic ermine
rancid panther
#

i would just go with Adrenaline Rush if it isnt taken, or Fight or Flight

ivory gyro
#

Just making an node app for auto making the server config Mods= et WorkshopItems=

#

Anyone want ?

#

Open source code

sage mantle
#

not working any ideas? -- Function to destroy vehicles local function destroyVehicle(square) local vehicle = square:getVehicleContainer() if vehicle and not string.find(vehicle:getScriptName(), "TigerII") then if string.find(vehicle:getScriptName(), "burnt") or string.find(vehicle:getScriptName(), "smashed") then sendClientCommand(getPlayer(), "vehicle", "remove", { vehicle = vehicle:getId() }) end end end

sage mantle
#

not giving any errors in the console just not deleting the vehicles as expected

#

building damage, kill zombies, and the main function all work, just this one seems to not be working

#

Maybe because I'm trying to do it with sendclientcommand?

cosmic ermine
#

print(getPlayer():getInventory():getClothingItem_Legs():getDisplayName())

compact dirge
#

Hey, I've got a little problem with the clothing.xml file, I've got 2 clothing items, and I want that zombies spawn with either one of them (2x25%) or both of them (25%), but never spawn with none of them (25% :/ ), that's why the <probability> isn't the best option here, what can I do to find a workaround that ?

#

Do I need to do some lua ?

cosmic ermine
#

print(getPlayer():getInventory():getWornItem("Pants"):getDisplayName())

#

Bruh, why aren't these working.

fast galleon
cosmic ermine
#

How do I get the pants the player is wearing? And if possible include the underpants too.

#

Son of a..

#

It was a player method.

#

print(getPlayer():getWornItem("Pants"):getDisplayName())

#
local player = getPlayer()
local wornItem = player:getWornItem("Skirt")
if wornItem ~= nil then
  print(wornItem:getDisplayName())
  wornItem:setWetness(30) 
end
#

Torso1Legs1
Legs1
Pants
Skirt

#

Hmm, so you can't make underwears wet for some reason.

frank elbow
#

They don't get dirty at all or allow cleaning, if I remember correctly. They oughta

twilit kayak
digital osprey
#

good afternoon! im trying to replace an item on the ground after a timed action, it shows up in the floor container but cant figure out how to show the actual mesh on the ground, this is what i have now:

local _item = sq:AddWorldInventoryItem("Base.UnusableWood", _x, _y, _z);
_item:getWorldItem():addToWorld();
self.floorcont:AddItem(_item);

i tried using sq:transmitAddObjectToSquare(_item) but it throws errors, noticed in the docs that the method expects an int too but not sure what it wants

nocturne swift
#

hi! Tell me how expensive it is in terms of resources in UI:render() to compare var1 == SandboxVars.SU.RegisterDock ?
Or is it better to place the SandboxVars variable in an external variable and poll it, for example, once every 10 game minutes?

#

in other words: are the SandboxVars variables stored on the client side or is the server polled each time?

compact dirge
#

Hey, where can I find any documentation for the <subItems> tag in clothing.xml ? I can't find any

hallow cradle
#

Hello everyone. I want to start making mods but don't know where to start. Need guide please. Thank you.

hallow cradle
#

any good yt video for LUA learning ?

#

and how long does it take to learn it ?

outer crypt
#

I just noticed on a vanilla server that the radios are duplicating text... Is this a known issue? I suspect this may be related to another bug I am tracking where a pickup up radio is still showing the test on the ground where it was but only in MP.

#

Starting into the server the radio is normal, picking it up and placing it again starts the double lines...

#

in single player I don't get the duplicate entries...

cosmic ermine
outer crypt
#

zero

#

found this related through... it does exactly what I see in game, something is being left behind in MP when a radio is picked up.

#

Since a mod I have works on radio positioning, this is a problem. I need to figure out a way to identify what is left behind and remove it. Otherwise ghost radios are left everywhere...

#

I imagine when the world item is being removed, it's not being updated to the server and down to the clients.

#

Move a radio 3 times and get ghosts left behind

nova socket
#

Happened to check out B42 feature with negative Y plains (underground, basements) and just realized how funny it would be to have a mod that allows you to dig underground tunnels on existing map, like between two houses kek

#

Or windows traps so zomboids and players fall into the hole thats exactly in front of that window

bright fog
#

All these will definitely be doable

neon bronze
#

Cant wait to make my little bunker in pz and dig tunnels over the whole map

bronze yoke
#

not sure it'll be that simple, not all chunks have all z levels

#

it'll happen for sure but it'll be a little jank

neon bronze
#

Thats pz in a nutshell

nimble yarrow
#

how can I print the... object, in an ArrayList?
I tried print(tostring(myArrayList(i))) but that didnt work ><

bronze yoke
#

myArrayList:get(i)

neon bronze
#

myArrayList:get(i)

#

Should add that java arrays start at 0 and not 1 like the lua ones so you have to potentially index it at one lower

nimble yarrow
#

oh no LOL

#

so... for i = 1, myArrayList:size() do
I might as well start at 0 instead?

bronze yoke
#

i = 0, size-1

#

otherwise the last iteration will go out of range

nimble yarrow
#

print("iteration ", i, " ", myArrayList.get(i))

java.lang.RuntimeException: get: Expected a method call but got a function call. Correct syntax: E obj:get(int arg1)

neon bronze
#

myArrayList:get(i)

nimble yarrow
#

OOF

neon bronze
#

Imperative that you use : and not .

#

It actually says right at the bottom of your error how to use it properly

bright fog
#

<@&671452400221159444>

#

yup

#

welp

#

Let's hope for you don't get banned lol

#

You clicked some shit that gave access to your account

#

Probably nothing to do with a virus

#

You just connected to your discord account on a website or something

#

oof

vague raven
#

oof

#

welp he got banned

bright fog
#

<@&671452400221159444> hey uh the guy that you banned was getting back his access to his account

#

He was talking with us about it

#

poor guy

#

let's hope Discord fixes their shit with those embed links

vague raven
#

it waits to pop up that it's a hyperlink when it really shouldn't

lost slate
#

Ty

left plank
nimble yarrow
#

What do holes even do?
I put 10 holes in a 1/10 leather jacket, it still seems to have 65 insulation, 35 wind res, 45 water res, 20 bite def, 40 scratch def
(all same as 10/10 perfect leather jacket)

bright fog
#

I don't know them lol, I don't have them in DMs

bright fog
#

Check the sewing panel

nimble yarrow
#

innnnnnnnteresting. my tooltip was lying to me

proven meadow
#

Hi! I got a quick question, in the building tool, does the room type also dictate what kind of items can spawn 'outside of furniture' (like how you can find canned foods on top of counters instead of just on them)

nimble yarrow
#

I could be wrong, but I'm pretty sure items 'outside of furniture' are just hand-placed by the mapper.
If they aren't there every playthrough, it was either removed due to loot rarity in the sandbox options, or perhaps it was a 'story' that didn't spawn (everyone in the room is wearing baseball stuff / alcohol and chips and red cups / dead body with bleach bottle)

So no, I don't think the specific room type has any effect on world items. (but once again, im just guessing)

proven meadow
#

Ah alright, thanks!

bright fog
#

Items aren't hand placed by the mapper

#

You will have items that will spawn with item stories

#

Be it the mod that adds more of those or the vanilla ones (like finding food on counters in the kitchen for example)

drowsy delta
#

hey how do I get the players item that they're wearing?

local function InitalizeMod(playerIndex, player)
    print(player.WornItems) -- How do I get the players clothes / any item that they're wearing?
end

Events.OnCreatePlayer.Add(InitalizeMod);
nimble yarrow
#

not ideal, but you can use these...

#

nvm wornItems is an actual.... bodyLocationGroup? hmm

drowsy delta
#

is player just zombie.characters?

#

or like an instance of it

nimble yarrow
#

im pretty sure:
player inherits from isogamecharacter, which inherits from charcters, which inherits from zombie

drowsy delta
#

lol ok

bronze yoke
#

no, zombie.characters is just the package IsoGameCharacter is in

#

all of zomboid's classes are in the zombie package

thick karma
#

It's basically a file in a folder, where the file is called a "class" file and the folder is called a package.

drowsy delta
#

ok

#

ty

thick karma
#

This is its inheritance path:

#

So it is an IsoGameCharacter but more specifically it's an IsoPlayer

outer crypt
#

as I suspected, in vanilla in multiplayer the game leaves behind invisible radios when one is picked up...

bright fog
#

weird

#

How did you find out ?

#

I mean, what made you check that ?

thick karma
#

Poor Norby is trying to perfect a lot of weird edge cases with stopping sounds when radios move because he is working on True Music Radio @bright fog.

#

(Spared you needing to write that while you suffer, Norby.)

#

He accidentally figured this out while trying to understand why the radio would leave ghost audio for people as though radios were still in places they shouldn't be.

bright fog
#

I see

#

That could explain why when True Music boomboxes burn you still have the small text saying they are playing, tho those are items and maybe that was fixed since that happened to me

#

That could also explain why Survivor Radios when running on a radio breaks a save when it burns

thick karma
#

No idea on that front. I am very glad these weird edge cases don't apply to jukebox object lmao.

bright fog
bronze yoke
#

ugh that might mess with my radio mod too

bright fog
#

Maybe you could report the bug to TIS

bright fog
bronze yoke
#

it's an unreleased expansion for a true music pack that adds music playing radio stations, with dialogue intermissions and stuff

bright fog
#

damn

thick karma
#

Very closely related goals... And he already got the obvious name haha

#

True Music Radio has been live awhile now

bronze yoke
#

not for as long as this has been in development

bright fog
#

yup

bronze yoke
#

it was primarily written at the start of last year

bright fog
#

old project

bronze yoke
#

it's a collaborative project and there's been some computer issues and other such things holding back release

drowsy delta
#

where can i see all the luaEventManager's events?

thick karma
bronze yoke
#

i had a quick look at the page a while back and it doesn't look like the features overlap all that much

bright fog
#

Right forgot you had an updated list lol

thick karma
#

I guess we will have to wait and see!

bright fog
#

Survivor Radio is such a banger tbf so having something like with True Music that would be amazing

bronze yoke
#

basically there's a bunch of different radio stations each with their own announcers who speak between songs, usually just a 'that was... up next...' but with some rare longer dialogues

bright fog
#

Damn so basically like Survivor Radio

bronze yoke
#

i've never used it, so not sure

thick karma
#

That sounds like an intense project for sure.

bronze yoke
#

i'm quite proud of it, hopefully it sees release soon

bright fog
#

Like different radio stations with themes for songs and announcers who will talk in between radios or have longer dialogues

#

But the way they do it makes it so when you fastfoward you desync the radio and it will cut a song before it can finish

thick karma
bright fog
#

While current True Music makes it so you can fast foward and the full song will still play

bronze yoke
#

it was just an update for existing true music pack Music for the End of the World

thick karma
#

Ohhhh so it'll be a submod of that?

drowsy delta
#

how do i get the isoPlayer from a client script?

bronze yoke
#

if it were a standalone release i wouldn't've named it after true music though, it technically doesn't really have anything to do with it

bright fog
thick karma
bronze yoke
#

it doesn't share any code with true music or use its api or anything

#

the only commonality is that it plays music

bright fog
#

Wait it doesn't use True Music ?

bronze yoke
#

it was pretty immediately obvious that hooking into true music would be a waste of time, it's not built for it and it didn't look like anything true music did would actually be beneficial to this usecase

thick karma
# drowsy delta how do i get the isoPlayer from a client script?

Depends on the situation. It's good practice to try to identify the interacting player from context for split screen support, but for the KBM player or "player 1" in 2-player mode, "getPlayer()". Otherwise it could be self.character, self.playerObj, getSpecificPlayer(playerIndex), player itself, or any number of things. Context is everything here haha

outer crypt
#

TMRadio just pulls whatever True Music mod music you have and broadcasts it on stations. I plan on adding more to it, but the first stage is getting it stable. I figured out the ghost radios by tracking them on a tick... Once the radio was picked up, the tick continued...

#

The side effect is that I might be able to code an auto nuke of all invisible radios! Blasted monsters!

thick karma
bronze yoke
#

yeah, of course it shares sounds with true music but you can tell it to play whatever sound you want really

nimble yarrow
#

addHole(bloodBodyPartType, boolean1) Does anyone know what this mystery bool does?

bronze yoke
#

it's user configurable although admittedly a little dense

#

everything is set up by script files so it searches Lua/ and other mods for them too

thick karma
#

You're tempting me now. Now I want to make my own way of turning .ogg's into some new music item for non-TM .ogg's provided by expansions. We also don't use its API for much in TMJ.

#

Lol no must not do

#

Must live

#

Modding is a bad addiction

bronze yoke
#

it had me tempted to make my own true music competitor but ultimately i couldn't see any benefit to end users

thick karma
#

It's worse than all the drugs

bright fog
#

Didn't knew you made the End of the World true music pack Albion

bright fog
#

I'm having so much fun modding rn

bronze yoke
#

i'm not the original creator but i've helped with a lot of the lua and most of the lua in the forever upcoming update is my work

thick karma
#

Yeah I think most people enjoy TM so I don't see it as necessary. But it's tempting. For people who perhaps want our jukebox capabilities but don't like TM for some reason.

outer crypt
#

I'd rather see a good sound api, any modder just sends a soundclip to a location with volume and it plays automatically to multiplayer sync...

bright fog
#

True Music does a great job and the Cassette stuff just fits the game so well

bronze yoke
#

i don't know how your mod works but i would think about what benefit you actually get from hooking into true music

bright fog
#

idk how well made the mod is but eh

bronze yoke
#

i didn't see true music doing anything for me that playSound() wouldn't so i avoided it, but a jukebox is closer to true music's original functionality so it may be more helpful there

thick karma
#

I see two primary benefits: letting TM handle item management saves programming energy, and the large TM fanbase already wants to use all their TM packs, and it would feel a bit "aggressive" to tell people they could use TM packs without the TM dependency because I had written away any need for TM...

outer crypt
#

I love the jukebox, Burryaga made it godlike

drowsy delta
#

does pz have/use the string library? (for lua)

thick karma
#

Would feel almost mean lol, since TM is the reason all these great packs exist.

outer crypt
#

it's all about getting access to the music and playing it in a user friendly way

#

A nice twist would be pulling the TM music out of ambient and into the music channels...

thick karma
#

Yeah would need to mute the game's default music though, unsure about that. Even better imo would be creating a unique volume slider for jukebox music. Might actually try to solve that but I'm unsure if Java would need to be involved

#

That would be my dream goal though

#

Convert all music played via jukebox to its own volume type

bronze yoke
#

we didn't get around to implementing an actual setting for it but we have code configurable volume just by playing the sound quieter on the emitter

thick karma
#

Well we can lower the volume on the emitter fine but it still ultimately plays through ambient... So if you mute ambient you also mute jukebox. Is there a way to make our volume ignore a slider?

#

Would we just need to change the sound's type master or something?

outer crypt
#

yep, and evidently a lot of people play with their ambient levels jacked up

bright fog
#

do they lol ?

bronze yoke
#

i either never tested that or considered it an acceptable drawback

thick karma
#

Fair fair. I mean it is acceptable but still I can't help but dream of optimal

bronze yoke
#

if you're gonna mute the game just play music on youtube 😭

outer crypt
#

took a while to figure out what was happening when people said the music was too loud on volume level 1

thick karma
#

We offer a good range of volume that should work at most levels of ambient volume but I would still prefer to let people control e.g. footsteps separate from nearby music

outer crypt
#

yep, jukebox's own slider 🥹

thick karma
#

Yeah I just haven't had time to even consider how a new slider and type could be modded in

outer crypt
#

complicated I bet

thick karma
#

I don't fear complicated modding, I fear complicated installation

#

And users

#

They terrify me

#

Just in general

drowsy delta
#

how do i change moodles cause i've been searching and i only see get methods (for the moodle class)

outer crypt
#

I think there is a mod that allows the easy add and remove of new moodles if that is what you are looking for

drowsy delta
#

I'm looking for changing the 'amount' of unhappyness someone has

thick karma
outer crypt
#

In ISRadioInteractions.lua there is a list of many of the stats that can be changed

thick karma
outer crypt
#

even better

#

can I bring up the "y" now?

thick karma
thick karma
outer crypt
#

"Strewberrie"

#

the nightmare...

thick karma
bright fog
#

Wait you do that ?

#

For hapiness perhaps ?

thick karma
#

We have 1 sandbox page for Jukebox Therapy and one for Jukebox Nutrition

#

So that nothing about mood or nutrition will stop your friends from partying around a jukebox indefinitely (these settings are off by default, gotta enable them or it's just muzak).

#

@bright fog

bright fog
#

Jukebox Nutrition ???

#

I mean listening to music reducing depression definitely should be a thing

#

(especially how easy your character can get depressed)

thick karma
#

I understand it's not the taste of everyone who plays Zomboid, but sometimes my friends just wanna dance until the zeds come, kill them, and repeat.

#

Being able to eat is fun, needing to eat is a chore

#

shrug

bright fog
#

Nah I get it

#

Not my way of playing tho hahalol

thick karma
#

Haha that's why I didn't force those options in everyone lol I think 90% of Zomboid will leave Jukebox Nutrition off

#

But it does nothing when off so it's not gonna kill anyone

bronze yoke
bright fog
#

Gosh I'd be dead already

#

I listen to so much music

thick karma
#

If anyone ever asks in earnest I would probably make the adjustment

thick karma
#

🤨 @bronze yoke @outer crypt @bright fog

#

Could it be so?

#

It's even automatically gamepad compatible... It feels too good to be true.

bright fog
#

uh

#

didn't follow your conversation so no idea

thick karma
#

Oh sorry lol thought you were in on the volume chat

#

My bad I may have mixed people up

outer crypt
#

oh boy!

thick karma
#

Apologies for frivolous ping

#

(I still haven't solved forcing the sounds to register on my volume channel or wired up anything really... it's just a phantom option.)

#

But adding the option on its own page is tempting...

#

I guess I wouldn't strictly need to change volume types. In theory I could use this option to simply adjust our volume directly so that people can max ambient and mute us if they want... Though that would require ambient be left on to hear us (as is already required). Still seems like a definite improvement

drowsy delta
#

how do i reload a characters appearance?

thick karma
#

Working in game, although I need to exit menu before the audio will update. @bronze yoke

local DOME = require("DOME")

local GameOption = DOME and DOME.require and DOME.require("GameOption")
local GameOptions = DOME and DOME.require and DOME.require("GameOptions")

if GameOption then
    
    JukeboxSound.userVolume = 5

    Jukebox.MainOptions = {}
    
    Jukebox.MainOptions.create = MainOptions.create

    function MainOptions:create()
        -- I don't think this is actually necessary; it's protective.
        local creation = Jukebox.MainOptions.create(self)
    
        self:addPage("TRUE MUSIC JUKEBOX")
        
        self.addY = 0
    
        local y = 20;
        
        local splitpoint = self:getWidth() / 3;
    
        local comboWidth = 300
    
        local control = self:addVolumeControl(splitpoint, y, 
            comboWidth, 20, "True Music Jukebox User Volume", 0)

        local gameOption = GameOption:new('jukeboxVolume', control)
    
        function gameOption:toUI()
            local volume = math.min(10, math.max(0, JukeboxSound.userVolume))
            self.control:setVolume(volume)
        end
    
        function gameOption:apply()
            JukeboxSound.userVolume = self.control:getVolume()
        end
    
        function gameOption:onChange(control, volume)
            JukeboxSound.userVolume = volume
        end
    
        self.gameOptions:add(gameOption)
    
        return creation
    end
end

(DOME is a WIP I'm going to release alongside our Sunday update.)

bright fog
#

nice

#

Is anyone familiar with SendCommandToServer and if it's possible to intercept it ?

cosmic ermine
#

Has anyone made a trait similar to Cat's Eyes?

#

It's hard-coded so I don't know how to do it in Lua.

cosmic ermine
#

getPlayer():getBodyDamage():setOverallBodyHealth(0)

sage mantle
#

is there a specific name for fences? like if I want a function to destroy specifically fences and poles when they are hit with a vehicle

hallow cradle
#

How long dose it take to learn LUA ?

#

btw how to learn making mod with LUA. Should first just watch video or should I ask ChatGPT to explain examples?

sage mantle
hallow cradle
sage mantle
# hallow cradle so you build everthing through ChatGPT ?

Yeah like I'll look at all the functions and kind of figure out what each one does based on like what its saying. Like if its spawning a burnt texture on the ground for instance and the mod spawns an explosion I know that is a related. So I'll as GPT like I want to do so and so to this explosion funtion and it'll pump out something

#

then I just go back and fourth until it work in debug mode

frank elbow
#

I personally do not recommend doing that if your intent is learning the language

#

(That was directed at Xille, since the question was asked)

hallow cradle
#

I want to learn LUA First then Python

frank elbow
#

If you learn well via reading, I recommend reading through Programming in Lua (https://www.lua.org/pil/contents.html#P1). Otherwise, there might be a SoloLearn course (unsure) and there's certainly a LearnXInYMinutes that can show you the basics quicker

#

If reading isn't your thing, there are plenty of videos that teach stuff. Either way, the best way to learn is by using it

sage mantle
#

Idk I just been poking around game code for a long time and reading it and messing with it and can just kinda see what different code does now based on the statements and math/variables used

hallow cradle
#

@frank elbow is it true that this is easiest and the best for beginners (Lua)?

frank elbow
#

The answer to questions like that is always “it depends.” There are certainly measurable things that could make it easier—it's a scripting language, after all, and it's nowhere near as feature-rich as something like C#—but it's difficult to say whether it's the “easiest.” It's the second programming language I learned, though, and probably one of the easier ones

#

The only concept that might take some getting used to is metatables, but you don't need those for most use cases

hallow cradle
#

Okay. Btw thank you for guide ( @frank elbow and @sage mantle ). Hopefully i'll be able to start making mods very soon.

#

one more thing: notepad++ or visual studio ?

sage mantle
hallow cradle
sage mantle
hallow cradle
#

hold on Zomboid is made in java not lua ?

sage mantle
#

I think it uses both

#

if I'm not mistaken

hallow cradle
sage mantle
#

like most of it is java in the main files but theres allot of lua files that do different functions

#

but I literally just learned about the javadoc a few days ago lol

#

Speaking of which, is there a way to get the names of specific isometric objects in the game like fences and stuff?

neon bronze
#

try :getName() perhaps

mellow frigate
sage mantle
#

hm nah I dont see it in the javadoc

#

oh theres one called gethoppable, I wonder if I did like a check to see if the square is hoppable and if so then just delete whatever is on the square

digital osprey
#

im trying to replace an item on the ground after a timed action, but i cant figure out how to actually make the mesh appear on the ground, i have this for now

local _item = sq:AddWorldInventoryItem("Base.UnusableWood", _x, _y, _z);
_item:getWorldItem():addToWorld();
self.floorcont:AddItem(_item);
--sq:transmitAddObjectToSquare(_item);

tried using transmit but it doesnt work, and it thows a phantom error w/o anything in the console

#

also, how does one get rid of that plunger icon 😄

digital osprey
#

awesome 😄

mellow frigate
sage mantle
#

well quickest way

mellow frigate
sage mantle
thick karma
#

It's called Darkvision

#

You're welcome to review and refactor my solution to your own ends.

#

I had to do it by moving a local-only light source along with the player everywhere they go

#

Idk any other ways

cosmic ermine
thick karma
#

Basically

#

It's highly customizable so if your goal is a brighter or less effective Cat's Eyes, I suspect both would be possible

cosmic ermine
#

Damn, that looks quite complicated. I'll check it out tomorrow after work.

#

I have to sleep in a few minutes.

thick karma
digital osprey
#

i figured it out.. its because i was getting worldpos instead of square pos, is there a way to get the exact position of the item? looking through IsoWorldInventoryObject methods but nothing seems to return what i need

nocturne swift
#

Hi, Are SandboxVars variables stored on the client side or is the server polled every time they are accessed from Lua code?

mellow frigate
digital osprey
#

getOffsetX() and Y are there for isoobject but no z

mellow frigate
#

z is probably on the item itself

digital osprey
#

cool thanks for the answer! ill get to work

shadow tangle
#

Hiya, Im very new to modding the game and i was wondering if i could get some help with something im trying to do

#

Im trying to make a new addiction trait and item. I am currently going through the game code to find out how to do it but I can not find the code for how the smoker trait is implimented

#

I was wondering if anyone knows where i can find that since all I can find is the "MainCreationMethods" lua where it defines smoker but does not actually impliment the mechanics

#

Actually I may have just found it but I cant tell because it is unreadable and im not sure why

#

like i said im very new so if im going about this completely wrong i appritiate any guidence

lunar goblet
cosmic ermine
#

Most traits in-game is hard-coded into the Java source.

shadow tangle
#

hmm is there a better way to go about implimenting this then

shadow tangle
lunar goblet
shadow tangle
#

Got it ill look for that

thick karma
shadow tangle
#

thank yall

bright fog
#

Is anyone familiar with SendCommandToServer and if it's possible to intercept it ?

mellow frigate
bright fog
#

I mean detect whenever SendCommandToServer is used

#

I'm trying to detect whenever zombies are deleted with RemoveZombies commands

#

And those are triggered with SendCommandToServer

#

I need to stop Emitters of zombies getting deleted or I end up with vocals of zombies still getting played where they were

#

Not exactly sure why that happens but it seems like the game doesn't reset their vocals

#

There's more detail in the PZ modding Discord coding channel

thick karma
bright fog
#

One example for the remove all is this which is ran from the lua

function DebugContextMenu.OnRemoveAllZombiesClient(zombie)
    SendCommandToServer(string.format("/removezombies -remove true"))
end
thick karma
#

I'll try to remember to send you that in a few hours if someone else doesn't beat me to it.

bright fog
#

👌

#

thx a lot

#

Unless maybe I can detect a lua function being ran ?

thick karma
#

Although wait you need to access the Zombie?

bright fog
#

No

#

Yes

#

I mean I need to access the zombie getting removed

thick karma
#

Then you need to decorate the Lua function not the Java call

bright fog
#

From looking at the lua and java

#

Whatever, just I need a way to detect zombies getting removed and be able to access their IsoZombie

thick karma
#

DebugContextMenu is vanilla?

bright fog
#

yea

#

That's the lua files

#

DebugContextMenu.lua

#

I guess I could rewrite that function to send my mod a command that triggers a function ?

#

The issue is accessing the zombies

#

And making sure my function is ran first before zombies are removed or I won't be able to get them

#

In the case of remove all zombies it's fairly easy I guess

thick karma
bright fog
#

No probably not

#

Haven't found anything that adds to event manager

thick karma
#

Make sure no Events.something.Add call associated with that function in vanilla

#

But assuming it's not already bound to an event you can decorate like this...

#
local SirJvlaModule = {}
SirJvlaModule.DebugContextMenu = {}
SirJvlaModule.DebugContextMenu.OnRemoveAllZombiesClient = DebugContextMenu.OnRemoveAllZombiesClient

function DebugContextMenu.OnRemoveAllZombiesClient(zombie)
     SirJvlaModule.madeupFunction(zombie)

SirJvlaModule.DebugContextMenu.OnRemoveAllZombiesClient(zombie)

end```
bright fog
#

What does this do ?

#

I mean

#

Does that replace the vanilla function ?

thick karma
#

Overrides old version but calls the original

#

So all vanilla stuff still happens

#

While also letting you operate on zombie first

bright fog
#

But that would run two OnRemoveAllZombiesClient ?

#

Also, the zombie tag is unused

#

Doesn't retreive the zombie

thick karma
#

Oh sounds like an odd function

bright fog
#

Yeah idfk why they added that zombie tag

thick karma
#

I will probably have to see it at home then

bright fog
#

Literally doesn't do anything

thick karma
#

To confirm how it's called

bright fog
#
    if isClient() then
        subMenu:addOption("Remove All", obj, DebugContextMenu.OnRemoveAllZombiesClient)
    else
        subMenu:addOption("Remove All", obj, DebugContextMenu.OnRemoveAllZombies)
    end
thick karma
#

Might not work as a place to intervene if no access to Zombie object

bright fog
#

That's the place where it's called

#

In the case of removing all zombies it's easy

#

I get the zombieList of getCell()

thick karma
bright fog
#

obj has nothing

#

In the case of the menu to spawn hordes, the remove zombies button it gets the zombies in the radius, haven't checked if I can access that info

thick karma
#

Weird I'll have to look at the vanilla chain of events but it's very odd if they have a useless parameter in that signature.

#

I am not home unfortunately

#

Wrote the above on my phone

bright fog
#

yeah np

#

This is the function that calls the remove all zombies function

#

The command sent to server in the java is supposed to stop all emitters but for some reason that part doesn't trigger when I manually changed the vocals of the zombies but when running the method myself to stopAll() getEmitter() it does stop sounds

thick karma
#

Super weird

#

I'll probably need my computer to solve this one

bright fog
#

👌

thick karma
#

Looks like the obj is a relic of possibly having those lines of code lower down the function in original version

#

Since obj gets a definition 4 seconds after those calls

#

(okay immediately after, 4 seconds is a terrible figurative way of saying very fast in programming)

bright fog
#

Probably used it before, but then they stopped

#

And possibly they need to add that obj argument in the command

#

empty or not

thick karma
#

They do

#

Because of the order of params

#

I prefer do give a meaningless label in those contexts to indicate variable being passed is nothing, or nil if I'm feeling boring

#

obj is a bit misleading, as is catching a zombie in the params of the target function.

bright fog
#

yea

#

Well there's a lot of stuff that are not perfect in the code lol

thick karma
#

In almost all code tbh

bright fog
#

yea

thick karma
#

Ain't nobody got time to go back and fix everything they ever programmed

#

Oof

#

Maybe with a few extra lives.

#

But I haven't found any in our simulation yet.

bright fog
outer crypt
#

I used remove all zombies in debug mode for testing, maybe there is something that happens out of sight that needs to be handled when that happens.

bright fog
#

In the java yes

#

Sends a command to the java

#

Idk how the java detects the use of a command tho

#

But what I know is that once it receives it, it checks a bunch of stuff, gets the list of zombies in getCell() and remove them

#

Tho it's supposed to remove their emitters too

#

But doesn't seem to do so in my case for the zombies which I set the vocals manually

#

All the detail in coding channel of the modding Discord

outer crypt
#

emitter whack-a-mole sounds familiar...

bright fog
#

watch a man as he decends into madness

thick karma
#

Goes through the metatable

bright fog
#

yes ik that calls out the java, but what I found for the sendCommand is that it's not directly linked to a java or idfk it's weird shit

thick karma
#

@outer crypt might have access to the patch function I was gonna share with you

bright fog
#

I think it might be something that detects the chat messages and verifies if it's a command

#

Maybe a modder made a custom Events library that triggers on SendCommandToServer

thick karma
#

We'll get you sorted. The call from Lua to Java can definitely be hooked if that's your goal

#

You'll have to do something else to get the zeds though

bright fog
#

Yeah that's fine

thick karma
#

Maybe I can find the code in chat with Norby...

bright fog
#

My next idea is that I'm planning on creating a custom zombie spawning menu to spawn the zombie types the player choses to spawn and there will be a custom remove function in it too

#

But I won't remove the vanilla tools to spawn and remove zombies

#

I'll just add a custom menu exactly like Braven did with his zombie boss

#

But with different options to spawn the type of zombie the player choses to spawn

#

And a remove button too

#

Also seriously this emitter shit barely has shit to it

#

Like there's no fucking method to get the currently played vocal

#

To know what vocal is played

#

You need to run an IsPlaying(vocal name) to check vocals getting played

torn igloo
#

Doesn't the vanilla already have remove zombies on radius? Why reinventing the wheel?

bright fog
#

And I'm not reinventing it

#

Just creating a menu for spawning zombies types for my Zomboid Forge framework which allows modders to easily add zombie types with addons that work together

#

To spawn a specific zombie type you can't use the usual way because it will randomize it's zombie type based on its chances of spawning and other zombie types chances

bright fog
drowsy delta
#

how do i modifiy what items a zombie spawns with?

bright fog
#

Or clothing ?

drowsy delta
#

clothing

bright fog
#

I'll send you back to a similar discussion I had about this

drowsy delta
#

ok ty

bright fog
#

Bcs it can be long

#

But basically there's multiple ways:
-change outfits (will take you ages if you plan adding a clothing to every zombies)
-make zombie a reanimated player but if you do that for every zombies you'll just lag the game
-change the visual of the items the zombie has

#

The best way is definitely the visual change

#

It's what I use in the mod I sent in the convo I just sent you

#

You can also change underwears but it's weird

drowsy delta
#

if I do the visual change does it still update their drops?

#

like if I made a zombie wear a spiffo suit does it drop the spiffo suit?

bright fog
#

It does yes

lone hound
#

Hello, I wanted to ask for your help.

I'm looking to create a healing weapon to heal other players.

I managed to come up with this code using some examples, and the healing does work.
The problem is that with each hit (heal), the player ends up with wounds and bleeding.
Is there any way to make it work without the player getting these wounds?
NOTE: I don't want to use "bodyPart:RestoreToFullHealth()" because it heals fully.

bright fog
#

One question, why do you rewrite the variables attacker and weapon ?

#

Don't use getDisplayName to verify the item

#

use...

#

give me a sec

#

HandWeapon:getFullType() == "Base.BareHands"

#

Because if you translate the DisplayName in other languages the code won't detect it

#

Perhaps you could make the damage of your staff be 0 in the script files to stop it from dealing wounds ?

lone hound
bright fog
#

👌

#

Those are already local I think so no point in doing those probably

lone hound
bright fog
#

hmm

#

That sounds like you'll have to check the java to see how the game sets those up

lone hound
#

I don't have any more ideas on what to do.

bright fog
#

Wait how do you have a second player ?

#

Didn't knew you could do that

bright fog
rancid panther
lone hound
#

The ideal would be to improve your life and heal your injuries. But if you have the option to improve your life without causing new injuries, it is also valid.

cosmic ermine
bright fog
#

Going to be a full rewrite of the original mod

muted garnet
#

Tell me pls if someone knows where contains character`s sneeze code? Like sneeze sound range and text

cosmic ermine
#

It has a "Cold" in it.

muted garnet
robust locust
#

Hi peeps, I'm a first time modder and trying to create a mod, but am getting a little stuck... would anyone be able to give some assistance?
It's a guitar wall hanging mod, any help would be greatly appreciated

austere sequoia
#

Hey guys! I currently try adding a bunch (well... a ton) of items into the game - and I want them to be craftable.
I already got it working, but with roughly 1.6k recipees I feel like it is an absolute overkill. I wonder if there was a more elegant way.
Let me try and explain: My mod lets you craft one baseitem from vanilla stuff. This baseitem can then be altered into one of 80 different items. Each of those items then can be altered to use one of 20 different textures. Thats how I currently have 1.6k different items (example: Blue version is a specific item, Red version is a specific item, etc)
Can it somehow be done that maybe, instead of totally wrecking the crafting menu, those items might be altered via a rightclick menu? And is there maybe a more elegant way to make an item switch textures, without creating an extra item for each texture?

austere sequoia
robust locust
#

Yes sir, I do

bright fog
#

Also yes you can make them through a right click menu

#

For switch of texture I'm not too sure ngl I don't think I ever saw something like that in mods

robust locust
#

I hate having collected all the guitars but they look crap on the floor, so why not hang them on the walls... 😄
Unless thats been done already...

austere sequoia
# robust locust Yes sir, I do

have you read the wiki? It is pretty helpful. You will (afaik) have to add them as new tiles. It is not that hard, done it myself (and I am a noob too), but it can be tricky 😄

bright fog
robust locust
#

@austere sequoia I have, but there's still a lot that it doesn't cover. I've watched a load of tutorials too

austere sequoia
robust locust
#

@bright fog Yea, I'd like to use the 3d models so they rotate better, I tried with the image but it looks wonky

#

I've also looked for how light switches work, as I'd like the guitar mount to attach to the wall then with a right-click I can then attach guitar to the hanger

#

I was able to get the icon and static image thing in and it showed in the inventory and on the floor, but after making tiles so thet i can fix it onto the wall, it doesn't show on the floor lol

austere sequoia
robust locust
#

Ideally, once I can get it onto the wall, I'd like to take the guitars 3dobject into blender to render an accurate tile... so they look correct on the wall

#

@austere sequoia 😄 yea mine too apparently! I tend to jump into the deep end when learning something new panic

#

I copied the image from the wiki, but it looks wrong when I put it in place...

#

I tried looking for how the battery charger works, as in connecting a car battery to it has a similar mechanic to what Im after... but I dont know how to work out how it is all coded

bronze yoke
#

you can use the OnFillInventoryObjectContextMenu event to get the context menu when an item is right clicked on, and add a button to it that calls your function

drowsy delta
#

does Events.OnZombieDead also return the zombie container? (like the corpse)

bronze yoke
#

no, the event fires a little bit before the zombie actually turns into a corpse

austere sequoia
bronze yoke
#

you, but there's a similar event for world objects that raff could use

bright fog
robust locust
#

@bronze yoke I'd have to look that up, I guess that means i need to write a function? I was delaying that 😄

bronze yoke
#

i'm not sure of the extent to which texture swapping is possible, if you're just swapping the colour of the icon that does work but i'm not sure if it'll remain after saving and loading, and i know swapping the texture of a 3d modelled item isn't possible

bronze yoke
robust locust
#

@bronze yoke darn! AI needs to hurry up so I can use it to write my code ...

austere sequoia
bright fog
#

But technically you can already train a model to code in kahlua project zomboid

robust locust
#

so I guess I've gotta figure out how to get my mount onto the wall first with the tiles i made

austere sequoia
robust locust
#

can we get a pzbot in discord to code for us all? or is that too much?

bronze yoke
#

then what will i do 😰

robust locust
#

hahahah

#

make sure it's not trolling us?

bronze yoke
#

i've seen ai zomboid code posted here, it's always trolling you

austere sequoia
#

yes.... it takes a lot of debating until the code it gives you is actually working 😄

robust locust
#

just a matter of time

#

for now I want my guitars on my wals...

drowsy delta
bronze yoke
#

you can grab the zombie's inventory on that event and it'll be transferred to the corpse when it is created

drowsy delta
robust locust
#

To get an object from my inventory onto the wall, would i need a recipe for that or a function?

bronze yoke
#

:getInventory() should be it

drowsy delta
#

oh ok

#

ty

robust locust
#

i.e. do I go the route of building a wall frame, then doing a multistage build like building the wall onto the frame?

#

my brain is already melting, I dont know how you all survive!

austere sequoia
robust locust
#

@austere sequoia yea, first a frame is built, then you right-click and select the wall/window from the context menu. Which is a multistage recipe, if I've read it right

bright fog
#

like albion said

austere sequoia
#

You would still need some kind of function that allows you to add and retrieve your guitar via rightclick

#

And of course tiles for every guitarmodel you want to add

robust locust
#

@austere sequoia Yea I'm trying not to make it difficult, I guess I've learnt too much and am slightly confusing myself 🤣

austere sequoia
robust locust
#

The way I'm thinking of going is, I build the mount... attach it onto the wall (either by just placing it normally, likethe deer trophy)... then with guitar in inventory I rightclick the mount and attach the guitar

austere sequoia
#

For the rightclick thing you will need lua, everything else is kinda simple and mostly depending on your pixelart skills

robust locust
#

I've made a 3d model, done the icon and static model thing, and made the tiles/pack, but currently I can't actually put it onto the wall

austere sequoia
#

Ahhh, you made your own guitar, so its not the vanilla guitars we are talking about?

robust locust
#

sorry, ive made a 3d mount

austere sequoia
#

But why?

robust locust
#

I wanna take the vanilla model into blender

austere sequoia
#

Tiles are 2D

robust locust
#

i made the model to get renders of it to use as 2d images... but i need the guitar models to do proper 2d tiles of them when they're on the wall

#

again, I've bitten off way more than I can chew...

austere sequoia
#

So instead of making 20 pixels in Gimp you made a whole 3D model? That is kind off awesome to be honest! But sounds like an overcomplication to me. And dont worry about biting and chewing, you just made your learning curve a bit steaper 🙂

robust locust
#

hahah thanks

#

I'm use to blender, also I thought it would look cool if I could put it on a table and rotate it... but that's kinda stupid 🤣

austere sequoia
#

You could totally do that - with an item. Items and tiles are two different things though

robust locust
#

I think I have it as an item

austere sequoia
#

Actually the item stuff is very simple when you already have the models. Did you add a guid?

robust locust
#

I dont think so....?

austere sequoia
#

thats is

#

All your 3d model items need an exclusive guid, you can get one (or 1.6k, as I did....) from this generator

robust locust
#

I haven't added the model yet or any of the fbx stuff, just using 2d images as the icon and static thing. It did show in my inventory and on the floor when I place it... yesterday...

bronze yoke
#

3d models don't need guids, guids are just used for clothing

robust locust
austere sequoia
robust locust
#

I'm kind confused how to set up the sprite(?) correctly

#

this is my very basic model of it...

austere sequoia
#

Awesome!

robust locust
#

thanks!

#

not my best, not my worst...

austere sequoia
#

Dude, the best I can do is adding red stripes to the basic cube mesh, and I am already proud of that. So yes, from my perspective this is awesome

austere sequoia
robust locust
#

but i dont think my tilesheet worked

#

i'm just getting a question mark icon instead of the image now... at least i can craft it... i'll take that as a mini win!

#

Question: Does the DisplayCategory have to be a specific thing, or can I make one up?

bright fog
robust locust
#

It's no biggie if it doesn't work, I'll categorise it as something standard

#

Could my tiledefinitions data be overwriting my item properties?

drowsy delta
#

I don't get why this code fails errors

local function OnZombieDead(zombie)
    local zombieInventory = zombie:getInventory()
    local Items = zombieInventory:getItems()
    print(Items)
    print("each Item 1 by 1 \n")
    for i , item in pairs(Items) do -- Error is here somehow
        print(item:getName())
    end
end

Events.OnZombieDead.Add(OnZombieDead)
fast galleon
digital osprey
robust locust
#

@digital osprey nice one dude! I knew hoarding scrap wood would be beneficial!

digital osprey
#

enjoy! tested it a little everything should be in order

mystic vessel
#

I'm making a mod that uses precisely this mechanic involving tiles as workstations

cosmic ermine
cosmic ermine
fast galleon
cosmic ermine
#

It's just a good practice to use something for their intended purpose.

fast galleon
abstract cairn
#

hey how does one overwrite a texture in the game with a mod? I found some mods that add custom zombie textures and I wanted to see if I could retexture some stuff in a mod for some friends and I

cosmic ermine
#

So you'd rather do for i=1, #table do end?

bronze yoke
#

ipairs is just that with overhead

#

there's arguably never any reason to use ipairs

#

i don't personally use it at all

cosmic ermine
#

It's just cleaner in my opinion but if it's about performance then I'd like to optimize.

bronze yoke
#

performance wise, it's numeric loop > ipairs > pairs

#

but pairs is often unavoidable whereas ipairs doesn't do anything unique

cosmic ermine
bronze yoke
#

yeah

#

my benchmarking found ipairs to be nearly 5 times slower than a numeric loop

#

and a correction, pairs is somehow faster than ipairs

#

to my knowledge this isn't the case in standard lua

#

it may be that one scales better or worse with table size, my testing used a very small table

slow graniteBOT
#
dapra20comer1636 has been warned

Reason: Bad word usage

austere sequoia
abstract cairn
azure edge
#

hello i ask this at mod support

#

i want to create a server not today it will take some time i am gathering all mod i like and i have a question
i like at my server to take a mod from some1 and change some things inside the code i will give an example to understand
an easy example is using a mtealwork mod that can make weapons (in that mod to create a katana for example u need metalwork level 5)
i want to change that to level 8 for example
i know how but my question is i must change all recipes to desired level and report the mod at steam?
with all credits offcource to the person who made it
and say metalwork mod by ........ customisez for (my name server?)
i hope u can understand my question

#

and got this reply

#

Most likely all you would need to do is upload a mod that overrides the original recipe file with your own modded recipes and requires the original as a dependency. You would only need the recipe file in the right place with the right name and no other files from that mod. If you attempt this and need further help, ⁠mod_development is better. (edited)

#

if any1 can help me with an example or something i will be really gratefull so i can making my server as i like.....

#

and 1 more question will this not make mod conflict??? isnt it better to simply change their recipes level and upload their mod again but saying its a customize for my server?

#

sorry for the long message and ty for reading

austere sequoia
# azure edge hello i ask this at mod support

I guess you already go the right answer dude. The easiest way would be to make a mod depending on the other mod and just add two or three textfiles in the right places. This should allow you to overwrite certain parts of the original mod without causing conflicts. The best way to learn this is by looking at mods that already do something similar.

And for the reuploading a whole mod with tiny custom changes: Not cool dude. At least not for me - maybe the creator of the mod you want to change sees this differently. But ask him beforehand

austere sequoia
#

Hey guys! Another question: When I have all the materials for a recipe and rightclick on the materials in my inventory, I get the option to make the recipe in the rightclick-menu. Now I have a metric ton of recipes, all with the same materials, so when I rightclick on the material, I get a wall of options. Is there a way to add like a category in the rightclick-menu? So that it does not say "", but only says "Make Item" in the initial rightclick-menu, but gives me a submenu with "Make Item A - make Item B - Make Item C - make Item D - etc" (or even better... more submenus, lol) when I hover over it with the mouse?

drowsy delta
cosmic ermine
wise igloo
#

anyone know much about radio stations? we're looking to try and get some custom stations working with repeating messages running pretty much all the time, however the XML files for it are pretty complex and im not sure how to keep a constant recurring broadcast

outer crypt
acoustic rapids
#

Can someone point me to where/what the player body model files are? I'm poking around the game files rn but I'm not sure what I'm looking at

bright fog
#

What about looking at the part that fails to remove the radios from the world and patch it ?

#

Be it a lua or java function ?

#

Did you try to remove a radio (a visible one) with various methods and see if they do get removed ?

#

Perhaps you could do like I did to patch zombies not getting their emitters removed and do a patch that deletes the radio before actually having the java or lua part that handles that try to do it and fail it ?

nimble yarrow
#

edit: If a method has a bunch of mystery parameters, is there a way to find out what they do?

In my case,
addBlood(bloodBodyPartType, boolean1, boolean2, boolean3)

these 3 mystery bools appear in these configurations, in the vanilla game files:
steps.lua true, false false
scenario.lua true, true, false
ISHealthPanel.lua false, true, false

bright fog
#

You can check the java

#

Definitely go check the java

robust locust
#

Hiya... does anyone know if/how .x files are opened/used? They are in the models(x) folders

bright fog
#

There's a small part in this tutorial on how to import .x in Blender

acoustic rapids
#

👀 aaahaaaa

bright fog
#

(I tested it and those work)

outer crypt
# bright fog Did you try to remove a radio (a visible one) with various methods and see if th...

So only finding this a few days ago and having limited MP test time, it takes a while for me to work through it. I was successful at shutting down my sound cache of emitters after detecting an orphaned one. At that time, the device no longer has a valid square so I can't sledge destroy or use any square removals on them. Can't remove them when they are first detected, because they are being used as glue to make MP sync on radios work... I have never seen any code that would point to their creation or destruction and expect it's in java... the non-sprite non-invisible versions do not act the same, so with testing today I may find a way to actually remove those after they are at end of life...

bright fog
#

Like actually go try and destroy an active, visible and non-bugged one

#

And see if that causes the same bug

outer crypt
#

I have destroyed them and it causes the original radio to bug, unable to destory them after the original radio is removed.

bright fog
#

And whenever there is code that removes it in the java, lua or fucking paradise at this point you don't care: there is something that's handling the removal of the radio anyway when a player picks it, the radio burns or else and you can do like me a patch before the java or in the lua itself to run a code that destroys the radio before the game runs its own code to destroy the radio

#

Alright

#

Did you try every technics to remove the radio ?

outer crypt
#

and there is no one way to grab all the removal ways in one quick solution... from context inventory to context world pick up, grab, place, drop... there are so many different interactions.

bright fog
#

Also as a temporary fix you can just remove a radio's sound, actually make it disappear even if it's technically still here invisible and stop manage that radio ?

outer crypt
#

The only ways I know right now are sledgedestroy and removal from square and the invisible ones no longer have a valid square to use for removal...

bright fog
outer crypt
#

I am using my list of emitters to mute and remove it after orphaned.

bright fog
#

👌

outer crypt
#

if I can stop the emitters, I am fine with it until 42 patches these radio issues... IS said they have patched them internally...

#

Just wanted to get the word out to anyone with radio audio sync issues, they may be looking at a much more complicated issue with devices than they thought...

#

nothing like having another player pick up a radio and the audio left behind...

#

this to some extent is also the issue with duplicated radio text lines and text lines appearing where radios were removed

#

the game still registers the invisible and non-sprited radios as a place to spawn the text in Events.OnDeviceText.Add()

bright fog
#

Yea understandable

#

You said the radio issue was known by TIS right ?

outer crypt
#

Going by this forum message from last year...

#
The Indie Stone Forums

41.78.16 Multiplayer [Menu Hosted] No mods New save Reproduction Steps: Two lines bug: Place down 3D radio and listen to a broadcast Icon bug: Open device options on a TV or HAM radio, then open device options of a 3D radio HAM radios not working: Place down radio, place down ham radio, set to sa...

bright fog
#

👌

bronze yoke
bright fog
bronze yoke
#

it says their names

#

there isn't actual documentation

bright fog
#

nvm then

nimble yarrow
bright fog
#

I used that

#

You need to use git bash

#

But it worked great for me

#

Just I had to understand how to use git bash but it wasn't that hard once I got the hang of it

bronze yoke
#

definitely not the latter one

#

i haven't read tcherno's guide, he usually knows what he's talking about so that one may be better

#

but personally i just use beautiful java

bronze yoke
nova socket
#

Anyone knows how to leave a suggestion to devs?

I want to leave one about zomboid.socket being able to source Lua files directly to server environment or server itself having a server command that can source arbitrary Lua script. Something similar to reloadlua but sourcing it instead. That would enable advanced scripting based on bash, shell, python and whatever else without a need of a dedicated mod for that. Yeah I know how to source stuff anyways but its kinda a lame workaround.

robust locust
#

Gimp question... I accidentally closed all the windows in the viewport, and cant select layers or anything.... the windows/dockable dialogues isnt doing anything.
Any ideas how to correct it?

vast edge
#

Debugging someone else's mod, what's the difference between the distributionTable for a vehicle and the VehicleZoneDistribution? I see they've put the vehicle in a distributionTable, but the server console is still throwing the WARN for it not being in VehicleZoneDistribution

austere sequoia
robust locust
vast edge
nimble yarrow
vast edge
primal tendon
#

I was saying this in #pz_b42_chat, but I think the new animals coming in build 42 might provide a real chance of making a ridable horse mod that isn’t a goofy joke

nimble yarrow
#

I'm not sure, it was just a guess.
I know, for sure, there are a few vanilla vehicle stories
(car sitting there with no tires, jack, lugwrench, and tires on ground.)
(2 cop cars blocking the road, light-bars on, several zombie cops standing in the area)
but im sure you could define a custom story in a custom map, with a custom car.
new fire station, with a custom firestation story, which spawns a custom fire truck, etc

primal tendon
nimble yarrow
primal tendon
#

Say someone was able to figure out how to allow themselves to control a deer, since that’s kind of similar to a horse. Then it would be a matter of altering or replacing the model to be a horse, and slapping your character’s model on top in a rider’s position whenever they’re controlling it

#

To me that sounds like a pretty decent baseline for a ridable horse mod. From there it could possibly be expanded to allow you to to wield guns or melee weapons while riding, but that would be much more complex

#

You’d have to create completely new animations of your character aiming it’s gun, or swinging a weapon down on either side of the horse

inner wedge
#

I'm looking to patch YC Katana Legacy to work with the Katana Stance mod. According to the Stance creator the only thing needed is to add the parameter " isSword = true," to the weapons.

Is this the right way to go about it?

{
    imports
    {
        Base,KatanaLegacy
    }

    item YCKatana
    {
        isSword = true,
    }
}```
nova socket
inner wedge
#

AH ok I misunderstood something I read then. Do I need to copy the whole item over to my patch or is there a way to append the parameters?

bright fog
#

Just copy the original item script of Katana and place it in your code but add isSword = true

sullen bobcat
#

Anyone have any idea how to create a recipe that ignores drainable values and instead just destroys the item?

I wish to create a recipe involving breaking a Battery, however it instead just takes 1 unit of battery power.

When i used the Destroy tag around the battery, it seemingly removed the Battery from the recipe, and bugged it out, as if I had added a non-existent item as a recipe item.

bright fog
#

Make the recipe use all the battery units ?

sullen bobcat
#

Apologies for the dumb questions if that's the case

bright fog
#

Batteries disappear whenever you use all their charges I believe

#

At least you can't remove a drained battery from a flashlight or radio etc

sullen bobcat
bright fog
#

Ha okay lmao

#

I'm not familiar with recipes and what you can do

sullen bobcat
nimble yarrow
#

so you want its condition to be reduced?

nova socket
sullen bobcat
# nimble yarrow so you want its condition to be reduced?

Nope, i want to be completely removed disregarding, the drainable values completely.

So for for clarification, the recipe is about breaking open the Car Battery to remove the Sulfuric acid out of it, so it could have 0 condition and 0 power.

#

I just want to remove the Battery from the inventory and allow crafting at any value

#

Sorry I didnt explain this well

nova socket
vast edge
#

Where can I find the docs for the distributionTable/VehicleDistributions/VehicleZoneDistribution?

vast edge
# vast edge Where can I find the docs for the distributionTable/VehicleDistributions/Vehicle...

as an example, looking at the mod 1993lorevehicles, the logs tell me vehicle type "Base.84electra" isn't in VehicleZoneDistribution, and when I look in 1993VehicleLorePack/media/lua/server/Vehicles/1993lorevehicles.lua, I see distributionTable["84electra"] = distributionTable["CarNormal"] with local distributionTable = VehicleDistributions[1] defined at the top. So basically, I am trying to figure out the relationship between VehicleZoneDistribution, and the distributionTable that the mod is defining locally, and how this relates to the VehicleDistributions map/slice/thing

nimble yarrow
#

there's no docs. though, theres a bunch of comments at the top of VehicleZoneDefinition.lua, which is super cool.
I would look at how other mods added their custom cars to the distro.
Not a great answer, i know, but that's a start.

vast edge
nimble yarrow
vast edge
vast edge
nimble yarrow
#

I think its fine. my own console.txt has tens of thousands of lines. countless warnings about crafting recipes, sounds, sound events, offsets, etc. etc. but everything is working as expected. the 84electra spawns, right? then it's working 😛

vast edge
nimble yarrow
#

I would start a world in a custom sandbox with vehicles cranked to maximum, then teleport to maybe, louisville parking lots?

vast edge
#

What I need to do is have a mod that just spits stuff out to console when a vehicle is spawned, and then I can grep for 84electra or whatever

#

Thus far I don't have a counterexample, where something isn't in VehicleZoneDistribution, but does naturally spawn on the map. Once I find that, I can safely ignore the WARN/ERROR and assume that the mod is somehow getting the vehicle into some table somewhere

nimble yarrow
#

nah, I was wrong. the 69 vehicles I currently have throwing WARN in my console were NOT added to the VehicleZoneDistribution, purposefully. they're all crashed/wrecked/burned up cars. which should not fill parking lots.

so the 84electra cannot spawn.

vast edge
#

I did the logical thing and just asked the mod author whether this was intentional or not. Perhaps these vehicles are still under development or something, but he doesn't want to keep them partitioned off in a separate git branch, and instead delivers them to main but leave sthem unplugged from everything else.

nimble yarrow
#

eh, I dunno. likely the entire line would be commented out, like the 89seville

#

is it just the 84electra, out of curiosity, or a whole bunch of them?

vast edge
#

Quite a few, lots of burned ones (those made sense), but there's a lot of otherwise fine vehicles that aren't included; it's not ALL of them, it's even the majority of them, but it's a substantial number

nimble yarrow
#

media/lua/server/vehicles/1993lorevehicles.lua -- what car is Normal/Sports/SUV
media/lua/shared/1993lorevehiclesSpawnlist.lua -- what car spawns in what parking spot

the 84electra is missing from the 2nd file

vast edge
#

Right

nimble yarrow
#

so, like you said, probably purposeful. incomplete model, or texture, or whatever.

empty geyser
#

hello, I'm a programmer and I was thinking on create some mods just for trying out like adding the candles to be able to light a molotov or stuff like that, is there any official api or library for modding?

mellow frigate
bright fog
azure edge
# austere sequoia I guess you already go the right answer dude. The easiest way would be to make a...

really ty for answer reupload the mod sound simple for me that why i thought it and all picture and credits will be to him off cource i will not change picture poster or anything but you are right maybe some1 may get offended or something... i will try to find out how a new recipe can cancel an old 1 basically 2 things are a must for my server harder recipes(more metalwork level to create a weapon for example) and second i want to make all recipes for weapons cars etc 1 time read like magazines or book i will try find how ty

drowsy delta
#

how do i reload the players character?

bright fog
#

Reload the player character ?

drowsy delta
#

like the visuals

bright fog
#

For zombies I use that
zombie:resetModel()
so probably
player:resetModel()

heady crystal
#

Does anyone know how to check if an IsoObject is player built?

heady crystal
#

I was looking at the Vanilla code, and it just specifies theObject.player = [...] but it's not saved or something, I can't access it.

bright fog
#

I don't know if there's a direct method but recently I found out while working around zombie damaging structures that an already placed structure and a player built one doesn't output the same type of thumpTarget for the same kind of structures

#

Not sure how useful that will be to you tho

#
    local thumped = zombie:getThumpTarget()
    if not thumped then return end

        if instanceof(thumped,"IsoThumpable") then
            health = thumped:getHealth()
            if thumped:isDoor() then
                thumped:setHealth(health-200)
            elseif thumped:isWindow() then
                thumped:destroy()
            else
                thumped:setHealth(health-100)
            end
        elseif instanceof(thumped,"IsoDoor") then
            health = thumped:getHealth()
            thumped:setHealth(health-100)
        elseif instanceof(thumped,"IsoWindow") then
            thumped:smashWindow()
        end
#

For example something I had to do is check the class of the thumpTarget of a zombie bcs player built ones aren't the same as doors and windows on the map

#

And structures built by the player overall are IsoThumpable from getThumpTarget()

#

(so walls, doors)

mellow frigate
heady crystal
#

Yeah exactly its just setting it temporarily

bronze yoke
#

iswoodenstairs isn't a java object

mellow frigate
#

There must be a place in java code where Zombies decide to attack or not depending on something close to : is it build by player or not. I do not know where it is.

sly zodiac
#

can anyone tell me what this is trying to tell me and how to potentially fix it? cheers. for reference, im attempting to make a main menu mod

bronze yoke
# inner wedge I'm looking to patch YC Katana Legacy to work with the Katana Stance mod. Accord...

you can add parameters to an item script through lua:lua local item = ScriptManager.instance:getItem("Module.Item") if item then item:DoParam("Parameter = Value") end this is the recommended way to make simple edits to items, copying the item script entirely will be problematic if the original mod updates and changes that script, since your edit will still be the older version```lua
local item = ScriptManager.instance:getItem("KatanaLegacyStancePatch.YCKatana")
if item then
item:DoParam("isSword = true")
end

icy escarp
#

Hello modders, im working on the wiki and trying to find the code related to the health of barricades. So far i cannot find it in the scripts, or lua folders, nor MultiStageBuilding or BarricadeAble java files.
Does anyone here happen to know or know where to look?

bronze yoke
bright fog
# sly zodiac

Nothing here in this case
You can click the play button to resume playing and if trying to debug and you errors you can click the error menu or look at them in the console file

Personally I don't know how to use the debug menu and never used it but for one or two things

frank elbow
# sly zodiac

You're probably better off looking at console.txt—you could hit “Errors” and step forward, but it's simpler to just read the log file imo

#

Chances are it's either something is nil or something is the wrong type

bright fog
frank elbow
#

It's certainly there

bright fog
#

I played a bunch with barricades 2 or 3 days ago and you set their health with setHealth()

#

For add planks yeah you can add new planks but I believe it requires the inventory of a player ?

#

Haven't done that tho, was just removing health mostly

bronze yoke
#

my guess is you just pass nil for no player

#

typed null is kind of an issue with kahlua but there isn't any ambiguity here

frank elbow
bright fog
#

give me a sec I'll find the java doc

#

That's the thumpable target of a character

#

And you can retrieve the barricade

bronze yoke
#

i don't think you're incorrect, it just doesn't look like the vanilla barricade health is sourced from there

bright fog
frank elbow
#

I should clarify, my "think you're thinking of" was because of the mention of setHealth, which IsoBarricade lacks

bright fog
#

I'm pretty sure I did some setHealth on barricades the other day and I had issues with it wait I'll find it back on the modding discord

bronze yoke
#

when the question was asked i quickly looked for the timed action for barricading, saw it sent a client command, checked the command handler, and it called those methods

bright fog
#

Nevermind that was damageBarricade

bronze yoke
#

so i quickly looked at the methods and they definitely set barricade health

bright fog
#

Oh yeah didn't see them yeah I see them now

#

They set health ?

#

Or add health ?

#

Also considering they require an inventory item and an IsoGameCharacter not sure how you set those ?

#

Yeah no that doesn't health for addPlank, it actually adds a plank

frank elbow
#

I think the original asker was moreso looking for where the health is set (for the purpose of getting info), but yeah it looks like they just set it to the max per plank (well, based on condition)

bright fog
#

I mean I guess it does sort of add health

frank elbow
#

See the plankHealth field

bright fog
#

Yup

#

They set the health of planks

#

But it consumes plank per plank health

#

If I remember right

frank elbow
#

It looks like planks map to 1 of 4 numbers in the health array, so they have individual health. That's just at a glance though (so may not be entirely accurate as to how it works)

bright fog
#

yup

#

Look at Thump

#

Then Damage

#
for(int var2 = 3; var2 >= 0; --var2) {
               if (this.plankHealth[var2] > 0) {
                  int[] var10000 = this.plankHealth;
                  var10000[var2] -= var1;
                  if (this.plankHealth[var2] <= 0) {
                     this.plankHealth[var2] = 0;
                     this.chooseSprite();
                  }
                  break;
               }
            }
robust locust
#

If I was to attach a vanilla items to something ive created, do I need new items in scripts for each item? or can I reference each item somehow?

#

i.e. putting different guitars on individual hangers... do I need to create a new item for each guitar (bass/acoustic/etc) when it's hung? sorry if the question is not clear

#

I've made a tile for the acoustic guitar on the wall, but im wondering if I need to set it as a new item

bright fog
#

I think so yes but are those hangers tiles or items ?

robust locust
#

both...

#

i think

bright fog
#

Haaa so you want the player to be able to place the tile basically ?

robust locust
#

Id like it as an item to collect/craft that gets attached to the wall, like a neon sign

#

im just a bit confused as to the best way to go

#

yea

bright fog
#

Probably create a furniture item that the player transforms the guitar item into the furniture in their inventory

#

And then they can place that furniture

robust locust
#

then with a guitar rightclick it and attach... but I dont know if once its attached to use the tile of it one the wall

sly zodiac
robust locust
#

Id love it if I could reference the actual guitar model and place it upright against the wall... that would look a lot better

bright fog
robust locust
#

if its a tile, do I need to have it as an item?

bright fog
#

No idea, I doubt it but I'll let someone who knows more about tiles and items answer further

robust locust
#

I heard there was a gun mount somewhere in the game, that sounds like it has a similar mechanic, ie weaponobject attached to furniture , but no idea where that is or if its real

bright fog
#

No that's not a thing

bright fog
sly zodiac
#

the error boxes yes but none of it rly makes sense to me

#

:c

bright fog
#

These are the two only info you need

#

The line you have an issue

#

And then "title of non-table: null"

#

I personally don't know what title is but non-table null means at your line 24 you try to access an empty (?) or non-existant table

sly zodiac
#

this is line 23 and 24

frank elbow
#

title is the field it's attempting to index

#

Meaning one of those get calls is returning nil

sly zodiac
#

i end up following a youtube guide and i somehow get a bug KEKW

bright fog
#

And one thing they talk about is this:

if getPlayer():getInventory():contains("MyMod.MyItem") and getPlayer():getInventory():contains("MyMod.MyItem") then

is better written like this:

local inventory = getPlayer():getInventory()
if inventory:contains("MyMod.MyItem") and inventory:contains("MyMod.MyItem") then
#

Would make your code way easier to navigate for yourself and others

#

Then what Omar said

sly zodiac
#

not my code, came from a YouTube video

bright fog
#

Also you can't access fields like that ?

frank elbow
# sly zodiac this is line 23 and 24

Agree with everything that was said above, but regarding this: compare with the vanilla MainScreen and you'll see there's a check that's missing here

bright fog
#

Wait nvm I'm telling lies here

#

mb

bright fog
sly zodiac
frank elbow
#

The check I'm referring to has to do with the size of the credits list (LuaList)

#

The vanilla code:

if self.credits:size() > self.creditsIndex then
  if self.creditsIndex > 0 then
    if self.credits:get(self.creditsIndex-1).title == self.credits:get(self.creditsIndex).title then
      lastIsSameTitle = true;
    end
  end
  -- .. excluding the rest of this block to illustrate the above
end
#

Since your code doesn't have that check, it can run when the size is (for example) 0, which would mean trying to get the value at 0 would fail

#

I'm guessing the intent of whoever originally made the code was to simplify it, but that check is important

sly zodiac
#

So since he didn't include that check, it broke it?

bright fog
#

Probably more complicated than that

#

The fact he didn't include it probably means the check is just overall useless if the code is written correctly and maybe it's impossible to have a case where this check doesn't pass

#

Didn't he include his file in the description of the video or something to use ?

sly zodiac
#

yes

bright fog
#

I find it weird to make a full tutorial to rewrite the entire file without just giving it ?

#

Are you using his file ?

sly zodiac
#

basically yes.

bright fog
#

Or are you writting it yourself ?

sly zodiac
#

using the template he provided.

bright fog
#

Also know that because there's an error at a certain line, doesn't mean it's specifically this line the issue

#

But like Omar said, I highly suggest you understand how things work, read some basics in lua if you don't know how to use it or learn some basic coding stuff if you're not too familiar with coding in general

#

The link I sent you above is a guide to all this in case you want to understand a bit more how lua works

gilded hawk
#

Hi, do we have an in-game debug zombie heatmap? I'm looking for a way to check which area are the most populated, and run some code depending on how many zombies will be in that specific area.

#

Or, if that's not possible, how can I pull the zombie population ratio from a square using the LoadGridsquare event?

outer crypt
#

if you have an item in a bag, is it possible to get the x,y,z of the bag when its one the ground?

#

from the item

bright fog
#

So if you store the item when you detected it then check it's place where it's stored

#

You can access the inventory datas

bright fog
heavy pebble
#

i don't get any error messages in debug when loading the game so I assume it's liking the mod but maybe I'm not spawning it in right?

heavy pebble
#

nevermind I got it working. Is there a tutorial somewhere I can put what I did to help others?

heavy pebble
#

thanks

outer crypt
bright fog
#

rip

#

Watch out as those might not be saved and their IsoContainer (or whatever) might change after a game reload

outer crypt
#

not important, the info is kept client and scrubbed between sessions on purpose at this point.

#

I could always moddata it if needed.

near hull
#

Hello, is there a tutorial that teaches how to create (or change) moodles, interface when getting into a vehicle and things like that? I would appreciate any help

outer crypt
torn igloo
#

Any confirmation that B42 will add moddata to vehicle?

bronze yoke
#

they already have it?

torn igloo
#

You can't add to vehicle, you can only add to the parts. Doesn't work for MP (the transmitModData isn't immediate like the part is). Only works reliably for SP.

fast galleon
torn igloo
gilded hawk
#

I'm asking this again, in case some of the other modder didn't see this.

Hi, do we have an in-game debug zombie heatmap? I'm looking for a way to check which area are the most populated, and run some code depending on how many zombies will be in that specific area.
Or, if that's not possible, how can I pull the zombie population ratio from a square using the LoadGridsquare event?

fast galleon
torn igloo
#

The game only provide transmitModData to sync the data, no?

fast galleon
torn igloo
#

Thought so, a workaround implementation.

fast galleon