#mod_development

1 messages · Page 142 of 1

rancid panther
#

yea it's [table] [th] and [tr]

#

and [td] for the cells with the images

sour island
#

For parse script to work you'd need the string to be the contents of a script file

#

This is actually probably advanced so I can help write it up when I'm home

#

I was going to suggest something else that's kind of advanced 😅

fading horizon
#

what's up?

sour island
#

Which would be to generate the functions too - so you don't have to maintain those either

rancid panther
#

i love how my mod images are just random screenshots with text added with mspaint

fading horizon
#

||I thought i was almost done||

sour island
#

I prefer to write stuff so I only have to touch 1 thing

#

Maybe add to a list

fading horizon
#

these are all superb suggestions

#

defenitely adding them to a list because it would be cool to structure it like that

sour island
#

So ideally for you to add new flavors you would need to just add the texture/name to a list

#

Assuming their stats are all the same?

fading horizon
#

yeah except the empty one

sour island
#

That's how I structured namedLit

#

Trying to practice more segmented code writing -- I was able to breeze through a massive overhaul of that mod because of it

fading horizon
#

i should be better at it

#

rn mine is basically just one lua file

#

kinda messy

#

it works tho

sour island
#

1 file is fine, it's more about not being afraid of making multiple functions

fading horizon
#

and it has comments so nobody can yell at me

#

:v)

sour island
#

A good indicator I use is if there's any repeated code it could probably be it's own function

fading horizon
#

while you're here I have another question

#

local opt = context:addOption("Vape", isVape, callVapeAction, playerObj)

Right now i add my context menu like this

#

it adds it to the bottom of the stack

#

do you know of a way to move that to the normal "eat" position

#

like move it up in the stack

#

i'm not sure how to even google that one

#

i was checking iscontextmenu.lua but didn't see anything

rancid panther
#

how does the vanilla cigarette handle it?

fading horizon
#

food item with custom context menu parameter i believe

#
    {
        DisplayCategory = Junk,
        Count    =    20,
        HungerChange    =    0,
        Weight    =    0.005,
        RequireInHandOrInventory    =    Matches/Lighter,
        Type    =    Food,
        DisplayName    =    Cigarettes,
        StressChange    =    -5,
        Icon    =    IckySticks,
 >>>>>  CustomContextMenu = Smoke,
        CantBeFrozen = TRUE,
        OnEat = OnEat_Cigarettes,
        StaticModel = Cigarette,
        EatType = Cigarettes,
        WorldStaticModel = CigarettePack_Ground,
        CustomEatSound = ,
    }```
#

yeah

#

that's how

#

but mine is a completely new context menu

#

wait theres an insertOptionAfter

#

i'm just blind

sour island
#

There's other addOption functions

#

One is for addToTop, here's another for add before/after another specific option by name

fading horizon
#

there's also a way to make the tooltip a different color, right?

neon bronze
#

In its rgb values yes

fading horizon
#

do you know the function?

neon bronze
#

Its a member of it

#

You should be able to just alter it

fading horizon
#

right now the tooltip is just set in the item definition script

#

not in lua

#

idk how to set a tooltip in lua

neon bronze
#

Do you wqnt your option to have a specific color?

fading horizon
#

yes

neon bronze
#

Im looking through ISContextMenu but there is no option to specifically change an options color

#

You could set a new background color and a new background color on mouse over

fading horizon
#

LOG : General , 1680184445003> ERROR: Missing translation "-- Out of juice"

#

this is in relation to the item script parameter

#

Tooltip = -- Out of juice,

#

how do I get that to stop?

#

I tried setting the tooltip in a lua function via a translation instead but it still gave me the error

tidal crystal
#

hey, so dumb question

#

I'm making my first mod

#

and I'm trying to override the base game Frog item

#

This works for changing the icon but the display name stays as Frog

reef karma
#

would you need to create a translation var like UI_xx_out_of_Juice = whatever and then use that var instead of the actual string?

Prob wrong and made no sense but that is what i had to do with mine to fix the translation errors i had

fading horizon
#

set a parameter onCreate = frogSpawn

#

in media\lua\server create a new .lua file

#

in that put

#
function frogSpawn(item)
  item:setDisplayName("Unidentified Frog");
end
#

this makes it so every time a frog is spawned, the frogspawn function is called on that specific frog, which is then renamed to "Unidentified Frog"

tidal crystal
#

thank u sm! I’ll give it a go

fading horizon
#

sounds like a cool mod already btw

#

i like it

#

i like frog

red tiger
sour island
#

You cannot change the tooltips contents aside from the text

#

But you can mimic it alongside it

#

I also do this for named Literature

#

To spoof the color values for literature since my mod makes them all 0

red tiger
#

Sounds like something that's a consistent ask here in the mod dev chat.

sour island
#

Yeah, Konijima wrote a tooltip API for the former community project

#

I'd have to ask him if I can use it for it's spiritual successor

#

What I do in namedLit is hijack the tooltip render and stretch the box down based on font heights and lines, then fill the area with text rendering

red tiger
#

I'm saying that this shouldn't need a hacky workaround if simple changes are made in the vanilla code.

sour island
#

Yes, but in the meantime we can flex our modding skills

tidal crystal
sour island
#

Also the hackish part of stretching is due to me wanting to keep the vanilla box

tidal crystal
#

with maybe eventually pocket kitten style pet features

sour island
#

It would be more stable if I just added a box below

red tiger
sour island
#

Fair, but pragmatically theyre working on other stuff that is new content

#

Stuff that's good in the end is still pushed back if outwardly no changes can be seen

red tiger
fading horizon
#

I'm spending today learning to understand that damn mod down to the detail

#

Because it keeps being relevant to what I need to do

#

It at least got the context menu in the correct location now

red tiger
#

Been too busy to work on any PZ projects this week..

tidal crystal
fading horizon
#

show me the frogspawn function

#

copy & paste

tidal crystal
#

function frogSpawn(item)
item:setDisplayName("Unidentified Frog");
end

sour island
#

Look for the error line

#

Under the files

#

"tried to call nil" means what ever you're calling doesn't exist

fading horizon
#

hmm

#

that's strange

neon bronze
#

How do you parse the function?

sour island
#

Didn't someone yesterday say setDisplayName is a script function?

fading horizon
#

lmfao

#

yes

#

and it was me

#

use setName instead

sour island
#

You want "setName()"

fading horizon
#

ive crammed too much into my brain in a short amount of time

sour island
#

Get pz-libraries

#

It cuts down on how much you have to remember

tidal crystal
#

Thank u all sm!! That worked

reef karma
#

is there a way to check current zombie population?

fading horizon
#

@sour island I'm digging through your named lit mod for the tooltip stuff right now

#

you put a ton of work into this

#

good job

kindred dagger
#

Can you add an already cooked item to loot tables? I know you can find cooked meat in ovens but looking at ProceduralDistributions.lua I can't figure out how they did it.

frank elbow
#

Not at home to take a look, but the meat in the oven may be a random "story" from the Java side. There are a few hard-coded (but randomized) "table stories" that define stuff like breakfast on tables; might be smth like that for the oven if you can't find it in the Lua code

kindred dagger
#

Mhmmm I'd have to decompile some java then?

frank elbow
#

To look through it and see if that's the case, yes. Dunno whether there's a way to do what you want, but that'd provide insight

kindred dagger
#

Aight. Just gotta find the file that contains these "stories"

frank lintel
#

fernflower FTW

kindred dagger
#

Found it but it's a java function to make the food cooked directly. Mhmmm.

bronze yoke
#

you could add the uncooked item to the loot table and give it an oncreate to make it cooked

frank lintel
#

stuff spawns cooked so should be possible

sour island
#

Could be done in item spawning

kindred dagger
#

Basically I want to add cooked canned foods in kitchens

sour island
#

Stories are handled separately afaik

#

Can stuff be cooked in fridges?

kindred dagger
#

Not that I know of, I'm sifting through distributions

#

But you can find cooked meat in ovens and that's not in there

frank lintel
sour island
#

You could handle it via onFill I guess

frank lintel
#

Ive seen a sauce pot with something cooked in it on top of an oven before

sour island
#

That's a "story" if it's a world item

kindred dagger
#

So "stories" are like tables with food on it

drifting ore
#

I have an idea for a mod, I was thinking of a mod that lets you sharpen knives with a sharpener sharpening increases condition and the lower the condition the less damage it does. Sharpening would become less affective after 15 times and would have a chance to damage the knife instead after that point. Dm if you can’t help. I can model and shit

kindred dagger
#

I've seen a few sharpening mods in the workshop before, might be a good start

drifting ore
kindred dagger
#

Project Zomboid - Project Zomboid is an open-ended zombie-infested sandbox. It asks one simple question – how will you die? In the towns of Muldraugh and West Point, survivors must loot houses, build defences and do their utmost to delay their inevitable death day by day. No help is coming – their continued survival relies on their own cunning, ...

#

You can look for mods here

drifting ore
#

Well I know that I just don’t know the inner workings

#

@sour island I shot you a dm a bit back

frank lintel
#

does some spring cleaning and turns their amps up to 1kw and blows off some of the dust from his speakers

drifting ore
tribal shuttle
#

does anyone know if loot table values less than 1 actually work? my testing is suggesting that they are just getting rounded up to 1

sour island
#

You mean for chance?

tribal shuttle
#

yes

#

the default table is full of values less than 1, but the results are suggesting to me that they all get rounded up

sour island
#

They sort of do, rolls means the change is repeated

#
  • other factors
kindred dagger
#

If it was rounded up you'd see a lot more of these 0.001 rifles in houses

tribal shuttle
#

eh, i see a lot of rifles as is

kindred dagger
#

Although, speaking of that, I'm finding way more gun cases than loot tables would have me think

tribal shuttle
#

1 is 1%, and most containers have 4 rolls on each item. so that's about a ~4% chance per viable container, which is usually one per bedroom. that sounds about right to what ive seen

#

bear in mind the loot settings you use

kindred dagger
#

Guns in wardrobes are 0.05% * 4 it shouldn't be so common

tribal shuttle
#

and yet they are?

kindred dagger
#

Yeah. Weird

#

Maybe it's because you have like 5 different gun cases that can spawn lol

tribal shuttle
#

I've already done some testing that backs up my claim.

tribal shuttle
#

the loot table i made is working fine. the problem ive got now is that it generates too much! and changing the item probabilities from 0.1 to 0.0001 doesn't seem to change the number of items generated at all.

sour island
#

Some tables in the distro might have rolls of more than 1

#

Distros get re-ran for each roll

kindred dagger
#

OnCreate might work for my pre-cooked thing. Just have to make sure that it only does that when the item is in a specific container

tribal shuttle
#

id expect that if i reduce an items probability by 100 fold that id see 100 fold fewer items generated. but instead i see the exact same number regardless

drifting ore
#

I have an idea for a mod, I was thinking of a mod that lets you sharpen knives with a sharpener sharpening increases condition and the lower the condition the less damage it does. Sharpening would become less affective after 15 times and would have a chance to damage the knife instead after that point. Dm if you can’t help. I can model and shit. dm if you can help

sour island
#

You could also do It on prefill

#

The event for when loot is "found"

bronze yoke
#

i'm hoping oncreate is called after the item has been added to the container, otherwise it's going to make stuff like this a lot more annoying

kindred dagger
frank lintel
#

my brain when I think I seen or havent ever seen something in PZ 'code'

kindred dagger
#

Never really bothered with events

#

But that sounds like a good place to search

#

(Where is it located?)

frank lintel
#

and down the rabit hole ya go.

kindred dagger
#

Never to be seen again

frank lintel
#

while ya down there keep an eye out for when the jumpscare event is triggered

kindred dagger
#

Considering I have the gnome alert mod I'm probs gonna get gnomed

frank lintel
#

and whats even more f'd up I still cant find the jumpscare sound either...

sour island
#

You could look for events.onprefillcontainer.add I believe

bronze yoke
#

chuck's referring to OnFillContainer

sour island
#

Or that lol

#

Not at a PC atm

#

Also you may need to run OnAge() or something -- ages stuff to rotten based on world time

sour island
#

OnCreate is anytime the item is created for the first time or even when loaded?

frank lintel
#

would think so...

bronze yoke
#

well i got 800 errors upon loading because i expected the container to exist, so let's see if i get 800 more when i reload

sour island
#

Oh he means its ran before it's added to the world

kindred dagger
#

I just wanted cooked food to spawn in kitchens what have I gotten myself into

sour island
#

That sucks lol

bronze yoke
#

yeah, i was hoping to use it to simplify the whole dummy item thing i've been doing

sour island
#

OnCreate should be reserved for things specific to only that item not it's location then

#

Dummy items?

#

Script replacements?

bronze yoke
#

it's sort of a patchwork solution for the way item spawns work, i wrote it for a true music extension and it's seen use in a pony mod too

sour island
#

I mentioned this as a suggestion this morning - great minds I guess

bronze yoke
#

the idea is add one item to the table and replace it with a random item from a list instead of having hundreds of items in the probabilities table

sour island
#

So it's a way to have control over variations with out adding more scripts?

frank lintel
#

whispers join the dark side...

sour island
#

Ah

bronze yoke
#

it can be used for that too, but at the moment it's just being used to control spawn rates

sour island
#

OnFill would be better then I assume

bronze yoke
#

yeah, the problem is onfill doesn't get called for zombie corpses and patchwork solutions i've been using to get around that have all fallen apart in multiplayer

kindred dagger
#

Where is OnFill found in the code?

sour island
bronze yoke
#

that's what i've been doing but it's not working in multiplayer

sour island
#

That's odd - changes to modData and items works for me

bronze yoke
#

i don't really get why myself

sour island
#

Corpses might have a particular weirdness to them

frank lintel
#

wait till ya meet player corpses

bronze yoke
#

maybe if i complain on the forums they'll add the event to corpses for b42 😅

kindred dagger
#

Nope no idea where to find these events

bronze yoke
#

it's a tiny bit outdated but it's mostly pretty reliable

kindred dagger
#

Oh, that'll help. Thanks.

fading horizon
#

is there a way to remove the top box

#

where it has the name and encumbrance and such

#

so I can just only show the custom box below it

kindred dagger
#

So OnFillContainer is applied when the container is filled by the game?

sour island
fading horizon
#

that's what i'm trying to do currently

upbeat night
#

Hello, everyone!
There is a slightly specific question: can anyone help me with checking the mod I generate with AI ?
I don't know English and for some reason I can't understand programming at all, so I'm resorting to such methods and can't check this code properly myself.
P.S. I'm Russian, so I'll be glad if there is someone who can help me in this language. But I can also communicate through a translator. I apologize for any inconveniences on this subject, if any.
Have a nice day, everyone! spiffo

fading horizon
#
local oldRender = ISToolTipInv.render
function ISToolTipInv:render()
    if not ISContextMenu.instance or not ISContextMenu.instance.visibleCheck then
        local item = self.item
        if itemTypes[item:getFullType()] then 
            injectTooltip(item,self)
            oldRender(self)
        end
    else
        oldRender(self)
    end
end```


```lua
local function injectTooltip(slotsTypes,self)
    local fontSize = getCore():getOptionTooltipFont();
    local th = self.tooltip:getHeight();
    local height = fontConfig[fontSize].y*(5)           
    self:setY(self.tooltip:getY()+th);
    self:setHeight(height);
    self:drawRect(0, 0, self.width, self.height+10, self.backgroundColor.a,         self.backgroundColor.r, self.backgroundColor.g, self.backgroundColor.b);
    self:drawRectBorder(0, 0, self.width, self.height+10, self.borderColor.a,       self.borderColor.r, self.borderColor.g, self.borderColor.b);
    local x = 15
    local y = th+5
    local gap = 5

self.tooltip:DrawText(self.tooltip:getFont(), "THIS IS A TEST", 5, y, 1,1,0.8,self.borderColor.a);
neon bronze
#

Do you wanna swap the places for the tooltip boxes?

sour island
#

Where it says inject tooltip

#

You're calling the original

fading horizon
sour island
#

If you comment that out the original won't render

fading horizon
#

i need to go to bed

#

i just keep getting the "i need to fix one last thing first" energy

#

thank you very much

tidal crystal
#

Could anyone walk me through how Obsolete:true and Override:true works?

#

I’m trying to overwrite the Slice Frog recipe but I’m not sure how to insert the Obsolete:true

fast galleon
tidal crystal
#

Ooh thanks, I’ll take a look!

red tiger
#

Will try to work on the formatter for ZedScript this weekend.

bronze yoke
#

i don't think you need to use the yeeter for that

#

you just need to add Override:true into your recipe

red tiger
#

Maybe I can sit down and flesh out the documentation for Item properties.

tidal crystal
#

This is what I've got

#

My problem is that if I go onto Frog there's two Slice Frog options

red tiger
bronze yoke
#

missing comma

tidal crystal
#

oh!

#

sorry I'm v stupid

tardy wren
#

where was the module person

frank elbow
tidal crystal
bronze yoke
#

yeah seeing that made me panic

frank elbow
red tiger
frank elbow
#

We're here. We're in the dark future

red tiger
#

The chaos will be delicious.

red tiger
tidal crystal
#

oh it's Atom, just because it's a text editor I already had installed for Ren'Py

#

I should probably get Notepad++

red tiger
#

You and other new modders are the target of a VSCode extension that's a WIP right now for helping with scripts.

#

That's all.

tidal crystal
#

oooooh, thanks for letting me know

#

that sounds v useful

red tiger
#

Been a project for the past couple months.

#

Its syntax highlighting and partial documentation should help people for the moment while other features gets implemented.

tardy wren
#

Does anybody know what event fires when a player connects to the server?

#

Or possibly what chain of events fire

red tiger
#

Haven't launched the game since early January.

tardy wren
#

Oh... Hmmm, That would make it... Well, more throughput requiring, but mkay

#

Just a bit of extra code then

#

So, what events do I need to hook into?

frank elbow
#

Are you looking for when they connect, or when they spawn?

tardy wren
#

I'm not sure which one would be better for my case

#

I need to send down Sandbox options to them

#

Not sure when the game is ready to receive those

#

I already know the functions I need to call, I just need to know when to do it

#

I plan to buffed the calls, so that several players joining wouldn't result in several calls

frank elbow
#

Gotcha. I think I ended up using OnCreatePlayer for that use case recently, but I think you'd probably be fine with OnConnect. I had chosen to do it when spawning because I thought I needed the player for sending a client command associated with the connection (later found out that's not the case)

#

I'm curious as to what your method is. I'm still not entirely satisfied with how I did it. Haven't released the mod that uses that quite yet

tardy wren
#

So I just cracked that mod and found how they did it... And did that

frank elbow
#

I'll check that mod out then, thanks

tardy wren
#

It's just instancing a new SandboxOptions object, copying values from the current one(maybe adjusting something), then sending it to server... All on the server;s side

frank lintel
#

cracked? o.O

tardy wren
#

Glyth3r was signed there, so... @ancient grail thanks

frank elbow
#

I thought that was an interesting word choice too lol

tardy wren
#

Sorry, Just had some... pain issues

frank lintel
#

unless this is .class stuff then that kinda applies

tardy wren
#

Back pain,. Also the unsynchronized settings has been a pain in the *** for the past several weeks

#

I went on a week-long charade trying to find why the duct tape on our server sometimes had 16 uses and sometimes it had 4

#

I fixed the damn holes in the back

bronze yoke
#

onconnect is no good

frank elbow
#

I do hope a fix for that is included in b42

bronze yoke
#

it's called long before client commands start working

frank lintel
#

ah the hopes of the usage of ---@async drunk

frank elbow
#

Ah dang

red tiger
red tiger
tardy wren
frank lintel
#

no but you can make sure coders know it ^_^

frank elbow
#

We do have coroutines, at least, but I have never used them in a PZ context

#

So no idea how they work or if they work & not looking to find out anytime soon

red tiger
frank elbow
#

Yeah

red tiger
#

Pro tip: Render code for UI Lua code is on the main thread too.

#

It uses the same sprite cache renderer as the game's world.

tardy wren
#

Isn't there an option to... Render it separately or something?

frank lintel
#

why likely they have that fps limiter for UI offscreen so it dont go nutz

red tiger
#

The game's code has become too fragile to try to move to a multi-threaded solution so easily.

#

This is why none of that has happened yet. =)

wheat kraken
#

Introducing the Reifel Quick Join mod (R-QJ for short) for Project Zomboid

  • a hassle-free way to find and join community servers in your language. With our mod, you can say goodbye to typing in IP addresses, ports, server passwords, usernames, and user passwords + no more need to go out looking everywhere by yourself to find a MP server to play. Simply be part of the R-QJ mod community and select your language and hit the Quick Join button to access servers.

Plus, our mod comes with an auto-fill feature that automatically fills in all the necessary details, including server IP, port, password, and even your most used username. It's a steam cloud sync/save of your favorite community servers too. our focus on this is to offer the most friction-free way to access and play MP servers

In tech, friction-free refers to the idea of removing any barriers or difficulties that may impede or slow down a user's interaction with a product or service. The goal is to create a seamless, effortless experience for the user, without unnecessary steps or complications. A friction-free design aims to make the user experience as smooth and efficient as possible, reducing the time, effort, and frustration associated with completing tasks or achieving goals. This can be achieved through various methods, such as automation, intuitive interfaces, and eliminating unnecessary steps or distractions.

designing a friction-free experience is an essential part of a UX designer's job. It's about creating interfaces and interactions that are intuitive, easy to use, and don't require unnecessary effort or frustration on the part of the user.

(current indexed 74 servers, check the table on mods pages, and contribute too) sneak peak:
EN BR AR ES RU KO CN JP
21 3 6 5 5 6 6 1
all server data on our mod is obfuscated and lightly encrypted
consult the mod page to check if your server is eligible
https://steamcommunity.com/sharedfiles/filedetails/?id=2954954791

red tiger
#

lol @ ad

frank lintel
#

I was just pointing out that atleast using that in documentation sense anyone looking to use it knows 'there might be a nice delay here...' plan on that.

bronze yoke
#

you're posting a whole ad in here 😟

frank elbow
#

Is it a mod or a business plan

tardy wren
#

Can I counter-ad?

frank lintel
#

no pls dont.

tardy wren
#

Okay

#

So I ask again...

tardy wren
bronze yoke
#

i ended up doing it on the first player update

red tiger
#

This game is way too small to have corporate-speak in the mod channel.

tardy wren
#

So onPlayerUpdate I do a thing, and then remove it from that event?

wheat kraken
bronze yoke
tardy wren
#

that part is gonna be harder than the actual syncing part huh

red tiger
#

Also, when did mod groups become a thing in PZ?

#

Might as well ask.

bronze yoke
#

it seemed very abrupt recently

red tiger
#

I have my personal org but it isn't focused to do actual business.

tardy wren
#

Wait, are modders unionizing

red tiger
#

I know MC did a lot of this in recent years as a sort of business approach but man all the ones I tried out were abysmal.

#

But for PZ?

tardy wren
#

I'm just modding with focus on our server... And oh god my meds ended

red tiger
#

That sort of terrifies me.

frank lintel
#

tbh I totally ignored that...

red tiger
#

People come to me for comms and I refer them to others but to make a business with PZ right now?

#

Wait until b42.

bronze yoke
#

i didn't think the market was big enough for it to be worthwhile

red tiger
frank lintel
#

oh you didnt get the whole opinion of the support for modders rating ads be happy

red tiger
#

I think I did like 8-10 commissions last year?

frank elbow
#

Are there many mod groups? I've only seen Glytch3r's and what I assumed were just collabs from others

red tiger
#

(Which I don't)

frank elbow
#

I didn't know Konijima had a group either, huh

#

Unless I've misunderstood that message

bronze yoke
#

well i imagine it's not active anymore

red tiger
tardy wren
#

huh... I mod a bit with UdderlyEvelyn, but it's mostly helping out for her server

frank elbow
#

Gotcha, so nowadays y'all are observing a shift to what seems more business-focused

tardy wren
#

No money, just... satisfaction

frank elbow
#

I guess I haven't been paying enough attention lol

red tiger
#

I mean.. chaos is a good currency.

drifting ore
red tiger
drifting ore
red tiger
#

Damnit.. I haven't really made a content mod.

#

10 years and still no release of something that actually provides gameplay content.

frank elbow
#

I'm sure you hear this plenty already—I hope, anyway—but leaning into being a tools dev is noble

fading horizon
#

making this custom tooltip is going to be the death of me

frank elbow
#

I just make stuff that's like "I want this and I haven't seen an implementation of it/haven't seen one that I'm satisfied with"

red tiger
#

I also think it's funny how I haven't launched PZ since January and I know that somehow I'm helping people out.

#

Also, you are more than welcome to hop onboard with the ZedScript extension. I wrote a mini API so people can populate the documentation for script properties.

frank elbow
#

Might contribute at some point (I tend to say things like that and then never do so & that could very well be the case here)

red tiger
#

It's how things go.

#

We all do it.

#

I'm currently mostly concerned with implementing diagnostics support for the extension.

fast galleon
frank elbow
#

So people can see when they're specifying invalid values, or leaving off a comma/bracket? Sounds handy

fading horizon
#

ive got it //working//

#

just formatting it and such is a pain in the ass

#

just a lot of reloading and trying stuff out

red tiger
#

I stopped my personal project because people won't stop asking questions about scripting in here.. usually the same problems.

twilit rune
#

More workshop related question. How to add images to the description?
I use [img]link[/img]
But, instead of image I need, i get this small image

fast galleon
#

it does that when you have a bad link or a file type it doesn't support

fading horizon
#

use imgur to host it

#

or steam itself

#

it doesn't support most other things from my testing

#

even the official TIS forum

#

lol

twilit rune
#

Then how to add image/link from indie stone mod permissions thread?

https://theindiestone.com/forums/index.php?/topic/2530-mod-permissions/

fading horizon
#

it doesn't work

#

i just went through that

#

youll have to host that image somewhere else if you want it

#

i ended up just doing this

twilit rune
#

Understood. Thx

fading horizon
#
[code]This mod's permissions fall under TIS's policy [url=http://theindiestone.com/forums/index.php/topic/2530-mod-permissions/?p=36477]Credit Where It's Due[/url]

You are free to use the mod for personal use, in multiplayer servers, and even include it in mod packs! Just please do not redistribute or reutilize the files of this mod elsewhere without permission ❤. 

This mod can be added to and extended by anyone in the community, but credit must be given to the original author within the files of the mod - and posted alongside the mod wherever it roams.
[/code]```
#

code if you want it

tidal crystal
#

just wanted to say thanks to everyone who helped me out today

#

Frog mod basics are up and working!

fading horizon
#

Yay! Nicely done!

frank elbow
#

Maybe the image thing is a quirk with that format vs the [img=URL][/img] one?

fast galleon
#

huh wait

frank elbow
#

Oh, nevermind then 😄 that was a guess; I haven't used images in descriptions

#

Does it not work?

#

Now I don't know what to believe stressed

fast galleon
#

no it only showed up in mx's tool

frank elbow
#

Ah, gotcha

fast galleon
#

usually it goes the other way around

kindred dagger
#

Alright, I got my thing to work. OnFillContainer event was the key

#

Still debating whether or not having jars give you back their lid is balanced or not.

fast galleon
#

to balance it, require 10 strength to open jar

kindred dagger
#

Strong Fire Officers: "Am I a joke to you"

#

A better way to do it would be to add more lid spawns to the game since they're so bloody rare.

frank elbow
#

I think a separate "jar with lid" item would make sense, too. Surely some people would keep the lid with the empty jar (my mom does some jarring & I believe she keeps most lids on the jars)

#

The lid could be removed from that item, of course

rancid panther
twilit rune
rancid panther
#

[img]imgurl.png[/img]

#

right click the picture and copy image address

twilit rune
#

Idk, it doesn't work for me

rancid panther
#

can you copy exactly what you are typing and send it here

#

if you are copying the link it will not work. it has to be the image address

kindred dagger
#

I'll make lids reusable for now and see how it goes. If it's too strong, then, I'll remove or make it a % chance to break the lid.

kindred dagger
#

Don't have to use tags in Discord it's usually displayed correctly

twilit rune
#

We are trying to figure oout what I do wrong in Steam

kindred dagger
#

workshop descriptions?

rancid panther
#

yes

twilit rune
#

Yep

kindred dagger
#

Oh I'm not familiar with that then, but it should work with [img][/img]?

rancid panther
#

i think you need to use a dif image address

#

try copying the image address from someone else who used the image in their mod

#

or upload it urself privately and use that image address

kindred dagger
#

Host it to imgur or something and then use that

rancid panther
#

u should host it on steam

drifting ore
#

@twilit rune check DMs g

fading horizon
#

that image doesn't work as an image for steam workshop description

#

like specifically that image

#

i tried all the variations back when I was uploading my mods

#

if you want that image, it must be hosted elsewhere

twilit rune
#

Its same for me with any other pics

glass basalt
#

I posted Imgur links in Mod Resources, it's already done for you

fading horizon
#

try imgur as a host

glass basalt
#

Check it

fading horizon
#

most hosts I tried didn't work

#

only reliable hosts were imgur and steam itself

rancid panther
#

my images work fine thru steam

#

so steam and imgur it is

glass basalt
spring wind
#

I wanna make a mod where I can specify a list of items and have those items get highlighted in corpse inventories. I thought a good place to start was cooking and freezxing - they change the color of inventory UI elements - but I couldn't find where that happens in code. It feels like it would be a Lua thing instead of a Java thing.

rancid panther
#

wow and u even have the bbcode prepared for them

#

how neat

rancid panther
twilit rune
spring wind
fading horizon
#

ive decided

rancid panther
#

good luck!

fading horizon
#

i'm making a workshop description formatting guide

#

because its coming up so frequently

fading horizon
spring wind
drifting ore
reef karma
spring wind
fading horizon
#

holy shit

#

based

frank elbow
#

There is an existing steam guide for the format, but it doesn't have everything

drifting ore
reef karma
spring wind
fast galleon
rancid panther
#

woah horizontal rule! i needed that!

frank elbow
#

@fading horizon may prove useful, if you haven't already seen this

fading horizon
#

thanks for pulling up all the resources y'all

#

this helps a lot

#

hopefully this guide will be of use

frank elbow
#

Something to note with the HR + most of those is that when using them via workshop.txt it adds a br for each line. I place it at the end/beginning of a line to avoid that

reef karma
#

can someone pin that pz editor?

spring wind
#

Does the PZ dev team know "separation of concerns" and "single responsibility principle" are things and not just things but things that generally help you when practiced?

bronze yoke
#

they probably do but didn't ten years ago

spring wind
#

I say that not as a dig at them or anything like that. It's just evident looking at the Lua code, seeing UI setup right alongside logic/etc. It helps me understand why progress on this game has fairly slow-going - just finding where something happens in code is a heavy cognitive process.

#

On that note - I found these luaexamples but they're not commented very well. It feels like some comments detailing why particular things are there would make them more helpful.

#

RE: updating the colors in inventories - I'm getting closer. updateTimers feels like the right place for that sort of thing because then you can update the Cooked stat for the item alongside increasing the amount of red/blue to account for cooking/freezing.

tidal crystal
#

new dumb question

#

does anyone know why this item always spawns with 0 PoisonPower

rancid panther
#

do you have herbalist

#

or you spawn it knowing it is poison

tidal crystal
#

I'm spawning it knowing it is poison

spring wind
tidal crystal
#

but when I edit the item in debug I can see it's 0 PoisonPower instead of 75

#

I'm not using any mods besides the one I'm working on

glass basalt
fading horizon
#

the imgur link

#

with those images

#

actually i'm just gonna put the images in the document itself

glass basalt
tidal crystal
# tidal crystal

Oh! Update! I’ve figured out it’s poisonous if I spawn it in, but if I get it through a recipe (Slice Frog on a poisonous frog) it’s not

#

this is the recipe but I'm still not sure on what's removing the poison

fast galleon
#

@spring wind
if item:isIsCookable() and not item:isFrozen() and item:getHeat() > 1.6 then

spring wind
glass basalt
fast galleon
#

I wasn't sure exactly where it was, but I remembered seeing it

spring wind
#

Wait not that line precisely - but thats super close

#

its the same block of code

#

I'm surprised they don't use more constants? .... does Lua even have constants?

fast galleon
#

I'm sure you can do that with metatables

bronze yoke
#

lua doesn't have constants

reef karma
#

hey guys, i am trying to create a new texture for zombie and have that zombie spawn with a less % than the others. would I have to make my own model for that as well ? Not too sure how the texture modding works yet

small topaz
glass basalt
rancid panther
#

is there a command to turn off the power besides changing the power shutoff day to before current day?

reef karma
glass basalt
reef karma
#

yea i have been. it is quite hard to know what they do without knowing anything about it lol

#

i spawned the new models but they only spawn naked xD and my texture doesnt apply

fast galleon
fading horizon
#

Formatting guide is going well so far

#

it of course has to be formatted nicely

small topaz
rancid panther
#

how can i decompile those files to read in vscode

fast galleon
rancid panther
#

thanks!

drifting ore
glass basalt
drifting ore
glass basalt
#

Lay it out then, got any ideas?

drifting ore
#

Yes

drifting ore
# glass basalt Lay it out then, got any ideas?

I have the synopsis here “I have an idea for a mod, I was thinking of a mod that lets you sharpen knives with a sharpener sharpening increases condition and the lower the condition the less damage it does. Sharpening would become less affective after 15 times and would have a chance to damage the knife instead after that point.”

rancid panther
glass basalt
shut oar
#

this might be a silly question, but is there any documentation for the zomboid Lua API, because I have not found any

bronze yoke
shut oar
#

thank youuuu

thorny pollen
shut oar
#

thank you toooo

tidal crystal
#

Hey, does anyone know how pocket kittens allows users to rename the cat items

#

I’ve been looking through its code but I can’t figure it out

hot patrol
drifting ore
#

CAn anyone help me with a mod

#

Colab

frank elbow
#

There's a thread for mod ideas @stuck saffron

drifting ore
#

Been

#

NEEB

#

I HAVE A GOOD IDEA

frank elbow
drifting ore
#

DM ME

#

@stuck saffron I HAVE A GOOD MOD IDEA

stuck saffron
#

i don't know anything about making mods 😭

frank elbow
#

I'm directing them because they had an idea in pz-chat

#

That's certainly a method for trying to get people to collab, I suppose 😅

stuck saffron
#

just wanted to know how hard it is to
A) make a TV station repeat it's shows endlessly on the day loop like they play out the first week.
B) Interject new movies/shows and stuff into the already preexisting TV channels as more shows that can play out.

drifting ore
#

I need someone to make a mod with me ,I can do all the modeling and stuff. I have the synopsis here “I have an idea for a mod, I was thinking of a mod that lets you sharpen knives with a sharpener sharpening increases condition and the lower the condition the less damage it does. Sharpening would become less affective after 15 times and would have a chance to damage the knife instead after that point.”

bronze yoke
shut oar
#

In debug mode while in game can I easily reload a Lua file, or reopen the debugger menu stuff like when you first load a save?

thorny pollen
#

f11

drifting ore
#

and the whetstone model, the magazine model, the inventory icon, animations, and the dull knife varient icons and models.

shut oar
drifting ore
#

I tried that, not a big fan

#

I want mine to be simple and and not over powered, I want it to just apply to short blades and long blades

#

Or axes

#

Not axes*

reef karma
#

cant you just modify the existing mod (ask for permission and credit him) ?

drifting ore
#

Hmm I suppose

reef karma
#

and that is ok but the way i see it is this. you can't really colab with someone on making a mod if you dont know how.
I would just pay someone to make the mod

drifting ore
#

I can model tho

frank lintel
#

If I asked someone to define and/or point me to what a string is etc for Lua. what would be your answer?

bronze yoke
#

modellers working with programmers is a fair exchange, you just need to find someone interested on working on it

reef karma
#

i would call it fair if it was the equivalent amount of work.
I am not saying that this mod is not.
But you can't say it is fair if one person makes one model and the other one makes a full fledge revamp with such single model

frank lintel
#

dude there a reason Im asking. because you likely would not be pointing me to the java 15 javadoc page for string would you?

bronze yoke
#

i'm saying that's what my answer would be

frank lintel
#

okay html that to a link. I'll put that in :P

bronze yoke
frank lintel
bronze yoke
#

i guess it's because they're technically java strings (is there even a separation in kahlua?) but yeah, not the most useful

sour island
#

strings are interchangeable afaik

#

as are booleans

#

things get dicey with numbers/int/floats sometimes

frank lintel
#

thats the other thing

glass basalt
#

another weekend of updating all of my mods and not doing anything new

frank lintel
#

like no its a number..

bronze yoke
#

it's kind of weird that this event passes strings at all

sour island
#

methods to convert things into specific types would be nice

bronze yoke
#

you'd expect it to pass the faction and player objects, not their names

#

it might have just been intended for a very specific vanilla use, probably for ui

frank lintel
#

shrugs

#

but thanks I just wanted to get some decent feedback.

drifting ore
#

I need of a programmer.

wet sandal
#

Still needs to be prettier, but here is everything, everywhere all at once

wet sandal
#

Ty

drifting ore
#

Hello modders, I am modeler in need of a programmer for a mod I have in mind. It’s quite simple and not over complicated. DM and I will give the premise. Thanks!

tidal crystal
#

trying to implement clothing is frying my brain

#

I’ve somehow managed to make the player and zombies turn invisible

whole oasis
#

same but for animations lol

#

Oh

whole oasis
#

depending on the amount of masks it can mask the entire player/zombie its on

tidal crystal
#

I’m gonna be honest

#

I saw that

#

Thought to myself

#

Oh this is a hat not a mask

#

And deleted it

#

Do you know what it should say?

whole oasis
#

uh

#

is it a helmet? or a mask

tidal crystal
#

Helmet

whole oasis
#

this is what my mask one says

#

gimme a sec to grab one of my helmet.xmls

#

ooh thats too large

#

thats what one of my helmets say for the .xml

#

(static) btw not skinned

#

skinned means its weight painted and already bound to certain bones via weight paint

#

hope this helps ya

tidal crystal
#

Thank you! I’ll let you know how it goes

#

I still can’t see my hat but I’m no longer getting lots of errors which is a definite improvement

#

I think I might have to go back over it tomorrow

whole oasis
#

npnp

glass basalt
#

when are vehicles spawned when creating a world?
would making changes to vehicle distribution tables in the sandbox options and then linking that functionality to Events.OnInitWorld work?

tidal crystal
#

does anyone know why the tooltip for my hat would be blank and this would come up + hundreds of errors when I hover over it

#

it also crashes if I try to inspect it

whole oasis
#

got the script file?

#

or chunk of code

tidal crystal
whole oasis
#

item hat
{}

tidal crystal
whole oasis
#

hmmm

#

I think you're missing a Weight = (number) ,

#

2nd from bottom

#

all items need a weight afaik

tidal crystal
#

Thank u! I added it but the errors are still happening

#

Wait no

whole oasis
#

hmm does the tooltip show up?

tidal crystal
#

I’m dumb

#

I just forgot the comma lol

#

Sorry I am very new to this

whole oasis
#

oh lol, np

#

yeah I still fumble that now and again

fading horizon
#

workshop formatting guide is well underway

whole oasis
#

what is this for?

fading horizon
#

formatting steam workshop descriptions

#

since it gets asked her a lot

whole oasis
#

oh sorry, I read it, sometimes the responses are faster than the action

#

awesome though, never knew you could input some of these into the descriptor and get cool categories like that

tidal crystal
fading horizon
#

thank you!

glass basalt
# fading horizon

I don't want to spook you, but the formatting changes if you instead post bbcode in a comment or a discussion post

fading horizon
#

wdym

glass basalt
#

links are different in discussion posts: they are underlined

#

comments: just don't work sometimes?

fading horizon
#

well

#

regardless, hopefully this will help at least one person

#

and if it does, that's worth it

#

plus i just fucking love making spreadsheets

thorny pollen
#

is that Zyzz? @glass basalt

thorny pollen
#

tank

sour island
#

I believe authors can also use codes in comments where users cannot

#

Specifically for bolding and headers

glass basalt
#

I believe it is just h1, b, and i
links and other code does not work in my experience

#

kinda got interested: does anyone else do this? my to-do list for my mods

sour island
#

h2/h3 work for authors in comments

#

I think h1 doesnt

glass basalt
#

ah, so it's the other way around. thanks!

bronze yoke
#

do what? keep a to-do list?

glass basalt
#

ye

bronze yoke
#

i know i do

#

if i'm being honest i have a bad habit of just adding things to it and never actually going through the stuff i have to do on there, but i think everyone who's been modding for a while should keep one

glass basalt
reef karma
glass basalt
#

I have a whole list dedicated to merging to-do lists. the list for lists 😂

glass basalt
tribal shuttle
#

im sure i sound like a broken record at this point, but im stuck on figuring out why this function isnt working:

RandomItems.AddToLists = function(ProcList)
for i=1, #SuburbsDistributions do
for j=1, #SuburbsDistributions[i] do
if SuburbsDistributions[i][j].procedural then
table.insert(SuburbsDistributions[i][j].procList, ProcList[1]);
end
end
end
end

glass basalt
tribal shuttle
#

insert into a table in suburb distributions

#

into many tables

glass basalt
#

are you trying to add an item to distribution tables?

#

or add a whole table into another distribution table

tribal shuttle
#

both.

glass basalt
#

have you looked at procedural distributions?

tribal shuttle
#

yes

glass basalt
#

ProcList[1], do you want that always to be one?

tribal shuttle
#

placeholder

bronze yoke
#

what isn't working

tribal shuttle
#

[1] is just the only entry in the table until i can get the function to work. then i can add to ProcList as I like

tribal shuttle
# bronze yoke what isn't working

im trying to go through the full list of distribution tables. some are procedural lists, some arent. this loop is for adding an additional procedural list to the procedural tables

wet sandal
reef karma
#

That is great man! Congrats again

bronze yoke
#

one issue i can spot is that SuburbsDistributions[i][j].procedural will give you an 'attempted index of non-table' error if it isn't a table (and looking at the distributions table this will happen)

#

not sure if it's the only one but there's some isShop booleans in there

sour island
#

SuburbsDistributions is a keyed table

bronze yoke
#

oh, i'm missing a bigger issue here

sour island
#

you can't use [1]

bronze yoke
#

they aren't numeric indexes

tribal shuttle
bronze yoke
#

i really missed the forest for the trees 😅

tribal shuttle
#

its the for loop iterating through the full distribution list that isn't working

sour island
#
    for i=1, #SuburbsDistributions do
        for j=1, #SuburbsDistributions[i] do
#

SuburbsDistributions doesnt have numeric keys

#

you should be using pairs

#

The snippet I gave you for replacing parts of a nested list would work for any part of that list

bronze yoke
#
RandomItems.AddToLists = function(ProcList)
    for _,room in pairs(SuburbsDistributions) do
        for _,container in pairs(room) do
            if type(container) == "table" and container.procedural then
                table.insert(container.procList, ProcList[1])
            end
        end
    end
end
```something like this
sour island
#
  local itemsOverride = {
      "item","chance",
      "item","chance",
   }

    for roomID,data in pairs(SuburbsDistributions) do

        for containerID,contData in pairs(data) do
            ---if room's container's data has an items list OR if it has a junk list with items
            if (contData.items and #contData.items>0) or (contData.junk and contData.junk.items and #contData.junk.items>0) then
                contData.items = itemsOverride
                contData.junk.items = {}
            end
        end
    end

This is what I gave him yesterday for context

tribal shuttle
sour island
#

You're trying to parse through a nested table - the first two nests are not numerically keyed - using a for loop that counts up won't work

bronze yoke
#

you're trying to do SuburbsDistributions[1] in a table that's indexed with text like SuburbsDistributions["aesthetic"]

tribal shuttle
#

right. but i didnt even know how to make a for loop in lua at the time. and i just wanted to figure that out.

#

im only really figuring out what pairs() even does

sour island
#

It splits the keys and values for key,value in pairs(table) do

#

makes a set of paired variables to call in the for loop - but the order is not guaranteed unless the keys are numeric

#

Notice the middle for loop doesn't print anything

#

Surprised it doesn't toss a warning or error though

#

Also pairs() on a non-keyed or numeric keyed table works too:

#

Does the proclist matter if you're scrambling the items for everything though?

tribal shuttle
#

i cant get around the fact that item probabilities below 1% are seemingly being rounded up to 1%.

sour island
#

Are you testing this in a zombie free world?

tribal shuttle
#

the item list contains 1500 items, and most containers roll 4 times on each one. so nearly every container ends up stuffed full of crap even on the lowest loot settings

sour island
#

you can set their rolls to 1

tribal shuttle
#

sure, but that still ends with an average loot density about 60 times higher than i want

sour island
#

also at 1500 items you're going to get alot of items regardless

tribal shuttle
#

i had mistakenly assumed that since the developers use values below 1 that they actually worked

sour island
#

they do

bronze yoke
#

the reason you're seeing so many items is because every item is rolled for individually

#

more possible items = more items

sour island
#

you could try dividing the chances by 100 or 1000

tribal shuttle
#

yes, i know. but ive also tried probability values below 1/10000 and im still getting full containers

#

i get the same same number of items returned whether i go with 1 or 0.00001

sour island
#

what does your code look like

#

perhaps your not overwriting the chance

bronze yoke
#

i know extremely low numbers cause issues but it's not as bad as capping out at 1%

tribal shuttle
#

even at 0.00001 i was getting DUPLICATES of single items. which is just such a minute possibility that i shouldnt have seen it occur multiple times in a handful of attempts

sour island
#

did you try setting the rolls to 1

#
  • if you're testing in a zombieless world the lootchance is like 400%
#

you should verify actual loot drops with the loot tool

bronze yoke
#

they're right that at 0.00001 multiple rolls still shouldn't land, that might be below the level at which the probabilities start messing up

sour island
#

there's definitely something going on

tribal shuttle
#

every attempt was done on a standard apocalypse sandbox with loot set to normal because normal doesnt apply a modifier to loot

sour island
#

@bronze yoke How do you activate the loot tool again?

bronze yoke
#

you turn it on in the debug cheats menu and then right click the container icon in your inventory

sour island
#

forgot the right click container button lol

#

trying to test my scramble loot code

sour island
tribal shuttle
#

yes

#

here, i ran another test for demonstration

#

all = {
bin = {
rolls = 10000,
items = {
"ScrapMetal", 0.01,
},

i got an average of 40 scrap metal per trash can. which equates to an actual item generation rate of 0.4 instead of 0.01

#

thats 40x higher than expectations

sour island
#

there's other factors impacting loot spawn

#

if you check the lootspawn tool you'll see the in-game chances

tribal shuttle
#

there are, but if ive done all i can to negate those factors and the loot rate is still FAR above expectations, then im out of options

bronze yoke
#

population density has an impact

tribal shuttle
#

population changes loot?

bronze yoke
#

yeah, areas that spawn more zombies have more loot

tribal shuttle
#

then continuing my test, id expect riverside trashcans to have less scrapmetal than the muldraugh cans ive been testing at. so far the average is actually higher

#

how do i see these things with the lootspawn tool?

bronze yoke
#

turn on lootzed in the debug cheats menu, and then right click the icon of the container's tab in the inventory

fading horizon
#

hope it can help someone one day

reef karma
#

wait

#

how did you do in the google sheets (excel) ?

#

are they just nicely formatted tables??

fading horizon
#

yeah I just fucking love formatting and spreadsheets

#

lol

#

lots of merging cells

tribal shuttle
reef karma
#

that is what it looked like. that looks awesome lmao

fading horizon
#

took like all day

#

barely even worked on my mod

#

i guess it wont be releasing today after all

#

Friday is a good release day though

reef karma
#

friday is the best day

tribal shuttle
#

i did manage to find some trash cans in more remote locations that only had x10 the drop rate i put in instead of 40 60 or 80x

bronze yoke
#

increasing the drop rate might fix it

#

very low numbers don't work properly because of some kahlua bug or something

tribal shuttle
#

increasing the drop rate isnt an option for what i had in mind, so i had to scrap the plan. thats the conclusion i had reached this morning

#

also, any idea if population density altering loot still works this way when using uniform zombie distribution?

bronze yoke
#

no idea

tribal shuttle
#

its so frustrating how obfuscated this is

#

to answer my own question. tested uniform zombie distribution. it changed the amount of scrap generated by trash cans in each area. but not in any way that makes sense.

old crescent
#

what folder does clients character saves

#

in server side

#

its in there compute r?

frank elbow
#

Mixed this up w a different server?

bronze yoke
#

yes.

#

LOL

#

i don't know why because i don't use that server very often at all LOL

tribal shuttle
#

it looks like somewhere between 0.1 and 0.5 the number of items generated starts approaching the actual expected results

bronze yoke
#

Zomboid\Saves\Multiplayer\savename\players.db

sour island
#

"Sledgehammer", 0.001, "Sledgehammer2", 0.001,

#

seems to be the lowest value

#

you could shave the chances down and cap it using math.min()

tribal shuttle
#

i dont know man, even at 0.1 i was getting x10 what i should have

sour island
#

🤷‍♂️

#

Could be how you wrote the item list

#
  • some containers have rolls over 1
tribal shuttle
#

which is why i assumed previously that it was just rounding up to 1. it just turns out that the truth is far screwier than i had anticipated

#

im doing tests right now that prove its not because of the rolls value

#

i think ive thoroughly disproven the rolls theory at this point

sour island
#

you said you have duplicates of items

#

that would only occur if you added duplicate items yourself

tribal shuttle
#

yes, but im running a much more narrowly focused test right now that proves what im saying beyond the surprising mod results i pulled up this morning

#

im testing with trash cans that only contain one item in the drop list

#

ive run multiple probability tests that SHOULD have resulted in cans generating one scrap metal on average. instead i get 40-80

#

that is one HELL of a margin of error

sour island
#

Why do you think it's supposed to be 1?

tribal shuttle
#

because 10000 rolls x 0.01 drop rate = average 1.

#

and 1000 rolls x 0.1 drop rate = average 1

#

and 200 rolls x 0.5 drop rate = average 1

#

instead, i get 40+

sour island
#

10,000 x 0.01 = 100?

tribal shuttle
#

which is divided by 100 because the loot chances are in %

bronze yoke
#

that's not how probabilities are combined

tribal shuttle
#

large number probabilites. the larger the number of rolls, the more likely the result over multiple iterations will approach the average

sour island
#

Also, idk if this helps but this is the loot calculation: (10000) <= chance(modified by luck) * 100 * lootmodifer + zombiedensity * 10

tribal shuttle
#

loot modifier should be sandbox settings yeah?

#

but how is zombie density calculated?

sour island
#

it's based on the map zones I believe

tribal shuttle
#

well, on the 200 rolls test the results came out nearly as i would have expected. its the 1000 rolls and 10000 rolls tests that were giving RIDICULOUS numbers

sour island
#

try making the scrap metal 0.001?

tribal shuttle
#

even worse results

#

im getting MORE metal

#

literally every trash can is FULL to capacity with scrap metal now

tribal shuttle
bronze yoke
#

yeah, it's definitely weird

#

and i think your math is correct and i was thinking of something else anyway

fading horizon
#

@sour islandI've been digging apart your named lit mod code to see how you do the tooltip rendering,

I've gone through most of the code and made adjustments just to test if it would work for me and it does ; however, the vanilla tooltip is still showing.

Do you happen to remember how you hid the vanilla

#

because mine is basically the same idk why its not working

drifting ore
#

Modeler in need of programmer for a mod, dm and I will fill you in on the details. Thx!

sour island
#

Made the default tooltip longer

#

Then added my lines over the extra space

fading horizon
#

well dang

sour island
#

If you replace the vanilla render function the vanilla tooltip shouldn't appear - I would assume?

fading horizon
#

i would think that's what this is doing

#

if its not a vape, do the regular render

#

but if it's a vape, render the custom one

#

so it should only be rendering the custom one I would think

drifting ore
#

Modeler in need of programmer for a mod, dm and I will fill you in on the details. Thx!

fading horizon
#

please don't start doing this every 10 minutes..

drifting ore
#

Idk what you expect

fading horizon
#

well posting it again in the chat when theres been literally 10 messages since your last post which was exactly 10 minutes ago

#

everyone still sees it fam

drifting ore
fading horizon
#

i recommend you be patient and wait and hope that somebody comes by that wants to help

#

🙂

#

or go try to learn it yourself

ancient grail
#

Or you could hire for commission

fading horizon
#

oh snap

#

i did it

#

i got rid of the vanilla tooltip

#

lets GO

old crescent
#

Hello need help .

lyric turtle
#

You are closer and closer to perfection brother, keep it up! thumbsup

old crescent
#

I want to add a death count on server database ..

#

where do i possibly put it

frank lintel
#

lua/server... if that was a code ?

tribal shuttle
#

alright, im seeing that some of the procedural loot lists dont have a weight selection on them. i'm not getting errors adding a second procedural list, but does anyone have any idea how they interact? does it default to the first list? or does the first list get a default weight value?

reef karma
#

@maemento i have never heard of the vapes you that you are using in your mod until i started reading this channel. I am gettings ads about them now on tiktok

fading horizon
#

lmao

bronze yoke
#

i might be missing some though, i didn't crawl through the entire distributions of course

tribal shuttle
bronze yoke
#

ah, yes

fading horizon
#

we're getting there, slowly

bronze yoke
#

actually, should be fine

tribal shuttle
#

im not confirmed yet, but i think the default weight is 0

bronze yoke
#

the default weight is -1, if all weights are -1 then it just picks randomly

#

actually no... if the weights total to -1 it picks randomly... that seems like an oversight

tribal shuttle
#

i have to set a weight to my added list because it also gets added to other list lists that do have weights

bronze yoke
#

yeah, it seems like having multiple with no weight would be bad anyway... you might have to add weights to the ones that don't have them

tribal shuttle
#

yeah, im already trying to figure that one out and am getting errors. so it goes

#

and then theres the forceForTiles that i have to deal with. and the non procedural containers after that

#

how do you check if a value exists in lua?

bronze yoke
#

var ~= null

#

or just if var actually

tribal shuttle
#

thank you

bronze yoke
#

if var won't work in the specific case that var is false

#

if that's a possiblity in your data use var ~= null

fading horizon
#

nil not null

frank lintel
#

oooh fernflower command line decompile yummy

bronze yoke
#

been reading too much of the java 😅

fading horizon
#

it happens

frank lintel
#

you using the actual zulu version?

tribal shuttle
#

ah, will adding weightChance to the forceForTiles containers cause them to appear in rooms they shouldnt?

bronze yoke
#

it looks like weight is completely ignored if there's any forceForWhatevers

#

or rather ones with those properties aren't included in the picking for that

tribal shuttle
#

is that for when its the designated tile/container AND for when its not?

bronze yoke
#

if it's the designated tile/container it just uses the forced one, if it's not then the weight stuff still happens but anything with a forceForX doesn't get included in weight calculations

tribal shuttle
#

thank you for clarifying

#

would have been nice if LootZod showed weights for lists

#

if containerData.procList[i].weightChance ~= nil then
containerData.procList[i].weightChance = 100
end
resulted in no weights being added. : /

bronze yoke
#

you're testing if the weightChance is already set

#

use == nil to invert it

tribal shuttle
#

/facepalm

#

i should have spotted that one on my own, thank you

#

with how many exceptions there are when dealing with the non procedural containers, i think im better just manually creating a list of containers that need updating than trying to program exceptions to each of them

#

otherwise i could end up with containers containing containers that contain containers

fading horizon
#

and remembered someone was asking something similar

#

so here you go if it's relevant

#

oh the message is too long one sec

#

i just realized the custom tooltips don't follow the mouse

#

i think this may be more of a pain than it's worth

glass basalt
#

in case this ever pops up for anyone searching for it: Project Zomboid handles Unix LF line endings fine, and you can use them instead of Windows/DOS CR LF line endings
...I was skeptical about it.

fading horizon
#

i got it to work omg

glass basalt
#

why hide the amount left though?

fading horizon
#

i'm not

#

i just haven't added it yet

#

it's a completely custom tooltip

#

idk how i'm going to make the little bar remaining thing

fading horizon
glass basalt
#

got this working my way, and covers the most variations out of all of the mods I've seen.

rancid panther
#

nice work

humble oriole
#

Is it just DestroyResult:True to remove the result of a recipe?

old crescent
#

anybody knows how to disable button

#

I want to disable NEW CHARACTER button. just disable it not delete

glass basalt
#

depends on what kind of button. ISUI elements all have different superclasses and such

old crescent
#

local button = ISButton:new(buttonX, buttonY, buttonWid, buttonHgt, getText("IGUI_PostDeath_Respawn"), self, self.onRespawn)

humble oriole
glass basalt
old crescent
#

tried it but notther workds

shut oar
fading horizon
#

already does

shut oar
#

oh thats so cool

glass basalt
#

ah, it's probably because it's IG_UI

#

idk anything about IG_UI elements

fading horizon
#

i think i'm gonna just take what i have now and put it in a stable state and release v1

#

i'm tired of waiting

old crescent
#

copy2 i look into it

humble oriole
#

is that a vape mod? lol

fading horizon
#

and all these complicated things can be for v2

#

yes

humble oriole
#

didn't know those were around in '93

glass basalt
glass basalt
fading horizon
#

i just want to release it

neon bronze
shut oar
neon bronze
#

You may even use nil for it but im not sure

fading horizon
old crescent
fading horizon
#

itll be out tomorrow prob

old crescent
#

yes2 thanks

shut oar
#

neat

glass basalt
#

@old crescent
ISButton.lua

function ISButton:setEnable(bEnabled)
    self.enable = bEnabled;
    if not self.borderColorEnabled then
        self.borderColorEnabled = { r = self.borderColor.r, g = self.borderColor.g, b = self.borderColor.b, a = self.borderColor.a }
    end
    if bEnabled then
        self:setTextureRGBA(1, 1, 1, 1)
        self:setBorderRGBA(
            self.borderColorEnabled.r,
            self.borderColorEnabled.g,
            self.borderColorEnabled.b,
            self.borderColorEnabled.a)
    else
        self:setTextureRGBA(0.3, 0.3, 0.3, 1.0)
        self:setBorderRGBA(0.7, 0.1, 0.1, 0.7)
    end
end

function ISButton:isEnabled()
    return self.enable;
end
#

use setEnable(false)