#mod_development

1 messages · Page 529 of 1

wise remnant
#

hmmmmmm ..... does it involve ur lawnmower?

#

ahhahahah

faint jewel
#

it do.

#

i wanna get it finished up.

#

so i can release it.

wise remnant
#

nice

faint jewel
#

release myt go karts last night.

wise remnant
#

if i had to guess .. i'd say you'll make the zombie explode into nothing while crawling

#

into oblivion

wise remnant
#

the cool thing about CZs method is you can pretty much get any field value from any object using it

faint jewel
#

well not NOTHING... but it would hurt them till they die.

thin hornet
#

would be cool to at least get a getter for those properties

hearty herald
#

I did figure you could probably index the classes for their fields, but didn't know how to go about it

faint jewel
#

there's another FUNction that happens then

thin hornet
#

thats the only one that doesnt have one

wise remnant
#

yeah would be nice

faint jewel
#

koni, did i have you look at the new spray?

wise remnant
#

but again it's super expensive to do .. so wouldn't recommend OnZombieUpdates .. i avoided using that like the plague

thin hornet
#

didnt see it

chrome egret
#

Yeah, if you can find any method that doesn't involve reflection, you will almost certainly be better off

thin hornet
#

vanilla zombie already lag as hell in lousiville, cant imagine an unoptimized onzombie added to it

wise remnant
#

yup it's bad

#

i tested it

hearty herald
#

It does feel like it should be something that should be exposed, the state of bCrawling I mean

wise remnant
#

its one of hte reasons why customizable zombies kills the game with lots of zombies around

#

@hearty herald definitely

#

maybe it's overlooked

thin hornet
chrome egret
#

What's the deal with this on a body?

#
function DebugContextMenu.OnDeadBodyToggleCrawling(body)
    body:setCrawling(not body:isCrawling())
end
#

At all relevant?

faint jewel
#

local isCrawling = zombie:GetAnimSetName() == "zombie-crawler"; no worky

hearty herald
#

Is the aiming with weapons thing hardcoded in java? Because it does differentiate between prone and not prone, and crawlers are in the prone category

faint jewel
#

ERROR: General , 1646086736703> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: GetAnimSetName of non-table: null at KahluaThread.tableget line:1689.

wise remnant
#
---@public
---@return boolean
function IsoZombie:isCrawling() end
hearty herald
#

If you remove the auto attack prone and use the keybind you entirely ignore prone enemies with everything except stomp

hearty herald
#

Or it's not a zombie?

wise remnant
hearty herald
#

If it's inside the zombie you might not be able to access it outside zombie

wise remnant
#

probably inherited?

hearty herald
#

I'm curious what is body reffering to?

wise remnant
#

worth a shit

#

shot

hearty herald
#

because body has :isCrawling

chrome egret
#

In the higher context it's provided by IsoObjectPicker.Instance:PickCorpse(x, y)

wise remnant
#

in IsoZombie.java +3770

#
   public boolean isCrawling() {
      return this.bCrawling;
   }
#

could be exposing this

hearty herald
#

Worth trying to call isCrawling() from the lua side then right?

wise remnant
#

worth a shot

thin hornet
#

O.o

#

so it exist

wise remnant
#

yup thanks to @chrome egret for finding it

chrome egret
#

noice, good looking out to spot the Java side

thin hornet
#

it was hidden, sneaky little getter

chrome egret
#

Konijima, I've seen your tutorial about using IntelliJ but I'm confused

#

does it imply after decompiling to Java I have to recompile the files into the .jar files?

wise remnant
#

i used this guide

#

to get decompiled source into project

#

when you search in intellij (ctrl+shift+f) you need to set the destination of the search to Scope

#

to search through the .jar files

chrome egret
#

Well those jars don't exist anywhere on my system

#

That's why I assumed it was implying that after decompiling .class to .java, I had to recompile to the jars that needed to be added

wise remnant
#

when you run the gradle tasks, it does it for you

chrome egret
#

Ah, I didn't realize this guide depended on that

#

Thanks for the clarification

wise remnant
#

yeah if you follow that guide you'll get everything you need ...

faint jewel
#

if zombie and (zombie:getCurrentState() == ZombieOnGroundState.instance() or zombie:isCrawling()) then ?

wise remnant
#

yeah you need to start a new project and initialize is as a Gradle project .. what i do is initialize a separate mod, so mine isn't cluttered w/ all the stuff it adds

#

then i go over to that projet when i need to scan source files

chrome egret
#

pz-41.66-generator

thin hornet
chrome egret
#

That's ok

#

Once I go through it myself I can try to create a PR

thin hornet
#

that would be great let me know here

gilded hawk
willow estuary
willow estuary
#

👍

pastel frigate
#

Any mods that add additional sounds/tracks for playing TV/radio? Looking for something that adds more immersion when my zedhunter is watching Paws but is listening to a talkshow host talk about poverty, disease, and climate change.

faint jewel
#

okay! crawlers get boned now!

chrome egret
#

gratz Skiz

faint jewel
#

now to figure out how to get the gore right

chrome egret
#

It would be even better if it also left a circle of gore on the cell where the zombo was crawling + run over

wet coral
#

what's the difference between index = 1 and index = -1?

#

it's used a lot in vehicle spawns

chrome egret
#

Can you give a little more context?

#

Like, is that index being used to retrieve values from a table?

wet coral
#

VehicleZoneDistribution.trafficjame.vehicles["Base.86oshkoshUSMC"] = {index = -1, spawnChance = 0}; here's the whole line of code

#

courtesy of oshkosh mod

#

the -1 is replaced with 1s a lot of the time

rich path
#

YOU

#

My mortal enemy

wet coral
#

oop

#

standoff inbound

faint jewel
#

i wanna get the fan right first.

#

then i get to devolve into how to change that damned art that it's using.

#

addBloodSplat() i mean if you can tell me where that is opulling the art from and how to change that i could do MAGIC

#
public void addBloodSplat​(float float1,
float float2,
float float3,
int int1)
#

i know the floats are the square (or i believe so) the int should be the type.. everything from 1 to 100 is the EXACT SAME ART.

#

addBloodSplat(square, ZombRand(100));

hearty herald
#

Did you try it without the zombrand?

faint jewel
#

yeah

#

1-100 all look the same

hearty herald
#

what about 1-3

#

It could be indexed and it simply doesn't have variants above, say 3

faint jewel
#

i would fall in love with someone if they can tell me how to get the game to actually throw blood like i hit em with an axe.

hearty herald
#

I think you'd have to mess with blood giblets and such to get that

faint jewel
#

could make a fun gore cannon that pushes back zombies with chnks of other zombies XD

#

or a mod where you "Code V" blood.

#

lol i love how i can kill this channel

wet coral
#

in general, what's the easiest type of mod to get started on?

#

I want to make a vehicle mod but I feel like I should wait a bit for that

faint jewel
#

clothing.

#

just textures.

nimble spoke
#

I wouldn't recommend clothes as they require linking the XML files, go for a food items, or maybe a literature item as those are useful just by giving the item script the correct values

wet coral
#

got it. Is there anywhere I learn about file organization for this game?

#

every game I've tried modding has been quite different

chrome egret
#

One of the sections is on the structure

wet coral
#

thank you

slim swift
willow estuary
slim swift
#

I was more meaning the tutorial he linked not the wiki. I did see the pin to the wiki page

#

But I see it's linked in the wiki page

willow estuary
#

Previously the amount of pinned posts reached a point where people were unable to find pinned posts, and were daily requesting that posts that were already pinned get pinned. It's not a viable organizational system once there's a critical mass of pinned posts.
Therefore now, for this channel, that page of the wiki is the pinned post page, in that that format allows for better organization. Albeit that aspect of that page needs more work.

slim swift
#

I can appreciate that :) just wanted to make sure that resource was available for people. Missed it on the wiki before :)

willow estuary
#

Well, I'm seriously an idiot that's more of a janitor than anything, so I have no attachment to how I haphazardly transferred everything over there and added to it.
So anyone who wants to take a crack at better organizing that stuff on that page is a goddamn hero if anything. Registering +editing pages are pretty painless.

faint jewel
#

lol

#

sooooo

chrome egret
#

ayyy

#

finally made my first crappy iteration of the UI

nimble spoke
hearty herald
#

Think he mentioned earlier getting all nearby containers, so maybe just search everything around you

chrome egret
#

Yeah, with lots of item storage (say in the large warehouse) it becomes hard to know where to find things

#

So the idea was to allow an item input, then your character auto-searches for the item

hearty herald
#

Oh, like walking to each container?

chrome egret
#

Still feeling out the compromise of having to walk directly up to everything and just kinda scanning from a distance

#

but sumfin like that for sure

hearty herald
#

Because the distance for what containers qualify could get iffy

faint jewel
#

hey i have a project you can attempt...

hearty herald
#

And if they are on other side of wall etc

faint jewel
#

hehehe

hearty herald
#

Are you considering making sure containers are in visibility?

chrome egret
#

Perhaps

faint jewel
chrome egret
#

There's nothing saying you couldn't find something on the floor

hearty herald
#

Since in SP you got the whole pause game and flick through all containers you can loot already lol

chrome egret
#

Right, it's def an idea borne out of MP

gilded hawk
#

Does any of the veterans know if there is any mod that improved the debugging UI? Cause the current one is kinda bad IMHO

hearty herald
#

I do like idea of just adding filter text on inventories in general

chrome egret
#

Another good idea

faint jewel
#

does anyone know a simple way to off set the position and direction of a vehicle? like i just want to get a position that .5 away from and 45 degrees to the right and facing of the vehicle

#

and if i could do that in a function it would be even better.

chrome egret
#

Wouldn't there be a trig function for that?

#

been forever since I've had to think about those

faint jewel
#

welli found a couple things but have no idea what they want to be fed.

chrome egret
#

Have you tried searching for invocations of the functions in the vanilla code?

faint jewel
#

well in the lua yeah.

faint jewel
#

ugh

#

theres nothing good for offsets 😦

steel lantern
craggy furnace
#

its a rough one, honestly

#

it does not function in for weight/size

#

so you can throw in 5 heavy items out of a set of 30 tiles and you still have 25 tiles still sitting there

#

nice concept though

hearty herald
#

I think it would only be graphical, and if it needs more tiles you'd probably just add a scrollbar.

#

In fact there's already a scrollbar there 😂, so it doesn't have to be that big vertically for sure

faint jewel
#

that's a stretched out view yeah.

woven wren
#

So I made a true music mod but I want to update it properly.

#

How do I do that?

undone crag
#

What is that lone getPlayer() for? Also that mod looks incompatible with other mods that modify the tooltip. It also looks like it may not work well with firearms that have attachments. You could try picking at what y to start by getting the tooltip's height after doing the original render function.

polar prairie
#

does anybody know where the ground-models are stored? for example if i replace a vanilla model with a new created one the "place on ground" model is the same, but it's shifted upside down.

celest crane
#

What is a good way to spawn custom, player-only clothing items?

#

I don't want to add them to zombie loot list

#

I wonder if crafting them with stupid easy items like a ripped sheet is a good idea Thonk

celest crane
#

Is there an empty texture I can set the <texture> attribute to to make my clothing item transparent?

#

If no, where do I put my transparent texture to use it?

gilded hawk
gilded hawk
#

Fellow modders, I was wondering how does sound work in MP/SP?
I'm planning to make a L4D1/2 pipebomb mod, where you yeet it, makes loud beeps zombies go to it, and they go boom

How do I spawn sounds? And how do I make it that that sound will aggro the zombies more then me? And sync it in MP

faint jewel
#

lua.

#

there's a "getOrCreateSound"

gilded hawk
chrome egret
celest crane
#

bruh no I haven't

#

I can just leave it blank?

#

I'll give it a try

chrome egret
#

glgl

#

Gettin' there!

celest crane
#

What's the correct code to grant skill xp when crafting something?

#

I have the mod "Craft Sheets" as a base, and the code to grant xp is wrong. A couple commenters posted the "correct" code and I edited the mod code directly but it doesn't seem to have any effect

chrome egret
#

What do you mean you edited directly? Not all mod code can be replaced the same way.

celest crane
#

The mod simply consists of media/scripts/recipe.txt

#

I edited that .txt directly

#

the code right now reads OnGiveXP:Recipe.OnGiveXP.Tailoring5

#

A commenter says this:

OnGiveXP:Recipe.OnGiveXP.Tailoring5,

(instead of your current code: OnGiveXP:Give5TailoringXP,)

I've tested it and it works for me. And thank you for a nice mod! It helped me create mine for sturdy sticks recipe without utilizin a saw :)```
#

It has the same syntax as the vanilla game recipes (such as slicing watermelon) but it doesn't seem to work

#

Either that or 5 XP is too small that I don't notice somehow

#

Anyway, is there an explanation for the crafting recipe?
I want to make the recipe unavailable from right click (i.e I have to open the crafting menu to see the recipe), is it possible?

drifting ore
#

You know what would improve inventory? Color coded inventory slots by category

faint jewel
# faint jewel

I was thinking you could color code the backgrounds of the icons. green for food, yellow for crafting, red for weapons etc.

drifting ore
#

Could you color by condition then color the background?

#

I like the coloring by background for the icons actually

#

Not too intrusive

drifting ore
# faint jewel

This type of inventory would also benefit from icons taking up space proportional to their weight

drifting ore
faint jewel
drifting ore
#

True lol

faint jewel
#

though making each square = 1 weight.

#

seems logical.

drifting ore
#

Might look into it, though it's probably over my head atm

drifting ore
faint jewel
#

you need to as thirsty as these damned zombies are.

celest crane
#

Lmao uh

#

I set the model to empty

#

and instead of a transparent nose ring I get a checkerboard dress that covers the face and body kek

#

Hmmm well the belly button object doesn't have anything associated to it but

celest crane
#

okay got it, I have the wrong texture path

celest crane
#

How does insulation work? I tried adding insulation to a custom nosering/bellybutton and it does nothing. The game shows the items as wearable, I have equipped them, and it shows insulation/wind resistance.
Do they have to have condition for insulation to function?

#

or is it because of the BodyLocation?

gilded hawk
celest crane
#

Nani

#

I thought "BloodLocation" is where the blood textures would be applied when getting bloody

#

alright let's see...

gilded hawk
#

BloodLocation handles protection and insulation too

#

I know cause I spent the last week working on the transmog mod and that shit was so confusing

celest crane
#

You're the guy that made transmog?

gilded hawk
#

Yes

celest crane
#

Huh that's cool

gilded hawk
#

Thanks loveyou

celest crane
#

So if I have insulation 1.0 and bloodlocation is literally the whole body
I'd basically be heating myself to the mars

gilded hawk
#

I guess that will be the case

#

Are you making a mod that adds stuff like RPG games? Where earring and similar trinkets add bonuses and stuff?

celest crane
#

No I'm just trying to figure things out at this point

fair pine
#

maybe mod that lets place gate that only faction members can open?

celest crane
#

uh oh, 1.0 insulation is too strong
or is it? Thonk Sure it's strong in summer, but I assume it'd help a lot in winter

#

Jesus there's a variant for each ring, for each fucking finger????

gilded hawk
#

_yes Good luck

chrome egret
#

So since I'm taking in text input for the item search mod, I'm wondering-- is there a way to get a reference to all defined items, so I can look for a match?

#

Or at least to get it through a multi-step process like get all items modules, get all items for the module, repeat

drifting ore
#

@faint jewel I was imagining something like this where you show each bag, have icons colored by category, show weight, and show how encumbered you get in the background grid

faint jewel
#

nice edit!

errant meteor
drifting ore
#

Could include a toggle for showing weight, there's definitely something to be said about overengineering

#

Ideally I'd like some way to show how much weight everything takes up but it's hard to do that and show the icon and show max carry capacity bc there are only so many visual channels

faint jewel
#

i think size would be okay.

#

like if an axe weighs 4, make the icon take up a 2x2

#

i need a function! "ObjectOffsetAngle()"

drifting ore
#

Also low weight icons have to misrepresent their weight, you'd have to add a toggle to switch between show/hide small icons

faint jewel
#

ObjectOffsetAngle(o,a) NEEEEEEED

#

dammit that would help but not really.

#

i would have to kno how to offset from that.

zinc laurel
#

anyone familiar with the Save Our Station mod, the radio broadcast portion of the mod seems to write out variable names instead of the values of the location/faults

timid plume
#

Hello modders

#

someone know how to tp someone from a mod?

regal canopy
#

Hey, anyone good a good article/howto on using python to read details from the players.db?

analog fern
#

Is there a mod let's me move multiple vehicles across the map at once?

clear lodge
#

This dude fell for it

#

How Can you be that naive in 2022

glad portal
#

can i download it somewhere?

#

or not yet

drifting ore
chrome egret
#

Miiiight steal that ModKeymap panel idea

daring palm
#

absolutely

#

I'm not that skilled with UI. You could take the code and improve it if you want

#

I'd gladly use a version of yours

chrome egret
#

So you're welcome to scavenge what you like

daring palm
#

This one doesnt work anymore

smoky sentinel
#

does anyone know how to get underwear to appear in character creation? This doesn't work and throws "unknown item type":

split yoke
#

I wonder if anyone knows how to read the Zombie Population map(debug mode)? Or where I can get more info/ask?

#

Specifically curious about the meaning of green square outlines, blue square, and the number n/n in the topleft corner of cells(assume zomb population but doesnt seem right)

rugged delta
#

Hi I have a Super Cool™ Mod idea

#

But I dont really know how to start

#

I just want to make your character talk to themselves

#

about their current situation

#

as an alternative to moodles

faint jewel
#

that .... would not be to hard?

rugged delta
#

are there any tutorials on this kinda thing?

#

I used to mod Skyrim and Fallout so I'm not compltely foreign to modding

#

but I dunno anything about PZ

#

I saw a mod that seemed to already show characters talking I was wondering if that can be like a template

#

its called Super Survivors?

#

Does Zomboid use like events to detect things going on?

#

@faint jewel Any idea how I might start on this kinda thing or any tutorials that might nudge me in the right direction?

faint jewel
#

yes it does.

rugged delta
#

I think I could do something really fun with it

#

but I'm stuck on the "how do you start" part lol

faint jewel
#

step 1.: learn lua.

rugged delta
#

uh huh

faint jewel
#

step 2. learn java.

rugged delta
#

uh huh

faint jewel
#

step three learn the engine.

rugged delta
#

I know a lot of Python, will that help here? lol

faint jewel
#

.uhhhhhhh

rugged delta
#

oh

#

I see someone made the mod I want to make already

#

so I can just expand this

#

very cool

faint jewel
#

there ya go.

faint jewel
#
AngleOffset(object, angle, distance) 

I need this function.

faint jewel
#

anyone?

chrome egret
#

Idk man, it looks like there are some getAngle* methods on BaseVehicle

faint jewel
#

i just want that specific function.

#

takes and object and the way it's facing, adds the angle ot that angle, and puses it away from the object the distance

frank elbow
faint jewel
#

well i dont brain that well lately.

hearty herald
#

If you want an angle offset from a center you need the center, then construct a unit vector, rotate that by the angle you want to offset, then add the two together.

#

You can also scale the unit vector if you don't want the offset to be 1

#

The only important thing is that the unit vector is pointing the way you want, say forward.

abstract sierra
#

Anyone know how to fix the issue with your dedicated server and ModOptions saying it doesnt exist giving you the error code for media/lua/shared/!ModOptionsEngine.lua

hearty herald
#
-- not real code, just example pseudo
function angleOffset(offsetAngle, length)
  offset = Vector3(1,0,0) -- assumes positive x is forward
  offset.rotateZ(offsetAngle) -- few ways to do this part, and gotta be specific if angle is in radians or degrees
  offset = offset * length -- scale to length
  return offset
end

position = Vector3(0,0,0)
offset = angleOffset(90, 1)
newPosition = position+offset   -- expected output of 0,1,0
offset = angleOffset(180, 1)    -- expected output of -1,0,0
offset = angleOffset(90, 1)     -- expected output of 0,-1,0
offset = angleOffset(-180, 1)   -- expected output of -1,0,0

Other than that, maybe you'd find enjoyment in a video about quaternions by 3b1b https://www.youtube.com/watch?v=zjMuIxRvygQ&ab_channel=3Blue1Brown

Go experience the explorable videos: https://eater.net/quaternions
Ben Eater's channel: https://www.youtube.com/user/eaterbc
Help fund future projects: https://www.patreon.com/3blue1brown
An equally valuable form of support is to simply share some of the videos.
Special thanks to these supporters: http://3b1b.co/quaternion-explorable-thanks

Pre...

▶ Play video
ashen lance
#

where can I find or whats the directory for the sound file WatchAlarmLoop?

chrome egret
#

Sounds are also located under media/scripts. I believe you're looking for sounds_item.txt

chrome egret
#

np

ashen lance
#

Ouh actually this shows me what event triggers to play the sound

#

but still no directory where the sound is

chrome egret
#

Not sure, just going off the reference for scripts in the Zomboid Modding Guide

#

it says event is used for "sound clips that are in the vanilla soundbanks, for customer sounds we need to use file"

ashen lance
#

I'm reading the guide, yeah its probably in a .bank file
I'll check it out now, thanks again

chrome egret
#

So it begins... results!

ashen lance
#

Is it possible for an object to have multiple types?
i.e

viral spire
#

Are there any radiation mods out there?

blazing radish
#

that being said, I don't know about your question, but I learned what I've told you after many errors

woven wren
#

A lot of new music I want to release for my True music pack.

#

If only if I knew how to update the mod w

blazing radish
#

same way you uploaded it

worldly stone
#

i was about to ask if you would take a request. so i searched the workshop first and someone already included it 👌

woven wren
blazing radish
#

didn't knew that was necessary to update a mod

woven wren
#

About that

#

lol

ashen lance
blazing radish
blazing radish
#

maybe some lua functions are required?

woven wren
#

I'll try to figure this out.

blazing radish
#

maybe it's worth to keep an eye here or to ask someone who uploaded it

#

or maybe downloading one and checking the file structure

woven wren
#

I think I've might've messed something up.

blazing radish
#

why? are you getting some error?

woven wren
#

I'm an absolute noob with creating mods.

#

Well I realized I forgot to rename some files in the True Music addon folder

blazing radish
#

yeah me too, but I've been doing a private mod for some time so I know it's a pain to upload one

woven wren
#

That's was a required step for the addon to not conflict with other True music addons.

blazing radish
#

and starting all over it's too much work?

woven wren
#

I'm gonna try to fix the stuff inside the folder before I even consider starting over.

#

Gonna test it in game after.

blazing radish
#

good luck mate

#

hope you can sort it out

woven wren
#

👍

woven wren
#

I think I'm good now.

drifting ore
#

Btw, why not use a collapsable window and remove the collapse part (the window element work too) ? Like that you can have the close button like other window (the bar in the top) and add a name for the window

#

Also I believe that the EntryText element has a function for when enter is pressed. Like that you could delete the two buttons

astral cargo
#

Hey, i need some advice, i'm looking for way to set some items to not spawn on map, and others to spawn in any container instead of dedicated spawn. Is there way to do it easly(mod) or do i need go hard way and modify item.txt and distributions.lua?

blissful shard
#

You could just modify the distributions.lua for spawn chances of items and basically not have them spawn at all and if I’m correct item.txt contains an items base stats

faint jewel
hearty herald
#

Just replace Vector3 with the math vector3f you can access in zomboid I guess

#

alternatively do the whole rotation thing manually like you did before, just on the forward unit vector by however many degrees lol

flint whale
#

Is there a way to reload my mod without restarting the game?

chrome egret
chrome egret
faint jewel
flint whale
#

thanks

hearty herald
#

yeah, Vector3 if not a class, it's called something else. like vector3f

#

I think you have to do vector3f:new(1,0,0)

#

It's under math java stuff in the javadoc's

faint jewel
hearty herald
#

It was matrix3f that had the rotation function, but they're more of a pain to get the xyz out of I think

#

Though, vector3f had inherited methods from something else

#

rotateX, rotateX, rotateY, rotateY, rotateZ, rotateZ

gilded hawk
#

Can we ship .class files in a workshop mod?

#

Cause I need to edit the original Clothing class 😐

#

If not, is it possible to ask the devs to add a single function to it?

nimble spoke
#

no

#

if you have a very good case, explain why you want the function,I'd say go ahead and make the suggestion. But make sure you explored what you already have first and there are no solutions to your problem/limitation

faint jewel
#

this is shredding my brain.

#
                        tempVector = Vector3f.new()
                        vecPos = vehicle:getWorldPos(0, 0, 0, tempVector)
                        print("vehicle:getWorldPos = x:", vecPos:x(), "-- y:", vecPos:y(), "-- z:",vecPos:z())
                        print("vehicle:get* = x:", vehicle:getX(), "-- y:", vehicle:getY(), "-- z:",vehicle:getZ())
                        tempVector = Vector3f.new(1,0,0)
                        vecPos2 = vehicle:getForwardVector(tempVector)
                        print("vehicle:getForwardVector = x:", vecPos2:x(), "-- y:", vecPos2:y(), "-- z:",vecPos2:z())
                        print("vehicle:getAngle* = x:", vehicle:getAngleX(), "-- y:", vehicle:getAngleY(), "-- z:",vehicle:getAngleZ())
#

the numbers are all over the chart.

#

all i want is

function angleOffset(position, offsetAngle, length)
    offset = position 
    offset.rotateZ(offsetAngle)
    offset = offset * length
    return offset
end```
drifting ore
#

Is there a pager mod or something like that ?

faint jewel
#

not that i know of?

drifting ore
#

Yeah i searched and found nothing. Good, I'll be busy tonight. I'm tired of work

chrome egret
drifting ore
#

Hello, can someone direct me to any source regarding applying a retexture to a mod vehicle? Trying to just do a simple texture overwrite to keep the dependency on the original as I only want to alter the texture of a few variants of it. Only thing I came up with was a post on TIS forums simply saying "copy the whole file structure" buuuut that would basically steal all the original work. And I've got no desire to model a vehicle from scratch at the moment. - Thanks for any assistance, my google-fu seems to be lacking lately...

drifting ore
#

thanks ill give a look at the file structure. cheers

drifting ore
chrome egret
#

true, it's a matter of perspective

#

I didn't start with baby's first mod after all

faint jewel
#

i think i cracked my skull headbutting the wall.

#

this makes zero damned sense.

#

like at ALL

woven wren
#

Ok how does one include change notes in an already uploaded mod?

#

I'm trying to get a second entry

faint jewel
#

update itt hrough pz.

drifting ore
#

make it possible to throw items (spear - spear is used for throwing), and create torch from a stick of rags and gasoline

woven wren
#

Yep

drifting ore
winter bolt
faint jewel
#

they updated teh existing ones to add thier skins.

drifting ore
#

Hm is it possible to make melee weapons deal fire damage? I know it's not a default weapon_item parameter, you'd have to hijack the damage system somehow.

faint jewel
#

or just use a lua to cehck if they got hit and if so do fire dmg then.

faint jewel
#

sigh.

faint jewel
#

man i kilt this channel DED.

worldly stone
#

yeah you did RIP

faint jewel
#

i just need this dumb ass function to work. then i can release my mowers.

faint jewel
#

yeah pretty much.

celest crane
#

Is there something special that I need to do to set an item as a backpack? I've given it carry capacity and weight reduction stats, also the sounds (open close put) but nothing

#

Oh... I forgot to set it to type container kekw

drifting ore
#

Opinions on the design? I like it but never used a pager so maybe I'm missing something

faint jewel
drifting ore
faint jewel
#

also they were grey.

drifting ore
#

Grays are the latest gen, this is the first gen with liquid crystal screen so they are green

#

To stay as much as possible in the year of the game

faint jewel
#

that's the pager I had in 1992.

drifting ore
#

I could do it gray it's true, it would be more historical but I like green. It's reminiscent of the gameboy and the era

#

But I will pass the numbers in black and keep the green background

faint jewel
#

a nice cross.

#

and that green is the "glow in the dark" green.

drifting ore
#

For the moment I only do a digital to send codes, can send [0-9]

#

This way you use a notepad to write down your codes, the old fashioned way

faint jewel
#

well i mean the colors.

#

not the style lol.

drifting ore
#

Yeah I get it, thx for the opinion

faint jewel
#

🙂

drifting ore
#
  1. Is an item's modData synced with the server and players? For example, if I add a variable to the modData of an item from the server, can a client read it?
#
  1. Can I save an item in global modData?
#

I'm trying to find an efficient way to save a number in an item (the pager) then, if the server receives the command to send a message to this number, find the item and change these modData.

#

This is the part where you have to find the item that I have no idea how to do

wintry stag
flint whale
#

Any way of reloading lua without disabling mod, go back to main screen, enable mod?

blazing radish
#

using debug mode IIRC allows you to reaload lua from the main menu

chrome egret
#

I've changed my mod's code many times-- simply quitting the SP game and hitting continue reloads the code

flint whale
#

I tried just quitting the game and continue. When I do that, it shows the new lua code, however it doesnt seem to be executed.

#

Only when I disable/enable It actually executes the new code

chrome egret
#

very odd

flint whale
#

for example... the object watcher does not show a new variable

#

even when the lua code shows it.. Its odd

#

I can reproduce this behavior many times

flint whale
blazing radish
#

just tried and isn't showing, I rmember it was on the right corner of the screen or near it

tight tulip
blazing radish
#

funny thing is even scenary list dissapeared from the main menu, so it could be bugged

flint whale
#

Just found that button! lol life changer

#

But its funny how it shows the new code, but doesnt execute it unless you forcefully reload it

faint jewel
#

tf is this?!

round zenith
#

Anyone know where a tutorial is for making a UI?

chrome egret
#

Same fella also provides a lib for making custom UIs if you don't want to learn the vanilla way

round zenith
#

cool ty! I was looking at lib but it wasn't expansive enough

blazing radish
#

anyone cna help me wiht this?

#

function zombieDeath(zombie)
local inv = zombie:getInventory();
inv:AddItem("AsuraChi.baseChi", 1);
end

Events.OnZombieDead.Add(zombieDeath);

#

I've ben trying for quite some time to spawn items in zombies when they die

#

I've tried a lot of scripts to make it work, and while it does spawn the item, that item gets duplicated by the ammount of players that loot that corpse

#

that code is one I've made following They Knew as example

#

but even with that the item still duplicates, while in they knew it doesn't happen

#

so, what I'm missing?

#

the script is in media/lua/server

#

all my efforts always end on the same result, the item getting duplicated in MP

#

it's literally the only thing holding me off uploading that mod and I'm getting insane stressed

chrome egret
#

Do you need to do it this way, or could you alter the loot distribution for the zombies?

blazing radish
#

the idea is that every zombie spawns only 1

#

idk what's the better approach on this honestly

#

at this point I'm thinking on just launching it with that bug

chrome egret
#

I mean sure, you can always update it later if you feel it's breaking balance or w/e

#

A benefit of trying to do it through distribution or generation would simply be to prevent adding the performance load of a function called on every death.

#

Though of course it's pretty simple code

blazing radish
#

thank you pal, it's a good idea and probably the method that other mods uses like greenfire

faint jewel
#

happy valentines day 😦

chrome egret
#

New and improved h/t to MrBounty

faint jewel
#

Messy!

final smelt
#

Aye Cool mod dudes, Can you add Cool kids - Gas station into your next True music addon, Thanks!

shell geode
#

anyone know what mod is this map mod?

late hound
shell geode
#

and gps/mini when u dont have the map on full screen

#

nvm i didnt realize this was vanilla stuff, havent played in awhile lol

slate wasp
drifting ore
# chrome egret New and improved h/t to MrBounty

Btw, for one of my mod I made a function to change a string so if you use it with string.match(), "can opener" and "Can opener" is the same, like that capital and lowercase letter is the same. Do you want it ?

drifting ore
chrome egret
drifting ore
# chrome egret Absolutely, I was expecting to have to roll my own implementation

I use it like that string.find(text, transformToPatern(subText))

local function transformToPatern(name)
    -- For the filter, remove upper and lowercase issue. Like that ShOrt and shorT is the same thing.
    -- To use with gmatch or string.find
    local toReturn = ""
    for i = 1, #name do
        local c = name:sub(i,i)
        toReturn = toReturn .. "[" .. c:lower() .. c:upper() .. "]"
    end
    return toReturn
end
boreal oriole
#

They both uses the method of changing the speed of animation using m_SpeedScale in the xml file which to me is really weird

#

Are there any other methods to change the speed of sprinters code wise?
I've read through the source code and try to decode it but I just couldn't figure it out.

dry stone
#

Just wondering if it's possible in theory to make a map with a power plant and water facility, and have some way for the player(s) to bring them back online and maintain them?

hearty herald
#

Isn't there one called "save our station" which does something similar for radio? I think for the weather reports mainly

dry stone
#

It's just an interesting idea.. but the last time I had an interesting mod idea for another game, it ended up as a DLL that loaded into the game's memory space and did hooks/code injections lmao

#

I'm hoping its a bit easier in zomboid

drifting ore
#

With global modData, if I use ModData.request(String key). How do I get the table after ? With the event OnReceiveGlobalModData or I can use ModData.get(String key) ?

dense peak
#

Quick question; how do I spawn a single "stack" of ammo from a recipe, or is that just broken?

drifting ore
dense peak
#

The two first recipes spawn a single shotgun shell

#

What I can't get to work is for it to spawn six. It either spawns one, or some other multiple of 6.

drifting ore
#

Send you recipe

dense peak
#
    {
       GunPowder=1,
       CanBeDoneFromFloor      : TRUE,
       Result:ShotgunShells,
       Sound:OpenCannedFood,
       Time:50,
       Category:Firearm,
    }
    recipe Result:ShotgunShells=1
    {
       GunPowder=1,
       CanBeDoneFromFloor      : TRUE,
       Result:ShotgunShells=1,
       Sound:OpenCannedFood,
       Time:50,
       Category:Firearm,
    }
    recipe Result:ShotgunShells=2
    {
       GunPowder=1,
       CanBeDoneFromFloor      : TRUE,
       Result:ShotgunShells=2,
       Sound:OpenCannedFood,
       Time:50,
       Category:Firearm,
    }
drifting ore
#

Wich one give you one ammo ? And wich one give you a multiple of 6 ?

dense peak
#

First two spawn a single shell. Third one spawns 12 (2*6) as it's supposed to.

drifting ore
#

Seems to be normal, you can't spawn one stack. In any case, nothing in the vanilla game, all the recipes have a =2

chrome egret
drifting ore
chrome egret
#

ah, I just found the Lua reference for this

#

[ and ] are magic characters to create a char-set

#

Perfect, thank you so much

rare sleet
#

You might be able to fake it but doing so would be an incredibly involved process (manually setting squares as having power as they're checked, or creating fake water sources that constantly get topped off to plumb things to, both pretty obnoxious hacks that may or may not be feasible or work as expected)

dry stone
#

heh invisible modded noiseless generators all over the map

#

I've found some tutorials and stuff for map making so far, and I think I could get into this...

#

but there's a lot of other stuff. vehicles, recipes, and so on that I'm not even sure where to get started

native dragon
hearty herald
#

Wouldn't it be possible to make a context action for sinks etc that allow you to draw water if some variable is true?

#

ofc it probably wouldn't be detected by crafting that needs water, but you could just tap it into pots etc before crafting

dry stone
round zenith
sharp prawn
#

does anyone know where foraging zone data is kept on a save file?

slate wasp
#

my recipe .lua file for my mod causes the items required for crafting sheet rope, ripped sheets and dismantling digital watches to disappear? the recipes are still in the crafting list but nothing the box that usually has the ingredients is gone. any ideas?

blazing radish
#

put the code of one of those recipes here

slate wasp
blazing radish
#

yeah, the code of one of the recipes that has the issue

#

one from your mod

slate wasp
#

Recipe = {}
Recipe.GetItemTypes = {}
Recipe.OnCanPerform = {}
Recipe.OnCreate = {}
Recipe.OnGiveXP = {}
Recipe.OnTest = {}

function Recipe.GetItemTypes.CraftPlankStack(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("Rope"));
end
-- save the ropes used
function Recipe.OnCreate.CreatePlankStack(items, result, player)
local item, itemType;
local ropeItems = {};
for i = 0, items:size() - 1 do
item = items:get(i);
if item then
itemType = item:getFullType();
if itemType ~= "Base.Plank" then
table.insert(ropeItems, itemType);
end;
end;
end;
result:getModData().ropeItems = ropeItems;
end

-- give back the ropes used
function Recipe.OnCreate.SplitPlankStack(items, result, player)
local ropeItems = items:get(0):getModData().ropeItems;
if ropeItems == nil then
player:getInventory():AddItem("Base.Rope");
player:getInventory():AddItem("Base.Rope");
else
for i = 1, #ropeItems do
player:getInventory():AddItem(ropeItems[i]);
end;
end
end

#

here's what it looks like in game when i go to dismantle the watch

#

everything that i modded in functions as it should, its just messing up these other recipes ( for anyone reading this after the fact, i pretty much took the code from server/recipecode.lua that referenced LogsStacks, switched out the names so it's referring to my new items, and stuck that code into a new .lua file that was packaged in my mod. )

blazing radish
#

uhm

#

I cna't help you, but that code should be able to tel someone more experienced what's happening

slate wasp
#

ty:)

blazing radish
#

sorry mate, butthere is really nice and talented people here so I'm sure you'll get an answer soon

nimble spoke
#

you're overrdiing the tables at the beginning of your file, don't do that

#

Recipe = {}
Recipe.GetItemTypes = {}
Recipe.OnCanPerform = {}
Recipe.OnCreate = {}
Recipe.OnGiveXP = {}
Recipe.OnTest = {}

#

remove these

#

You flushed vanilla recipe functions down the toilet the moment you made those = {} , empty tables

blazing radish
#

is there a way to create sound loops? I'm doing a script for sound, looks like this:

#

sound demake
{
category = Item,
clip
{
file = media/sound/demake.ogg,
}
}

#

but it'll only play once and I'm trying to avoid creating longer sounds, but I'll have to do it if I don't have a way to loop them

thin hornet
blazing radish
#

distance max it's relaetd to how far the sound gets in the game, like for a sound that will attract zeds?

thin hornet
#

Only for hearing sound

#

Not zombie attraction

blazing radish
#

nice

#

thank you mate

thin hornet
#

to attrack zombies you need to use this global function

addSound(playerObj, playerObj:getX(), playerObj:getY(), playerObj:getZ(), 20, 20);
blazing radish
#

fantastic, thank you very much pal

#

jsut tested it, works flawless!

low yarrow
#

Is there a way to add multiple outputs of a recipe?
Apparently this here doesnt work:

#

Basically i want to split a previously combined item again

thin hornet
#

Recipe want to return only 1 result item. The OnCreate function will let you add more.

little stream
wet coral
#

where do you put mods that you create?

thin hornet
#

you can use ModTemplate as example for the mod file structure

wet coral
#

ok, thanks

low yarrow
#

Cool. It worked. Thanks again 😄

drifting ore
#

With global modData, if I use ModData.request(String key). How do I get the table after ? With the event OnReceiveGlobalModData or I can use ModData.get(String key) ?

sand tinsel
#

Having trouble with regions on my server (hosted). They never show up when I boot the server and start to spawn in, can anyone break down what I have to do fix it?

#

By the way, I mean I don't have the option to spawn in them

#

In single player it works fine

wet coral
#

what % chance does this translate to?

#

.01% or .001% or what?

#

since in most games 0.4 is usually like 40%

sand tinsel
wet coral
#

thanks

sand tinsel
#

np

sand tinsel
wet coral
#

sorry man, I have no idea

#

not really the guy to ask

sand tinsel
#

Its alright

#

Ill figure out somehow

#

Ill just beg for help in pz chat

wet coral
#

good plan lol. I've been in that spot before, kinda sucks

azure rivet
#

Hello, I have a question, can it be implemented that a garment can be repaired with cloth or leather?

sand tinsel
#

While this is active can anyone help me with the region thing I posted a little while ago

drifting ore
#

How do I get the in-game time and date?

sand tinsel
#

A watch

#

Digital one

drifting ore
#

I mean in lua

hot vine
sand tinsel
#

Please man someone help

#

Im desperate

blazing radish
#

sadly you'll have to wait until someone that knows that answer would help you out :/

#

if I knew I'm sure as hell I would be glad to help you out

sand tinsel
#

Alr

blazing radish
#

don't lose hope, this channel has a lot of very cool, talented and nice people

azure rivet
sand tinsel
#

You mean like you're repairing it and because of that, there's extra/different material?

#

So like I break both sleeves on a cotton t shirt, I repair it and it becomes leather or some other material I had

#

?

wet coral
#

my isn't my mod showing up in the mod list?

#

followed the Blackbeard tutorial almost exactly

#

oh wait

#

fixed it

drifting stump
#

then you choose if you want to save it or do something with it

drifting ore
#

Ok and the table is save ? Like if the server reboot, the table is the same ?

worldly stone
sand tinsel
#

Ie, moving the ky maps to the bottom of this

worldly stone
#

yes. move the KY maps to bottom so the game reads them last

sand tinsel
#

Alright

#

Just did it

#

Gonna reboot the game

#

Wish me luck!

worldly stone
#

i hope it works

drifting stump
#

ive told the devs

sand tinsel
drifting ore
worldly stone
#

have a look around because the spawn regions file you eddited isnt set out the same way as i remember

drifting stump
#

save the table with the json thingy and load it back on startup

sand tinsel
#

If I go and check my server files, you have all the mod spawn regions as maps

#

and then just maldraugh

drifting ore
sand tinsel
#

These makes me believe that maldraugh should have all the modded regions in it

#

But they arent in it

worldly stone
#

it should look likemap= modname, modname, Muldragh, KY

sand tinsel
#

Might be wrong folder

#

Yeah thats why

sand tinsel
#

I need to find the map file

drifting stump
#

can save on a timer

sand tinsel
#

And then add those all and put muldraugh ky

drifting ore
#

Yes that's what I told myself, save every hour

worldly stone
#

exactly. riveside and westpoint wont be in the list iirc

sand tinsel
#

I have no clue where the file is though

#

Gonna look it up

worldly stone
#

because they are covered under the same region as Muldragh, KY

drifting stump
#

this is the client side save of a server

#

server side save

#

global mod data is missing

sand tinsel
worldly stone
#

nope. never done it myself. not at my computer either xD

sand tinsel
#

Server test ini

worldly stone
#

^ 👍

drifting ore
#

Mmmm kind of stupid to not save it

sand tinsel
#

for all the maps

#

dont know why

#

never mind found it

#

still doesnt solve the problem though

#

Found it!

#

Alright

#

I did it

#

I did all the steps

#

Moment of trut

#

truth

#

Its booting

#

It didnt work

#

I hate this

regal sail
worldly stone
#

sorry man. it must be more complex and probably beyond me then

sand tinsel
#

theres one line I dont understand

#

Next, re-FTP into your folder. Overwrite/edit your spawnregions.lua files and copy the info from the mod= line in your servertest file to match the one in the server, either manually or by overwriting.

#

That one

#

I think he means make the mods the same as the server

#

But i dont know

#

It just dont make sense

#

And when I go in game, I still have to add the regions as maps in order for them to appear in spawn region

#

Its just so stupid

slate wasp
#

how would i go about locking a recipe behind a certain zombie kill count/days alive?

sand tinsel
#

uh

#

You mean like making a mod?

slate wasp
#

yeah!

sand tinsel
#

Hm

#

I mean

#

I dont code

#

But you could add a stat thing

#

LIke

#

Every day you get

#

20 xp in this stat

#

Like maintennance those kinda stats

#

once you hit a certain level it gives you the recipe

#

Or I mean, not sure if this would work, but have something to check the amount of days, then when you hit a certain amount of days it gives you an item or something that has the recipe

#

But im not savvy with that stuff

worldly stone
#

lookup mod become desensitized. have a look through the code to see how they achieved it

sharp wind
#

is there a way for me to detect if the vehicle i'm driving is damaged?

#

raising an event

slate wasp
#

anyone know how many unique zombie sound effects there are?

gilded hawk
#

It's kinda raw but I think i did an okay-ish job, but god I hate unresponsive UI

flint whale
#

I am creating a Custom Object.
I have the ISCustomLightSwitch which describes how the object is placed.
Once the object is placed ISCustomLightSwitch:create is called. This method will then create the object IsoObject.new(getCell(), self.sq, getSprite(sprite)) and add it to the square.

Does my workflow makes sense? I tested and it works as intended.
The second question I have is around using the IsoObject. I could not find any generic type I could use. However, by using IsoObject I have no way of using isinstanceof when building my menus. Should I derive from IsoObject to create my own?

Thanks in advance.

drifting ore
gilded hawk
drifting ore
#

Can I add a custom recipe to a vanilla magazine ?

flint whale
#

What is wrong with this code?

local electronicsSubMenuOption = context:addOption("Electronics", nil, nil)
local electronicsSubMenu = ISContextMenu:getNew(context)
context:addSubMenu(electronicsSubMenuOption, electronicsSubMenu)

electronicsSubMenu:addOption("Light Switch", nil, nil)
hidden compass
#

Hello everyone.
I have created a stealth camo mod, and I'm using vanilla GhostMode to achieve stealth.
However, GhostMode is mainly for debugging purposes, which has caused some problems.
(no sound playback, collision detection disabled, etc.)

Another possible way to achieve stealth would be to "take away the zombie's vision",
but this could not be achieved (by my modding skill).
This is just an idle talk, do you have any good ideas on how to achieve stealth?
I would like to hear various opinions.

https://steamcommunity.com/sharedfiles/filedetails/?id=2762398967

chrome egret
#

Where is getPlayerInventory defined? I'm calling it, and it seems to work, but I'd like to look at it. I can't find it among the other functions exposed globally by the LuaManager class, or searching anywhere else (other than the actual calls using it in vanilla code).

thin hornet
chrome egret
#

Muchas gracias

drifting ore
#

Ability to craft a pager to a door

#

So if the door is opened it notifies the connected users pager(s)

#

Good for MP if you have a base thats getting raided for example

native dragon
#

Do you guys know where is the furnitures files? I want to make one but I don't have any reference

chrome egret
#

Is it normal for Item instances (from a character's inventory "backpack" in this case) to always return a Count/getCount() result of 1?

#

I would've expected stackable items to report a count of 2+ similar to the way they look in the inventory page:

flint whale
chrome egret
#

Can you include the error? just seeing the code isn't necessarily enough info

flint whale
#

attemped index: subOptionsNums of non-table: null

chrome egret
#

What's the function call chain?

flint whale
#

is there a way to copy from the game stackstrace?

chrome egret
#

It's just a file

flint whale
#

nvm.. i am stupid

chrome egret
#

it's k, you just needed a rubber duck 🙂

flint whale
#

should have looked into the stacktrace earlier

#

I had some garbage somewhere else

chrome egret
#

Glad you found it!

flint whale
#

Thanks anyways for helping out

chrome egret
#

np

chrome egret
native dragon
#

yep thanks a lot

blazing radish
#

this code would generate the item I want with 100% chance on all zeds?

#

require 'Items/SuburbsDistributions'

local allinv = {"inventorymale", "inventoryfemale"};

table.insert(SuburbsDistributions["all"][allinv].items, "AsuraChi.baseChi");
table.insert(SuburbsDistributions["all"][allinv].items, 100);

#

well, didn't work

#

shows an error, I'll keep trying

pseudo tinsel
#

Hi modders, am new to modding - just wanted to start with something simple like changing an item's image and stats (not through the game files, would rather release as a mod so the server can apply it). How should I start? There is probably very similar code I can reference to? (I am more trained in data analytics, think R and Python, so not familiar to modding languages)

blazing radish
#

I think it'll depend on the item but it's pretty basic, even for us non programmers!

#

waht item you want to change?

#

this one worked out fine

#

require 'Items/SuburbsDistributions'

table.insert(SuburbsDistributions["all"]["inventorymale"].items, "AsuraChi.baseChi");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 999999999);
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "AsuraChi.baseChi");
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 999999999);

#

but IDK if this change did something to zombies, someone knows if it's correct?

#

tried using 100 but the item didin't appeared in all zeds, this one worked out fine

hearty herald
#

Well, it's the weight that is 9999999?

#

It might displace one other item then 🤔

blazing radish
#

I was afraid of that but I wasn't sure

hearty herald
#

Unless there's a -1 or something for "always add this", but I haven't looked into distributions at all

blazing radish
#

still appeared other items like always tho

#

yeah this is my first time on this due desperation because I was using OnZombieDeath function but creates some weird issues in MP

#

the item I spawn duplicates by the ammount of players that loot the corpse

#

if anyone knows how I can add an item for everyone without messing with other mods would be fantastic

#

😅

hearty herald
#

Aren't there ways for scripts to run serverside, aka only once?

#

Otherwise you'd have to mess with that message sending thing from client/server/otherclients

blazing radish
#

idk honestly, I had the script on server folder

#

was this one

#

function zombieDeath(zombie)
local inv = zombie:getInventory();
inv:AddItems("AsuraChi.baseChi", 1);
end

Events.OnZombieDead.Add(zombieDeath);

#

and tried many more iteration of similar codes, all with the same results

#

I'll try with -1 just to see if it works

#

nope, doesn't work, now the item doesn't spawn 😦

hearty herald
#

Hmm

#

Apparantly you might be able to place a minimum value for items to spawn in a container

#

If you can say minimum 1 asura it would always drop

blazing radish
#

yeah that would be nice, but it only have to drop from corpses

#

in the future I'm planning to add a player action to gather the item I want plus the zeds

hearty herald
#

I saw it on a forum post "quick guide how to mod distribution" but that's in the distributions.lua file when I did a quick google

blazing radish
#

yeah but that's fro containers

hearty herald
#

Zombie corpses are also containers though, technically

#

but yeah idk if you can change what zombies drop from it

#

Maybe only in procedural

#

the adding you did looks like a proceduraldistributions

#

Since it only has a weight

#

But hmm, wouldn't it be possible to add a new table for your asura that has minimum 1 and only contains asuraChi?

blazing radish
#

I don't know how to do that honestly

#

but I would do anything at this point, I'll try to look for examples

hearty herald
#

If this structure is still the case

#

What I'd like to see, is the distributions.lua ["all"][inventorymale]

#

Because if you can edit that one, you can add a new entry to the ProcList, and add your own procedural distributions for that proclist that only contains ur chi

#

And set it to minimum 1 so it always drops 1

#

You could also set it so maximum is 2 so theres a chance for 2, if you wanted to lol

blazing radish
#

nah just 1 it's perfect

#

I've looked that file and tbh I didn't understand anything

hearty herald
#

But what about the female zombers

#

😂

#

That turned dark

#

👀

blazing radish
#

went over my head tbh so it's ok I guess

hearty herald
#

Where is the distributions.lua file? I could take a look

pseudo tinsel
# blazing radish waht item you want to change?

thanks for responding! Honestly just wanted to see if I could create a "texture pack" of sorts, but more for the items themselves. Have not looked into coding languages yet though, I am really starting from 0 right now. I see some mentions about Java and stuff but will have to look closer after I get off work

#

Cheers!

hearty herald
blazing radish
blazing radish
#

3 in fact, distributions.lua, proceduraldistributions.lua and suburbsdistributions.lua

#

I took the example code form a mod that adds loot to zombies and compared to another one and both shares the same structure, but both works with chances and I haven't found anything llike what I want

blazing radish
#

relevant files are the ones with "item_" and models_items

hearty herald
#

Hmm, can a container have both a procList and standard items?

#

Or does procedural override it

blazing radish
#

I don't have idea, tbh my mods is pretty simple, just a bunch of items and recipes

hearty herald
#
inventorymale = {
    rolls = 1,
    items = {
        "BluePen", 1,
        "Cigarettes", 0.5,
        "Cologne", 0.5,
        "Comb", 1,
        "CreditCard", 1,
        "Earbuds", 1,
        "Lighter", 0.5,
        "Locket", 1,
        "Magazine", 1,
        "MarchRidgeMap", 0.1,
        "Matches", 0.5,
        "MuldraughMap", 0.1,
        "Newspaper", 1,
        "Notebook", 1,
        "Pen", 1,
        "Pencil", 1,
        "Pills", 0.1,
        "PillsAntiDep", 0.1,
        "PillsBeta", 0.1,
        "PillsVitamins", 0.1,
        "Radio.WalkieTalkie1", 0.05,
        "Radio.WalkieTalkie2", 0.03,
        "Radio.WalkieTalkie3", 0.001,
        "RedPen", 1,
        "RiversideMap", 0.1,
        "RosewoodMap", 0.1,
        "Wallet", 1,
        "Wallet2", 1,
        "Wallet3", 1,
        "Wallet4", 1,
        "WestpointMap", 0.1,
    }
},
blazing radish
#

I've been avoiding lua stuff

hearty herald
#

That's how the inventoryMale is

#

It takes 1 item from all those

#

I can see 1 method that might save you hassle, since this is only dropped items

#

What if you make all zombies equip an asurachi?

#

Then it would also drop

blazing radish
#

equip how, like clothes?

hearty herald
#

Yeah, I'm sure theres a place you can change what clothes they spawn in

#

And such

#

Like items in their inventory

#

Axes in their body and all that

blazing radish
#

uhm

#

I'm not sure, sounds... weird

#

also I would mess with other costumes maybe?

thin hornet
#

So i posted my utilities class that i posted here before, on the forum, might be easier to follow up and update.
https://theindiestone.com/forums/index.php?/topic/49989-utilities-class-for-modder/

hearty herald
#
-- Current
inventorymale = {
    rolls = 1,
    items = {
        -- lots of stuff
    }
},

-- Possible, changes? But probably would fk with other mods...
inventorymale = {
    procedural = true,
    ProcList = { 
      {name="InventoryMale", min=1, max=1, weightChance=100}, -- would have to add it to proceduraldist.lua
      {name="AsuraChi", min=1, max=2, weightChance=5}, -- would weightChange add 5% for two?
    }
},
-- Do both work at the same time? would be for best probably.
inventorymale = {
    rolls = 1,
    items = {
        -- lots of stuff
    }
    procedural = true,
    ProcList = { 
      {name="AsuraChi", min=1, max=2, weightChance=5}, -- would weightChange add 5% for two?
    }
},
#

It's that or making it so zombies spawn with it in their inventory that's best I think. Maybe konjima's utilities has a better method for you

thin hornet
#

I actually got a small api that i will release for easily adding item spawn to outfits.

#

cause adding items to an outfit require the outfit entry to be already in the distribution table, so it kind of handle it so that if its found already from an other mod, it will just add the items but if its not then it creates it.

hearty herald
#

Well, I don't think I can find out if you can have both items and ProcList on a single entry and have both work without looking at the java for picking what item(s) to spawn

#

Since nothing in the default list has both

#

Too lazy to actually test it in practice 😂

thin hornet
#

I believe the distribution for outfit is not procedural

hearty herald
#

Don't know about outfits, wouldn't surprise me if they did include randomness to it though

blazing radish
#

well mate, I'm really greatful for all your help

#

I think I'll stick to OnZombieDead even if it's bugged :/

hearty herald
#

if you wanted to test having both proclist and the other one

hearty herald
#

So I'm guessing that the outfits have their own ProcLists included

blazing radish
#

but it's that 999999 weight really messing with other mods?

#

all of this would be more easy if I couldtreat it like the containers on rooms

thin hornet
#

mhm interesting

blazing radish
#

I just tested it in MP and works as I want, but I don't want to mess with other mods at all

thin hornet
#

I have this for now

require "Items/SuburbsDistributions"

-- Define your mod distribution for outfits
local myOutfitDistributionEntries = {
    ["Bandit"] = {
        rolls = 1,
        items = {
            "Drugs.EmptyBaggie", 5,
            "Drugs.CocaineBaggie", 10,
        },
    },
    ["Punk"] = {
        rolls = 1,
        items = {
            "Drugs.EmptyBaggie", 10,
            "Drugs.CocaineBaggie", 5,
        },
    },
};

-- The code handling the distribution table
for key, value in pairs(myOutfitDistributionEntries) do
    local outfitName =  "Outfit_" .. key;
    -- Outfit not found we create it
    if not SuburbsDistributions.all[outfitName] then
        SuburbsDistributions.all[outfitName] = {
            rolls = value.rolls or 1,
            items = value.items,
        };
    -- Outfit already found we just add the items
    else
        for i = 1, #value.items do
            table.insert(SuburbsDistributions.all[outfitName].items, value.items[i]);
        end
    end
end
blazing radish
#

in fact I'm thinking that I should drop the chi from corpses and try to get working a player action, I could use just a recipe but AFAIK recipes doesn't allow to change things like hunger or thirst

#

taht would be more true to my kenshi mod

hearty herald
#
maleTable = UrbanDistributions["all"]["inventorymale"]
table.insert(maleTable, {"procedural", true}) -- can you add keyValuepairs like this?
table.insert(maleTable, {"ProcList",{{name="AsuraChi", min=1, max=2, weightChance=5}}})
table.insert(ProceduralDistributions.list,{
    "AsuraChi",
    {
      rolls=1, 
      items={"AsuraChi", 1}
    }
})
#

Well idk about the table.insert thing

thin hornet
#

table insert will add it as an array entry, not as an object table with keys (just saying idk if that ok or not for your case)

hearty herald
#

Idk it seems easier to let the game handle merging it isntead

#

than doing it with code

#

The SuburbsDistributions.lua has merging logic for additional distributions

blazing radish
#

I'm completely lost at this point lmao

#

I'm sure as hell I'll be crediting you too when I launch this

hearty herald
#

So you can add your own distributions.lua and add it to a list of distributions

#

and the game merges it together when it's loading

blazing radish
#

thank you for the aptience and the disposition, means a lot to me

#

I'll go to sleep, it's almsot 4am here and I'm dying

#

thank you very much to you 2, again

thin hornet
hearty herald
#

Depends on the order

#

The last one in the list should override the first one

thin hornet
#

And i supose it will anyway if one mod doesnt do it properly

hearty herald
#

If any keys conflict

#

There's a List called Distributions somewhere, and the games default Distribution should be the first item in the list (always)

#

And if you want to add new lists you need to add your distributions table onto that one

#

And any conflicts from base game will be overriden

#

Like if you want to make a certain item spawn less

thin hornet
#

ah yeah i see

hearty herald
#
-- in SuburbsDistributions.lua
local function mergeDistributions()
    SuburbsDistributions = Distributions[1] -- the games distribition table should always be the first in table.

    -- if there are modded distribution tables merge them into the main suburbsdistributions
thin hornet
#

im gonna need to take deep look at the whole distribution system i think im missing a couple key things here

hearty herald
#
-- at the bottom of Distributions.lua
table.insert(Distributions, 1, distributionTable);

--for mod compat:
SuburbsDistributions = distributionTable;
#

Is it possible to insert into that list without specifying index?

#

So you don't accidentally override any other mods dsitributions

thin hornet
#

yeah im looking at the same

#

just omit the index and it will append it

#
table.insert(Distributions, myModDistributionTable);
hearty herald
#

If things do merge, it might be possible that things do have both procedural and fixed items

thin hornet
#

Yeah its seem that it might be the proper way of doing it

hearty herald
#

Does it handle both of them properly then?

thin hornet
#

all this time

#

haha

hearty herald
#

Because that'd be a good way to solve Asura guy's problem

#

Just smack a ProcList that always drops 1 on the inventory of male and female corpses

#

Or if theres a method without proclist that gives you minimum of 1 and doesn't impact random rolls

thin hornet
#

i always used SuburbsDistributions directly not knowing i could simply add my own tables to Distributions and that would simply merge and prevent conflict with other mods.

#

If im understanding correctly

hearty herald
#

Well it will still conflict if you are both changing the same things

#

And it will use the last loaded one in that case most likely

#

But that's only if you are both changing the same variable, not sure how it works for the lists?

#

However you could be naughty and hook to Events.OnPostDistributionMerge if you want to ensure no other mod screwed you on something 😂

thin hornet
#

well they could be sneaky too and do it too xD

#

then load order still hit

hearty herald
#

It would I guess

#

depends on the order of the event callbacks

thin hornet
#

ProceduralDistributions does not have that merging stuff

hearty herald
#

Nah, but it is a simple list instead

#

or should I say simpler

#

It's only one level deep

#

not sure what the mod compat thing at the bottom wants

#

if you use table.insert, and you have an object with same key as the base game, what happens?

thin hornet
#

its commented out

#

probably not in use

hearty herald
#

hmm

thin hornet
#

probably they though of doing something similar and decided to not to for now or not needed at all

hearty herald
#

Hmm

#

Well

#

Think would have to go read some java to find out how it uses the procedural tables

thin hornet
#

well the procedural table is only used for "linking" to the suburbDistribution proc list.

#

so basically it must only be looking up for the key in list

hearty herald
#

Well from what I gather so far, you could probably add a new procedural table by writing something like:

require('summat/ProceduralDistributions.lua') -- whatever the path is

list = ProceduralDistributions.list

table.insert(list, "ProcListName", {rolls=1, items={"ItemName", 1}}
thin hornet
#

or just simply

ProceduralDistributions.list.Konijima_DopeStorage = {
    rolls = 2,
    items = {
        "Drugs.EmptyBaggie", 20,
        "Drugs.CocaineLine", 20,
        "Drugs.MDMAPill", 10,
        "Drugs.CocaineBaggie", 1,
        "Drugs.MDMABaggie", 1,
    },
    junk = {
        rolls = 1,
        items = { }
    },
};
hearty herald
#

Yeah that probably works too

thin hornet
#

it does

hearty herald
#

Looks better also

#

😂

thin hornet
#

But that definitivly will be overwritten if an other mod use the same key

#

So its a good idea to prefix our custom proc table

hearty herald
#

I just saw the examble for outfit adding items

thin hornet
#

in All

hearty herald
#
-- This is an example to add a specific distribution on a dead corpse according to his outfit
Outfit_Generic99 = {
    rolls = 1,
    items = {
        "Wallet", 100,
    }
},
#

Yea

#

You can definitely add ProcList to that then

thin hornet
#

but if an other mod add items not as procedural to the same outfit (and that if they dont override it completely in the first place) then idk what will happen

#

based on the example i suspect it shouldnt be procedural

hearty herald
#

Just curious what would happen if an item has both procedural =true and items{some items}

thin hornet
#

but not saying you cant

hearty herald
#

Nah there are outfits that have procedural I think

#

because proceduraldist file has "armysurplusoutfit"

#

bunch of outfit proclists

thin hornet
#

I dont know where the outfit are set but clearly not in Items\Distributions.lua

#

armysurplusoutfit is only to generate army clothing into a container

hearty herald
#

hmm

thin hornet
#

i havent found where the zombie base loot is defined

hearty herald
#

But since it's inside distributionsLua it should hook into the proc thing

#

So it should work

thin hornet
#

yeah sure it should

#

i would assume that if the code find procedural = true, it will use procedural only.

hearty herald
#

We could test it

#

Or rather, you could. mwahaha

#

😂

thin hornet
#

im trying to find the actual code instead

#

xD

#

so IsoZombie have addItemToSpawnAtDeath(InventoryItem var1) which seem to be used with AttachedWeaponDefinitions

#

but i think outfit loot is defined in the xml

#

but thats only for the clothing item, not the random Items loot

hearty herald
#

that attachweapon thing is also neat for ading items on death

#

it should only add it once right? on servers

#

tho I've heard of people seeing different items inside zombies

#

when I played some MP apparantly same zombie had 2 diff things for people

thin hornet
#

But thats also for visual item like katana on the chest

hearty herald
#

You think this might work?

-- AsuraDistributions.lua
-- Idk the actual requires, fix as necessary
require('Distributions')
require('ProceduralDistributions')

local asuraTable = {
    all = {
        
        inventoryfemale = {
            items={"Apple", 50000,}
            procedural=true,
            ProcList= {
                {name="AsuraChiItems", min=1, max=2, weightChance=5}
            }
        },
        inventorymale = {
            items={"Apple", 50000,}
            procedural=false,
            ProcList= {
                {name="AsuraChiItems", min=1, max=2, weightChance=5}
            }
        }
    }
}

ProceduralDistributions.list.AsuraChiItems = {
        rolls = 1,
        items = {
            "AsuraChi.baseChi", 10,
        },
        junk = {
            rolls = 0,
            items = {}
        } 
}
-- Fix as necessary if names are wrong
table.insert(Distributions, asuraTable);
#

Though it assumes that it can take rolls from itemlist and procedural same time

thin hornet
#

table.insert for the ProceduralDistributions.list will not work

#

cause is a key/value table not an indexed table

hearty herald
#

oh right

thin hornet
#

but im sure it would work for the Distributions line

#

it will process it into the merge function

#

but

#

inventoryfemale might not works

#

cause its already defined not as a procedural

hearty herald
#

I mean, doing the table insert with key is the same as doing the .Name thing

#

I even spelled procedural wrong LOL

thin hornet
#

in the worst case scenario it will use you procedural only and ignore the other vanilla items to it

hearty herald
#

Well, should try it still

#

add some ridiculous weight item the norm and then use procedural too

thin hornet
#

i really dont think table.insert works with key/value table

#

cause it dont set the key anywhere

hearty herald
#

It should if you specify the key

thin hornet
#
table.insert(targetTable, numberIndexPosition, insertedValue) -- insert at index
table.insert(targetTable, insertedValue) -- insert at the end with index
#

just like table.remove doesnt work with key/value table

#

instead we just table.key = nil

#

and set with table.key = {}

hearty herald
#

Thought lua was really flexible with keys and that

#

😂