#mod_development

1 messages Β· Page 255 of 1

gleaming sorrel
#

I got errors the source of which I can't identify

bronze yoke
#

oh, change character:getBodyDamage() to player:getBodyDamage()

gleaming sorrel
#

OHHHH I'm dumb I was wondering why that part wasn't the right color

gleaming sorrel
#

The infection is waterborne

jade crown
#

im so confused its literally just a regular png file at 256x256

jade crown
#

mb lol thought i did

bright fog
# jade crown

Open it in paint, copy the image and create a new file with the image

#

Perhaps you used a weird old file or idk

jade crown
#

this is after i did just that though is the thing

#

in an attempt to fix it

#

actually the entire mod i made isnt working wtf maybe i messed somethin upπŸ’€

bright fog
#

Wrong folder order

jade crown
#

probably

hardy drift
jade crown
#

is there something up with the anthro survivors mod making tool?

fair jolt
#

hey, when its necessary to import base in base?

bronze yoke
#

never

fair jolt
#

hmm. i saw it quite a lot in mods

fair jolt
# bronze yoke never

wait are you the player shop albion? patching that mod rn lol. i like it but doesnt work out of box 😦

bronze yoke
#

what's wrong with it? it was a commission so i haven't touched it in a while

fair jolt
#

buy orders are broken, there is flipped (<) comparsion for price chcecs, after i fixed that, when i sell to shop, whatever is the price, i get 1 dollar. Then if you pickup the shop, it cant be locked again, so i added context menu locking without need of padlock. also it can be sledged and dismantled

bronze yoke
#

yeah, the server that commissioned the mod already had security systems for stuff like that in place

#

the first few things are new to me though

#

are you using Base.Money or whatever? the server used their own money mod too which had a bunch of different denominations so that was the only way i tested it

fair jolt
#

i use immersive currency, but money are still items in stack.

#

i think this loops only once, but i didnt dive into it yet

local items = self.container:FindAndReturn(SandboxVars.PlayerShops.CurrencyItem, price)
    for i = 0, items:size() - 1 do
      local item = items:get(i)
      self.container:Remove(item)
      self.container:removeItemOnServer(item)
      inventory:AddItem(item)
    end
#

not sure if price is set to 1 or method return only 1 item

bronze yoke
#

hmm, weird to return an arraylist with just one item in it

#

FindAndReturn is a weird method name, i wonder if i should've used getSomeType instead

#

nope, FindAndReturn is just a wrapper around that anyway

fair jolt
#

maybe price is set wrong, i didnt debug yet. also i made the window smaller so people with extra text and ui scale can see whole thing

#

if u have it in git i can make PR with fixes once im done

bronze yoke
fair jolt
#

ok, should be finished and tested during the week

drifting ore
#

it's in the decompiled java code

cerulean sonnet
#

Hello, first of all, I'm starting the program and I wanted to go straight to the mods, how did I start the program, what folders should I create? Another thing my goal with the mod is to make it span some stone when using the pickaxe it drops stone and other things that will be used for the benches I'm going to create, can you help me at the beginning?

sand parcel
#

any way to add a completely new translation file to the menu? and also any way to only apply that translation when picking a specific trait?

drifting ore
night sandal
#

I never modded for PZ before, right now i am trying to add compatibility for a mod with another mod named Customizable Containers, however i don't know where to start. Any advice?

drifting ore
#

as is usual, start with looking at its source code

night sandal
drifting ore
night sandal
#

Will try thanks

fair jolt
#

hi, any idea why this wouldnt work? what im trying to do is to integrate build menu glasswork with kentucky car overhaul mod. its lots of parts so i made list and some script to generate the file but it seems like zomboid is refusing to load it. Is it because of the recipe name is same as item? filesize (71kb)? tabs? this mod is loaded last

dawn portal
#

is there a way to check if the user is in the main menu or inside the game? other than listening for OnMainMenuEnter and OnGameStart? in other words can I retrieve that information at any time without using events or manual state keeping?

grizzled fulcrum
#

is that even exposed

bright fog
#

If it's in the documentation, it's very likely

dawn portal
#

ooh that might do if it's accessible in lua. I see MainScreenState and IngameState as classes inheriting GameState

grizzled fulcrum
#

ye

grizzled fulcrum
#

how, I thought they werent exposed from people saying that ;-;

bright fog
#

idk why tf Albion would tell that without saying you can in fact access them

#

I just use her mod, which makes them accessible very easily

grizzled fulcrum
#

oh ik that

#

But can you just write JavaClass.field in lua?

#

without using her mod*

bright fog
#

I don't know the detail but yes

#

Ofc her mod is not mandatory

#

But you can easily access the fields with like getPlayer().field

#

Let's say I want to access isSpeek from player

#
local isSpeek = getPlayer().isSpeek
grizzled fulcrum
#

huh

bright fog
#

With her mod

bronze yoke
#

you can't, that's what the mod does

grizzled fulcrum
#

so they're exposed but you cant access them via . notation?

#

only with the mod you can use dot

bright fog
bronze yoke
#

i wouldn't say they're exposed at all, the exposer never touches them (except public static fields)

#

it's just that the game exposes a wrapper around some java field reflection stuff for debug purposes

#

accessible fields just twists around the syntax so it isn't absolutely insane to use (and to my knowledge runs better than any similar mod)

bright fog
#

I use it constantly but haven't exactly verified its performance impact

bronze yoke
#

it preprocesses all fields as early as it can to save performance as much as possible

grizzled fulcrum
bronze yoke
#

yeah

grizzled fulcrum
#

not because the exposer actually exposes the methods

#

ok makes sense now ty

bronze yoke
grizzled fulcrum
#

wat is the syntax to access them??

#

like original syntax without mod

#

just curiosity, I don't actually plan on using the raw syntax will just depend on your mod where necessary

cerulean sonnet
#

Hello, first of all, I'm starting the program and I wanted to go straight to the mods, how did I start the program, what folders should I create? Another thing my goal with the mod is to make it span some stone when using the pickaxe it drops stone and other things that will be used for the benches I'm going to create, can you help me at the beginning?

grizzled fulcrum
#

is this translated? if not, please rewrite this I cannot understand anything

#

im big dumb

bright fog
#

He means he's starting to code and he wants to learn how to make a PZ mod, the folder structure for example. He wants to make a mod where you spawn rocks by using a pickaxe but wants to expand that to other features like branches

grizzled fulcrum
#

ooo

grizzled fulcrum
bright fog
grizzled fulcrum
#

pzwiki saves me every single time

bright fog
#

Or just use a pickaxe and poof it pops stone out of fin air ?

bronze yoke
grizzled fulcrum
#

I can see why you created the mod now

cerulean sonnet
#

I want you to find some stones in the forest and when you go there with a pickaxe you can go and it will drop x amount of stone and other ores@bright fog

bright fog
#

Actually there's a mod that does that

#

I believe ?

#

There's a few mining mods

#

That one is the one I find the best bcs it doesn't require map modifications for ore nodes

#

As it's simply about finding items with the search mode

grizzled fulcrum
#

Also why the heck does this not work:

local tbl = {}
tbl.subtbl.mykey = "hello"
--- Expectation: tbl = { subtbl = { mykey = "hello" } }
--- Reality: tbl = {}, error on second line
grizzled fulcrum
#

like this has caused more problems for me because I type this on instinct

bright fog
#
local tbl = {subtbl = {}}
tbl.subtbl.mykey = "hello"
#

This works

grizzled fulcrum
#

yes, but why does it not allow assignment like that

#

can it not infer that subtbl has to be a table if there is a key being defined inside of it?

bright fog
#

if tbl is not defined as a table

#

That's the exact same thing

bright fog
bronze yoke
#

i feel this would cause more problems than it would solve

bright fog
#

Yeah

grizzled fulcrum
#

hmm maybe im just lazy lol

#

I hate having to define all my table subtables before I actually assign anything in them* like:

local tbl = {
  subtbl1 = {},
  subtbl2 = {},
  subtbl3 = {},
  subtbl4 = {},
  -- ...
}
or
local tbl = {}
tbl.subtbl1 = {}
tbl.subtbl2 = {}
tbl.subtbl3 = {}
tbl.subtbl4 = {}
bronze yoke
#
local tbl = {}
tbl.subtbl = "hello"
-- does subtbl become a table now? reassigning keys does work that way so it would be inconsistent if it didn't, but probably annoying if it did
tbl.subtbl.mykey = "hello"

-- no error or ide warning because this is completely valid, but obviously the user wanted to add to subtbl and not create a new table
tbl.Subtbl.mykey = "hello2"

print(tbl.anothertbl.mykey) -- error or nil?
grizzled fulcrum
#

true

bronze yoke
#

what about?

drifting ore
#

about what all of that is about

grizzled fulcrum
#

like showing why it is a bad idea

drifting ore
#

well, if you wanted to see an example of what happens when you take "execute implicit operations if that's what necessary to make the code work" as a principle, you can look at the whole clusterfuck of JS

#

and much moreso HTML and CSS

#

there's so much egregious crap added purely for the sake of making even badly composed code work, or at least not crash

#

something like 99.9% of websites, including the major ones, are not W3C compliant, and that compliance already includes astronomical amount of silent fixing of user errors

#

it's like GPU drivers shipping fixes and optimizations for AAA games shaders because they release broken and slow, but turbocharged, and I mean really

#

because at least AAA devs are competent coders, websites are made by people who can barely follow a youtube tutorial

#

though that's enabled by web browsers fixing their errors so that's kind of a positive feedback loop. But that's enough rambling for today.

prisma wren
#

does zomboid not like mp3 files for sound effects?

#

i'm looking at another mod for reference and im seeing that its using .ogg

#

i'd rather know before i start testing it

grizzled fulcrum
prisma wren
#

where can i find a list of applicable eattypes?

solar rover
#

Would it be possible to add a new fishing rod item that will modify the line break chance?

bright fog
grizzled fulcrum
#

I'll stick with the annoyance and just use #region like in C++ to collapse them

bright fog
#

Yeah I have that thing too

#

Tbf idk what you're achieving with your code

#

But the table within a table is a thing I do a lot and I don't have any problems with that

#

Tho I dynamically define them

prisma wren
#

like the player is still infected but the timer is reset

#

not sure how to send code blocks in discord

solar rover
#

I used "They Knew" as a guide for that stuff.

prisma wren
#

im currently using i

#

t

#

is it just setinfectionlevel?

solar rover
#

use `
or 3 of them to make a block

#

I feel like that was how much "damage" was being dealt but I would have to dig it back up. I think I used that in my "fake" cure code to kill them in 30 seconds if they didnt have a real cure on hand.

prisma wren
#
if playerdata.ZomboxycyclineHours > 0 and playerdata.unprotectedinfection == false and infectionStatus then
    local bodyParts = playerBody:getBodyParts();
        
    if playerBody:IsInfected() == true then
        playerBody:setInfectionLevel(1)
    end
        
end

haven't changed the names of stuff yet, theres alot of commented out code

#

this is pretty much my first time ever messing with lua code in zomboid

#

theres a whole lot of useful functions but i dont know more than a few

solar rover
#

I'm a rookie also. I just poke a it with a stick and hope for the best.

prisma wren
#

jolly

solar rover
#

Im just crossing my fingers a fishing rod mod isnt java like generator code ; ; Lua I can explore at least.

prisma wren
#

i know a decent bit of lua from roblox coding

#

but roblox coding =/= zomboid coding since iirc roblox uses a unique kind of lua

#

found out why one of my errors was happening, i forgot to add commas in the items script

livid bison
#

does the "IS" prefix for many of the file names stand for Indie Stone?

bright fog
prisma wren
#

thanks

prisma wren
#

how do you set how long it takes to use something

nimble bane
#

is there any way to make a zombie perform a custom animation? I dont mean in the way of replacing one, but i want to add stun animations to zombies that are being electrocuted by whatever means. im new to zomboid lua scripting, but it seems like zombies are too hardcoded to do anything fancy :/

warped valve
tulip valve
#

Can you play doom 2 on it?kekw

fair jolt
warped valve
hardy drift
#

anyone know if they have eat times in the game files? can’t find em

thick karma
#

I would investigate what determines the length of that action

winged raven
#

Can anyone drop some guides for modding zomboid? All I can find is videos on how to download mods

hardy drift
#

got the same exact time like 3 times so i figured that'll work

thick karma
winged raven
thick karma
#

This workshop item links to a repo

#

The repo explains how to set up the mod and submit it to workshop

#

And has the code with lots of comments

thick karma
winged raven
#

Oh yeah I saw that. I saved it to my watch later

thick karma
#

I think it's still 99-100% correct

#

I don't think game has fundamentally changed since that video in any ways that would matter

winged raven
#

K

thick karma
#

Reading other people's mods is among the best ways to learn

winged raven
#

I’d love to get into map making too. Is that super difficult or?

thick karma
#

Just time consuming afaik but I'm not a mapper

winged raven
#

K

thick karma
winged raven
#

Alright. I do have a good bit of time on my hand cuz I’m gonna be moving in a bit so not gonna be in school for a while

thick karma
#

Well I say go for it. The people in mapping will surely point you the right directions

drifting ore
quiet fulcrum
#

with lua, can I change a field in a IsoGameCharacter if it doesn't have a setter?

quiet fulcrum
#

darn... as a followup, is there any way I can change bDead or rez a dead player via lua?

#

oh wait I can with setOnDeathDone

#

I realize that's probably not the right thing to rez though

shut bluff
#

Trying to use Fmod bank tools to repack the bank files for audio modding but it gets stuck on building fmod bank files

Anyone know whats wrong?

rare zodiac
#

ok, imma be real with you my idea for my complete overhaul mod is gonna be crazy

fair jolt
drifting ore
fair jolt
tacit carbon
#

hello guys! is there any way to add or remove tags from an item? I want to identify specific Items to make it exclusive to a certain player, so I want to block it from use to other players, I was thinking about adding tags to know who it is from, is that anyway I can do this? thanks!

#

there is no setTags code or anything, so I was wondering how could I identify who the owner would be

drifting ore
bright fog
#

I think you have 2 solutions:

  • tags like you mentioned, which you can set but I don't remember how exactly, but you can
  • mod data
tacit carbon
#

can items have their own mod data?

#

I was about to test that to confirm if it works

#

I tested and it didnt work, adding mod data to an item, when I tried to check the selected item for the mod data gave me an error

#

im going to try using getTags

drifting ore
#

i think it's important to establish if you're trying to do this with Item or InventoryItem

tacit carbon
#

yeah true

#

I think im doing it to handweapon

#

whats the difference between handweapon and inventoryItem?

#

is it like a subclass?

drifting ore
#

Item is the stuff you define in item scripts, it's a template to create InventoryItem objects which are the stuff you see in the game.

tacit carbon
#

i see, I want to add this ingame so it would be inventoryItem

drifting ore
#

inventoryitem should have moddata working

tacit carbon
#

but from what I know the equiped item you get in xp when hitting someting is a HandWeapon

#

does that make a difference?

#

since its probably a subclass of InventoryItem it should have it work right?

drifting ore
#

yeah it's a subclass

tacit carbon
#

its giving me an error when I do table.insert on it

drifting ore
#

try code like this

data.MYMOD = data.MYMOD or {}
data.MYMOD.info = 123
#

that's how you set mod data in general

tacit carbon
#

so I would do weapon:getModData().MyMod_VariableName = Identifier?

#

i tried that but didnt work

drifting ore
#

you read it about like so

if data and data.MYMOD then
   info = data.MYMOD.info 
end```
tacit carbon
#

when I try to check for it

#

using this

drifting ore
tacit carbon
#

if instanceof(items[1], "InventoryItem") then
primaryItem = items[1]
else
primaryItem = items[1].items[1]
end
it returns an error when I try to do primaryItem.getmoddata

tacit carbon
#

the code I use to check for the rightclicked item is that one, but when I tried to access modData() from it it doesnt work

drifting ore
#

show that part too please

#

i.e. the code where you actually call getmoddata

tacit carbon
#

how do I add code her again?

drifting ore
#

it should be a couple of lines, you can just paste it

tacit carbon
#

local equipPrimary = context:getOptionFromName(getText("ContextMenu_Equip_Primary"))
local equipBack = context:getOptionFromName(getText("ContextMenu_Equip_on_your_Back"))
local equipSecondary = context:getOptionFromName(getText("ContextMenu_Equip_Secondary"))
local equipTwoHands = context:getOptionFromName(getText("ContextMenu_Equip_Two_Hands"))

if instanceof(items[1], "InventoryItem") then
    primaryItem = items[1]
else
    primaryItem = items[1].items[1]
end

if primaryItem.getModData().owner ~= player then
    equipPrimary.notAvailable = true
    equipBack.notAvailable = true
    equipSecondary.notAvailable = true
    equipTwoHands.notAvailable = true
end
#

im trying to have the item that is right clicked by someone who isnt the owner it wont be able to be equiped

#

I also had a primaryItem.getModData().owner ~= nil as well

drifting ore
#

well to start with you need to use colon notation to call the function on an object, you use dot notation there

#

the difference is subtle but it causes errors if not done correctly

tacit carbon
#

sorry what is the colon notation?

drifting ore
#

it's when you call function by using a colon as separator
weapon:getModData() is calling getmoddata using colon notation

tacit carbon
#

oh I misspelled rewriting it

#

it was :

#

my bad didnt notice

drifting ore
#

i'm just assuming that what you pasted here is the exact copy of what you wrote in the actual file

tacit carbon
#

I deleted cause I was trying something else

#

so I rewrote to send you

#

if primaryItem:getModData().owner ~= player and primaryItem:getModData().owner ~= nil then

#

this is how it was before I deleted it

#

it gave me an error there

drifting ore
#

allright well the only way this can not crash is if moddata.owner already exists

tacit carbon
#

maybe its because im saving it to handWeapon?

drifting ore
#

no it's because you're effectively checking for primaryitem.modData.owner so if modData doesn't exist then the next item in the table chain causes an error

tacit carbon
#

ahh i see

bright fog
tacit carbon
#

wait let me rewrite it then

tacit carbon
#

I think the error is that if that specific item doesnt have the mod data it would crash

#

right?

drifting ore
#

you normally work around this by putting if item:getModData() then before doing any other checks

tacit carbon
#

okay let me try then

drifting ore
#

or you can put that as the first check in your if-and-and-and-then chain

bright fog
#

Did you READ the error ?

#

Bcs if you read it, you'll realize it points out to the specific reason getting the mod data didn't work

#

Like "trying to access key from a non-table" meaning you'd have done modData.yourkey with modData being nil

bright fog
#

Tho it should NEVER give out nil

#

So I highly doubt that is the problem here

drifting ore
# bright fog Tho it should NEVER give out nil

does it? I didn't reall check but the source gave me an impression that it starts off with a null as a table reference and it would gladly give it out without creating an empty table

bright fog
#

modData is a table

#

In any case, it's a table

sour island
#

GetModData should be an empty table - the nil error comes from assuming owner exists. Those checks should be inverted if anything.

#

if md.owner and md.owner == player then

drifting ore
#

i checked and at least for InventoryItem it does creates a new table.

bright fog
sour island
#

That could also be an issue

drifting ore
#

probably but i operated on assumption that the data structure isn't broken in relation to the decision tree

bright fog
#

We just don't even have the full code here

#

We got no idea what their working with

#
  • seriously, read the god damn errors in console, they exist for a reason and are fairly informative on what the problem is usually
#

Gives exact line + reason 99% of the time you get an error

drifting ore
#

true but gotta start with strong evidence and once that fails then continue to speculation

bright fog
#

Strong evidence of what lmao ? Their code failed and mod data ALWAYS naturally creates a table

#

Imagine if it didn't, modders would fight for mod data

sour island
#

Player could also be nil here, you should probably store the username

#

As a reference can't be saved

bright fog
#

online ID if multiplayer

#

If not, just getPlayer as singular player

sour island
#

Doesn't online ID change?

bright fog
sour island
#

I assumed it was the slot number - username in eithercase doesn't change.

#

And you could double its use for displaying the owners name.

bright fog
#

No idea

drifting ore
bright fog
#

Yeah

#

Every mod data does that

#

Nothing new, really didn't need to check the java tbf but at least it's proof

tacit carbon
#

Im basically using Events.OnFillInventoryObjectContextMenu.Add() to change the option to equip an weapon to not avalible, the full code of this part would only be

local function addTooltip(player, context, items)
    local primaryItem
    local playerObj = getSpecificPlayer(player)

    if instanceof(items[1], "InventoryItem") then
        primaryItem = items[1]
    else
        primaryItem = items[1].items[1]
    end
    if primaryItem:getModData() then
        if primaryItem:getModData().owner and primaryItem:getModData().owner ~= player:getDisplayName() and primaryItem:getModData().owner ~= "Nobody" then
            local equipPrimary = context:getOptionFromName(getText("ContextMenu_Equip_Primary"))
            local equipTwoHands = context:getOptionFromName(getText("ContextMenu_Equip_Two_Hands"))
            equipPrimary.notAvailable = true
            equipTwoHands.notAvailable = true
        end
    end
drifting ore
#

don't know why i thought it wouldn't do this. I guess probably because this means any time any code at all checks for mod data, it's filled in. So basically if you have any mods installed that do this, you rapidly fill up all the moddata tables for all objects in the game even if they hold absolutely nothing.

bright fog
#

Makes it hard for us to read your code rn

sour island
#

```lua
<Code>
```
@tacit carbon πŸ‘

tacit carbon
#

this is the error

drifting ore
#

yeah you'll have to check the console.txt file

tacit carbon
#

I dont know where that is in my keyboard im sorry

sour island
#

That error means it's calling something that doesn't exist

bright fog
drifting ore
#

this error log doesn't shows what was the actual error, only the stack trace

tacit carbon
#

its not 7 for me

bright fog
#

Just copy it

#

From my message

tacit carbon
#

I did

bright fog
#

`

#

πŸ‘Œ

bright fog
#

addEnchantment

sour island
#

Including the Lua part also colors it. But yeah that error isn't from this snippet.

bright fog
#

Check the line I indicated in the error

#

That I put in red

#

These are the informations you want to look at:

  • line and file
  • problem
tacit carbon
#

that line is

weapon:getModData().owner = player:getDisplayName()
sour island
#

I'd guess players don't have display names

drifting ore
#

this means either weapon or player was nil

bright fog
#

No that sounds right

drifting ore
#

wait no

sour island
#

Pretty sure it's not lol

tacit carbon
bright fog
#

It mentions addEnchantment

tacit carbon
#

to make this name I use the players display name

drifting ore
tacit carbon
bright fog
#

It's the name of the character

tacit carbon
#

im trying to get this update where the item you have ascended cant be equiped by other players

sour island
#

Heh isoPlayer does have a getDisplayName - never ran into that before.

drifting ore
#

well one of the two functions there was nil

sour island
#

What is weapon in this case?

drifting ore
#

so player is some kind of object that doesn't have getDisplayName or weapon is some kind of object that doesn't have getModData, but neither of them are nil, or so it seems

bright fog
#

Where is addEnchantment in that part

#

That can't be right

#

Object tried to call nil in addEnchantment, isn't that the name of the variable ?

sour island
#

No

#

addEnchantment is the function

bright fog
#

Weird

sour island
bright fog
#

We really need the full code here

drifting ore
#

full code of the function addEnchantment anyway

sour island
#

call = calling a function - it knows addEnchantment - so whatever is line 394 is calling a function that doesn't exist

bright fog
#

Yeah

tacit carbon
#

one sec

sour island
#

if its weapon:getModData - that means weapon is nil or something else

drifting ore
sour island
#

Although if it was nil I think the error would look different

drifting ore
#

something like trying to get field getModData of non table nil

tacit carbon
#

if you want to take a look

#

its too long to post here on discord

drifting ore
#

wait what

#

both player and weapon work completely fine up to that point

sour island
#

Which line is 394 can you take a screenshot of that area in your IDE?

tacit carbon
#

up to here, add enchant basically add the name to the item, then saves all the base values of the item so I can restore it to normal after its removed

bright fog
tacit carbon
#

then I added the last line to try to make this update work

bright fog
#

The error doesn't fit the current code

#

You're modifying this ?

tacit carbon
#

yes

bright fog
#

Did you make sure to unsub from the original mod ?

tacit carbon
#

im adding this update

sour island
#

is 394 right?

tacit carbon
sour island
#

Where is addEnchantmentTwice called?

#

addEnchantment is only used once in addEnchantmentTwice which is used nowhere else in this file

bright fog
#

There is no check for primaryItem

tacit carbon
#

called when the enchant item is used to overide not being able to enchant an weapon if you already have one

bright fog
#

Your functions get called from the context menu, and you retrieve the primary weapon but there is nothing that verifies primaryItem exists

#

From your function addContext

tacit carbon
#

its also used at the bottom

sour island
#

oh weird my IDE didn't find those right away

tacit carbon
#

which is when a person has no enchanted items and the free enchant is marked

#

on sandbox options

bright fog
#

idk why you'd get the primary item by accessing the first item in the inventory of the player, that sounds scuffed asf

tacit carbon
#

it was working for everything else

bright fog
#

The reason being that, how do you know that's the item you want

tacit carbon
#

i dont know why it wouldnt for this

#

its working for adding removing and rerolling

sour island
#

That's not the first item in the inventory

tacit carbon
#

but to check if has an owner its not working

sour island
#

Right click context on the UI brings up the header item and it's items

#

items[1] is the first item within the header's items

bright fog
#

The header ?

sour island
#

In the inventory UI, each row is a header

#

you can expand or collapse

bright fog
#

Hmm I see

sour island
#

The first one isn't actually an item it just mirrors items[1]

bright fog
#

Yeah

sour island
#

But yeah if weapon works earlier in the code

tacit carbon
#

albion helped me with that code to actually be able to use it on contextmenu

#

it is working fine, this update is giving the error

#

before I used that part of the code, I was just checking for the items and not actually saving them to use it

sour island
#

Can you change that line to

    local owner = weapon:getModData().owner
    local playerName = player:getDisplayName()

    owner = playerName
#

I'd be curious which line is breaking

#

Cause I don't see how or why either should

tacit carbon
#

let me try that

#

thank you very much for the help!

#

ops

#

im going to correct this part

#

thanks for the help guys, its working now @sour island @bright fog @drifting ore

bright fog
#

πŸ‘Œ

sour island
#

What was not working?

bright fog
#

Stopping the equiping of the weapon

#

Limit it for only a specific player

sour island
#

No I mean, why was that line not working lol

tacit carbon
#
local function addTooltip(player, context, items)
    local primaryItem
    local playerObj = getSpecificPlayer(player)

    if instanceof(items[1], "InventoryItem") then
        primaryItem = items[1]
    else
        primaryItem = items[1].items[1]
    end
    if primaryItem:getModData() then
        local owner = primaryItem:getModData().owner
        --print(owner)
        if owner and owner ~= playerObj:getDisplayName() and owner ~= "Nobody" then
            local equipPrimary = context:getOptionFromName(getText("ContextMenu_Equip_Primary"))
            local equipSecondary = context:getOptionFromName(getText("ContextMenu_Equip_Secondary"))
            equipPrimary.notAvailable = true
            equipSecondary.notAvailable = true
        end
    end
#

this is how I made it

sour island
#

it was the check for owner πŸ˜…

tacit carbon
#

yeah

#

the check for the owner was the issue

sour island
#

Glad you got it working πŸ‘

tacit carbon
#

thanks for the help !!

bronze yoke
#

you can check if an object has a moddata table created before trying to read it but it's wasteful of performance

drifting ore
#

(because the alternative is to microoptimize the entire codebase and remove small amounts of waste everywhere, and that's just not gonna happen)

solar rover
#

Are fishing rod break/catch chance locked in like generator code?

bronze yoke
#

i haven't seen how hardcoded that specifically is but fishing is almost entirely lua so it will be at least possible to change it

solar rover
#

I've seen a lot of the options for the fish, lures, sizes etc. but the standard rod vs crafted rod as well as line vs twine have different settings that I didn't see in lua but i might be looking in the wrong spot

#

I was hoping do to some final fantasy XI stuff and make some rare fish drop items that can be crafted together into a strong rod but if i can't edit the rod stats all they'll get is a fancy new model lol

prisma wren
#

i dont know why but its not finding the function to administer the effect of the pills

    item PhalanxPills
    {
        DisplayCategory     = FirstAid,
        Weight                = 0.2,
        Type                = Drainable,
                UseDelta            = 0.5,
        UseWhileEquipped    = FALSE,
        DisplayName            = Phalanx Pills,
        Icon                = PillsPainkiller,
        Tooltip             = Tooltip_Painkillers,
        StaticModel         = PillBottle,
        WorldStaticModel     = PillBottleGround,
        Medical             = TRUE,
        CustomEatSound      = AdministerPhalanxPills,
        CustomContextMenu   = Take_Pills,
        EatType             = pills
    }

this is the item

#
module TheyKnewNMRIHaddon {

    imports
    {
        Base
    }
    
    recipe Take Phalanx Pills
    {
        PhalanxPills=1,
        
        Result:PhalanxPills,
        RemoveResultItem:true,
        Time:30.0,
        OnCreate:Administer_Phalanx,
    }
}
#

and this is the code

#

the player is able to take the pills but the function is never found to apply the effects

drifting ore
#

Administer_Phalanx must be a global Lua function

prisma wren
#

i'm not really sure what that means

drifting ore
#

you need a Lua file that creates Administer_Phalanx and does so without setting it as local

prisma wren
#
function Administer_Phalanx(items, result, player)
    playerdata = player:getModData();
    playerdata.ZomboxycyclineHours = 24;
end

this is what that function looks like

#

im using they knew as the base

drifting ore
#

ok well is it in /server/ or /shared/?

prisma wren
#

its in client

drifting ore
#

put it in /server/

prisma wren
#

alright i'll try that

drifting ore
#

also how do you know exactly that it's not working?

prisma wren
#

in the output it says that the function is not found

#

when i check the characters infection level its still rising

drifting ore
#

weird but allright

prisma wren
#

and not going down

drifting ore
#

one possible reason this could be an issue is because your Lua file name is the same as some other file, so it's not actually loaded

prisma wren
#

its still not finding the function

bronze yoke
#

in your log you should see a bunch of Loading: filename.lua lines, is your file there?

topaz tangle
#

eat paper mod when?

grizzled fulcrum
#

brick layer more like break eater 🧱

hardy drift
#

this is wild

drifting ore
#

yeah only 10 engine parts, can you imagine lowballing so hard

bright fog
bronze yoke
#

christ

hardy drift
#

17k subs

bright fog
#

Yikes

#

2022 tho

#

Old ass mod

#

Probably doesn't even work anymore

drifting ore
#

2022 was 98 years ago. Feel old yet?

bronze yoke
hardy drift
#

yeah it's just a simple crafting recipe mod it prolly does work

bronze yoke
#

infact no it was three days after

drifting ore
#

well nobody's complaining that it doesn't work

bronze yoke
#

you need to keep in mind when you judge mods by their age that the version of the game we're playing is actually quite old itself

bright fog
#

Yea I thought the last update was early last year

bronze yoke
#

recipes rarely break with updates anyway

hardy drift
#

bro thinks he's a comedian i guess

drifting ore
#

to play devil's advocate, making a joke based off racial stereotypes is not at all the same thing as being negatively racially prejudiced

bright fog
hardy drift
#

nah fs im not a witch hunt kinda guy i just thought it was wild as hell

#

caught me off guard

#

plus it's steam so what can u really expect

#

thats why i said he thinks he's a comedian cause usually they get those immunities but this is just a mod lol kinda unnecessary

drifting ore
#

wdym immunities? nobody's immune from getting flagged

hardy drift
#

yk what i mean, usually when comedians make jokes about racial stereotypes they get more leeway cause it's kinda their job and they usually know their audience

#

the good ones at least

drifting ore
#

so what are you saying that the deciding factor in whether it's ok to make racist jokes is if you're a professional comedian?

#

come on now

hardy drift
#

nah that's what you're saying im saying. I'm saying I just wouldn't expect to see that on a steam mod

drifting ore
#

true, true

hardy drift
#

🀝

#

and there's a difference between a joke and just "This mode is called Jew mode because you get more metal for cheap than normal mode"

drifting ore
#

it's still a joke, but in a bad taste. But i don't think there exist a joke in NOT in a bad taste whatsoever if it's based off stereotypes.

hardy drift
#

yeah nah fair enough

drifting ore
#

so it's kinda the default for this kind of jokes

hardy drift
#

u right

drifting ore
#

though i will say that it's unfunny and it doesn't fits the setup or the punchline, it kinda reads as an excuse to use the stereotype

sour island
hardy drift
#

thats what im sayin pretty much

bronze yoke
#

the joke is entirely that it is in bad taste, he said a naughty thing now everyone laugh

#

it's the kind of thing you usually grow out of around age 14

sour island
#

Yeah it's not even a good joke lol - racial jokes need to come from a place of understanding otherwise you're just mocking.

hardy drift
#

it's one of those dog whistles for other edge lords

drifting ore
#

i think it's a dogwhistle for the group of people opposite of edgelords

#

not intentional i mean

sour island
#

Lmao his comments are off and his discord link is missing. Yikes.

drifting ore
#

being a federally and internationally certified edgelord myself i didn't find it worth mentioning

hardy drift
#

brother was reading chat i guess lmao

sour island
#

Nah the 'link removed' usually comes from reports.

hardy drift
#

ahhhhhh god damn it must have gotten a lot of reports within the 10 minutes i put that screenshot

sour island
#

Play stupid games, win stupid prizes. lol

bronze yoke
#

i didn't know reporting actually did anything, steam is usually pretty apathetic towards this kind of thing

drifting ore
sour island
#

It's automated - removes links (usually) and disables comments.

#

@bronze yoke Unfortunately I've been reported falsely a few times lol

#

I also have this experience too lol

drifting ore
#

Impressive. Very nice.

frank elbow
#

@earlier convo: There's not much sense in differentiating between making a joke rooted in racist stereotypes & being racist when the end result is effectively the same: reinforcing those stereotypes. We have no way to know their intent; we can assume it's an unfunny, failed attempt at edginess but ultimately it's a harmful stereotype regardless

drifting ore
#

at face value, the stereotype of being exceedingly efficient is hardly harmful. But if you view "harmful" through the prism of evoking untrue assumptions then any and all stereotypes are harmful and calling them such is redundant.

bronze yoke
#

it plays into and around a lot of more overtly harmful stereotypes + not to mention racist conspiracy theories

drifting ore
#

yeah well flat earth conspiracy exists so at this point one need not even care

frank elbow
#

Yeah, racial stereotypes of β€œgood” things are definitely still harmful

#

There are plenty I can think of

bronze yoke
#

nobody wants to be pushed into a box like that

frank elbow
#

Re. the second part of that message though, some stereotypes based on things that aren't immutable may not be harmful (or as harmful)

drifting ore
#

like what

frank elbow
#

Stereotypes about lawyers, for exampleβ€”β€œlawyer” is not inherent to anyone's identity. Still probably inaccurate

#

Replace lawyer with whatever profession, or any other aspect of a person that isn't related to their unchangeable identity

drifting ore
#

i'm asking because it sounds awfully like "some stereotypes are true"

frank elbow
#

Well that isn't what I said so 🀷🏾

#

I'm just saying calling a stereotype harmful wouldn't be redundant, even if the premise were true

#

This isn't really the place for this convo anyhow though & I probably shouldn't have revived itβ€”just wanted to give my two cents since it rubbed me the wrong way. Plenty of resources for learning more online

drifting ore
drifting ore
frank elbow
#

Lmao yeah I guess on a technicality it's related, but still probably something I should've just left alone since the chat had moved on already

drifting ore
#

Nobody's question about making a mod was interrupted so i figure it's fine.

prisma wren
#

its just in the output log?

bronze yoke
#

in Zomboid/console.txt

safe seal
#

Hey so, I'm a pretty bad and inexperienced modder. Last time I made a mod was a few years ago so I don't remember everything.

I'm making a mod that just changes the forageDefinitions file, and in particular just modifies the forageCategories part of it. I can get it to work if I put the full file in, both the unchanged and changed parts. However, from what I remember that would make it incompatible with other mods that change the forageDefinitions file, even if it changed a different part like forageSkills.

How would I make it so I can only implement the changed parts?

prisma wren
#

i need to get a program fully intended for coding

bronze yoke
#

i recommend vscode

prisma wren
#

so this happened because something in the code was incorrect and causing an error

#

good to know

uneven jay
#

yall know why i have the ingridients to craft something but cant?

#

nvm i fucked up by putting keep as Keep

grizzled fulcrum
# bronze yoke i recommend vscode

same^
I plan on making a vscode extention for all scripts like item, recipe, model scripts, sandbox options etc to give highlighting and errors too so you can find out before you load into the game and it doesn't tell you literally anything

bronze yoke
#

jab's got one for scripts, idk what state it is in exactly though

wild estuary
#

I'm working on a mod that creates a new item and for now, I just want that item's icon to be the same as the tv remote. How do I specify that in the script .txt file?

prisma wren
#
function ZomboxycyclineMonitor(player)
    local playerdata = player:getModData();
    local playerBody = player:getBodyDamage();
    local infectionStatus = playerBody:IsInfected();


    if playerdata.ZomboxycyclineHours == nil then
        playerdata.ZomboxycyclineHours = 0;
    end

    if playerdata.ZomboxycyclineHours > 0 and infectionStatus == true then
        local bodyParts = playerBody:getBodyParts();
        local bodyDamage = player:getBodyDamage();
        

        bodyDamage:setInfectionMortalityDuration(-1);
        bodyDamage:setInfectionTime(-1);
        bodyDamage:setInfectionLevel(0)
        
               
        for i=bodyParts:size()-1, 0, -1  do  --the game is erroring on this line of code and i dunno why
                local bodyPart = bodyParts:get(i);
            bodyParts:setInfectionLevel(0)
        end

        print("Balls")
        print(bodyDamage:getInfectionMortalityDuration())

        return;
        
    end
    
end
#

this for loop is wrong in some way

prisma wren
#

if its lua cant i just do #whateverarrayitis?

bronze yoke
#

no, # only works on tables

prisma wren
#

so its not a table, darn

#
LOG  : General     , 1723683816601> Object tried to call nil in ZomboxycyclineMonitor
#

on that line where i've got the comment

bronze yoke
#

bodyParts:setInfectionLevel(0) should be bodyPart:setInfectionLevel(0)

prisma wren
#

anything else?

bronze yoke
#

the rest looks fine from here

prisma wren
#

alright time to test

wild estuary
uneven jay
#

np

prisma wren
#

after this i need to make the usage of the pills make a sound then make my custom model and its textures shown and

#

i'll just figure it out as i go

#
function: ZomboxycyclineMonitor -- file: TheyKnewNMRIHaddon_TakePill.lua line # 35 | MOD: They Knew NMRIH addon

LOG  : General     , 1723684238247> Object tried to call nil in ZomboxycyclineMonitor
        for i=bodyParts:size()-1, 0, -1  do
            local bodyPart = bodyParts:get(i);
            bodyPart:setInfectionLevel(0) --this is line 35
        end

something is wrong with this loop in some way

bronze yoke
#

oh, there's no such thing as infection level on an individual body part

prisma wren
#

so this loop is pointless then and i can remove it?

grizzled fulcrum
bronze yoke
prisma wren
#

is that for zombification or like wound infection

bronze yoke
#

zombification

prisma wren
#

im trying to make this just stall the infection by resetting the timer for a period of time

#

not remove infection entirely

#

so i'll see what happens without setting the infection of the body parts

bronze yoke
#

if you set the main bodydamage not infected but not the parts i think it'll just reinfect them when the game reloads

#

if you want to delay it i think you don't need to touch this yeah

prisma wren
#

great, thanks

#

and it looks like its working how i want but i'll just run the timer down to see that it works fully

#

also does setting infection mortality to -1 reset its timer or does it just make it not progress

bronze yoke
#

it resets it

prisma wren
#

perfect

ancient grail
bright fog
#

Oh

#

That's interesting

#

What did you do exactly ?

hardy drift
#

my first mod is almost to 100 subs lets go

#

just recorded the most satisfying soundbite for it too

uneven jay
#

yall whats the order that i need the mod in to upload it

bright fog
uneven jay
bright fog
#

Folder ?

#

Organisation ?

uneven jay
#

C:/Users/User123/fawdwadafa

uneven jay
#

like

bright fog
#

Just check the mod template

uneven jay
#

is there a little thing i can use anywhere?

#

uh

#

alr

#

ill try

#

ig i messed something up

#

cuz i tried that

ancient grail
bright fog
ancient grail
#

it also applies to zombies

bright fog
#

Would there be any use to it ?

ancient grail
#

if you want to hide like a camera perspective mod

cuz doing invi still doesnt hide you from your own screen
but if you apply clothing that masks everything then shadow , name, admin tag will remain

same with the admin tag i spammed it
for the username i just set it to blank

#

maybe useful for streamers or admins idk..

ancient grail
#

oh cool

hollow canyon
#

Hello everyone. I’m trying to add a command in Project Zomboid to remove a specific item from a player’s inventory, but the command doesn’t work.

I’m adding the Lua script to the Project Zomboid\media\lua\server folder, but I can’t get it to run in the game.
Tell me what am I doing wrong?
Here’s the code:

drifting ore
#

server and client commands are internal commands, RCON commands are a different thing

hollow canyon
drifting ore
#

i guess so? if you run a modded server, all clients download all server mods

hollow canyon
drifting ore
#

well this sort of thing will run as a mod either way

#

since it's not a part of the base game

hollow canyon
# drifting ore since it's not a part of the base game

There is no way to add a command to Lua to delete items from the inventory? Cheaters create 10,000 generators in the player's inventory. I am trying to create a script for moderators to delete them. Without access to Lua

drifting ore
#

if that's the issue then you're focusing on the wrong aspect of it

#

the appropriate solution here is to ban cheaters

#

in any case, as I said, since this functionality isn't in the base game, it will have to run as a mod

hollow canyon
hollow canyon
drifting ore
bronze yoke
#

if you just add to/modify the game files it'll make the checksum fail for all players

hollow canyon
sour island
#

That's just lua

#

I think you're conflating terminology due to Lua being a scripting language and there being "scripts" in PZ

#

There is a way to have Lua on the server alone, but it would be a problem in any case where the code needed to be available to clients.

hollow canyon
sour island
#

What's the issue with mods anyway?

hollow canyon
sour island
#

It's not really feasible

hollow canyon
#

I can't understand why the game allows the moderator to delete any number of items from himself. But it only deletes 1 from the player🀨

sour island
#

I feel like I've missed something

#

Regardless if you want to modify the way the game works it would need to be a mod. You could load stuff for server-side use, but as an admin you're a client.

#

Which is where sending code through network would need to happen - but even the loading stuff through network would need to be a mod.

#

So short answer to "can you just change stuff for server only" no

hollow canyon
sour island
#

πŸ‘

hot patrol
#

so i'm setting up distribution for a thing and I want it to draw from and array list. Does this look right? I have no idea what i am doing and am throwing things at the wall based on another piece of code. ```require 'Items/ProceduralDistributions'

local DakimakuraWeapons = require("DakimakuraList")
local OpaiZList = require("OpaiZList")

--Dakis
table.insert(ProceduralDistributions["list"]["WardrobeMan"].items, "Base." .. DakimakuraWeapons:get(rand));

--Manga/Doujinshi
table.insert(ProceduralDistributions["list"]["WardrobeMan"].items, "Base." .. OpaiZList:get(rand));```
mellow frigate
hot patrol
#

how would I stop that?

#

in concept tho this is correct?

#

I have something similar but it's for the items actually spawning on a tile in the world. This persists without rerolling

bronze yoke
#

can i ask why you're using an arraylist?

hot patrol
#

think like true music

#

but for degenerates

drifting ore
#

you don't need to use RNG at that stage, you need to set up probabilities for all your items in the distribution list and the game will draw items randomly according to settings

bronze yoke
#

you should just use a table, they're native to lua so they're much faster and the syntax is less weird

hot patrol
bronze yoke
#

ok that's fair

hot patrol
#

good to know tho

#

I will note that down

bronze yoke
#

you probably just want to loop through your arraylist and add all of them to the distributions rather than randomly picking one

#
local wardrobeMan = ProceduralDistributions["list"]["WardrobeMan"].items
for i = 0, DakimakuraWeapons:size()-1 do
    table.insert(wardrobeMan, DakimakuraWeapons:get(i))
    table.insert(wardrobeMan, 0.001) -- this is the spawn chance, this should probably be quite low since you're presumably adding lots of items at once
end
hot patrol
#

thank you

#

and also thanks for the table suggestion. I am working on trying to find someone to update my addon system so I will maybe add that to the commission request if it's better

bronze yoke
#

i don't know exactly what you use that list for, if it's just stuff like this it might not be critical since it doesn't hugely matter how fast you do distributions stuff (it just makes the game take longer to load, which isn't a big deal compared to laggy gameplay), but using an arraylist is just overall really strange

hot patrol
#

if that makes sense

#

I probably explained that as poorly as possible

#

lol

bronze yoke
#

no i get it!

#

it doesn't sound like that would be too laggy either way

hot patrol
#

that's good. I worry about loot saturation since it's my main gripe with true music but one step at a time. if you are running enough addons to have thousands of anime body pillows thats on them and they should get their head examined

#

lol

bronze yoke
#

yeahhh the loot saturation issue is a massive pain to fix

hot patrol
#

one build42 releases it will be a god send. rather than having to have each body pillow varient be it's own unique item I'll be able to just have it be one with multiple texture options

bronze yoke
#

i've done it for a couple other mods in the past, i keep meaning to just write a framework for it

#

(though i got paid both times so maybe i shouldn't 😈)

hot patrol
#

I use a lot of music addons and it was making it hard to find skill books

bronze yoke
#

yeah, i use a similar concept but it kind of opens itself when it spawns?

hot patrol
#

with mine you have to open it yourself but yes i've seen other music mods do that

#

I like my method since it's like a loot box

bronze yoke
#

have you used music for the end of the world? that's where i originally wrote it

hot patrol
#

gamba addict

bronze yoke
#

pomp's items uses some similar code too

hot patrol
hot patrol
#

I say mine but I didn't actually code. it you get it.

bronze yoke
#

oh wow, i had no idea that was from another mod

#

that explains it using an arraylist LOL

hot patrol
#

yep. they thought it was funny so they asked to copy it over

#

lol

hot patrol
# bronze yoke ```lua local wardrobeMan = ProceduralDistributions["list"]["WardrobeMan"].items ...

so if I understood this correctly then this here should spawn one of the items from my arraylist in each of these spawn locations?

    local BookstoreBooks = ProceduralDistributions["list"]["BookstoreBooks"].items
    for i = 0, OpaiZList:size()-1 do
        table.insert(BookstoreBooks, OpaiZList:get(i))
        table.insert(BookstoreBooks, 0.001)
    local ClassroomDesk = ProceduralDistributions["list"]["ClassroomDesk"].items
    for i = 0, OpaiZList:size()-1 do
        table.insert(ClassroomDesk, OpaiZList:get(i))
        table.insert(ClassroomDesk, 0.001)
    local CrateBooks = ProceduralDistributions["list"]["CrateBooks"].items
    for i = 0, OpaiZList:size()-1 do
        table.insert(CrateBooks, OpaiZList:get(i))
        table.insert(CrateBooks, 0.001)
    local LibraryBooks = ProceduralDistributions["list"]["LibraryBooks"].items
    for i = 0, OpaiZList:size()-1 do
        table.insert(LibraryBooks, OpaiZList:get(i))
        table.insert(LibraryBooks, 0.001)
    local LivingRoomShelf = ProceduralDistributions["list"]["LivingRoomShelf"].items
    for i = 0, OpaiZList:size()-1 do
        table.insert(LivingRoomShelf, OpaiZList:get(i))
        table.insert(LivingRoomShelf, 0.001)
    local LivingRoomShelfNoTapes = ProceduralDistributions["list"]["LivingRoomShelfNoTapes"].items
    for i = 0, OpaiZList:size()-1 do
        table.insert(LivingRoomShelfNoTapes, OpaiZList:get(i))
        table.insert(LivingRoomShelfNoTapes, 0.001)
    local SchoolLockers = ProceduralDistributions["list"]["SchoolLockers"].items
    for i = 0, OpaiZList:size()-1 do
        table.insert(SchoolLockers, OpaiZList:get(i))
        table.insert(SchoolLockers, 0.001)
    end```
unreal pewter
#

is this the loot pools for certain zombie types?

#

hm, well im trying to find where outfits are for certain zombie types, as well

dry chasm
cerulean sonnet
#

I doubt I can take two already made mods and combine them into one and change things when I have to separate them. I was thinking about taking the miners mod and the table mod and making them into one and adding craft to the tables

thick karma
# cerulean sonnet I doubt I can take two already made mods and combine them into one and change th...

I feel like you're trying to ask something here, but it's being lost in translation. The first sentence doesn't make sense as written... I am guessing what you mean is that you doubt two separate mods can be combined into one?

If so, I don't know why you doubt that. It is often possible to combine two mods into one. But I would wonder why you would want to do that.

The second sentence makes me think you're trying to ask how the "miners mod" options could be associated with some sort of crafting table from another mod.

I would suggest to try to be specific about exactly what you're trying to do, and also which mods you're trying to merge...

Whatever you're trying to do, I would suggest you try to ask specific questions if you want to increase likelihood of someone responding quickly with a specific answer that moves you forward.

hot patrol
#

anyone know if it is possible to disable an occupation with a sandbox option?

#

my mod adds a custom one and I want players to be able to disable it if they don't want it

bright fog
#

Oh wait sry

#

Read that wrong

#

But the answer is still no

#

The problem is that the sandbox options are not loaded when you create your character

hot patrol
#

yea that makes sense.

bright fog
#

So you can't delete a profession or trait that way

#

The way I did it with Susceptible Overhaul is with a secondary mod

#

Sadly

hot patrol
#

not a big deal. I just wanted to know if it was possible to condense my mod with just sandbox options

bright fog
#

Yup

hot patrol
#

never played around with sandbox options so I am just seeing what I can and can't do

bright fog
#

You could

#

Perhaps use Mod Options

#

But that wouldn't work for servers

hot patrol
#

if you don't mind could you tell me if these look like proper uses of my sandbox options?

hot patrol
#

making it a second mod just makes the most sense

bright fog
#

Yeah but when you add tens of professions it's tough

hot patrol
#

thankfully I only have the one

#

local DakimakuraWeapons = require("DakimakuraList")
local OpaiZList = require("OpaiZList")

    --Benni & PowPow's
    table.insert(ProceduralDistributions["list"]["FreezerTrailerPark"].items, "Base.BenniPow");
    table.insert(ProceduralDistributions["list"]["FreezerTrailerPark"].items, 0.13);
    table.insert(ProceduralDistributions["list"]["FreezerGeneric"].items, "Base.BenniPow");
    table.insert(ProceduralDistributions["list"]["FreezerGeneric"].items, 0.16);
    table.insert(ProceduralDistributions["list"]["FreezerRich"].items, "Base.BenniPow");
    table.insert(ProceduralDistributions["list"]["FreezerRich"].items, 0.1);
    table.insert(ProceduralDistributions["list"]["FreezerIceCream"].items, "Base.BenniPow");
    table.insert(ProceduralDistributions["list"]["FreezerIceCream"].items, 2.6);
    table.insert(ProceduralDistributions["list"]["TheatreKitchenFreezer"].items, "Base.BenniPow");
    table.insert(ProceduralDistributions["list"]["TheatreKitchenFreezer"].items, 1.5);

    --Dakis
    local wardrobeMan = ProceduralDistributions["list"]["WardrobeMan"].items
    for i = 0, DakimakuraWeapons:size()-1 do
        table.insert(wardrobeMan, DakimakuraWeapons:get(i))
        table.insert(wardrobeMan, 0.001 * SandboxVars.BigDegens.DakiSpawnRate) -- this is the spawn chance, this should probably be quite low since you're presumably adding lots of items at once
    end

    if SandboxVars.BigDegens.Manga then
        --Run-N-Tug
        table.insert(ProceduralDistributions["list"]["BathroomShelf"].items, "Base.RubNTug");
        table.insert(ProceduralDistributions["list"]["BathroomShelf"].items, 0.13);
        table.insert(ProceduralDistributions["list"]["BathroomCounterNoMeds"].items, "Base.RubNTug");
        table.insert(ProceduralDistributions["list"]["BathroomCounterNoMeds"].items, 0.13);
        table.insert(ProceduralDistributions["list"]["BathroomCounter"].items, "Base.RubNTug");
        table.insert(ProceduralDistributions["list"]["BathroomCounter"].items, 0.13);
        table.insert(ProceduralDistributions["list"]["BathroomCabinet"].items, "Base.RubNTug");
        table.insert(ProceduralDistributions["list"]["BathroomCabinet"].items, 0.13);
        
        --Manga/Doujinshi
        local BookstoreBooks = ProceduralDistributions["list"]["BookstoreBooks"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(BookstoreBooks, OpaiZList:get(i))
            table.insert(BookstoreBooks, 0.001 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local ClassroomDesk = ProceduralDistributions["list"]["ClassroomDesk"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(ClassroomDesk, OpaiZList:get(i))
            table.insert(ClassroomDesk, 0.001 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local CrateBooks = ProceduralDistributions["list"]["CrateBooks"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(CrateBooks, OpaiZList:get(i))
            table.insert(CrateBooks, 0.001 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local LibraryBooks = ProceduralDistributions["list"]["LibraryBooks"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(LibraryBooks, OpaiZList:get(i))
            table.insert(LibraryBooks, 0.001 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local LivingRoomShelf = ProceduralDistributions["list"]["LivingRoomShelf"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(LivingRoomShelf, OpaiZList:get(i))
            table.insert(LivingRoomShelf, 0.001 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local LivingRoomShelfNoTapes = ProceduralDistributions["list"]["LivingRoomShelfNoTapes"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(LivingRoomShelfNoTapes, OpaiZList:get(i))
           ```
#
table.insert(LivingRoomShelfNoTapes, 0.001 * SandboxVars.BigDegens.MangaSpawnRate)
        end
        local SchoolLockers = ProceduralDistributions["list"]["SchoolLockers"].items
        for i = 0, OpaiZList:size()-1 do
            table.insert(SchoolLockers, OpaiZList:get(i))
            table.insert(SchoolLockers, 0.001 * SandboxVars.BigDegens.MangaSpawnRate)
        end
    end```
bright fog
#

Anything that uses sandbox options, needs to run on a save launch

#

So here you're using it but the sandbox variable still doesn't exist when you load lua

#

The problem is that inserting a table like this would insert everytime you load a save, thus creating duplicates of the items

#

My guess is the best way to do that would be to reference a value within your own table, and this value is replaced OnGameStart with your sandbox option value

#

Thus it's also replaced within the distribution

hot patrol
#

hmm, guess I thought too soon when I believed I was getting the hang of this

#

lol

bright fog
#

That can happen hahalol

hot patrol
#

I won't bother posting the other one because that's even more complicated and likely to be wrong

bronze yoke
#

it is possible

#

sandbox options are always loaded when making your character

#

think about there being sandbox options for extra trait points, and sleep traits depending on sleep being enabled

#

for distributions you can just do it in an OnInitGlobalModData handler and call ItemPickerJava.Parse() at the end

bright fog
#

So how would you go about that ? What trigger should you use for the professions and traits ?

bronze yoke
#

i have a setup for sandbox-dependent traits but i haven't had to touch professions with it

bright fog
#

Professions are similar to traits

bronze yoke
#

since you can't change traits at runtime you can't really have them respond to sandbox option changes

hot patrol
#

you might be able to help me with the bed spawn portion since you worked on that for creep

bronze yoke
#

sure!

drifting ore
bronze yoke
#

my wording was a little unclear but what i mean is you can't actually change a trait object after construction so no 'trigger' to set its values would be appropriate, what you can do is patch its getters to return the sandbox values

#

they only get accessed from lua and everything is enforced by the ui so it doesn't matter that the 'real' value isn't changed

tropic oriole
#

anyone know why a zombie created with createZombie function crash the game if touch a fence?
[16-08-24 17:30:51.057] ERROR: General , 1723822251057> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "zombie.characters.BodyDamage.BodyDamage.getBodyPart(zombie.characters.BodyDamage.BodyPartType)" because the return value of "zombie.characters.IsoGameCharacter.getBodyDamage()" is null at ClimbOverFenceState.shouldFallAfterVaultOver line:587..

tropic oriole
#

ok, I removed line by line, happens when I set z:setRunning(true) and touch the fence

grizzled fulcrum
#

That's weird how would running null body damage

uneven jay
#

hello how do you make occupation mods?

#

or can you not

#

i couldnt find thier code in the wiki page unlike other stuff like items

tropic oriole
uneven jay
#

also another question lets say i made new items for mechanics like idk a tempered glass winshield if i list it as heavy duty can i install it in those cars

warped valve
uneven jay
#

guys can i make a mod where i use universal vehicle partsfor vanilla vehicles? or anything like that

#

like i wanna add tires and some suspension

#

is that possible

drifting ore
#

how does getFileReader works on the server?

bronze yoke
#

exactly how it works on the client, but on the server

#

if you wanted to know what it does in general, it opens a file in the game's cache's Lua/ folder

thick karma
uneven jay
#

what bout my otha question

#

also thx for answering

#

not alot of people active here

thick karma
#

I just have an occupation mod that afaik 100% works bug-free and could be used as a basis for others

#

Has special foraging skills defined, special outfits defined, and has similar perks to vanilla Veteran

hearty mason
#

Howdy, I've never made a mod for Project Zomboid, but I had an idea to solve the indoor weather issue. The mod would add a new floor tile, that is invisibile, and has no clipping. This way, you can have a "floor" in order to satisfy the room sealing requirements, but you can still have the freedom to build in a way that should by all means be possible. Does anyone have any tips for the best way to go about making this?

drifting ore
# bronze yoke exactly how it works on the client, but on the server

I'm asking because I have this ridiculously complicated config screen which saves its own sandbox settings file because sandbox text entry length limit is chump change compared to save string length. So this file somehow needs to end up on the server and be loaded properly. If I generate this file on a local machine, it puts it in /Zomboid/Lua, could I copy it to the same folder on the server? Also, server sandbox settings are saved through an .ini file, could I just dump 20 pages of text into the text entry field? I mean would it load? Would it not get clipped by the game afterwards?

hollow canyon
#

Hello. Could you please tell me how to display a player's (client's) inventory through the command console so that their inventory is printed to the console? Is there a ready-made script for this?

tropic oriole
#

Anyones know what I'm doing wrong? I render for example an square like this:

local function renderSquareAt(x,y) local floorSprite = IsoSprite.new() floorSprite:LoadFramesNoDirPageSimple('media/ui/FloorTileCursor.png') floorSprite:RenderGhostTileColor(x, y, 0, 0.0, 1.0, 0.0, 0.8) end

called in the OnPostRender event. But despite x and y didnt change on some frames its rendered in another location.

I attach a video to show the problem:

autumn frigate
#

Pretty sick of having to reload the entire environment every time I make a change to my mod.

Is there any way to reload specific .lua file while the game is already loaded?

I've used the debug menu to do so, but my changes to the file aren't actually reflected when doing that. Seems to cache them in some way, and I'm not sure we have access to clearing specific .lua from the cache

tropic oriole
#

If you press F11 to go debug and reload the file, should work.

autumn frigate
#

I wish it did. Doesn't seem to. Even changing something as simple as the string of a print statement is not reflected. Still prints the old string.

Same thing when using reloadLuaFile

coarse sinew
bronze yoke
#

global state changes like adding event handlers won't be reverted by reloading the file, it's best to not use file reloads when using them

tropic oriole
#

or if your code loads from events like OnGameStart, you will not see any change, since it will not be triggered as Elyon suggest

coarse sinew
tropic oriole
#

I'm starting to think its a problem of the game, because if you open the chunk debugger, you can see the same problem

autumn frigate
#

I'm reverting back to the closest version I had to working, will post some code\images for reference.

autumn frigate
#

So, although I am using events. The only event called (while in debug mode) is to generate this UI. I have my reload function destroying and rebuilding the menu in itself, so the need for the event to be retriggered is a moot point.

Hmm a new development. It seems it's only the print statements WITHIN functions that aren't changing after the reload. Maybe I just need to clear those functions from the cache somehow.

Regardless, here's what I'm working with at the moment.

The text I've been trying to get to change is the simply the string the test button outputs.

tropic oriole
#

you are using OnGameStart xD

autumn frigate
#

Indeed.

tropic oriole
#

this event is not triggered when you realod the lua

autumn frigate
#

The function itself triggers it.

#

So retriggering the event isn't necessary.

tropic oriole
#

ah this is the other lua i dint check it , let me see

bronze yoke
#

testButtonUI is a local variable, it still refers to the original local from when this function was compiled, not the new one in the reloaded file

tropic oriole
#

yes

#

I think you can change testButtonUI to global and add a testButtonUI:onGameStart() after writeCustomLog("BuildingMenu_Creative_Debug_UI.lua has been loaded."). At least for dev process maybe make the work?

coarse sinew
autumn frigate
# coarse sinew Hmm, are you trying to remove objects and tabs from the Building Menu? I was goi...

Well. I started just adding a few appliances he was missing. Propane barbecue, coffee makers, toaster.

I also kind of wanted to make a Vanilla tab so you could do all the vanilla builds with the building menu as well.

In that process I realized there are an awful lot of tiles that aren't in it.

Then I realized there is some demand for a creative mode, so I decided to try and make a a tab that simply adds everything dynamically. If you've ever looked at his code he's added each individual tile statically. Props for the dedication, but what a labor that must have been.

#

But I got super hung up on having to wait a solid two minutes every time I made a small change. So for the past two days I've been focusing on getting this reload button to work. Hopefully this local vs global thing is the issue

silk pike
#

Hi everyone! Sorry for my bad English...
I'm creating a mod that overwrites the Vannila professions with those created by me. Is it possible to insert a skill-cap for certain skills??
For example, I would like a fighter not to be able to exceed level 5 of carpentry.
Thanks to those who will dedicate some time to me

autumn frigate
#

(β•―Β°β–‘Β°)β•―οΈ΅ ┻━┻

#

@tropic oriole @bronze yoke
Simply removing "local" when declaring testButtonUI did indeed work.
I should've come here two days ago.

tropic oriole
#

yep but you need to do two clicks yes? reload lua and your reload button, right?

autumn frigate
bronze yoke
#

i recommend changing it back when you're done testing, globals are bad practice

coarse sinew
tropic oriole
#

Ah yes i see you reload with code, then its fine

autumn frigate
bronze yoke
#

that is one reason, but also because they're slow and enabling of weird code

tropic oriole
#

local is also faster and has less overhead

autumn frigate
autumn frigate
#

I just hate the idea of having to remember to go back and change it

bronze yoke
#

try something like this at the end of your file:```lua
if isDebugEnabled() then
testButtonUI_debug = testButtonUI
end

magic halo
#

Does anyone know which file the "getPlayerCraftingUI(num)" function is defined in?

bronze yoke
#

this will just set the value of the local, if you want to globalise it that way you need to either use a different name or use the syntax _G.var = 0

magic halo
autumn frigate
#

Is there a way to clear the error log in F11? At the moment I have to full restart the game to do so. Since I can't copy and paste from there I've had to restart the game, recreate the error, and send a picture to Chat to relay error messages out of it.

Sometimes I use the debug log, but it doesn't seem to display identical information.

bronze yoke
#

stack traces go into console.txt, that's usually what i check

#

(not least because the error menu opens at the top but the latest error is at the bottom??)

autumn frigate
#

Ah true. Guess I've done that a few times too. Will become the common practice I suppose.

#

Is there any verbosity settings for console.txt? Or is it always everything all the time

bronze yoke
#

it's always everything all the time (some stuff is suppressed in non-debug), there's some divided logs in the logs folder that might be better

autumn frigate
#

Good to know. Appreciate the tips

cerulean sonnet
#

I was wondering if you could play in two different mods and combine them in one and Dynamic Mining in this mod I would remove the gold, salt, silver, and aluminum and put in the copper. And the second mod is this Crafting Enhanced Core. This mod only has a table. Is making crafts with the first mod possible and how did you do it?

neat coral
#

Is there any resource on making new skins for existing vehicles?

bright fog
neat coral
#

Mods that add skins? I already know a few. Im asking cuz I wanna make my own

fair jolt
#

Hello, is zomboid lua capable od http calls? I would like to create mod that depends on PlayerShops and would post listings trough webhook.

bright fog
neat coral
#

Check these for what exactly?

ancient grail
#

cant really interact with it

bright fog
#

How they add more texture options

long hull
#

Howdy folks, I have been working a ton on map modding and tile creation so far, but would like to get a bit more into mod development. Is there a source I can use to get started with lua and the PZ specifics attached to it? I have some experience in programming, not much with lua yet though.

#

I already have a mod idea, but I have no clue where to actually start

fleet bridge
long hull
# fleet bridge What are you trying to do?

Simply put, I have built a power plant (originally for my town, but now I want to use it for a specific mod first) that I want to use in conjunction with sub stations in order to power certain regions (cells) on the map. The Restore Utlities mod already does a lot of what I need, but for the entire map instead of certain regions.

#

I do not understand enough of the PZ lua stuff yet on where to start with this

bright fog
#

From what I understood reading some conv about it

long hull
bright fog
#

Sadly I don't think so, I believe the reason is that any handling of electricity is locked behind the java (which if you mod, that requires a bit harder coding and also manual installation from players)

#

So increasing the range of a generator for example, I don't think is possible without the java part

#

ik there's some that know more than me/have more detail

#

But that's the main reason you haven't seen any system reworking the electricity system yet

meager belfry
#

What is the PZ code which gets the current month in-game in no particular preferential date format? (For an if statement)?

bright fog
meager belfry
#

Thanks

long hull
bright fog
#

Bcs you'd have to make a java manual install

#

And that's if you manage to use the java

drifting ore
long hull
drifting ore
#

well IsoGridSquare has setHaveElectricity so you can work something out with that

#

not sure how would it interact with generators because they use the same function to toggle grid square powered status

#

by the way what happens if you turn a generator on and off while the grid electricity is still active?

bronze yoke
#

nothing

#

grid electricity is baked into the method that checks for electricity, it's not state of the square

drifting ore
#

then this is only an issue if you use this manual power override in conjunction with generators

fleet bridge
#

Turning on square electricity after power turns off will only work for lights iirc, stuff like fridges and freezers won't work still and need generator

bright fog
# long hull In theory possible, but not that easy to do then. Sad...

In this episode of Project Zomboid Mods Done Quick, we take a look at three amazing map mods that are joined together and deserve your attention!

Enjoy!

------------------------------------- Important Links -----------------------------------------

Patreon & Server Whitelists: https://www.patreon.com/mratomicduck

My Discord: https://discord....

β–Ά Play video
#

(if you're that Simon_MD)

long hull
bright fog
#

Got my own short too, AtomicDuck giving us some love :3

unique sequoia
#

So is there like a wiki or guide for getting started on modding? I'm trying to create a poster pack just to get started and I'm completely lost.

unique sequoia
barren goblet
#

Does anyone know if it is possible to modify the randomly generated stories, like for example adding or removing items from the randomized table stories to include or exclude other food items?

grizzled fulcrum
#

that path may not be fully correct since i am unsure if I remember fully but it should be mostly accurate

astral geode
#

you can right click on project zomboid in the steam library and open the local folder from there and just go up until you see the workshop folder

grizzled fulcrum
#

True, I just include the full path so I don't have to type out the steps like 5 times

unique sequoia
#

ok, awesome

#

sorry, this is just my first time modding anything so I didn't even think of that

limber onyx
#

Hi guys. Sorry for the noob question.

How do you create mod dependencies in the workshop? I see some mods require you to subscribe to some other mod in order for it to work. How do you do that?

bronze yoke
#

after you upload your mod you can add them with the Add/Remove Required Items button on the workshop page

limber onyx
#

thanks!

mystic vessel
#

Good evening everyone, I have a question.
I made this specific tile have an ambient sound
and it works perfectly.

However, when the player leaves the sound range, the sound ends abruptly.
and it doesn't go down smoothly, is there anything that can be done?

#

Is there any way I can smooth this out? so that the sound slowly disappears and doesn't cut out of instantly?

grizzled fulcrum
#

For example, you need to be in the range of distanceMin to distanceMax tiles to be able to hear the sound. I think you can make distanceMin to 0 if wanted.

polar steppe
#

Hi guys,
I'm looking to make a simple mod that allows you to change in the settings the range that you can plumb sinks and appliances with rain and barrel collectors, but I have no idea how so I was looking for guidance (it would also be nice if I could get it to plumb through 2 floors, but that's just a bonus)

thick karma
grizzled fulcrum
thick karma
#

😭

copper rapids
#

guys how can i make music mod?

polar steppe
#

note: if you add it to an existing save it will only start spawning in previously unloaded chunks

old bobcat
#

ermm, not me makin a mod, but my frien, does anyone have the normal female playermodel, wuh

#

as blend. or smh

#

file type

thick karma
long hull
# bright fog In theory, yes, viable ? No

Well, I have thought about my mod idea and I am going to adjust it a bit that power will be on everywhere. Only difference is that several substations must be repaired for this to work. I still do not know though how I can access the necessary data from PZ in lua. What functions I have available, which classes/objects etc.
Right now I would need the info of where (which square) the player action has been executed on, so I know the sub station location and can set this one to be repaired (if the repair action was successful). I am looking in the PZ wiki, but not sure if it is in the correct area I am looking in...

bright fog
#

I invite you to join the modding Discord too for even more technical aspects

long hull
bright fog
#

And a class can have a subclass

#

Let's say at the top right in the search bar you search for IsoZombie

#

You get this

#

That list on the left means that IsoZombie is an IsoGameCharacter

#

And IsoGameCharacter is an IsoMovingObject which is an IsoObject

#

It means that IsoZombie inherits most of the methods and fields from the previous classes

long hull
#

yeah

bright fog
#

In the same way, IsoPlayer is also an IsoGameCharacter, and thus zombies and player objects have things in common but also have their own unique methods that only work for them or subclasses from themselves

#

(which I don't think there are any subclass for these 2 specific examples)

long hull
#

so, if I were to look for the class that can give me data from the iso world, I would need to find that

bright fog
#

In your case you want to access a square ?

#

You have multiple ways of doing that

long hull
#

yes, the square where the action has been executed on

bright fog
#
  • from X Y Z coordinates
  • from another object (getSquare() retrieves the square the object is on)
  • from the context menu (right clicking a tile will give the objects in it in a list for you to use)
#

So in your case you would want to give the player the ability to right click a specific square and interact with it ? You'd have to use the context menu

long hull
#

Well, the mod I use already does that. I have assigned some coordinates in a file, where the action can be executed

bright fog
long hull
#

Now, as there are different locations with different coordinates, I want to know which one it is

bright fog
long hull
#

and get these coordinates. THen I know in which sub station the player currently is trying to repair

bright fog
#

Yeah I get what you're trying to do but first you have to know how to access your square

#

Once you get your square, getting the coordinates and verifying they are the right one is easy

#
local function OnFillWorldObjectContextMenu(playerIndex, context, worldObjects, test)
    -- Your code here
end

Events.OnFillWorldObjectContextMenu.Add(OnFillWorldObjectContextMenu)
#

This gives you the playerIndex, which you can retrieve the player that right clicked, the context menu so you can add new options to the context menu being opened by that player, the list of worldObjects (and test idfk what it is)

#

You'll be interesting in worldObjects here

#

Because you're square will be accessed from it

#

What I would suggest you do, is run that code, and print the values that are given to you

#
local function OnFillWorldObjectContextMenu(playerIndex, context, worldObjects, test)
    print(playerIndex)
    print(context)
    print(worldObjects)
end

Events.OnFillWorldObjectContextMenu.Add(OnFillWorldObjectContextMenu)
#

In the console, this might give you some informations on what you are working with

#

If those are java objects for example, it will tell you for the player for example:

local player = getPlayer()
print(player) -- prints IsoPlayer:a_number
#

So you know player is an IsoPlayer object

#

Thus you go in the documentation, and look what you can do with this

#

Well you do the same here with your context menu event

long hull
#

Okay thanks - I'll have to do some more research about this as I do not fully understand how these functions (and where they) are called yet. Been only working with Java and C++ so far

bright fog
#

isGhostMode() being a method than can be applied to IsoPlayer

#

We still don't have proper tutorials but you might get better help on some more technical stuff

long hull
#

Thanks!

bronze yoke
#

you can't be too close to hear a sound

alpine scroll
#

There is a mod that has a function as a recipe code. If I make my own function and load it later, will it override the original mod function, as long they are the exact same name?

#

Basically I want to mod a mod

bronze yoke
#

yes

alpine scroll
#

Thanks

#

I am adding the 4 missing dance cards for true actions v3, Dancing

#

Since currently as it is(at least the version I am using), you cannot get 27,28,29 or 30

alpine scroll
#

Me again

#

Do I need to add the items.txt to my own mod or is there a way to make my mod spawn items from another mod?

#

Because I did overwrite the function, but now its giving no items instead of the items I wanted. I'm not sure if 'require' can load other mod items

bronze yoke
#

you don't need to redefine the items

alpine scroll
#

But I do need to import them somehow, right?

bronze yoke
#

not to call them from lua

alpine scroll
#

if I do a .txt inside scripts with imports { TAD } is enough? Or does it need to be imports { base }

bronze yoke
#

the whole game shares a single lua context

alpine scroll
#

I mean, I did override the function, but it didnt give the items, so maybe I did something wrong. I'll check a bit

alpine scroll
#

I honestly dont know what I did wrong

#

It did override, considering that when I right click the Ceral Boxes it still allows to open the box, and it stopped giving dance cards, that means that something changed and something broke

#

However it SHOULD give dance cards, since there is a dictionary with the full list of items

drifting ore
#

pro tip: never override any functions

#

besides breaking the game in subtle or obvious ways, like you just did

#

it also kills mod compatibility

#

if you need to, you can decorate an existing functiuon

#

make it run itself and then your code (or the other way around)

#
function Game.Code.Function(...)
   yourFunction(...)
   return oldFunction(...)
end```
bright fog
#

return the old function

#

Make sure to do that or every other modders will hate you for your entire life

bronze yoke
#

they're trying to override the entire functionality of the original function though