#mod_development

1 messages ยท Page 25 of 1

weak sierra
#

Object tried to call nil

#

hm

#

now im thinking it's not an IsoObject or it's got some other nonsense

quasi kernel
#

This is def one way, however it's.. not optimal.

#

Main reason being, well, it isn't compatible with other mods that override the same file.

#

Is it likely people will override it? Nah. Possible? Yes.

steep onyx
#

So what do I do?

quasi kernel
#

I believe DoParam exists (?) which allows you to dynamically set stuff like that via code

weak sierra
#

it does

quasi kernel
#

I've only seen it once or twice so I have 0 clue how to use it

weak sierra
#

it's used by item tweaker

#

so

#

it's all over

quasi kernel
#

I see

#

Either way though, dynamically changing it is your best bet.

weak sierra
#

have to use it before the item is instantiated tho

quasi kernel
#

Prob on game boot yeah?

weak sierra
#

can't do it live once it's been instantiated

#

if u do it in shared lua

#

is usually fine

#

scripts can instantiate items

#

and some do

#

like loot scripts

#

sometimes

#

time decreases loot for example

quasi kernel
#

I like how it's usually and sometimes with zomboid

weak sierra
#

or other mods that might tweak the item

willow estuary
#
local item = ScriptManager.instance:getItem("Base.PetrolCan")    
if item then 
    item:DoParam("AttachmentType = Gas")
end

That's it. Just do it this way in the shared or server directory somewhere in a lua file.

weak sierra
#

yup

steep onyx
#

man im too stupid for this

weak sierra
#

xD

glad ridge
#

I was too

quasi kernel
#

We all were!1

#

And sometimes still are (me)

steep onyx
#

I feel like theres this modding menu you guys know about lol

quasi kernel
#

Not really, it's all done via scripts and lua.

weak sierra
#

means to use getObjectName, types getItemName and it fails

#

derp

glad ridge
quasi kernel
#

That's really how most, if not all of us learn.

glad ridge
#

I do have a lil Java under my belt but it was pretty much following other people's mods

quasi kernel
#

Don't feel too bad about being lost at the start by the way, it's normal.

steep onyx
#

at this stage, how can I have it effect happiness

quasi kernel
#

Flote is that a txt file?

glad ridge
#

I spent 6 hrs the other day on a mod that should have took me 5 min to make but I missed a capital R and had an extra category in the recipe

steep onyx
#

yes.

quasi kernel
#

Alright, hold on.

steep onyx
#

Should it not be?

quasi kernel
#

I'm gonna guide you to where you need to be for that to work, mkay?

steep onyx
#

Is there something else I could use

quasi kernel
#

I mean, technically notepad works, but I doubt you wanna put yourself through that agony.

glad ridge
#

That's prolly gonna be a lua

steep onyx
#

I dont

glad ridge
#

Not txt

quasi kernel
#

^

steep onyx
#

I dont want to be in agony

quasi kernel
#

One step at a time doh

#

Hehe understandable

#

I personally use a program called VSCode

#

(Visual Studio Code)

glad ridge
#

Notepad++ works for me but I'm sure vs is better

quasi kernel
#

It helps to format everything all nice and tidy once you get the right extensions for it

steep onyx
#

and yoink im stealing that

weak sierra
#

i use scite mostly

quasi kernel
#

Anywho, you'll need to create a new .lua file in order to actually run lua code.

weak sierra
#

crossplatform works with any language etc

steep onyx
#

okay 1s

quasi kernel
#

And before that, we need to make sure that file is in the right place.

steep onyx
#

how do i make a lua lol

quasi kernel
#

Your best bet for setting up a mod is by going to C:\Users\USERNAME\Zomboid\Workshop and copy pasting the ModTemplate file there.

weak sierra
#

a lua file is just a text file with .lua instead of .txt

#

really

quasi kernel
#

Yeup basically

steep onyx
#

OH

#

sorry caps

weak sierra
#

code and text are just plaintext files

steep onyx
#

okay ive got it open now what

quasi kernel
#

I think you can just do "Save As" and put .lua at the end iirc

#

Alright, you copy pasted the template mod yeah?

steep onyx
#

yes

quasi kernel
#

Alright.

#

There's some things in there we'll need to change before we can actually have a place to put it.

steep onyx
#

okay

quasi kernel
#

The reason? It's a test map mod for the template.

weak sierra
#

last modding community i was in i wrote the template that ended up being given out :p

#

i dont envy u doin this over and over to help diff people

#

lol

steep onyx
#

like a reason im making this?

weak sierra
#

you have to put up the scaffolding

#

before u can build a building

#

this is the scaffolding ur working on

quasi kernel
#

Yeye

#

Don't expect me to do this every time, I've just got some down time hehe

steep onyx
#

I just want popcorn to make you happy tbh

quasi kernel
#

Alright so..

steep onyx
#

btw thanks for helping

quasi kernel
#

Rename your new "mod" file to whatever you want for now

weak sierra
#

Object's name is "Thumpable" (sprite name "furniture_storage_01_46").

quasi kernel
#

Np!!

weak sierra
#

god dammit

#

that is not useful game

steep onyx
#

Already did

weak sierra
#

๐Ÿ˜‚

quasi kernel
#

Okay perfect

#

You'll want to go down into "Contents" and edit your "mod" file really quick.

#

You're a smart cookie, so I have a feeling you'll be able to edit that with relative ease.

steep onyx
#

im in the contents

quasi kernel
#

Just change the name in there for now so we can identify and enable the mod later in-game.

steep onyx
#

if so i already did change the name

quasi kernel
#

Okay perfect.

#

Look at you, already gettin ahead hehe

#

Alright

steep onyx
#

lol

quasi kernel
#

Now pop open our "media" folder

#

You're gonna notice "maps", we don't need this.

steep onyx
#

i dont have maps only scripts

quasi kernel
#

Oop?

#

That's alright then.

#

We might be interacting with different templates but it should work all the same iirc

steep onyx
#

okay

quasi kernel
#

You can remove the "scripts" folder, we won't need it.

#

(If we were doing it the cheap route, we would, but we're doing it the snazzy way!)

steep onyx
#

okay

quasi kernel
#

Alright, now we're going to make a new "lua" folder

steep onyx
#

got it

quasi kernel
#

In there, we'll put another folder called "shared"

steep onyx
#

okay

quasi kernel
#

Then, at long last, that's where you can plop down your newfound lua file.

steep onyx
#

a blank one or the one i already had

quasi kernel
#

Either or, so long as it's a .lua file.

#

You'll need the code Blair sent anyways.

steep onyx
#

okay

weak sierra
#

@quasi kernel getContainer():getType() was the thing to use

#

for future reference

quasi kernel
#

Thank

weak sierra
#

im sure ull run into it eventually too lol

steep onyx
#

okay ive got the code

quasi kernel
#

Perfect, if you have VSCode now, we can set that up with a single extension so it'll recognize parameters and the like.

steep onyx
#

okay

#

ive got vscode

quasi kernel
#

Literally all you'll need is the "Lua" extension but sumneko

#

VSCode should make adding extensions a piece of cake, though if you need help I'm happy to assist.

steep onyx
#

where do i go

quasi kernel
#

You'll see these buttons to the left, the bottom one is for extensions.

steep onyx
#

oka

quasi kernel
#

Then you should just be able to type "Lua" in "Search Extensions in Marketplace"

steep onyx
#

first one?

quasi kernel
#

Whichever is made by sumneko

steep onyx
#

okay got it

quasi kernel
#

I believe it's the top one, but do check.

#

Perfect, alright.

#

Now go ahead and pop open your snazzy lua file in VSCode

steep onyx
#

okay

#

got it

quasi kernel
#

Perfect!

#

Look at you go, mastering this in such a short timeframe when it took me days

#

Alright, now for the fun part, programming!

steep onyx
#

i mean I am being helped

quasi kernel
#

Fair point.

steep onyx
#

okay im ready

quasi kernel
#

Alright.. so now lemme read up a tad.

steep onyx
#

okay

quasi kernel
#

Gotta figure out what the parameter is called that we'll be editing

steep onyx
#

im gonna quickly get some soda

quasi kernel
#

Found it, it's called "UnhappyChange"

steep onyx
#

okay im back

quasi kernel
#

You'll notice this is unhappy change, so giving it a positive value will do the opposite of what we want.

#

So we'll need to give it a negative value.

steep onyx
#

okay

quasi kernel
#

In your script, edit the :DoParam() to make it into a "UnhappyChange = " setup

#

You can put your chosen value in after the =

#

(Remember to make it negative!)

steep onyx
#

including setup?

quasi kernel
#

?

#

You lost me there hehe

#

ohh wait

steep onyx
quasi kernel
#

no I see

#

Yeah no don't worry about that

steep onyx
#

okay

quasi kernel
#

Just do "UnhappyChange = -10" or something along those lines in the :DoParam()

#

So something like..

#

:DoParam("UnhappyChange = -10")

steep onyx
#

now im guessing I replace the petrol with popcorn

quasi kernel
#

Mhm!

steep onyx
#

okay

#

okay got it

quasi kernel
#

@weak sierra Question rq, does lua code run on it's own or do we need to hook up an event?

#

I'm pretty sure an event is needed but I wanna double check to make sure I'm not being dumb

#

(Sorry for ping aaa)

drifting ore
#

hey guys can someone send me the cursorwhite and cursor_normal files found in media/ui ?

#

I have changed a lot on files so cant verify, just need the two

quasi kernel
#

I think udderly is busy, lets just play it safe and hook an event.

steep onyx
#

okay

quasi kernel
#

(Also sorry Snow, I don't have a copy atm, I'm sure someone will get back to you tho!)

drifting ore
#

I would verify if I didnt have a ton of mods and altered the files

quasi kernel
#

Alright, now we're gonna do something interesting.

steep onyx
#

oh god

quasi kernel
#

We're going to hook our little bit of code into an event.

steep onyx
#

okay

quasi kernel
#

Don't worry! It ain't so bad.

steep onyx
#

good

quasi kernel
#

First, we need to turn our bit of code into a function.

steep onyx
#

okay

quasi kernel
#

I'm assuming your code looks something like this right now..

#
local item = ScriptManager.instance:getItem("Base.Popcorn")    
if item then 
    item:DoParam("UnhappyChange = -10")
end
steep onyx
#

yep

#

instead its -20

quasi kernel
#

That's quite alright!

#

I might need to check something right quick to make sure we're modifying the correct item, so gimme a second

steep onyx
#

okay

quasi kernel
#

(There's likely two versions of popcorn, if I'm not mistaken.)

#

I can't seem to find anything else, so lets stick with this for now.

steep onyx
#

okay

quasi kernel
#

Alright, now for the event.

#

We're going to use "Events.OnGameBoot.Add()"

steep onyx
#

okay

quasi kernel
#

This will, as you probably would expect, fire a function of our choosing on game boot.

steep onyx
#

okay

quasi kernel
#

Put this below the rest of our code for now. Make sure you don't group this in with our future function.

glad ridge
#

Oh that's pretty easy to change I'm learning something new

steep onyx
#

under end?

quasi kernel
#

mhm!

steep onyx
#

okay

quasi kernel
#

Now, huge reveal..

#

We're putting an end under the end!

steep onyx
#

spooky

quasi kernel
#

Your software is going to freak out for a second, because we haven't given it something to end yet.

steep onyx
#

okay

quasi kernel
#

So don't worry if things go red for a moment.

steep onyx
#

i did slightly panic for a sec

quasi kernel
#

At the top, we're going to put in "function FunctionName()"

#

Without the "

#

Change FunctionName to something of your choosing, but keep it relevant!

steep onyx
#

okay

quasi kernel
#

It does?

weak sierra
#

mhm

quasi kernel
#

That's news to me omg

steep onyx
#

got it

weak sierra
#

lmao

quasi kernel
#

Tysm

weak sierra
#

how do u think it runs the part where it hooks up to an event

quasi kernel
#

Is it bad to hook it to game boot or?

weak sierra
#

if it doesn't run on its own think

quasi kernel
#

Fair point

weak sierra
#

xD

#

it's way better to just have stuff run on its own when possible

#

stuff shud only run on events when necessary

quasi kernel
#

Okay so flote I just got some intel from a very smart person!1

steep onyx
#

sweet

weak sierra
#

keeps load order sane and understandable in the environment

quasi kernel
#

Forget that second end and completely ditch the event!1

#

What you have is apparently fine! Congratulations!1

steep onyx
#

so remove everything about end

quasi kernel
#

Just remove the second "end", the function, and the event.

steep onyx
#

okay

quasi kernel
#

We won't need those, apologies.

#

I thought lua needed funny events to do gaming

steep onyx
#

okay so im ready?

quasi kernel
#

(now I gotta go edit my mods smh, shame on you evelyn for being smart!)

#

Anywho, we gotta test it before assuming it's working, right?

steep onyx
#

yea

quasi kernel
#

There's a couple ways we can do this, if you'd prefer the short and easy way since this may be your only mod for now, I can tell you how to do that.

#

If you think you'll be returning to the modding scene, I recommend a longer method.

steep onyx
#

i dont know if i will tbh

quasi kernel
#

Valid!

#

Do you know how to edit steam launch options?

steep onyx
#

I just want to do this just to say i did

#

also yea

quasi kernel
#

Okay, all you need to do is add "-debug" (without quotes) to the startup options to PZ

#

Then boot the game, you'll notice some things will be different.

steep onyx
#

okay

#

i should save the code

#

right

quasi kernel
#

Mhm!

steep onyx
#

okay

quasi kernel
#

Then once it's saved, we're gonna head into pz and find your snazzy mod.

steep onyx
#

1s still loading ive got lots of mods

#

holy shit what am i seeing

quasi kernel
#

Alright, you probably see a couple new things right off the bat.

steep onyx
#

yep

quasi kernel
#

Welcome to debug mode! The little pop-down menu is our scenarios.

#

We'll worry about that in a second.

steep onyx
#

no theres these screens

#

no main menu

quasi kernel
#

Oop

#

Show show

#

They may be errors

steep onyx
quasi kernel
#

Okay nvm that's fine

#

Just one of your mods going nuts

steep onyx
#

okay

quasi kernel
#

Looks like more traits

#

Just click the little play button up top

#

This happens in debug mode to, well, help debug.

steep onyx
#

the arrow going right

quasi kernel
#

Mhm!

steep onyx
#

okay got it

quasi kernel
#

If (fingers crossed), that was it, you should be in the clear.

steep onyx
#

okay im good now

#

so now what

quasi kernel
#

Alright, now explore your mods folder for your mod.

#

Make sure to enable it, or your changes wont happen!

steep onyx
#

i dont see it

#

should the file be under workshop or mods

quasi kernel
#

Under workshop iirc

steep onyx
#

oop my bad

quasi kernel
#

It's quite alright, you can just reload your lua in the bottom right once it's moved

#

Handy!

steep onyx
#

1s

#

tbh i closed the game and moved it]

#

1s

#

nothing is showing up

#

should i have named the .lua to something

quasi kernel
#

Hold on, lemme see

steep onyx
#

wait it should be workshop.txt right not mod.info?

quasi kernel
#

ohh it may be

#

mb

steep onyx
#

1s i think i might have fixed it

#

let me check

#

okay let me check if it worked

#

it didnt work

quasi kernel
#

Im checking things on my end rq

steep onyx
#

okay

#

i wanna try cookin it

quasi kernel
#

I've got it here

steep onyx
#

odd

#

something must have gone wrong for me

quasi kernel
#

It in the right place and everything?

steep onyx
#

i think

#

does the mod work for you

quasi kernel
#

To a degree, it gives happiness even plain.

#

..which might need fixing.

steep onyx
#

oh

#

im gonna continue this tomorrow tbh

quasi kernel
#

Mkay!

steep onyx
#

thanks for helping

quasi kernel
#

Yeye!

steep onyx
#

at least i get to eat popcorn bc i cooked it

quasi kernel
#

yemss

#

pop of the corn

steep onyx
#

wait theres an in game editor

quasi kernel
#

With debug I believe so yes, but it won't save.

#

oh god adding magnet fishing is gonna be a compatibility nightmare

#

adding a lure is easy, getting it to work the way I want wont be

elfin stump
#

I am having issues where I cannot remove or update items on the loot tables. Even if I use RemoveItemFromDistribution and I confirm that it disappears out of the list with LootZed - those items still spawn at the original rates - but just don't show up in LootZed. I cannot find any way to actually get these adjustments to stick after the initial creation of the world or installation of the mod - even if the mod is removed and reintroduced with adjusted rates it still sticks to the original ones from the initial world start or mod install. - These were entered using the style "table.insert(SuburbsDistributions.all.inventoryfemale.items, "module.item") table.insert(SuburbsDistributions.all.inventoryfemale.items, (1)" - Is this a broken way to enter into the loot table for generic zombies? Is there any way to update or adjust this after the fact? Has anyone else ever experienced this issue? I am really stumped here. - My next steps are just forgetting the zomboid loot system all together and just shoving my items into inventory with my own scripts - but I would rather use the existing system - it just doesn't seem to want to be used.

lime hedge
#

debugging lua is pain in the ass tbh...

#

wish there's hot reload or something like most environment, such as nodejs

elfin stump
#

It sure is. It would nice to have a diagram of how some of this works. I am setting loot rates in sandbox and I think it does not work well. I think on the first time the game is loaded it gets those rates, but after that I think it when it gets those rates it does it too late maybe? If I comment out all my distribution entries completely then nothing spawns on a reload - if I count on it to look at a bool to make choice about which entries to do - it always goes to the initial one - not the new setting - even after running /reloadoptions - it has to be me misunderstanding the order of these things - or it is just buggy as hell and loot entries are not meant to me adjusted via sandbox by design.. maybe?

lime hedge
#

i create a dummy local dedicated server that mimic the settings/loadorder in the main server, by then i can restart it all the times for doing a test before deployed to main serer

#

doing every test/edge cases in the test server, reload it, restart it, I notice even just a single missing "," in the scripts might cause indefinite black screen

#

without any further informaton

elfin stump
#

Yeah there is something with the orders for sure - I am trying to figure out the steps to get it to behave - I may be doing something out of order here too in my testing so I am looking at all of taht right now

lime hedge
#

really pain in the ass... also if the mod on the local isnt updated as in the workshop, you have to rely on steamlibrary workshop folder, not on your document/zomobid/workshop, so i have to copy between both, whenever restart, i copy to 2 folder (server/clientworkshp), then restart server, also reloading lua in F11

elfin stump
#

Cool thanks for the info!

lime hedge
#

unless if I already upload the new version, then server downloaded the new mod with new structure, i can just save my changes and F11 reload lua inside the game.

#

otherwise it will still be manual copy and paste. between 3 folder

#

for /Server folder you need server restart, whereas for client and shared can be done by reloading in the client.

#

or in server reloadlua

#

but server restart might do better.... as it freshly reloading it

elfin stump
#

Do you know if it is possible to run a local hosted server with a local mod and not with a workshop mod? For testing purposes that is

lime hedge
# elfin stump Do you know if it is possible to run a local hosted server with a local mod and ...

For that purpose, i just have to rely on current mod folder, usually at the end of the list, restructure it into separate mod later etc, never try with dedicated server, for host perhaps..

probably this way is working, find a mod workshop ID that are useless, put it in your server config, then just replace with your things there, to update the mod just copy over to your local dedicated server/workshop directory

elfin stump
#

K, I see. Thank you. Lots of tedious testing ahead.

lime hedge
#

I suspect the server always check the workshop upon restart or something, so yeah, a real workshop ID that can be found on the workshop might do the job, even it contains nothing in it, haven't try that yet.

#

C:\SteamLibrary\steamapps\common\Project Zomboid Dedicated Server\steamapps\workshop\content\108600\ [hereWorkshopID]

#

by that you dont have to upload to workshop everytime theres an update

elfin stump
#

Right now I run everything on another workshop entry and then I test using that and merge if I like it which seems to work okay

lime hedge
#

if there's multi autosave feature in your editor, make the files you are working also save to that folder as well, also the client\workshop folder

elfin stump
#

My problem seems to be that you cannot update loot table probabilities via changing sandbox settings. It will do it right the first time but will not successfully update after that. I even made a script that removes items from the loot table and restarted after that - right back to using original sandbox setttings - loot tables still report everything removed. So I am thinking it is not possible to set loot table stuff with sandbox variables except for the first time around that either the mod is installed or the world is started - after that it seems to ignore sandbox and go to whatever the initial setting was (not the default).

#

I can remove everything successfully from the loot table by removing the entries that are under the bool that was set the very first time.

#

In my actual script. So this gets saved somewhere and the game loots there - not back at sandbox - at least for loot tables. So I need to find a way around this and to see if I can ever see the adjusted sandbox settings via code or if they are not accessible.

lime hedge
#

so there are 3 dir i'm working
C:\Users\saver\Zomboid\Workshop\WORKEDMOD\Contents\mods\ --- [1] File im working
C:\SteamLibrary\steamapps\common\Project Zomboid Dedicated Server\steamapps\workshop\content\108600\SOMEID\mods\WORKEDMOD -- Server mod, i have copy [1] if test server need restart
C:\SteamLibrary\steamapps\workshop\content\108600\SOMEID\mods\WORKEDMOD--- [3] Client loaded files, if the server checksum are alot difference in the structure

So i'm editing [1], whenever changes made, i need to put [1] to folder [3] and reload via F11, if /server folder mod changes, i need to put [1] to [2] and restart/reloadlua on the server

if server restarted, i copy over [1] to [2] and [3]. then restart the game as well

elfin stump
lime hedge
lime hedge
#

it might gives you clue...

elfin stump
#

Signing off for a bit but more testing later tonight - thank you for all your help here. something tells me... I'll be back ๐Ÿ™‚

lime hedge
# elfin stump I am actually finding a lot of mods with the same problem - doh! but hopefully I...

hmm.. haven't tried to mess with distribution yet to notice the quirks, so far the architecture itself are relying on events and stack of object, lets say I wanted to change after plowing land also seeding it automatically, i've tried it can't be done because the isoObject are delayed to change until the timedaction function ends.. (calling another inside that action doesn't works except if its artificial function (like cheating it, emulate everything)), the closest thing is creating new cursor object with seed, where user need to do more click

lime hedge
elfin stump
hearty dew
#

ISInventoryPane.onMouseUp fires when dragging items between the panes, but it doesn't when dragging off the panes onto the main game screen (to drop the item). How can I intercept an event when an item is dragged from a pain to the main game screen?

hearty dew
#

Also I'm looking for a way to intercept the TransferAll event

signal frost
#

Anybody know of a mod off the top of their head that adds constructions I can reference?

lime hedge
weak sierra
#

if u use debug mode

#

u can reload all, or reload by file

weak sierra
#

it's uh.. simpler

radiant venture
#

@weak sierra hey sorry if the ping is annoying but just wanted to say thanks for the great mods

lime hedge
lime hedge
lime hedge
# weak sierra there is hot reload

probably in the future it can be done and applied/turn on/off on demand in debug mode, since it was the same as putting file monitoring in the coroutine to reflect/F11 for every file changes

signal frost
#

Damn the building code is really based around the idea of using a hammer

signal frost
#

There's a flag for ISBuildingObject called noHammerNeeded and it changes a lot of things based on if that's true or false

#

If it's true, it makes hammer noises. If it's false, the derived class ISWoodenWall (also used for metal walls) thinks you're making a log wall and forces the animation to be something else

#

I'm gonna derive from ISWoodenWall and replace the method that's giving me issues

dense rivet
#

I have very cool mod idea but poor modding skills
But this idea is too good so i search for someone that can make it

#

Someone who know how to make cars and perks

#

it gonna be enought

eternal garnet
#

Type it out and if someone thinks it's good they may comment

#

Don't @ people though about it, just type it up

lime hedge
#

what item that has tooltips, wanted to check how it looks, then scrap the code

dense rivet
#

ok
So...
Imagine the negative perk that you were involved in in a car accident, as a result of the accident your two legs are limp for the rest of the game.
You start the game in a wheelchair that is treated as a vehicle, you can repair it, modify it and install some improvements, such as headlamps.
Moving without this cart would be possible, but the character would only be able to crawl.
Of course, all actions that would require the use of legs (e.g. driving a car) would be impossible to perform.
And it would be nice that such a friend in a wheelchair would have a hard time at the beginning of the game, but with the development of his wheelchair, he would be better and better.
Imagine if he could have a lot of things with him because he would have small containers welded to the wheelchair.

Tell me if you like the idea and if you could help make it appear in the game cat_smile .

lusty nebula
#

Finally got the 3D model of the helicopter implemented and fully working! ( When the player spawns a heli will be spawned beside him too ). Note that the heli still require fine tuning/adjustments but that's the easy part... ๐Ÿ˜‰

signal frost
lime hedge
#

how do i add tooltip on hover without overriding it...

shadow geyser
#

ISInventoryPane has alot of nice stuff for various tooltip stuff for showing variables

hearty dew
#

Oh, there is ISInventoryPane.transferAll(). That looks like it does exactly what I'm looking for. I can modify that

lime hedge
#

the way it works, like transferAll, it might loop in to the destination

#

finding the bag, iterate tru multi dimensional table/array etc

#

also the items transfered need to be iterated as well.. in every general programming stuff, loop is kinda essential, coroutines, event loops etc

hearty dew
#

Ah, and ISInventoryPane.onMouseUpOutside() might be an event I can override when dragging an item to the main game window. I'll try those two out.

lime hedge
#

onmousemove?

lime hedge
hearty dew
#

handle the event when the user drags an item from an inventory pane into the main game world to drop it

lime hedge
#

local dragging = ISInventoryPane.getActualItems(ISMouseDrag.dragging)

hearty dew
#

I'll try these out. Thanks

lime hedge
#

@hearty dew also

#

ISItemDropBox

high citrus
#

hi, what if I want to find nearby players (and this is easy) that are also potentially visible by my player (if I were to turn around by 360 degrees)? In other words given a player I want to find all players that he could potentially interact with, if another player is very close, but they are separated by a wall they shouldn't count (same if they are on a different floor)

#

I guess that there is no "is in line of sight" function that I could call

lime hedge
#

Wanted to ask simple question, does modData could store boolean values?

smoky meadow
#

guys i have question how do i find this "Recipe.GetItemTypes." on the vanilla lua

lusty nebula
#

The coords order in PZ is x,y,z or y,x,z?

shadow geyser
# high citrus I guess that there is no "is in line of sight" function that I could call

nothing in the lua side that I know of, but the java side does some stuff. there is a lineClear function in LosUtil.java which to my understanding should be able to do this. although im not sure if you can actually used it as I haven't tried to do anything like this b4. you could also dig into the super survivors code. tmk there is some line of sight logic stuff there for aggressive npc that shoot at you. not sure if it is custom code, or if they utilize this function.

gilded hawk
#

Is there anyone who have made a repo with decompiled PZ? ๐Ÿค”

lime hedge
lime hedge
shadow geyser
#

would be nice if an admin would just pin any of the messages for the decompile guide. so many times it needs to be shared, and I have to go find a link for it again every time

gilded hawk
#

Thank you both, I did already followed the tutorials, but I was looking for a simpler solution like at the PD2 modding scene, where one person has the repo with everything decompiled (and fixed where needed)

lime hedge
#

much simpler if you do it yourself, it's automated as well with intellij.

gilded hawk
lime hedge
#

it will be useful and much simpler

#

with your scaffold approach

gilded hawk
#

Maybe, i'll probably merge it with PipeWrench tho

signal frost
#

What's the benefit of having the Java side of the codebase? Can you actually do anything with that? I thought the only extendible part was the lua

gilded hawk
#

eg: what traits really do

high citrus
lime hedge
signal frost
#

I understand the benefit of understanding how the underside works, I'm just curious if you can extend it

shadow geyser
#

you can extend java, you just can't share those mods on the workshop.

#

thats why most modding is still on just the lua side

signal frost
#

Yeah I guessed as much

#

Gonna make my own aftermarket PZ fork

lime hedge
#

they wrap into nice API but it needs frequent update to follow up, so im not sure if its up to date to the current API.. probably there's lot of missing API

lime hedge
#

it's pain in the ass, going from TS/C# to lua, no typesafe, primitive debugging.. althou I just know it have breakpoints.

gilded hawk
lime hedge
gilded hawk
lime hedge
#

does it have full compiling support? no quirks or limitation?

#

i meant transpiling

gilded hawk
#

is paw low in this server? ๐Ÿค”

lusty nebula
#

How can you remove files from the game? I've tried by deleting completely the contnent of the file of interest and changing the file extention adding " -remove " ( Sample: map.info-remove ) but it doesn't work. ( Obviously simply emptying the file doesn't work )
Any other idea or suggestions about how to do it?

#

...maybe by creating a function os.remove(filepath) ?

#

( If feasible is there an event like " OnBoot " [ or similar ] to be used? )

#

Yep...OnGameBoot...

lusty nebula
#

Is there a way to control in which direction an item spawns? I mean...Let's guess that I want an item spawning, pointing in a west direction...any way to obtain it?

high citrus
#

hi, I just called a java method that returned an enum (LosUtil.TestResults), however the return type is actually a userdata according to the type function. Are enums not fully supported in kahlua?

shadow geyser
#

everything java related is type = userdata because you aren't accessing it from java, you are accessing it from kahlua

#

I'm not really knowledgeable about the technical side of it, but to my understanding, you are never accessing the java object, you are only interacting with a kahlua interface which affects the java object, and so the interface is always type userdata

quasi geode
#

lua only has a few data types. string, table, number, boolean and userdata.. which is any data type provided by another language library (usually C/C++, in this case java)

high citrus
#

but I can't invoke methods on the enum. Like name

quasi geode
#

that specific enum might not be exposed. (java classes need to specifically exposed to the lua)

high citrus
#

yeah, that might explain it

tardy beacon
#

Hey, so I was wondering does Singleplayer Mod Load Order matter?

undone elbow
#

Yes Sometimes

tardy beacon
#

Is there a guide on where to put mods?

undone elbow
#

The first mod is that you enabled first.

#

It affects overlapping translation strings. Nothing critical as I know

lusty nebula
#

***EDITED: Moved to " Modeling " channel

nocturne bane
#

Is it possible that OnObjectAdded is only triggered in multiplayer?

ancient grail
#

does anyone knoe how to trigger an animation just by pressing a key

lusty nebula
gilded hawk
#

How can I save data inside a tile a sync it with other clients? ๐Ÿค”
I want to increase the size of a wooden crate box and limit it to only a single type

lime hedge
summer rune
#

is there a way to view the global ModData?

shadow geyser
#

I think there was a way to view them in debug mode

brazen grove
#

Would anyone be able to help me out? I'm making the Ghostbusters firehouse, everything is going fine BUT I want to create a few custom ContainerTypes so that I can ensure certain loot will spawn in a custom tile I've made. My issue is I have no idea how to go about this. I have a distributions lua where I have set my distributions but I don't know how to add a custom distribution such as instead of having "counter =" "customthing =". How do I go about this? Any help would be great

stuck temple
#

put this in the #pz_b42_chat, is this a mod related bug and does anyone know how to prevent it from happening again or fixing it

covert summit
#

I knew it would be a challenge. But there is no way back

#

The modern Internet is shit, to put it mildly. It's too hard to find simple photos of the front of the car and on the sides. Instead, they are trying to sell me new volkswagen models and show me how poorly teenagers tune this car.

#

regardless of how correct my request was. However, I will finish this retexture. The car is beautiful :]

ancient grail
weak sierra
#

but i don't know what causes it

#

i would be inclined to assume map corruption

#

because the wood floor seems to be the "default" tile

#

possibly forced reboots could cause it

#

without saving

#

or while saving

elfin stump
#

Is there any way to write a server sided script that looks at some in-game variables and updates a file with them that can be stored on the server and referenced later - say after a reboot?

summer rune
#

can someone help me out, i just wrote my first mod. it is only 30 lines of code. just modifying moddata. but i would like for someone to look it over and give me hints to what improve and how to upload it and test it.

lime hedge
summer rune
#

(1) i would like to know if this is correct. (2) and also how to tell the mod that this is the main file. i put it in C:\Users\NAME\Zomboid\Workshop\GPZModFixes\Contents\mods\GPZFixToxicZones\media\lua\server (3) how to upload the mod ?

glad ridge
thorn minnow
#

Hi

#

woops, am in wrong channel

summer rune
#

u cant click subscribe?

pine fiber
#

Hello there. Is there any way to keep the formatting of the mod's workshop page description text from the workshop.txt or modinfo.txt file (I don't know which one steam uses to modify the mod's workshop page description)

thorn minnow
pine fiber
#

Do we have to go through steam workshop again to modify the form and make it pleasant?

summer rune
glad ridge
ancient grail
#

is it really imposible to disable the pvp stunlock?

pine fiber
# glad ridge if you don't want to reupload it again..

Sorry I didn't understand. I just updated 4x my mod and every time I have to go through the steam workshop site to format the text with [b][/b] tags because I can't specify these tags in the description to be given in the workshop.txt file when submitting the mod to the workshop.

ancient mirage
#

Hello everyone! I've just started getting into modding this game, I've made a few food items, but I wonder if its possible for me to make my own CDs? I haven't been able to find any information on this so I was hoping someone could point me in the right direction.

This is all I've really figured out on my own so far, not sure how I would replace the text lines for the lyrics.

Appreciate any help, thanks!

module NRC
{
    imports    
    {
        Base
    }

    item Track1 {
        Weight                 = 0.01,
        Type                 = Normal,
        Icon                 = Disc,
        DisplayName         = CD: Bready or Not. Here I Crumb!,
        WorldStaticModel    = Disk,
        MediaCategory       = CDs,
    }

    item Track2 {
        Weight                 = 0.01,
        Type                 = Normal,
        Icon                 = Disc,
        DisplayName         = CD: Like Butter. Iโ€™m on a Roll,
        WorldStaticModel    = Disk,
        MediaCategory       = CDs,
    } 
    }
}
ancient mirage
#

@pine fiber thanks for the response, but no luck there. I didnt see anything in those mods that handles setting the lyrics/text, those mods just appear to make it so you can play actual music files in game.
i thought this was a pretty simple ask but starting to think its impossible, as i havent seen it done yet.

i think i'll look into making custom vhs and radio stations, maybe that will help me understand how to do it

weak sierra
#

you have an extra closing bracket in ur script btw

#

@ancient mirage

ancient mirage
#

thanks, just a copy paste error

#

there's 44 tracks, i cut some out so it wasnt a massive wall of text lol

stoic oar
#

Is SoundRadius are based on tiles or the others?

#

Just makin test script but im really confuse about SoundRadius and SoundVolum Parameter

glad ridge
#

pretty sure sound vol is what you hear

stoic oar
#

Then what Radius for?

glad ridge
#

the distance of tiles you can hear it from i am assuming

#

i'll check a mod rq

stoic oar
#

Thx mate, just figure out why MP gun mode get worse SoundRadius then SP

glad ridge
#
        -- Some examples of radius and volume found in PZ code:
        -- Fishing (20,1)
        -- Remove Grass (10,5)
        -- Remove Glass (20,1)
        -- Destroy Stuff (20,10)
        -- Remove Bush (20,10)
        -- Move Sprite (10,5)
        local soundRadius = 13
        local volume = 6```
stoic oar
#

Seems like then SoundRadius are per tiles then

glad ridge
#

not 100% on it but i believe so

stoic oar
#

Theres a lot of help about it, thx mate

glad ridge
#

i think you can check it in debug mode as well, but i don't have an idea how to, you might just have to play with it

stoic oar
#

Gonna tell you if i get sometin

weak sierra
#

it's a deliberate change, and there's a mod that reverts it to the SP values if you want that

zenith smelt
#

oooh

dull field
#

Is there a mod that skips the this is how you died message every time you log in?

shadow geyser
lusty nebula
shadow geyser
# pine fiber Sorry I didn't understand. I just updated 4x my mod and every time I have to go ...

so for example here is the workshop.txt of a mod I have. notice that all the [h1], [list], etc tags are all inside as normal text. you just need to include those inside the text when you upload it to the workshop and they will be formatted correctly in the workshop page.

version=1
id=2778991696
title=HydroCraft b41 Continued
description=[h1]Latest Hydrocraft mod for b41 - for both MP & SP[/h1]
description=[h1]recent update highlights 11-Sep-2022[/h1]
description=[list]
description=[*] Added animations for when equipping dolly, toywagon, and wheel barrow thanks to trynaeat
description=[*] Added sugar crafting chain from beets thanks to trynaeat
description=[*] Added ability to smelt other ingots in 4 ingot mold
description=[*] fixed crops breaking on restart of a dedicated server
description=[*] fixed crop behavour when crops are unloaded. you can now leave your crops in greenhouses and go far away
description=[*] and much more in the change logs
description=[/list]
etc etc

lusty nebula
shadow geyser
#

you can just search steam formatting on google and it will give you the link

lusty nebula
shadow geyser
lusty nebula
#

...ATM I'm still struggling with the item shadow thing ( Not yet found a working solution ) so I'm busy with it....Widgets time later on LOOOL ๐Ÿ˜„

#

Thanks for the infos mate ๐Ÿ˜‰

sinful vessel
hearty dew
#

How can I check whether the player is currently performing a timed action (bar over head) (specifically if the player is performing the ISRemoveBrokenGlass action, if that is relevant)?

ancient grail
ancient grail
shadow geyser
sinful vessel
violet fractal
#

Hello, I wanna get started on LUA modding but I'm not finding any documentation or basics thing, is there some place where can I get started? (I'm familiar with the LUA language)

#

Like how can I gather the player's injuries?

#

I made a mockup of what I'm planning to do, basically a minimalistic health panel (red: untreated, white: bandaged, orange: dirty bandage)

low yarrow
#

Is something like that possible? Basically i wonder if there is a way to fetch a other mod into a boolean variable depending if its there or not.

#

Its just a tiny detail and i dont want to make a patch for it, would be nice to handle that in a elegant way

ancient grail
smoky meadow
#

guys i need help, i have this weird bug. first i build my custom furniture, then the real problem is when i walk too far away, and then come back the custom furniture i build visually disappear but the furniture is still in that location because i still see the containers in it.

shadow geyser
low yarrow
#

Worked ๐Ÿ™‚
Thanks again!

lime hedge
#

displayin modData in the tooltips, any predefined function to do that?, seems like InventoryItem only has :setTooltip, which is not multiline..

#

also, anyone know the hook when we hover over the inventory item?

zealous cosmos
#

Hiho,
I've continued implementing Storm, a mod loader, but I can't add it in any way to the startup options of steam, which would make it more easy to start it off.
I was wondering, if there is any way to add startup options in steam?
Another route is to create a Steamworks account and register this starter as a mod, but I would have to pay 100$, which I currently don't have.
So either I start a gofund.me or find another way to achieve an easy installation + startup.

shadow geyser
shadow geyser
zealous cosmos
zealous prairie
#

my mods list isnt working for hosting servers can someone tell me which mod are not mp compatible like if you know any off the top of your head

lime hedge
lime hedge
#

compile into .exe

lime hedge
#

can't found where the progress bar such as 'Remaining: [===--]

zealous cosmos
lime hedge
#

so its a one liner .exe

zealous cosmos
#

nice!

lime hedge
#

i suggest to go with golang, as C# would need you to use IlMerge or something to make it standalone, delphi could compile into standalone easily as well

lime hedge
# zealous cosmos nice!

so in golang would be exec.Command("steam://run/108600") to run zomboid, just add slash for adding args or somethin

#

your welcome

zealous cosmos
lime hedge
zealous cosmos
lime hedge
stark coyote
#

Is it possible to make players with a trait see a different name for an item ?

weak sierra
#

yeah by client-side adjusting it in the rendering.. but if your purpose is to do something like show whether something is tainted or poisoned then i'd advise just adding an extra ui bit for it, it'd be easier

#

if u actually changed the name then others would see it if you allowed it to work outside of the inventory

weak sierra
#

i am trying to get a list of all vehicle zones in a cell. this is what i am currently doing, and it yields 0 zones..

#
function UdderlyVehicleRespawn.GetZonesForCellAt(worldX, worldY)
    local zones = metaGrid:getZonesIntersecting(worldX, worldY, 0, 300, 300)
    local vehicleZones = {}
    for i=0, zones:size()-1 do
        local zone = zones:get(i)
        if instanceof(zone, "VehicleZone") then
            table.insert(vehicleZones, zone)
        end
    end
    return vehicleZones
end

local zones = UdderlyVehicleRespawn.GetZonesForCellAt(cellx*300, celly*300)
#

i have had to do some guesswork and digging in the decompile to get this far

#

but unfortunately that method just is a stub in the lua side

#

it doesn't point to something i can find in the java side

#

so i have no idea how it works internally

#

whether it wants world coordinates or what

#

due to the context i presume it does

#

i am also making the assumption that it will return zones that intersect the bounds defined by X,Y through X+W,Y+H (at Z)

#

i am getting metaGrid like this..

#
local metaGrid = IsoWorld.instance:getMetaGrid()
#

i guess as a next troubleshooting step i'll print the original zone count it finds before filtering down to vehiclezones

#

but any input would be appreciated

#

i had tried passing worldX and worldY directly from the event i'm calling things from, OnPlayerUpdate, into this

#

but it said invalid argument, and when i looked it up it said INT so im assuming it gave me something fractional

#

and since i sought cell-wide anyway i computed the cell coordinates to world

#
    print("[UdderlyVehicleRespawn] Found "..zones:size().." in the rectangle ("..worldX..", "..worldY..", "..(worldX+300)..", "..(worldY+300)..").")
#

so.. anyone got any info on this function? how it works? if it works?

#

searches the vanilla code for hints

#

function is not used in the vanilla lua..

#

i guess if i have to i can precompute a list of zones assigned to cells and store them in a table or smth

#

:|

#

realizes she should use IsoMetaCell

weak sierra
#

so searching in intellij does not find the functions by name

#

within the file

#

then i scroll around and try again and they show up, that's fun

elfin stump
#

oofff - evil computers

#

I haven't done anything yet involving the world or vehicles

weak sierra
#

i've heard that there's reflection available

#

where is the reflection

#

i imagine my life would be less painful if i knew ๐Ÿ˜‚

elfin stump
#

It is a challenge having so little documentation haha

#

I have a few fixes for my loot problems all set up but it would be nice to know why my problem exists in teh first place so I could fix it rightt! noooo

#

Anyone familiar with loot tables and sandbox settings together? Is this a bad practice because of the reference to SandboxVars?

table.insert(SuburbsDistributions["all"]["inventorymale"].items, "ModModule.SomeItem")
table.insert(SuburbsDistributions["all"]["inventorymale"].items, SandboxVars.ModModule.CustomChance)

It seems like it only works as expected the first time the mod is loaded or the game is loaded and after that it never loads updated sandbox settings - just the first settings that were ever input.

willow estuary
#

Also those are additions to the distribution tables, they don't really have anything to do with the sandbox settings.

#

Unless your are doing something weird with "updating sandbox settings" that is doing something weird to the distro tables.

weak sierra
#
  1. is there any way to get a list of vehicles in a cell besides just in the loaded-in bubble of the player?
#
  1. is there any way to get a list of vehicle zones in a cell, i can't seem to make anything work.
willow estuary
#
  1. Probably not, only vehicles that are within the 150 tile reality bubble around a player, "exist"
weak sierra
#

that's what i thought yeah, i really wish the vehicles.db had exposure

willow estuary
#
  1. I only know of polling zones by individual tiles.
weak sierra
#

there's tons of zone-getting functions for the whole world, for cells, for chunks.. but none of them seem to work?

#

metagrid, metacell, etc.

willow estuary
#

I... ...am the newest and stupidest member of the team and I don't know a fraction of the code?

weak sierra
#

there's a field "vehicleZones" on metacells and i can't access it because i don't understand when fields are exposed or not

weak sierra
#

xD

elfin stump
# willow estuary I don't know how or why you don't think that works, but that is standard good pr...

The behavior that has me questioning it is that if I use SandboxVars as a variable to set the chance and then I change this setting it does not seem to get reflected in the loot tables, even if I do /reloadoptions or if I restart the server. If I check the sandbox settings by having the player say what it is in game when I call a function - the updated sandbox settings are confirmed. So it seems like sandbox settings get updated fine, but loot tables do not reflect that. When I omit the SandboxVars reference in the loot table entry and replace it with a number - loot tables receive that number and get updated just fine on a restart.

willow estuary
# weak sierra you still know more than me, mate

If you're trying to do something that takes the cars in the world, in runtime, that does stuff like despawn cars to swap in new ones or something similar and "intrusive" to the world, I'd have a lot of expectations of it causing all sorts of issue if you got it to work.

weak sierra
#

yup

#

i already have it dynamically picking up cars in the reality bubble and tracking their last seen time, deleting them, picking a new car to spawn

#

just failing to get locations to spawn them

#

i plan to write code to teleport someone around the map triggering car load-in and building a heat-map as a one-time thing at world start

#

and use those values to guide the "goal" per cell

#

since i can't harvest the total count a more sane way

#

i don't wanna swap them out directly with the old car because then it could easily be exploited by players

#

and picking random spots would.. well, im sure u can imagine

willow estuary
willow estuary
# weak sierra yup

I wouldn't expect that work smoothly, and you may have all sorts of issues and headaches. And it may cause all sorts of more issues and headaches in MP.

#

Game wasn't designed for that stuff.

#

Not saying it's impossible, just my gut feeling.

willow estuary
weak sierra
#

well regardless of whether it's a good idea or will work nicely, it should definitely be possible to get the zones and finish the prototype, lol.. and i am of course also throttling it per-cell-per-player and per-cell globally, configurable thresholds for that, all sorts of stuff to ease it

elfin stump
# willow estuary 1) Ah, you know sandbox settings aren't meant to change in runtime; sure admins ...

Cool, I definitely am restarting now haha, it wasn't always the case but now I am doing a full restart every time. - The only weird thing about that on #2 there is that it does work the first time. If I start a game with adjusted sandbox settings they work and reflect the sandbox settings - but not if I update those and restart. So I think you are right, that it is the variable causing problems, but what has me stumped is that it worked the first time and just not when they are updated.

willow estuary
elfin stump
# willow estuary Ah, just try having more console output as your code runs so you see the exact v...

Good call, I will do that now. I have been thinking maybe when the game world loads the first time more is going on and the sandbox variable gets loaded in before it gets called. But during an update maybe it isn't loaded in fast enough and table inserts happen first... or something. I should be able to see if this is the case now... Should we add to distribution tables in a script just like that or is it best to put them in a function and connect to a specific event?

willow estuary
weak sierra
#

i usually use loops to avoid redundancy and make it easier to update, but no more complex than loop thru spawns + loop through items

#

i havent done configurable, but that has been a thing ive planned to do

#

i certainly hope i don't run into whatever you have, phil

#

lol

elfin stump
elfin stump
mellow oyster
#

any way to overlay something transparent over the player skin without things breaking?

weak sierra
#

unrelated question to earlier: is there a way to get a handle to another player's IsoPlayer from the client end?

#

i can write a mod to do what i need to do but it's a one-off..

weak sierra
#

nvm

#

gonna go about it another way

gilded hawk
#

How can I change the size of the police armoury containers?

weak sierra
#

size?

#

visually?

#

or capacity?

#

or what

gilded hawk
#

In particular this one

weak sierra
#

it might be lumped in by container type

#

this is the class that deals with containers

#

from IsoObject you can do getContainer()

#

mm

#

there was a mod that took those back when they weren't lootable and made them lootable

#

i bet that has something worth poking at

#

id poke at that and see if it tells u anything about replacing/modifying a particular container (and bonus points cuz it happens to already be the same one)

gilded hawk
#

I was actually look at this too, I noticed that I need to use tileZed

#

I was hoping for a pure lua solution, I guess I'm stuck with it shrug

elfin stump
#

Regarding sandbox loot table issues - I put together some scripts that check the sandbox settings at different times via some events and output the results to console.

Here is the result:
NO EVENT - Entered straight into distribution script = Original Sandbox Setting is Shown
Events.OnPreDistributionMerge = Original Sandbox Setting is Shown
Events.OnDistributionMerge = Original Sandbox Setting is Shown
Events.OnPostDistributionMerge = Original Sandbox Setting is Shown

IN GAME CHECK = Updated Sandbox Setting is Shown

So I can see why it isn't working - and it looks like the sandbox doesn't get updated to new settings until after distribution is done. My next attempt is going to be to store the sandbox settings with getModData and see if I can access that on a restart. I don't have a lot of experience with getModData - I have only used it off of a player - is there getModData or something like that at the server level? Can I just do getModData without a prefix for some object?

weak sierra
#

but it's not "correct"

gilded hawk
#

๐Ÿ‘€

#

I'm curious ๐Ÿค”

weak sierra
#

you can dynamically alter container capacity live when clients open the container conditionally

#

nothing actually enforces the container size beyond the lua on the client

#

Eggon's uses this to modify car trunks and such

#

u can hook the container stuff and go "if it's this one then capacity is actually X"

#

u probably have some experience hooking container code considering proximity inventory

gilded hawk
#

That sounds like a pretty good idea imho

#

Thank you, I will look into it

weak sierra
#

if u happen to run into an issue where the updated size only applies after clicking the container icon and fix that, let me or eggon know lol

#

im hoping that's just a quirk in his code and not an issue with the approach

#

doesnt happen all the time or with all trunks

gilded hawk
#

Sure, why not

#

At the moment I'm interested into looking at tile zed, and see if I can make a higher quality version of my idea.

Like, properly upgradable lockers. With X lvl in metal working you get X more capacity in that locker

#

I'm still a bit salty that I must go via tile zed tho

weak sierra
#

they already do that for wooden crates

#

u shud look into how that works

gilded hawk
#

I am, but I'm not finding anything at the moment ๐Ÿ˜ฆ

weak sierra
#

tho i assume it's diff containers that are built

#

depending on the carp level

#

they are visually different at two points

gilded hawk
#

I'm looking into media\lua\server\BuildingObjects\ISWoodenContainer.lua but there is notthing that helps me ๐Ÿ˜•

#

Maybe it's something set via tileZed? ๐Ÿค”

weak sierra
#

ive not touched that program rly so idk

signal ibex
#

Is there a generic on observe function somewhere?

#

LoadGridsquare and ReuseGridsquare I assume?

lusty nebula
weak sierra
#

and yeah Events.LoadGridsquare exists.. not sure what "on observe" means here exactly

#

im guessing u mean "square starts to exist" in which case yeah probably

willow estuary
# signal ibex `LoadGridsquare` and `ReuseGridsquare` I assume?

Just a warning, but OnLoadGridSquare can be very expensive run-time wise and affects performance, especially in areas with lots of multi story buildings.
I've used it extensively in the past for modding, and now I think that may have been a mistake on my part.

signal ibex
#

ahh okay thanks. I see
On observe as in updating an item only when it's observed, such as growing trees, but only when a player goes there, so I don't have to have a growing script running when there is no one able to observe the tree (Becasuse there are too many).

weak sierra
#

OnPlayerMove with throttling might be appropriate

#

if you want it to update them periodically when people enter an area, or enable a function that keeps running until player is away

#

and then disable

#

if that's your specific use case i'd use OnPlayerMove and have a throttled check for plants within radius of player, if found, adds their update functions to whatever event, track those plants whose functions are added and keep handles to those functions, and then when plant falls out of radius remove their functions from the event they are tied to and yeet em from the list

#

perhaps

#

it's very use-case dependent though and u have to weigh tradeoffs between all the logic to throttle/enable/disable vs. just running it all the time depending on how intensive and common the thing is

signal ibex
#

Yeah, thanks.

#

It's very specific for situation, I was hoping someone had a framework for something like this.

alpine scroll
#

Anyone knows how to change the time to place a pipebomb/grab a pipebomb?

#

The timed version

shadow geyser
signal ibex
#

Gotcha, I'm just poking around seeing what I can do

#

Yeah loadsquare seems bad because I would have to check for my case position or existance of object, which would mean every square loaded it's pointlessly checking

#

Probably even if I only check positions, still bad

#

It's good to know getsquare is nil!

signal frost
#

What's the fastest day to determine if something is on the lua side of the codebase or the java side

pine fiber
#

Could someone tell me if there is the possibility to create a working environment on Visual Studio Code with Intellisense for Project Zomboid modding projects as below (using IntelliJ IDEA) ?

https://github.com/Konijima/PZ-Libraries

GitHub

Complete tutorial to decompile and use Intellisense for Project Zomboid modder. - GitHub - Konijima/PZ-Libraries: Complete tutorial to decompile and use Intellisense for Project Zomboid modder.

shadow geyser
# signal ibex It's good to know getsquare is nil!

if it is only certain objects on the map and not all, you can look into using the globalobjectsystem for handling it. that way you have then tracked, rather than constantly checking a square if or if not the object you care about is there. its how the game handles things like the rain barrels, traps and crops. again tho, without knowing what you are trying to do, this still might be overkill

lime hedge
#

any way to get hours elapsed, i get confused counting it, lets say i define a moddata today, and want to calculate it in the next month or years.

shadow geyser
#

you can just write into the moddata a timestamp

plucky junco
#

I have a question, can I make a single object that when placed become a multy tile? for example the metal shelves when in the inventory it's devided in 2 pieces, when placed it occupy 2 tiles, can I do it with a single object?

#

like I have one object in the inventory and when I place it it become 4 tiles

spare kiln
#

Anyone can give a clue as to how to change a weather on the fly through lua?

#

or where to look for an answer

lime hedge
# shadow geyser you can just write into the moddata a timestamp

alr did use getGameTime:getWorldHour, the current codebase use getYear, getHour, getDay, to calculate, and i wont do lots of refactoring to it, so i just added tooltip and extra code to compare between legacy approach and current approach, seems using getworldhour are easier.

#

also i added hardcoded tooltip via setTooltip(args), my debug console now filled with missing translation, is that matters to the performance in general?, or it only appears in debug and client?

shadow geyser
lime hedge
shadow geyser
shadow geyser
#

tmk it is fine now

hearty dew
#

Anyone have a good resource to share for clothing icons?

lime hedge
#

also, is there anyway to add electricity to certain tiles, likes, i want to extend player safehouse electricity tiles

#

seems electricity only defined with shutmodifier, is it hardcoded in the java? :S

shadow geyser
#

yes but its a bit of a hassle to do it, because it it won't persist when the square is unloaded, so it isn't perfect

#

let me try to find the code, it was really weirdly done and not great so i moved on, but if you want to put the effort, its possible

#

I think it was isosquare:setHaveElectricity()

#

you can also use virtual isogenerators if you want to give areas electricity

hearty dew
#

    item RopeBelt
    {
        Weight    =    0.1,
        Type    =    Clothing,
        DisplayCategory = Clothing - Accessory,
        DisplayName    =    Rope Belt,
        Icon    =    RopeBelt,
        BodyLocation = Belt,
        ClothingItem = Belt,
        AttachmentsProvided = SmallBeltLeft,
    }```
I specified the DisplayCategory as `Clothing - Accessory`, yet it shows up in game as `IGU_ItemCat_Clothing - Accessory`. Tried specifying as `Accessory`, but then it shows up as `Accessory` when I'm trying to simply use the existing `Clothing - Accessory` display category. Other mods that specify `Accessory` for clothing type items display as `Clothing - Accessory`, so I'm a bit confused why the behavior is different. Any ideas?
#

Oh, maybe it is the Better Sorting mod performing some shenanigans

#

Yea, it is Better Sorting. nm

#

Is there a best practice for using Better Sorting categories for items when the Better Sorting mod is loaded and falling back to normal categories otherwise?

opal linden
#

question for modders

#

is it possible to make a functional bayonet attachment for rifles

#

but it would still push them when they get too close

shadow geyser
#

depends. you could implement 2 items, one which was the gun, and another which was just a spear. and do something like have a hotkey switch between the two items. I don't think it is possible to make 1 item that does all three things, but you could fake it by having the 2 items, and you "swap modes" with a hotkey

lime hedge
#

what's the proper way to remove item from server in client's code, i saw legacy code use removeItemFromServer, but it doesn't appear in any vanilla lua side at the current version.

rancid tendon
#

so question--
i have a mod that contains 3 packaged mods within it. if i wanted to make an additional optional mod that modifies one of those other mods, how exactly does that work?

#

i have a true music mod that i'd like to make an optional addon for that alters the loot distribution tables

lime hedge
#

so either way, it will load the unpatched mods then your altered list after

#

just find the function name, handle with getActivatedMods():contains("yourpatchmod"), under that scope, alter the function, keep it the original function in a local variable to recall the original, could be after or before your altered behaviour

rancid tendon
#

hmm

#

perhaps this is a little above my paygrade as a distinct not-a-modder/coder

#

or, wait--i think i see what you mean, hmm

lime hedge
rancid tendon
#

hmm, yeah i think this is a little too complicated for me maybe

#

what would the function name be here? table.insert?

hearty dew
#

Is simply changing the data in those tables not sufficient? You may not need to patch any functions

rancid tendon
#

the patch is intended to be an optional modification to the baseline to make things more rare

#

i want the main mod to have these values normally, but allow folks to turn on an included patch to lower the spawnrates if they so choose

hearty dew
#

Might be simpler to do that via a sandbox configuration parameter, and use that sandbox parameter to set a different value e.g.

table.insert(ProceduralDist...blahblah, SandboxVars.mymod.rarerloot and 0.1 or 0.7)```

But if you want it in a separate mod, you would need to ensure the optional mod loads after the 1st. If you can do that, then simply overwriting those values in the ProceduralDistributions should be sufficient.

I think you might be able to ensure the lua file load order of the files by using `require("mainmodsfile")`, but I'm not positive if that works with how pz loads lua in mods. I'd need to test it (I happen to need to for something unrelated, so I'll have a better idea a bit later) or maybe someone more familiar could provide some insight.
lime hedge
rancid tendon
#

but that's a guess

#

also, one thing to note: anything that would require manual editing of individual lines is a definite no-go

#

the total amount of lines is like, 15000

lime hedge
rancid tendon
#

huh, i underestimated, 22,895 lines

#

anywho

rancid tendon
lime hedge
#

as long as the patch load after the patched mod, it shall be fine, i did with greenfire, wrapped in getActivatedMods():contains if guard, and it loaded and patched.

hearty dew
# rancid tendon huh, i underestimated, 22,895 lines

Do you need to change the value of all/most of those lines? Or just a select few? Do you need to hand pick the new values (e.g. I need to change this 0.7 to 0.35 and then change this 0.8 to 0.7)? Or do you just want to scale down all down by some factor?

rancid tendon
lime hedge
#

by then i dont really have to mess with the original mod

lime hedge
rancid tendon
#

nah i don't want to fork it because i don't want to split the workshop metrics

#

noted

hearty dew
#

This ProceduralDistributions object is global and is used by vanilla lua code to distribute loot, so if you iterate over it to modify values, you need to do so in such a way as to not modify vanilla entries and entries from other mods

rancid tendon
#

simply overriding the entire original file sounds easy enough there, my main concern is that i'm not even sure if it's possible to set mod load order outside of rearranging them in the ini file for that save?

#

you can do it with maps but i cannot recall if it's even possible with standard mods

hearty dew
#

Honestly, I think it'd be easiest to just have a script iterate over each line to insert a sandbox var to multiply the original values.

table.insert(ProceduralDistributionslis["Store"].item, 0.7);```
to
```lua
table.insert(ProceduralDistributionslis["Store"].item, 0.7 * SandboxVars.mymod.lootrarityfacor);```

Some text editors make that easier to do than others. If you'd want, I could do that real quick if you have trouble doing that to 15k lines.
rancid tendon
#

hm

#

if it would be simply appending the exact same thing to the end of each line, it'd be pretty easy to do from my end

hearty dew
#

It's not every line. It's only the lines with the numbers there (the loot rarity)

rancid tendon
#

just like, find and replace .7); with .7 * SandboxVars etc etc

#

oh yeah true

lime hedge
#

loop thrugh ProceduralDistributions.list, get the type you want, or string find it, remove the record in the list then add that back up with your modified values.

lime hedge
hearty dew
#

Could do that too. Just have to compile which strings you need to look for bc like I said that object is global and other mods and vanilla insert entries into it

lime hedge
#

the vanilla wont even get into the core part of your code if you handle the string properly..

rancid tendon
#

tyrir, if i take your approach, what is lootrarityfactor?

lime hedge
#

like, item:getFullType() < check for prefix modulename. if its from true music then go on with that

hearty dew
#

It's a sandbox var. Like when you create a world, the user sets the zombie population to 1.0 or 0.8. It'd be like that, and users can adjust it how they prefer

lime hedge
#

only handle everything from Tsarcraft.

rancid tendon
lime hedge
#
for k, v in pairs(ProceduralDistributions.list) do
        for i= 1, #v.items do
            if string.find(v.items[i].item:getFullType(), 'Tsarcraft') then
                --
                table.remove(ProceduralDistributions.list[k].items, v.items[i].item:getFullType())
                table.insert(ProceduralDistributions.list[k].items, 'yourvalue')
            end
        end
    end
lime hedge
#

just a seudocode

hearty dew
# rancid tendon ah i'm familiar with sandbox vars, but i'm surprised at the idea that they're th...

You create them via adding a couple files, if you don't already have them.
Create media/sandbox-options.txt in your main mod. In it, put

VERSION = 1,

option mymod.lootrarityfactor
{
  type = double,
  min = 0.0,
  max = 1.0,
  default = 1.0,
  page = mymod,
  translation = mymod_lootrarityfactor,
}```

Then in `media/lua/shared/Translate/EN/Sandbox_EN.txt`, put:
```json
Sandbox_EN = {
  Sandbox_mymod = "My Mod",

  Sandbox_mymod_lootrarityfactor = "Loot Rarity Factor",
  Sandbox_mymod_lootrarityfactor_tooltip = "This value does blah blah",
}```

pz's mod framework takes care of creating the lua var `SandboxVars.mymod.lootrarityfactor` from that (assuming I didn't make a typo).
rancid tendon
#

ooh, thank you very much

#

this seems pretty easy to implement and it's a far more elegant solution than the one i started with

hearty dew
#

That code savaroo wrote works too, 1) assuming you can ensure it is loaded after the main mod and 2) no other mod uses Tsarcraft prefix in their item names (else there is a possibly of modifying their values)

rancid tendon
#

i am almost certain that tsar has a ton of other very popular mods using the tsarcraft module

lime hedge
#

you can try debug it in console first by printing it, count the numbers etc..

#

that's the downside, you have to make sure about it, or if the list of items can be collected in your end easily, just put them in a list, to make a strict/explicit comparison to your "modded" list of items.

#

If I had to scrap through alot of list (more than 10k record), I usually make a snippet in other programming language such as Javascript/TS with Quokka(real time interpreter), and scaffold it into a lua table of item list, then begin writing the lua once I gather the table with the list collected and scaffolded

sly apex
#

Are there any good tutorials/guides on how to make custom radio/tv stations?

hearty dew
#

And that the require() function in lua only works on lua files in the vanilla pz lua source code, not lua source from mods (although this is from like 6 years ago, so might be outdated)

shadow geyser
weak sierra
#

i see all kinds of nonsense with the require function failing even for vanilla things that are definitely present among the many mods i run

#

doesn't seem to cause issues but it does concern me a little :P

#

require definitely works within the same mod

#

and i've seen it used between mods though i can't personally speak to whether it works or not

shadow geyser
weak sierra
#

i suspect the random failure of require on my end has to do with being on linux

#

i think there's some nonsense in the path handling in PZ in some places

#

i've seen mod assets fail to load due to pathing

#

and i run it on wine to avoid that

shadow geyser
#

what issues are you having? I don't get any issues with the require function unless I have specified the path incorrectly

weak sierra
#

random example

#
LOG  : Lua         , 1663625615565> Loading: Z:/home/evelyn/.local/share/Steam/steamapps/workshop/content/108600/2732834772/mods/CheatMenuRebirth/media/lua/client/CheatMenuRebirth/Lua/LuaInterpreter.lua
WARN : Lua         , 1663625615566> LuaManager$GlobalObject.require> require("CheatMenuRebirth/Times/GenericInputWindow") failed
WARN : Lua         , 1663625615566> LuaManager$GlobalObject.require> require("CheatMenuRebirth/Times/SkillInputWindow") failed
LOG  : General     , 1663625615566> [CHEAT MENU] ISUICheatMenu successfully loaded```
#
WARN : Lua         , 1663625615578> LuaManager$GlobalObject.require> require("Recipecode") failed
WARN : Lua         , 1663625615579> LuaManager$GlobalObject.require> require("XpSystem/XpUpdate") failed```
#
WARN : Lua         , 1663625615556> LuaManager$GlobalObject.require> require("ISTimer") failed```
lime hedge
#

seems this is the require function in java side of the embedded kahlua

mortal widget
#

are there any current plans for a More Gloves type of mod? I feel like there is a very lacky amount of gloves

hearty dew
shrewd heath
#

how i can turn off Zombie dragdown via mods\lua? i have CDDA zombies mod, which override base zombie settings, but looks like enable this dragdown option again. Can i just add ZombiesDragDown = false (this is how it looks in sandbox settings) in his functions somewhere or it doesn't works this way?

weak sierra
#
LOG  : General     , 1663625612225> [UdderlyGuns PPSh] Udderly Gun Reconditioning detected, adding reconditioning recipe.
LOG  : Lua         , 1663625612225> Loading: C:/users/steamuser/Zomboid/Workshop/UdderlyRP/Contents/mods/UdderlyRP/media/lua/shared/UdderlyRP_UdderlyAttachments.lua
Sep 19, 2022 6:13:32 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: Error found in LUA file: C:/users/steamuser/Zomboid/Workshop/UdderlyRP/Contents/mods/UdderlyRP/media/lua/shared/UdderlyRP_UdderlyAttachments.lua
ERROR: General     , 1663625612233> ExceptionLogger.logException> Exception thrown se.krka.kahlua.vm.KahluaException: UdderlyRP_UdderlyAttachments.lua:4: unexpected symbol near `=` at LexState.lexerror line:278.
ERROR: General     , 1663625612234> DebugLogStream.printException> Stack trace:
se.krka.kahlua.vm.KahluaException: UdderlyRP_UdderlyAttachments.lua:4: unexpected symbol near `=`
    at org.luaj.kahluafork.compiler.LexState.lexerror(LexState.java:278)```
#

you'd think this is a straightforward thing to debug

#
print("[UdderlyRP Undead Survivor Patch] Looking for Udderly Gun Reconditioning..")
if UdderlyGunReconditioning and UdderlyGunReconditioning.RecipeAssignments then
    print("[UdderlyRP Undead Survivor Patch] Udderly Gun Reconditioning detected, adding reconditioning recipe.")
    table.insert(UdderlyGunReconditioning.RecipeAssignments[7], "ReconditionHeadhunterRifle")
    table.insert(UdderlyGunReconditioning.RecipeAssignments[7], "ReconditionDeadlyHeadhunterRifle")
end```
#

but this is that entire file

#
print("[UdderlyGuns PPSh] Looking for Udderly Gun Reconditioning..")
if UdderlyGunReconditioning and UdderlyGunReconditioning.RecipeAssignments then
    print("[UdderlyGuns PPSh] Udderly Gun Reconditioning detected, adding reconditioning recipe.")
    table.insert(UdderlyGunReconditioning.RecipeAssignments[3], "ReconditionPPSh")
end```and here is a nearly identical file that you can see working just fine just before this one
#

:|

#

ik someone will ask so here's the tables it's inserting into

#
--Content of the below should be per-volume of the books, so:
--Pistols, Revolvers, SMGs, ARs, Shotguns, BARs, SARs, LMGs
UdderlyGunReconditioning.RecipeAssignments=
{
    {--Pistols
        "ReconditionTEC9",
        "ReconditionM1911",
        "ReconditionM9",
        "ReconditionG17",
        "ReconditionDE",
        "ReconditionP228",
    },
    {--Revolvers
        "ReconditionM105",
        "ReconditionMagnum",
        "ReconditionM625",
    },
    {--SMGs
        "ReconditionMP5",
        "ReconditionMP5SD",
    },
    {--ARs
        "ReconditionAK47",
        "ReconditionAK47F",
        "ReconditionCAR15",
        "ReconditionCAR15D",
        "ReconditionM16",
    },
    {--Shotguns
        "ReconditionM500",
        "ReconditionM500Sawnoff",
        "ReconditionM500SawnoffNoStock",
        "ReconditionDoubleBarrelShotgun",
        "ReconditionDoubleBarrelShotgunSawnoff",
        "ReconditionSP12",
        "ReconditionSP12F",
    },
    {--BARs
        "ReconditionR700",
        "ReconditionW1866",
    },
    {--SARs
        "ReconditionR1022",
        "ReconditionMR223",
        "ReconditionMR223F",
        "ReconditionM14",
        "ReconditionSKS",
        "ReconditionMSR788",
    },
    {--LMGs

    }
}```
#

ran it on rextester and no errors

#

did i find a bug in the parser? :p

willow estuary
weak sierra
#

it has been yes

#

and the other script that works the same way executes with no error

#
print("[UdderlyGunReconditioning] Initializing Database..")

UdderlyGunReconditioning={}

UdderlyGunReconditioning.Magazines = 
{
    "Magazine_UdderlyGunReconditioning_1_Pistol",
    "Magazine_UdderlyGunReconditioning_2_Revolver",
    "Magazine_UdderlyGunReconditioning_3_SMG",
    "Magazine_UdderlyGunReconditioning_4_AR",
    "Magazine_UdderlyGunReconditioning_5_Shotgun",
    "Magazine_UdderlyGunReconditioning_6_BAR",
    "Magazine_UdderlyGunReconditioning_7_SAR",
    "Magazine_UdderlyGunReconditioning_8_LMG",
}

UdderlyGunReconditioning.Books =
{
    "MaintenanceVol1",
    "MaintenanceVol2",
    "MaintenanceVol3",
    "MaintenanceVol4",
    "MaintenanceVol5",
}
#

here is the bit of file preceding that

#

the bit after that does loops to assign recipes to magazines dynamically

#

all tested and working in a released mod

#

with one client mod inserting its recipe

#

(which still works right now, in the same run, that second example of code)

#

you can see its output in the error i posted just above the problems

shadow geyser
# hearty dew How do you specify the path when trying to `require` a file between two mods? Ar...

yep. one thing to consider about mods is that they don't differentiate files from different mods. its a weird behavior on how they are loaded. so if in mod1 you have media/lua/client/file.lua, and in mod2, you have an identical filepath media/lua/client/file.lua but with different content, only one of those files will be loaded and read. I can't quite remember the exact ordering mechanism(been a while since it mattered to me), but if I remember correctly, for SP and hosted MP, they load in order of workshop id, last is the one that is kept, then in dedicated server, they load in the order of the workshop id's listed in the server.ini, again the last one is kept. this applies to all mod files, so xmls, .png, .txt, .lua, etc... As for the difference in client and server stuff, im actually not sure. I've never tried loading another client file from either server or shared or vice-versa, only from the same folders. I would guess that the require statement would see everything in SP, since they aren't separated, but then in MP, the server and client are properly separated so you wouldn't be able to require a client file from server file or vice versa

weak sierra
#

it's a good idea to prefix your mod files with the mod name

#

for that reason

#

when they are not sufficiently unique

shadow geyser
#

its why you get issues with some older mods. there are alot of mods that used generic file names like "books.txt". They would conflict with each other because only one file would get loaded, as the last one would supercede the other "books.txt" files

weak sierra
#

or put them in a uniquely named folder if possible

#

that same behavior lets you prevent others' code from running and/or replacing it with yours though

#

which is important

#

let's try restarting PZ and testing it again

#

i know for a fact that junk remains in PZ that isn't unloaded when you reload lua

#

because sometimes things break on click to start with a getTexture() error loop

#

and a restart fixes it

#

so let's seeee

hearty dew
weak sierra
#

they do function that way as well

#

it's a useful feature, but it'd be nice if it were somehow controllable

#

too late now without breaking things though

#

hehe

undone crescent
#

hey guys, im kinda hardstuck on a project of mine. it worked perfectly fine in singleplayer but in multiplayer it acts all wierd. so i wanna spawn a zombie via a recipe and like i said in SP no problem, but in MP it either doesnt spawn at all or spawn and i am the only one seeing it but i can kill it multiple times and so on. this is the spawn command im using in the lua, anyone has an idea? thanks in advance! ๐Ÿ™‚

weak sierra
#

well

#

i guess the default could be on an a new "don't do that" config-per-file-file could be introduced

#

without breaking new things

#

but so few people would end up using that

#

w/o default

#

that it's a pointless investment of their time

weak sierra
#

oh

#

i read the rest

#

it must be spawning it clientside and not with the server

#

u have to send a server command to the server probably

#

to make it actually "exist"

undone crescent
#

ahhh this is why it works SP and not MP?

shadow geyser
#

the Oncreate is properly in the server folder right?

undone crescent
#

yeah it is

shadow geyser
#

it is entirely possible that the createHordeFromTo doesn't work in MP. I can only see it being used in the challenge maps stuff which I think are all SP? I haven't actually played them much

undone crescent
#

well i had the very same problem with the addzombiesinoutfit command โ˜น๏ธ

shadow geyser
#

if you just want to create a horde, you should probably check what the admin menu in MP calls and use that function instead, as it isn't using createhordefromto there.

weak sierra
#

any idea how to find the java for functions that a search in teh decompile only gives results in the lua for?

#

u see any calls to it, then the stub that exposes it

#

and then nothing on the java side comes up cowThink

#

createhordefromto is an example

#

so where do those stubs point? xD

quasi geode
#

global lua functions defined by java are in Lua\LuaManager.class

#
      @LuaMethod(
         name = "createHordeFromTo",
         global = true
      )
      public static void createHordeFromTo(float var0, float var1, float var2, float var3, int var4) {
         ZombiePopulationManager.instance.createHordeFromTo((int)var0, (int)var1, (int)var2, (int)var3, var4);
      }
weak sierra
#

then.. why is intellij not telling me about them i guess is the real question

#

xD

#

hm searching that file doesnt show it either

shadow geyser
#

change the search thing from directory to scope, then all places

weak sierra
weak sierra
#

nope lol

#

this has led me to dead ends on a number of things in the past few weeks

#

trying to guess what args are supposed to be, etc

#

followed konijima's guide

#

oh shit

#

thjere's a file mask on

#

alright let's turn that thing off.

#

there we go.

#

i hate jetbrains products, their UIs are always so odd

#

things in weird spots, windows that disappear when u click on something or off of it

#

etc

#

solid under the hood, just the UI..

quasi geode
# weak sierra i suspect the random failure of require on my end has to do with being on linux

there shouldnt be any issue with require. it just gets used wrong. pointing to your second random example there:

LOG  : Lua         , 1663625615578> Loading: Z:/home/evelyn/.local/share/Steam/steamapps/workshop/content/108600/2335368829/mods/Authentic Z - Lite/media/lua/client/TimedActions/AuthenticZ_RecipeCode.lua
WARN : Lua         , 1663625615578> LuaManager$GlobalObject.require> require("Recipecode") failed
WARN : Lua         , 1663625615579> LuaManager$GlobalObject.require> require("XpSystem/XpUpdate") failed

this is a file in client trying to require 2 files in server (can only require in shared or same root ie: client)

#

i dont have cheatmenu so cant check the location of the failed requires on the other examples there

weak sierra
#

i don't know where those are off the top of my head, but im guessing u looked or know the locations already

#

that explains some things..

#

but i thought require stops the file from loading if it fails

#

so how come things just.. work anyway?

quasi geode
#

it doesnt

weak sierra
#

ah so parts of mods are just not running

#

and the makers don't realize

#

and work around it?

#

:P

#

that's.. sad

#

i don't use require, so that my code fails miserably if something isn't loaded MD_SkadiNod

#

no secrets there, hehe

quasi geode
#

its amazing how many people dont actually check the console for errors when they mod (or just ignore them i guess) ๐Ÿ˜…

willow estuary
#

It would be a mistake to assume that any modders, no matter how many thousands of subs they have, knows what they're doing.

I need a vomit bucket when I look at the old code in my own mods, for example.

worldly olive
#

Even when old ๐Ÿ˜‚

willow estuary
#

Oh lordy, I'm sure there's a regular rogue's gallery of bad practices lurking in them stressed

worldly olive
#

I was able to disable Survivor Vehicles with a mod thanks to the Worse Vehicle code ๐Ÿ˜‚ glad that option is added to vanilla now ๐Ÿ˜› hope Worse Vehicle will eventually vanilla too ๐Ÿ‘€

weak sierra
#

so

#

apparently the file is loading just fine, because it actually inserts the things just fine

#
LOG  : General     , 1663628195197> [UdderlyGunReconditioning] Could not find recipe "ReconditionDeadlyHeadhunterRifle", skipping.```
#

this is it processing it later

#

so the error is meaningless from a practical perspective yet undesirable

#

:|