#mod_development

1 messages ยท Page 362 of 1

bright fog
#

Store things in it

#

And forget about any kind of saving

#

It already saves when you quit the save

sour island
#

To be pedantic, the game saves the table for you

raven epoch
#

so mod data does save

bright fog
#

Yes but you SHOULDN'T SAVE YOURSELF

#

It already saves

raven epoch
#

oh ok ok heres where we

#

misunderstood

#

i understand it now

#

i dont use mod data to hold

#

in game objects

#

i use a module

#

i use mod data to save stuff

bright fog
#

Don't use a module

bright fog
#

Directly use the mod data

#

If your data is persistent: use mod data
If your data doesn't need to be persistent: use a module

raven epoch
#

well most stuff doesnt need to be thats why

bright fog
#

Then use a module for these

raven epoch
#

i just need 5 values to save right now

#

thats what i was trying to make

sour island
#

Also you can only save basic data types

raven epoch
bright fog
#

You're saving !

#

Don't save anything

#

Directly store in that fucking table

#

It's a table

raven epoch
#

thats what i am doing by saving ๐Ÿ˜ญ

bright fog
#

use it as a table

raven epoch
#

i just put the stuff i want to save in that table

bright fog
#

DIRECTLY use the table

#

Don't do any storing in a module then save in the mod data

#

DIRECTLY store in the mod data table

#

it's a table

raven epoch
#

but wouldnt i save bazillion unnecessary stuff

#

if i do that

bright fog
#

Why ????? You already controll what you put in it !

#

IT'S A FUCKING TABLE

raven epoch
#

ok ok look i get that

#

ik im a bit slow

bright fog
#

If you don't want to put things in that table then don't do it ???

raven epoch
#

look

#

i got a table named structure right

#

it holds all these

#

AND

#

all these

#

BUT

#

for it to persist between saves

#

i only need these guys

#

the rest i need during runtime

#

thats what i am trying to do

sour island
#

If you're creating structures why do you need modData?

raven epoch
#

its a weird naming its not really a structure

#

its a point that when u get close to it

#

spawns npcs and updates itself according to time

#

so first days it spawns 3 -4 npcs all brand new equipment

#

then it becomes worse as time goes on

#

it also adds fortifiactions

#

i just need to make this point persist between saves

bright fog
#

Your structures are generic structures, have an ID associated to it and in global mod data store the reference to that structure and some condition for spawning and coordinates and done

#

You don't need to store a copy of the generic data, that's stupid

raven epoch
#

problem is when i do that it for some reason loads from nothing??

sour island
#

Well anything you add to the table is "saved" - I can't really grasp what your save function is doing either

raven epoch
#

getting needed save data and making a new table

#

then when game loads i respawn the structures from that table

bright fog
#

I don't know what to tell you more than properly develop your systems you are using

sour island
#

When you say it loads from nothing - do you mean a fresh game or?

bright fog
#

It's classic programming here, verify anything you use to get the data is the proper ID, and that it exists and that you check the right table etc etc

raven epoch
#

yeah i make a fresh game right

bright fog
#

You are saving your data with OnSave

#

I said don't save anything

#

That's the reason your mod data swaps between saves

raven epoch
#

aah

#

so ur saying i should put it into mod data

bright fog
#

Because you store shit in mod data via OnSave but the mod data is ALREADY saved in that fucking event

raven epoch
#

the moment i make it

bright fog
#

I'm not saying anything, you just didn't understand what mod data is

#

Don't. Save. Anything.

#

It already saves

#

Use the mod data as a persistent table between sessions, that's it

sour island
#

Wait how/why does OnSave migrate the modData? ๐Ÿ˜ฎ that sounds useful/fun

raven epoch
#

EXCEPT

#

build structure is false so it means it loaded the building somehow

#

got it from mod data

bright fog
raven epoch
#

when the mod data is supposed to be an empty table since its a fresh save

bright fog
raven epoch
#

oh he did the same as me

bright fog
bright fog
#

That dates back from literally this night

raven epoch
#

no no we are not manually saving mod data

bright fog
#

Yes you fucking are !

raven epoch
#

we are putting stuff that needs to be saved in mod data when the game is saving

bright fog
#

Wtf are you saying, you have a save function that you trigger OnSave

bright fog
#

That's literally NOT what you should do

sour island
bright fog
#

You should ALREADY store the data dynamically during your session

raven epoch
#

ah alright

sour island
#

You guys are talking past each other a bit, lol

bright fog
#

You shouldn't store anything during OnSave because you should have already done it when shit runs

raven epoch
#

ok ok now i get it

#

so i will save stuff directly when i make a new structure

#

by save i mean

#

put it into mod data

sour island
#

"store"

raven epoch
#

ye that

#

lemme try that rq

#

hold on zomboid got stuck

#

ok something keeps erroring

#

when i exit the game

#

and then i cant load the save anymore

#

trying to fix that rn

#

yep

#

it errors and when i open up f11 no errors there

#

when i load the save it plays the you died stuff and i get stuck in a black screen

#

all i added really

#

disabled onSave function

#

just added this when i spawn a new militarystructure

#

oh there we go

#

fixed THAT

#

still not loading

#

i officially beat the game

#

peak mod breaks the game loading system

shy latch
#

could someone make a mod to add in the ghost/war camaro it has a really cool story behind it & it just look like a zombie killing machine

#

it was a special forces vehicle for the Danish back in the 90's it would deliver aid in a war torn bosnia with special inferred scrambling black paint. lined with kevlar & steel for bullet & explosive protection ,inferred headlamps , a nitrous system both the car & drivers are heros

shy latch
raven epoch
#

when should i use randomizedworldbase and when should i use the classes themselves?

safe lagoon
#

Thinking of making a mod to allow you to break up Salt Licks for salt, any balancing ideas?

willow tulip
#

Could also take a very long time to do, like 30 seconds (I believe its 50 'craft time' per second?)

#

... Hu, I just realized crafting recipes don't make noise(?)

#

that should totally be a thing.

safe lagoon
#

But I was more talking "how much salt do you get"

willow tulip
#

10 'regular salts' that is, I believe each 'regular salt' still has a number of uses

tough gulch
#

Are we allowed to commission people to port mods in this server? I've gotten permission from the owner I just don't really have much coding knowledge lol.

bronze yoke
#

watch out for scammers in your dms, once you say the c word you'll get a bunch dming you

tough gulch
#

Will do! Appreciate the help!

safe lagoon
sly gazelle
#

i was trying to update this mod to work with build 42.13 (until 42.12 it worked fine), but when i tried to enable it on my game (i've downloaded the files using steamcmd and placed on Zomboid\Workshop\ExtraElectricTrait\Contents\mods\ExtraElectricTrait) creating a new sandbox save and tried to select one of the traits, it did a weird system-wide crash, and when i rebooted the pc and opened again the game, the mod wasn't listed on the Mod Manager menu anymore.

bright fog
#

They now depend on a registry and they are defined using a script

wet sandal
#

This is absolutely not where I expected to find my FPS ending performance issue:

bright fog
#

You made a whole UI to see the performance impact of elements in your UI ?

#

God damn

wet sandal
#

Gotta do what ya gotta do

bright fog
#

Also maybe imgui has that already built-in ? I don't remember seeing anything like it tho

wet sandal
#

I'll stop being lazy eventually and see about getting some PRs up for the community debug tools.

bright fog
#

I had to disable some systems that were too buggy

#

I improved the Lua reloader so you can actually reorder the reloading of fixes

wet sandal
#

But its one of those things where if you don't design for it, you lose it

glad sentinel
#

is there a way to delete some of the games java code with lua?

#

not really good with modding im just trying to get rid of forced fast shamblers on b42mp and have some sprinters in a server

bright fog
#

That'd be insanely powerful tbh

#

But you need a Java mod for that

glad sentinel
#

hmm

rain berry
glad sentinel
#

how would i make a java mod to just delete that segment? sorry i have like literally zero experience in java moddin...

rain berry
#

where you can armour up cars

glad sentinel
#

like would i just remove the segment andd recompile it and just let people replace their gamefiles with that?

bright fog
#

But it's way more complicated than that

#

Bcs the problem with a Java mod is that it needs to be manually installed

#

And you better pray that this code only runs server side or every players need to install that Java mod

glad sentinel
#

shit youre right...

#

it should only change the config files no way they put more checks to make sure sprinters arent real...

bright fog
#

That too yea lol

glad sentinel
#

another issue how would i recompile the decompiled code....

bright fog
#

There's no guide on that currently, but if you search for some key terms here or in the modding Discord you will probably find some info

#

There's some modders that know about the details of it

glad sentinel
#

ah hmm

bronze yoke
#

javac -cp projectzomboid.jar MyFile.java

shy latch
glad sentinel
#

ah!

rain berry
glad sentinel
bronze yoke
#

did you give it the path to projectzomboid.jar

glad sentinel
#

ah shoot youre right i totally forgot about this uhm ill try it again

#

does this just compile it directly to the zomboid jar file?

#

it doesnt seem to have worked heres what i edited out and saved

bronze yoke
#

it creates the class files next to the java file, you need to copy them into the jar

glad sentinel
#

ah thank you!

willow tulip
#

you can not override java functions called by java using LUA.

#

(this is how inventory capacity override mods work)

willow tulip
glad sentinel
#

i used winrar to replace the files in the jar but uh

#

it seems like it bricked server settings

willow tulip
#

(IMO, this is a cleaner way to install java mods because you can uninstall all java mods by deleting the zombie dir, and its much easier to make a batch file that compiles your mod and copies it to zombie, for the next test run)

willow tulip
#

lUa, where l tells you that its a long type and Ua is the type name.

glad sentinel
#

commenting out the block of code preventing you from getting sprinters just bricks the setting editor this is going to kill me

willow tulip
glad sentinel
#

no way right all that code block does is just to set a number to 2 if its 1 or 4

#

if its the sprinters it should atleast let me open up my game before exploding surely

willow tulip
#

yea im saying its blocking code that is horribly broken. like, really, nth level, horribly broken.

#

didn't even try to make work.

glad sentinel
willow tulip
#

thats the whole point of it.. to prevent the broken code from running.

#

if it was only half broken, they would have just shipped it and told us 'lol thats what unstable means' when we complain that sprinters randomly turn into 50' tall titan zombies and rampage across the map

glad sentinel
#

how could this be so fucked man shit...

willow tulip
#

because they had to like... rewrite 1/4 of the game for MP?

#

proper server side MP

#

not like the hacked client side MP that B41 had

glad sentinel
#

ill test it again but this time recompiling with no changes to just see what happens

willow tulip
#

B42 at least tries to be server authorative.

glad sentinel
#

wow i just guess even calling setting to be 1 or 4 completely bricks the game

#

i guess sprinters are locked away for eternity until next patch

#

its so weird becasue just the other day i saw sprinters in a game in b42 mp when there were supposed to be no sprinters

shy mantle
#

Man am I happy the OnThrowableExplode event exists, gonna add some vehicle "landmines" nonsense lol

willow tulip
brave bone
#

quick question: how do you guys detect singleplayer , mp and coop(the splitscreenthing)?

wet sandal
bronze yoke
#

there is no host state

wet sandal
#

No? Thought that was a thing

bronze yoke
#

when you 'host' in-game, it just runs a dedicated server in the background and connects to it

#

so there is a separate client and server process as normal

red blade
#

i had an idea for a mod that you can choke zombies to death instead of stomping them which is loud and can attract other zombies (? idk about this lol)

tight elm
#

I guess a chokehold from behind is okayish, but still risky if you misplace your hand

red blade
#

that could be a drawback to the thing

#

the mod could create new opportunities for killing outside bonking zombies oer the head or shooting them

#

like you can straddle and strangle them but you're anim locked or the zombie can bite back

scenic tusk
#

Hi quick question, im setting up umbrella with emmylua, when i try to make a new file in the zomboidworkspace it just tries to put it in one of the other folders, does it need to go into one of them or does it need to go into the main root?

raven epoch
#

Main root

#

ฤฐf i remember correctly

scenic tusk
#

I tried putting one in the root for each folder because I cant put one in the workspace root itself so im working on seeing if thatll work

raven epoch
#

Oh u mean any new file?

#

Or u mean emmysjson tmthingy

scenic tusk
#

the emmyjson

raven epoch
#

Root

scenic tusk
#

is there a way to put it in the workspace root or do i need to put one in each folders root because I cant get it to make a file in the main workspace root

#

i made a workspace and then opened both my mod folder and the media folder

#

for easier reference

raven epoch
#

Gimme min

scenic tusk
#

alrightly

#

also i had seen someone had syntax coloring for the recipe and item files and i was under the impression it was part of this but as far as i can see this is only lua files?

raven epoch
#

Ok dont know

#

Dont have much exp with visual studio

scenic tusk
#

yea now that im actually setting it up even what i did isnt working anyways

#

unless its just not possible to use the plugin for the base code of the game

#

oh i didnt even download umbrella im sure thats pretty important

#

๐Ÿคฆโ€โ™‚๏ธ

scenic tusk
#

does anyone know if its possible to get umbrella working for the entire media folder or is it only useful for a personal files

torn slate
#

wdym personal file?

scenic tusk
#

as in my own mod folder

torn slate
#

as far as i know you have to manually enable it for every wokrspace

scenic tusk
#

im trying to set it up for both my folder and the media folder but neither are working

raven epoch
#

did u make

#

emmyrc.json

scenic tusk
#

yes

#

for both folders

raven epoch
#

u added the library path?

scenic tusk
#

yes

raven epoch
#

u got emmylua enabled?

scenic tusk
#

yes ive even tried restarting it a few times

raven epoch
#

send screenshoty

#

make sure ur path is valid

scenic tusk
#

what specifically the emmyrc?

raven epoch
#

y

scenic tusk
#

this first one is for my mod folder and the lua file im using is just a random lua script i pasted from the media folder to test because i dont even have any of my own right now

#

and this one is for the media folder which im not even sure if itll read it right for this one so i dont really mind this not working

crimson ore
#

any1 know how to add an item or loop via OnZombieDead?

raven epoch
#

lemme check doc

#

maybe the extra arguments are causing it?

#

installation says to just add library

#

waaait

#

ayo

#

@scenic tusk

#

do C:/

scenic tusk
#

oh my i didnt even catch that

#

unfortunately that still didnt fix it

raven epoch
#

hmm

#

are u sure ur path is valid

#

u can just

#

click the bar on top in file explorer

scenic tusk
#

yea i could try going the full path from user to library but c-docs-umbrella should work too

raven epoch
#

to get file path then change \ to /

#

try it i guess

#

though

#

seems to be working?

#

if its giving u 9+ thingy

#

if its not from another extension

scenic tusk
#

whats the 9+

raven epoch
#

so 9+ problems

scenic tusk
#

now files in media are just saying problems instead of errors

#

yea so maybe it was the path

raven epoch
#

if it autocompletes

#

like try writing

#

IsoPlayer

scenic tusk
#

ah it does

#

so its working

#

thank you

raven epoch
#

ye then u got it working ye

#

ur welcome

#

are u using

#

b41 or b42

scenic tusk
#

42

raven epoch
#

aight

#

just asking cus sometimes

#

it says stuff are problems

#

when they are not

#

at least in b41

#

anyway i got a problem of me own

#

i cant figure out how to play an animation without the conditions

scenic tusk
#

ive never touched animations so thats out of my ball park but good luck dawg

raven epoch
#

ye ty

#

animation fit or no?

#

tried to get forage anim but couldnt do it

scenic tusk
#

yea kinda looks like theyre either taking notes or diagnosing something out of a book

#

is there a way in game with the debugger to see if a lua script is even working im trying to added an object the foraging table and even after setting it to 100% on roads with max foraging im struggling to find it so something i did isnt right im assuming

raven epoch
#

to see if the script runs

#

you can also use f11 to check for errors

scenic tusk
#

smart

raven epoch
#

f11 -> play button -> it will stop when errored

#

and also show u where it errored

#

pretty useful

scenic tusk
#

are lua prints just print() or are they different

raven epoch
#

just print() ye

scenic tusk
#

im used to python and c#

#

alr

#

it would have put it int he output log correct because if so then no my script isnt being called

raven epoch
#

it would yes

scenic tusk
#

im trying to base my code off of another mod mixed with the base game foraging categories but its struggling

#

as far as the structure i would just put it like media/lua/shared correct

raven epoch
#

yeah

#

client if u want on client server if u want on server

#

shared if u want on both

scenic tusk
#

yea im just using shared for it because the base categories and the modded categories are both in shared so i think it should work fine there

raven epoch
#

did u connect to any events

scenic tusk
#

i believe so

civic galleon
#

.lua in /Server run on both client and server.

raven epoch
scenic tusk
#

im not sure this is my first time touching lua scripts in here

raven epoch
#

whats the point then ๐Ÿ˜ญ

raven epoch
civic galleon
#

You have to use isClient() and isServer() to filter. That said, I must have done something wrong because I needed both isClient() and sendClientCommand() workflows to separate

scenic tusk
civic galleon
raven epoch
#

if client can see server code thats just asking for exploits

scenic tusk
#

wouldnt server only run on both if its the host running it

bright fog
civic galleon
# scenic tusk wouldnt server only run on both if its the host running it

Don't ask me I didn't write this. I got just as confused as y'all hahahahaha.

I was having even weirder shit like a single file prints to the server-console.txt but when I filter out server code with isClient then it stopped printing to server-console.txt. I will likely never have a real answer

bright fog
#

Also I suggest using locals, not globals

raven epoch
#

oh hey sim i fixed that mod data bug thingy from yesterday

#

ty for help

scenic tusk
#

this is just copied code im trying to decipher as i go

raven epoch
#

since u know c# and python all u gotta learn is tables and ur good to go with lua

bright fog
#

Yea

scenic tusk
#

and also pzs references in general but im piecing that together

civic galleon
#

No proper switch-case, lua officially sub tier /s

#

I say this as a complete js/ts heathen. Speaking of, does LUA have self invoking functions?

raven epoch
#
local Skibidi = { -- this is a table
  [1] = "Testing1", -- integer to string key example
  ["Toilet"] = "Rot", -- string to string
  ["SkibidiFunction"] = function(ExampleArgument)-- string to function adress
      print(ExampleArgument)
  end,
  ExampleStringKey = "Goo" -- strings dont need brackets to add into key
}

print(Skibidi[1])
print(Skibidi["Toilet"])
print(Skibidi.Toilet) -- same thing as above
Skibidi["SkibidiFunction"]("test")
Skibidi.SkibidiFunction("test")

local Table2 = {} -- make a new unique table
Skibidi[Table2] = "example2" -- table adress to string

print(Skibidi[Table2])

most of what u need to know

scenic tusk
bright fog
#

You mean class methods ?

bright fog
#

If it was properly setup, you shouldn't get a single error, if your code is well typed and written

#

But Java elements like that if highlighten means no Umbrella

scenic tusk
#

oh i figured i had it working when it went from errors to problems

civic galleon
bright fog
bright fog
scenic tusk
#

does emmylua have build in autocorrect for pz?

bright fog
#

So function definition that instantly calls itself ?

bright fog
civic galleon
#

I'm that jerk that pretends TS is for people who need training wheels (type checking is very important please don't kill me)

scenic tusk
civic galleon
#

Pffft, what do you mean you don't purposely mutate booleans into arrays?

bright fog
bright fog
scenic tusk
#

as far as im aware

bright fog
#

I've been working on a video guide for installing EmmyLua but it's not ready

bright fog
civic galleon
bright fog
scenic tusk
#

yea i had run a restart each time i changed the emmyrc but just did it again and still does not fix the issue

civic galleon
#

Is JavaScript you dont, they made typescript so you could (I'm pretty sure you could in js but no one did)
|| Yup, you can do typeof yourVariable to check a variables data type in JS||

raven epoch
#

is it possible to play an animation such as foraging without the istimedaction itself?

scenic tusk
#

also sim you would know better than most im guessing, is it possible to use umbrella on the base code files itself?

silent zealot
#

I open a second VS Code, and then open the Zomboid media folder (and decompiled java)

#

That's my reference VS Code, and the umbrella highlighting works in that

scenic tusk
#

second might work better im currently attempting to use one workspace for the different folders just for easier reference and then i tried setting up an emmyrc in each root

bright fog
#

I usually don't do it, but I should try with EmmyLua to see if it's different

scenic tusk
#

everytime it loads its definetly slow but not awful and i have a pretty beefy computer so i should be fine with that part

scenic tusk
#

yea even making it its own workspace with one emmyrc file isnt helping

bright fog
#

What is your file named like ?

scenic tusk
#

.emmyrc.json

#

if thats the one you mean

bright fog
#

Where did you put it ?

scenic tusk
#

the workspace root

#

like i said part of it is working i just so happen to be getting problem codes

#

i get autocorrects though

bright fog
#

Can you show the error you are getting when hovering Events ?

scenic tusk
#

just undefined globals

#

thats all the errors

raven epoch
#

maybe ur umbrella file has a problem?

scenic tusk
#

i also get an error with the code im actually trying to do but i think im just calling the wrong thing

raven epoch
#

u downloaded from releases?

scenic tusk
#

not sure i downloaded the most recent one

raven epoch
#

show umbrella file screenshot

scenic tusk
#

not much going on

#

i renamed the file from the original name but i still call to this one in the emmyrc

#

used to be umbrella-main

#

but i dont think that has anything to do with it

bright fog
raven epoch
#

ok same as mine

#

weird

bright fog
#

You don't have 2 Lua extension ?

scenic tusk
#

i have the official lua one

bright fog
#

You have 2

#

The 2nd one is LuaLs

scenic tusk
#

ohhhhhh

bright fog
#

Uninstall it

#

Only use EmmyLua

scenic tusk
#

bingo

scenic tusk
#

im dumb i saw that and didnt pay much attention i thought it was autodownloaded because i had setup vs for lua

raven epoch
#

tried PlayAnimation but didnt work (prob because of conditions)

bright fog
#

What tipped me to that conclusion is that it does in fact show you the content of Events so you have 2 conflicting information in that hover

bright fog
raven epoch
#

okey

scenic tusk
#

any good resources in here or the modding discord on how to add something to the foraging table

#

i thought it would be simpler i just need to add a pre-existing item to a pre-existing category

raven epoch
#

best way i found was to

#

look at existing mods

scenic tusk
#

yea thats what ive been doing it just hasnt worked out the best so far but im trying something right now because i just noticed a comma that didnt need to be there

#

are folders past the shared folder required for scripts to be recognized

#

or is that just organizational

raven epoch
#

just organizational

#

u can slap it in there

scenic tusk
#

like do i need to make a media/lua/shared/Foraging/script.lua

#

okay i thought so

#

ill see if itll work now

#

hip hip horray ive foraged a salt lick block

#

now unfornuately the salt lick doesnt have much going for it like a proper icon or much of anything

steel plinth
#

I'm total newbie in PZ modding, but can someone explain how to do a mod for MP 42.13 that allows players to claim custom buildings as safehouses or how to avoid the game restrictions for that? Right now in vanilla players can't create safehouses in their own buildings ๐Ÿ˜ข
Or maybe someone know about existing working mods with this functions?

Thx for any help!)

scenic tusk
#

anyone know what i could do to do fix the icon/pick up tooltip

#

or atleast where to look to play with it

#

the people need salt

#

is it possible to make an icon that would overide the base game one

#

ping me if anyone has some info i didnt even realize its 7 in the morning

crimson ore
#

anyway of using proclist in a func?

bright fog
bright fog
bright fog
crimson ore
# bright fog proclist ?

ProceduralDistributions.list etc. i can get bags and things to spawn in zack inventory using onzombiedead but id like to use a list. for reasons i cannot explain i dont wanna do it the usual way

steel plinth
bright fog
#

Those mods have guides

#

The true music radio mod simplies uses true music cassettes I believe

#

There's nothing special to do

bright fog
crimson ore
bright fog
crimson ore
#

satic list?

bright fog
#

No it's not static

raven epoch
#

what is larger than a cell

bright fog
#

It's a Lua table

bright fog
raven epoch
#

ok omw to run target finding performance to the ground

#

actually nvm a cell is big enough

raven epoch
#

any ideas on why WalkToTimedAction would not work?

#

it works sometimes but doesnt work more often

#

im guessing the action itself has a range limit but there is no such thing in its lua file

signal dew
#

๐Ÿค” hello guys, I have a question to ask

#

If I subscribe to my map mod and also have its local version, and then I update the local version but haven't uploaded it to the creative workshop yet, will there be any problems when I use my subscribed map in multiplayer games?

small osprey
tranquil kindle
# signal dew If I subscribe to my map mod and also have its local version, and then I update ...

Game will always load steam subscribed version over local. You might end up doing changes on local, but it will still load steam version and you might wonder why changes aren't doing anything, thats because of that. If you work on your mod and want to see changes you need to unsubscribe mod, but then if you want to play On server, just subscribe it back, otherwise it wont let you due the diffrence in files

signal dew
tranquil kindle
signal dew
tranquil kindle
#

I don't know how updating Map mods works. I assume its diffrent compared to normal mods as You can't really add new map mods to ongoing saves without hoops N loops (it is possible i heard, but i have no idea about map mods).

#

Id suggest ask in Mapping if you have map mod related questions

signal dew
tranquil kindle
#

Updating the map on local should not effect anything AS long as you don't update Workshop item IF the server is using Workshop one to begin with

signal dew
tranquil kindle
#

But updating map mod works in diffrent way than other mods AS FAR AS I KNOW. I heard that updating map mod will break servers IF you don't know what youre doing

#

Not only your server, bur pretty much every server that uses it and they don't have backup

#

Though steam offers to revert to older versions on steam workshop, but if it would fix broken server already affected? I don't know that.

#

Map modding is very unique in terms that it takes alot of time, skill, creativity and pretty much knowing what you do, because people's servers are at stake and they might come to you with pitchforks

signal dew
#

oh Damn, I'll just hold off on updating the version for now

#

I just did some bug fixes and adjusted the orientation of furniture in certain buildings, and then I added some furniture that I made myself

tranquil kindle
#

As i said, if you're just stating mapping i'd really suggest asking people that have done maps. I'm 3d/texture oriented modder, but i've been part of servers that closed because of poorly updated map mods that were cause to wipe progress

signal dew
#

I am also inquiring on the unofficial pz map channel

#

It's just that there aren't many people around during this time period

tranquil kindle
#

One is losing items because the item that adds them failed, but the way zomboid maps works is diffrent. IF it were that already created cells no longer need mod once map is created it would be diffrent, but thats not the case from my limited experience

tranquil kindle
signal dew
#

I hope someone can tell me on the unofficial map channel a bit later what would happen if I do that. A few hours later, I should be going to bed

outer crypt
#

running into an odd issue, I can upload a new version of a mod, exactly the same as an old version with a new id name and number, it downloads on my clients without issues but the server will not download it. Even if I push it to the server via ftp it still can't see it. Anyone ever run into that before?

outer crypt
#

odd, I had to completely rebuild the server shrug

worthy wharf
#

version 42
I would like to replace the yellow hazard suit with a different skin
did I miss something?

#

when i change item property ClothingItem = CustomHazmatSuit it goes blank

merry seal
#

Hellur... I am an absolute noob interested in getting into modding. So what does one start with? A cooking mod.. I'm starting simple with one item. Got my item, can spawn it via item viewer. Got my recipe and it registers the in/output. But when I hit craft, it doesn't consume the inputs and doesn't create the output. In my item viewer, the item shows as craft:false. Even if I copy a vanilla recipe into my recipes file it won't craft. I am at an utter loss xD Help please.

worthy wharf
merry seal
#

This is what I'm using:

craftRecipe DehydrateOnion
{
    Time = 100,
    Tags = AnySurfaceCraft;Cooking,
    SkillRequired = Cooking:1,
    category = Cooking,   
    xpAward = Cooking:3,
    AllowBatchCraft = true,

    inputs
    {
        item 1 [Base.Onion] mode:destroy,
    }

    outputs
    {
        item 1 SpiceAHolic.DriedOnion,
    }
}

}

worthy wharf
#

let me see your item SpiceAHolic.DriedOnion,

merry seal
#

item DriedOnion
{
DisplayCategory = Food,
ItemType = base:food,
Weight = 0.1,
Icon = Onion,
FoodType = Vegetable,
DaysFresh = 180,
DaysTotallyRotten = 360,
HungerChange = -5.0,
Calories = 10.0,
Carbohydrates = 2.0,
Lipids = 0.1,
Proteins = 0.3,
StaticModel = Onion,
WorldStaticModel = Onion,
}
}

worthy wharf
#

and the Onion too please

merry seal
#

that's base item

#

I think the item is fine.. given I can spawn it in with the item list viewer

worthy wharf
#

come to BC

#

voice

hot plinth
#

I had a mod Seedy that let people get seeds from crops in older version, but B42 has this basically built in right? Is there anything that isn't included that my mod is worth updating for?

willow tulip
#

Ask me how I know. looks at dashboard that he had to rename files of because it kept loading game files for certain icons

#

You might be able to make your own .pack file, I dunno if mods support them however.

bright fog
bright fog
willow tulip
#

that you can do, also via LUA with doparam I believe.

#

'partial' script override files should also work

#

since those values should just be overwritten

bronze yoke
shy mantle
#

Ignoring what went obviously wrong, did you know a NORMAL race car can spawn from a table of burnt vehicles?

#
ProfessionVehicles.RaceCarBurnt = {
    General = { "Base.RaceCarBurnt", "Base.RaceCar12", "Base.RaceCar34", "Base.RaceCar58", },
    Alternate = { "Base.RaceCarBurnt", },
}

whoops?

sonic hearth
#

Could anyone help/make a no sleep mod for build 42.13.1 singleplayer which simply resets fatigue to 0 every time (you can still sleep but its not needed)? I tried doing it myself and others say that its easy but I just can't make it.

scenic tusk
scenic tusk
bright fog
#

You override a specific parameter in the item script

#

This is simply done by defining that item script again with only the parameter you want to overwrite

#
item itemID
{
icon = ...,
}
unreal copper
#

anyone know where you can change the year for magazines? they moved the file in 42.13 and im not sure where to look

scenic tusk
bright fog
#

Wdym ?

#

The goal is not to bloat that thread

icy night
#

Hi all, anyone know of mods that emit very loud sounds from a tile?

bright fog
icy night
#

trying to make a storm siren, but need examples

bright fog
#

You should be able to find a bunch of examples for this

scenic tusk
#

wouldnt the files for random events have examples of it

willow tulip
icy night
#

ty

bright fog
willow tulip
#

Don't allow spaces and special symbols (except underscores and dashes) in mod id's, dir names and file names.

bright fog
#

An ID being able to have special characters in it is extremely cursed and at the end of the day is sources of problems

willow tulip
#

And im only talking about directories and filenames.

bright fog
#

I still think special characters shouldn't be allowed

#

That'd be a change that would break some mods sure, but it's already breaking the game

#

If you download some chinese mods that have chinese characters in those IDs, filenames and directory names, it throws hidden errors in the console

willow tulip
#

If its supported by windows/linux/mac, it should be supported by games that run on windows/linux/mac. You shouldn't break support for legal filenames just because they upset you.

scenic tusk
#

would that include things like item ids or just the modids and file names

willow tulip
scenic tusk
#

I agree i was just asking because my recipe names use spaces since i couldnt figure out how else to space the words out like the base game recipes

willow tulip
bronze yoke
#

you are absolutely exaggerating how many mods do this

bright fog
#

Agreed

#

Also by keeping to only latin characters, you ensure that'll it work in any OS in fact

#

And in any environment

willow tulip
bright fog
#

Say you accept weird ass formatting for folder names from a weird ass OS or some shit, you basically put yourself in a position where mods are only working for that specific environment

bright fog
willow tulip
#

(without having to have a special language installed)

#

I remember the most fun stuff ever in windows 95/98 era, where you could actually get filenames onto your hard drive with unsupported characters and windows would refuse to delete them -_-;

#

had to drop down to dos and use the 7.3 filename

willow tulip
scenic tusk
#

quick question away from this debate, when i reference an icon can I just reference a file name or does it have to be the same name format as base items

willow tulip
willow tulip
#

if your using get_texture() you need to use the proper filename, if your using icon= then the game will prefix it with Item_ before looking for the file

scenic tusk
#

ive found out why the salt lick icon sits on the foraging thing so oddly

#

anyone know what the base size is for icons?

willow tulip
# scenic tusk

TIL saltlick is 2 tiles tall. Those cows must have really licked the hell outta that thing..

bronze yoke
#

all modern OSes do support spaces in path names but i've found software support is still really spotty so they're worth avoiding

wet sandal
#

RejectSpaces,ReturnToCamel

willow tulip
wet sandal
#

RejectCamel,ReturnToPascal

bronze yoke
#

the terms 'lower camel case' and 'pascal case/upper camel case' are preferable because of this

unreal copper
# bright fog Wdym ?

the little date that comes after a magazine, ex. (HottieZ - May 1992, OSCC Insider - September 1990)

bright fog
willow tulip
#

damn you beat me by that much.

bright fog
#

:3

unreal copper
willow tulip
#

lemme do a file scan...

#
StoryClutter.OfficeTreatClutter = {
    "Base.Apple",
...
    "Base.HottieZ", -- what a scumbag!

Devs be hottie shaming ๐Ÿ˜ข

unreal copper
#

lol

willow tulip
#
    public static void onCreateHottieZ(InventoryItem item) {
        boolean hunkZ = Rand.NextBool(20);
        RecipeCodeHelper.DateResult dateResult = getDate(item, hunkZ ? 1973 : 1953);
        String name = item.getDisplayName();
        if (hunkZ) {
            item.setTexture(Texture.getSharedTexture("Item_MagazineNudie2"));
            item.setWorldStaticModel(ModelKey.HOTTIE_ZGROUND_2);
            item.setStaticModel(ModelKey.HOTTIE_Z2);
            name = Translator.getText("IGUI_MagazineTitle_HunkZ");
        }

        setMagazineName(item, hunkZ ? "HunkZ" : "HottieZ", name, dateResult);
    }
#

ItemCodeOnCreate.java

unreal copper
#

i'm trying to get this for every magazine, would this also work for any other type?

#

also thank you very much for looking

willow tulip
#

Look at ProjectZomboid\media\scripts\generated\items\literature.txt

bright fog
willow tulip
#
item HottieZ {...
OnCreate = ItemCodeOnCreate.onCreateHottieZ,
scenic tusk
#

got it working thanks guys now i just gotta fine tune my art

willow tulip
#

you need to change the onCreate method to your own LUA version of that above function

willow tulip
wet sandal
#

I believe it

willow tulip
#

If you downgrade to B42.12 you might also be able to just grab the old lua onCreateHottieZ() function.

#

(though realistically, you might need B42.11 since they moved a lot of stuff to java in B42.12)

unreal copper
willow tulip
unreal copper
#

ah, i see

bright fog
# willow tulip ? Rephrase?

No way, that's hardcoded ??? surprised reaction, completely shocked (actually shocked) shocked emoji, :o :o

willow tulip
#

you need to basically just readd that, with a new name(?) and then change the onCreate. It might override the java if you have LUA with the same name, I dunno.

bronze yoke
#

it will

#

the recipe code is still invoked through lua

#

the class is exposed so it references the method through lua

willow tulip
willow tulip
willow tulip
#

(Some changes may be needed, since tags massively changed)

unreal copper
bright fog
willow tulip
#

looking at you, lessfull tag

#

grumbles at stupid tag that makes all lighters/smokes/etc spawn at 0~50% capacity, ie average of 25%

scenic tusk
#

much nicer salt lick icons

#

i just found out that changes will update while in game and thats much better than reloading the save everytime i change a small thing

willow tulip
scenic tusk
#

ah well atleast what i was working on was updating that definetly helped

shy mantle
#

@willow tulip do you know the difference between isAlarmed and hasAlarm for vehicles?

willow tulip
#
    public boolean isAlarmed() {
        return this.alarmed;
    }

    public void setAlarmed(boolean alarmed) {
        this.alarmed = alarmed;
        if (alarmed) {
            this.setPreviouslyEntered(false);
        }
    }
#
    public void triggerAlarm() {
        if (this.alarmed && !this.previouslyEntered) {
            this.alarmed = false;
            this.alarmStartTime = GameTime.getInstance().getWorldAgeHours();
            this.alarmAccumulator = 0.0F;
            this.chooseAlarmSound();
            VehicleScript.Sounds sounds = this.script.getSounds();
            boolean bLooping = sounds.alarmLoop.contains(this.chosenAlarmSound);
            if (bLooping) {
                this.onAlarmStart();
            }
        } else {
            this.alarmed = false;
        }
    }
#
        return this.script.getSounds().alarmEnable;
    }
#

So hasAlarm just determins if the car has an alarm sound at all in the scripts, and not if the alarm is currently enabled.

#

isAlarmed tells you if its going to trigger when someone gets in.

shy mantle
#

Yeah, I'd just need isAlarmed then. Had no clue hasAlarm was needed for anything

willow tulip
dusky tartan
#

Hi everyone, I'm brand new to mod making. I'm starting with a custom model helmet, I successfully added the item to the game and it's droppable, pick up-able and properly registers as a helmet and everything. While it initially appeared as an orange question mark, I was successfully able to fix that by solving a discrepancy in one of the XML files. However, now it appears as a blue question mark. I first tried fixing the texture file (I realized it wasn't 256x256) and then re-imported the FBX models with the new texture file in the proper workshop directory and everything, as well as the world model to put it on floors and stuff. Nothing seems to be working :( anybody know what else I should check around for? I can answer any questions about like file directories or send screenshots in-game and stuff if anyone needs. please ping me if you have any ideas ๐Ÿ™

#

wait, it has turned into this like purple-ish one?

bronze yoke
#

missing icon, usually tricked by the Item_ prefix

#

Icon = MyItem, looks for Item_MyItem.png

dusky tartan
#

it's like that on the ground too- even though i supposedly have a worldobject

#

it doesn't even appear on my head :(

bronze yoke
#

if it's like that on the ground the WorldStaticModel does not exist (if it exists but there's something wrong with it it will usually just be invisible)

dusky tartan
#

naur. does that mean my file directory for it is wrong?

dusky tartan
bright fog
#

ops sorry thought you had an icon problem

#

I mean it seems you do anyway

#

For your model can be many reasons, what albion mentions should be correct

#

Make sure to define a WorldStaticModel

dusky tartan
#

like in my xml files?

bright fog
#

No

#

In your script file

#

Uses a model script

dusky tartan
#

omg i think i put the wrong directory halppp

#

ok hold on

bright fog
dusky tartan
#

wait no i didnt its the right directory

#

wtf

bright fog
#

What are you talking about ?

dusky tartan
#

is this not correct??

#

agh nvm i looked at the wiki, this is just straight up incomplete

small osprey
dusky tartan
#

you're right ๐Ÿ˜ญ this was a quick install for me i do love vs code

clear aurora
#

hey, im in my way on making my first mod, im almost finished, but for the final touch i want to make a blender model into an object an place it in the map, is there like a guide for that or smething? thankss

noble fossil
#

To anyone making foraging mods for MP, all new foraging items must be in the base module not a custom module or else they can't be picked up. Nearly every foraging mod for 42 on the workshop has this issue.

winter bolt
#

dont need to include the .fbx though just the name

bright fog
#

Project Zomboid Scripts extension fork

This is a direct fork of the PZ Syntax Extension which provided help in creating scripts. It will be expanded upon in the following days or so.
https://github.com/SirDoggyJvla/pz-syntax-extension
https://marketplace.visualstudio.com/items?itemName=SimKDT.project-zomboid-scripts

GitHub

Contribute to SirDoggyJvla/pz-syntax-extension development by creating an account on GitHub.

sly gazelle
#

I'm editing some scenarios of Pillow's mod, and there is a function that basically wipe all the inventory of the player on the start:

            pl:clearWornItems();
            pl:getInventory():clear();

Is possible to replace this with one that doesn't wipe everything, leaving items like the ID Card that vanilla spawns and the key and stash map (annotated map?) Uncle Dave was a Prepper adds on the player on spawn?

silent zealot
silent zealot
sly gazelle
#

while it mention the key as Base.Key1 i didnt find the item id of the stash map

#

just as an example

silent zealot
#

If tehre is an existing function to add the stash map then call that.

sly gazelle
#

from another mod? is this possible?

silent zealot
#

No, I mean you have code right there

#

is that in a function you can make use of?

#

otherwise, just go the other way - iterate through the player inventory and delete things that don't meet your "keep this item" criteria

sly gazelle
silent zealot
#

Has anyone worked out how B42.13 is assigning clothing to zombies, because it's changed from earlier versions. I've got a debug item in my personal tweaks mod (Ring of Protection) that has no recipe, is in no loot tables, is not in any zombie clothing tables, and should only be accessible via debug mode spawning... but it spawns on Zombies as often as normal jewelry.

bright dawn
#

Good Day everyone, I'm trying to make a mod, where can I find a documentation here with regards to OnCreate and OnTest in CraftRecipe? I was reading it and I cant grasp the syntax since upon testing the mod then appying the said custom function it just errors the game, thanks. I've read the wiki and sad to say its not enough example https://pzwiki.net/wiki/CraftRecipe

#

My aim is to constraint the crafting recipe to simulate dynamic changing the amount of sellable goods and price that fluctuates from time to time since making a dedicated UI for it is beyond what I can do and I cant seems to make it work, the documentation is kinda confusing on my part given the fact that I'm not a native english speaker
this is my prototype code, I would love to gift my friend this mod on this new year. thank you in advance everyone https://pastebin.com/fyuWmJjj

bright dawn
scenic tusk
#

can evolved recipes have more than one base item to trigger the recipe or can it only be one

#

or could i use adding a certain ingredient to a preexisting evolved recipe to make a different evolved recipe

crimson ore
#

any1 got a list of rooms and zones?

dull chasm
#

im updating my clothing mod rn, my head clothing item doesnt hide hair anymore. how can i fix that?

bright fog
tranquil kindle
buoyant violet
#

im back with some bs again

#

I need testers to see if a hook im modifying works well in MP

sonic needle
#

i mean i have a server

buoyant violet
#

I will release RPM mod unlisted

frail violet
#

Hi, I'm trying to fix an issue with my mod. My issue is with clothing.xml I'm assuming, as the outfits work perfectly, but the boots don't seem to be applied/equipped when selecting the custom outfits.

#

Has anyone experienced this, or possibly know how to fix it?

winter bolt
#

for some reason any clothing items you add to clothing.xml also need to be in your mods fileguidtable so you have to copy paste any vanilla items you use

frail violet
winter bolt
red kettle
#

hii, i am interested in making my own posters to add to the game however i am a total noob at this stuff, does anyone know of any tutorials/tips?

bright fog
red kettle
bright fog
#

@hot patrol knows how to do that, they did it for their own mod too

red kettle
#

ohh my bad, thank u so much though !!

bright fog
small osprey
#

it will save lifes, or at least brain cells ๐Ÿ˜…

bright fog
#

For now it works decently well

#

I need to stress test it

small osprey
#

I'll try next time I do scripts.

hot patrol
bright fog
dull chasm
lusty kindle
buoyant violet
#

feel free to provide any feedback friends

wet sandal
#

My main feedback is that its a bad idea to inject new dependancies into existing mods

clear aurora
#

like furtniture

#

for decoration but the player should be able to carry and place it

buoyant violet
bright fog
hybrid musk
silent zealot
cold skiff
#

Hello everyone, I've never used multiplayer mode before, as I started making mods in version 42. Can someone tell me what changes or things I need to keep in mind to make my single-player mods work correctly in multiplayer? Are there any changes to the file structure, code, etc.?

hasty wharf
#

https://steamcommunity.com/sharedfiles/filedetails/?id=3633382126
Tracks ALL 267+ Lua events automatically, no configuration needed
Server Administrators:
Identify which mods are causing server lag
Monitor high-frequency events (OnTick, OnPlayerUpdate, OnZombieUpdate)
Track performance over time and optimize server configuration
Compare performance before/after adding mods
Generate reports for troubleshooting

Mod Developers:
Profile your mod's event handlers in real-time
Optimize callback execution times
Ensure your mod doesn't cause performance issues
Debug event registration and triggering
Compare performance across different implementations

silent zealot
#

That looks useful!

raven epoch
#

how does one play animations in isoplayer

#

i cant figure it out

silent zealot
#

If I'm hosting a server using "host" to test my mods in multiplayer, is there any difference between these two options?

sonic needle
#

yes. those are the same found in the INI file for dedicated servers

raven epoch
#

ok so im trying to play an emote but i cant

sonic needle
#

one loads the Name of the mod, IE the 108600 ID

the other loads the name module IE WAR_REDUX

raven epoch
#

am i stupid

sonic needle
#

is it even playing it? or

raven epoch
#

nope not playing

#

no errors

#

maybe the anim is deprecated?

#

or does it have to do with condition

#

im confused

silent zealot
sonic needle
#

yes they should

raven epoch
#

testing with removed condition

sonic needle
raven epoch
#

nope same with no conditions

#

rlly weird and annoying

fallow hollow
#

Hey guys
wanted to ask if there's really no way how to change individual vanilla recipes - tried searching here, found some resources, but if I want to override one recipe in recipes.txt then that's nonsense..
Thanks

worthy wharf
#

i guess this "require" option

name=errorMagnifier
poster=poster.png
icon=icon.png
id=errorMagnifier
description= Strictly for debugging purposes, creates in-game popups to make error reporting clear and easy.
versionMin=42.0
author=Chuckleberry Finn
require=\ChuckleberryFinnAlertSystem,

worthy wharf
fallow hollow
#

I tried that with just change in time and it didn't work :/

#

is that a problem that the file is not called recipes.txt like original ? I thought only recipe name is important

bright fog
bright fog
#

It probably won't catch your problem for now since I haven't added parameter checking

#

But it helps reading scripts

fallow hollow
#

thanks a lot
I've spent 20 years in idea, I can't picture myself moving to vscode ๐Ÿ™ I really appreciate the work did on that and in here, I truly do

bright fog
#

Rip didn't see it was IDEA

#

Also comments use /* */

#

Not --

fallow hollow
#

sorry about that ๐Ÿ™‚

bright fog
#

Tho it shouldn't matter because it just ignores the -- line

#

Do what's the problem with you recipe ?

fallow hollow
#

back to basics - I found this in previous comments here
https://theindiestone.com/forums/index.php?/topic/86011-allow-lua-to-edit-recipes-in-b42/

and I wanted to ask about current status - maybe it changed in recent version, maybe there was some breakthrough

#

I wanted a very basic thing - change 1 parameter in a recipe, time. (if you use scissors to cut up belt, I wanted it fast. a bit slower with knife)

Spent some time with that but it's not going anywhere, so I am wondering - maybe there's some rule and approach I didn't find yet, or maybe I should just abandon .txt "override" and try to lua approach in that link

#

for example, I am altering an item's parameter like this in another mod:
local fireFuelRatio = (itemData.burnTime * 1.5) / currentWeight

        item:DoParam("FireFuelRatio = " .. fireFuelRatio)

Maybe I could do the same with just time in existing "recipe" object ?
Not overwrite whole recipes.txt ๐Ÿ˜„

raven epoch
#

yo anyone know how to play anims

#

the only way i figured out was using istimedactions but some of those actions require lots of stuff

#

they use setaction on luatimedobject and setting that myself causes errors

silent zealot
#

So, the good news is recipe editing via lua is possible. The bad news is you will need to do sneaky stuff with reflection to access private fields. The good news is the Starlit Library does this for you. The bad news is time is an int so gets passed by copy instead of passed by reference.

#

You could probably override the crafting timed action setup to change the time. Which is overkill for something so simple that should have an setTime() API .

fallow hollow
#

exactly
Thanks a lot for taking time to reply ๐Ÿ™‚
I scrapped the idea altogether, ("we are too early" ๐Ÿ˜„ ) and just pressed F5, spent whole ingame day cutting up belts (after clearing up whole fallas lake)

silent zealot
#

hahahaha

#

Debug mode -> cheats -> timed action instant

fallow hollow
#

wanted to do the same with digital watches, but I ain't itching that bad, it kinda makes sense it's complicated .. I saw digital watch internals as a kid and I can like with that

silent zealot
#

Only takes a few seconds to access the internals of a digital watch. Assuming you don't mind them being a bit broken.

fallow hollow
#

yeah considering how long everything takes to load up, I don't even want to turn off the game, activate debug mode, do the deed, close the game, remove the parameter, fire it up again

If there isn't the "added value" of creating a mod that hopefuly solves the 'pain' for someone else, too, then I don't wanna do it at all

silent zealot
#

I just play in debug mode.

fallow hollow
#

๐Ÿ˜ฎ
the F2 key itself that does something else, other than pause ( I am not sure what that is) makes that unreal for me
errr sorry for spamming, thanks for your time, it's "solved" for now

silent zealot
#

I use that open (under "accessability" for some reason) and never have to hit F2.

bright fog
#

You can do single parameters overwrite by redefining the same recipe with only the parameter you want to change and it'll change only that parameter in the original recipe

fallow hollow
#

thanks
well...that would work, I only want time changed ๐Ÿง

bright fog
#

Yup so that will do it

#

The main limitations regarding recipe modification are inputs outputs and mappers

#

Mappers you can add stuff easily, remove idk
Inputs you can add to an existing input if you have a way to identify it, outputs I believe you can too

bronze yoke
silent zealot
#

So more useful for a dedicated server where the server needs to download mods?

#

But with "host" it has access to all your local mods

frail siren
#

Is there any b42.13 mod template for MP compatibility? Or a full guide for a new folder and file structures for moders, especially for MP?

bronze yoke
#

it needs to download a copy for the server regardless

#

the exception being anything in the cache dir so it's not too annoying for local testing

silent zealot
#

Maybe I'll just make singleplayer only mods instead of having to figure all this out ๐Ÿ˜›

#

From a quick test I have 12 mods working in MP and 13 with issues of some sort so that's almost a 50/50 chance of getting lucky.

zealous maple
#

hello, I have a server that i connect locally. Im trying to send a client command to the server and a server command to client. lua/client sendClientCommand("test", "hello", nil) and on lua/server local function onClientCommand_test(...) if module ~= "test" or command ~= "hello" then return end print ("hello") end Events.OnClientCommand.Add(onClientCommand_test) i never see hello. it works on solo but not when joining the server. I have in client a print("client) and server print("server) i can see them in the console. Is this the correct way on a server or do i need to do something on the server? like RCON?

zealous maple
#

no im using join on my own server

quasi kernel
#

Like the in-game hosting system I mean, not a dedicated.

#

Ah..

#

Reason I ask is because server-related stuff isn't going to pop up in client output, wanted to make sure you were looking in the right place.

#

For in-game hosting that's usually under coop-logs iirc

#

Servers have something else

zealous maple
#

yeah im looking in server and client logs

quasi kernel
#

Wait, are your args "..."?

#

Or was that just to simplify

#

(Because that's technically valid syntax in lua last I recall, it's just weird)

zealous maple
#

didnt want to print them = ) (module, command, player, args)

quasi kernel
#

Valid hehe

#

So I imagine the client is firing correctly but the server isn't picking up on it for some reason-

zealous maple
#

what im trying to do is get all players even the offline players in a dropdown

#

yeah that is my stand point aswell

quasi kernel
#

Unless your aforementioned server print is working when events are received, I'd recommend printing the args in the OnClientEvent function just in case.

#

Make sure the data is feeding in the way you expect it to, one time I had the order screwy lol

zealous maple
#

i have this print("CMD:", module, command)

#

in the function and that isnt showing

quasi kernel
#

Does that print?

#

One second

#

I don't know if that's valid lua syntax or not- lemme double check

#

It very well could just be erroring on the server for all I know

#

idk why but sometimes the errors are quiet

zealous maple
#

thank you are taking the time to help me!

quasi kernel
#

Oh wow weird, print takes multiple arguments?

#

I literally never knew that LOL

#

Also yea!

zealous maple
#

๐Ÿ™‚

quasi kernel
#

It looks like an atypical concat but it seems valid from what I saw on the official webpage?

zealous maple
#

maybe it is not vaild! ill try to make it like normal

quasi kernel
#

Yeye, try a regular concat just in case, remember tostring() it just in case

#

Wait

#

WAit

#

You're sending "test" and "hello" as the command. The return thus will basically "kill" the call where it stands.

#

wait

#

im crazy

#

raaa

zealous maple
#

if its not test or command

quasi kernel
#

Sorry I'm misunderstanding ahiuewahiufwae

#

Gimme a sec, Zomboid stuff is wonk sometimes lol

#

Do try that concat thing though just in case, Kahlua has its quirks

#

I don't think parts of the math library are even there

zealous maple
#

if its not test or not hello

quasi kernel
#

Yeye I see your logic now

bronze yoke
#

when are you sending your command

zealous maple
#

from client

quasi kernel
#

No like, when from the client

#

After what event?

zealous maple
#

ahh no from a mod

#

ahh sorry. i have a ui with a dropdown and a button Get. and the function for the button is sending the command

#

can i paste all the code here?

quasi kernel
#

Yeye! That'd probably help, just format it first.

#

```lua
Code goes here!
```

#

It'll format differently for you, that's okay.

zealous maple
#

it is too big 125 to big=)

quasi kernel
#

You can just let it post as a .txt if it'll permit you to

bronze yoke
#

are you in b42?

zealous maple
#

b41

#

have i mixed them up?

bronze yoke
#

no there's just a bug in b42 that might have tripped you up

#

but it doesn't happen in b41

zealous maple
#

ahh i see. I have been reading for days now. when i as a AI for help they feel way off and this feels correct.

#

ask*

#

did the txt show?

quasi kernel
#

I exist again hold on

#

Okay so @zealous maple this might sound silly but

#

Are you an admin on your server

zealous maple
#

yes i have admin in red befor my admin name

quasi kernel
#

Hm..

zealous maple
#

takes forever to debug awell. need to upload it to workshop. restart server then you can se if it works ๐Ÿ™‚

quasi kernel
#

Did the change of string concat change output or anything?

#

Forgive me if I'm wrong but I dont think this is a valid multi-line comment.

#

Multi-line starts with two dashes

#

(which is what the IDE is suggesting to me here)

zealous maple
#

there are 2 ๐Ÿ™‚

quasi kernel
#

There are..?

#

Not in the file you sent- weird.

zealous maple
#

NOO!

#

i got that from some forum and just pasted it in there

#

booting up. lets hope it was that silly misstake!

quasi kernel
#

It very well could've been, there's a fair chance your file didn't even run LOL

bronze yoke
#

yeah this file won't run it's unparseable

quasi kernel
#

Likely errored on boot and then just sat in stasis

#

I imagine the server function wasn't properly defined because of that, so your client-server command was lost to the void

#

..basically anything in that file probably failed to define correctly.

raven epoch
#

how different is isoplayer in b42 compared to b41

#

ignoring mp would it still work the same?

#

i heard there was a render limit thats why me ask

zealous maple
#

didnt print print("Module:".. module .." Command:".. command) =/

quasi kernel
#

Definitely check for any stack traces

zealous maple
#

i will hope i can see it. I cant see any errors i client or server logs

#

thank you for ur time!

quasi kernel
#

Yeye!!

zealous maple
#

code rn?

raven epoch
#

did u manage to get it working

zealous maple
#

im still trying to debug. It dont seem too work. added this on the top of the server fil print("DEBUG: SERVER FILE IS LOADED")

#

so that is my next try

raven epoch
#

can u show ur code i can try helping

zealous maple
#

it is the same as txt above but โ€“-[[
local world = getWorld()
if world and world.getAllKnownPlayers then
local known = world:getAllKnownPlayers()
-- safe usage
end
โ€“-]] and alot more debug

#

if you can see them, else i can send some snipps if u need

raven epoch
#

ye the indentation is kinda confusing me tho

#

can u send some snipps

zealous maple
#

im trying cachyos and i have to hard restet every 10 min when im restating server and so on.

#
    if module == "ZDItemGiver" and command == "sendingPlayers" and ZDItemGiver_UIInstance then
        ZDItemGiver_UIInstance:populatePlayerDropdown(args)
    end
end
Events.OnServerCommand.Add(OnServerCommand_ZDItemGiver_UI)


function ZDItemGiver_UI:requestAllPlayers()
    sendClientCommand("ZDItemGiver", "GetPlayers", nil)
end
function ZDItemGiver_UI:createChildren()
    ISPanel.createChildren(self)
    local previewWidth = 150
    local contentWidth = self.width - (previewWidth + 20)
    
    self.playerSelect = ISComboBox:new(10, 35, contentWidth, 20)
    self.playerSelect:initialise()
    self.playerSelect:instantiate()
    self:addChild(self.playerSelect)    

    self:requestAllPlayers()
end
#

this is from client

#
local function onClientCommand_ItemGiver(module, command, player, args)
print("Module:".. module .." Command:".. command)
if not player:isAdmin() then return end
    if module ~= "ZDItemGiver" or command ~= "GetPlayers" then return end
    
    local thePlayers = {}
    local allKnown = getWorld():getAllKnownPlayers()
    
    for i = 0, allKnown:size() - 1 do
        local p = allKnown:get(i)
        if p then
            table.insert(thePlayers, {
                name = p:getFullName(),
                username = p:getUsername(),
                online = p:isAsleep() == false -- Note: isAsleep check is for activity status
            })
        end
    end
    
    -- Send the flattened Lua table to the requesting client
    sendServerCommand(player, "ZDItemGiver", "sendingPlayers", thePlayers)
end
Events.OnClientCommand.Add(onClientCommand_ItemGiver)```
#

server

raven epoch
#

does debug print?

zealous maple
#

just read that local should not be here local function onClientCommand_ItemGiver(module, command, player, args)

#

my computer died so i have to restart server one 1

bronze yoke
#

that won't change anything

zealous maple
#

one min

#

it shouldnt becuse i only use it here anyway

#

[30-12-25 19:00:05.733] LOG : General , 1767117605733> 0> DEBUG: SERVER FILE IS LOADED.

#

but not print("Module:".. module .." Command:".. command)

raven epoch
#

maybe its because of variable naming?

#

change module to smth like module2

#

cus my ide colors the module for some reason

zealous maple
#

humm ill try

#

local function onClientCommand_ItemGiver(module2, command, player, args)
print("Module:".. module2 .." Command:".. command)

raven epoch
#

you are doing sendclientcommand yes?

zealous maple
#

yes to the server from client and sendserver from server to client

raven epoch
#

u sure the sendclientcommand part is running

zealous maple
#

self:requestAllPlayers() this is called in :createChildren() maybe put in new isteed and remove self. then it should be called when im creating the window.

worthy wharf
#

i never did it before, i just opened one mod that i knew had reference and told you

you can try:

  • find any other mod that has 2+ dependencies, subscribe and peek
  • test using comma and colon
fleet bridge
#

any stack trace errors on server when you send client command?

buoyant violet
#

I reverted the requirement

#

If someone wants RPM then they can add the mod otherwise will work as before

raven epoch
#

how do i damage objects?

#

i tried Object:Damage but im not sure if it wors

#

works

small osprey
small osprey
willow tulip
#

Generally PZ uses ;

broken briar
broken briar
bright fog
raven epoch
#

does anyone know why isoplayers are invisible in b42?

bright fog
#

Uh ?

raven epoch
#

they exist

#

i can hear sounds

#

but no character

brave bone
#

How do we check all online players in a dedicated server?

I was using isoplayer.getplayers() but it seems it only see me (local) it doesnt see the whole players in the server.

TIA ๐Ÿ˜Š

true nova
brave bone
winter bolt
willow tulip
# brave bone Thank you. o7

do note, IIRC on client, it only returns players the player has encountered, to prevent hackers from teleporting around the map and killing everyone on a server.

#

(on b42)

#

So if you need it on the client side, you'll have to make a client-server packet system to ask the server whatever info you needed about the connected players

knotty saffron
#

I'm trying to make a simple mod, but the solution I came up with involves saving some coordinates persistently on the client (for single player) or on the server (for multiplayer). I tried some solutions like a "local FILE = 'coords.txt'" but it doesn't seem to work.

knotty saffron