#mod_development

1 messages ยท Page 99 of 1

ancient grail
#

Wait its just an image wheres the link

tiny pivot
#

I didnt know if I was allowed to add the link.

ancient grail
#

This chat allows it . Other chat u cant

fast galleon
#

@sour island
is it ok to add this compatibility for lootzed and low screen resolution

require "ISUI/ISPanelJoypad"
local ISPanelJoypad_initialise = ISPanelJoypad.initialise
function ISPanelJoypad:initialise()
    local screenH = getCore():getScreenHeight()
    if self.height > screenH then
        self:setHeightAndParentHeight(screenH)
    end
    return ISPanelJoypad_initialise(self)
end
tiny pivot
#

thanks by the way!

ancient grail
#

Gave you an award for good luck

sour island
ancient grail
#

It is it has a panel

fast galleon
sour island
#

Ah

tiny pivot
sour island
#

And what's going on? the window pops off the side?

fast galleon
#

It expands beyond the limit of screen and the close is outside (below) screen

pulsar heath
#

this is weird

#

ERROR: General , 1675198106115> java.nio.file.NoSuchFileException: /lua/EasyConfigChuckedServerConfigs/servertest_config

#

the file ran away ๐Ÿ˜„

sour island
sour island
fast galleon
#

default issue

#

same happens for server statistics debug, but it closes now when I click again on button

pulsar heath
#

i just deleted the host and started a new one

sour island
#

That's a good general fix

sour island
pulsar heath
#

no need to bother with a local test

#

just make another one ๐Ÿ™‚

ancient grail
#

Resolution adjustment is always a pain

#

Wish every panel is resizeable

#

Scrollable

Wait jab was writing a css thing

sour island
#

I mean, just have a bigger screen drunk

ancient grail
#

It night improve all the panels

sour island
ancient grail
sour island
#

moving it resets the position with in the bounds but it's too big to fit lol

ancient grail
#

To have the portability

sour island
#

I was being sarcastic ๐Ÿ˜…

ancient grail
#

Might need to reduce the H. Does it really have to be that tall

#

I know it shows a list of stuff but item picker doesnt share the same problem

ancient grail
pulsar heath
#

well my host doesnt work lol

#

guess ill just hijack the dedicated server to do some testing ๐Ÿ˜„

#

but no error...

#

LOG : General , 1675199007514> SERVER: info@alpine shardop mode enabled
LOG : General , 1675199007514> SERVER: status@UI_ServerStatus_Initialising
LOG : General , 1675199024430> SERVER: process-status@terminated

red tiger
#

@sour island are you trying to do something like what I am working on?

sour island
#

I don't believe so?

#

I've just been correcting vanilla UI issues with the debug menu

red tiger
#

Ok. Been curious.

sour island
#

the goal was just a debug panel that opened and closed windows using the buttons - but half the UI beahves slightly differently

red tiger
#

I firmly sit in the "rewrite" camp

sour island
#

Some were missing sub function calls

sour island
red tiger
#

If I had the time I could rewrite the codebase.

#

As you say the UI are slightly different

#

A lot of unexplained table structs and deprecated / dead code.

fast galleon
#

@sour island global name for util table?

red tiger
#

Some pseudo fields are shadowed too..

sour island
sour island
red tiger
sour island
#

I was going to repo the lua folder to check for changes on releases but it's 30MB+ and I'm not sure if that'd go against ToS

#

Otherwise you run into the same issues some mods do when vanilla changes stuff and there's no way to tell

red tiger
#

The Typescript was an unspoken gesture to modders and the devs to lift parts of the Lua code to Typescript over time as a means of cleaning up the code.

#

It was a way that I could make this sort of project realistic.

sour island
#

I'm not really familiar with typescript but how would it be different to rewriting all the Lua files?

red tiger
#

It's foolish though to expect that to happen.

red tiger
sour island
#

Like conceivably the entire patch could be 1 giant Lua overwrite

red tiger
#

It enforces consistency with types.

fast galleon
#

hm, is it ok to have different commits in pull request?

red tiger
sour island
sour island
red tiger
#

Even still, less opportunities for human error is always a good thing.

sour island
#

True

#

Would it be possible to adopt typescript later or would this be something to do now?

red tiger
#

Ten years and many hands on code can really challenge the ability to keep code clean and bug-free.

red tiger
#

You could type one file and have it work with the rest.

#

It compiles to Lua

#

You can write interfaces to call native Lua code.

#

The two caveats ATM is TSTL class metadata not working in a friendly way with PZ's class implementation in Lua and my types generator not seeing 100% of the PZ Lua code due to different code patterns.

#

(both being things that can be worked out)

#

Hopefully this helps clarify my position on the matter @sour island

sour island
#

It does

#

I was able to upload the vanilla lua as a repo - much of the file size was due to translations which gitignore can skip

red tiger
#

Thanks for entertaining the idea. I can eventually look at your project and possibly make typings for it.

sour island
#

I don't mind anything that can help - I'm just wary of another new language or tool ๐Ÿ˜…

#

If I new how gradle worked I'd try to make the libraries process basically an exe or plugin for intelliJ or other platforms

red tiger
#

Heheheh.. Spending 7 months on a project to approach the same problems that you are working on, I'd have to at least let you know.

red tiger
#

maven too.

#

gradle is pretty tough for people new to it.. heck it's still mean to me.

#

I should have both groovy gradle and Kotlin gradle scripts on my repo if you need to take a look and see how at least I'm using it.

#

x)

sour island
#

Are you using them to decompile the game as well?

red tiger
#

No. I do this manually.

#

Each Java container I decompile I clean it up and remove decompilation errors.

drifting ore
#

okay i've gotten as far as setting a tile to light up on left click from player. also don't have a problem in assigning a location to be a specific object. but now i'm struggling with detecting the light source and essentially undoing it... any ideas? or a way to store the previous value from setting the light so i can set a toggle that changes that tiles specific values back to rgb 0, 0, 0, light strength 0?

red tiger
#

I could write something like MCP for PZ where the code is decompiled then patched to compile automagically.. but that would be the easiest way to get nuked by the devs.

#

I wouldn't see them as lenient on such a tool like Mojang was for Minecraft then.

drifting ore
#

we are close to not even caring about room defs when it comes to using lightswitches lol

sour island
#

At some point CAPSID could run the game through intelliJ for break point use

#

I stopped doing that though

red tiger
#

I can do that but it requires stupid amounts of tweaks to do.

sour island
#

hasn't really hurt me not having it

red tiger
#

Not sure though why one would need to decompile the entire Java code for the game.

#

If you know your tools, you should only need to do it fully when modifying it.

sour island
#

I use it for intelliSense

red tiger
#

Ah.

#

Is this how those Lua tools works?

sour island
#

The old CAPSID/PZDOC project still works

red tiger
#

I know that a few Lua containers in the PZ code say they were generated using IntelliJ

sour island
#

I imagine that's what the devs use for that to appear

red tiger
#

Probably.

#

Hahahaha I really need to stop playing the same drum beat in my head of.. "Oh.. yeah I have PipeWrench."

sour island
#

But the PZ-Libraries / CAPSID/PZDOC decompiles the classes and makes Lua referenceable classes and functions from what's exposed

drifting ore
#

i can confidently say that those java libs have been half the reason i even understand how to code in lua with pz lol

#

then again i am a noob mcnoob

red tiger
drifting ore
#

fair enough LOL yea it's tricky

red tiger
#

It's a steep learning curve.

drifting ore
#

i do research for around 6-8 hours a day almost every day in my job so i'm just used to having to do way too much research to get a simple answer ๐Ÿ˜„

red tiger
#

It's pen-testing, ethical hacking practices and reverse engineering knowledge that got me over the hump easier.

drifting ore
#

i thought about easier ways though. i'm trying to document as much as i can to gather a crap ton of use cases for other noobs atm

red tiger
#

You know it's funny..

drifting ore
#

lolol

#

threads op

red tiger
#

I've said it several times in here now however I wrote a format that allows people to write 3rd party documentation for my TS environment.. Perhaps I can extend a branch over to the Lua community to have that forwarded.

drifting ore
#

the more examples i can gather the easier it should be for someone new to pz to jump right in with a crap ton of examples

#

ooo

red tiger
#

Who better to document the code than the people who use it the most.

drifting ore
#

sometimes i have chat gpt document things and then i go back and reference how it's used and will write my own notes lol. i love that idea

#

it would be sick to see some good documentation

#

or at least decent

red tiger
#

One sec.. finding the same silly picture i've posted here a hundred times.

sour island
#

It is neat seeing the changes between branches using github

#

alot more tweaks than I realized

#

between 41.71 and 41.78

red tiger
#

It's a resource that roughly no one knows about. :3

sour island
#

What's that look like?

red tiger
#

We see all changes.

sour island
#

Like a hosted decompiled src?

red tiger
sour island
#

Ah for your own project

red tiger
#

It'll show you the changes in PipeWrench's typings that reflects all API for the game.

#

You're looking at PZ's API calls being modified, removed, added, etc.

sour island
red tiger
#

You don't see this level of detail for patch notes.

#

I've seen people host decompiles on github.. also with cheats. I've reported them and seen nothing happen.

#

It's generally bad to do this and legal action is definitely something if the offended party cares enough. (And should honestly)

sour island
#

For the modified java stuff/cheats?

red tiger
#

For hosting decompiled code publicly and for hosting code that exposes / contains PZ's Java code along with hooks for cheats.

#

All you can do is report it.

#

The only reason I cared to know about these repositories is because of the anti-cheat patch I made last year.

#

All of my sensitive research of the game's networking protocol and file formats are private repos. Only I and a few trusted are able to view / push code to it.

#

IMHO if you ever get that deep @sour island , keep all of that stuff private and locked down.

#

It becomes nightmare fuel if you expose a vulnerability to the game and it gets leaked. panic

sour island
#

This is the lua that comes with the game - unless you mean the decompiling stuff

red tiger
#

I mean Java stuff.

sour island
#

Hard to prevent people with enough know-how

red tiger
#

PZ is a great sandbox for when these sorts of issues pops up every now and then.

#

Great security practice / exercises. A buddy of mine is rewriting some of the network layer on his server.

sour island
#

I should also mention - almost 99% of the debug functions don't check for debug or admin, they just trust the UI isn't visible ๐Ÿ˜…

red tiger
#

Oh yeah absolutely.

#

That's why I had to write sanity checks in the Java code for the ClientManager packet.

sour island
#

Is there a way to ensure one's mod is loaded last?

#

I'm thinking the patch should overwrite anything else unless they call on the patch

#

@fast galleon I'm still seeing issues with lootZed btw

ancient grail
#

supporting m3ss

sour island
#

ah I think the issue is when changing window size after opening lootZed

#

yep that's it

#

there's also issues with other windows being kept off the edge of the map

red tiger
#

The screen?

sour island
#

Yeah

#

if you change your window size layouts are maintained regardless

#

even the inventory is off screen

fast galleon
red tiger
#

True.

sour island
#

Nah it works - the issue was how I was testing it

#

or well, how I tested it revealed more issues

#

This is honestly a good candidate for !patch

#

rather than debug tools

#

But I'm starting to see having 3 separate mods might be more confusing/work ๐Ÿ˜…

#

Would have to make each sub-mod compatible if it touches the same stuff

fast galleon
#

lootzed is debug tool, so it felt more appropriate.

sour island
#

Yes but this is an issue with all windows

fast galleon
#

Resizing does cause indeed issues for other things too

#

some mods also throw errors

sour island
#

with debug tools?

fast galleon
#

no, my mod collection

#

ModManager maybe

red tiger
#

Haha

#

That reminds me.. I'll probably release a fancy mod loader for server-specific mod content to the public.

#

It's a simple request API that bounces code from the server to the client, all written in Lua code. It's useful for reloading content without rebooting the server.

drifting stump
#

resizing is something addressed by me

#

and there should be no overlap between the different mods

#

debug tools depending on the framework is perfectly reasonable

terse locust
#

I'm just curious, how hard would it be to make a mod (with absolutely no knowledge) for escape ropes to take less time to climb?

#

Its pretty specific so I don't think they exist

drifting ore
#

relative question really. is it possible? most likely. really depends on the effort you put in to learn how that stuff works or if someone is willing to give you exactly what you need. here is the timed action for climbing sheetropes though. you can use this to trace whats used to determine how you'd need to edit it to your specifications. other than that i'd check the pins for guides and stuff to at least get a basic understand of what you are even doing though.
here is the vanilla lua code for timed action for climbing sheetropes.

#

other than that, once you start making headway into understand anything at all. ask questions here and you will start to make sense out of it all

#

there is no "one size fits all" guide though.

fast galleon
#

Climb sheet rope is a java state, mostly locked.

drifting ore
#

now that you mention it also. i dont think there is many ways to speed up char is there?

fast galleon
#

I think those are edited by changing the animation XML though.

terse locust
#

hmm

#

I'll probably just leave it for now xD

#

I'm taking a java course in school but I got no info on LUA and its a relatively beginner java course

drifting ore
#

still fun to try stuff out though really

terse locust
#

Probably

#

I tried learning c# which I got to like a beginner level which helped me get ahead of my java class but my teacher isn't the best

#

For now I'll probably only make a mod if I want something that I can't already find

#

The rope isn't a huge deal :)

drifting ore
#

well if you get bored, i challenge you to try to find way to do what you are trying

#

some concepts (unless someone smart like poltergeist or other tells you otherwise) it's fun to come up with out of the box ways to do things

terse locust
#

Yep, thanks for the advice though either way

red tiger
#

Didn't co' make a climbing ladders mod?

#

Maybe look at that.

autumn garnet
#

Yes and the mod ladders by Co' work perfectly , I never stopped using it in multi

red tiger
#

Can someone remind me of what exactly broke radios?

#

Something about the location of players being taken out correct?

sour island
#

From what was said yesterday if someone logins in away from someone else they can't speak over radio until they get close to eachother

red tiger
#

Ah so the client A doesn't know that client B logged on.

#

Looks like it'll take a deeper dive for me at another point in time to investigate and produce a fix for it.

drifting ore
#

yea and it was tied with the fix for playerlist to non admins

red tiger
#

I believe that either location data or a channel listening list / array isn't populating or isn't calculating due to the missing info.

drifting ore
#

not sure if directly related but it was all at the same time

red tiger
#

Someone offered me a bounty for this so if anyone else is interested, there might be some people happy to fund this as a community-patch.

#

I'm not rly interested in this patch being a commission.

#

It's a fun problem though.

#

A fix like this should be for everyone tbh.

drifting ore
#

the range is also 1k almost exactly btw. if you outside of that range upon login is when they dont work

red tiger
#

I've listed my initial suspects for what's causing this. =)

#

Either location-based or login-notify based.

#

Makes sense that it could be both.

sacred matrix
#

I'm having trouble adding a custom sprite to the world using Lua. I:

  • created a custom texture pack (testpack.pack made from testpack.png)
  • created a tile definition (testpack.tiles with testpack added)
  • added pack=testpack and tiledef=testpack 896 to mod.info

When I load in the sprite using the name testpack_01 as the name, it's blank.

However, using the sprite name of e.g. location_community_cemetary_01_31 works (and shows a pole).

Any suggestions?

drifting ore
#

have you tried just using the tile painter to see how the tile looks from the tile manager?

#

in admin or debug you can goto cheats and use tile manager

#

then right click and use the tile manager and search for your tile pack

#

if you see anything wrong in there, then you def setup the tile pack wrong. also try a high number for your tiledef identifier just to be safe imo

#

pretty sure you can use up to 10000

sacred matrix
#

Thanks for the pointers, I'll check. ๐Ÿ™‚

red tiger
#

Oh cool. GameMode enum now.

drifting ore
#

also tile.pack goes into texturepacks folder inside of media, and the .tiles goes right into media. not sure if you did that

sacred matrix
#

OK, so I see the tiles in the tile manager. I figure I must be using the wrong sprite name/texture name?

drifting ore
#

most likely im thinking

#

you can see the name in the tile manager

#

almost certain

sacred matrix
#

Tile Manager as in the one in Tilezed, or some debug system in game..?

drifting ore
#

admin/debug

pastel loom
#

Hey, how are you doing?

#

I'm new here to this discord. But not the game itself.

#

Anyway. Have you guys tried the "STALKER Functional Exoskeletons REFORGED" Modification?

sacred matrix
#

OK, found the issue. I was using testpack_01 and it should be testpack_1.

red tiger
#

Finishing up decompiling and cleaning up the ZomboidRadio class.

#

Cleaning up compiler artifacts..

sour island
#

I also did a thing

#

tying into a 'onResolutionChange' event

#

but it's breaking windows lol

pastel loom
#

Ah, I'm sowwy

drifting ore
#

all good just get more responses there ๐Ÿ™‚

red tiger
#

It's hooked into via Java-side.

sour island
#

is that resize of the element or resize of the window?

red tiger
#
if (this.getTable() != null && this.getTable().rawget("onResize") != null) {
      LuaManager.caller.pcallvoid(
          UIManager.getDefaultThread(),
          this.getTable().rawget("onResize"),
          this.table,
          this.getWidth(),
          this.getHeight());
    }
#

onResize.. mb

#

Been a second..

#

I guess this one only sends the new width and height.

sour island
#

I think the issue is trying to make every isuielement follow the rule lol

#

going to scale it back to the debug windows themselves

red tiger
#

Just letting you know that's a thing.

sour island
#

So I should call that after?

#

to prevent squishing?

red tiger
#

No. It is called apparently when the element resizes.

#

Or the screen. One of the two.

sour island
#

it's when the element is resized

#

there's this - function MainScreen.onResolutionChange(oldw, oldh, neww, newh)

#

and a few other windows have this

#

but they're added into the event

#

Events.OnResolutionChange.Add(MainScreen.onResolutionChange)

#

it's not a default behavior for all windows

red tiger
#

One thing I really dislike about UIElement Lua hooks: the color order of parameters.

#

ARGB in Lua but RGBA in Java.

#

Should be RGBA IMO. Me thinks a TIS developer who wrote the original interface for the Lua side in ISUIElement previously worked with DirectX.

sour island
#

more likely to change A than RGB perhaps?

red tiger
#

Oh the order is up to the person implementing the API.

#

ARGB is more the norm in DirectX land.

sour island
#

I meant if you're changing alpha more often, typing out nil, nil, nil, 0.8 could get tedious

#

although creating a sister function would be wiser in that case

red tiger
#

(At least that I recall. I've been modifying these draw calls on the Java side as of late)

#

Oh wait.. There's a static tempColor object. My guess is the last colors are used.

#

Sort of dirty code there IMO.

#

It's bad to uhh sanity-check render code calls.. otherwise I'd say to absolutely do that. =(

#

assert all the vars..

sour island
#

Going to try and do something dirty my self ๐Ÿ˜‰

#

if a uiElement has no parent try to fit it onto the screen - and then apply the same logic for all its children but instead use the parent in lieu of the screen size

red tiger
sour island
#

I'm not familiar with the issue tbh

red tiger
#

Okay. Thanks.

sour island
#

@drifting ore

Nippytime โ€” Yesterday at 7:27 PM
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
@red tiger

red tiger
#

Probably this calculating it: ```java
private boolean DeviceInRange(int var1, int var2, int var3, int var4, int var5) {
return var1 > var3 - var5
&& var1 < var3 + var5
&& var2 > var4 - var5
&& var2 < var4 + var5
&& Math.sqrt(Math.pow(var1 - var3, 2.0) + Math.pow(var2 - var4, 2.0)) < (double) var5;
}

faint jewel
#

is there ANY way to refresh animations ingame? this restarting is for the damned BIRDS

red tiger
#

Also:

  private int GetDistance(int x1, int y1, int x2, int y2) {
    return (int) Math.sqrt(Math.pow(x1 - x2, 2.0) + Math.pow(y1 - y2, 2.0));
  }
#

Redundant though because IsoUtils?

#

ZomboidRadio is weird. o_O

#

So I'm thinking the issue might be on the client-side.

#

I'm saying this because the code for players and their radio devices looks to be registering just fine.

#

My guess is that players receiving signal data when logged in and out of range don't have a device instance ready to handle along with the signal. =(

dark wedge
faint jewel
#

it does NOT for me and i AM in debug

#

i'm trying to fix a twitchy hand animation.

#

and it's NOT working.

#

:/

dark wedge
#

It only works for me when I "-nosteam" it too

faint jewel
#

well fook.

#

lol

#

so it needs to be in the mod folder instead of workshop?

dark wedge
#

Yup. I personally just symlink it from workshop to mods so I can switch as needed

faint jewel
#

a /J symlinkl?

dark wedge
#

Oh, I'm on Linux. I'd have to look it up for Windows. Ha

faint jewel
#
mklink Link Target

Use /D when you want to create a soft link pointing to a directory. like so:

mklink /D Link Target

Use /H when you want to create a hard link pointing to a file:

mklink /H Link Target

Use /J to create a hard link pointing to a directory, also known as a directory junction:

mklink /J Link Target```
red tiger
#

oof.

dark wedge
#

Ah, /D or /J work here.

red tiger
#

PZ Java code needs to calm down with condition block conditions

#

Hahaha

#

I think I just verified the cause of why radios break from the update. =)

faint jewel
red tiger
#

@drifting ore I think yall were spot-on with the cause of radios breaking.

dark wedge
faint jewel
#

all the other models do :/

#

is that a working . x exporter for blender?

drifting stump
sour island
#

I did a thing

dark wedge
faint jewel
#

well not we go BACK to the issue i have lol.

sour island
#

cute little windows

drifting stump
#

however if i remember correctly didnt the entire lua reload when changing resolution

red tiger
# drifting ore Oh yea?

Yes. I did a code dive into ZomboidRadio where I suspected where the issue ends up affecting things. I then went to the packet code for player info being sent to the client and this stuff seems to line up.

drifting ore
#

Explains why giving admin fixes it also since admin has access to players

sour island
sour island
#

I tried applying my resizer function to all elements but it breaks a few things lol

drifting stump
#

im still think thonking how im going to deal with it automatically

nova socket
#

Question: Is there a way to override item category from Base, doing so in mod does seem to override item, but leaves item category to what it is in Base?

drifting stump
#

anyway i already scale my uis to the resolution

drifting ore
drifting ore
#

Which I donโ€™t want others so it makes that quick fix not really a fix

#

Yes

sour island
drifting ore
#

Unrelated

red tiger
#

Ah ok.

#

Yeah so I suspect the fix to be very easy to implement.

drifting stump
#

would just be a matter of tying the position calculation to the event

drifting ore
#

Nice

red tiger
#

All I need to do is push player data to connecting players. (I think)

sour island
red tiger
#

Just one push

red tiger
#

Player wave signals are tied to player instances which populate based off of the server sending player data via request packets. =)

drifting stump
#

but i take it a step further with

local FONT_SCALE = FONT_HGT_SMALL / 14
#

and everything scales off this

#

this will be a key part of the new ui system too

red tiger
#

@drifting ore Are you able to test a patch?

drifting stump
#

no more broken uis with different font sizes

vast nacelle
#

Just to doublecheck, changing the 'name' field in the '.info' file during an update won't mess anything up, right? Mod won't get deactivated? I'd hope nothing uses name for identification when there's an 'id' field.

drifting stump
wet sandal
#

What's up modders? Modding hard or hardly modding?

sour island
drifting ore
red tiger
wet sandal
#

I'll interpret this as modding hard

red tiger
#

Am I silly? I must've misinterpreted the issue.. Is it that the radios shouldn't be working in a non-radio range? (>1K tiles)?

#

@drifting ore

#

I read that description of yours and somehow inverted the logic

#

Going to take a break from it but I have more understanding of the networking and updating of radios so maybe I can still fix the actual problem lol

drifting ore
#

Radios just donโ€™t work as normal if you log in to the server over 1k tiles away from another person who logged in. If you never meet face to face or a reasonably close distance at least, (not sure exactly) then you will not be able to communicate over radio

red tiger
#

Oh okay so it is like how I originally read that.

drifting ore
#

This isnโ€™t all exact btw, just roughly my findings after 2 days of testing

red tiger
#

Okay well I can patch one file.

sour island
#

Got it working on all elements

#

tries to match x/y/w/h when possible

#

children are scaled to the parent

#

I wonder if I can tap into fontsize

#

Now users can play on their apple watches in peace

red tiger
#

I can see that you're having fun.

#

Okay @drifting ore I sent you a DM with the experimental patch.

red tiger
#

Bootstrap when?

weak sierra
#

"reality bubble" around a player

weak sierra
# red tiger Am I silly? I must've misinterpreted the issue.. Is it that the radios shouldn't...

when you go to use a walkie it should work up to the rated walkie range (though i don't care if this is lost and they just work globally across the map), but instead it only works if you've met up and they've entered the reality bubble first - this information is then lost on death or relog, so you have to meet up with your team of people every time you wanna talk to them and every time you die and any time you relog.

#

works for admins tho.

#

same with getOnlinePlayers also

#

done around same time

#

but afaik not directly related, just same reasons

red tiger
weak sierra
#

you made the patch already?

#

giv

#

lol

#

notices the lines below where she'd read to

drifting ore
#

He been doing it today haha

weak sierra
#

im sick so i've been fuckin useless and haven't made the sandbox fix yet

#

:/

red tiger
#

A player doesn't receive the data otherwise. The radio engine (which covers walkies) handles the requests and incoming radio data by reflecting on a players list for the client which is affected by not receiving that player data.

weak sierra
#

the weird thing is it gives you the list for the scoreboard

#

i guess it's not the same format or storage location

#

perhaps lacks the positions

red tiger
#

I can't test this patch but with what everyone has said breaks and unbreaks this issue, the check I disabled has all of those conditions.

weak sierra
#

i can test it

#

๐Ÿ‘

red tiger
#

I'll DM you it.

weak sierra
#

tyu

red tiger
#

If it doesn't work, oh well. Can always look into other code.

#

But with three hours of reading into logic and following it throughout the client and server, I think this has a chance to work.

weak sierra
#

based on what i know about the symptoms what you described sounds like a very very likely candidate

red tiger
#

๐Ÿคž

idle dawn
#

I think multiplayer was a big misunderstanding.

#

This map is like... bigger then the state of texus and Altis from Arma3 combined... and yet there's nothing here but all these zumbebs.

#

The secret java men is holding us back! No wonder this feels like a simulation!

#

That being said, it's honestly impressive that this game had any sort of clean multiplayer implementation down the line.

#

Typically when you plan for multiplayer, you better program that shit with it in mind from the start.

#

(It's why I always make systems in mind with this just in case.)

red tiger
idle dawn
#

Outside of the fact we are decompiling the game itself, and legal, what's stopping us from going all open source fu on this?

idle dawn
#

Well, not exactly what I mean.

#

But some wack job made skyrim multiplayer.

#

There's a lot of access to internals.

red tiger
#

I originally found out about this game in 2012-2013 because friends asked me if I could mod multiplayer. Real story.

idle dawn
#

nice.

red tiger
#

They actually thought I could do it.

#

I never bought this game. They gifted me it.

idle dawn
#

As for multiplayer and desync... mmmm

#

Netcode and the architecture, how things are programmed.

#

It's p fuckin important.

red tiger
#

Yeah. A buddy of mine is rewriting a lot of that under the hood networking stuff to be multi-threaded with RakNet.

idle dawn
#

usually when a project gets an unexpected late multiplayer, it means they decided to netcode possibly 80% of the game state into the server.

#

Which even small games can choke on our copper cables.

#

Oh, and yeah, single threaded, we might be 32 bit still?

red tiger
#

If you want my opinion on PZ with multiplayer, I say that the server code and client code should be separate for all entity classes in the game. AKA ServerIsoPlayer, ClientIsoPlayer, and a commons abstract IsoPlayer.

idle dawn
#

Shit is cave man tech at this point.

#

Well.

#

Normally, both the client and the server should interpret the same entity differently.

#

And pick and choose very specific things to replicate.

#

The server should be running exactly 0 code that has to do with rendering and animation and visible states, for example.

red tiger
#

Mixing the code with isClient / isServer checks throughout easily gets messy.

idle dawn
#

In Lua, yes. You need to program from the ground up and put it in the respective folder.

red tiger
#

(It's a critique, not a stab at the game)

idle dawn
#

When I work in Unreal Engine, we have the benefit of replication so the engine sort of does everything for us, but funny enough, it's extremely easy to break it too.

#

Because we have too much control.

red tiger
#

I've made quite the list of critiques over the past decade of modding and playing this game. The big difference though between me and my friends / others I know who have their opinions is that I acted on my critiques by writing tools and examples of how to overcome those problems.

idle dawn
#

I'm more of a build from the ground up sort of person.

#

It's very awesome the passion people put into very long projects like these.

idle dawn
#

But making a project at all, you need to plan within.... 4-5 years or so.

#

No, star citizen is not a game.

#

It's a fucking experiment.

#

It's not following any principles of game design or industry at all.

idle dawn
#

But ye.

red tiger
#

I still like that PZ was daring enough to write their own engine.

#

It's a big plus IMO.

idle dawn
#

Oh no like I said, this is a really good game and project, and the love over huge time is great.

#

But we have a word.

#

And everyone hates it.

#

Sometimes a pity, but one all tech boys must weep from.

#

Technical Debt.

#

Avoid it early, avoid it often.

#

Practice safe programming.

#

Or you'll pay for it later.

#

In child support.

red tiger
#

A lot of words to simply say "Plan ahead" xD

idle dawn
#

Ye.

#

I wanna see a pre production plan.

#

Before a single line is written.

#

I want.

#

M A C H I N A T I O N S

red tiger
#

I wanna see an army of modders writing in Typescript.

idle dawn
#

I'm here not knowing what the fuck a typescript is.

#

Is it just Lua plus?

red tiger
#

Hahaha

idle dawn
#

C# is better then lua technically anyways.

red tiger
#

Typescript is a language designed to compile to other languages, mainly JavaScript. It can compile into languages like Lua with third-party projects.

idle dawn
#

Lua is great for simplicty, starting out, and game scripting purposes.

#

Honestly really great, like... I'd honestly do what blizzard did and just straight up have UI be written straight in Lua or some shit like that.

red tiger
#

It's a big language in the web industry / node.

idle dawn
#

Aaaah.

#

I see.

#

Sounds p neat.

#

Flexible too.

red tiger
#

If you want guardrails and type safety checking, go for it.

#

Oh and OOP.

idle dawn
#

C# is the daddy's house of OOP compared probably.

#

Everything is absolutely fucking strict.

#

You better know what metadata is.

red tiger
#

Lua is good for small-scale things.

#

Nothing bigger than a few thousand lines at most IMHO.

#

Anything larger needs structure.

idle dawn
#

Yeeee.

#

It's possible in lua and I really like it.

#

But the whole point is simplicity.

#

Keep it's endpoint similar in scope.

#

PLUS.

#

It's amazing for teaching programming too.

red tiger
#

That's whyyy I'm writing my HTML render engine project in TS.

idle dawn
#

Just basic principles.

#

Love2D I think isn't too bad for that sort of thing. Learning how to do something in a no-holding-hands environment.

#

Can actually make something without worrying about

#

class structuruurres

#

muh

#

metadata constructors I gotta make on my owwwwn.

red tiger
#

Thought Python was really gunning to be that language.

idle dawn
#

It ended up being too inbetween, and not worth in performance.

#

BUT

#

I've seen so much use in technical stuff.

#

AI, web, complex stuff.

#

Now of course.

#

The 5d kings gambit of mainline programming.

#

C++

#

If you can work it, and you can reliably go from A to Z on project with it.

#

Absolutely killer.

#

But it takes some time and while C# helps, it's not all to it.

#

C# I'm p sure was made to be the simplification of C++.

#

Or at least, not take 4 years of the programmer struggle to find good practices and methods of doing things.

#

Def one of those things you slowly want to transition to once the feet are thoroughly wet.

#

If you want to play the dante must die mode of programming you can try out ass fuck or whatever the name of it is.

#

Here's piet code that interprets brainfuck.

#

As reference material.

upbeat harness
#

any ideas?

humble oriole
#

Hey @sour island do you have a second for me to DM you?

fair current
#

Is it difficult to create a radio mod that is just text?

cosmic condor
#

not very difficult, but tedious

polar thicket
#

If I want our mod to contain a new type of magazine to learn the recipes tied to the mod. What files would I add and what code is needed?

#

To make it spawn and work?

neon bronze
#

The distributions have regular lua lists in them so you can just insert your item in them + the chance of spawning

#

You can then mess around in LootZed to see the spawn chances as a percentage

jaunty marten
drifting ore
#

by golly i did it

#

encoding....

#

sorry looks like it's too large for embed

#

redo!

#

not good with this gif making stuff lol

finite radish
#

so it IS possible. i kinda had a hunch that would work out. awesome work!

drifting ore
#

yea get this

finite radish
drifting ore
#

0 lines of code

finite radish
drifting ore
#

tile properties yet again

#

all whatever is hardcoded is what i used

finite radish
#

how'd you do that via tile properties? I haven't looked at the code, but I thought I saw that the room lights require a roomdef (which player constructions don't have, right?)

drifting ore
#

turned the lightswitch into a lamp essentially

#

with a light radius of 10

#

just working on the bulb part and im good to go

finite radish
#

oh I see, damn. I thought you actually made a "real" room light somehow without code, but that makes more sense. that's clever, although I imagine it may not work as well once the lighting update comes out with B42

#

that's awesome either way though

drifting ore
#

it actually works better than the current lighting if i were to be honest. but then again i just made a giant radius knowing the walls block the light anyways

#

pretty stoked though, instantly levels up my mod

polar thicket
neon bronze
#

Look at the vanilla hunting magz

#

I think they teach the trap recipes

drifting ore
polar thicket
polar thicket
jaunty marten
polar thicket
tardy wren
#

Okay, I have a very bad idea

#

I need to remove a player's map_sand.bin file from their local copy of the save every time they log onto a server, because that fucker doesn't update properly

viral vale
#

Hey all, I made a mod awhile back but I am really not a competent coder, I was wondering if anyone could help me out because otherwise I don't think I can fix this. I haven't touched the code at all in a few months and I was reportedly fine until the latest update: https://steamcommunity.com/sharedfiles/filedetails/?id=2874678809 Here is also a pastebin that someone put in the comments: https://pastebin.com/EkFTUe6j

neon bronze
#

Well i can tell you this much: you are indexing something that is not a table in main.lua on #73

drifting ore
#
    local timeToTalk = zombieData.talkTimer:tick()
#

it seems like it doesn't work the same way anymore

viral vale
#

Ahhh shit... Would anyone be able to help me fix this? I'm not really sure what to do without destroying everything

drifting ore
#

well you are calling a global timer

#

from another file of yours

#

as part of talkTimer

jaunty marten
#

it can cause problem due to other mods can use same global name for it

viral vale
#

Not really sure how to do it any other way, my code was based off something else because I have basically no coding experience really

jaunty marten
#

I too use timer global name for my timers lib and mb this mate have my mod

#

in ur timer.lua change timer = {} to local timer = {} and add return timer to the end of this file

#

in main.lua instead require "timer" do local timer = require("timer")

#

this way don't have 100% chance to fix it but it can be

#

cos code looks fine

viral vale
#

I'll try it out

#

Thank you very much

jaunty marten
viral vale
#

So any time it says timer, just make it say local timer instead?

jaunty marten
#

not for all, just do like I said

drifting ore
jaunty marten
#

when u returning local table in the end of ur file - u creating module instead creating some global one, after u requiring it (lua returns ur module) and it will be done as local instead global so it won't collide with same global variable

drifting ore
viral vale
#

I know nothing

jaunty marten
#

it's fine drunk

viral vale
#

I bashed my head on a keyboard for hours and I managed to make it work

#

But I don't think I can solve this lol

#

I assume the "main.lua" file is the issue though

jaunty marten
#

hah

#

btw yea

#

better to name each file by some unique name

#

or just create folder with unique name and then there can use any name of files

#

btw may be problem with name of timer.lua

#

too simple name

#

I think it's more likely to cause a conflict

viral vale
#

If I rename it, and fix that in the code elsewhere, it could fix it?

bronze yoke
#

this is sort of pandora's box because renaming a file is going to cause big issues for servers

jaunty marten
bronze yoke
#

you can replace it with an empty one instead but then it's going to replace all timer.luas with a blank file so it doesn't fully solve the original issue with having a generic file name

jaunty marten
#

btw it's single error that ppl sent u in workshop comments?

#

I just thought if timer.lua will be problem then error have to be raised on timer:new

viral vale
#

Not sure, 2 days ago people have been saying that is has been causing issues

#

Haven't updated my mod since 21st of October with minimal complaints of any issues

jaunty marten
#

I'm playing with ur mod and 50+ (mb even 100+ idk) other one, it's fine for me so strange bug

#

at least u just can add condition if not zombieData.talkTimer then return end but it's won't solve the original problem

#

just a crutch

drifting ore
#

i'm gonna guess you used another mod or something as your template that also required that same file lol? and those people are using both

viral vale
#

The other mod only has like 2000 subscribers, so i'm doubting that is the case. I editted that one to create mine

drifting ore
#

i mean you just had someone say they are using your mod with no issues

#

so that is more likely than anything really

viral vale
#

Hmmm

bronze yoke
#

there haven't been updates so issues suddenly coming up is absolutely a mod conflict

viral vale
#

Like 5 recent complaints out of nowhere :O? Errr, must be a new mod then or something?

ancient grail
#

Ow lingering uses lua timers? Interesting

open drum
#

Hi everyone

ancient grail
#

Hello

open drum
#

i just created a code using chatgpt

#

and wanted to see if this is actually working

#

local item_id = "item_id" -- The ID of the item you want to spawn
local x, y = 0, 0 -- The x and y coordinates of where you want to spawn the item

local item = IsoObject.new(x, y, 0) -- Create a new IsoObject at the specified coordinates
item:setType(item_id) -- Set the type of the item to the specified item ID
item:setName("Item Name") -- Set the name of the item
item:setDesc("Item Description") -- Set the description of the item

-- Add the item to the world
Map objectMap = getWorld():getMap()
objectMap:addObject(item, x, y, 0, 0)

jaunty marten
open drum
#

Is this code actually legit workable code?

#

cuz it's helpful on learning if it's actually working code

bronze yoke
#

no

open drum
# bronze yoke no

thought so.. cuz there's some methods that doesn't exist on the API

viral vale
#

Don't think I can solve my issue then, if anyone could create a fix that would be greatly appreciated, otherwise i'll probably just leave the mod as is since I can't create a fix

jaunty marten
open drum
#

i just love how active this place is. I really appreciate all you guys for helping

#

im learning alot

cosmic condor
viral vale
jaunty marten
viral vale
#

Duct tape and head smacking

#

And trying shit til it worked

#

I don't know nothin'

jaunty marten
#

copy each ur lua file but give them unique name

viral vale
#

So if I make duplicates of all of the files, have it so that all those old files are empty, then add "LW-" before all of the names of the duplicate ones, then anytime they are called in other code, I change them to call the LW- variants, should it work?

open drum
#

also it kinda helps me where to start

jaunty marten
#

hmmm btw I thinking will it can be cause issue for other mods ๐Ÿค”

#

bruhh, bad situation

viral vale
#

hmmmmmmmmmmmmmm

jaunty marten
#

but anyway it's single way so nothing to do more

jaunty marten
#

and for old files do same thing as u did for settings.lua

viral vale
#

Hmm, alright

jaunty marten
#

and don't forgot in each file change requiring files

require "timer"
require "settings"
require "talking"
>>>
require "lingering_whispers_timer"
require "lingering_whispers_settings"
require "lingering_whispers_talking"
viral vale
#

Ahh okay, i'll see if that works

jaunty marten
#

๐Ÿ‘

viral vale
#

So it would likely cause issues elsewhere with other mods? Orrrr...?

jaunty marten
#

it won't cause new problems

#

cos u already have files with bad names and u can't delete them

viral vale
#

So editing it also here is what I should be doing?

jaunty marten
#

not a better prefix but I think it's fine

#

not sure someone will use LW too

viral vale
#

With this, should I change all "responses" to "LWresponses" as well I guess?

#

What about line 22, "function conversationLine:getResponse() " to "function conversationLine:getLWResponse() "?

jaunty marten
#

change only global variable

jaunty marten
viral vale
#

What should Line 22 say then?

#

What it currently is in the image is okay?

jaunty marten
open drum
#

objectMap = getWorld():getMap()
objectMap:addObject(item, x, y, 0, 0)

#

in this addObject function is diff.

#

compared to addobject method in Class GlobalObjectLookup

#

Which is :
addObject(GlobalObject globalObject)

#

And I don't see addobject methods in any other classes (Class Isoworld for example)

#

do "
getItemFromXYZIndexBuffer(ByteBuffer byteBuffer) " do the same trick?

wraith dew
#

Can I make mod by using lua that force player turn on pvp mode in specific area ?

wraith dew
#

I don't how function I should use. Can you guide me ?

ancient grail
viral vale
#

I think i managed to fix my issue

#

Thank you very much all

#

We shall see if it worked lol

rancid panther
#

is it easy to make a patch for a mod if you know what needs to be changed?

#

oh i can probably look at the code of someone else's patch for a mod

dull moss
#

Anyone familiar with smoking trait in PZ? It does some funny things to stress. Didn't find a source of the behavior in zdoc-lua, but maybe I'm missing something.

I got a trait that supposed to remove a bit of stress every time you kill a zombie, right?

local function onZombieKill(zombie)
    local player = getPlayer();
    if player:HasTrait("Bloodlust") and player:DistTo(zombie) <= 4 then
        local bodydamage = player:getBodyDamage();
        local stats = player:getStats();
        local stressFromCigarettes = stats:getStressFromCigarettes(); -- added in fix attempt
        local unhappiness = bodydamage:getUnhappynessLevel(); -- 0-100
        local stress = stats:getStress(); -- 0-1
        local panic = stats:getPanic(); -- 0-100
        stats:setStressFromCigarettes(0); -- added in fix attempt
        bodydamage:setUnhappynessLevel(math.max(0, unhappiness - 4));
        stats:setStress(math.max(0, stress - 0.04));
        stats:setPanic(math.max(0, panic - 4));
        if debug() then <long print() here> end
        stats:setStressFromCigarettes(stressFromCigarettes); -- added in fix attempt
    end
end```
But it keeps increasing stress with each kill if player has StressFromCigarettes value. I tried to bypass that by setting it to 0 momentarily, but it doesn't work. I assume StressFromCigarettes  multiplies stress or something
#

<long print() here>
is
if debug() then print("ETW Logger: Bloodlust kill. Unhappiness:"..unhappiness.."->"..bodydamage:getUnhappynessLevel()..", stress: "..stress.."->"..stats:getStress()..", panic: "..panic.."->"..stats:getPanic()) end
it shows stats before I did my stuff to them and after

#

(also yes, I temporarily added OnTick event that prints out stress level)

#

OOOOOOOOH

#

I think I know what's up

#

I'll confirm and get back

rancid panther
#

i believe smoking trait has its own stress value for when you dont smoke

dull moss
#

Nah, not that

rancid panther
#

ah

dull moss
#

Well, not exactly

#

Anyway, this fixes it

local function onZombieKill(zombie)
    local player = getPlayer();
    if player:HasTrait("Bloodlust") and player:DistTo(zombie) <= 4 then
        local bodydamage = player:getBodyDamage();
        local stats = player:getStats();
        local stressFromCigarettes = stats:getStressFromCigarettes();
        local unhappiness = bodydamage:getUnhappynessLevel(); -- 0-100
        local stress = math.max(0, stats:getStress() - stressFromCigarettes); -- 0-1
        local panic = stats:getPanic(); -- 0-100
        bodydamage:setUnhappynessLevel(math.max(0, unhappiness - 4));
        stats:setStress(math.max(0, stress - 0.04));
        stats:setPanic(math.max(0, panic - 4));
        if debug() then print("ETW Logger: Bloodlust kill. Unhappiness:"..unhappiness.."->"..bodydamage:getUnhappynessLevel()..", stress: "..math.min(1, stress + stressFromCigarettes).."->"..stats:getStress()..", panic: "..panic.."->"..stats:getPanic()) end
    end
end

in case anyone runs into problems with setting stress when players have smoker trait, you have to substract stress generated by smoking before doing your stff to it, otherwise it'll add smoking stress on top of what you set, so effectively, every time you set stress you duplicate stressFromCiggaretes value

#

hm i gotta fix all my setStress() now

#

cuz it duplicates smoking stress at the moment

rancid panther
#

ah wow

#

at makes sense tho

dull moss
#

yea after I explain it

#

Normally you'd think stats:Stress would just hold stress value

sour island
#

Sounds like something good for the community framework ๐Ÿ˜‰

ancient grail
# dull moss OOOOOOOOH

Is it cuz if your mod? Btw you dont need to use ontick for print
You can just ipen general debuggers all stats are there

ancient grail
dull moss
#

So no, I need onTick print

ancient grail
#

Ahhh got ya

void fractal
#

yall

#

what does a basic custom timed action look like?

#

actually

#

i could prob check the game's code

#

but im lazy af

dull moss
void fractal
#

and it's full of shit the basic one might not need

ancient grail
#

Id the stress is comming from your mod then just create a reverse value ontick
If ever
Or not ontick i think stress has an event too

dull moss
#

?

#

It's already fixed

ancient grail
void fractal
#

why

#

doesn't seem hard at all to do

ancient grail
#

๐Ÿ‘Œ cool

dull moss
#

then do it WICKED

jaunty marten
sour island
#

Sure, what's a bench mark module?

jaunty marten
# sour island Sure, what's a bench mark module?

to test performance of different ways to do smth

local benchmark = require("benchmark")

local getmetatable, type = getmetatable, type
local string_meta = getmetatable("")
local str = "string"

benchmark({
    ["equal"] = function()

        local x = type("abc") == str

    end,
    ["meta"] = function()

        local x = getmetatable("abc") == string_meta

    end,
}, 10000000)
#

btw strange but meta should be faster but seems not in pz ded

#
local tbl = {
["abc"] = {true, 123, ArrayList.new()},
}

local array = ArrayList.new()
array:add(tbl)
array:add("abc")
array:add("blah")

local tbl2 = {true, false, 777, array}

advance_print(tbl2)

--[[ output
{
    1  =  true,
    2  =  false,
    3  =  777,
    4  =  [
        1  =  {
            abc  =  {
                1  =  true,
                2  =  123,
                3  =  [
                ],
            },
        },
        2  =  "abc",
        3  =  "blah",
    ],
}
]]
#

don't look at almost same functions in advance_print, was lazy to merge in single ๐Ÿ˜„

ancient grail
#

Damn thats useful

#

So this is based on client specs?

jaunty marten
ancient grail
#

I saved as snippet for future use if ever i need sonehmthing like it. Could cone in handy

jaunty marten
#

u can print array not it will in one line, for tables no print at all

jaunty marten
ancient grail
#

Ahhh ok

#

Got it

sour island
#

feel free to add those if you'd like

#

I think those fit in debug tools more so than frameworks

sour island
#

trying to debug twitch integration for EHE

#

I think I have EHE running in the client's server (???)

#

and managed to get twitch interation running in the server's server

ancient grail
#

Abt ehe chuck

#

Wait let ne send you the thing i did

sour island
#

sure

#

Normally occurring events show up in console

#

twitch fired events show in in co-op console

#

and all the code is in /server

#

so I'm kind of confused what I'm doing lol

#

the idea was it fired in /server and updated clients over time - but I suppose I misunderstood server/client again

#

OnTick fires for servers though right?

jaunty marten
sour island
#

Trying to figure out why the twitch fired events launch but don't seem to update

#

also all this server but not actually server stuff is breaking my brain

#

ah the update loop is running

#

on co-op console

#

it's just giving any info to the actual players ๐Ÿค”

ancient grail
#

his typing again

stone garden
#

chuck i have an modding related question
what code you use to make the helicopter move i want help my friend to make superb survivors work in mp

#

like making an moving object

sour island
#

I don't think the two can be corelated

stone garden
#

yeah i know but i want make an npc like meta event soo it can spawn in mp

#

why no one want help me in the modding part

sour island
#

Can't help if you don't start - also your idea is pretty complex and is literally a several year long endeavor

void fractal
#

are custom items made in what language

#

i assume not lua

polar thicket
#

And an item texture. Alongside a worldmodel if you want them to appear 3D on the ground

red tiger
#

Ahh man.. Sad that last night's experiment failed. Also, good morning.

polar thicket
#

Morning

void fractal
#

oh yeah

polar thicket
#

Hopefully me and my bud get some progress on our windturbine mod today after studying the Lua mord

void fractal
#

i see what you mean from a mod that adds items

#

that kinda seems like it's too simple though-

polar thicket
#

Reference existing game items and such. When i come home i can explain more in depth. Can give you the turbine alternator item I made as example

void fractal
#

sure, i have work soon though so you can dm me it and ill take a look after work

#

would appreciate it a lot

tame mulch
#

Started working on complete guides about PZ modding for PZWiki. What articles you want to see? (I will try research all sources and create complete guide)

idle dawn
#

Hmm. Hardest things to get started imo is gathering up that documentation by hand. It's what got me really slow to run around.

void fractal
#

you should have different types of levels

#

such as for "beginners" how to do basic timed actions or basic custom items

void fractal
#

and the higher level you go the more it's built upon

#

to add custom functionality and such

red tiger
#

I've personally documented over the years where I need.

void fractal
#

it would be SUPER helpfull

#

cause it's not like i suck at lua (i have 2 years of experience) but just getting started with modding a game with little to no real documentation is really hard

red tiger
#

I can forward documentation to PipeWrench (The Typescript modding solution)

tame mulch
void fractal
#

so slowly letting players follow from start to a finished mod would inspire a lot of people

red tiger
#

This is a highest-priority focus for my own work so I'd like to get involved.

tame mulch
#

Also will need help from car modders and map modders

idle dawn
#

Yep. Basic example scripts like my "make all zombies explode on death" are great ways to get people to go "aha" on a lot of very key things.

red tiger
void fractal
#

never expected adding items would be this simple though

idle dawn
#

Writing the thought process going through it too, all that.

void fractal
#

hot damn

faint jewel
#

?

idle dawn
#

Yeah but you add items with txt files.

#

And not yaml

#

I rage

#

seeethe

void fractal
#

i was expecting it to be json tbh

#

but its legit just txt yeah

idle dawn
#

yaml is like json but I don't have to cry.

void fractal
#

whats so bad about json

red tiger
void fractal
#

rip the ping

red tiger
#

Yeah. Apparently that role is disabled from pings.

idle dawn
#

That makes me want to absolutely nut jab.

#

What's that by chance?

void fractal
#

its not

#

aiteron is with an i

#

not an L

red tiger
#

That's.. disturbing lol

idle dawn
#

lmao

red tiger
# tame mulch What is this?

I created a Typescript modding alternative that compiles to Lua last year called PipeWrench. This allows modders to mod with strong types, type-safety checks, and OOP provided by the language.

#

PZWiki has a link to the project.

void fractal
#

because some people may have questions like

#

"oh should i put this in a seperate folder"

red tiger
#

This program allows me to create and export documentation and further clarification of types for the Lua code.

void fractal
#

or "whats the best folder layout"

idle dawn
#

Honestly the documentation exporting is already a huge plus.

red tiger
#

If you want to see the whitepaper or the repositories, let me know.

idle dawn
#

Like I said, one of the biggest things atm is a lack of docs.

tame mulch
tame mulch
#

@red tiger Also I think Ii will need your help with guides about TypeScript modding

thick karma
#

Anyone know where the game decides that your off-hand hammer (and I'm guessing many other weapons) will be carried weirdly?

#

(Honestly hoping maybe Aiteron knows, trying to grab a screen.)

#

(But I hate pinging pros lol.)

red tiger
#

We do automated generation of PZ's Java and Lua API.

#

(We see every API change in Git diffs)

tame mulch
idle dawn
#

I'm actually a recent modder here so I got that first eyes view on things too. Without proper documentation on available functions (and best practices using them for certain things, like ui, actions, loot, item creation, exc) you pretty much have to effectively decompile and dive into code using resources from the work of other modders, and mostly take from other mods as examples in general.

#

Dunno if anyone else thinks the same though.

tame mulch
#

So, that's why I started working on modding guide

idle dawn
#

yessss.

thick karma
#

Look at the way the left hand's hammer is rotated @tame mulch

red tiger
#

Wow. GitHub is so slow for me right now.

tame mulch
thick karma
#

Instead of pointing down like you're about to hit something with it, it points awkwardly sideways

faint jewel
#

i know the issue.

thick karma
#

makes dual wield mods look wonky

faint jewel
#

the stupid bone.

thick karma
#

Can it be easily fixed or not? @faint jewel

idle dawn
#

But yeah, I think getting very common example code out there, writing the process as if teaching (always good to teach people how your game works!) will go a long way for people to get started.

faint jewel
#

if you redo ALL the animations to rotate that bone lol.

idle dawn
#

๐Ÿฆด

void fractal
#

never done timed actions

thick karma
#

You mean e.g. standing, running, etc? @faint jewel

idle dawn
#

Me neither, and timed actions actually sounds like the "most" documented thing too.

#

but yeee

thick karma
#

How many animations have that bone rotated "wrong"?

#

For lack of a better word.

faint jewel
#

all of them.

idle dawn
#

Good luck with it all @ aiteron.

faint jewel
#

i THINK you might be able to make a seperate model for the offhand though.

thick karma
#

haha right but how many weapon carrying animations are there really? 4? 10? 120?

faint jewel
#

probably around 40-50

thick karma
#

oof.

#

What a horrible oversight that one was lmfao

red tiger
#

@tame mulch This is the template.
https://github.com/asledgehammer/PipeWrench-Template

This is a project I'm working on right now for rendering HTML elements as UI elements in PZ using Typescript:
https://github.com/asledgehammer/PipeWrench-UI

This is an example mod made by someone else entirely:
https://steamcommunity.com/sharedfiles/filedetails/?id=2851206870

This is the original whitepaper. (API has changed, so don't rely on this for documentation)
https://github.com/asledgehammer/PipeWrench-Template/wiki/pipewrench_paper

This is the example files / format for my third-party documentation application:
https://github.com/asledgehammer/PipeWrench-Models

If you need more clarifications and introduction to this project, let me know. I will help you. My goal is to have this help people get over a lot of the issues new modders have when working on PZ.

Thanks.

finite radish
thick karma
#

I used quotation marks for a reason. ๐Ÿ˜›

#

They have meaning and it is not, "I expect this to work the way I want."

#

But, yes, I agree with you.

#

I do not expect anything to work as expected outside the scope of their design.

#

That said, who carries a hammer that way? ;P

finite radish
thick karma
#

And carrying things in your off-hand IS vanilla design.

finite radish
#

just bags though, right? PepoThink

thick karma
#

I'm just saying... I don't carry hammers like that in my left hand.

#

I hand the head low like a normal human

finite radish
#

skill issue (pro carpenters carry them that way, trust me)

thick karma
#

You would have to fight gravity to hold it the way vanilla holds it.

#

shrug if you say so, I've seen a lot of experienced carpenters with hammers and never noticed any holding it sideways

#

And if that IS true, why don't they do it that way in the right hand?

finite radish
#

I was joking KEKW no worries

thick karma
#

Even if we assume you're right

#

lol fair enough

finite radish
#

no one holds a hammer that way (i hope)

thick karma
#

Hard to tell sarcasm in text.

finite radish
#

true, poe's law

faint jewel
#

i wish we could rotate held models via the txt

thick karma
#

That would be clutch.

#

This is discouraging my dual wielding effort bigtime lol

#

I thought I'd have to do 1, 2, maybe 3 custom animations.

#

Not fix 50 vanilla ones.

faint jewel
#
        {
            offset = 0.0000 0.0000 0.0000,
            rotate = 90.0000 0.0000 0.0000,
        }
finite radish
#

I haven't touched the model scripts, but can you not rotate the attachment point? may be easier to fix the current objects (i.e. bags) that can go in the secondary, than rewriting all of the weapons in the game

thick karma
#

I do not know how an item model gets attached to your hand to be honest.

#

I don't know where that occurs in the code.

#

And how much control we have over it depends on where it is in the code.

#

Seems like a custom two-handed weapon animation combo mod would be infinitely easier as a way to look cooler doing melee stuff, now that I am hitting this wall. Idk anymore.

#

Could do all kinds of two-handed attacks that would already look fine.

red tiger
#

Working from home today due to Winter weather.

#

Means more time to mod too.

#

wewt.

faint jewel
#

@late hound you around?

finite radish
# thick karma And how much control we have over it depends on where it is in the code.

seems like the scripts may be an option, but it'll depend on where the entrypoint for this data is (this is from models_items.txt):

attachment bighikingbagrighthand
        {
            offset = 0.8920 -0.1530 -0.0670,
            rotate = -178.0000 -15.0000 100.0000,
            bone = Bip01_R_Hand,
        }

        attachment bighikingbaglefthand
        {
            offset = 0.8790 0.2000 -0.0740,
            rotate = 178.0000 -15.0000 77.0000,
            bone = Bip01_L_Hand,
        }```
thick karma
#

Huh.... interesting... I will look there.

finite radish
#

if you can search the code for "bighikingbaglefthand" you should find the entrypoint pretty easily, I think - it may be fed into another script file though (like the item definition, or the model definition for the bag, etc.)

#

and from there it should be fairly straightforward to implement your own entry for the weapons and such, I'd guess

thick karma
#

Yeah, here's maybe the problem?

    model Hammer
    {
        mesh = Weapons/1Handed/Hammer,

        attachment world
        {
            offset = 0.0150 0.1100 0.0000,
            rotate = 180.0000 0.0000 180.0000,
        }
    }
#

Only one way to hold a hammer.

#

No alt for left hand vs right hand

#

I wonder what code calls this

#

And uses the attachment data here...

finite radish
# thick karma Only one way to hold a hammer.

that's not the hold animation there, because the attachment point is world
it's likely that the hammer uses a different animation, either from a similar item or from a generic type

#

but that's just a guess

faint jewel
#

it does not.

#

ALL melee uses the same animation. wanna test? offhand a wrench/

finite radish
#

that's what I meant by "generic type"

pulsar heath
#

my brain hurts just from reading ๐Ÿ˜„

thick karma
#

It sure looks in this file like there are no other left-hand right-hand specifications that could serve as a generic @finite radish

fair current
#

What program do I need to open the .pack format?

thick karma
#

At a glance, this file seems to be for stuff treated as worn, rather than stuff treated as equipped.

#

I don't know, certain details about holding weapons seem to be absent entirely

pulsar heath
#

uh... here i was thinking discord connectivity would be a pain for the integration mod, but they actually have a .net library ๐Ÿ˜„

thick karma
#

Like how does it know whether to attach hammer to left or right hand in this file? it just has an attachment definition for the world. But some items do have left and right hand definitions... but the items that do are not fighting items.

#

E.g. if you hold a backpack in your left hand, this file has info for that condition, but there's no info at all about handedness in relation to machetes.

finite radish
#

so if you could technically cook up something like LeftHammer as a new attachment type, and then assign that via something like setAttachmentType() if it exists, then you're in business!

#

given that it's generic you wouldn't have to do it for each item either:

if item:getAttachmentType() == "Hammer" then
    item:setAttachmentType(LeftHammer)
end```
#

it won't be that direct and the set function may not even exist in that form, but hopefully you get the idea from that

thick karma
#

I do see what you're saying. I don't know if I can do that on an item at the moment of equipping it, but I think I get the vague idea.

#

Question becomes how to mod in an attachment type properly... Can I just say:

module Base
{
    model FemaleBody
    {
        mesh = Skinned/FemaleBody,
        static = false,
        animationsMesh = Human,

        attachment LeftHandHammerFix
        {
            offset = 0.8920 -0.1530 -0.0670,
            rotate = ??? ??? ???,
            bone = Bip01_L_Hand,
        }
    }
}
#

Or do I create my own module?

#

And then say setAttachmentType("MyModule.LeftHandHammerFix")?

#

Or do I need to check and handle body type?

finite radish
#

but they should be relatively exposed, enough to make your own at least

#

take a look at the tables the hotbar code uses alongside getAttachmentType() for some hints

thick karma
faint jewel
#

it wouldn't be for hammer.

finite radish
faint jewel
#

it would be for prop2

#

prop2 is the left hand attachment point.

thick karma
#

prop2 doesn't exist in models_items.txt

finite radish
thick karma
#

Nor in items_weapons.txt @faint jewel

finite radish
#

skizot was mistaken on what you were actually looking for

thick karma
faint jewel
#

i'm just trying ot explain it from the model POV. the prop2 bone needs to rotate 90 degrees to correct the placement.

#

however the hell you wanna accomplish that.

ancient grail
finite radish
thick karma
#

So you're thinking the Hammer attachment data referenced in items_weapon.txt is actually somewhere else? @finite radish

finite radish
thick karma
finite radish
#

don't listen to Skizot, he's confused KEKW

#

(no offense ily)

fair current
faint jewel
faint jewel
#

i have to modify that stupid bone everytime i make a new animation.

finite radish
#

yes, but you're giving the wrong solution - you shouldn't rotate the entire bone at all unless you're doing it via an animation

thick karma