#mod_development

1 messages · Page 98 of 1

finite radish
#

(unless you overwrite the code that's calling that, and so on)

but if a local function is added DIRECTLY to an event handler, then there's no way to remove it, other than the messy, permission-needed-from-the-author way, aka rewriting the whole file

vital sedge
#

namespace is mod id?

finite radish
#

but it's just any global object that they assign stuff to more or less

drifting stump
finite radish
#

they're also called modules

red tiger
#

Writing modules means that everyone can get along.

#
local exports = {};

exports.foo = bar;

return exports
finite radish
red tiger
#

I'll never know why PZ doesn't use modules.

#

I do.

#

I encourage everyone here to use modules.

drifting stump
red tiger
#

Might be a good idea to make short tutorials, possibly videos for people beginning PZ Lua.

finite radish
#

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

weak sierra
#

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

finite radish
weak sierra
#

im guessing modules are the middle ground

#

i am of the camp of long variable names that are expressive

red tiger
#

One of the benefits of Typescript modding for PZ is that these specific quirks of Kahlua somewhat goes away. =)

weak sierra
#

usually

#

i have ONE mod that i did not do that with

#

not sure why

red tiger
#

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.

weak sierra
#

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

red tiger
#

¯_(ツ)_/¯

weak sierra
#

yeah

red tiger
#

It's fun knowing the evils of both.

weak sierra
#

i hate languages like these tbh

sour island
#

I don't think modules are the middle ground - they're by far better and don't sacrifice accessibility

weak sierra
#

that's what i meant by middle ground

#

accessible yet still fast

sour island
#

but I use require religiously anyway cause I don't trust myself or the load order

weak sierra
#

as opposed to one or the other

#

i don't trust require

finite radish
#

tbh modules aren't really necessary if you're using an OOP workflow properly, but they're the best option if you aren't

red tiger
weak sierra
#

cuz it always fails miserably for all kinds of mysterious reasons

sour island
#

Sorry, misunderstood middle ground to be a compromise

weak sierra
#

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

sour island
#

Yeah I'm not sure why that happens

weak sierra
#

i've felt safer just making sure the alphabetical order of paths is correct

#

zero issues with that

finite radish
#

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)

weak sierra
#

function environments? :p

sour island
#

I wonder if it would be possible to create a visual map of requires

red tiger
weak sierra
#

with a custom parsing

#

that'd be kinda neat

sour island
red tiger
#

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?

finite radish
# weak sierra function environments? :p

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

red tiger
#

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. >__>

vital sedge
#

is there anything better than mod manager for ordering mods? Its pita to use in this use case

sour island
#

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?

weak sierra
#

:)

#

that's what i do

#

lol

#

full granularity

drifting stump
sour island
#

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

finite radish
#

nice!

sour island
#

I also thought of using the same color blend method for fading clothing

finite radish
#

at least, if I'm remembering correctly I think those have variable alpha fades and such

sour island
#

The issue is how often I have to call it - but I can check

finite radish
#

how often are you calling it now? and what's required?

sour island
#

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

finite radish
#

seems weird

sour island
#

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

finite radish
#

could be a different command for setting the alpha than what you're using, but I don't know for sure

sour island
#

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

finite radish
sour island
#

could also be a math issue - as I wasn't flooring it to the nearest 0.01

finite radish
#

the overhead on that may be miniscule though, hard to say without testing

#

just my embedded programming side coming out a bit lmao

sour island
#
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
red tiger
sour island
#

perhaps, I found it when trying to make nicer colors for conditional speech like 2 years ago

#

softer the sound the closer to gray

finite radish
#

yeah that's more or less a lerp from the looks of it. cool beans

bitter frigate
#

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

pulsar heath
# sour island although I am curious about the alpha thing

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

finite radish
#

@sour island what's the base object you're using for the icon, or are you not using the UI library at all?

sour island
#

it's a ui element

#

the texture itself is what is getting alpha'd

#

EHE_EventMarker = ISUIElement:derive("EHE_EventMarker")

finite radish
sour island
#

I am implementing update/render/new

vital sedge
#

is there a way to show miliseconds/execution time for a block of code in PZ debugger or use some clever function in lua?

finite radish
vital sedge
#

like system.timer.start stop

sour island
vital sedge
#

or even substract time from system time point 1 - point 2

sour island
#

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)
signal ibex
#

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 🤔

finite radish
finite radish
sour island
#

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

finite radish
sour island
#

the event is a different object to the marker

finite radish
#

i.e. your helicopter update loop, in the OnTick, and also the UI update loop, on update()

finite radish
#

then yeah that probably isn't the issue

sour island
#

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

sour island
#

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

#

😅

finite radish
#

i doubt that's the culprit though

sour island
#

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

vital sedge
#

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

finite radish
vital sedge
#

os time and gettimestamps gives me 1ms

finite radish
# sour island I have a few things to check: flooring the alpha to 0.01, using a non-transparen...

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

sour island
#

it's in render

finite radish
#

then yeah it all checks out, sorry for spamming you with guesses KEKW

sour island
#

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

red tiger
finite radish
red tiger
#

Thought you said you don't know all the hooks for UIElement.

finite radish
#

nah, I know what they are, just wasn't clear on where they're called

red tiger
#

Those are the functions invoked if you handle your own java object for UIElement.

finite radish
#

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? PepoThink

#

(okay yeah, took another look - it seems like the last thing I said is the case. I get it now)

finite radish
red tiger
#

ISUIElement is a wrapper.

finite radish
#

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

red tiger
#

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.

fast galleon
#

@sour island I made a commit to reopen panels if you're interested, but the generic.OnOpen needs some refactoring

sour island
#

the current version should repopen/keep closed as expected

#

I don't mind refactoring for the sake of optimizing or eliminating the instance = nil

fast galleon
#

instance should be nil, those sometimes save playerObj

sour island
#

Oh then the current version is fine(?)

fast galleon
#

I tested once and the generic panel closed and opened as expected

sour island
#

I might need to eliminate the dev branch - I'm still getting hung up on the PRs

#

Can I fork my own repo?

red tiger
#

Sounds like you need a Discord server to manage this project.

ancient grail
#

I remember tyrir had a debug console . Can that be included on the community api

sour island
mint helm
#

Hey guys, is it generally unsafe to uninstall mods in the middle of a save? Multiplayer in my case (I'm host)

sour island
fast galleon
mint helm
dark wedge
sour island
#

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 ?

fast galleon
#

no it's fine

sour island
#

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

drifting stump
#

should have a branch for each thing being worked on

drifting stump
sour island
#

a fork per person or you mean a branch for each sub-mod?

drifting stump
#

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

sour island
#

I can probably make a thread (not sure) - this would be for your project and it's updates?

drifting stump
#

then we merge branches into main whenever theyre ready for a release

sour island
#

I can see what the higherups feel about using threads for that purpose

drifting stump
#

is it dedicated server time then?

vital sedge
#

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

finite radish
#

"Unofficial PZ Mapping Discord" exists, it's time for "Unofficial PZ Modding Discord" NODDERS

pulsar heath
#

lol

drifting stump
#

Official Unofficial PZ Community Modding Project Discord

#

longer is better

sour island
#

There already is one (sort of)- but I figured the community project should remain in here to some dgeree

drifting stump
#

it should but also hard to keep track of stuff without a dedicated channel

sour island
#

I don't think there's that much demand to have it's own channel much less server tbh

red tiger
#

Yaaay for bad weather.. I guess.

#

Out of work.

sour island
#

Would be easier to justify/request if there was momentum

#

I woke up sick, so I'm out of work too lol

red tiger
#

You're more than welcome to have a channel on my org's server.

drifting stump
#

i swear there will be momentum whenever im satisfied with this damn ui

pulsar heath
#

trying to understand why one of my mods only has 5k unique visitor and over 14k subs...

sour island
#

MP

finite radish
#

yup. or collections

pulsar heath
#

makes no sense the mp bit, its only ui for extra info on screen or obs

finite radish
#

why wouldn't that make sense?

drifting ore
#

yea when it's distributed via server mod you dont goto the page

#

you just sub

#

no visit but yes sub

finite radish
pulsar heath
#

but thats what im saying... whats the point in adding something like that in a server

finite radish
#

if a streamer plays on your server? KEKW

#

streamers don't just play singleplayer, yknow

drifting ore
#

don't even get me started. the zombie fix is a java fix

sour island
#

extra stats as in how many kills etc?

pulsar heath
#

yup

#

kill days alive and fire kills

drifting ore
#

and it's the same way

pulsar heath
#

still thinking about adding the car kills or not

sour island
#

sounds like someone wants to use that - and in MP everyone has to use the same mods

finite radish
#

yeah

pulsar heath
#

its 3x more subs than visits

#

thats just ... wacked?

sour island
#

QoL mods are usually the biggest to benefit from visitors<subs

finite radish
#

not really, that's not that unusual

#

yeah

pulsar heath
#

never thought this would get so much use

#

very niche mod...

finite radish
#

could just be someone with a very popular server likes your mod

pulsar heath
#

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"

#

....

drifting ore
#

i think when you read most comments on workshop, its not too surprising

shy radish
#

is there getPlayer() command to get faction info?

drifting ore
#

people like feedback haha

pulsar heath
#

i should finish the mp part of the integration mod... but this animation thingie is fun

drifting ore
#

dont have it in front of me atm so someone may have to correct

shy radish
drifting ore
#

i'm almost certain it works

sour island
#

it does

drifting ore
#

just for usage sake

shy radish
#

I'm getting a nil exception even though he's in a faction :/

sour island
#
Faction.getPlayerFaction(getPlayer())
Faction.getFaction(string)
-->
faction:isMember(username)
faction:isOwner(username)
shy radish
#

ohh

#

that'll do it

sour island
#

wait misread

#

do you have factions setup?

#

it's nil in SP

shy radish
#

I do, im testing on my MP server rn in the debug window

sour island
#
    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

pulsar heath
#

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?

finite radish
shy radish
pulsar heath
#

hold on, but doesnt that send the command to the client?

shy radish
#

It believe so, yes.

finite radish
#

you're thinking of sendServerCommand

pulsar heath
#

the naming logic still baffles me

finite radish
#

it's really poorly named tbh

pulsar heath
#

ok... i have the code ready then

shy radish
#

oh, wasn't paying attention, thought you were talking to me

pulsar heath
#

just need to switch the sendservercomand with sendclientcommand...

#

...........

finite radish
pulsar heath
#

yeah thats what im doing

finite radish
#

if you have the permissions logic on the clientside code, then it leaves it vulnerable to exploits

#

ye

#

you got it then

pulsar heath
#

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...

drifting ore
#

depends how to look at it

pulsar heath
#

the name to me at least tells me its supposed to be the other way around

drifting ore
#

to me i see, sends client command out

#

thats how i read it, and probably how whoever wrote it thought also

drifting stump
#

sendClientCommand sends a command from the client to the server

#

sendServerCommand sends from the server to the client

pulsar heath
#

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

finite radish
#

also make sure your event listener is in the right place too, i.e. Events.OnClientCommand.Add(onClientCommand) should be on the server

pulsar heath
pulsar heath
sour island
#

lmao what's that for

#

also looks neat

pulsar heath
#

integration with twitch... in game alerts

sour island
#

you're not using community modding: debug tools

#

😦

pulsar heath
#

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

sour island
#

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

pulsar heath
#

i only started using AUD about 2 weeks ago... and i think youre the one who reminded me of it

sour island
#

probably did lol

#

It's fantastic and the reloading helped with UI testing

pulsar heath
#

yup

#

the reloading just by itself was worth it

#

it speeds up making the mod by a lot

sour island
#

the biggest change I made was modifying the inspect context to include java fields and more classes

pulsar heath
#

the ui was also overhauled 🙂

sour island
#

I also made the vanilla cheats window alot less clunky in favor of how AUD does it

pulsar heath
#

add in a lua intepreter like cheat menu has and it will be my favorite mod 😄

sour island
#

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

pulsar heath
#

to test small stuff

#

its a must have, the lua window from cm

sour island
#

it's basically like typing into console?

pulsar heath
#

second

#

ill show you

fast galleon
#

chuck should I edit the OpenPanels?

pulsar heath
#

oooh

#

its on the video i posted

#

i use it mainly to trigger functions for stuff im testing

sour island
pulsar heath
#

or to change some values midway

finite radish
dark wedge
finite radish
#

i just use semicolons but that works too

#

ye

pulsar heath
#

@dark wedge debug mod refuses to run on this machine

sour island
#

Scratch that - the debug windows don't actually open on death

finite radish
pulsar heath
#

dunno why, tried everything i could

bronze yoke
#

doing it with semicolons is the most unwieldy thing ever

pulsar heath
#

but it just doesnt run

sour island
#

my custom cheat/vehicle windows work as intended

#

🤔

finite radish
#

code? working as intended? blasphemy

sour island
#

I wonder why those work

dark wedge
red tiger
#

You could mod in Java. xD

pulsar heath
pulsar heath
sour island
pulsar heath
#

on this machine everytime the -debug is set the game just either freezes or doesnt even start

fast galleon
#

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).

pulsar heath
#

even with -nosteam

#

the gog version behaves the same way

fast galleon
#

lol main branch is full of errors now

sour island
#

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

pulsar heath
#

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

sour island
#

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?

shy radish
#

can you make http requests using require('http')?

shy radish
#

Rip my mod idea then lol. Thanks!

red tiger
#

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.

sour island
#

I figured out the issue with cheat panel

shy radish
#

Oof. Why'd they block out api calls anyway

red tiger
#

I reported this a ways back and TIS either didn't understand what I reported or didn't care.

sour island
#

I need to grab the vanilla instance created and make sure that's closed and removed on death too

red tiger
#

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)

shy radish
#

womp womp. Feels like a pipe dream now haha.

red tiger
#

Was nice to have back in the day.

#

Well it is a big security risk

shy radish
red tiger
#

Unless they made a whitelist for domains then yeah..

shy radish
red tiger
sour island
#

openUrl doesnt work?

red tiger
#

Unless they've fixed it no it hasn't for years.

sour island
#

I use it to access desktop folders

bronze yoke
#

it definitely works for local files

sour island
#

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

red tiger
#

I can patch it but I don't know if it was disabled due to security reasons.

shy radish
#

Well I just tried it and it is working but it opens open a web browser tab

sour island
#

What did you want it to do?

red tiger
#

He wants a HTTP GET

shy radish
#

Just trying to reach an API

sour island
#

oh

red tiger
#

openUrl won't do that for you.

shy radish
#

Yeah I’m getting that now haha

pulsar heath
#

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

shy radish
#

What’d you build the app with and how exactly did you connect it with Zomboid?

pulsar heath
#

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"

shy radish
#

Gotcha, thanks!

pulsar heath
#

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

nimble spoke
finite radish
pulsar heath
#

i would expect to at least quiting to main menu to clear it

#

oh well, its not that much of a deal... just anoying

sour island
#

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

finite radish
#

hard to tell, not quite sure what you're trying to accomplish there. invoking a function at index addFuncOnShow?

sour island
#

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

finite radish
#

does it throw errors in MP by default, or only with your mod? PepoThink

sour island
#

with my mod

finite radish
#

hmm

sour island
#
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
finite radish
#

do you even touch StashDebug at all?

sour island
#

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

drifting ore
#

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

fast galleon
#

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

sour island
#

I only do that to trigger register window - so that the windows reappear when relogging

tardy wren
#

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

fast galleon
#

I have to debug my mod MP stahes now 😦

sour island
#

?

fast galleon
#

error

tardy wren
#

Sounds fun...

fast galleon
#

let me try vanilla only

sour island
#

turning off the openOnStart is creating the double click to open issue as mentioned earlier

#

also stops the windows from opening on relog

tardy wren
#

I tried to search through all files and found no evidence duct tape is ever modified

#

And in game, it's weird as well

sour island
#

I think the instances need to be generated for the layout to keep them open or closed (?)

tardy wren
#

It sometimes has 4 maximum uses, and sometimes it has 16

fast galleon
tardy wren
fast galleon
#

during game*

tardy wren
#

But... I want to find which mod causes this fuckery

fast galleon
#

easier to search the files for "DuctTape", "Base.DuctTape"

tardy wren
#

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

ancient grail
#

Wow so many active on chat

fast galleon
#

Vanilla throws error too for Stash Debugger, no mods when I host

sour island
#

oh?

tardy wren
#

How do I debug my mods when vanilla barely functions as is

sour island
#
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

tardy wren
#

We also have issues with setting a player's zombieKills.

sour island
#

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" ?

bronze yoke
#

unreliable? how so?

sour island
#

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

fast galleon
#

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
sour island
#

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?

fast galleon
#

the above is for when you load from Main Menu

sour island
#

is that why characetrInfo is hardlocked to appear ?

#

I actually wrote a mod fixing that

fast galleon
#

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

sour island
#

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

fast galleon
#

does relogging mean log from main menu?

sour island
#

means exiting to main menu yes

fast galleon
#

hm, I need to see this in action

sour island
#

the name is misleading - it's more of a get or set afaik

fast galleon
#

didn't notice it worked like that (yeah I haven't played / used debug much lately)

sour island
#

nah man, these UIs are super inconsistent - years and years of work and growing skillsets I imagine

#

haven't messed with layouts much

fast galleon
#

I mean, my UI doesn't auto make an instance. I expected it would be tracked by the Layout Manager

sour island
#

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

fast galleon
#

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

sour island
#

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

drifting ore
#

not sure whats diff but 0 errors with no mods

fast galleon
drifting ore
#

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

fast galleon
#

Chuck seems to have fixed / stopped that

drifting ore
#

oo gotcha ty

dark wedge
#

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

sour island
#

question, is your control scheme ctrl + click for primary and ctrl + ? + click for secondary?

dark wedge
sour island
#

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

dark wedge
#

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

pulsar heath
#

had to remove it

sour island
#

how so?

pulsar heath
#

whenever i tried to use the lua explorer to reload a file

sour island
#

throws an error?

pulsar heath
#

sometimes just by opening it it start spiting errors out

sour island
#

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

pulsar heath
#

kk

weak sierra
#

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

drifting ore
#

you trying to fix the map_sand thing?

weak sierra
#

Yes

drifting ore
#

i'm starting to see how bad it gets just now

weak sierra
#

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

drifting ore
#

i was whipping up an exe to search and delete the file using powershell lol

#

this is like a million times better LOL

weak sierra
#

Well yeah u dont want people to have to do external shit

drifting ore
#

agree totally, especially since most people dont care about the sandbox setting stuff until it directly affects them 😄

weak sierra
#

Lots of the settings are invisible to end users but greatly affect balance

#

It can be insidious

drifting ore
#

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

red tiger
#

You'd think that world settings are mutable..

drifting ore
#

jab i was poking thru the faction safehouse code and jesus god it's almost too pretty

#

felt like reading a book

red tiger
#

Makes me think that all the files are legacy wrapped in Band-Aids..

drifting ore
#

that made with pipewrench?

red tiger
drifting ore
#

lol

red tiger
drifting ore
#

the mod itself

#

or whatever you use

#

i get all the stuff yall made mixed up now

red tiger
#

DW. I make too many gadgets.

drifting ore
#

lolol

#

yea that was nice though.

red tiger
#

Might be a new dev team rewriting erroneous code.

#

Safehouses provided some of the worst exploits before 41.70

fast galleon
red tiger
#

It's how hackers teleported players on servers.

weak sierra
#

Does it?

red tiger
#

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.

weak sierra
#

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

red tiger
#

Glad that no one's found some of the bad ones I did.. means that servers are safe. :)

fast galleon
#

I saw it somewhere, I'll try to find it again.

red tiger
#

It was also fun writing a mod called faction safehouses. (Was commission)

#

Desyncs were bad with safehouses then. :[

weak sierra
#

people still use that damn thing

#

and it's a mess

#

been tinkered with by like 6 people

#

and now is entirely unmaintained

#

lol

red tiger
#

Wait what?

#

I wrote the original code.

weak sierra
#

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

fast galleon
#
   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();
      }

   }
red tiger
#

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

weak sierra
#
   public void sendToServer() {
      if (GameClient.bClient) {
         GameClient.instance.sendSandboxOptionsToServer(this);
      }

   }```
fast galleon
#

^you can see it sends it to clients too

weak sierra
#

where down the line is receiveSandboxOptions

#

can i force it to run someplace

fast galleon
#

it's the function that runs when the server receives the PacketType.SandboxOptions packet from the sendToServer you called

red tiger
drifting ore
#

I still use it alongside a mod that lets you be added to more than one safehouse lol

red tiger
#

Splinter is entirely mia atm

#

So idk who owns the rights to the code

#

He paid for my work

drifting ore
#

according to tos i think you if you wrote it lol

red tiger
#

Lol

#

My name's on it

drifting ore
#

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

ancient grail
drifting ore
#

the code was written so easy to understand from anyones perspective even someone who doesn't code

weak sierra
#

too many

drifting ore
#

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

ancient grail
#

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

drifting ore
#

it's like every hour or something i think

ancient grail
#

@red tiger

red tiger
#

I mean Icould.. heh

drifting ore
#

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

weak sierra
#

bikini's BTSE stuff has a checkbox to just let people join more than one safehouse

#

easier option imo

drifting ore
#

i havent messed with it

#

yes

#

your code lol

red tiger
#

Nice.

red tiger
#

Again I literally timed myself coding in one go.

#

50 minutes

#

<3

#

I'm so glad to see that code went a long way.

sour island
#

just tested the stash / zomboidRadio in MP and sure enough these 2 buttons don't work for me in vanilla

red tiger
sour island
#

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

red tiger
#

Just how high in demand is fixing the walkie talkies?

sour island
#

probably should have just tested it lmao

#

what's up with radio?

drifting ore
red tiger
red tiger
drifting ore
#

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

sour island
#

is this a recent thing?

red tiger
#

If you want to I can try to make a patch for it.

drifting ore
#

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

sour island
#

hm

drifting ore
#

doesnt matter the radio also

#

spent 2 entire days figuing out the info i do have on it

sour island
#

sounds like the sync issues I'm having with EHE

#

things work great if everyone stays close by

drifting ore
#

its part of that playerlist fix they did

#

somehow thats related to it

red tiger
#

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.

sour island
#
function ZomboidRadioDebug.OnOpenPanel()
    if isClient() then
        return;
    end
#

that explains that - the radio debug window is disabled in vanilla MP

red tiger
#

You guys are awesome. Thanks for letting me know.

thick karma
#

@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

sour island
#

@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

dark wedge
thick karma
#

If I find any bugs I'll 100% try to help you find the solutions asap

dark wedge
thick karma
dark wedge
thick karma
#

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...

dark wedge
thick karma
#

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

dark wedge
#

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

sour island
#

@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

#

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

pine patio
#

Is it possible to add more than two required skills to craft an object?

queen sail
# red tiger Just how high in demand is fixing the walkie talkies?

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

ancient grail
thick karma
jaunty marten
#

@sour island mb do u know from where renders player nicknames? at least java or lua? if lua will be awesome

azure rivet
#

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.

jaunty marten
#

can't find due to so much name funcs and I'm not sure if there's only single func to get player name

jaunty marten
drifting ore
#

what event you think would be best for me trying to trigger action from a lightswitch when you turn it on?

jaunty marten
#

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

drifting ore
#

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

jaunty marten
#

problem is light obj list on java side

#

as I said in past on lua even no light obj class

drifting ore
#

hmmm i refuse to accept defeat

jaunty marten
#

he-he

thick karma
drifting ore
#

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

timber river
#

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

thick karma
#

Or any square

#

You could add the sprite separately somehow

#

If we're talking a fixed location

drifting ore
#

yes thats good since i can change the length/strength of hte light itself i believe

thick karma
#

And color

drifting ore
#

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

thick karma
#
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?)

drifting ore
#

yea i totally get whats going on here

#

you made this pretty easy lol

thick karma
#

I try.

drifting ore
#

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

thick karma
#

Hell yeah!

#

Flying Spaghetti Monster is real

#

It's the code that runs our borked simulation

drifting ore
#

😄

#

lolol

drifting ore
ancient grail
timber river
ancient grail
#

I think u need to run on debug

#

I cabt seem to tag fajdek
He left the pzdiscord?
Sucks

ancient grail
#

Also tyrir is no longer here on the server too

upbeat harness
fast galleon
#

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.

jaunty marten
fast galleon
#

I've dug a deep whole for myself by releasing a new version with a different ID and people keep enabling both versions. ded

#

Might need to patch the ModManager at least for a time.

ancient grail
jaunty marten
ancient grail
#

Ah shit its case sensitive!

#

Lol

#

I was searching for the debug

#

Anyone has access to the workshop for this one

stuck bronze
#

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?

fast galleon
#

@ancient grail
I think it was this file.

#selfPins tyrir inspectJava

ancient grail
#

Doesnt seem to be

ancient grail
#

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?

fast galleon
fast galleon
ancient grail
#

ah sorry cuz i saw it was txt file lol

#

im dumdumb

stuck bronze
ancient grail
#
media\sandbox-options.txt
media\lua\shared\Translate\EN\Sandbox_EN.txt
ancient grail
stuck bronze
#

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.

golden sparrow
#

Should be like SandboxVars.ModID.OptionName

stuck bronze
#

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.

ancient grail
ancient grail
stuck bronze
#

Lol, meant local, not let. I'm working in a few different languages at the moment.

golden sparrow
#

Np i was confused

stuck bronze
#

It's lua.

golden sparrow
#

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

stuck bronze
#

I'm not the mod author, just a dev running into an issue with it.

fast galleon
golden sparrow
ancient grail
sour island
#

I don't suppose anyone here worked with yml or github actions before?

ancient grail
#

Do you use it too?

golden sparrow
sour island
#

I think I resolved the issue by sheer luck 👍

stuck bronze
sour island
#

I had an issue where my upload action was dumping my entire repo into the workshop folder

ancient grail
#

What exactly is the mod what does it do originally or suppose to do

#

@stuck bronze

sour island
#

But setting it's /Contents/ as the intended path uploads the files properly

golden sparrow
#

You can find it

sour island
#

although, now I can't update the workshop.txt or workshop preview from github

golden sparrow
sour island
#

also I tested positive for covid - so I'm off for the week

stuck bronze
# golden sparrow Mod dev say you can't add it in game ?

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.

sour island
#

my modding will be so productive

ancient grail
#

Then what is that specific sandbox var that is giving off error

ancient grail
golden sparrow
#

but you should probably see/ask with the author himself i guess

ancient grail
#

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

stuck bronze
#

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.

pulsar heath
#

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

sour island
#

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.

elfin moss
#

~~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 😄

stuck bronze
#

Screenshot of the error am running into.

tardy wren
#

Yeah, check the line, and make sure you're working on values you think you are

honest shard
#

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

neon bronze
#

sound.bank and alike

honest shard
neon bronze
#

Yea i think its those

#

Youd need a fmod exe if i remember correctly

honest shard
neon bronze
#

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

honest shard
honest shard
#

you can try a mod before uploading/updating in workshop?

sour island
sour island
#

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

neon bronze
#

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

faint jewel
#

YIKES

#

C:\Users\Zomboid\Mods

#

way better for devving.

sour island
#

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

golden sparrow
#

Workshop just have steam folder around it

sour island
#

Yes, and that would mean you have to drag the folders around to make them work in /mods and to later upload them

neon bronze
#

Yea you can then just upload the done changes directly to Steam afterwards

#

From the Workshop folder

golden sparrow
sour island
#

Not to mention GitHub or an IDE would throw a fit every time the folder isn't where it expects

faint jewel
#

where the hell are log items defined at?

sour island
#

Log items? Like wooden logs?

faint jewel
#

yeah

sour island
#

Probably new_items

fast galleon
#

-nosteam doesn't work from Workshop folder so you need to make some junctions on Windows

sour island
#

That's true - and I wish they'd change that 😅

#

Hard to test MP otherwise

faint jewel
#

mods. folder.

#

lol

faint jewel
# sour island Probably new_items
    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"

fast galleon
#

When you can't find it directly, look in translations.

#

what about item LogStacks2,3

#

It requires item Log to craft

pulsar heath
#

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)```
fast galleon
#

@faint jewel
items txt
item Log

pulsar heath
#

this should just print in the console

#

and i should call it with sendServerCommand("test","somevalue") right?

#

oops sendClientcommand

sour island
#
    {
        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 😛

faint jewel
#

weird it's not in mine

sour island
#

try to verify?

faint jewel
sour island
#

match case

pulsar heath
#

yeah you have match case ticked

sour island
#

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 🤔

polar thicket
#

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

tame mulch
polar thicket
polar thicket
tame mulch
#

In game

polar thicket
ember swallow
#

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

tame mulch
#

But

pulsar heath
#

im ragin' hard with the sendClientCommand

tame mulch
#

You can do like this:
…Add(function() JRFapplyModOptions({…}) end)

ember swallow
#

understood. thank you!

dreamy hamlet
#

its a mod for traps an a building

fast galleon
#

@polar thicket
how much fuel would one tile add?

#

what about absence / blocking wind path with tiles.

pulsar heath
#

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?

fast galleon
#

While looking up do you have the sensation of falling?

pulsar heath
#

?

#

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);```
sour island
#

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

pulsar heath
#

then i tried

sendClientCommand("TWEEvents", "Test", {
                data = "Some string of text"
            });
end
#

nothing happens

#

no output in the console, nothing ...

bronze yoke
#

it's server commands that don't work

fast galleon
#

last person wasn't looking in the coop-console.txt, do you check there?

pulsar heath
#

i have no coop-console.txt

bronze yoke
#

should be in Zomboid

#

not logs

fast galleon
#

..

pulsar heath
#

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

bronze yoke
#

you only need to use console.txt and coop-console.txt

fast galleon
#

well sometimes you want to find older logs, then you go there

pulsar heath
#

well at least it works so i can just finish the rest of the code...

tiny pivot
#

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. tired "Depression Makes You Sleepy"

ancient grail