#mod_development
1 messages · Page 98 of 1
namespace is mod id?
more or less, yes - a mod can have several "namespaces" in that regard
but it's just any global object that they assign stuff to more or less
here you go https://www.lua.org/pil/23.1.1.html
they're also called modules
Writing modules means that everyone can get along.
local exports = {};
exports.foo = bar;
return exports

I'll never know why PZ doesn't use modules.
I do.
I encourage everyone here to use modules.
Might be a good idea to make short tutorials, possibly videos for people beginning PZ Lua.
fenris's tutorial is the best reference imo, if a bit incomplete
I'd be so lost without the explanation of all the weird shit Kahlua/TIS does compared to normal Lua and how it interacts with Java
i've been making one global table per mod and storing everything as as subitem of that table
so that everything is patchable yet i don't bloat the global table table so much
i have heard locals are more performant
but i didnt wanna sacrifice accessibility
nothing wrong with that tbh, as long as you make sure your namespace name isn't vague
im guessing modules are the middle ground
i am of the camp of long variable names that are expressive
One of the benefits of Typescript modding for PZ is that these specific quirks of Kahlua somewhat goes away. =)
It's been fun watching people mod in Typescript and mention how much easier it is to use it rather than learn Lua and also the weirdness of Kahlua.
if someone handed me typescript when i started i would have jumped on it
but i already learned the nonsense
and i dont know javascript
so
¯_(ツ)_/¯
yeah
It's fun knowing the evils of both.
i hate languages like these tbh
I don't think modules are the middle ground - they're by far better and don't sacrifice accessibility
They even allow modifications.
but I use require religiously anyway cause I don't trust myself or the load order
tbh modules aren't really necessary if you're using an OOP workflow properly, but they're the best option if you aren't
local foo = require 'bar'
foo.bar = 2
cuz it always fails miserably for all kinds of mysterious reasons
Sorry, misunderstood middle ground to be a compromise
yeah doesnt have to be
i've seen lots of require statements in pz kahlua fail miserably to load things that exist
so im a bit wary of them
Yeah I'm not sure why that happens
i've felt safer just making sure the alphabetical order of paths is correct
zero issues with that
big brain move: ignore the global namespace, use function environments
(just don't fuck up your scope or you'll break literally every line of Lua in the game)

function environments? :p
I wonder if it would be possible to create a visual map of requires
I bet it's improper pathing.
undoubtedly
with a custom parsing
that'd be kinda neat
It sometimes occurs for my mods - but not for me - so I have to assume it has to do with load order in dedicated machines
Did you know that if you contained all code into events and remapped all module requires as variables prior to that event you can eliminate the need to require in implemented code?
you can use setfenv to basically throw away the global namespace, and replace it with a new one entirely. it's usually recommended to pass the current global object as _G into the new namespace you're creating though, so you can pass things between them
(This is how PipeWrench works)
The load-order BS kills generated Lua code.
I had to boilerplate-reload the imports and that got rid of Lua-require shenanigans entirely.
No more of that "chicken-vs-egg" crap. >__>
is there anything better than mod manager for ordering mods? Its pita to use in this use case
question regarding requires - does kahlua reload the module once it's 'found' along the directory even if it was required previously up the file-chain so to speak?
edit the ini file by hand
:)
that's what i do
lol
full granularity
nay require only runs the file once
alright
I was curious about that but wasn't sure how to test for it
In other news:
Color coding events - using a color blend method I use in conditional speech
using alpha on the colored circle causes severe FPS drops
nice!
I also thought of using the same color blend method for fading clothing
maybe the same method the foraging system uses to do alpha fades on their icons could be applied?
at least, if I'm remembering correctly I think those have variable alpha fades and such
The issue is how often I have to call it - but I can check
how often are you calling it now? and what's required?
it's called if I recall every other tick
it's calculating the player's pos to the event's
weirdly enough doing all the math for the color blending is less costly than just setting the alpha itself
might not be a cost issue though - could be a bug in rendering
the game stutters
so just doing the alpha set command alone causes it? hmm
seems weird
I could try to test more to eliminate possible factors
I was spamming raider events so I had a couple dozen beer bottles around me
could be a different command for setting the alpha than what you're using, but I don't know for sure
I was doing this
self:drawTexture(self.textureBG, centerX-(EHE_EventMarker.iconSize/2), centerY-(EHE_EventMarker.iconSize/2), 1, _color.r, _color.g, _color.b)
except the 1 was a non 1 or 0 value
every tick? yeah I think that'd be the issue, maybe, unless the way that the drawing works is that you need that every frame or it doesn't exist. but if that's what vanilla uses to load UI elements then I suppose that's normal
I'd expect there to be a way to keep that texture in memory and modify it when needed, rather than effectively creating a new object each time
could also be a math issue - as I wasn't flooring it to the nearest 0.01
also, may be slightly faster if you make the pos constant, to avoid the overhead from dividing to get the size there. i can't imagine you're going to change that icon very often, so you should be able to use a constant number there
the overhead on that may be miniscule though, hard to say without testing
just my embedded programming side coming out a bit lmao
local function colorBlend(color, underLayer, fade)
local fadedColor = {r=color.r*fade, g=color.g*fade, b=color.b*fade, a=fade}
local _color = {r=1, g=1, b=1, a=1}
local alphaShift = 1 - (1 - fadedColor.a) * (1 - underLayer.a)
_color.r = fadedColor.r * fadedColor.r / alphaShift + underLayer.r * underLayer.a * (1 - fadedColor.a) / alphaShift
_color.g = fadedColor.g * fadedColor.g / alphaShift + underLayer.g * underLayer.a * (1 - fadedColor.a) / alphaShift
_color.b = fadedColor.b * fadedColor.b / alphaShift + underLayer.b * underLayer.a * (1 - fadedColor.a) / alphaShift
return _color
end
This is the blending method I use
all this doesn't cause stuttering
although I am curious about the alpha thing
local aFromDist = 0.2 + (0.8*(1-(self.distanceToPoint/self.radius)))
local mColor = {r=self.markerColor.r, g=self.markerColor.g, b=self.markerColor.b, a=1}
local base = {r=0.22, g=0.22, b=0.22, a=1}
local _color = colorBlend(mColor, base, aFromDist)
``` use case
Is that a lerp function I see?
perhaps, I found it when trying to make nicer colors for conditional speech like 2 years ago
softer the sound the closer to gray
yeah that's more or less a lerp from the looks of it. cool beans
lerp gang
howdy everybody! is there a way to tie a moodle to the helicopter following you? i took deaf on a friend's server and it's a lot of fun but i am paralyzed with fear from the heli
im having issues when messing with the alpha of the markers i made as well, been messing around with it on the last 2 days thinking i was doing something wrong... the game was stuttering and it only stopped when i removed the alpha manipulation
@sour island what's the base object you're using for the icon, or are you not using the UI library at all?
it's a ui element
the texture itself is what is getting alpha'd
EHE_EventMarker = ISUIElement:derive("EHE_EventMarker")
it looks like ISUIElement's update(), render(), and probably prerender() are abstract, does EHE_EventMarker implement those? if not, it might be causing the wonky issues, if you're adding your own update loop outside the UI's update loop
I am implementing update/render/new
is there a way to show miliseconds/execution time for a block of code in PZ debugger or use some clever function in lua?
then yeah all seems to be in order. I assumed when you said it was occurring every other tick that you were adding it to the event handler manually
like system.timer.start stop
nah, I have the event skip a tick - and the marker is only updated when the event is
or even substract time from system time point 1 - point 2
may have to double check that
lastUpdateAllHelicopters = 0
function updateAllHelicopters()
lastUpdateAllHelicopters = lastUpdateAllHelicopters + getGameTime():getMultiplier()
if (lastUpdateAllHelicopters >= 5) then
lastUpdateAllHelicopters = 0
for _,helicopter in ipairs(ALL_HELICOPTERS) do
---@type eHelicopter heli
local heli = helicopter
if heli and heli.state and (not (heli.state == "unLaunched")) and (not (heli.state == "following")) then
if not heli.updateEvent then print("ERR: updateAllHelicopters: heli.update not accessible. heli:"..tostring(heli)) return end
heli:updateEvent()
end
end
end
end
Events.OnTick.Add(updateAllHelicopters)
I saw that the serverside stuff for inventory and such will change at some point, anyone know if that's coming? I don't know if I should still update a mod which maybe obsolete in like a week or a month 🤔
it won't be completely accurate, but yes - you can use os.time and subtract it
oh yeah, don't do that. you need to have all the UI's update code inside the :update() implementation you mentioned
I could also be mistaken and just have it so the event doesn't update - but the UI is still grabbing the event's info every update()
EHE is almost 2 years old and was done mostly through trial and error
right, but wouldn't that mean you're executing it twice? on two different loops?
the event is a different object to the marker
i.e. your helicopter update loop, in the OnTick, and also the UI update loop, on update()
oh okay, as long as you aren't updating the marker object (the ISUIElement parts) on an event handler manually
then yeah that probably isn't the issue
Since m35 had similar issues related to alpha - I think it's a render issue
the texture I have is also a png with some transparency already - could be related
getTimestampMs()
I'll do more testing after I'm done
the current system works so I'm not all that inclined to figure out why it was breaking
😅
maybe, yeah. you could try maybe loading the icons as a spritesheet, maybe they'll get loaded differently? haven't looked at how it loads atlases compared to loose sprites. idk if the texturepack creator in the mapping tools can facilitate that though, depends on the sizing of your icons and such
i doubt that's the culprit though
the icon isn't being resized afaik
I have a few things to check: flooring the alpha to 0.01, using a non-transparent png, etc
it shows me 1ms, i think thats too much for a simple table, though i dont notice any stutter
i think this is not accurate
are you using os.time or the function above? whichever you're using, try the other
os time and gettimestamps gives me 1ms
these are longshot guesses since I haven't done much with the UI and I don't know where ISUIElement's abstract functions are actually looped through and called, but where are you calling drawTexture? from what I can gather it should be in :render(), and you want to make sure as many things are passed in from the object itself (i.e. no calculation logic, and so on - just pure value reads with maybe a couple conditions) and then do the drawing logic at the end
whereas :update() should be whatever info you need to update on-loop, i.e. your alpha value (which would be stored on the object somewhere)
and from what I gather, prerender() is somewhere inbetween
it's in render
then yeah it all checks out, sorry for spamming you with guesses 
nah it's fine - the fact that the blend works with no issue makes me think it's a internal thing
the only time I know textures are drawn with alpha is in inventory and there's no issues there that I know of
render(), prerender(), update(), onresize(old_width, old_height, new_width, new_height)
I'm confused as to what this is in reference to
Thought you said you don't know all the hooks for UIElement.
nah, I know what they are, just wasn't clear on where they're called
Those are the functions invoked if you handle your own java object for UIElement.
not sure what you mean by that
ISUIElement is Lua-based but using OOP (as is most of the code), and the functions you listed are abstract, but I don't know where they're actually added to the loop
unless you're saying ISUIElement has a Java root, and the former is just a wrapper, and the Java calls stuff on the Java version of it? 
(okay yeah, took another look - it seems like the last thing I said is the case. I get it now)
the "if" here implies there's another way, i.e. without using a returned java instance of UIElement in instantiate()? is that possible?
ISUIElement is a wrapper.
I mean I guess you could re-implement all the logic in Lua and add everything to the appropriate event handlers and whatnot, but I imagine there's a barrier you'll hit somewhere
I'm also rewriting ISUIElement with the HTML project.
Since I'm getting kicked out of the office early today I could work on it.
@sour island I made a commit to reopen panels if you're interested, but the generic.OnOpen needs some refactoring
the current version should repopen/keep closed as expected
I don't mind refactoring for the sake of optimizing or eliminating the instance = nil
instance should be nil, those sometimes save playerObj
Oh then the current version is fine(?)
I tested once and the generic panel closed and opened as expected
I might need to eliminate the dev branch - I'm still getting hung up on the PRs
Can I fork my own repo?
Sounds like you need a Discord server to manage this project.
I remember tyrir had a debug console . Can that be included on the community api
Idk if the changes were on main or dev -or if you had them in your branch - but setting it to nil on death fixed the issues I was having
Hey guys, is it generally unsafe to uninstall mods in the middle of a save? Multiplayer in my case (I'm host)
Sure if he's ok with adding it- but what did it do?
Depends on the mod
or make a thread for it
Just a car mod boss, I was told map mods are a no no
I would recommend just keeping one main branch, and using git tags to mark commits intended as releases.
I have 1 branch as main - auto updates on fridays and a hotfix that uploads on push
the issue is I have a dev branch too for ongoing changes - but I think that should be my own fork
if I delete dev would that cause an issue on your end @fast galleon ?
no it's fine
The branch dev is associated with 1 open pull request:
#23 - reopen debug panels OnCreatePlayer
I do feel bad considering you've helped - I wouldn't mind merging a space or indent just so you're on the credits 😅
I cant reopen the PR - due to it pointing to dev
If you're still having issues and want to make a new one lmk
I wasn't able to experience any issues upon relogging or death
should have a branch for each thing being worked on
have indeed thought about it
a fork per person or you mean a branch for each sub-mod?
looked into making a thread within this channel but theyre disabled
i meant a branch per group of related commits
so for example in my case id have a BaseUI branch
I can probably make a thread (not sure) - this would be for your project and it's updates?
then we merge branches into main whenever theyre ready for a release
I can see what the higherups feel about using threads for that purpose
is it dedicated server time then?
why people dont like strong typed languages? I really dont like lua because there's no strong typing, when you work on someone else code you either print everything or be on the whim of modder documentation
"Unofficial PZ Mapping Discord" exists, it's time for "Unofficial PZ Modding Discord" 
lol
There already is one (sort of)- but I figured the community project should remain in here to some dgeree
it should but also hard to keep track of stuff without a dedicated channel
I don't think there's that much demand to have it's own channel much less server tbh
Would be easier to justify/request if there was momentum
I woke up sick, so I'm out of work too lol
You're more than welcome to have a channel on my org's server.
trying to understand why one of my mods only has 5k unique visitor and over 14k subs...
MP
yup. or collections
makes no sense the mp bit, its only ui for extra info on screen or obs
why wouldn't that make sense?
yea when it's distributed via server mod you dont goto the page
you just sub
no visit but yes sub
zomboid doesn't have clientside mod loading
but thats what im saying... whats the point in adding something like that in a server
don't even get me started. the zombie fix is a java fix
extra stats as in how many kills etc?
and it's the same way
still thinking about adding the car kills or not
sounds like someone wants to use that - and in MP everyone has to use the same mods
then that could be literally any server where the owner/players want that feature
yeah

QoL mods are usually the biggest to benefit from visitors<subs
could just be someone with a very popular server likes your mod
i made simply 'cause i was sick on the same questions everyday on the stream... like every 10 m
"how long are you alive for? how many zombdies did you kill"
....
i think when you read most comments on workshop, its not too surprising
is there getPlayer() command to get faction info?
people like feedback haha
i should finish the mp part of the integration mod... but this animation thingie is fun
i think its getFactions()
dont have it in front of me atm so someone may have to correct
I tried that as well as singular Faction with no luck 😦
thanks tho!
i'm almost certain it works
it does
I'm getting a nil exception even though he's in a faction :/
Faction.getPlayerFaction(getPlayer())
Faction.getFaction(string)
-->
faction:isMember(username)
faction:isOwner(username)
I do, im testing on my MP server rn in the debug window
local factions = Faction.getFactions()
if factions then
for i=0,factions:size()-1 do
---@type Faction
local faction = factions:get(i)
local factionName = faction:getName()
if faction then
works for me
hmm is there any way on a mod for mp, to lets say allow a user thats not an admin, but is whitelisted or something do run server side mod code?
that's precisely what sendClientCommand is for
I managed to get it to work, thank you for the help. I was doing getPlayer("admin"):getFactions() like a goober. Faction.getPlayerFaction(player) worked. Thanks again!
hold on, but doesnt that send the command to the client?
It believe so, yes.
no. sendClientCommand is sent from clientside code to the server, to execute a server event
you're thinking of sendServerCommand
the naming logic still baffles me
it's really poorly named tbh
ok... i have the code ready then
oh, wasn't paying attention, thought you were talking to me
also if you want a "whitelist" kind of functionality, you'll need to do verification on the serverside that the client has the correct permissions to do whatever it's trying to do
yeah thats what im doing
if you have the permissions logic on the clientside code, then it leaves it vulnerable to exploits
ye
you got it then
but it seems i was sending the wrong stuff to the wrong place
so... now i know why it didnt work
....
that makes no bloody sense... sendclientcomand = server to client...
depends how to look at it
the name to me at least tells me its supposed to be the other way around
to me i see, sends client command out
thats how i read it, and probably how whoever wrote it thought also
sendClientCommand sends a command from the client to the server
sendServerCommand sends from the server to the client
i got that part @drifting stump , i was mistaken and trying it the wrong way around
the frustration got to the point i decided to just finish the sp bit to release the mod and stop the damn DM's
and focus on the mp later
also make sure your event listener is in the right place too, i.e. Events.OnClientCommand.Add(onClientCommand) should be on the server
a bit less janky, gonna increase the fps on the animation to see if it improves it
tks for the heads up will do so
integration with twitch... in game alerts
no im not, link?
anything that makes my life easier is always welcome
i need to find a better way to move the UI
so i can add some "randomness" to its movement
I don't think the public one has the latest fixes - going to see if the auto updater works as expected
it's basically AUD given a fresh coat of paint + a few extra bells and whistles
i only started using AUD about 2 weeks ago... and i think youre the one who reminded me of it
yup
the reloading just by itself was worth it
it speeds up making the mod by a lot
the biggest change I made was modifying the inspect context to include java fields and more classes
the ui was also overhauled 🙂
I also made the vanilla cheats window alot less clunky in favor of how AUD does it
add in a lua intepreter like cheat menu has and it will be my favorite mod 😄
except I don't manually set up the cheats - it grabs them off the vanilla menu and decorates it to work like a toggle
I've been meaning to look into that when you mentioned it
it's basically like typing into console?
chuck should I edit the OpenPanels?
oooh
its on the video i posted
i use it mainly to trigger functions for stuff im testing
I don't have any issues with window layout inconsistency - do you?
or to change some values midway
so it's like the console, but with multiline support? that's nice I suppose
there already is a lua console when you run the game in debug mode. multiline support would be nice, but its not actually needed in lua if you just use ;
@dark wedge debug mod refuses to run on this machine
Scratch that - the debug windows don't actually open on death

dunno why, tried everything i could
doing it with semicolons is the most unwieldy thing ever
but it just doesnt run
code? working as intended? blasphemy
I wonder why those work
what? that would make modding very hard overall, sheesh. even if you use -nosteam ?
You could mod in Java. xD
now just need to make the clouds "move" and some more details
i even bought a nonsteam copy of the game to try out
Yes, I was mistaken - the panels don't reopen on death. So if you have something to address that much appreciated.
on this machine everytime the -debug is set the game just either freezes or doesnt even start
no but I was thinking that making all the instances on start is not necessary. Also I think it causes the debug menu buttons to not open panels the first time I click (this happened before).
yeah that answeres one of the questions I had
lol main branch is full of errors now
I had the needs more than 1 click issue before- but that hasn't occured for a while
oh really? :\
should have been more careful with that dev branch my bad
that happens to me with right click on the ui
i had the right click set to rotate UI defs ( size position etc )
sometimes it would only work after the second click
other times it would just work perfectly
ah the cheats window that reappears isn't a functional one
wait...
now it's just not working . _ .
fast move works no clip doesn't?
seems like the toggles break on death
what errors are you seeing btw?
can you make http requests using require('http')?
Nope.
Rip my mod idea then lol. Thanks!
If TIS set java.awt.headless=false on the default JVM params for the game when launching, openUrl(..) would work again.
This is what broke the API call.
I figured out the issue with cheat panel
Oof. Why'd they block out api calls anyway
I reported this a ways back and TIS either didn't understand what I reported or didn't care.
I need to grab the vanilla instance created and make sure that's closed and removed on death too
If you want to put discord invite buttons for your mp servers or even mods, get them to set that back to false.
(Or rewrite the method)
womp womp. Feels like a pipe dream now haha.
Yeah, I can imagine.
Unless they made a whitelist for domains then yeah..
For them, users, or both?
Both.
openUrl doesnt work?
Unless they've fixed it no it hasn't for years.
I use it to access desktop folders
it definitely works for local files
isDesktopOpenSupported is disabled for me
but openUrl can be used for local too
the game used to have links to mod folders
all that's been disabled with desktopopen being gone
mayhaps it could be added in with the patch
I can patch it but I don't know if it was disabled due to security reasons.
Well I just tried it and it is working but it opens open a web browser tab
What did you want it to do?
He wants a HTTP GET
Just trying to reach an API
oh
openUrl won't do that for you.
Yeah I’m getting that now haha
thats one of the reasons why i made an app for my mod
so any connectivity need is handled by the app
just had the trouble of making a lib for twitch api and use it in the app
i hate using keypresses to trigger stuff
What’d you build the app with and how exactly did you connect it with Zomboid?
the mod is what connects the app to zomboid
the app speaks with the mod the mod speaks with the game
so the mod is just the "middleman"
Gotcha, thanks!
one question... is there a way to "flush" the cached images from the game without restarting?
if i use lets say image.png to draw a texture
i edit the picture but it doesnt reflect the changes unless i restart the game
That seems to be coming as part of build42, so definitely not in a week or month
I don't think it'll be possible
i would expect to at least quiting to main menu to clear it
oh well, its not that much of a deal... just anoying
not sure why I tried to make the class run it's function with the instance as self instead of just doing it this way
oh I see why
I don't think : is interpreted this way (probably?)
causes an exception with the StashDebug in MP though
hard to tell, not quite sure what you're trying to accomplish there. invoking a function at index addFuncOnShow?
addFunctionOnShow is a string
fed into my 'generic onOpen' for debugUI
some of the UI have special functions called on their OnOpenPanels
trying to figure out why stashDebug is throwing errors on MP
the line throwing it is:
function StashDebug:populateList()
self.datas:clear();
for i=0,StashSystem.getPossibleStashes():size()-1 do
local stash = StashSystem.getStash(StashSystem.getPossibleStashes():get(i):getName());
self.datas:addItem(stash:getName(), stash);
end
end
``` ` for i=0,StashSystem.getPossibleStashes():size()-1 do`
null:size
not an issue in SP though
and the window works fine after the fact
does it throw errors in MP by default, or only with your mod? 
with my mod
hmm
function: populateList -- file: StashDebug.lua line # 72 | Vanilla
function: initialise -- file: StashDebug.lua line # 66 | Vanilla
function: OnOpen -- file: vanillaOpenPanels.lua line # 37 | MOD: Modding Community: Debug Tools
function: openOnStart -- file: vanillaOpenPanels.lua line # 85 | MOD: Modding Community: Debug Tools
do you even touch StashDebug at all?
My guess would be an issue with the timing
It's one of the debug buttons
could it be the server's "client" ?
the server's client wouldn't ever try to open the debug panel
i think its timing also because it doesn't throw it when you reload it while in game
unless im clueless which is also possible 😄
i dont fully get what exactly reloads when you reload a lua file in game
if it's timing, I mentioned this earlier. No need to make all the instances on create player
but stashsystem is a server focused system, e.g. when you read a map it sends a command to server
I only do that to trigger register window - so that the windows reappear when relogging
Is there a way for me to just... Log spam while the game is loading? I need to figure out why our duct tape has 16 uses instead of 4
I have to debug my mod MP stahes now 😦
?
error
Sounds fun...
let me try vanilla only
turning off the openOnStart is creating the double click to open issue as mentioned earlier
also stops the windows from opening on relog
I tried to search through all files and found no evidence duct tape is ever modified
And in game, it's weird as well
I think the instances need to be generated for the layout to keep them open or closed (?)
It sometimes has 4 maximum uses, and sometimes it has 16
in debug print things like getUses, getUseDelta for the Item
Sure, but... How do I get my prints to happen in-between every mod load?
during game*
But... I want to find which mod causes this fuckery
easier to search the files for "DuctTape", "Base.DuctTape"
I did
There was... Nothing
I even searched for all the DoParam and setUseDelta to see if there's any autopatchers at play
There was absolutely nothing
Wow so many active on chat
Vanilla throws error too for Stash Debugger, no mods when I host
oh?
How do I debug my mods when vanilla barely functions as is
local StashDebug_populateList = StashDebug.populateList
function StashDebug:populateList()
local stashes = StashSystem.getPossibleStashes()
if stashes then
StashDebug_populateList(self)
end
end
local StashDebug_onClick = StashDebug.onClick
function StashDebug:onClick(button)
if button.internal == "CANCEL" then self:close() return end
StashDebug_onClick(self, button)
end
Since I already have an overwrite for stashDebug I was going to do this
We also have issues with setting a player's zombieKills.
heh
there's more issues with MP trying to populate lists for other UI
whats the event for a player finishing loading in?
pretty sure OnCreatePlayer is unreliable
"OnLoad" ?
unreliable? how so?
I had issues before where the player being created into the expected object
sure enough OnLoad bypasses the stashdebug exception
still hits the radio debug exception though
MP seems to have a few UIs behaving differently
nvm spoke too soon
interesting it's hitting the radio one now too though
Chuck, register window normally doesn't restore (set visible) the ui (at least not the one I made)
here's one example for vanilla how it's done
--ISPlayerDataObject
self.characterInfo:setVisible(isMouse and (self.characterInfo.visibleOnStartup == true));
--ISCharacterInfoWindow
self.visibleOnStartup = self:getIsVisible() -- hack, see ISPlayerDataObject.lua
Strange
From what I understood from registerWindow is if it wasn't already registered it added it self to the layout - otherwise it pulled the information stored?
the above is for when you load from Main Menu
is that why characetrInfo is hardlocked to appear ?
I actually wrote a mod fixing that
If I remember right, it saves when you exit to menu and restores only the saved, not the new instance
so if you call it twice during play, it restores the layout from the previous time it saved
or not do anything
it's been a while
as I understood it stored the information of the layout - I don't mind changing the approach as long as the visiblity is saved between deaths and relogging
what it is currently doing is trying to open all the windows and with registering it applies the old layout to the new intances
so windows that were open before stay open
does relogging mean log from main menu?
means exiting to main menu yes
hm, I need to see this in action
the name is misleading - it's more of a get or set afaik
didn't notice it worked like that (yeah I haven't played / used debug much lately)
nah man, these UIs are super inconsistent - years and years of work and growing skillsets I imagine
haven't messed with layouts much
I mean, my UI doesn't auto make an instance. I expected it would be tracked by the Layout Manager
if you don't register the UI it has no way to connecting to it afaik
you also have to set:
function generic.RestoreLayout(self, name, layout)
ISLayoutManager.DefaultRestoreWindow(self, layout)
end
function generic.SaveLayout(self, name, layout)
ISLayoutManager.DefaultSaveWindow(self, layout)
ISLayoutManager.SaveWindowVisible(self, layout)
end
but this just saves position
for some reason it doesn't actually correct for visiblity
because there is no instance to correct it with (I guess?)
that's how the inventory windows are handled from what I saw
they're all created - then the layout manager steps in - but save/restore layout isn't called if it's not registered
perhaps I'm misunderstanding
but it works as expected in SP
going to add a hackish onTick delay to see if that fixes MP
is there an option to disable this feature or select which UIs you care about, chuck?
would be preferred to have a one line solution to stop this
but I guess for i,v in pairs(...) do ...=nil end is also one line
looking into some possible solutions
overwriting the populateLists for stashes and radios breaks the UI (atleast for radio) in MP
and the delay using OnTick seems finnicky
not me
not sure whats diff but 0 errors with no mods
did you open it?
oohhh only upon opening?
i gotcha. myb no i wwas only refering to the error that happens upon load into game, you think it's just nil always?
maybe because debug in mp? i guess i was out of the loop for the past 30 so maybe i should hush haha
i guess just fixing it in general is what's needed so my point is pretty irrelevant i suppose lol
Chuck seems to have fixed / stopped that
oo gotcha ty
Hate to break up the already in-progress discussions, and really sorry for the book, but could use some advice on moving forward from y'all.
Currently, I have it so you have to hold a button and click to do the offhand attack, but am actually trying to give an incentive to use it and there's really not as you can still only do one attack at a time (left or right). This would be the simplest way as just an option that is available.
But, this led me to find the "AttackDelays", and have now been playing with this.
My new idea is to make a kind of "combo" system where the offhand attack will just be done if applicable as part of the combo, so you would have no direct control over it. This could also greatly expand the mod to be more of a combat overhaul instead of just adding the offhand attack, as I could add "combos" to any weapon really. My current "combo" simply reduces the attack delay so you can chain up to 3 attacks, but you have a longer delay after the 3rd. This all would be controlled by levels and player progression of course.
Am I overthinking this a bit? I guess the main question is, for a mod that adds an offhand attack, how would you want that integrated?
Here is an example of the "combos" with a knife. When the red square is visible in the top right, the delay only happens on attack #3
question, is your control scheme ctrl + click for primary and ctrl + ? + click for secondary?
Currently when aiming, use click to primary attack and ctrl+click for secondary
oh that's right, right click is for combat mode
my brain is fried
I don't see an issue with being able to control which hand is used with controls
I'd prefer that over combos
especially for two handed allowing you to use the butt of the weapon
or even things like shields
also, now I'm getting the error in MP whenever I try to open it
not sure how/why
Cool. Thanks for the input. I think either way I am going to do something with control+ click too. So could still do something with the offhand there
the community debug thingie is killing my game 😄
had to remove it
how so?
whenever i tried to use the lua explorer to reload a file
throws an error?
sometimes just by opening it it start spiting errors out
that can kind of be ignored
already fixed - has to do with how that window is created than can't work with layouts
not updated yet
kk
is there an opposite of SandboxOptions.sendToServer()
:)
goal: get a copy of the sandbox options from the server ot make sure current ones are up to date due to bug in game
any thoughts appreciated
you trying to fix the map_sand thing?
Yes
i'm starting to see how bad it gets just now
If needed I'll go through em all and serialize in json then override local settings but I'm not familiar with any of the related functions yet lol
Send via global mod data
Pull on login and maybe add a command that triggers it for all players for admins
And which updates it from current settings ofc
I have little worry for getting the data I'm mostly worried about how to then save it
Need to poke at the api
Shame it's sandboxed or I'd just delete map_sand on logout lol
i was whipping up an exe to search and delete the file using powershell lol
this is like a million times better LOL
Well yeah u dont want people to have to do external shit
agree totally, especially since most people dont care about the sandbox setting stuff until it directly affects them 😄
Lots of the settings are invisible to end users but greatly affect balance
It can be insidious
having the issue with your mod atm. the knocked out one. all the settings revert for everyone except me who did the map_sand fix test LOL
doesn't matter to me i just wanted chance and everything at 100% max loss and noticed it kept reverting. then saw your post
i assume it's all related
You'd think that world settings are mutable..
jab i was poking thru the faction safehouse code and jesus god it's almost too pretty
felt like reading a book
Makes me think that all the files are legacy wrapped in Band-Aids..
that made with pipewrench?
DW. When I wrote the anti-cheat patch, safehouses we're the worst of it.
lol
Huh?
DW. I make too many gadgets.
Might be a new dev team rewriting erroneous code.
Safehouses provided some of the worst exploits before 41.70
that triggers a send to clients, doesn't it?
It's how hackers teleported players on servers.
Does it?
At least the most obvious exploits are taken care of now.
When items go server-authoritative that'll take care of a lot of petty exploits.
If it does send I could conceivably run sendToServer on the server periodically to update..?
I'm on my phone so I dont have the decompile rn
Glad that no one's found some of the bad ones I did.. means that servers are safe. :)
I saw it somewhere, I'll try to find it again.
Same.
It was also fun writing a mod called faction safehouses. (Was commission)
Desyncs were bad with safehouses then. :[
people still use that damn thing
and it's a mess
been tinkered with by like 6 people
and now is entirely unmaintained
lol
so many fuckin people still run this
in fact i did until a month or so ago
there aren't many options to let users be in multiple safehouses
<_<
idk what state it was in when u left it but it's a bit of a mess
constantly sending updates
etc
117,173 Current Subscribers
heh
i know everyone who worked on it now actually 🤔
but yeah it has no options and updates too often and spams messages between client and server
static void receiveSandboxOptions(ByteBuffer var0, UdpConnection var1, short var2) {
try {
SandboxOptions.instance.load(var0);
SandboxOptions.instance.applySettings();
SandboxOptions.instance.toLua();
SandboxOptions.instance.saveServerLuaFile(ServerName);
for(int var3 = 0; var3 < udpEngine.connections.size(); ++var3) {
UdpConnection var4 = (UdpConnection)udpEngine.connections.get(var3);
ByteBufferWriter var5 = var4.startPacket();
PacketTypes.PacketType.SandboxOptions.doPacket(var5);
var0.rewind();
var5.bb.put(var0);
PacketTypes.PacketType.SandboxOptions.send(var4);
}
} catch (Exception var6) {
var6.printStackTrace();
}
}
Want to know what's funny?
I wrote it in 50 minutes.
I don't know what was done to it since.
Was a 100 USD bounty.
It did what it needed to do then
public void sendToServer() {
if (GameClient.bClient) {
GameClient.instance.sendSandboxOptionsToServer(this);
}
}```
^you can see it sends it to clients too
it's the function that runs when the server receives the PacketType.SandboxOptions packet from the sendToServer you called
I can't see how many subscribers use it on mobile
I still use it alongside a mod that lets you be added to more than one safehouse lol
Splinter is entirely mia atm
So idk who owns the rights to the code
He paid for my work
according to tos i think you if you wrote it lol
i'm 100% not interested in restarting another legal debate from a bunch of programmers and coders pov but yea even when it was his it was yours
that was you nice
now maybe my original comment makes more sense lol
the code was written so easy to understand from anyones perspective even someone who doesn't code
i was tempted to learn UI stuff to have a menu that shows each safe house you are a part of since you can join multiple on my server, but... ui is way beyond my capabilities atm
ow yeah it on the descriipt nice
you plan to update that
players cant access other safehouses
and has to do like a cycle back thing just to be able to get the other safehouses thing
it's like every hour or something i think
@red tiger
I mean Icould.. heh
lolol the double ping
i think it's a super relevant mod still
but then again i have used it since the first time i played MP lkol
bikini's BTSE stuff has a checkbox to just let people join more than one safehouse
easier option imo
My code? :D
Nice.
oh ill check this out ty
ooo didnt know about this
Again I literally timed myself coding in one go.
50 minutes
<3
I'm so glad to see that code went a long way.
just tested the stash / zomboidRadio in MP and sure enough these 2 buttons don't work for me in vanilla
The issue with anti-cheat breaking radios?
testing debugUI and two particular windows break on populate list
I thought it was something I'm doing but it's not
so like 2 hours of work was for naught
Just how high in demand is fixing the walkie talkies?
high for players low for devs 😄
Apparently a fix for cheating borked radio
That's what I heard periodically.
i asked for suggestion and i was told by them to use global voip haha
like most others now. rp server, so it just doesn't really fly
is this a recent thing?
If you want to I can try to make a patch for it.
last patch or so
been around for a few months now ish
most don't notice because they logout together when they play together
so when they login they are within non radio range and the radios work fine
but if you login out of 1k range they dont work until you meet face to face
or close to that
hm
doesnt matter the radio also
spent 2 entire days figuing out the info i do have on it
sounds like the sync issues I'm having with EHE
things work great if everyone stays close by
I wonder how easy it will be to patch the offending code to get radios to work again.
I like focusing on high-profile issue with the community. :) Otherwise I do commission work for people.
function ZomboidRadioDebug.OnOpenPanel()
if isClient() then
return;
end
that explains that - the radio debug window is disabled in vanilla MP
You guys are awesome. Thanks for letting me know.
@dark wedge bruh I just found SpiffUI (edit: Radials) and that is incredible. I don't know why I wasn't using it sooner.
Amazing work
@fast galleon You were actually right - on death doesn't respect layout changes 😦
🙏
layouts only save at the end of a session, and register loads that up
I'd need to figure out a way to save layout on window closes/moves
Thanks! Glad you enjoy! I need to hurry up and release my health panel module for that. Haha
Dude beyond enjoy. 100% should be how more stuff in vanilla works for gamepad players. It's so smooth and efficient for so many things. Can't praise it enough
If I find any bugs I'll 100% try to help you find the solutions asap
Based on that, you're talking about SpiffUI-Radials right? If so, currently working on a rewrite of that one actually. So much re-used code that I'm moving to modules and such. Plus got some new radial ideas. (ex. Carpentry Menu Radial)
Yes, sorry, I realize now you have several UI mods, but radials is by far most useful to me
I figured, ha. Out of all of SpiffUI, that one is definitely the most popular, especially for controllers. Got any radial ideas, let me know!
I have other important interface UI edits on gamepad in Wookiee Gamepad Support now (e.g., horizontally displaced tooltips and repositioned tooltips to avoid vanilla panel overlap), so I'm not sure that'd play nicely with my stuff since inventory edits of the tooltip require a bit of code invasion...
Nice! I had someone bring up the tooltips as an issue for inventory with a controller in a comment and hadn't looked into it. So I'll defer that to your mod. As for the tooltips with the radial, I created my own tooltip object based on vanilla and use that, so not sure if your changes propagate down but I can fix that if they conflict
I'm definitely down to work with you to help things stay compatible while you work on theming and whatnot.
I have a friend who would really appreciate a theme mod if you get around to finishing it... They hate dark themes like many of us hate bright ones.
For my part I can convert colors in the functions I overwrite to variables that you can define by hooking the initialise function
I think I only have to strictly overwrite maybe one function
Cool! Sounds good. Themes are very much on the back burner for me right now, but the plan is for the next update to allow users to define their own colors to use. I need to find a way to get the colors to override defaults more consistently too
@fast galleon Figured it out - ended up where you started - added the classes under debugMenu registerClass - but I overwrote that function to also save the windows layouts -- also realized those 2 windows causing the trouble to begin with don't actually get registered (no clue if they stayed open after death)
also got a little fancy for MP
also
reinit fills the menu - for some reason in MP the first call on this breaks
confirming everything in MP atm but looks good in SP
Is it possible to add more than two required skills to craft an object?
Hit or miss for people- I’ve seen a lot of posts about it with low engagement and generally a dev or mod responding that it either doesn’t work or has ever been implemented. A number of RP servers or just ones that don’t wanna use constant communication through discord are valuing it highly and i for sure have been seeking a fix
Thanks for the insight.
Idk i thiught it added functio. Havent tried it but it increased its window size and that alone is already a useful feature
A lot of the defaults are hardcoded. You will need to fully overwrite many functions to use variables instead of hardcoded colors. And ideally you'll wanna do this as early as possible in the load order, I suppose, so that others can at least decorate your updated UI elements. Honestly because so many colors are hardcoded, themes will be a big project.
@sour island mb do u know from where renders player nicknames? at least java or lua? if lua will be awesome
Hello, I want to remove the option of a weapon that can be equipped in the main hand, I just want to leave the option for it to be equipped in the second hand.
can't find due to so much name funcs and I'm not sure if there's only single func to get player name
context_menu:removeOptionByName(getText("Equip_Primary_Translate_ID")) and use it in OnFillInventoryContextMenu event
what event you think would be best for me trying to trigger action from a lightswitch when you turn it on?
as I know there's no event for that
mb single way is override
context menu is fine
about just clicking on switcher I'm not sure it's lua side
hmmm. there has to be something remotely close for my purpose
i'm trying to just make the lightswitch itself a source of light to test
just by setting the light to the sprite
trying to trigger on switch if i can
problem is light obj list on java side
as I said in past on lua even no light obj class
hmmm i refuse to accept defeat
he-he
Thanks, I'll try to apply it.
Sorry what is your goal with lights exactly?
either create light from sprite on the tile the player is standing on, or directly from the lightswitch when it's triggered
i'm working through the events atm also to find the best way to trigger it as well
for context. i have the lightswitch electrician mod on the workshop. and for this next update. i'm adding in some sandbox options but also want to add the ability to emit some sort of light from sprite (since that seems to be "the" way to do it from what i've seen)
i was thinking about trying to make the lightswitch itself but as you may have seen earlier, it's seeming like it may be tricky to make work with the lightswitch itself. so thought maybe having it emit from the tile the player is standing on may be feasible
the way lighting works in roomdef at the moment is pretty weird looking already. i've seen some pretty clear light cutoffs. this might even make lights better and able to be used in player built structures (rooms with no id in general) if i get it down
Just gonna toss a nugget of an idea out there…. A mod that identifies the locations of reanimated players.
Possible use case in SP: tracking down your zombie that wondered off with all your good gear
Possible use case in MP: Admin server event. Can identify locations for server players to go and execute those zombies. Fun event, also helps clean the server up. (Yes you could just delete reanimated.bin if you have zero fun bones or need to clean ‘‘em up now)
Bonus points if you could do it dynamically… like add a radio to a player zombie that broadcasts on the emergency freq to help hunters find these zombies
I'm not sure about the sprite bit but I can tell you how to add a light to your square
Or any square
You could add the sprite separately somehow
If we're talking a fixed location
yes thats good since i can change the length/strength of hte light itself i believe
And color
lol whoa we'll get to the dance parties soon ahahaha
thats sick though. i love colored lighting. use it all the time now for holidays for our community center
just never from code lol. i think having light from the player tile might be better than from the a sprite anyways depending on how it looks
local player = getPlayer()
local light = IsoLightSource.new(player:getX(), player:getY(), player:getZ(), r, g, b, range)
local cell = player:getCell()
cell:addLamppost(light)
Gotta define your r, g, b, range (obviously?)
I try.
i spent 4 days trying to figure out how to get random context options per click lolol....
feeling good about it now though
by the power of spaghetti, i figured it out
Hell yeah!
Flying Spaghetti Monster is real
It's the code that runs our borked simulation
Thank you also
Ow its you hi...
Anyways the zombie population panel offer that function. It indicate a difftent color for player zeds
Mmm I see I see, I’ve never used it before tbh
I think u need to run on debug
I cabt seem to tag fajdek
He left the pzdiscord?
Sucks
Also tyrir is no longer here on the server too
Hi. i found the mod
https://steamcommunity.com/sharedfiles/filedetails/?id=2823529103
How add to this mod integration to Discord bot?
Suggestion, add support for mod versions. So a mod can have same ID but different version.
-Makes requires a little more stable.
-stack trace prints can show version so that it's easier to debug the issue
-stop same mod being enabled twice
Sorry if we already found a better alternative to this.
? he's here
I've dug a deep whole for myself by releasing a new version with a different ID and people keep enabling both versions. 
Might need to patch the ModManager at least for a time.
Did he change name?
nope Tyrir#9793 @hearty dew
Ah shit its case sensitive!
Lol
I was searching for the debug
Anyone has access to the workshop for this one
Odd one for y'all, running into some script error on a dedicated server where a table in SandboxVars is non-existent (null) even though it exists in SandboxVars.lua - what could be the cause of this?
@ancient grail
I think it was this file.
#selfPins tyrir inspectJava
Doesnt seem to be
Its how you made the sandbox fan you show what you did. U have to have 2 files for the sandbox to work
is it possible to create a hidden trait like you cannot pick it from the character creation . it can only be obtain after the player is created?
if it has cost 0 it's not in list to select
What's different? This response seems like you didn't even test?
Which two files are you referring to?
media\sandbox-options.txt
media\lua\shared\Translate\EN\Sandbox_EN.txt
here
Ah, right. Those exist. The issue is on the server side. Mod options are in the SandboxVars.lua for the server, but when the script tries to access it, it comes back as null.
Can you send the code you use to access it ?
Should be like SandboxVars.ModID.OptionName
That's exactly how it's being done, but for some reason... local Opts = SandboxVars.Example; isn't a table with the options, it is null.

are you in java lol ?
Do this
Lol, meant local, not let. I'm working in a few different languages at the moment.
Np i was confused
Yeah I guess it should works if they are defined with same name in sandbox-options.txt, in my code I always access the option directly rather than the table maybe try it
I'm not the mod author, just a dev running into an issue with it.
oh, it's the contents that matter. Helps to get around the character limit too.
So you want to access SOTO options from another piece of code ?
Ye iknow now . I just thought the txt file was an error log for some reason ... My bad dude
I don't suppose anyone here worked with yml or github actions before?
Do you use it too?
I'm a yml pro i've setup at least 1 minecraft server
I think I resolved the issue by sheer luck 👍
No, I'm running into an issue where I can't move items around in my inventory or containers, can't even equip em, because that table is coming back as null. It just loops the animation and spits errors at me until I interrupt it with a shove.
I had an issue where my upload action was dumping my entire repo into the workshop folder
But setting it's /Contents/ as the intended path uploads the files properly
SOTO on the workshop
You can find it
although, now I can't update the workshop.txt or workshop preview from github
Mod dev say you can't add it in game ?
also I tested positive for covid - so I'm off for the week
It's in the game, others aren't having issues with it on the server I'm managing. For some reason it's just me and my partner that are running into these issues, and I'm wondering why that is to understand how PZ stuff works in general as well as to resolve it.
my modding will be so productive
Then what is that specific sandbox var that is giving off error
Ow man. Get well soon sir
sorry i meant mid-game
but you should probably see/ask with the author himself i guess
Yes that
If u are doing something woth other peoples mod . Even if it benefits them . We should still ask . Ethical thing to do. Also promotes collaboration anyways
Yah, mod author knows I'm in touch with y'all. Talking to em on the side. Don't even think it is an issue with the mod itself, but PZ.
has anyone filed a bug with EHE where the drop from the heli is a "ghost"?
and what i mean by that is... the heli goes through, the drop icon appears
but isnt a drop anywhere and the marker stays there till game reload
Also protip to all modders: anything outside of the Contents folder does not get uploaded you can stick your assets and larger PSDs and such there.
~~If I am making a placeable/carry-able cookie jar, would the model be skinned or static?
I used the lunchbox as a placeholder for now since I copy pasta'd the script then made edits.~~
Nevermind! Found an answer 😄
Screenshot of the error am running into.
Yeah, check the line, and make sure you're working on values you think you are
Hi, I need to know where the actual sounds of the game are at.
media/sounds has old sounds or sounds that aren't used in the game
sound.bank and alike
Thanks, this?
I love you, thanks! I will search that fmod engine, I never knew something like that existed
Yea i tried to mess around with them aswell but no dice
If you want to just play certain sounds when doing something, programming them in lua is easier
Yes, calling those events and that's all. I just want to understand more about this, I will use in-game scripts like you said later
you can try a mod before uploading/updating in workshop?
your local upload folder can run the mod - just make sure you're unsubscribed from the live version
Thank you!
There's a pin I wrote that helps separate your dev environment from your play environment -- only caveat is you need to unsub after playing to return to dev
There‘s also a C:\Users\Zomboid\Workshop folder where you can manually put your mod files in and test them in game, just make sure you have the mod.info set up correctly
Not in my opinion 😅
The /mods and /Workshop folder follow different file structures so it would be a pain to keep moving files over every time you want to upload
It is the same once you're in Content/
Workshop just have steam folder around it
Yes, and that would mean you have to drag the folders around to make them work in /mods and to later upload them
Yea you can then just upload the done changes directly to Steam afterwards
From the Workshop folder
your method is surely more secure to human mistake but both works anyway in the end 😄
Not to mention GitHub or an IDE would throw a fit every time the folder isn't where it expects
where the hell are log items defined at?
Log items? Like wooden logs?
yeah
Probably new_items
-nosteam doesn't work from Workshop folder so you need to make some junctions on Windows
item Cologne
{
DisplayCategory = Junk,
Weight = 0.2,
Type = Normal,
DisplayName = Cologne,
Icon = Cologne,
WorldStaticModel = Cologne,
}
``` only thing with "*log*" in it.
there's no "tree" "log" or "Wood"
When you can't find it directly, look in translations.
what about item LogStacks2,3
It requires item Log to craft
so im raging with sendServerCommand
something simple just to test it out
if command == "test" then
print("OnCommand test triggered")
end
end
Events.OnClientCommand.Add(onCommand)```
@faint jewel
items txt
item Log
this should just print in the console
and i should call it with sendServerCommand("test","somevalue") right?
oops sendClientcommand
it's in items
{
DisplayCategory = Material,
Weight = 9,
Type = Normal,
DisplayName = Log,
Icon = Logs,
WorldStaticModel = Log,
}
generally newer stuff is in new_items, I just wasn't sure - but this was all assuming you couldn't find it in items 😛
weird it's not in mine
try to verify?
match case
yeah you have match case ticked
I'm going to repo media on github - as a means to track changes for the sake of the patch
Just wish it could be more automated 🤔
Ok so me and a friend is working on a wind generator mod
So far our wind generator is fully craftable. And placeable. It behaves like a normal generator in inventory and in the way you put it down
Now to our current problem
We are trying to make it use the "wind intensity" to produce fuel per say... For now we are trying to make it be able to read or see the wind intensity at all
So we have "tried" to add a new value to the code. Similar to the fuel value. Which stores the "wind" intensity value in a way that can be read on the generator info
For now we have managed to make it show on the generator info tab as a % value
What we have attempted is to use the "every climatechangetick"
Where the function on every said tick will load the wind intensity value per say. And write it to the getmod.wind value we made.
But it does not update
it remains 0% in the generator info window
I think easier add event to every ten minutes and check climatemanager
We figured it doesnt update during wind change using the debugger
Is that ten minues in game or system clock?
In game
Thx! this is very usefull!
Events.OnGameStart.Add( JRFapplyModOptions({settings = SETTINGS}) )
is this the wrong way to call my mod options function? I read that it is but it seems to work correctly
I mean passing argument and calling it with Events.OnGameStart.Add on the same step
You need write function name without args
But
im ragin' hard with the sendClientCommand
You can do like this:
…Add(function() JRFapplyModOptions({…}) end)
understood. thank you!
its a mod for traps an a building
@polar thicket
how much fuel would one tile add?
what about absence / blocking wind path with tiles.
no matter what i do i cant get the sendClientCommand to work
fried my brain
if im running a host
can that make the sendClientCommand not work since im sending it from the player whos running the host?
While looking up do you have the sensation of falling?
?
i guess thats a no
😄
i read the guide by dislaik
and added this to a lua file on the server side ( on the right folder )
Commands.TWEEvents = {};
Commands.TWEEvents.Test = function(source, args)
local sourceId = source:getOnlineID();
local data = args.data;
print("player ID [".. sourceId .."] send: ".. data)
end
local onClientCommand = function(module, command, source, args) -- Events Constructor.
if Commands[module] and Commands[module][command] then
Commands[module][command](source, args);
end
end
Events.OnClientCommand.Add(onClientCommand);```
I recall there being something about one of the commands not working in SP - not sure about hosted
I forget which command it was though
then i tried
sendClientCommand("TWEEvents", "Test", {
data = "Some string of text"
});
end
nothing happens
no output in the console, nothing ...
it's server commands that don't work
last person wasn't looking in the coop-console.txt, do you check there?
..
ah ok
.... it was working from the 1st try.......
......................
LOG : General , 1675194962643> 1,005,406,634> player ID [0] send: Some String of text
so i just lost 5h and half my hair, because this game has more log files that i can remember
awesome
you only need to use console.txt and coop-console.txt
well sometimes you want to find older logs, then you go there
well at least it works so i can just finish the rest of the code...
Hey guys, I just started playing Project Zomboid last week, and I cant believe I am so late to the party... This game is the best. I made my first mod today, would love to hear your thoughts on it. This was something I personally wanted and was also a practice project for me. I hope you enjoy it.
"Depression Makes You Sleepy"
Dude wow what an intro. Congrats and welcome to pz modders chat 🙂
