#mod_development
1 messages Β· Page 357 of 1
is my server not printing for any reason specifically?
bc when i reload them
they print
do i need to do like umm
wait for loading
Wdym ?
or something
only server does this
scripts dont print
or anything
but when i reload them
they work
scripts for me is lua files btw
You can't just ask me that and not give me a single context on what you're doing
. check this, a module loader
hes using sendclientcommand to send command to server
but server script is not running at all
i made a simple server script
client runs
saying
server test
only that
in a lua file
and it didnt run
or atleast i couldnt see it in console
On a server, it appears in the server console
how can i access it?
I mean, depends which side
im using this one
If hosting, it's in your cache folder named as coop-console smthg like that
I'd suggest reading the error
It tells you everything you need to know
wait what
the console is a txt file?
Yea
The same stuff in the console is output to a txt file
As in, the stuff you see there is mirrored to that file
should i do
Stop cropping all your screenshots and show the whole thing dude π
Events.GameBoot on server scripts?
Show your whole file, show your whole error
sent it earlier
look
How do you expect me to know what fucking line is what ???
bro chill
Seconding the chill, but also it's understandably frustrating when people make it difficult to help lol
You have to understand we can't help you if you give us so little info and context
im showing you console, the script nd the whole thing
idk
Show the error
The actual full error
i can resize the window to show it entirely?
Just read it from your console.txt file
where can i find it?
Cache folder
That's the file mentioned in the error ?
like the server folder thing
it seems so
nothing else is there
other than that error
Did you properly reload your mod after editing it ?
yeah i reloaded lua and reloaded the server
completely
How are you getting this error? Does it appear on load, or are you putting something in the console?
Do you have a second copy of your mod in mod folders somewhere ?
doesn't appear on load appears when i reload from log()
im subscribed to it in the workshop but i have it listed at hidden
Tbh what I don't get is the error itself, I don't see how that could happen with such a file
and im seeing no clones
Clarify what you mean by "reload from log()"?
Then that's the problem
using log() command on console
It reads as an error from something put in the console
Don't sub to your own mod
As in, you're typing in log()?
Why would it error on the file itself tho
yeah
No clue, usually it opens the debug console to some random vanilla file
btw where's the server folder located by default tho?
dont seem to find it in the game's folder
Wdym by the server folder ?
like the cache folder nd stuff
It's your local cache
so i can actually access the console
If you're on Windows and running a server with "host" go to %UserProfile%\Zomboid
just found it
It clears it when opening the server
Oh, I meant to reply to this: why?
it opens a menu
log exists, but it's meant to be called with a debug type and a message
where you can access files
and i can search for my lua files
and reload them
separately
You can just press f11 for that
F11 menu
oh
You're opening the debug menu by causing an error
okay im going to rejoin the server and see the console
im going to see if it works
oh yes it works
but just couldnt see it from the normal console
is there any modding tool
that i can use
so i dont have to access the txt
each time im trying to see the server output?
Just use VSCode when programming your Lua mods, you can also open the console in it and the file will reload in front of you
I even use an extension to autoscroll to the bottom of the file when it updates
im using VSCode
Then what's the problem ? You can open the file and see its content easily then
like this right?
Yea
btw in roblox we do like wait(1) how do we express a yield here?
in the same way?
Did you read the error ?
You mean to run code after a specified time ?
yes
you gotta write ur own
We don't use that, because your code runs in the tick and impacts the speed of the tick. You need to use Lua timers so it triggers after X ticks or X time
so like a delayed task
how do i use a lua timer?
Basically
Uuuuuh let me see if I can find an example
---@param seconds number
---@param callback fun(...)
---@param ... any
HorseUtils.runAfter = function(seconds, callback, ...)
local elapsed = 0 --[[@as number]]
local gameTime = GameTime.getInstance()
local args = {...}
local function tick()
elapsed = elapsed + gameTime:getTimeDelta()
if elapsed < seconds then
return
end
Events.OnTick.Remove(tick)
callback(unpack(args))
end
Events.OnTick.Add(tick)
return function()
Events.OnTick.Remove(tick)
end
end
For example
The idea is to add a function to an OnTick event, check how much time elapsed then remove that callback
turns out there is no string library in zomboid lua
There is
would it be fine if i just did an isoobject instead of isothumpable?
string should be a lib
Also PZ uses Lua 5.1 but a lot of stuff are reimplement Java side and are not classic Lua libs
btw these command props are good?
Probably, I don't have in mind the exact command args
The JavaDocs should tell you all you need regarding that
Also check out the Networking wiki page
Tho that page was B41 networking but commands are the same in B42
okay thanks
any idea why this would be?
More detail is necessary
it is on 46
according to debugger
so the line in screenshot
here are the variable values too
aa ok okay
figured it out
sq is nil
thats why its not showing up
might have overdone the fences
are you making a labyrinth?
btw is there a way to get players in a radius?
also getPlayer() returns isoplayer right?
It returns the client player
isnt that technically an isoplayer?
class
Yes of course
Are you using Umbrella ?
Yes
i got the lua language server
If properly used, it allows to detect the majority of problems
got it but idk how to toggle
No
Read the wiki page, that isn't Umbrella
It's extremely annoying but that extension is not Umbrella
Read the wiki page
You need git only if you use LuaLs
If you use EmmyLua, you don't
just did it
But LuaLs is technically still usable but won't be supported for long
Read the EmmyLua wiki page for the details
this legit might be the worst code i've written for this mod
idk wtf you're doing but everytime you send a screenshot of that checkpoint gen it's worse than before
Read the wiki page π
You need to create the file
You need to read man, like the info is right there π
yea we are cooked
You can't just go random with that
Make a mapping of your structure
And generate based on relative coordinates
i did this
im trying to make it dynamic
Wait I did a mistake in the naming on the wiki
so it changes based on the rectangle u give ti
The file needs to be .emmyrc.json
Ctrl + Shift + P > Reload window
btw does this go in .vscode folder?
Or 'Restart Lua server', but idk off the top of my head whether that catches the .emmyrc change
Nop, in the root
oh
It does yes
You can also do that at the bottom left where it's written "EmmyLua", select it and restart language server pack
still erroring when reloaded
Did you add Umbrella to the libs ?
ok
Like I can't say it enough, read. the. page
{
"workspace.library": [
"<path-to-umbrella>"
]
}
Download Umbrella's last source code from the GitHub release page or clone the repository.
In the library field, add a new entry to the array ([]) with the path to Umbrella's library folder on your computer.
If it were a long ass page, like I could understand you not reading it
But it's literally a few lines of explanation on how to even setup Umbrella
I mean it kinda is a mid-long page so i just keep important points on my mind
It fits on my screen !
The explanations for EmmyLua literally fit in a single screen height
Like if this is long for you, like man you won't survive the documentation long π
The repo (https://github.com/PZ-Umbrella/Umbrella) also has an explanation but the wiki page really is quite clear π so unsure how that was missed, but either way hopefully you can figure out the setup
Yeah im just used to another display of uhh documentation
srry
i'm learning how things work here
What kind ?
lemme show you
ok so in roblox
are you used with roblox things a lil bit?
that might ease things
The Wiki always can appreciate improvements, so if you think another format would fit better I'm open for it
I don't no
No no actually it's well written
https://kampfkarren.github.io/Roblox/api/ look at this api doc for example
i rlly like mkdocs styling
and very visual
Maybe if the code block were initially expanded it'd be easier to not miss it? I don't see an option for that on the CodeBox template though
ok im done
its a bit unoptimized (people might think the mod is a bitcoin miner) but i cant deal with it anymore
The idea of the codeblock was not to have it take too much space, especially since that same file is detailed in the EmmyLua page
But from experience, users want examples available
Yeah, the template page mentioned thatβbut in this case it seems like it'd benefit from visibility
The template however is unclear that it can be opened I think
It's clear to me, but unsure how much of that is familiarity
i.e., whether it'd be clear to everyone
btw does umbrella needs to be as a descendant of the root?
Tell me what you think
This is more of an API doc, which the Modding Wiki only is partially
I was considering just the code snippet too, but the CodeBlock is pretty π₯² probably better that way for visibility though
well i think the page styling still would fit a lot better pz
The JavaDocs does most of the job, as well as the LuaDocs which is going to see some improvements in the future as @bronze yoke is looking into moving to Sphinx
yeah javadocs are clear
Overall the main problem is the lack of description of things
In my case I've been trying to get into modding recently and at first I assumed this was the code snippet, but I did find later I had to expand it
Also had the issue with the config name but saw the right one on the Emmylua wiki page
Like what functions do what
do i put the path to umbrella in library?
bc when i look at the repo for umbrella
its telling me something very different
Eventually I'm gonna add some manual notes to the Lua stubs & try to convince others to do the same
from the luadocs
Likely a task for around b42 stable though
This is an environment variable to more easily move Umbrella around your system
there should be a harmony between pz and vscode
to the point
you can do like
uhh
Wym? Both indicate a path. You're looking at the environment variable example
oh k
Sadly the whole wiki is not very good on phone because it isn't meant to be used on phone since people that need the wiki play PZ on their computer, not phone π
Unless you meant something else
That is Umbrella lol
You'll get Intellisense once it's set up
when i do getPlayer() and it gives me the player object, can i access its properties? do i get autocomplete?
Yeah
Yeah the process of learning I did it on PC, I'm just on phone rn and wanted to show what I meant
Yes
What did you mean with your remark ? Is it the code block width or something else ?
Needs to be the library folder
oh k
Idk if that parent folder works
done
I think it'll find them either way, but I always set it to the library folder anyway
uhh still no intellisense and errors
Ctrl + Shift + P > reload window
did that
Try no dollar sign in the environment variable name
I mean that I thought the "code snippet" title was for the code below which shows the environment variable example, so I didn't think I could click on "code snippet" to expand on something else, it might just be a me issue π
still
do i put them on system or user env?
because its on user
Close and reopen all vsc instances, maybe? Windows creates copies of env vars for diff processes so it could be outdated
By "close and reopen all" I meant make sure there are no open instances and then reopen, to be clear
I would prefer it being expanded by default on this case, idk if that would be better for most people
now
thank you
btw
i should call all funcs
with :
right?
everything is OOP
No, depends on the function (from java, static methods are called with . on the class & instance methods with :. from Lua, depends entirely on what the function expects)
I see what you mean
also is it possible?
getting players in x radius
btw is there Y coords?
or nah?
vector2d or 3d
Yeah, although mind that depending on the radius clients may not have all the players loaded
yeah ik
If by Y you mean vertical, Z is vertical
oh
so y is horizontal?
or depth
X and Y are the position with reference to North/South/East/West on the map
Z is the vertical level
okay
thank you
btw is there a table i can access from client
for players loaded?
getOnlinePlayers returns ArrayList<IsoPlayer>
okay thanks
Note that this is not a Lua table, so you have to iterate through it accordingly
apologies for the interruption, bit confused about mod translations and where to put my strings
would it be correct to put the strings in common/media/translate/EN? and how exactly do i format the string file, the wiki entry isn't very good
btw how can i get character gender?
wait what doesnt it convert to a dictionary with isoplayers?
You can find examples of the format in the game filesβit's just associating translation names to their translation, pretty much. Substitutions can be done with %1 to %4
e.g., UI_Reload = "Reload", (grabbed a random one from UI_EN)
for index, isoPlayer in next, onlinePlayers do
-- code here
end
player:isFemale() β bool, where player is an IsoPlayer
right, but the folder organisation is correct?
next does not exist in Kahlua
Ah, missed thatβit should be in media/lua/shared/Translate
right, thank you
No (that one does exist, of course, but can't be used for ArrayLists), you have to loop through it using size and get. e.g.,
local players = getOnlinePlayers()
for i = 0, players:size() - 1 do
local player = players:get(i)
end
size -1 bc array starts at [1]?
or what?
because ur going from 0 to n
ArrayLists are 0-indexed, unlike Lua tables
uh ok
An ArrayList with 2 items has indices 0 and 1, thus size - 1
so ontick is like renderstepped or heartbeat right?
yea
does it provide delta?
oh
okay i understood it
thanks
btw
how do i add player proprs
like adding variables
to the isoplayer
You can't add properties, but you can add mod data to the mod data table
if i want to save a state for something
local modData = player:getModData(), then set properties on the returned table
should i make then a handler module and register players in a dictionary to change state values?
oh
so moddata is an arraylist or dictionary?
Regular Lua table
also is this per server or saved on client?
If you use it on the server it's on the server, if you use it on the client it's on the client. I believe it's not synchronized, but I'd have to double-check to be sure
If you're trying to save data about other players on the client this wouldn't be the way to do it, given that (assuming my memory serves correctly)
so if i for example make a flaw that has different stages
to register a value to indicate the stage
should i save it instead
on
server mod data?
using player as a key to index the value
If it's something only relevant to the player that you won't ever have to let other players know about I'd just save it on the player mod data on the server
If it's something you do need to let other players know about, but only while the player is online, I'd use commands
so i should do on server script, getServerModData() for the table or array list
and add
moddata[player:getUID()] = this
it must be persistent data
like
saved
like a datastore
What I described is what I'd do, not necessarily standard or best practice, to be clear
Yeah ik
so
moddata is a dictionary lua
or arraylist?
These are questions that can be answered by Umbrella & the LuaDocs/JavaDocs
It's a Lua table
im checking umbrella
and its telling me functions for the table
such as
:get()
which you told me to use for
arrays
no no
getservermoddata()
btw also look at this
-> charactertraits<?>
what is charactertraits
table, arraylist?
It's an instance of a class
so dictionary?
No, it's from Java. userdata
oh
If you type it fully and ctrl + click then you can go to where Umbrella defines it in a stub
ohhh
This doesn't return anything, it just requests that the server sends its mod data down (which you'd then have to handle with an event listener). I'd avoid this, personally, since you can use commands to have more control over what's sent instead of sending the entire server mod data table every time you want something from it
So what do you think is the best practice/method for storing persistent data?
like a value for example as level
as important as
Depends on what you need, but for your use case you could store it in global mod data on the server & write commands to get that data when you need it
how i can write on globalmoddata?
or get it
oh
i could just write a wrapper for it
btw global mod data is server only right?
No
so your allowing client to read it or write too?
ohh
so when you get the mod data on clientside
it creates a different data table
but when you get it on server you get the serverside one
basically mutations
like a module
btw how do i do character flaws? in registries
I haven't used registries yet, but I'm pretty sure that's explained in the migration guide https://discord.com/channels/136501320340209664/1448602571810803785 (or see the example mod, if it has that)
just checked it
its literally a trait
but negative cost
Yeah
also
its referencing
UI_trait_x
on desc and name
on traits
where i can add those vars?
so now the 100million dollar question, how do i get ma semi trailers back to 1000 capacity? π€ͺ
cant get to register a trait
simply doesnt appear
this is my registries.lua
character_traits on scripts
got it to work
but for some reason
uhh
it doesnt display the translation i added
Show your translation txt
I've had zero issue with custom traits and professions this far
@drifting wigeon is your translations in media/lua/shared/Translate/EN/FILENAME.txt?
yes
can you show it please?
the text in file
SCREAM_EN = {
SCREAM_trait_paranoid = "Paranoid",
SCREAM_trait_paranoidDesc = "You have mental problems, you need to take medication to battle this otherwise you will go crazy."
}
btw i changed these to SCREAM_trait_...
The prefixes that don't say "(optional)" on https://pzwiki.net/wiki/Translations are not optional
i.e., you can't have SCREAM_trait_paranoid, assuming that's UI_EN.txtβyou need to have the UI_ prefix
i did
SCREAM_EN
for my mod
The first line in the file does not actually matter
and the file name?
im gonna try that
well if the trainee has deleted the 0 for max capacity, i will just add 9 other trunks with 100 each so we will be back at 1000 capacity for semi trailers 
employing my evil spritework skills to edit the cheesecloth sprite into something resembling chainmail
i intend to make chainmail forging the pain in the ass that it is
putting together chainlinks by hand is agonising
how can i add status/moodle?s
is there a way i can do them on my own?
not without rewriting the entire moodle ui
moodles are not moddable and you have to go to extreme lengths to fake them
that framework does it for you
question, will all client side code need to be moved to shared or can non-item moving code etc stay in the client folders?
if it's client code it should be in client
ok ty, I heard the work around for client code on dedicated servers right now was to remove the DoLuaChecksum... I heard that was because of client code checks... it works though.
i don't think it's to do with client code, there's just some issues with the checksum in general
disabling the checksum doesn't change how the code actually runs
ah okay, thank you so much, Albion! π
btw how can i
uhh
make like the argument
for the .new
typechecked
like add a type to it
---@param player IsoPlayer
thanks
btw
how i can require moodle framework?
requiring it like this
but i want it to intellisense
you'll need to add the path to that mod to your libraries in .emmyrc.json
add it to library
yeah
yes
the lua folder
btw does it always have to be 4 goods and 4 bads?
is there an easy way to map building or other tile objects into script?
.lua files load once the player joins the game or on menu?
if they enable the mod on the main menu, it will load on the menu
if they start singleplayer and the modlist doesn't match their main menu mod list all lua will be reloaded
all lua is always reloaded when joining multiplayer even if the mod list matches
so what do i do if i want the client to reload each time they join?
since it wont make much sense
joining a server/game
and having like
character variables from past servers
that can't happen
they reload each time you join then?
lua always reloads when joining multiplayer or leaving a singleplayer save
worst case u tie it into events
yes
okay
anyone got ideas?
thats the thing
you would just be adding callbacks
each time you join a server
right?
if you reload
okay
Lua reloads when joining a server
I'm sure there's a million ways to do that
oh
The reload includes getting rid of old event listeners, if that's the confusion
ohhh
or whatever they are called
thanks
surely the devs didnt manually code in rotation and all
Story events
yes those
I'm not familiar with how they are stored
But I told you can place buildings manually
tbx files I believe they are
stories don't add tiles
They do actually ?
can i load these tbx files from script?
Some stories do have tiles in them
they just spawn items and cars don't they
._. I said you can spawn buildings, tbx files, so of course you can load them in
You probably can't load their data tho
No they do spawn tiles
thats fine
Some do spawn tiles
fence generator is getting an upgrade
Like that one road story with a manhole, there's orange cones
There's also the camp story
variables default to nil?
Wdym what happens ?
you're using isoplayers right
ye
He is
yeah that's a memory leak then
Wdym a memory leak ?
npc doesnt exist but references to them exist
if you don't drop the reference after it unloads the isoplayer will never be collected
and never get cleaned up
Interesting, and it never gets reassigned to that NPc when you load the area ?
i don't think isoplayer is pooled, it wouldn't make much sense to
other object types are pooled so holding references doesn't usually cause a memory leak but it causes other bugs that are usually actually more annoying
even if it did thats a npc logic running even when the npc isnt there
this editor is only for b42?
starlit has a module that makes this a bit less annoying but i don't know if it works with isoplayers
i can handle it prob dw
Yes
btw isoplayer object means the character physical, not the connection to server right?
so if a character is in creation
Forgot you're doing your shit on B41 --'
theres no isoplayer
Yea it's the player object
okay
i should prob get the soldier ai solid before working on these
bro just left me to die
wait why are you in b41
Bcs he's probably learning from superb survivor which doesn't exist in B42
But it's technically the same shit
how can i listen from server
to check when a player object spawned in? (player client only)
is there a event for that?
a lot of the things you're learning are already out of date though π they're making a lot of changes to how mods work
Did you check the list of events ?
first time modding any game tho
yeah cant find anything
except gmod maybe
theres no event to check from server when a player joined the game
That's client side:
OnCreatePlayer
yeah
but serverside?
server should be able to detect when a player joined its instance
yeah that would make sense wouldn't it
I guess you checked if there were new events already ? @bronze yoke
so i just do a oncreateplayer and send a client command to server to just let the server know he's there?
what if connection fails?
I guess
i ran a scan for new events but i haven't reconfirmed the details of any existing events
You can probably check if the IsoPlayer exists from server side
types are still accurate but client/server annotations could be incorrect
uhh how would i go on that?
do i parse the player UID to server
and it iterates through all server players to check if its existant?
they're already connected to the server and playing when this event triggers
No, just use the online ID of that player, which you receive from them when you make them send it to you, try to access the player and if it doesn't exist, it might be because they left
Also maybe you can get a list of clients on the server, and check whenever someone left
And associate them to their player
you can get a list of active isoplayers
how do i get the online id? and does the online id change or its locked for that player independently if the server - client reboots?
getOnlineID
thats for client-side right?
On any IsoPlayer ref
So if you have that ref server side it works too
An online ID is associated to an IsoPlayer instance
Yea
No
how can i play a sound?
hold on im gonna see how
do i call addsound
and the isoobject can be isoplayer right?
I highly recommend looking at a mod that can play a sound
isoplayers are isoobjects
i lowk dont want to depend on anything
im not using moodles
i made a manager
that creates a oop for a player
and registers the state
What I mean is looking how any other mod plays sounds
of a trait
oh
Not using a framework for sounds
i thought you meant about a api
okay thanks
hi there, has anybody found a way to use addxp in mp? it looks like it gets rolled back and not validated
xp must be added from the server
im sending a clientCommand that triggers the server to add xp, but it doesnt look like it works
this is a bad practice btw
you shouldnt trust client with this
hmm
what are you rewarding xp for? maybe you can make a way for it to run on server in an optimized way
nimble
what's that
for being in aiming stance and moving
oh
just make a server oop combatmanager for the mod or any kind
and make if it starts aiming
or moving
send a signal to the server
to set the state to moving or aiming
i already got it to trigger on the correct moments, but the xp add isnt working
i have a halo that pops correctly
that is trusting the client with more steps
but no xp, even if i try /addxp me Nimble=1000 it gives me the xp and rolls back
What would you do
I have a bunch of traits that are loaded conditionally, to allow people disable traits they do not like, is it completely fcked with the scripts system?
As example
if not activatedMods:contains("\\2934686936/EvolvingTraitsWorldDisableAxeThrower") then
local AxeThrower = createTrait("AxeThrower", 4);
AxeThrower:addXPBoost(Perks.Axe, 1);
table.insert(newTraits, AxeThrower);
end
if not activatedMods:contains("\\2934686936/EvolvingTraitsWorldDisableBloodlust") then
local Bloodlust = createTrait("Bloodlust", 4);
table.insert(newTraits, Bloodlust);
end
...
--- add traits later down the code
doesnt the server know whether the client is aiming and crouching?
pretty much
you were using mod ids to disable traits?
ye i had a separate mod to let ppl disable traits 1 by 1
been trying for 2 days to do that and to get stamina regen for sitting but stats seems to be private/protected in java class and not exposed for lua
that's cursed as hell π you can do it with sandbox options, starlit has a module for it
basically it just hides the trait from selection
it's not optional to pre-register traits anymore but doing it that way wasn't compatible with sandbox options anyway
how can i play a sound originated from a player?
player:playSound("name")
okay thanks
im looking at the docs and i dont see anything 
Which module is it?
can i add sounds like this?
i don't think i wrote docs for that one
ah k
it's older and ported from some other shit i made, let me check how it works

No =
how then
No = in the sound script line
brother look at any mod that adds sounds
and on playsound i do scream:x right?
You shouldn't have that scream: thing
Unless the game is inconsistent here and doesn't use the module off sound scripts, which it might not use actually
Then you'd need a suffix
and this?
Try calling it with the module, just so we can see if that thing is script bullshit or not
?
Else you'll need a suffix in your sound script ID to not clash with other definitions
local Traits = require("Starlit/sandbox/Traits")
local traitInfo = Traits.getOrCreateInfo(MyCharacterTrait)
traitInfo.toggleOption = "MyMod.myOption"
wait what the hell is this shit hold on
Do you know what modules are
i will add a suffix anyways just in case
yes i do
there is a typo that is going to make this not work LOL
safer now
that code will work, i just need to push a hotfix really quick π
Is there any mod that uses that module, I'd like to look at working implementation?
Collection on workshop doesnt look like it has any trait mods
the only mod that uses it used a copy pasted version because it was before the module was released
it'll be outdated now since the whole trait revamp a couple days ago
getuid will return the same thing for a player in client and server right?
Different application
Basically the game supports servers outside of Steam
oncreateplayer only fires when the character is customized and created? or when it loads in?
So depending on a Steam ID limits things for that, and so I guess they went with another system to identify IsoPlayers client and server side, and there's already a method to retrieve the IsoPlayer instance via an onlineID
When it loads in since the IsoPlayer reference already exists
okay, also for each time they die does its id change?
or isoplayer change?
Yes
so online id changes when they die?
I said an online ID is associated to an IsoPlayer
ok that's fixed, make sure it updates and let me know if there's any problems
So if that IsoPlayer disappears, its ID too
that'll be a while as first I'll have to migrate all my traits to scripts from NPCCreationMethods

btw if i do player:getmoddata() that data will save on server when player leaves?
yeah you're gonna be hit hard by these changes huh π
yep
this also means that when the player leaves even if the character didnt die, the id disappears right?
and when they join the isoplayer has a different one
isnt there any bound id to the living character?
The ID still exists, but the IsoPlayer ref disappears
Why would you need that ?
to store a class in a dictionary for a trait manager
Use object mod data if you need to keep track of player informations
hmm
i got an idea
i think if they rejoin they get the same online id back
I'd be surprised tbh
they only reset when the server resets
so its like player uuid in minecraft servers?
maybe?
could be
i really don't know how minecraft servers behave
if i use my module for new items like:
module BetLock
imports
{
Base
}
item BobbyPin
{
DisplayCategory = Tool,
ItemType = base:normal,
Weight = 0.01,
Icon = BobbyPin,
Tooltip = Tooltip_BetLock_BobbyPin,
WorldStaticModel = Paperclip,
}
}
should i do ItemType = BetLock:normal?
No
i mean if they're using uuids it sounds like they're meant to be used for persistent storage
online ids are not persistent
btw when i recieve the ondisconnect event on client i can still communicate with the server to alert him a player is leaving?
I want to translate the game into Hebrew but I can't. I don't see the font. It's gone. I'm looking for someone with experience to help me in exchange for money.
i need a reliable persisent id
Why do you need an ID ?
What's the need you have for it ?
does it need to be a player id or a character id
for a reliable way of storing a class oop bound to a player connection id
Because if object mod data is enough, I don't see why bother with an ID
its not enough
If I used to append few symbols to trait names to mark them for players, that is also gone, right?
---@param name string
---@param cost number
---@param isProfExclusive boolean
---@param isDisabled boolean
---@return Trait
local function createTrait(name, cost, isProfExclusive, isDisabled)
isProfExclusive = isProfExclusive or false;
isDisabled = isDisabled or false;
if getActivatedMods():contains("EvolvingTraitsWorldMarkDynamicTraits") then
return TraitFactory.addTrait(name, getText("UI_trait_" .. name) .. " (D)", cost, getText("UI_trait_" .. name .. "Desc"), isProfExclusive, isDisabled);
else
return TraitFactory.addTrait(name, getText("UI_trait_" .. name), cost, getText("UI_trait_" .. name .. "Desc"), isProfExclusive, isDisabled);
end
end
man this update 
i need to create a class and garbage collect it each time a player join and leaves
I don't see what's stopping you from doing that here
classStore[reliableIdentifier] = nil or x
Are mods from the workshop category loaded too when selected?
because I have a mod in two places...
and ondisconnect i can still comm with server?
No idea
yes, do not have the same mod in two different places
Don't have two copies
ahhh... I did so many manipulations elsewhere to understand that the workshop was a priority...
thanks
would i be able to do this?
Maybe
wait
do you have to like guess what each thing does on the code?
pz devs dont release official guides?
which thing?
oh
Basically the whole modding wiki you have at your disposal is completely community built, and I probably wrote like 90% of it ? π
I got the help of others, notably albion, on the technical details
Albion who is also the one managing the JavaDocs for B42, and the LuaDocs, and Umbrella
So yea we have to guess everything, like we have to find out everything that changed the majority of the time
Us getting notices from TIS about changes is kind of a first, best we usually get is a mention of things in the patch notes, and the majority of the time it omits a lot of things
aiteron is working on some basic api docs
Apparently yea
this would make things easier
if a dev actually gets involved
Which tbh I don't understand why this isn't made on the modding wiki
He's a dev
yeah thats why
I mean imagine if 42.13 dropped without docs
i would've had to repeat myself even more than i have π
What scares me is that those notices become unusable, or are badly written / aren't actually proper intructions to doing X Y Z
they should make a clear structure
is there someone here that can help me with a simple mod im creating? ive no idea why it isnt working
and that doesnt change behavior of old mods
with new updates
which is totally possible
Making new game updates backwards compatible with mods is as far from bright idea as it gets
it's not possible with the level of changes they're making currently
just ask questions
it should be noted that only one of the documents released alongside this update is the migration guide
the other is part of the general guide aiteron has been writing
Like the code overhead on that is honestly beyond imagining
yeah ig, game is still in early ac right?
im trying to make a mod that gives the zombies their own custom walking sounds. whatever they are wearing. but it is not working
the game's code is genuinely just really poorly designed in a lot of very major areas and they're working on that now and that means big breaking changes
this is my first mod and im doing it with help from internet and chatgpt
they still use the same bank as the player
I'd recommend replacing chatgpt with other_mod_that_works_and_does_similar_thing
a good approach should be making the game with modding in mind, making game structure like a puzzle, plug and play, like each feature of the game being a kind of a mod that's already pre-integrated, so you just build up and not like "break the whole thing" each update
if yk what i mean
I'm a big advocate for chatgpt in coding but it's really bad when it comes to PZ API
the most major design change is making the game more extendable and working on the core frameworks of the game
i mean ive already tried multiple ways and rn i have a custom bank and a LUA script. but it doenst wanna work
this breaks every mod because it wasn't designed this way in the first place, it's not something that is possible to maintain compatibility with
they should keep old functions/methods but changed for retrocompatibility
so if anyone that knows more aboutr this can help me figure it out that would be nice
it's not just old functions, it's the core design of these systems
ig
they *could* have allowed trait identifiers that are just strings to continue working, but then that basically just throws out every benefit of changing the system, and most mods would simply never update to the newer API
registries seem good tho
I'm of the pov that such changes is fine, yea it'll break mods but if it's for the better it's worth it
basically maintaining compatibility with changes this fundamental is an insane code burden and genuinely just goes against the point of making these changes in the first place
just think abt what will happen when they release next build
i dont want my code broken
changes like this do not happen every build
B42 released and barely broke anything
when b42 first released i only had to make changes to one of my mods
Hi! Is there still a Java Doc for the 42.12 or older versions available somewhere?
Nop
but it broke the way traits work? for me that is too much already
the trait system was awful and needed a total revamp, i don't think they've even gone far enough yet
is there a guide for ui?
I have one planned for the wiki, but not done yet
not even started yet
What language are the translation text files? I am ahving a brain fart
they do not conform to any language
text and stuff uses udim2?
Alright didn't think so.
udim2 ?
Yea it's not a language
scale: relative to screen offset: pixels
Sooo absolutely no comments at all in those files.
Yes actually
How?
can i actually do this? (storing mod data on a class)
Of course
Mod data is just a regular Lua table
btw moddata is isoplayer bound right? if player dies it erases right?
Man at least toss me a bone for my work on the Lua stubs π (I don't actually care about credit at all, poking fun)
It is bound to the player, but when the player dies if you still have a reference to the IsoPlayer then I'm pretty sure you can still grab the table
oh okay
If you mean well after they've died (i.e., different session), though, then yeah
yeah i meant about like getting the new player
You are right sorry, you do tend to be the shadow of the project and so I don't actually know how much work is yours π₯²
You're good lol
Wym?
player dies
client creates a new player
player joins the world
oncreatedplayer fires
server receives it
and gets player
different moddata right?
Yeah, different mod data on the new player object
Should be the same
Same mod data, but remember it's not sync'd (I believe)
im getting moddata on server
as a "data-store"
but i want it per character
so this should do
lua docs are really 99% omar's work, he wrote the generator for lua type information and goes over it for accuracy after most patches, i just wrote a quick script that would let doxygen make sense of it
Simple answer is "like a Lua comment, with --". Full answer goes into the weird parser quirks that make it so that technically it's any line that contains --, and does not contain = and ". The detail only really matters when extending translation lines with .. (which is also something you can do), since starting a translation with -- would render it unusable otherwise
So, basic answer is just -- comment for comments in translation files, except for some weird edge cases
Actually, checking again, idt the detail matters since the comment check prevents extending with The comment condition does not run for lines ending with ... So, simple answer probably suffices.. π€¦
I did not knew about it yea
btw is there a way that the server i test the mod on i host as an outdated version of my mod?
