#mod_development

1 messages ยท Page 20 of 1

deft jacinth
#

Anybody know if anyone is currently working on a total conversion S.T.A.L.K.E.R. mod?

jagged ingot
#

I would love to play a mod that implements the daytime radiation mod in the Pripyat one.

#

Like the daylight zombifies you over time or something.

deft jacinth
#

Been thinking about it ever since I was like 5 hours into PZ years ago. It feels like it would be absolutely perfect for an isometric STALKER experience.

#

Just have psy-zombies like in STALKER if you're outside during an emission and that's where they come from

#

along with animals etc. I don't even want regular zombies

#

I want to just play isometric STALKER lmao

jagged ingot
#

I don't think that the zombies will ever become as moddable.

#

Would be an excellent mod to work on...

#

You'd have to modify the client & server's core to get a mod like that going.

unkempt bronze
#

Anyone know how to develop a server restart announcement in-game? Ex. Server will restart in 15 minutes, get somewhere safe!

calm depot
#

the game already supports sending announcements to everyone

unkempt bronze
calm depot
#

no, manually, you would obviously have to write a script if you want to automate it

jagged ingot
#

Can't remember the names but yes they're out there.

unkempt bronze
fiery pecan
#

or at least to dynamically change the texturelights field and lightbar color via lua?

quasi kernel
#

Does everyone do the modelling themselves for their mods? I'd do the same, but my modelling kinda sucks.

empty cove
#

Hi, does anyone know how call the 'DataInputStream.read(byte[], int offset, int len)' via lua? I'm a bit stuck in this part. I tried passing an empty lua table and it gives me 'no implementation error'. Any idea how to pass byte array? Or do I need to stick with 'readByte()'?

calm depot
#

when you call a java function, if it expects a java type, then you must pass it one

#

numeric values and strings are converted for you

#

in essence, you would need an instance of a byte[]

empty cove
#

@calm depot
Thank you for answering.
In that case, I'll just stick to readByte / readLine for text files. I couldn't find a way to initialize java byte array. Even the byte class is not exposed.

quasi kernel
#

@calm depot may I call upon your wisdom at this time

calm depot
#

sure

quasi kernel
#

I'm trying to figure out why my timed action seems to perpetually get stuck in :perform() whenever it finishes charging the hand crank

#

It'll stop the animation and everything when the player runs, but it'd be nice to stomp out the bug once and for all.

calm depot
#

sounds like you forgot to call ISBaseTimedAction.perform(self) at the end of the function

quasi kernel
#

I did though-

#

Which is what's confusing me

calm depot
#

paste the code

quasi kernel
#
function ISChargeBattery:perform()
    self.character:stopOrTriggerSound(self.sound)
    print("Done..?")

    -- needed to remove from queue / start next.
    self.handCrank:setJobDelta(0.0)
    ISBaseTimedAction.perform(self);
end
#

(the setJobDelta on the item is copied over from ISTakeFuel since I thought that might've been causing the problem. Apparently not, but it doesn't break things so shrug)

calm depot
#

uh, why do you set the job delta to 0?

quasi kernel
#

handCrank job delta is treated seperately from regular jobDelta

calm depot
#

yeah, I don't expect it to break things but it doesn't do anything useful either

quasi kernel
#

Fair tbh

#

I can delete it rq

#

But yeah, it just kinda.. loops perform forever for some reason.

calm depot
#

pastebin the entire timedaction file

quasi kernel
#

okie dokie

#

(Yes the instant action code doesnt do anything yet, that'll be patched)

ivory knoll
#

sorry, wrong panel

calm depot
#

you have loopedAction set to true

quasi kernel
#

oh my god

#

thank you

#

Am I able to just delete that line and it'll work fine?

calm depot
#

theoretically drunk

quasi kernel
#

Zomboid modding hours

#

Now I can finally focus on tiny things to make the mod look marginally more appealing

calm depot
#
    if o.character:isTimedActionInstant() then o.maxTime = 1; end```
You can reduce this statement to
`o.maxTime = o.character:isTimedActionInstant() and 1 or 600`
quasi kernel
#

Not necessary

#

maxTime is overwritten by :setTime() in start code anyways

#

Better to set it up there

calm depot
#

then just get rid of the if statement

quasi kernel
#

I am!1

#

I told you it'd be patched!!!

#

smh..

calm depot
#

although it would be good if you respected the instant timed actions

#

not a huge deal, but useful for debugging

quasi kernel
#

literally just did this lol

#

maxtime is irrelevant since it's dynamically set anyways so

#

p sure it's required for startup though so I just leave it

calm depot
#

yeah, the base class probably expects it to have a value

quasi kernel
#

Alright, perfect!

#

Thank you once again Oli, can't believe I glanced over that

#

Now for this mod to be considered complete in my eyes, just gotta make a couple models and a better thumbnail

calm depot
#

Blender

quasi kernel
#

Yeye I know about Blender, I'm just not amazing at modeling lol

calm depot
#

I dunno, making models for inorganic objects is alright

quasi kernel
#

Is Smart UV map good enough for zomboid?

calm depot
#

start with a cuboid and start subdividing and extruding faces

#

I generally start with the smart UV map and fiddle with it until it's arranged in a way that I'll be happy to texture

quasi kernel
#

I see

calm depot
#

zomboid doesn't care

#

it's for you to arrange as you see fit

#

the smart map is just a convenience tool

quasi kernel
#

I have no clue how to do any of that but I'll figure it out as I go!1

#

I think this is an upgrade.

empty cove
#

Is it alright to use 'OnTick' event to create a timer? Or there's a way to create coroutine?

local function onTick()
  local currentTimestampMs = getTimestampMs()
  for k, v in pairs(tFunctions) do
    if (currentTimestampMs - tFunctions[k].timestampMs > tFunctions[k].properties.intervalMs) then
      tFunctions[k].properties.elapsedFunction()
      if (not tFunctions[k].properties.autoReset) then
        tFunctions[k] = nil
      else
        tFunctions[k].timestampMs = getTimestampMs()
      end
    end
  end
end
Events.OnTick.Add(onTick)
calm depot
#

can you do it? sure. Should you? almost certainly not

#

the real question is why are you implementing a timer

empty cove
#

is to call delayed functions at certain intervals.
i need it for my custom meta events. just not sure if it's the right way to do it.

#

the server don't have update event to hook so im quite troubled with it

calm depot
#

there's an event that fires every 10 in-game minutes and every in-game hour

#

oh, there also one for each in-game day

empty cove
#

how long is 10 mins in-game to real life time? i really forgot to check on this one event ๐Ÿคฆโ€โ™‚๏ธ

calm depot
#

depends on what the game speed is set to

empty cove
#

i'll take a look at it. thank you.

calm depot
#

at normal speed, 10 minutes is something like 20 seconds

empty cove
#

hmm.. i could use it for meta event timing.

#

that would be a great choice since the in-game time speed is changeable

#

it really was a hindsight on my part haha. thanks alot

calm depot
#

I'd suggest rolling once a day to decide if a meta event will happen, if it will, enable an event for the every10/hour - once it fires, have it unregister itself

empty cove
#

yeap, that's a good idea.
if i want to make a short term roguelike gameplay, what do you think is the best duration for in-game one day?

calm depot
#

depends on what you're building

empty cove
#

the gameplay is focused on one time session gameplay so i'm a bit clueless how long should i decide. should i based it on targeted session length?

calm depot
#

you're asking a game design question and currently you're the only person who knows what the game experience should be like

empty cove
#

haha, my bad. i just can't make a decision on it. will ask my friends how long they would like to play per session.

#

anyway, thanks a lot olipro. wouldn't have noticed my hindsight without you haha.

calm depot
#

you mean oversight?

empty cove
#

yeah oversight

halcyon dagger
#

does someone know if and how I can access player inventory on server? inventory seems to be empty on server script but works on client ๐Ÿค”

tame mulch
halcyon dagger
empty cove
#

You might want to work on custom server data storage for player inventories.
reason would be that, the game's architecture has not fully migrated from SP to MP yet.

  1. get the list of item ids from players when they're connected, compare and store if needed.
  2. update list if player add/remove items from their inventory.
halcyon dagger
#

yeah that's what I'm doing now and works just fine. Thanks for clearing things up ๐Ÿ‘

royal stirrup
#

anyone know a "how to make a car mod" video? i cant find it anywhere, help would be appreaciated!

calm depot
#

It isn't when you consider that inventory is basically client-side

#

Until the base game implements full server-side item accounting, I wouldn't recommend designing your mod to do any item operations on the server

#

Unless you have some compelling scenario where the server absolutely must be coordinating the item operation

shadow geyser
royal stirrup
#

hm, thanks for the info

spare kiln
#

I'm looking through the modding database at https://projectzomboid.com/modding , Does anyone perhaps know the exact snippet of code one should use for "walk to" to activate at specific x/y coordinate?

halcyon dagger
#

so I guess that would be a reasonable scenario, but I'm working with a server cache + periodic updates from client

#

and works like a charm - thx ๐Ÿ™‚

calm depot
#

Doing a Java based mod?

halcyon dagger
#

nope purely Lua only using tools provided and some linux magic ^^

fallow crescent
halcyon dagger
#

planning to share once I'm happy with it

halcyon dagger
zenith smelt
#

Are there example mods with that?
ohh nvm, I tohught it's something else

shadow geyser
woeful quest
#

Hey guys! I'm a bit new to modding PZ, more used to SupCom, and would need a little help to make a clothing mod work. I've been following a steam community tutorial (this one https://steamcommunity.com/sharedfiles/filedetails/?id=2648115890), got the items appearing in the devbug itemlist, but when equipped don't appear, same when dropped on the group with eventual map graphic glitches appearing.

This guide will provide all necessary to create a clothing mod for Project Zomboid.
Get now all clothing models in Clothing Assets !...

#

I've been using 3ds max 2019 first, thought it was maybe an export problem and tryed with newest blender version, still no model ingame, only in item listing or inventory

#

and each clothing model has the armature skinned to it

dapper tulip
#

@heady crystal hi there I have a mod suggestion for you

lime hedge
#

is there any lead on how to place bagpack attachment?? is it the offset? or does it has anything to do with the 3d model file?

#

can i do it without touching the 3d file directly?

dapper tulip
#

@heady crystal Have you seen the skyrim mod legacy of the dragonborn, it is a museum that you fill up with all the rare loot, armor, weapons that you find, is that possible?

heady crystal
#

That's beyond me I'm afraid. I don't make PZ maps.

zenith smelt
#

Anything BitBraven is making right now?

heady crystal
#

I released a new mod yesterday

#

I am working on the steering issue of the bicycles atm

zenith smelt
#

Oh cool

grim rose
#

Thats first advice i would give you

#

.x sucs ass

hidden jungle
#

is there a list somewhere with all of the zomboid definitions?
things like Player:getStats()
or PlayerStats:getHunger()

storm snow
#

Hi there, new here. I'm sure this may have been asked a lot, and I've googled but don't know which is the best/most current. What is the best guide/starting place for lua modding? I'm a software developer, but know nothing about PZ modding/APIs. Is there a simple mod that I can look through that's a good example to start with? What I've googled has directed to me to year old posts in forums and wikis that are outdated.

grim rose
# storm snow Hi there, new here. I'm sure this may have been asked a lot, and I've googled bu...

I used this to get into modding

https://m.youtube.com/watch?v=N6tZujOPnDw

This tutorial video will show you how to make a simple drink in Project Zomboid. I will go into the steps involved from start to finish. Read more below.

0:00 intro
1:08 Start
1:44 Searching for images to use in game
2:30 Searching for the Sound Effect
3:06 Creating mod file directory
3:54 Creating mod.info
4:34 Creating a poster
7:14 Adding ne...

โ–ถ Play video
#

Its not most recent, but it will get you on track

#

Also butchering other mods can help you understand how to

woeful quest
zenith smelt
random finch
#

Im trying to figure out how to determine if the object attacked is a thumpable. Any ideas? I did try this:

local function onWeaponHitZedorPlayer(_actor, _target, _weapon, _damage)
    local player = getPlayer();
    local thump = _actor:getThumpTarget();
    
    if instanceof(thump, "IsoThumpable") then
        player:Say("I found a thump!");
    end
    if instanceof(_target, "IsoThumpable") then
        player:Say("I hit a thump 2!");
    end
end
Events.OnWeaponHitCharacter.Add(onWeaponHitZedorPlayer)
storm snow
zenith smelt
#

Or if you have a specific tghumpable you can predict, check that? :S

#

I had similar issue and couldn't figure out a good solution

random finch
#

Hrmm, alright. I thought of the first suggestion but I keep thinking there has to be be an easier way. Have you messed with any of the hooks?

lime hedge
#

can we reload scripts directly when inside the game?

#

to debug stuff

weak sierra
#

yes from the debug screen if ur in debug mode

#

search for/select on right

#

then reload button to the right of the entry or at the bottom of the open script

#

note that this doesn't work for every scenario depending on when it executes what, sometimes u need to go reload all in the menu or restart the game or at least reload a save/rejoin

#

but for many things it is sufficient

zenith smelt
potent stratus
#

I just have a quick question about the bayonnets of the brita's firearm mod
How are they working ? is there a key to attack like with a melee weapon or is it the shoving who now produce xp for a melee type ?

undone crescent
#

hola! : ) anybody knows where i can find something about how the motion sensors work? i mean the code for it ๐Ÿ™‚

lime hedge
weak sierra
#

what's the best way to get rid of an existing recipe entirely?

#

base game one

#

ammocrafting mod, i've been overriding the gather gunpowder recipe but i'd rather just remove it so i can name my recipes what i like instead of being restricted to that naming to match the one i override now

heady crystal
#

Is it even possible to offset the extents of a vehicle?

#

extentsOffset seems to be completely useless

random finch
weak sierra
#

i guess i could mark it as hidden and require learning it with no book assigned, but i imagine there should be a way to programatically remove it

weak sierra
random finch
#

Its just a recipe file?

weak sierra
#

?

#

im not quite sure what you're suggesting

#

a blank recipe with the same name?

random finch
#

got yuh

#

got yuh

#

I thought you were modding another mod

weak sierra
#

no

hidden jungle
#

is there a way to detect when a player has eaten something? and what they ate?

weak sierra
#
    /*This is just to yeet the original recipe.*/
    recipe Gather Gunpowder
    {
        Hidden:true,
        Category:Firearm,
        Override:true,
        NeedToBeLearn:true,
    }```
ripe basalt
#

can anyone link a mod for managing zombie loot spawn rates? a lot of them seem to be outdated

weak sierra
#

like i can do that i guess

weak sierra
#

but check out "More Loot Settings" perhaps

#

kicks u out of the room

ripe basalt
#

ty sorry about that

weak sierra
#

๐Ÿ‘ข

#

lol

heady crystal
#

Dang I could hear it from here

weak sierra
#

so anyone got any better ideas than the shenanigans i posted above?

#

i know i can pull the recipe from lua

#

can i remove it from the table of recipes somehow?

#

for that matter i'd love to know how to programmatically add recipes to that table

lime hedge
#

tried to add attachment to the bag, is there any lead on how to fix this wrong placement?

marble lynx
#

๐Ÿคฃ

lime hedge
#

lel

marble lynx
#

I've never messed with this but maybe you can look at authentic Z's files to see how they did it

thorn bane
#

How can I make some noise at the player position to attract zombies, similar to sneezing

agile coral
#

@thorn bane ```lua
addSound(playerObj, x, y, z, radius, volume);

thorn bane
agile coral
#

I believe it's how much it gets their attention compared to other noises

thorn bane
#

Gotcha gotcha, I'll read the docs on it. Thanks!

lime hedge
quasi kernel
#

Alright, as I (potentially) prepare to set up my next mod, I have a some questions.

#

Does anybody know how to detect if a sofa / cushion chair is on a tile?

#

I imagine it would require searching through tile IDs, but I wanna make sure that it doesn't require that first.

weak sierra
#

how much information can i change on a recipe marked as Override:true

#

before it goes "this isn't the same recipe" and makes it a new one

#

because whatever that line is i think i crossed it

#

mm

#

oh nvm i was editing the wrong copy somehow.

agile coral
kindred arch
#

Is there a mod, or a way to create a mod. That limits peoples resolution to 1080p to prevent OP sight?

zenith smelt
#

Yes you can

#
getCore():getScreenWidth()

it's in media\lua\client\OptionScreens\MainOptions.lua

#

Best solution probably is to cehck the current screen width and height, display a warning and then tell the server and kick them

random finch
#

Anyone have any ideas on going about preventing a player from causing damage to a thumpable? I've tested and looked through the available events & hooks but doesn't seem like any are useful for this.

weak sierra
#

what is going on with bullet amounts and the number of items you spawn with a recipe or function

#

how come adding "200" bullets gives you "1800" bullets

#

it's like they are auto-multiplied for some reason

#

do i just need to divide everything by 9? why?

#

happens with cheat menu rebirth and with my own recipes..

thorn bane
#

Anyone know what the clothing definitions are for stuff like masks and backpacks? Trying to add the option to equip a balaclava for one of my traits but I can't find where to put it

stuck crystal
#

I have an issue with mods on my server

jaunty gate
weak sierra
#

that.. that is annoying

ivory gyro
#

how can I reload lua without leave my party ?

weak sierra
#

e.g., if count is 9 and i want 200, 200/9 is 22.22..

#

can i put 22.22 in there

#

ugh that won't even round nicely

#

why is this a feature

jaunty gate
#

Probably have to use OnCreate and do it that way. Never tried dividing the result item but I'm guessing it won't work.

weak sierra
#

i imagine it'll work if it's evenly divisible lol

#

but.. only then

#

ugh

#

or i can redefine all the items that act like this but then i have to redefine all the recipes that use them :D

#

pain in the butt

#

im already doing this just to work around another limitation in the engine

#

and im faced with another one

#

๐Ÿ™„

jaunty gate
#

Yep, it is. I just use OnCreate, spawn what is needed, then "removeitem". May not be the most efficient way (maybe someone else has a better way) but it works so far.

weak sierra
#

oh yeah i remember something i saw though

#

UseDelta on drainables

#

can i make that lower than .1

#

like .01, .001

#

etc

#

googles around

#

seems so

#

guess i can just modify the gunpowder item to make it more granular

#

i was making recipes to work around the limitation of 1 unit out of 10

#

not considering changing that

jaunty gate
#

Drainables can be lower than .1 yes. I have a few in my personal mod we run on my server. Pills and other meds mainly.

weak sierra
#

๐Ÿ™„

#

that'll involve redoing all the work i did today

#

ugh

#

thanks

sour island
#

Is there a way to profile lua functions?

random finch
#

hrmm, there really is no way to determine what object is attacked by a player? Determining if you attacked a player or zed is a none issue with Events.OnWeaponHitCharacter.

zenith smelt
#

I think so and I also think so for zombie attacks as well

#

Such as detecting if thumpable is attacked ๐Ÿ˜ฆ

weak sierra
#

oh god it creates COUNT even through oncreate

#

wth

#

i guess ill have to.. remove the extras? this is really stupid

tame mulch
weak sierra
#

i just want to make recipes that yield a single bullet, why is this so difficult to do :|

weak sierra
#

won't that mess up anything else that assumes count is not 1?

#

i guess i can do that

#

it's really odd how it's seemingly impossible to bypass this count system though

tame mulch
#

It's custom bullets or default?

weak sierra
#

combination

#

the mod runs on top of VFE

#

so it's mostly default plus two types

#

though VFE may well change the counts

#

no idea

#

can of course look

tame mulch
weak sierra
#

do i need to then change ammo unboxing recipes and such too, i assume?

#

:|

weak sierra
#

see.. that's why i didn't wanna touch it

#

kinda ripples outward..

#

i wish there were a way to just override the count

#

and do X

#

i was sure that OnCreate would let me

tame mulch
#

Why you need get 1 bullet and where?

weak sierra
#

it's an ammocrafting mod

#

and it's for recipes to craft bullets one at a time

#

i could of course craft larger groups but that's kinda weird and then i have to do tons of math to get all the numbers right

#

and i already had to do things to get gunpowder more granular and ratios to adjust the amount of gunpowder to the amount i adjusted the can to

#

it's really weird that we can't just set a container to hold "X units" and instead manipulate through UseDelta

#

and that count exists at all

#

spent all day with this xD

#

rewrote it twice already

#
function UdderlyAmmoCrafting.OnCraft9(items, result, player)
    player:getInventory():AddItem("Base.Bullets9mm")
end```
#

i was frankly stunned that this obeyed count

#

maybe there's an overload that i can specify a number

weak sierra
#

yeah

#

shocked me

#

cheatmenu mod also adds count per 1 u ask it to spawn

#

so i know it isn't just me xD

#

very odd thing for it to do

#

i can always retrieve count and remove N-1 i suppose but it's very odd to need to

#

and lots of excess work

#

so many layers of extra code just to spawn only one ๐Ÿ˜‚

tame mulch
#

Maybe just remove after 4 bullets?

player:getInventory():Remove(player:getInventory():getFirstType("Base.Bullets9mm"))
player:getInventory():Remove(player:getInventory():getFirstType("Base.Bullets9mm"))
player:getInventory():Remove(player:getInventory():getFirstType("Base.Bullets9mm"))
player:getInventory():Remove(player:getInventory():getFirstType("Base.Bullets9mm"))
weak sierra
#

im honestly a little afraid it'll try to remove count, but yeah

#

xD

#

very silly to need to do all this tho

#

to maintain compatibility ill retrieve count in case it changes

#

and do a for loop

tame mulch
#

Good way!

weak sierra
#

oh hey i can set count on InventoryItem

#

so if i instantiate that and set it to 1 then add it perhaps that'll do

#

oh

#

or i can modify the result item itself and not remove the item..

#

if that works

zenith smelt
#

Anyone know if I use a require inside a function, will it run the commands in the requried file again?

#

suchg as


function myFunc ()
    require "myFile"
end;
Events.OnGameStart.Add(myFunc);
gilded hawk
#

Which one of fellow modders made a guide that also included details regarding the loader order? In particular the order of shared, client, and server folders?

weak sierra
#
LOG  : General     , 1661985462822> java.security.InvalidParameterException: Error: Override:true is not a valid parameter in item: GunPowder```
#

it was valid

#

all day

#

or at least it didnt make the game freeze like it is now

#

on that line

#

:/

#

hm

#

maybe it's unrelated.

#

yeah if i remove that line it just.. stops there anyway loading the test save

#

ugh

#

no error

#

17% cpu probably stuck in a loop

sour island
#

X is type, n is count

weak sierra
#

i thought it'd just add count of count

#

the way things have been goin

#

thanks

#

slowly lost my mind today

#

rewriting the same recipes like 5 times

#

and now the game just crashes when my mod loads

#

with no error

ripe quarry
#

v41.73

Is there any event when an item (like food) is used/consumed?

weak sierra
#

if you literally mean event

#

they are all listed here

#

at least as of 41.65 which is still 99% accurate

#

u could probably get a relevant state from player update or something but not as convenient as u want

ripe quarry
#

oh, you mean "UseItem", it has the tag "OBSOLETE", no problem?

weak sierra
#

nah i dunno if that one exists or not anymore

#

not a good idea to use an obsolete thing

#

could potentially hook this but it's overkill

ripe quarry
#

that is why im searching for a way to check when an item is used

weak sierra
#

is this for a single certain item

#

for all food items

#

or u mean all use items

ripe quarry
#

certaim item (like candies)

#

or food in general

#

I need to get that item data

weak sierra
#

ah i found why the game was crashing

#

it only took an hour and 6 minutes

#

to find that one letter was missing from one word in one recipe

#

:|

#

please TIS, please add syntax checking pass to scripts

#

or like..

#

print which script it's loading

#

or..

#

anything

#

it cudda gone '"Gunpowde" cannot be found'

#

and even not crashed

random finch
#

What do you all think about adding a hook to WeaponHit in IsoThumpable.java?

weak sierra
#

nvm still crashin.

random finch
#

For example:

   public void WeaponHit(IsoGameCharacter var1, HandWeapon var2) {
    IsoPlayer var3 = (IsoPlayer)Type.tryCastTo(var1, IsoPlayer.class);
    Thumpable var4 = this.getThumpableFor(var1);
    if (LuaHookManager.TriggerHook("WeaponHitObject", var1, var2, var4)) 
    {
      
      if (GameClient.bClient) {
         if (var3 != null) {
            GameClient.instance.sendWeaponHit(var3, var2, this);
         }


         if (this.isDoor()) {
            this.setRenderEffect(RenderEffectType.Hit_Door, true);
         }

      } else {
         //Thumpable var4 = this.getThumpableFor(var1);
         if (var4 != null) {
...
#

Also, Anyone know of any good java modding frameworks upto date with the latest version?

wintry stag
#

hey guys, im trying to add a new item and the distributions file is driving me mad:( any tips?

weak sierra
#

use procedural distributions

#

not the loot tables themselves like old mods

#

and

#

use for loops to add things that are repetitive

#

to a list of tables

wintry stag
#

thx :))

random finch
wintry stag
#

if i use procedural distributions to add to the loottables my custom item, the file that i modify with my item needs to be renamed or stays unchanged like this?

weak sierra
#

there's no hook for java mods

#

so u have to literally have your users install it manually in the folder

#

that ain't happening for 99.9% of users

#

and legally it probably can't even come precompiled

#

so u'd have to distribute a patcher

random finch
#

For MP, definitely not ideal it seems.

weak sierra
#

to binary patch it

#

yeah it's useless

#

just suffer like the rest of us and use lua, or typescript if u want

#

:p

#

i hate lua so goddamn much xD

random finch
#

not enough exposed to LUA

#

I dont mind the scripting

weak sierra
#

yeah, ik

#

it'd be nice to change things that aren't exposed

#

there's even methods that'd expose more but they aren't exposed

random finch
#

Hrmm

#

They are using a Java server-side mod.

sour island
#

Same guy made the quest mod

random finch
#

yup

#

Then you have this Java Hook:

#

Seemingly it depends on what you are doing with the Java that determines whether you need to distribute some kinda of patch.

weak sierra
#

ok so apparently if you use >10 GunPowder in a recipe

#

it makes the game hang for all eternity with no error

#

that's fun

weak sierra
#

so, i changed GunPowder's UseDelta to .001

#

should give gunpowder 1000 uses

#

or units

#

yeah?

#

i then should be able to use well over 10 units

#

yeah..?

#
    recipe Craft45Round
    {
        ScrapMetal=1,
        GunPowder;10,
        keep [Recipe.GetItemTypes.Hammer],
        keep Wrench,

        Result:Bullets45,
        Sound:Hammering,
        Time:100.0,
        Category:Firearm,
        SkillRequired:MetalWelding=2;Reloading=2,
        NeedToBeLearn:true,
        OnCreate:UdderlyAmmoCrafting.IgnoreCount,
        OnGiveXP:UdderlyAmmoCrafting.ReloadingXP1,
    }```
#

this recipe? fine

#
    recipe Craft556Round
    {
        ScrapMetal=1,
        GunPowder;11,
        keep [Recipe.GetItemTypes.Hammer],
        keep Wrench,

        Result:556Bullets,
        Sound:Hammering,
        Time:100.0,
        Category:Firearm,
        SkillRequired:MetalWelding=4;Reloading=3,
        NeedToBeLearn:true,
        OnCreate:UdderlyAmmoCrafting.IgnoreCount,
        OnGiveXP:UdderlyAmmoCrafting.ReloadingXP1,
    }```
#

this recipe? nope, game freezes forever when it hits the script.

#

it's almost identical, i had to take a wild guess to even figure it out

#

here's the gunpowder script, just for sanity check

#
    item GunPowder
    {
        DisplayCategory = Material,
        Weight    =    0.01,
        Type    =    Drainable,
        UseDelta = 0.001,
        UseWhileEquipped = FALSE,
        DisplayName    =    Gunpowder,
        Icon    =    GunpowderJar,
        WeightEmpty = 0.01,
        WorldStaticModel = GunpowderJar,
        /*Override = TRUE,*/
    }```
#

commented that override line out as part of insane testing

#

so did i do anything wrong here, or is this a bug?

#

does UseDelta not give it more units?

#

will it work if i do GunPowder=1, GunPowder;1,?

#

tests last thing

sour island
#

You sure the bullets type is 556Bullets?

#

What is it's module?

weak sierra
#

Base.

#

ill double check

#

im pretty sure rifles are ###Bullets and pistols are Bullets##

#

yeah, old version of mod that is known working has it that way too

sour island
#

Delta use is denoted by a ;?

weak sierra
#

mhm

#
    recipe Make Meat Patty
    {
        MincedMeat;40,

        Result:MeatPatty,
        Time:30.0,
        Category:Cooking,
    }
    ```
#

vanilla example

sour island
#

Can use Delta be that small?

weak sierra
#

it can def be as small as 1

#

yeah

sour island
#

You have it as less than 1 tho

weak sierra
#

do i?

#

where

#

oh u mean UseDelta

sour island
#

UseDelta 0.001

weak sierra
#

yaeh

#

it can be

#

and that part works fine

#

if i comment out the recipes that use >10 gunpowder

#

game comes up just fine

#

recipes that remain work

sour island
#

That's true, you said the other bullets work

weak sierra
#

mhm

#

it's.. pretty damn weird

sour island
#

Any error?

weak sierra
#

lolno

#

that's the best part

sour island
#

In console?

weak sierra
#

no it just sits

#

CPU sits at 17%

#

i think it enters an infinite loop

#

damn thing

#
LOG  : Mod         , 1661993911631> mod "nattachments" overrides media/lua/shared/translate/es/itemname_es.txt
LOG  : Mod         , 1661993911633> mod "nattachments" overrides media/lua/shared/translate/es/recipes_es.txt
LOG  : Mod         , 1661993911634> mod "nattachments" overrides media/lua/shared/translate/es/tooltip_es.txt
LOG  : Mod         , 1661993911636> mod "nattachments" overrides media/lua/shared/translate/es/ui_es.txt
LOG  : Mod         , 1661993911700> loading UdderlyGuns-VFE-PPSh41
LOG  : Mod         , 1661993911706> mod "UdderlyGuns-VFE-PPSh41" overrides media/lua/shared/translate/en/itemname_en.txt
LOG  : Mod         , 1661993911708> mod "UdderlyGuns-VFE-PPSh41" overrides media/lua/shared/translate/en/recipes_en.txt
LOG  : Mod         , 1661993911723> mod "UdderlyGuns-VFE-PPSh41" overrides preview.png
LOG  : General     , 1661993911738> translator: language is EN
LOG  : General     , 1661993912461> ERROR: module "Base" imports itself
#

last bit of console.txt

#

if i make a syntax error in the item script that is alphabetically first in the mod

#

that error will show

#

then it will hang

#

so i know it's on the recipe script

#

ive very much narrowed the issue to this

#

unless there's a syntax issue in one of my last few recipes

#

goes over them

#

oh

#

maybe that's it

#

there's literally a missing }

#

i can'

sour island
#

I was going to say

weak sierra
#

i can't express how many dozens of hours

#

i lose

sour island
#

But the blocks provided were fine

weak sierra
#

to the lack of a syntax check for this damn script parser

#

i probably spend 20 hours a week

#

just trying to find out why a script breaks

sour island
#

If it makes you feel any better the bug for hanging sounds in EHE was a missing bracket around a variable

weak sierra
#

or find out THAT a script broke

#

it's a nightmare

sour island
#

The system expected a table

#

But didn't report an issue

weak sierra
#

yeah when it gives errors they never make sense, and most of the time it gives no errors

#

it's EXTREMELY rare that the script thing gives errors that are sensible

#

ok let's see if it works with >10 gunpowder values

#

now that that's fixed

#

i spent all day with working code, but giving me the wrong bullet count, i devise ways to fix that, and it started doing this

#

cuz of a typo during implementation of said fix

#

heh

#

btw i came up with a reusable thing

#
function UdderlyAmmoCrafting.IgnoreCount(items, result, player)
    result:setCount(1)
end```
#

presuming it works

#

should if result is InventoryItem

#

easier than writing separate ones

#

yeah it passed that point in the log

quasi kernel
#

I had an idea

weak sierra
#

and my trick works

quasi kernel
#

wait no idk if that'd work-

weak sierra
#

gunpowder amount seems suspiciously high tho

#

in the can

#

but hey, progress

quasi kernel
#

What would be the best way to go about making it so I can detect couches and those chairs with cushions

weak sierra
#

if UseDelta of .1 gives you 10 uses, then UseDelta of .01 should give 100, and .001 should give 1000

quasi kernel
#

TileID is one way, but it's messy would require an update every. single. time, something new is added

#

ntm tile packs

weak sierra
#

sprite name checks for keywords hue

quasi kernel
#

Better way may be to check if it's not a tileID and check if it's something you can rest on

#

But still requires updates

weak sierra
#

yeah that's not a bad idea

#

u making a patch for the true actions pack or smth?

quasi kernel
#

n

#

Making a couch searching mod hopefully

weak sierra
#

that'd be useful for that tho

#

if u come up with that bit of code

quasi kernel
#

Idea is I want people to be able to "Check between Cushions" and pull out random items for fun

weak sierra
#

it has a static list of possible sitting tiles atm

quasi kernel
#

Stuff like funny rats, remotes, screws, maybe even keys.

weak sierra
#

i'd probably just assume all couch tiles will have "couch" in their name, and let users report ones that don't

#

tbqh

#

the list of ones that don't is likely short af

#

check for restable + couch in sprite name

quasi kernel
#

That works

#

Only thing im worried about is like

#

The chairs with cushions

weak sierra
#

they aren't couches

#

unless u WANT them

quasi kernel
#

because reasonably you should be able to search those too

#

but idk

weak sierra
#

yeah that's not as easy

#

but IRL that's less liekly to have stuff in it

#

u feel it against chair wood/metal under the cushion

#

and it can fall out more easily

#

more likely to hit floor

#

etc

quasi kernel
#

Valid

#

Maybe couches are just the way to go here

weak sierra
#

def easier to heuristically detect by name l.ol

quasi kernel
#

No clue how to check sprites yet but I'll figure it out me thinks

weak sierra
#

that

#

hm

quasi kernel
#

I'd just use some string.find stuff for the name yea?

weak sierra
#

i've worked with that before but it was with an action not a context menu

#

i did it on sledge destroyu

#

to do checks before letting someone

#

whitelist of what u can sledge by sprite

quasi kernel
weak sierra
#

there's a getSpriteName() on IsoObject

#

i think

quasi kernel
#

There is that one mod that lets you get the funny uhhh

#

Fixes on those broken floorboards

weak sierra
#

u could iterate all objects on the square

#

and then do getSpriteName and restable checks

#

and if one exists

#

add context menu item

#

tied to that one

quasi kernel
#

Now for the big question

#

How do I associate one part of the couch

#

with a couch

#

So you don't get 2x as much looting

#

from a couch

weak sierra
#

i think there's a system that ties multi-sprite objects together

#

i dont know much bout it

#

but that said

#

there's more cushions to loot the longer it is

#

kinda makes sense to let them

#

just reduce loot per tile

#

and then if it's 2 long u get 2x, and 3 long u get 3x

#

etc

quasi kernel
#

Is there even 3 long couches?

weak sierra
#

i dont think so

#

but there could be'

quasi kernel
#

hm fair point

weak sierra
#

that said, just halve whatever u were planning to give?

#

unless u meant one item per couch

#

in which case that's hard

#

lol

#

half chance then

quasi kernel
#

I'm thinking like 2~3 per couch

weak sierra
#

then 1-1.5 per tile

quasi kernel
#

so it could round to 1 or 2

weak sierra
#

mhm

#

whats ur workshop link i wanna watch what u put out and see ur battery thing, assuming that's out

weak sierra
#

no powered recharger? :p

quasi kernel
#

Not yet

weak sierra
#

;3

quasi kernel
#

Though imo probably wouldnt be as useful tbh

weak sierra
#

u'd be surprised

#

my server is super super low loot, i can find more batteries but im lazy, i'd rather throw them in a recharger at home

#

xD

#

as long as it could do multiple

#

a fancy UI with like 6 battery slots would be nice but not too many ppl wanna fuck with UI

quasi kernel
#
  • Would soak up generator power
  • Isn't nearly as portable
  • Regular hand crank is already fast enough
#

Vs the chad hand crank:

weak sierra
#

valid but at that point it's just an infinite battery isn't it?

quasi kernel
#

Not necessarily

weak sierra
#

hand cranks take ages irl

quasi kernel
#

You have to keep your exhaustion in check

#

Hm valid

#

I could look into extending the time, it wouldn't be hard

weak sierra
#

sandbox-configurable wind time

quasi kernel
#

Rn it's 10 in-game minutes but theoretically and hour could work

weak sierra
#

and electric charger option

#

:D

quasi kernel
#

And electric charger would be epic but I'd need your help for it tbh

weak sierra
#

i will help if i can

#

i'd use the mod on my server if it had those two features

quasi kernel
#

How do I go about the sandbox config?

weak sierra
#

u add a text file that defines the sandbox options at a certain folder depth of ur mod

#

and then u add translation strings in the translation folder in the lua/shared/translate

#

Sandbox_EN.txt

#

that defines the text and tooltips for them

#

and then u reference in code with SandboxVars.MODNAME.THING

#

ill link u to one of mine that is relatively simple

#

the mod isn't simple but the sandbox options are

#

and using them in code is just as simple as i said above

quasi kernel
#

So just like

#

SandboxVars.BetterBatteries.CrankTime

#

then my heccin formula

#

I'm also tempted to tie the makeshift crank to an exisitng vanilla magazine but idk about it yet

#

Might even make a custom magazine for it

weak sierra
#

mhm

#

magazines are easy

jagged ingot
#

:kirby: hiiiii

weak sierra
#

i've done dynamically populated magazines lately

#

heh

quasi kernel
#

Now for my mod update list:

  • Add custom recipe magazine for learning to make the Makeshift Crank
  • Add 3D models to existing cranks + new magazine (woa!)
  • Add Electric Battery Charger (4 slots, custom ui?)
  • Add Sandbox options for endurance loss and crank time
jagged ingot
#

Seems like you've gotten yourself knee-deep in modding.

quasi kernel
#

apparently

jagged ingot
#

Heh..

quasi kernel
#

This is it?

#
option UdderlyUpToDate.RestartDelayMinutes = {
    type = double, 
    min = 0,
    max = 60,
    default = 5,
    page = UdderlyUpToDate, 
    translation = UdderlyUpToDate_RestartDelayMinutes,
}
#

@weak sierra

weak sierra
#

that's one of them yeh

quasi kernel
#

I assume "int" is another type

#

Not that I particularly need it, just curious

weak sierra
#

@sour island so no broken now, but turns out "GunPowder;24," means "1" unit somehow? lmao i cant get a break

weak sierra
quasi kernel
#

Will it automatically add the pages?

weak sierra
#

if ur unfamiliar with such things

#

"number that is not capable of having a decimal"

weak sierra
quasi kernel
#

I know what an int is reee!1

#

Hehe

weak sierra
#

oh i thought i had int there

#

and u were like "is int a type? hurr"

quasi kernel
#

Yoo you have an axe now

weak sierra
#

:p

#

oh yeah

#

neat

quasi kernel
#

You only have doubles so I was curious what int was represented as

#

Like "int" or "Integer"

#

Cuz it varies

#

Usually int but yknow

#

Programming be bleh sometimes

weak sierra
#

i come from c# world which is "microsoft redesigned java to be better"

#

so i assume the fact that it seemed natural to me is due to this

#

lol

quasi kernel
#

I'm familiar with java and a bit of C#

#

I wanna get better at C# but at the same time its like

#

Do I really need to? I'm not heading into the programming field so

#

Most I'd probably use it for is unity

weak sierra
#

i have a server where i teach it and help ppl if u want an invite to there

quasi kernel
#

ye s

weak sierra
#

got some stuff to do ima afk for a bit.

#

im bak goes back to fighting with gunpowder units

quasi kernel
weak sierra
#

so

#

how come all of these recipes with >1 gunpowder unit assigned in game are all 1 unit

#

example

#
    recipe Craft762Round
    {
        ScrapMetal=1,
        GunPowder;24,
        keep [Recipe.GetItemTypes.Hammer],
        keep Wrench,
    
        Result:762Bullets,
        Sound:Hammering,
        Time:100.0,
        Category:Firearm,
        SkillRequired:MetalWelding=4;Reloading=5,
        NeedToBeLearn:true,
        OnCreate:UdderlyAmmoCrafting.IgnoreCount,
        OnGiveXP:UdderlyAmmoCrafting.ReloadingXP1,
    }```
#

AmIDoingItRiteโ„ข๏ธ

quasi kernel
#

@weak sierra Maybe it's from the gunpowder use delta?

#

That's my best guess anyways

weak sierra
#

i set that to UseDelta 0.001

#

to get a 1000 unit per can

#

precisely so that i could have larger values

#

and not just eat a can instantly

#

also not sure why the gunpowder weighs .01 when it has 176 units in it

#
    item GunPowder
    {
        DisplayCategory = Material,
        Weight    =    0.01,
        Type    =    Drainable,
        UseDelta = 0.001,
        UseWhileEquipped = FALSE,
        DisplayName    =    Gunpowder,
        Icon    =    GunpowderJar,
        WeightEmpty = 0.01,
        WorldStaticModel = GunpowderJar,
        /*Override = TRUE,*/
    }```
#

since minimum weight in pz is .01 i made it .01 which i think is per unit.. so it should be heavy..? idk

#

anyway that's not my primary concern

quasi kernel
#

Evelyn do you think I should implement a "penalites enabled" bool?

#

Also, would it use "bool" or "boolean"

#

@weak sierra sorry for so many pings aa

weak sierra
#

what does that mean

#

penalties enabled

#

u mean the tiredness?

#

u could

quasi kernel
#

Depression / Low Endurance

weak sierra
#

some ppl might want that off yeah

quasi kernel
#

Tho I wanna figure out how to add a bool setting

weak sierra
#

could even make each one be its own box

#

yeah i think it's "boolean", been a minute tho

quasi kernel
#
option BetterBatteries.HandCrankPenalties = {
    type boolean,
    default = true,
    page = BetterBatteries,
    translation = BetterBatteries_HandCrankPenalties
}
weak sierra
#

mhm

quasi kernel
#

it no workie..

weak sierra
#

then maybe it's bool, idk

#

im gonna play for a bit

#

u restarted game right?

#

sandbox options aren't part of the lua

#

iirc

quasi kernel
#

mfw

weak sierra
#

scripts dont reload without restarting really either

quasi kernel
#

lovely

weak sierra
#

i've heard some ppl imply they should

#

but

#

sometimes they do

#

u know u shud just disregard me i spent 16 hours fighting recipes and im burned out af

#

im not even sure if i know what im talking about anymore

quasi kernel
#

NEITHER WORKS

weak sierra
#

im sure one of my mods has a boolean but im too dead to remember which

#

:D

#

oh

#

the reading xp one

#

go poke that one

#

it has a checkbox for needing light to read

quasi kernel
#

IT IS TYPE BOOLEAN

#

IT JUST HATES ME

weak sierra
#

if anyone knows why gunpowder units >1 are interpreted as 1 by the game..

#

is ;N not correct for units?

quasi kernel
#

Genuinely can't figure out why it's not loading the boolean option

#

found it

#

i forgot

#

a freaking

#

= sign

#

@weak sierra kill me now

weak sierra
#

lol

#

at least it wasn't 5 hours for a missing "}" like i had

#

just 1 hour

#

:D

teal basin
#

anyone know some good mod combos

wet osprey
#

anyone know a mod that allows you to build above yourself?

want to make a simple roof to shelter from the snow, something like this

#

and for a nomad run, its overkill to get carpentry lvl > get 15 planks > build stairs > go up and build floor > find sledge hammer > destroy stairs

#

like, it makes sense that our characters could make something like this for shelter but I would take roof above head if nothing else

weak sierra
#

@teal basin @wet osprey this is the wrong channel for this, this is where modders chat about making mods.

#

though i must say grafo your question was very well documented

young grotto
#

Hi, I'm trying to edit the erosion settings which will enable me to disable trees from spawning at all.

#

I found in the decompiled code, there is ErosionCategory for each nature stuff

#

I'm trying to edit NatureTrees spawnChance value to 0

#

how do I translate that to lua?

#

I apologize, I'm new to lua modding

#

Any help would be greatly appreciated, thanks in advance

#

the code that I found is from this

#
    private int[] spawnChance = new int[100];```
wet osprey
undone crag
wet osprey
cedar anvil
#

Does anyone know where I could find an oven cooking script? I want to make cookable food.

#

maybe it relates with BadCold = true,

shadow geyser
cedar anvil
#
        GoodHot = true,
        IsCookable = TRUE,``` Oh! Thank you!!
#

Um does cooked&burnt food have item_id?

young grotto
mystic rampart
#

Trying to make a mod to add skill books for agility/combat, but in game my BookTitle comes up with "Tooltip_BookTitle_<name under DisplayName>". Can't seem to find a reference for this on the forums

ancient grail
#

how do i call a audio function triggered by oncreate recipe
something that wil play even if a player moves and cancel the action

i want to make an alarm sound on our capture flag event

wintry stag
#

hey, someone can give me some advise about ProceduralDistribution Table not Working?

I just changed the fridges, added one item.

        rolls = 1,
        items = {
            "Burger", 6,
            "Burrito", 10,
            "Corndog", 10,
            "Fries", 6,
            "Hotdog", 6,
            "MuffinFruit", 10,
            "MuffinGeneric", 10,
            "Pizza", 6,
            "Pop", 6,
            "Pop2", 6,
            "Pop3", 6,
            "PopBottle", 6,
            "PopBottle", 6,
            "WhiskeyFull", 2,
            "NukaCola", 20,
        },
        junk = {
            rolls = 1,
            items = {
                
            }
        }
    }

something like that.

#

but in every item

#

the result is loot not spawning :)

#

any help? thx::))

#

and I just realised with necroForge i can spawn the item, so its 100% a procedural Table problem

grim rose
#

It doesnโ€™t work this way

#

I would use Table inserts

wintry stag
#

could you explain me how does that work?

grim rose
#

I would love to but i am afar from pc rn

#

But you can look it up in other poeple mods

#

If you want look it up from my mod

#

Okay i found one @wintry stag

#

So

#

require 'Items/ProceduralDistributions'

--PROCEDURAL DISTRIBUTIONS

---["list"]["xplace"]
table.insert(ProceduralDistributions["list"]["xplace"].items, "modID.item");
table.insert(ProceduralDistributions["list"]["placeX"].items, 10);

#

First is declaration where you add insert to list, second is chance

wintry stag
#

so this in a lua file?

grim rose
#

Call it dist.lua or something

wintry stag
#

at lua\server\items right?

grim rose
#

In your case i see its from tutorial

Do


require 'Items/ProceduralDistributions'

--PROCEDURAL DISTRIBUTIONS

---["list"]["MotelFridge"]
table.insert(ProceduralDistributions["list"]["MotelFridge"].items, "Nuk.NukaCola.");
table.insert(ProceduralDistributions["list"]["MotelFridge"].items, 10);```
wintry stag
#

god

#

i love you

#

ill look it up at a mod so i get things better, but thx man :)))

untold junco
#

Is there anything more than the mod.info require= param to extend an existing mod?

grim rose
#

That it

#

Nothing else

wintry stag
#

btw

#

the ["list"] what does it do?

grim rose
# wintry stag the ```["list"]``` what does it do?

Inserts it here

        rolls = 1,
        items = {
            "Burger", 6,
            "Burrito", 10,
            "Corndog", 10,
            "Fries", 6,
            "Hotdog", 6,
            "MuffinFruit", 10,
            "MuffinGeneric", 10,
            "Pizza", 6,
            "Pop", 6,
            "Pop2", 6,
            "Pop3", 6,
            "PopBottle", 6,
            "PopBottle", 6,
            "WhiskeyFull", 2,
            "NukaCola", 20,
        },
        junk = {
            rolls = 1,
            items = {
                
            }
        }
    }
#

And to other places too

wintry stag
#

i see

#

so i can create a loop

grim rose
wintry stag
#

to change the ["MotelFridge"]

untold junco
wintry stag
grim rose
wintry stag
#

ok :))

#

thx @grim rose :)

grim rose
#

Also

#

Make spacws

#

require 'Items/ProceduralDistributions'

--PROCEDURAL DISTRIBUTIONS

---["list"]["xplace"]
table.insert(ProceduralDistributions["list"]["xplace"].items, "modID.item");
table.insert(ProceduralDistributions["list"]["placeX"].items, 10);

---["list"]["xplace"]
table.insert(ProceduralDistributions["list"]["xplace"].items, "modID.item");
table.insert(ProceduralDistributions["list"]["placeX"].items, 10);

#

Like this

#

If you forget space between spawn 1 and 2 there will be error

grim rose
untold junco
#

`LOG : General , 1662035943446> 561,563,192> Workshop: item state CheckItemState -> Ready ID=2850054689
LOG : General , 1662035943447> 561,563,193> 1662035943447 znet: Java_zombie_core_znet_SteamWorkshop_n_1GetItemInstallFolder
LOG : General , 1662035943448> 561,563,193> Workshop: 2850054689 installed to E:\Steam\steamapps\common\ProjectZomboid\steamapps\workshop\content\108600\2850054689

WARN : Mod , 1662035958521> 561,578,266> ZomboidFileSystem.loadModAndRequired> required mod "DRACasino" not found Any reason Im getting this error ?

grim rose
#

@untold junco have you placed you mod in c:/users/zomboid/workshop?

untold junco
wintry stag
#

can someone check this lua code? it works but i get a final error every time. Here you have the code and the error ```function tableInsertPlaceAndItem(place)
i = 1
repeat
print("Inserted "..string.format(place[i]).." to the table")
i = i + 1
until(i < 2)
end
tableInsertPlaceAndItem({"MotelFridge","BakeryKitchenFridge"})

#

i dont get where the error is coming

quasi kernel
#

What's the string.format for?

stone flame
#

So how hard is it to add a new cooking items

#

like a new food

quasi kernel
#

@wintry stag

#

Are you sure you're not trying to use tostring()..?

#

iirc string.format is for stuff like string replacement, not converting a variable to a string.

wintry stag
#

let me test it

#

aright now it works:))

#

thx:))รง

empty cove
#

@weak sierra
are you still looking for a way to remove all existing recipes?
have you tried the reflection methods on scriptmanager instance?
it might introduce unknown behaviors so, you might want to check on how the crafting UI works at least.

wintry stag
#

Does this code has any errors? I cant find my custom item inside Motel Fridges.

table.insert(ProceduralDistributions["list"]["MotelFridge"].items, 100); ```
grim rose
#

@wintry stag

wintry stag
#

aright

#

so

#

now its like this my code ```require("Items/ProceduralDistributions")

function initDistribution()
table.insert(ProceduralDistributions["list"]["MotelFridge"].items, "NUK.NukaCola");
table.insert(ProceduralDistributions["list"]["MotelFridge"].items, 100);

table.insert(ProceduralDistributions["list"]["SpiffosKitchenFridge"].items, "NUK.NukaCola");
table.insert(ProceduralDistributions["list"]["SpiffosKitchenFridge"].items, 100);

end

Events.OnGameBoot.Add(initDistribution);```

#

gonna try it

wintry stag
# grim rose Check if

btw idk if its normal and i cant find a clear answer, but i get the error 1 at the bottom right corner every time i get into a new game for testing

grim rose
#

Ctr f -> modID

#

And copy error name

wintry stag
#

ok

#

i just found this

#

anything else

wintry stag
#

i wanna cry

#

thx for all the help btw :)

grim rose
#

I donโ€™t have it in mine dist and it is working

wintry stag
#

you mean

#

this?ยฟ

#

table.insert(ProceduralDistributions["list"]["MotelFridge"].items, 100);

#

or the spiffo's one?

grim rose
#

Events.OnGameBoot

#

This one

wintry stag
#

so i remove the hole function?

#

like this

grim rose
#

Yes

wintry stag
#

i just tested that

#

doesnt work

grim rose
#

Still getting error on game start?

wintry stag
#

error its always

#

and not spawning item also always

grim rose
#

Not nice, can you get whole error?

grim rose
#

Because it will say whats is wrong

grim rose
wintry stag
#
LOG  : Mod         , 1662045194611> 2x version of perts_basement.pack not found.
LOG  : Mod         , 1662045194616> loading NecroForge
LOG  : Mod         , 1662045194750> loading NUK
LOG  : General     , 1662045194790> AngelCodeFont failed to load page 0 texture D:/Program Files ``` this?
grim rose
#

Do you have file hierahy right?

wintry stag
#

yeah

grim rose
#

I may know the dumbest way to โ€žfix itโ€

#

Try changing its name

#

Name of dist.lua

#

I know it doensโ€™t make sense

#

But once it worked for me so it doesnโ€™t hurt to try

weak sierra
#

if you have something to point me at i'd definitely be interested

#

ive not poked reflection

#

im used to it from C# in concept

weak sierra
#

can someone explain to me what Ingredient=N, vs Ingredient;N means in recipes? I thought the former was full item count and the latter was units for fillables, but for GunPowder the latter ended up stuck as "1" every time no matter what N was and the former ended up doing units.

quaint mirage
#

Random question., about the lighter mod i put together. If i want it to override the smoker mod while its activated, how does one do it? Is it just a case of load order or anything code specific?

quasi kernel
#

Now for my mod update list:

  • Add custom recipe magazine for learning to make the Makeshift Crank
  • Add 3D models to existing cranks + new magazine (woa!)
  • Add Electric Battery Charger (4 slots, custom ui?)
    - Add Sandbox options for endurance loss and crank time
#

One down, three to go.

quaint mirage
#

Looks like I've compatibility work to do on this, the lighter refuels but it creates a separate Empty Lighter, if i support that it should work

cedar anvil
#

Does anyone know how to add baked/burnt food images on food items? It seems the baked/burnt item id does not exist.

dapper geode
#

Hey just want to ask, is that okay if i change 'VERSION = 1' on my sandbox-options.txt ?

#

and is anyone know what is the function? because after i change the version to 2 or 3, it's ended with sandbox options not loaded on server

shadow geyser
#

it will look like something like this

attempted index: items of non-table: null  <- important

LOG  : General     , 1652792922933> -----------------------------------------
STACK TRACE
-----------------------------------------
function: insertItemListsInDistribution -- file: HCDistributionFunctions.lua line # 207 <- these are important too
function: Distributions_HC.lua -- file: Distributions_HC.lua line # 494 <- these are important too

ERROR: General     , 1652792922933> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: items of non-table: null at KahluaThread.tableget line:1689.
ERROR: General     , 1652792922933> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: items of non-table: null
    at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
LOG  : General     , 1652792922933> -----------------------------------------
STACK TRACE
-----------------------------------------
function: insertItemListsInDistribution -- file: HCDistributionFunctions.lua line # 207
function: Distributions_HC.lua -- file: Distributions_HC.lua line # 494

weak sierra
weak sierra
weak sierra
weak sierra
#

afaik

#

repeats her question

#

can someone explain to me what Ingredient=N, vs Ingredient;N means in recipes? I thought the former was full item count and the latter was units for fillables, but for GunPowder the latter ended up stuck as "1" every time no matter what N was and the former ended up doing units.

weak sierra
#

as long as u give credit

quaint mirage
# weak sierra load order and for recipes/items setting "Override:true" and "Override=TRUE" res...

I've found a fix for it, i allowed SMEmptyLighter to be picked up and it works with it now

if (item:getType() == "EmptyLighter" or item:getType() == "SMEmptyLighter") then
    local hasDrawnEmptyLighterRefill = false;
    for x = 0, playerInv:getItems():size() - 1 do
        local vItem = playerInv:getItems():get(x);
        if (vItem:hasTag("Petrol") or vItem:getType() == "PetrolCan") and vItem:getUsedDelta() > 0 then
            if hasDrawnEmptyLighterRefill == false then
                local fuelSource = vItem;
                context:addOption("Refuel Empty Lighter with " .. vItem:getName(), item, CraftAndRefillLighters.doFillEmptyAction, player, fuelSource);
                hasDrawnEmptyLighterRefill = true;
            end
        end
    end
end

weak sierra
#

idk what ur mod is doin i didnt read all the context, but glad u figured something out thumbsUp

#

grats

weak sierra
#

is the data for when a cell was last visited and when a chunk was last "seen" exposed to lua?

#

i see IsoGridSquare has an hourLastSeen

#

so i guess u have to make an IsoGridSquare for a given cell? im not super familiar with these classes yet

#

hm looks like that's just one square (i knew that, boy i spaced out)

#

IsoChunk has "visited" and "seen" doubles

#

hm the visited and seen doubles in the docs aren't on IsoChunk in the decompile

quasi kernel
#

Magazine I might just re-use the in-game model but retexture it

#

I appreciate the offer tho!!

#

Might consider it anyways lol

weak sierra
#

ive only done one model myself, but it was easy enuff

#

im sure u can do

quasi kernel
#

I'm just worried about the UV mapping and painting tbh

mystic rampart
#

How do I reference textures that I created for items? I thought it was simple as creating textures/Item_<name>.png, then referring to it from scripts like Icon = <name>, but my game is frozen on reloading lua

mystic rampart
rough dew
#

In follow up on yesterdays question by rathner, made this to tackle 2k and 4k OP sight

#

Method calls on Playermove, i can change that and will implement a mssg thrown as well.

#

Its my 1st Lua work, im a .NET dev, so dont go full stackoverflow on me plz

#

basicly forces you in 1920*1080, full clientside

#

any thoughts?

#

and thx to HamsterCute for putting me on the right track, if you have a steam handle i will gladly credit you

#

people with 4k and 2k monitors can see way further then 1920 users, hence unbalancing PVP/multiplayer

#

im tempted to call on PlayerRender, but bit affraid that might cause hickups on the actual moment you join

zenith smelt
#

You won't need to call it that often XD

rough dew
#

can i call it somehow after the connect and1 st player render?

zenith smelt
#

And you shouldn't force them into fullscreen

rough dew
#

i will gladly take any suggestions, i normally write c#

zenith smelt
#

There are lots of events and you can probably also edit the menu code so wehn they close the menu

#

OnGameStart woudl be nice

rough dew
#

Yes, but the game tends to lag a bit when you 1st enter, thats why i didnt do that. Thought changing the res then might cause crashes on low end systems

zenith smelt
#

Yeah you shouldn't really change resolution XD

#

Instead just display a message or sth

rough dew
#

i'd rather keep the server out of it, so rather no kicks

#

maybe forcedisconnect

#

mssg, sleep and force?

zenith smelt
#

There's sleep?

#

It will execute every minute.
Just warn and then yeah disconnect

#

media\lua\client\OptionScreens\MainScreen.lua

random finch
#

Anyone know of a way to get ISObject info on objects that you hit or target? Pretty much just want to determine if the object the player hits is thumpable or not.

rough dew
#

ok, will fix tomorrow and will credit you on steam. thx

zenith smelt
#

Ohh it's okay no credit needed ๐Ÿ˜„

random finch
#

Pretty much any type of object information on objects that you hit.

#

I have only managed to get target/hit info on zeds & players

zenith smelt
#

ohh noo, I tried too, couldn't

#

Do you know what your target may be?

#

I ended up saving the object

random finch
#

I dont. The closest i can get is square info on click. From there I can possibly determine which objects exist but then it doesnt work since players can attack objects without directly clicking the object.

zenith smelt
#

What's the full mechanic you're trying to do?

random finch
#
if player attacks thumpable end
--DO SOMETHING
end
#

havent really thought out the full mechanic until I figured out if this was even possible.

#

Tried this but getThumpTarget() results in nil when attacking a thumpable.

local player = getPlayer(); 
local thump = player:getThumpTarget();
if thump ~= nil then
    player:Say("Attacked a thumpable");
end
wintry stag
# grim rose Name of dist.lua

ill put like popcorn or something random and ill try it, sorry for not answering didn't had time but thx @grim rose i apreciate a lot ur help :))))))))

grim rose
wintry stag
#

:))))

grim rose
wintry stag
#

still not working @grim rose :((

grim rose
#

Hmm if you want i can send me 7zip of that mod

wintry stag
grim rose
#

Dm

wintry stag
#

aright

storm snow
#

Hello, Where can I find documentation on recipe function signatures? I see recipe's have: OnCreate, OnGiveXP and OnTest, but I don't fully understand what's there. I've seen some mods like AuthenticZ and found one signature used with OnGiveXP:

function AZRecipe.OnGiveXP.Tailoring20(AZRecipe, ingredients, result, player)
    player:getXp():AddXP(Perks.Tailoring, 15);
end

Is there any documentation out there that describes what OnGiveXP and other functions signature is?

I've tried google, the wiki, light searching here for "OnCreate" and the https://projectzomboid.com/modding/ site, but I haven't been able to pin point it.

jagged ingot