#mod_development
1 messages ยท Page 362 of 1
To be pedantic, the game saves the table for you
so mod data does save
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
Don't use a module
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
well most stuff doesnt need to be thats why
Then use a module for these
Also you can only save basic data types
so whats wrong with wat i am doing with that in mind
You're saving !
Don't save anything
Directly store in that fucking table
It's a table
thats what i am doing by saving ๐ญ
use it as a table
i just put the stuff i want to save in that table
You literally don't that
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
If you don't want to put things in that table then don't do it ???
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
If you're creating structures why do you need modData?
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
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
problem is when i do that it for some reason loads from nothing??
Well anything you add to the table is "saved" - I can't really grasp what your save function is doing either
just looping through existing structures
getting needed save data and making a new table
then when game loads i respawn the structures from that table
You're just doing it wrong then
I don't know what to tell you more than properly develop your systems you are using
When you say it loads from nothing - do you mean a fresh game or?
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
yeah i make a fresh game right
You are saving your data with OnSave
I said don't save anything
That's the reason your mod data swaps between saves
Because you store shit in mod data via OnSave but the mod data is ALREADY saved in that fucking event
the moment i make it
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
Wait how/why does OnSave migrate the modData? ๐ฎ that sounds useful/fun
when i make a fresh game everything works fine
EXCEPT
build structure is false so it means it loaded the building somehow
got it from mod data
Because mod data is already saved for the current save, we had someone with that exact problem yesterday
when the mod data is supposed to be an empty table since its a fresh save
oh he did the same as me
I literally just told you you are saving shit with OnSave when you literally shouldn't
Yes because he thought you had to manually save mod data too
That dates back from literally this night
no no we are not manually saving mod data
Yes you fucking are !
we are putting stuff that needs to be saved in mod data when the game is saving
Wtf are you saying, you have a save function that you trigger OnSave
No you aren't
That's literally NOT what you should do
You shouldn't*
You should ALREADY store the data dynamically during your session
ah alright
You guys are talking past each other a bit, lol
You shouldn't store anything during OnSave because you should have already done it when shit runs
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
"store"
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
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
Why don't you do it ?
https://youtu.be/8d4RtvMQp10?si=TqQMCm1axduWTx8Q
here is a visual representation of me anything tech
when should i use randomizedworldbase and when should i use the classes themselves?
Thinking of making a mod to allow you to break up Salt Licks for salt, any balancing ideas?
Large sadness debuff when you do it for... being nasty and covered in cow spit. Id say the salt/corrosion will degrade your hammer and/or chisel required...
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.
Well some farm supply stores can have them as loot, found 3 at the fallas lake store alone.
But I was more talking "how much salt do you get"
Oh.. like 10 maybe? I feel like thats the lowest you can go before players are going to become extremely upset lol.
10 'regular salts' that is, I believe each 'regular salt' still has a number of uses
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.
of course, there's a job board in this server that is generally the safest way to hire people https://pzwiki.net/wiki/PZ_Modding_Community
watch out for scammers in your dms, once you say the c word you'll get a bunch dming you
Will do! Appreciate the help!
I was thinking closer to 20, or even more.
Seeing as a full "unit" of salt has 0.1 encumberance and a salt lick has 20.
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.
Idk what's up with the last issue but the traits were changed in how they are added now
They now depend on a registry and they are defined using a script
This is absolutely not where I expected to find my FPS ending performance issue:
Gotta do what ya gotta do
Also maybe imgui has that already built-in ? I don't remember seeing anything like it tho
That looks amazing
I'll stop being lazy eventually and see about getting some PRs up for the community debug tools.
Those need a looooot of reworks
I had to disable some systems that were too buggy
I improved the Lua reloader so you can actually reorder the reloading of fixes
Nice, I'd love to get reloading working again in some of my mods
But its one of those things where if you don't design for it, you lose it
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
No
That'd be insanely powerful tbh
But you need a Java mod for that
hmm
KI5 does stuff kinda like this
how would i make a java mod to just delete that segment? sorry i have like literally zero experience in java moddin...
where you can armour up cars
like would i just remove the segment andd recompile it and just let people replace their gamefiles with that?
You'd have to decompile the Java, modify this part by commenting out this setter for the speed value and recompile
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
shit youre right...
it should only change the config files no way they put more checks to make sure sprinters arent real...
That too yea lol
another issue how would i recompile the decompiled code....
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
ah hmm
javac -cp projectzomboid.jar MyFile.java
yeah but reaching out to him in impossible his friends list is full & i cant just random message him on steam
ah!
i don't think he likes people contacting him yeah
using this just pops out a ton of errors and most of them just says cannot find symbol im trying to recompile sandboxoptions file after decompiling it
did you give it the path to projectzomboid.jar
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
it creates the class files next to the java file, you need to copy them into the jar
ah thank you!
KINDA. you can override any java function called by LUA, like a normal LUA hook.
you can not override java functions called by java using LUA.
(this is how inventory capacity override mods work)
You can also just copy the files to project zomboid\zombie\ (path in jar here) and they override any files in the Jar
i used winrar to replace the files in the jar but uh
it seems like it bricked server settings
(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)
Lua, not LUA
lUa, where l tells you that its a long type and Ua is the type name.
commenting out the block of code preventing you from getting sprinters just bricks the setting editor this is going to kill me
Likely because.. its horribly broken.
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
yea im saying its blocking code that is horribly broken. like, really, nth level, horribly broken.
didn't even try to make work.

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
how could this be so fucked man shit...
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
ill test it again but this time recompiling with no changes to just see what happens
B42 at least tries to be server authorative.
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
Man am I happy the OnThrowableExplode event exists, gonna add some vehicle "landmines" nonsense lol
theres mods for sprinters AFAIK
quick question: how do you guys detect singleplayer , mp and coop(the splitscreenthing)?
isClient() - true when you are connected to a server
isServer() - true when you are the server
If you have a player object, you can check if they belong to your client with:
playerObj:isLocal()
For split screen, I use the playerNumber
A lot of vanilla UI elements already track it. You can also pull it from the player object with:
playerObj:getPlayerNum()
there is no host state
No? Thought that was a thing
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
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)
I wouldn't want to put my hands anywhere near a zombie's mouth for longer than a moment
I guess a chokehold from behind is okayish, but still risky if you misplace your hand
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
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?
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
the emmyjson
Root
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
Gimme min
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?
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
๐คฆโโ๏ธ
does anyone know if its possible to get umbrella working for the entire media folder or is it only useful for a personal files
wdym personal file?
as in my own mod folder
as far as i know you have to manually enable it for every wokrspace
im trying to set it up for both my folder and the media folder but neither are working
u added the library path?
yes
u got emmylua enabled?
yes ive even tried restarting it a few times
what specifically the emmyrc?
y
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
any1 know how to add an item or loop via OnZombieDead?
seems fine i think
lemme check doc
maybe the extra arguments are causing it?
installation says to just add library
waaait
ayo
@scenic tusk
do C:/
hmm
are u sure ur path is valid
u can just
click the bar on top in file explorer
yea i could try going the full path from user to library but c-docs-umbrella should work too
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
whats the 9+
so 9+ problems
now files in media are just saying problems instead of errors
yea so maybe it was the path
42
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
ive never touched animations so thats out of my ball park but good luck dawg
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
use prints
to see if the script runs
you can also use f11 to check for errors
smart
f11 -> play button -> it will stop when errored
and also show u where it errored
pretty useful
are lua prints just print() or are they different
just print() ye
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
it would yes
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
yeah
client if u want on client server if u want on server
shared if u want on both
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
did u connect to any events
.lua in /Server run on both client and server.
wait what
im not sure this is my first time touching lua scripts in here
whats the point then ๐ญ
do you get any errors?
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
no not for my mod
Unsure, the folder Client does infact only run on client though
isnt that illogical?
if client can see server code thats just asking for exploits
wouldnt server only run on both if its the host running it
You don't have Umbrella here
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
Also I suggest using locals, not globals
this is just copied code im trying to decipher as i go
since u know c# and python all u gotta learn is tables and ur good to go with lua
Yea
and also pzs references in general but im piecing that together
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?
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
also what did you mean by this is the umbrella not setup correctly here?
What are self invoking function ?
You mean class methods ?
Yea bcs it's highlighting Events
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
oh i figured i had it working when it went from errors to problems
((i)=>{console.log(i)})() aka silliness, this will run automatically, no variable to call
Nah that's just EmmyLua
I am not familiar enough with JavaScripts, I just learned to read a bit of TypeScript yesterday lol
does emmylua have build in autocorrect for pz?
So function definition that instantly calls itself ?
No of course not, read the wiki page I sent
I'm that jerk that pretends TS is for people who need training wheels (type checking is very important please don't kill me)
yes i have it set up exactly as page suggest however i get pz autocorrect just still have problems
Pffft, what do you mean you don't purposely mutate booleans into arrays?
I'm updating the PZ script extention for vscode ๐
Did you properly set up the emmyrc file ?
as far as im aware
I've been working on a video guide for installing EmmyLua but it's not ready
Ah I see the problem, restart EmmyLua
bottom left > emmylua > restart
Typescript easy mode:
let var: any = 'hello world'
hit em with that any data type all day LMFAO
I don't even remember indicating the type of a variable
yea i had run a restart each time i changed the emmyrc but just did it again and still does not fix the issue
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||
is it possible to play an animation such as foraging without the istimedaction itself?
also sim you would know better than most im guessing, is it possible to use umbrella on the base code files itself?
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
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
Yes but it will scream at you for duplicate function definitions, and also that folder tends to be massive so it can take up a lot of ram
I usually don't do it, but I should try with EmmyLua to see if it's different
everytime it loads its definetly slow but not awful and i have a pretty beefy computer so i should be fine with that part
Yes
Hmm
yea even making it its own workspace with one emmyrc file isnt helping
What is your file named like ?
Where did you put it ?
the workspace root
like i said part of it is working i just so happen to be getting problem codes
i get autocorrects though
Ok that's weird lol
Can you show the error you are getting when hovering Events ?
maybe ur umbrella file has a problem?
i also get an error with the code im actually trying to do but i think im just calling the wrong thing
u downloaded from releases?
not sure i downloaded the most recent one
show umbrella file screenshot
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

You don't have 2 Lua extension ?
i have the official lua one
ohhhhhh
bingo
how do i do this btw
im dumb i saw that and didnt pay much attention i thought it was autodownloaded because i had setup vs for lua
tried PlayAnimation but didnt work (prob because of conditions)
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
Check the timed actions code in start, usually you can start an animation, or more specifically a timed action script
okey
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
Nop
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
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
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!)
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
anyway of using proclist in a func?
If you have an icon at the same path as the item icon I believe it will override
proclist ?
Classic lol
You'd need a whole system to stop griefing or looting of a specific room in a building
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
I'm actually just need a creating "safehouses in wild". I'm working on mod collection for server project about surviving on deserted island, but players can't claim a houses that their builds. It's very frustrating ๐
Those mods have guides
The true music radio mod simplies uses true music cassettes I believe
There's nothing special to do
The procedural distributions list is a global table so you can simply use it yes
well i mean i want to manually trigger a roll using that func but what method?
Oh uh I don't think you can do that
satic list?
what is larger than a cell
It's a Lua table
cells
ok omw to run target finding performance to the ground
actually nvm a cell is big enough
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
Thank you ๐
๐ค 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?
careful though, never print a : as these are interpreted in some way and it may swallow a good chunk of your print silently. I'm not gonna get these hours of my life back 
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
but I created the server in multiplayer mode. Will it affect other players?
If server uses steam version, it will require steam version, if you have it unsubscribed it will "allow" you to attempt to join, but will not let you in, because of diffrence in files, but others that use steam version will have no issue. If you want to join the server you need to resubscribe the mod
If I update the Workshop version of my map while I'm playing the game, will it cause server issues?
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
I don't need to experience the updated content in the old save files. I just want to ensure that updating the map won't damage my server save files
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
If I update the workshop version, will it damage my server?

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
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
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
I am also inquiring on the unofficial pz map channel
It's just that there aren't many people around during this time period
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
There is also PZ Modding Community that has mapping channel too, but how active that is i don't know
hm I'll just wait for a while
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

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?
odd, I had to completely rebuild the server shrug
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
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.
i am also trying to learn to mod PZ, but a bit harder now with the new version 42, less documentation
try this example below:
craftRecipe MakeNewspaperHat2
{
timedAction = Making,
time = 20,
Tags = InHandCraft,
category = > OnlyFarms,
inputs
{
item 1 [Base.RippedSheets] mode:destroy flags[AllowFavorite;InheritFavorite],
}
outputs
{
item 1 Base.Hat_NewspaperHat,
}
}
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,
}
}
}
let me see your item SpiceAHolic.DriedOnion,
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,
}
}
and the Onion too please
that's base item
I think the item is fine.. given I can spawn it in with the item list viewer
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?
Nope, .pack files override loose files.
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.
Rip
Then the solution is to change the icon reference in the script file
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
Lua, not LUA
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?
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.
So would that mean making another item file for the salt lick with the same name and then just keeping everything the same besides the icon?
Thanks for the info, are semi colons alright or is it best to just avoid both
No
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 = ...,
}
anyone know where you can change the year for magazines? they moved the file in 42.13 and im not sure where to look
Oh okay thatโs even simpler
The year ?
Wdym ?
@willow tulip if comments bring nothing in #1318920979581501502 please thow them here, not there
The goal is not to bloat that thread
Hi all, anyone know of mods that emit very loud sounds from a tile?
Literally a million mods ? ๐
trying to make a storm siren, but need examples
You should be able to find a bunch of examples for this
wouldnt the files for random events have examples of it
My comment is that he'd be breaking most of the existing mods by forcing that requirement
ty
He's ONLY talking about mod ID and I completely approve with him
Don't allow spaces and special symbols (except underscores and dashes) in mod id's, dir names and file names.
An ID being able to have special characters in it is extremely cursed and at the end of the day is sources of problems
And im only talking about directories and filenames.
nvm
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
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.
would that include things like item ids or just the modids and file names
What you allow as legal for item/modID's is up to the developers, but you should follow OS support for legal filenames/folders.
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
you are absolutely exaggerating how many mods do this
Agreed
Also by keeping to only latin characters, you ensure that'll it work in any OS in fact
And in any environment
' ' (space) is still very well supported.
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
Spaces for folder names and file names is fine, but not special characters
Sure, id limit it to whatever works on mac, windows and linux.
(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
Also, mainly refering to mods that use space in their filenames or folders.
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
Depends how your referencing it.
Read the icon wiki page
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
ive found out why the salt lick icon sits on the foraging thing so oddly
anyone know what the base size is for icons?
TIL saltlick is 2 tiles tall. Those cows must have really licked the hell outta that thing..
all modern OSes do support spaces in path names but i've found software support is still really spotty so they're worth avoiding
RejectSpaces,ReturnToCamel
thatsNotEvenProperCamelCase.
RejectCamel,ReturnToPascal
there is no consensus on which 'camel case' refers to
the terms 'lower camel case' and 'pascal case/upper camel case' are preferable because of this
the little date that comes after a magazine, ex. (HottieZ - May 1992, OSCC Insider - September 1990)
Oh that's a magazine item right ? So it'd probably be in the translation files
Translation files?
damn you beat me by that much.
:3
i checked there, but didn't find anything. it used to be like an rng thing in speciallootspawns, but i think they removed it in 42.13
Much logic was moved to java side.
lemme do a file scan...
StoryClutter.OfficeTreatClutter = {
"Base.Apple",
...
"Base.HottieZ", -- what a scumbag!
Devs be hottie shaming ๐ข
lol
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
i'm trying to get this for every magazine, would this also work for any other type?
also thank you very much for looking
Look at ProjectZomboid\media\scripts\generated\items\literature.txt
No way that's hardcoded
item HottieZ {...
OnCreate = ItemCodeOnCreate.onCreateHottieZ,
got it working thanks guys now i just gotta fine tune my art
you need to change the onCreate method to your own LUA version of that above function
? Rephrase?
I believe it
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)
what i'm looking for used to look like this, was this removed entirely?
yes it was all moved to Java.
ah, i see
No way, that's hardcoded ??? surprised reaction, completely shocked (actually shocked) shocked emoji, :o :o
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.
it will
the recipe code is still invoked through lua
the class is exposed so it references the method through lua
Ah. Yea when they decided all the onCreates should be in java -_-;
ahh I was wondering how that worked
So yea, just readd that code and it will get used instead of the java.
(Some changes may be needed, since tags massively changed)
i'll test it out, thanks
Yea I didn't realize that was a Java OnCreate tho, that's fine, I thought that was something called when spawning the item via java or some shit like that
No they only do that when.... sigh, spawning everything else in the entire game with any kinda condition/uses/etc tags.
looking at you, lessfull tag
grumbles at stupid tag that makes all lighters/smokes/etc spawn at 0~50% capacity, ie average of 25%
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
yea in debug mode, some files are watched for changes. Others are completely cached till you restart the entire game..
ah well atleast what i was working on was updating that definetly helped
@willow tulip do you know the difference between isAlarmed and hasAlarm for vehicles?
Nope, but if i had to guess it would be related to the fact that after it goes off, it can't be triggered again. (that or its related to if the alarm is currently going off)
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.
Yeah, I'd just need isAlarmed then. Had no clue hasAlarm was needed for anything
its used to outright disable the alarm sound on vehicles that don't have alarmSound set
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?
missing icon, usually tricked by the Item_ prefix
Icon = MyItem, looks for Item_MyItem.png
it's like that on the ground too- even though i supposedly have a worldobject
it doesn't even appear on my head :(
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)
naur. does that mean my file directory for it is wrong?
ok! and what should i look for to figure out why my model isn't appearing when i wear the object
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
like in my xml files?
What are you talking about ?
is this not correct??
agh nvm i looked at the wiki, this is just straight up incomplete
Please upgrade to vscode ๐ฅน. You may enjoy it.
you're right ๐ญ this was a quick install for me i do love vs code
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
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.
should have the name of that fbx file at the end
dont need to include the .fbx though just the name
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
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?
You need to be a bit more specific. Do you mean as a world tile (like a piece of scenery/building), or an inventory item laying on the floor at pre-determines locations, or something else?
Yes, you could write your own function that goes through the inventory and decides which items to remove. Or... you could remove everything and regenerate the stuff you want them to have.
i was looking through DWAP's code for spawn those items... seems pretty complex
while it mention the key as Base.Key1 i didnt find the item id of the stash map
just as an example
If tehre is an existing function to add the stash map then call that.
from another mod? is this possible?
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
yeah i think i will go this route
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.
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
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Omg its you sir! thanks for the jumpstart to moding btw
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
any1 got a list of rooms and zones?
im updating my clothing mod rn, my head clothing item doesnt hide hair anymore. how can i fix that?
Np !
Hmm, I'll add more examples in a github repo I think
Check vanilla hats clothingitem XML. It has hat category depending on hat.
im back with some bs again
I need testers to see if a hook im modifying works well in MP
i mean i have a server
I will release RPM mod unlisted
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?
are they boots from the vanilla game?
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
Yes, they are vanilla boots. That explains it, thank you.
i had completely forgotten about that so ive added it to the wiki page now
https://pzwiki.net/wiki/Clothing.xml
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?
By poster you mean the item right ?
https://steamcommunity.com/sharedfiles/filedetails/?id=3113485839&searchtext=poster yes, something similar to this mod!
Well that's not an item, that's a tile
@hot patrol knows how to do that, they did it for their own mod too
ohh my bad, thank u so much though !!
amazing!
More ๐
it will save lifes, or at least brain cells ๐
I'll try next time I do scripts.
I didn't do anything too special with mine. I was helping Guns test their framework https://steamcommunity.com/sharedfiles/filedetails/?id=3431926792
This is for the next update
will do, thanks ๐ฝ
https://pzwiki.net/wiki/Mod_structure make sure it follows the correct mod folder structure. You'd need to provide more details for anyone to help you out though
My main feedback is that its a bad idea to inject new dependancies into existing mods
its like a piece of scenery
like furtniture
for decoration but the player should be able to carry and place it
I had to, was an emergency fix that turned into a tool that other people can use
https://steamcommunity.com/sharedfiles/filedetails/?id=3631541848
A couple of guns added to b42.13.1 Multiplayer, tested with 100 players and working with Lua=true
Three hours ago I was going to actually play some zomboid but then I wanted a silencer mod that worked on everything instead of specific weapons only so I made this instead: https://steamcommunity.com/sharedfiles/filedetails/?id=3634876505
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.?
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
That looks useful!
If I'm hosting a server using "host" to test my mods in multiplayer, is there any difference between these two options?
yes. those are the same found in the INI file for dedicated servers
ok so im trying to play an emote but i cant
one loads the Name of the mod, IE the 108600 ID
the other loads the name module IE WAR_REDUX
am i stupid
is it even playing it? or
nope not playing
no errors
maybe the anim is deprecated?
or does it have to do with condition
im confused
But in terms of testing the mod's code, they work they same?
yes they should
testing with removed condition
if it played it would
-
Play
-
Play the surrender animation
-
Fail
-
Fail due to XML params
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
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,
i believe you can overwrite by just giving your new parameters
not sure if mandatory fields should go in, but you can test
like:
recipe sunny side up egg
-egg
-salt
then you just make
recipe sunny side up egg
-egg
then salt is removed
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
The file name doesn't matter, juste make sure it's very specific to not clash with vanilla or other mods
Also may I suggest you this
https://marketplace.visualstudio.com/items?itemName=SimKDT.project-zomboid-scripts
It probably won't catch your problem for now since I haven't added parameter checking
But it helps reading scripts
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
sorry about that ๐
Tho it shouldn't matter because it just ignores the -- line
Do what's the problem with you recipe ?
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
So I have been trying and trying, and can't find much to edit recipes (aside from adding/removing possible ingredients to an existing ingredient slot) There is no 'setAmount' on the InputScript or OutputScript and I can't seem to add/remove InputScript's or OutputScript's It would also be nice if...
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 ๐
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
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 .
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)
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
Only takes a few seconds to access the internals of a digital watch. Assuming you don't mind them being a bit broken.
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
I just play in debug mode.
๐ฎ
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
I use that open (under "accessability" for some reason) and never have to hit F2.
There's thing you can do but it tends to be either tricky or limited
You can't overwrite recipes actually
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
thanks
well...that would work, I only want time changed ๐ง
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
steam workshop: workshop items for the server and joining clients to download (needed even when ingame hosted because the server keeps a separate copy of mods)
mods: actual mods from those workshop items to enable
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
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?
no
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
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.
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?
Are you using Host?
no im using join on my own server
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
yeah im looking in server and client logs
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)
didnt want to print them = ) (module, command, player, args)
Valid hehe
So I imagine the client is firing correctly but the server isn't picking up on it for some reason-
what im trying to do is get all players even the offline players in a dropdown
yeah that is my stand point aswell
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
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
thank you are taking the time to help me!
Oh wow weird, print takes multiple arguments?
I literally never knew that LOL
Also yea!
๐
It looks like an atypical concat but it seems valid from what I saw on the official webpage?
maybe it is not vaild! ill try to make it like normal
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
if its not test or command
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
if its not test or not hello
Yeye I see your logic now
when are you sending your command
from client
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?
Yeye! That'd probably help, just format it first.
```lua
Code goes here!
```
It'll format differently for you, that's okay.
it is too big 125 to big=)
You can just let it post as a .txt if it'll permit you to
are you in b42?
no there's just a bug in b42 that might have tripped you up
but it doesn't happen in b41
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?
I exist again hold on
Okay so @zealous maple this might sound silly but
Are you an admin on your server
yes i have admin in red befor my admin name
Hm..
takes forever to debug awell. need to upload it to workshop. restart server then you can se if it works ๐
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)
there are 2 ๐
NOO!
i got that from some forum and just pasted it in there
booting up. lets hope it was that silly misstake!
It very well could've been, there's a fair chance your file didn't even run LOL
yeah this file won't run it's unparseable
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.
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
didnt print print("Module:".. module .." Command:".. command) =/
Definitely check for any stack traces
i will hope i can see it. I cant see any errors i client or server logs
thank you for ur time!
Yeye!!
whats ur final code rn
code rn?
did u manage to get it working
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
can u show ur code i can try helping
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
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
does debug print?
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
that won't change anything
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)
maybe its because of variable naming?
change module to smth like module2
cus my ide colors the module for some reason
humm ill try
local function onClientCommand_ItemGiver(module2, command, player, args)
print("Module:".. module2 .." Command:".. command)
you are doing sendclientcommand yes?
yes to the server from client and sendserver from server to client
u sure the sendclientcommand part is running
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.
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
sendClientCommand(getPlayer(),"ZDItemGiver", "GetPlayers", nil)
any stack trace errors on server when you send client command?
Learned this the hard way
I reverted the requirement
If someone wants RPM then they can add the mod otherwise will work as before
Mehe I like the description btw.
Very nice Zeta. Can I ping or PM you later when I release something "not related but tangential"?
Generally PZ uses ;
kinda been wondering if i could possibly make an unofficial updated version of this mod
https://steamcommunity.com/sharedfiles/filedetails/?id=3507117617&searchtext=indiana
sigh..
Just ask him
does anyone know why isoplayers are invisible in b42?
Uh ?
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 ๐
getOnlinePlayers() returns an arraylist of player objects
Thank you. o7
just added a new script that finds any vanilla items used in your outfits and then saves them to a new file so you can paste them into your mods fileguidtable
https://github.com/LazySpongie/OutfitXMLConverter
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
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.
thanks, i missed that gonna give it a try