#mod_development

1 messages · Page 250 of 1

sour island
#

The inner-debatelord came out when they tried to gotcha me on 'I thought you said you wouldn't be troubleshooting here, huh?'

#

Yeesh, must suck to live as that guy

#

Thankfully these entertaining folks only show up once and a while

tacit plover
#

I'm happy that I've never got any bad interactions so far on my page

#

and I've broken my mod a few times when updating stuff

#

most people I've interacted with were pretty helpful

#

there are people who don't read descriptions tho

#

not really a bad interaction, but funny how often it happens

sour island
#

Yeah I don't consider comments like 'mod is broken' to be bad, just unhelpful

#

It graduates to 'bad' when they choose to just be snarky/rude

#

On the flip-side, I've had some bugs with the most recent/biggest update to skill recovery journal - unfortunately it has so many sandbox options there were some setups that I didn't account for + other mods didn't play nicely. I had 2-3 whole communities come together to help bug test it.

#

I still talk to them and have them ping me with collected reports.

grizzled fulcrum
#

the fact that I got away with reworking the backend of my whole mod twice because it was ugly and no complaints is just sheer luck

drifting ore
#

the Tail Concerto PFP guy is an ass but he has a very good point. People seriously don't appreciate it when you roll out 10 hotfixes a day just because it took 10 additional updates to fix the gamebreaking bugs in the original update. The problem is exacerbated by the fact that Steam forces updates, does not allow selecting the version you want to play, and will not push the updates immediately which makes the users end up with a non-functioning version when you've already pushed the fixed one - so they inevitably make a bug report (or just bitch about it) when you've already fixed everything. I know it's sometimes difficult or even impossible to make sure everything works fine the first time so you just have to bite the bullet and make a hotfix for a hotfix. But people have every right to complain about it, even if they straight up insult you for it. They are very frustrated that their game stopped working for no reason and they have no recourse other than to bite the bullet and uninstall your mod entirely so it won't cause issues with the game.

bronze yoke
#

but chuck says this didn't actually happen

drifting ore
#

Most of this can be avoided if you do expansive unit testing. But that's hideously time-intensive to set up.

grizzled fulcrum
#

I've unironically had the opposite experience of Chuck, where I pushed a patch that broke next to all my code and nobody reported anything, had to find it out myself when testing through Steam lol

sour island
#

every hill, wrong one every time, crazy.

bronze yoke
#

that one single small last minute change that you really don't need to test...

grizzled fulcrum
#

YES that quite literally defined what happened

sour island
drifting ore
sour island
#

GameNight has been notoriously hard to test cause people use it for decor. 💀

grizzled fulcrum
#

got rid of a single line of code that was important and updated the readme more, I was like ehh it's mainly docs being updated so I didn't bother to properly code review every change like I usually do

grizzled fulcrum
sour island
#

'Oh yeah XYZ happens, but we ignore it.' 🥲

grizzled fulcrum
#

I personally mash ctrl+s every single second so I've never had that issue yet

bronze yoke
#

in my mind i still live in the days where programs would just crash every fifteen minutes or so

drifting ore
sour island
#

IntelliJ seems to auto save constantly

grizzled fulcrum
bronze yoke
#

nah, just reflecting on how much more stable computers seem to be now

grizzled fulcrum
drifting ore
#

Also @sour island in that interaction, as shitty as it is, you're not being productive either. Ask people to paste the the error from the console.txt log or install ErrorMagnifier mod & try to reproduce it.

bronze yoke
#

i think everyone's ctrl-s habit runs back to a specific event in their past that in some way involves the phrase '6 hours of work'

sour island
#

If your takeaway is that guy was 'just frustrated' then you've missed valuable context.

drifting ore
#

You made a hint at it. But mostly you were just rude to the person complaining about what seems like game-breaking bugs. I know it's not unwarranted given the situation, but still.

sour island
#

There weren't any bugs.

drifting ore
#

I would ask them straight up to paste the error from console.txt

sour island
#

He was complaining about an update.

drifting ore
#

Well clearly something went wrong for him to go apeshit to the point that he decided to contact you personally to talk about it.

sour island
#

Well he's blocked, so the point is moot.

drifting ore
#

You know 99% of people stay completely silent.

#

I had to learn about 2 major problems about my mods in a casual conversation where people just kinda mentioned them.

sour island
#

I'll receive a more useful report if the bug actually exists from a user who isn't an asshole. 🤷‍♂️

drifting ore
#

That is 100% true. HOWEVER. Everyone's frustration is valid.

#

What I mean by that is there's no need to completely ignore someone just because they aren't nice. By definition, people who experience problems are the same people who get frustrated about it.

sour island
#

Actions have consequences.

drifting ore
#

Ok so you decided that you will ignore this quote-unquote error report. What is the net benefit exactly? There isn't one. The guy will just get more upset and you didn't improve anyone's experience.

#

I would've just said sorry I made a bunch of errors slip and I had to hotfix them.

sour island
#

Sometimes, the most important journey is the one within.

#

I like to think I gave him that inner journey.

drifting ore
#

Haha no, what you did is told him to fuck off and dress it up in a fancy metahpor😂😂😂

wet sandal
#

I think the only thing you might've done wrong is give them too much attention.
These are the users that make authors disabled comments.

drifting ore
#

I understand you completely but I just thing it's poor community management is all. As a dev you have to be the bigger man.

sour island
#

I agree, should have sent him on his inward journey sooner.

#

Kind of moot, when he stated he was not reporting an issue, and never did fill a bug report.

#

But I guess I should have been nicer in asking him to make a detailed report.

#

I'll unblock him, reach out and apologize.

drifting ore
#

Dude come on, most people can hardly be even bothered to speak to you at all about experiencing any issues, much less filing a bug report properly, especially if they have to go to another site and make an account. Each of those steps individually reduces the number of people willing to do this by a factor of 5-10x.

sour island
#

Weird that he had energy to keep trying to play gotcha, when in most other cases I say file a report on github it ends up there with no problems.

#

It's as if he wasn't there to be helpful

grizzled fulcrum
drifting ore
#

Playing gotcha is one of those virtiol feedback loops. It just keeps you going.

sour island
#

Man's greatest enemy lies within.

drifting ore
#

Once you start antagonizing someone it's virtually impossible to curb this thought process in a reasonable amount of time.

grizzled fulcrum
#

reading the whole thing, you can tell their intentions weren't to solve the issue and make their players happy, it was to whine in the comments about practically nothing

sour island
#

If 'file a detailed report' antagonizing then I'm glad he can't muster the energy to file one.

drifting ore
sour island
#

Would have been painful to try to get a console log. Might have gotten "Why do you need that???"

#

The issue was that the mod updated.

#

Solution: nothing.

grizzled fulcrum
#

When someone starts off a comment that is (supposedly) detailing an issue (not what they did here) with high amounts of sarcasm and criticism rather than a simple "Your mod has a bug" (to some lesser extent) than I honestly wouldn't give them much credit

drifting ore
#

Hehehe, you're still antagonizing the guy.

sour island
#

I suppose you have more experience in this matter.

grizzled fulcrum
#

If the issue weren't repeatable then I'd put in an assumption that they could be just agonising you for no proper reason.

drifting ore
#

Anyway yeah just copy-pasting the boilerplate of "please find console.txt in that folder, then find crash log, then paste contents" does the job 99% of the time.

sour island
#

✌️

grizzled fulcrum
drifting ore
grizzled fulcrum
#

true

drifting ore
#

It surely helps when the amount of negativity you see directed at you is virtually nil.

#

So I guess it's not fair to expect makers of actually popular mods to adhere to the same standards.

#

The proportion of asshats in any comminuty is more or less constant. But bigger community = more asshats.

#

1% of 100 people is not nearly the same as 1% of 10 000 people.

willow slate
#

Hi guys I just start a mod dev. today and triyng create a basic command for game

#

``-- Komut işleyici fonksiyon
local function onCustomCommand(module, command, player)
if command == "tst" then
print("Work!");
end
end

-- Komutları dinleme
Events.OnServerCommand.Add(onCustomCommand)

-- Müşteri komutları dinleyicisi
local function onClientCommand(module, command, player, args)
if command == "tst" then
print("Work!");
end
end

Events.OnClientCommand.Add(onClientCommand)``

#

My code is somethink like that but

#

when try "/tst" on chat its says command unknow

#

and docs is not enough I think.

drifting ore
#

those aren't custom console commands, no. They're more like custom network packets. You send them through code manually.

#

Just the other day someone made a mod to add custom commands though. Let me find it.

wet sandal
#

sendClientCommand(characterObj, 'module', 'command', args)

#

sendServerCommand(characterObj, 'module', 'command', args)

drifting ore
willow slate
#

you save my life bro

#

notloc and coldsteel thanks guys

#

I have to ask one more question because I am in pain!

#

I am using /reloadlua "client.lua" or "cliant" or client or "modname" or modname but ITS NOT WORKING

#

😢

undone crag
#

Oh @sour island I remembered I turned off the ping so you might have missed my reply.
So ```lua
Events.OnCreatePlayer.Add(HelicopterSandboxOptions("OnCreatePlayer: "))

is equivalent to
```lua
HelicopterSandboxOptions("OnCreatePlayer: ")
Events.OnCreatePlayer.Add(nil)

if HelicopterSandboxOptions("OnCreatePlayer: ") returns nil. Meanwhile

Events.OnCreatePlayer.Add(HelicopterSandboxOptions)

is passing a pointer to the function as an argument, rather than what it returns.

edit: crossed out "pointer to" because maybe it's not a pointer and maybe I don't know what a pointer is or something :d

willow slate
#

oh

#

okay

mystic vessel
#

So guys, I made a recipe for my mod involving a new coffee feature, which allows you to recover stamina
Is this a good addition?
I need a feedback

drifting ore
#

Well the important part is that it works. The people who like the idea will install it.

#

I wouldn't call it realistic or anything. But neither is recovering fatigue from eating tea bags.

thick karma
mystic vessel
#

So thats good to hear

#

I ill add it :)

#

This is for the Machines II mod

thick karma
#

If coffee can't save me from zeds, what can?

mystic vessel
sour island
#

Locking the door and playing solitaire

thick karma
#

😉

shadow willow
#

Hello again ! Is there an event for when a player use an item ? or even better for when he eat something ?

thick karma
#

idk about better ways

grizzled fulcrum
# undone crag Oh <@55792318204092416> I remembered I turned off the ping so you might have mis...

To add onto this, just for the sake of anyone reading as a cool fact: In Lua, all function arguments are passed as value, and all variables are references to the assignment. This is good to know if you come from a lang like C/C++. I am sad we can't do cool pointer stuff in Lua but I don't mind that much.
Example:

local a = 10
local b = a
a = 100
print(string.format("A=%d, B=%d", a, b)) -- A=100, B=10

-- test is a reference to this anonymous func
local test = function(val1, val2)
    b = 123
    
    local temp = val1
    val1 = val2
    val2 = temp
    return val1, val2
end

-- Here, params A and B are passed by value
-- You expect A and B to be swapped here, right?? No, it only swapped the values that were copied to the func and ultimately returned.
local v1, v2 = test(a, b)
print(string.format("v1=%d, v2=%d", v1, v2)) -- v1=10, v2=100
print(string.format("A=%d, B=%d", a, b))     -- A=100, B=123
drifting ore
#

This is the default intuively expected behavior.

#

Unsavvy people have problems when referenced objects get modified.

grizzled fulcrum
#

Yes, I just figured I'd post it here because some people might not know that and idk

#

beats reading the manual, I despise it

drifting ore
#

also IDK about "cool pointer stuff". Outside of nested arrays, constructs like pointer to a pointer to a pointer fall into "pretty cursed" rather than "pretty cool" category.

grizzled fulcrum
#

also is "(%d)":format(100) not valid Lua syntax? I could've sworn I used this in one of my mods and it worked fine, but not in my local lua interpreter

drifting ore
#

Depends on implementation I guess? I seem to remember it works in LuaJIT, but that is a frankenport of 5.1 with some later version features backported.

grizzled fulcrum
drifting ore
#

Eh I don't feel it. Most of that is just a really backwards way of using arrays.

#

I mean, in the same way as return 10[myArray]; is a perfectly valid C syntax. Except it's literally backwards.

grizzled fulcrum
#

I did not know that, that's pretty bad lol

#

I guess I really mean just being able to access and manipulate memory directly, not just pointers and references

shadow willow
#

When i was in school, I had a professor that was saying "Pointer are really cool. Too cool for you. Don't use pointer"

drifting ore
grizzled fulcrum
#

yeah I do agree pointers and stuff are pretty unnecessary but I like being able to have so much control (even if the compiler will just optimise it anyway) like being able to pass var by reference or value to a function is super useful

frank elbow
grizzled fulcrum
#

good to know! especially since i hate typing string.format every single time

drifting ore
frank elbow
#

Yes

grizzled fulcrum
#

well I don't use it that often but still it looks way cleaner

drifting ore
grizzled fulcrum
#

I think it's nil

#

wait no

frank elbow
#

The implementation may not handle it the same, but for the use case described here it effectively does

grizzled fulcrum
#

It's metatable is just this:

__add | function: 0x64ba5c6966b0
__mod | function: 0x64ba5c696710
__idiv | function: 0x64ba5c696770
__unm | function: 0x64ba5c696790
__pow | function: 0x64ba5c696730
__div | function: 0x64ba5c696750
__sub | function: 0x64ba5c6966d0
__index | table: 0x64ba5cf7e760
__mul | function: 0x64ba5c6966f0
frank elbow
#

I imagine __index is string

drifting ore
#

so kahlua parser just considers "":format() to be a syntax error

frank elbow
#

Yeah

#

But (""):format() is valid

drifting ore
#

parenthesis make everything better

grizzled fulcrum
frank elbow
#

Or worse in this case, depending on perspective 😅 personally I prefer just passing it in as the first arg without the sugar

drifting ore
frank elbow
#

My assumption is that the others exist only to say the operator isn't defined, but that's just an assumption (because I'm unable to check right now)

grizzled fulcrum
#

like __add it says attempt to add string with string

frank elbow
#

I should clarify I know that those operators don't work lol, I'm saying I imagine that's what those functions are there for

drifting ore
grizzled fulcrum
#

o, makes sense

drifting ore
#

i guess you can implement _add so you can do "foo" + "bar"

grizzled fulcrum
#

I am not sure why they didn't make string concatenation with __add work the same as .. too

drifting ore
#

__add = __concat

frank elbow
#

I don't know their intention, but it's certainly clearer for automatic type conversion

#

A string concatenated with a number is a string, and that's predictable. No uncertain behavior for +

#

Not in Kahlua, but what really has potential for cursed code is debug.setmetatable

drifting ore
#

I feel like the .. operator was added to avoid type coercion, but they had to cave and allow numbers and whatnot to be coerced to strings

#

but not for nil and booleans

#

those generate errors if you try to concatenate them

frank elbow
#

I'm not certain, but I believe it always allowed that

drifting ore
#

or tables

#

huh, is number is the only type that's even allowed to be coerced into string?

frank elbow
#

Maybe since those are the most common other type to need to be included in a string? Dunno

grizzled fulcrum
#

thankfully I just do someNilThing or "nil" and it works for my uses

frank elbow
#

tostring is glaring at you rn (this made more sense pre-edit)

grizzled fulcrum
#

LOL

drifting ore
#

that'd make sense yeah. But it makes it feel like the whole .. operator is a half-hearted statement of "Lua has no type coercion! (unless it's numbers to strings in the concat operator)"

grizzled fulcrum
#

It's good that you point it out to use tostring

grizzled fulcrum
#

I just use the or thing to avoid func call overhead in tick function

#

if there even is any, maybe im paranoid lol

drifting ore
#

Eh you know you're not supposed to use concat that way anyhow. There's string.format to display formatted strings.

frank elbow
#

Depends on what you need it for, really. I use x or y quite a lot (if I know a falsy value isn't valid for x, of course)

grizzled fulcrum
#

another thing I wish Lua had was inline, although there's no preprocessor or compiler(?) but making the memory usage a tiny bit higher for a situation where function call overhead is a TON is so helpful

#

I have to do it manually, but it really is a pain

drifting ore
#

normally JIT would take care of that but there's no JIT for Lua in PZ

grizzled fulcrum
#

sad times

#

unironically JIT would solve like a lot of issue

drifting ore
#

it would work better if PZ was writtein in C++ since there'd be C objects it could hook into for high performance mode

#

Fun fact. If you use C structs, LuaJIT can work faster than equivalent C code with -O2

#

(that's because LuaJIT is equivalent of -O3 -ffast_math)

#

speaking of fast math. It's absolutely unreal how much this makes a difference for calculation-intensive game logic

#

if you just move bytes from one class to another it's hardly relevant. But if you actually add and multiply stuff in complicated ways it makes a very big difference

#

And the whole downside is that it might sometimes be off by 1 least significant bit from IEEE solution

#

Depending on CPU there might be no difference at all.

#

But also depending on CPU you might get non-deterministic behavior if you use JIT.

#

Specifically one issue I encountered is that min and max SSE functions return the first argument if either of them is NaN. Most of the time NaNs have a very beneficial property that they silently propagate so if at any point in your calculation you ended up with a NaN, it'll just carry over all the way to the end of the calculation. But the aforementioned design quirk means that you will get NaN or a valid number depending on which operand passed into it was NaN. And much worse, JIT generated these instructions, it could've flipped operands however it felt was appropriate given the codepath and profiling information it had gathered during current run.

#

The practical upshot is that you need to actively check against NaNs which adds branching which kills hotloops.

#

I guess one good property of Kahlua is that it's so slow that none of the usual performance considerations are at all relevant (such as avoiding branching or maximizing cache use), and you just need to take care not to use O(2^n) algorithms

tight dirge
bronze yoke
#

it's kahlua

tight dirge
#

... bruh. :V

bronze yoke
#

a not quite up to standard and very slow java implementation of lua 5.1

tight dirge
#

Oh well more time to research.

drifting ore
#

kahlua is a wonky version of C lua implemented in Java, last updates over a decade ago

tight dirge
#

So it is just 5.1 bindings to Java then?

bronze yoke
#

no, it's a reimplementation

drifting ore
#

one quirk you might need to be aware of is that modulo operator uses 32 bit integer as intermediate variable for division process, so if in your A % B, A/B would generate integer longer than 32 bits, it will glitch.

bronze yoke
#

this is important because it is implemented in a much slower way than vanilla lua

tight dirge
drifting ore
#

beyond that the modulo operator in kahlua mirrors that of java, not Lua

bronze yoke
#

it also doesn't implement all libraries, and some are not implemented fully

drifting ore
#

it also doesn't have functioning next (despite having functioning pairs)and if you try to obtain it using hacky solutions, it's not gonna work either

#

it's a mess and we all hate it, but it works and the devs not gonna refactor half the game codebase to switch it out for luaj or anything else that's actually high quality

grizzled fulcrum
#

I was wondering why checking if a list is empty with next was nil, thats why

drifting ore
#

fun fact: you can get next by calling pairs but the retreived function stops working almost immediately

bronze yoke
#

we love```lua
local foo
for _,v in pairs(t) do
foo = v
break
end

drifting ore
#

yay

#

🤦🤦‍♂️🤦‍♀️

#

i have so many of these in my code

tight dirge
#

xd

drifting ore
#

it's one of those type 2 fun activities that are actually type 3

tight dirge
#

Anyway it probably is better that it at least is similar to 5.1 syntax, like in other instances where I meant with Bastardized Lua with added C syntax bs, Devs are considering removing all of it, as said API was only meant for prototyping originally before all that mess was made into modding API. It doesn't help that said Lua core was used for like 2 decades in 2 major versions oof.

drifting ore
#

it's 5.1 but with a laundry list of bizarre issues

#

like aforementioned modulo returning complete nonsense if you do 1000*1000*1000*1000 % 2

bronze yoke
tight dirge
#

I mean, I guess you could have custom version of Lua but at this point I would probably take something like Luau since it is actively developed by someone else.

drifting ore
#

Should've just stuck with tried and true luajit

#

it's more work upfront on the API side since it's the same raw deal as regular lua

#

but that thing is close to perfect

#

i mean sans the fact that hooks don't work on per-line basis, being JIT and all

tight dirge
#

JIT is not bad at all and great in performance, outside bit-wise operators or rather in it's case functions

drifting ore
#

it's not like bitwise operators are fast in any case. I mean they're single cycle but you always need so many of them.

#

Also if you make local cache of the function values, they get inlined.

tight dirge
#

They aren't, mostly they are useful for fixed-point operations which I had to deal with massively.

#

And me wanting to preserve a lot of booleans into flags variables, but that was in said Blua rather JIT.

drifting ore
#

imagine torpedoing game performance to save a few bits of RAM

#

hehehe

#

just kidding of course, fixed point is GOAT and it's really a shame that instead of developing strong hardware support for fixed point, we got floating point.

tight dirge
drifting ore
#

did the game had PCM sound effects? A few stray silent samples at the ends could've completely eclipsed memory usage of the bit banged booleans savings.

tight dirge
#

Well, it is SRB2 which is based in Doom Engine.

drifting ore
#

but which doom engine?

#

wait nevermind, the SRB2 engine

tight dirge
#

It is technically custom at this point. Yeah.

drifting ore
#

it uses a fork of OG Zdoom right?

tight dirge
#

Nope, Doom Legacy.

drifting ore
#

Aight. If I remember correctly, SRB2 engine was the first to implement sloped surfaces of any doom engine.

tight dirge
#

I think it was Zdoom though.... not sure, SRB2 had community build in GL with them.

#

Anyway bit off topic.

#

Small question, I was earlier today just playing around with the script for few minutes, and I assume that you cannot write new variables (saved in Lua registry) into player userdata/class?

bronze yoke
#

no, but most objects have a table attached that you can store data in

#

anything that inherits from IsoObject (which should be basically everything with a presence in the world) has getModData()

drifting ore
#

I imagine abusing it as storage is not great since it creates and writes back the whole table each time.

tight dirge
#

Doesn't help it is function either.

bronze yoke
#

(it's a function because they didn't implement accessing java fields from lua 🤫)

drifting ore
#

Well I'm assuming anyway. It's hard to tell.

bronze yoke
#

it does, it's just a table, nothing fancy

drifting ore
bronze yoke
#

doesn't java have a final keyword?

drifting ore
#

If there's just a getter, you will always get whatever's attached to hte java object and you can't swap it out for other tables.

tight dirge
#

Wouldn't imagine it to be done in Java.

bronze yoke
#

java has reflection so it's actually a lot simpler to do stuff like that

drifting ore
bronze yoke
#

it's a problem i'm facing with my current c++ project actually 😅

tight dirge
bronze yoke
#

pz does have a couple functions intended for debug that access fields but they're a giant pain to use, they're basically just wrappers around java's reflection stuff

#

i used those to generate field metatables

drifting ore
#

I don't get it. I've been implementing C side of Lua scripting and it's nothing special.

#

In fact there's no need for the If-else ladder.

tight dirge
#

It is not really, it is really mundane work that's all.

#

If you define each field manually that's is.

drifting ore
#

ah well, if you insist on implementing field access through __index then this might be tedious

tight dirge
#

I wasn't one insisting on it though.

drifting ore
#

the project I dealt with just implemented getters and setters

tight dirge
sour island
#

I was trying to help Buryaga with mouse event stuff - anyone know why setXY wouldn't work? It's exposed, but just doesn't do anything lol

bronze yoke
#

i'm facing the issue of exposing things to lua (currently only targeting class functions) automatically without reflection (as cpp has none)

bronze yoke
drifting ore
tight dirge
drifting ore
# bronze yoke it seems like it might not actually be using the value this sets

It does. The X and Y coordinates carry all the way to the backbone framework.

        s_mouseStateCache.getState().setCursorPosition(var0, Core.getInstance().getOffscreenHeight(0) - 1 - var1);
    }

    public MouseState getState() {
        synchronized(this.m_lock) {
            return this.m_states[this.m_stateIndexUsing];
        }
    }

    public void setCursorPosition(int var1, int var2) {
        Mouse.setCursorPosition(var1, var2);
    } //import org.lwjglx.input.Mouse;```
bronze yoke
drifting ore
bronze yoke
#

maybe, it'd be unideal to use macros that heavily and i'm unsure exactly how that'd look but i will probably be looking for solutions like that

drifting ore
#

either that or a python script that glues together C and Lua for you

#

just include it in the build

bronze yoke
#

yeah, that's the strongest possibility i think - i'd have to do something similar to generate stubs anyway

sour island
#

Gee, where can I get a commission done? I am willing to pay.

chilly nacelle
#

ey guys! gn, im a dev from brazil, i'm trying to get into modding pz, so i'm looking for general advice on where to start since i never modded a game before. But i also have one specific question:
Previously i made a short python script that i'm using to do automatic backups from my last single player save, i was wondering if when modding/making Luas scripts, we can have acess to the actual saving events of the game to trigger my own scripts, is this possible? what are some useful documentations to read for modding?

grizzled fulcrum
#

it's super helpful

#

I think it's official wiki and it has stuff like item, recipe and model script schemas and all that

drifting ore
#

on sale used to be $25,000

sour island
#

Best I can do is $50

drifting ore
#

$10 for medium mod

#

$49.99 for big mod

#

(these are not my real rates)

sour island
#

i will think about it

serene zenith
#

Dumb idea. But what about a pack of nostalgic food of the late 80's and 90's?
Mainly pizza rolls, hot pockets, and Teenage Ninja Turtle Pies.

sleek heath
#

im trying to upload a different version of goodie remover because the original creator has it as a 90% chance and I wanted to make a 80%/70%/60%/50% version aswell for people with bigger music libraries

#

but i keep getting this message

#

as you can see the folder exists on the right side

#

so whats the problem?

#

wait i see the problem

#

nvm

#

lol

#

i checked my other mod and i saw its missing some folder structure

#

all good

bright fog
#

<@&671452400221159444>

lost slate
#

ty

sour island
#

Heavens to betsy, does anyone here commission mods? I'll pay for a mod written in binary.

drifting ore
#

the what

dry chasm
dire oracle
#

Is there any way to force exact server not to use your zomboid mod?

grizzled fulcrum
#

I am not sure what you mean. If you don't want a server to use a specific mod, they are the ones who need to remove it from the mod list.

dire oracle
grizzled fulcrum
dire oracle
#

To force block

grizzled fulcrum
#

im not sure honestly

#

If you were able to do network stuff like get and post you could implement authentication but that isn't the case so

#

and even if you were to achieve it in lua, they could easily just remove the checks that prevent it from loading

dire oracle
#

Uh

nimble badger
# dire oracle To force block

remember that all mods are stored in a file, it can easily be accesed, unless you created a new folder or made a registry or something, but i wouldn't be able to tell you how to do that

drifting ore
#

Which is to say there are ways you can backdoor your mod and make it deactivate on command, but generally falls under "malware" category.

#

If you did it purely as a sport or for money, it would be unsavory but merely that. Doing so out of sheer spite or zealotry makes it quite frankly reprehensible.

dire oracle
bronze yoke
#

in any case it just wouldn't really work very well

#

any protections you add they can easily find and remove

dire oracle
drifting ore
#

Anyway I've heard you can make GET requests from within PZ mods which means you can send pretty much whatever info you want to your web server (as long as it's accessible from PZ) and you will be able to receive back server's response and proceed or terminate operation accordingly.

bronze yoke
#

if your mod has a significant lua portion, you can keep it exclusive to a server by loading the lua from the cache folder

drifting ore
#

You will probably need to very heavily obfuscate the files in order to prevent this backdoor to be easily removable.

bronze yoke
#

if it's server side lua this is pretty much 100% secure, if it's client side lua done properly it at least takes more skill to hijack than most people have

red tiger
#

Thought I'd make a post here on a funny project I just worked on: I got Python working in Project Zomboid.

from zombie.ui import UIManager, UIElement, UIFont #type: ignore
from zombie.core.fonts import AngelCodeFont # type: ignore
from com.asledgehammer import Jythoid #type: ignore

class PythonUIElement(UIElement):
    
    def renderText(self, x, y, font, text, red, green, blue, alpha):
        # type: (int, int, UIFont | AngelCodeFont, str, float, float, float, float) -> None
        if isinstance(font, UIFont):
            self.DrawText(font, text, x, y, red, green, blue, alpha)
        elif isinstance(font, AngelCodeFont):
            font.drawString(x, y, red, green, blue, alpha)

    def render(self):
        super(PythonUIElement, self).render()
        self.renderText(64, 64, UIFont.Cred1, "Hello, Python 2!", 1, 1, 1, 1)
    
    def isMouseOver(self):
        return super(PythonUIElement, self).isMouseOver()

# This allows for Kahlua to play with the object like a Java class
Jythoid.expose(PythonUIElement)

def mainmenu_enter():
    print('Adding Custom UI..')
    element = PythonUIElement()
    UIManager.AddUI(element)

Events['OnMainMenuEnter'].add(mainmenu_enter)
dire oracle
#

I just know, that there's another game that allows you to block IPs from downloading the mod, thought it was something on the side of steam, that allows to do that

bronze yoke
#

nah, steam doesn't have anything like that

dire oracle
#

Eh

dire oracle
drifting ore
drifting ore
#

cuz you know regular python is super slow

dire oracle
red tiger
bronze yoke
#

python is slower than lua but kahlua specifically is pathetically slow

drifting ore
#

But I suppose just the fact that it's a competent implementation alone makes it better.

#

Ideally it would compile python bytecode to Java bytecode, so that it can JIT.

#

and not have to waste CPU cycles marshaling data

red tiger
#

Kahlua is abandonware from like 10 years ago. Jython is way more recent. Kahlua runs on 1.6 JDK technology IIRC.

bronze yoke
#

it does do that

drifting ore
#

well if it compiles to Java then it's pretty great

red tiger
#

The JVM interprets the Python class as a Java class.

#

The interop is nice here.

drifting ore
#

neat. How's workshop compatibility?

red tiger
#

It's a client-side patch so beyond installing that and running it with an additional argument for the library, good.

drifting ore
#

so in general, not good. Dang that's a shame.

red tiger
#

Well if you consider modding the client as a killer then sure. Make a good enough mod though and a good installer for the patch and people will come.

drifting ore
#

Workshop mods really must NOT require any action on user part besides pressing "subscribe" otherwise it's gonna be a whole can of worms and people would need to REALLY want your mod in order to put up with all that.

bronze yoke
#

sure, but add multiplayer npcs or something and suddenly everyone has this patch installed and python mods are one click installation

red tiger
#

The funny thing is you could add custom Iso objects into the game and NPC logic is doable.

bronze yoke
#

we've been one killer app from a custom mod loader for years, though, and we're still here

red tiger
#

Also custom render methods in Java subclasses as python would mean rendering animals is already doable through this method.

drifting ore
red tiger
#

I did do an optimizer mod for build 31.

#

It forced the game to use a weaker but insanely fast PRNG which chopped a lot of the comp times for map & game code

drifting ore
#

I really appreciate the work done but at the end of the day it's not enough that it's really cool and advanced, it must also be accessible. It's like car turbos - unless it comes with a turbo from the factory, most people not even gonna bother trying it. Installing a turbo is just too much work for a regular person.

red tiger
#

Again if people like something enough they'll mess around with it.

drifting ore
#

What I also meant to say is that I would've really used this Python addon if it didn't require users to do anything other than to click subscribe on some workshop mods. Manual installation requirement would pretty much kill any potential userbase for me.

#

I mean at that point I might as well skip Python and make a Java mod. Would've been the same set of issues.

bronze yoke
#

it's not like he chose for it to need manual installation, that's just how it is if you want api expansion

drifting ore
#

It's just unforunate, is what it is. I can't make my subscribers jump through hoops - they not gonna do it.

tight dirge
bronze yoke
#

i'll probably give it a go when you've got typings done

tight dirge
#

Well, it is unfortunate, everything about PZ's Lua API is just messy. Would appreciate more consistent experience to Java with Python.

bronze yoke
#

there's a mod i've always wanted to make that isn't possible with the current api

drifting ore
#

Not for me of course. As a dev I'm used to pretty cursed setup shenanigans.

#

To my potential users. Vast majority of them will not put up with any of it.

#

Even something as simple as having to run an .exe can be an extremely huge turnoff.

tight dirge
#

To common user even settings most of the time are turn off.

#

We really deal with masses.

drifting ore
#

To me this would sting particularly badly because I specialize in novelty/niche mods, things people don't value as high as to go out of their way to make it work.

#

If it was a full 3d renderer? People would bend over backwards just to get it running.

red tiger
#
class UIManager:

    @staticmethod    
    def AddUI(element: UIElement) -> None: ...

class UIElement:

    def DrawText(self, font: UIFont, text: str, x: int, y: int, red: float, green: float, blue: float, alpha: float) -> None: ...
    
    def render(self) -> None: ...

    def isMouseOver(self) -> bool: ...

class UIFont:
    Small: UIFont
    Medium: UIFont
    Large: UIFont
    Massive: UIFont
    MainMenu1: UIFont
    MainMenu2: UIFont
    Cred1: UIFont
    Cred2: UIFont
    NewSmall: UIFont
    NewMedium: UIFont
    NewLarge: UIFont
    Code: UIFont
    MediumNew: UIFont
    AutoNormSmall: UIFont
    AutoNormMedium: UIFont
    AutoNormLarge: UIFont
    Dialogue: UIFont
    Intro: UIFont
    Handwritten: UIFont
    DebugConsole: UIFont
    Title: UIFont
#

A .pyi file in the module path

#

It's so funny.

drifting ore
#

I only really care about performance here.

tight dirge
#

Technically I could port it to PZ. Just have to look up the hud library xd

red tiger
#

Nevermind that Jython gives access to LWJGL, a 3D rendering environment regardless of how PZ draws its isometry.

drifting ore
#

I mean some assets can be rougly converted to textures and basic models exist for most stuff.

tight dirge
#

It doesn't. It is actually for lols extension of my polygon library, which I used for prerenders anyway.

red tiger
#

Reminds me of when I sent TIS a utility class I wrote that gives Lua the ability to dynamically assign uniform values in GLSL shaders.

#

They rejected it however a shader interface for values would seriously be badass.

drifting ore
#

I feel like the hard part of game modding is the fact that you're modding someone else's game, not making your own. When you're the one making it, all of this is extremely trivial.

red tiger
#

I mean then there's DOTA.

tight dirge
#

I mean, total conversions are a thing. It depends how much the API is closer to something like Unity has, making the game essentially engine.

#

Which in PZ case, it is very tailored to PZ.

drifting ore
#

Oh boy the choice to use sprites over 3d models. $5 says the devs originally decided to use sprites because they thought it's gonna be easier to make assets and it'll render faster.

#

Well at least they eventually made the right call to switch to 3d models, at least for items and characters. Factorio devs decided to double down which caused them all sorts of issues, not the least of which is huge performance problems due to sprite overdraw.

#

Whoda thunketh if you gonna render 10x the amount of your fullscreen pixels each pass, you gonna run into bandwith limitations?

tight dirge
#

Depends. GPU rendering is frankly still new to me. Most of my rendering work was pretty much in software rendering where said performance limitations are even more obvious.

jolly epoch
#

my brothers, sisters and all my other siblings I am in need of help with my code, when the mod is enabled I cannot drive, craft or hotkey weapons if someone could spare some time to help me go over my code I'd appriciate 🙏

#

if you can spare some of your time to help me fix my code please dm me 😄

sour island
#

Just chalk it up as a lesson and move on.

unkempt anchor
#

hey guys

#

how do i make textures for modded cars

trim yacht
#

I am really struggling with getting a custom .pack and .tile to appear in the Brush menu. Following Dirks youtube tutorials, I created a custom pack that I placed in my mods texturepacks folder and tile properties I placed in the media folder. I can see them getting loaded in the logs, but when I enable Brush Manager, they aren't there. Any suggestions on how to debug this?

safe silo
#

Is it possible to run a check if the local OS' time/date is a weekend?

granite ginkgo
#

greetings, what to do if my car dosen't spawn on the map,im pretty sure i did the spawnlist correctly.

drifting ore
#

Note that tying gameplay mechanics to real time is mainly just needlessly frustrating because players don't usually have the free choice of when to play, or to not play.

#

Best case scenario you make people change OS clock which is needlessly annoying.

safe silo
drifting ore
#

I'm just saying that saturday and sunday specifically are not everyone's free days.

quick cape
#

rookie modder here
how hard is it to make whats essentially a crashing meteor event?

where you can find and collect the meteor if you get through the flames and undead the noise attracted

nimble badger
drifting ore
#

flames in general work kinda weirdly since they don't update outside of current cell, which is very small. So not only does it effectively prevents buildings on fire from burning down while you're not looking, it also prevents fire spreading. And of course the flames don't go out.

shrewd grove
#

looking to commission someone to help me code a car in ladder logic

nimble badger
frosty sinew
#

Hey I'm trying to add a necklace as my first clothing item in a mod and whenever I equip the necklace, I cannot see it and the console repeats this error
ModelInstanceRenderData.init> skinningData is Null, matrixPalette may be invalid
Does anyone know where I may look to fix that?

shadow willow
#

I never made clothing but did you try with an existing texture ?

frosty sinew
#

I haven't but I'm pretty sure the texture is setup correctly, since it works with the ground item
I think I need to export .x model from blender(I used an online converter) but I cannot find a working .x export addon for blender anywhere

shadow willow
#

I not a 3D guy so I may not help you with that but i saved this link one day idk if it could help

The Indie Stone Forums

Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...

drifting ore
#

hello

quick cape
sour island
#

Yabba dabba doo, I need a commission worked on, willing to pay using totally not suspicious Paypal friends and family. 👍

shadow willow
#

Hey, is there a way to reload a specific lua file while in game ?

#

Nevermind i missed the the relaod button in the lua debugger drunk

drifting ore
mellow frigate
sour island
#

Clearly, you cant complete my binary commission. I need a real professional. 😞

nimble badger
nimble badger
# sour island d

What type of comission can't u do friend? From what I understand you're the most skilled programmer here

red tiger
tough lodge
#

hey there!

#

i was wondering which channel i can post in to get help, i'm very new to modding

thick karma
#

You're in the right place

tough lodge
#

do i send the lua file or a screenshot?

thick karma
#

Probably both if you have an error you're trying to ask about

#

At least the screenshot

tough lodge
#

okay one sec

#

okay so i'm first trying it with crafting/disassembling

bright fog
#

What are you trying to do exactly ?

#

There's quite a few mistakes here

tough lodge
#

Display certain events over the player's mistake

bright fog
#

Seems like loads of confusion on how lua works

#

halo is a table here

tough lodge
#

I am pretty bad

drifting ore
bright fog
#

You're typing code to run in a table, which uh, can't be done like that

#

function ... doesn't run a function, function is used to define a function

#

(trying to guess what you are doing)

#

When is your code running ? What is item ?

tough lodge
tough lodge
bright fog
#

2016 oh god

#

Just look at other current mods on the workshop

#

That's how I learned lua and modding

#

Just look at mods that do something similar and reverse engineer how they work

tough lodge
#

Alright, I will start over

#

🫡

tough lodge
#

i got two mods that display info over a player's head, but i can't seem to find the right code that i want to use for crafting/disassembling /building, it's nowhere in the folder media

thick karma
grizzled fulcrum
grizzled fulcrum
snow citrus
#

Hello! im looking to hire a mod developer to make a mod for me, someone who has experience, if you could dm me your prices and other mods youv made that would be great!

snow citrus
quick cape
coarse sinew
muted kelp
#

How hard is it to make a mod to modify weapon stats for one existing weapon?

solar rover
#

Anyone know what I need to add to make the Z key work on modded vehicles?

bronze yoke
#

<@&671452400221159444>

drifting ore
thick karma
# tough lodge Display certain events over the player's mistake

Are you trying to say that you want to add text above the player's head when they are in different states? And you want something above their head that says "Crafting" when they're crafting, or "Disassembling" when they're disassembling, or "Building" when they're placing something on the ground?

thick karma
# tough lodge Exactly yes

you might need to decorate some of these...

  1. function ISPlace3DItemCursor:render(x, y, z, square)
  2. function ISBuildCursorMouse:render(x, y, z, square)
  3. ISDestroyCursor:render(x, y, z, square)
  4. ISBuildAction
  5. ISCraftAction
  6. ISDestroyStuffAction

I'm unaware of any fields that tell you when a player is crafting or disassembling or building at that moment, so decorating related actions might be the best hope

thick karma
#

Programming is not solved all at once. Gotta go step by step. If you want to draw a message over someone's head at all, you have to get that function to work first.

#

So in debug mode you should learn to use player:setHaloNote() before you try anything further imo

#

Your code is entirely dependent on using setHaloNote but even that command is not formed correctly

#

Which leads me to suspect you haven't explicitly tried it in console by itself.

#

I would launch PZ with the -debug launch option and learn to use the console to figure out how function calls should work before incorporating them into more complicated code.

tough lodge
#

require 'ISBaseObject'

-- Function to display text over the player's head
function showEventOverHead(player, eventText)
local playerObj = getPlayer(player)

if playerObj then
    local x = playerObj:getX()
    local y = playerObj:getY()
    local z = playerObj:getZ()

    -- Create a new WorldObject for the text
    local textObject = IsoText:new(eventText, x, y, z + 2)
    textObject:setFont("font_name") -- Replace with desired font
    textObject:setColor(1, 1, 1, 1) -- White color
    textObject:setVisible(true)
    textObject:setAlpha(1)
    textObject:setOwner(playerObj)
    getWorld():addObject(textObject)

    -- Optional: Remove text after some time
    Events.EveryOneMinute.Add(function()
        if textObject then
            textObject:setVisible(false) -- or remove it from the world
        end
    end)
end

end

-- Hook into the disassembly event
Events.OnDisassemble.Add(function(player, item, success)
if success then
showEventOverHead(player:getPlayerNum(), "Disassembling " .. item:getDisplayName())
end
end)

#

i got the help of a friend and ai and this is where it got me, it looks much cleaner

#

still doesn't work for some reason though

bronze yoke
#

because the ai just made all this shit up 😭

tough lodge
drifting ore
#

AI is a search engine for a search engine.

#

Google won't understand what you're looking for from regular human language.

#

ChatGPT will not produce true and correct outputs.

#

But you can ask chatgpt what are the relevant search keywords given your problem, and from there you can find real answers to your questions.

#

Sometimes AI will make perfectly right outputs. But there's no way to tell without double-checking all of it yourself. It's a broken clock kind of deal.

thick karma
#

It's just on that next level shit

drifting ore
#

The occurence rate of it in the wild has got to be almost exactly 0% right?

bronze yoke
#

i think it's just made the connection between zomboid and iso

drifting ore
#

The fact that it has no way to gauge its own factuality is really an issue.

#

Like, you and me can know if we're recalling something exactly or making a conjecture or outright making things up. The AI - cannot.

drifting ore
#

Well, it's not correct to imply that AI can recall something exactly or make it up. It's just a really advanced text autocomplete. Does autocomplete has the ability to know facts or make up fake information? No, it just autocompletes text.

#

And by the way calling ChatGPT "text autocomplete" is not at all reductionist. It's literally how it works. It looks at the chat log and suggests what's the next most likely words* are, and then a sampler algorithm picks one of the options. Rinse, repeat, one word at a time, until another algorithm decides that it's enough. Then it allows user to type. Depending on what system is running the AI, it can even type for you, the feature is usually called "impersonate". Especially if you let it impersonate you after having wrote a bunch, the autocomplete nature of AI becomes really obvious.

  • actually tokens. They're usually smaller than whole words but bigger than individual letters. But it's the same idea.

/ blog

fleet bridge
#

AI is just a statistically driven random text generator

#

if you want to add player text to actions, i'd suggest reviewing LogExtender which decorates a lot of vanilla functions for server logging purposes

#

you can use the same methods to add player text to certain actions

grizzled fulcrum
#

Does anyone know what the version of Java PZ was built with in development?

#

I can't tell if it's just the decompiler or if they're actually using Java 9, but some dependancies they use and code in general is deprecated from Java 9 and onward, and also all the case statements are weird like

case 1 -> return 1;
``` instead of 
```java
case 1 -> { return 1; }
wet sandal
#

Aren't those both valid?
Use Java 8 at work, and I think both of those are fine, as long as return val is all thats written.

grizzled fulcrum
#

Apparently not in Java 17 (game was released with a jre17 so I assumed that's what they built it with)

#

Because cases "can't have a statement as a rule"

#

"unexpected statement in case, expected is an expression, a block or a throw statement"

drifting ore
#

does the game saves zombies at all beyond x.y.z coordinate?

wet sandal
#

I forget the exact value, but you can force it

drifting ore
#

ok thanks i'll give it a try

wet sandal
#

isReanimatedPlayer() I think

grizzled fulcrum
#

I just used a regex pattern to convert all the switches to the middle one! easy peasy
pattern: (^\s*(case\s*[^\s]+|default))(\s*->)(\s*return.*$) replace $1:$4

wet sandal
#

Oh ok, I have never seen that for switch/cases

#

Glad you got it sorted though!

#

Doh, missed the case at the start of your original message. I focused on the -> and thought of lambdas, which is what I described. My bad.

drifting ore
#

decompiled code is not representative of original source code

#

it only produces what (ideally) compiles to identical jar

drifting ore
grizzled fulcrum
#

that's why I asked if anyone knew what java ver they used, because there's deprecated code in there from java 9 so I was just wondering if they chose to keep it that way or not

drifting ore
#

it's probably the old version

#

in software development in general it's best to pick a version and stick with it until the heat death of the universe

#

unless there's a critical bug that you cannot work around and new version fixes it

grizzled fulcrum
#

nvm I think it's actually a dependancy

#

so they can't really fix it like without meddling with the dependancy

grizzled fulcrum
#

Is there an already-defined way to compile the sources back into playable code? I've been trying to edit the sources for ages but there's all kinds of errors.

#

I can fix them all but it'll take quite some time and I think there has to be a better way

chrome zephyr
#

idk if theres any osrs fans in here but yall should make a mod and add some armour and weapons from it

#

abysall whip

true plinth
chilly flicker
#

hello.how do you guyes make mods . do i need to learn a programming language ?

drifting ore
#

If you just want to add items, no.

chilly flicker
shadow willow
red tiger
grizzled fulcrum
# red tiger compile against the source as a library.

I think it's too much effort to do what I wanted to. I ended up just using JProfiler and attaching it to the game's jvm, though with the results, I think I am too inexperienced to optimise anything myself, like with the lighting funcs that are exported from Lighting32.dll and Lighting64.dll, reversing them is a pain lol

shadow willow
#

<@&671452400221159444>

sour island
#

I feel like there's at least 1 of those a day now, lol.

red tiger
#

I don't see why not since they have no competition and it's only help not hurt the game.

rancid panther
#

i wanted to keep things simple and asked for help from mathmeticians

#

so this is probably what i'll use for my blackouts mod ramp up option when i get around to improving it

#

and i believe it has everything i really need

drifting ore
#

lerp(low, high, min(1, max(0, i)))

drifting ore
#

<@&671452400221159444>

late bolt
#

Thanks

drifting ore
#

Does anyone know exactly how fast zombies are walking, in tiles per second?

shadow willow
shadow willow
# drifting ore awesome, thanks!

I made a 15 tiles corridor, spawn some Z on one end and made some noise on the other. So they where walking toward the noise and not randomly wandering

rancid panther
# drifting ore asking mathematicians was a mistake 😂

i didnt tell them exactly how it was gonna be used and this isnt what they gave me. they helped me conceptually understand breaking down a graph into parts

can you explain what the thing is you sent below that tho? and how does it work

drifting ore
#

it does the same thing

#

lerp does the angled slope thing

#

min and max limit the slope edges (otherwise it's infinite)

#

i is the nondescript interpolation variable between 0 and 1. You can usually compute it as i = (x - start) / width

rancid panther
#

tbf at first i asked them for how to make a graph that was exponential until i realized it was impractical to go for that

drifting ore
#

it's all just the difference between mathematical and programming approach

rancid panther
#

also i did not know there was something like this! i have been asking around here for maybe a year occasionally seeing what is possible for my mod

drifting ore
#

well i don't know if PZ has built-in lerp function but Lua has min and max

rancid panther
#

if it doesnt, how would you go about it?

drifting ore
#

if not, lerp is just return min * i + max * (1-i)

#

or you can call them left and right since min and max are technically taken by system library functions

#

though lua has local variables superceding everything before them

rancid panther
#

ok

bronze yoke
#

it's math.min/max anyway

rancid panther
#

what is? lerp?

#

or the whole thing?

drifting ore
#

math.min and math.max are system defined. But as far as Lua is concerned they have nothing to do with plain min and max

rancid panther
#

my brain is breaking again

drifting ore
#

don't worry about it

#

local function lerp(left, right, i) return left * i + right * (1 - i) end

#

then when you need the curve you compute it with lerp(low, high, math.min(1, math.max(0, i)))

#

and you compute the I with i = (x - start) / width

sour island
#

IsoUtils has lerp and a number of other functions.

#

I'd suggest checking those before reinventing the wheel for math utilities.

rancid panther
#

ok thanks

#

i should not have checked this immeditately after waking up

drifting ore
#

but with kahlua it would be a valid question to ask which is faster - using lua function or call java function

bronze yoke
#

almost certainly the lua function

drifting ore
#

because it's kinda hard to tell if kahlua is so slow that even something so tiny is more computation-heavy than the overhead of interfacing with java

bronze yoke
#

no, the java overheard is massively significant

#

not in a 'kahlua isn't that slow' way but 'kahlua is even slower in another way' way

sour island
#

So using IsoUtils would be slower technically?

bronze yoke
#

most likely

drifting ore
#

I wouldn't make a statement on that without benchmarking

bronze yoke
#

even with a lua function 99% of the processing time is going to be just from function overhead though

sour island
#

due to Lua -> java -> Lua -- but aren't we talking about thousandths of a ms?

drifting ore
#

I mean even if I had a really good gauge on the performance of the subsystems, I'd only be 90% likely to be correct, cuz you never know

bronze yoke
#

when it comes to performance we're basically always talking about thousandths of a ms

#

when we were testing math.max we found that that's over 20 times slower than a lua implementation so it's quite significant for simple functions

drifting ore
bronze yoke
#

but we weren't comparing it to a lua function so that test doesn't represent a speed gain from lua functions over java functions, just raw lua over java functions, i personally suspect the gap between java and lua isn't as big as people generally say and it might just be functions in general

sour island
#

Which would make the issue that it's being called 1000 times per frame, I tend to not worry too much about optimizations unless it's noticeable to the human eye

drifting ore
bronze yoke
#

yeah

drifting ore
#

big oof

bronze yoke
#

math.max is *incredibly* slow

sour island
#

could one just overwrite the global math.max to a lua version?

bronze yoke
#

i don't know if that's really much faster

#

this is such a simple calculation that function overhead becomes proportionally quite significant

frank elbow
#

Isn't math.max (re-?)implemented in stdlib.lua for kahlua anyway

bronze yoke
#

it should be tested

#

oh fuck's sake it better not be

frank elbow
#

I think I remember seeing that & being like what the hell is this here for

bronze yoke
#

everything in that file runs like shit i have no idea what it's about

sour island
#

std

bronze yoke
#

it's also responsible for ipairs running so insanely badly

frank elbow
#

I honestly didn't even want to document the serialize function from that when I was making the kahlua stub

drifting ore
bronze yoke
#

(unless potentially the native ipairs was even worse, but pairs isn't nearly as bad so i doubt that)

frank elbow
#

Bad decisions were made

bronze yoke
#

pairs is fine

rancid panther
#

before you branch into another topic, i know next to nothing when it comes to coding. i really need a lot of help when it comes to understanding what im trying to do

sour island
#

good thing I avoid using ipairs out of habit 😅

drifting ore
drifting ore
bronze yoke
#

ipairs is pointless anyway, but it's nice that i have a stronger reason to tell people not to use it

frank elbow
#

Good thing we have next, right? Oh, wait

rancid panther
#

im not on my computer rn as i just woke up, so i just need to understand a few things

bronze yoke
#

pairs is sorta slow but at least it does something unique, ipairs is at best a numeric loop with overhead

drifting ore
#

is pairs better than having 2 flat tables for keys and values separately? lmao

#

jesus every day i learn something new about this trash fire

#

and of course the devs have no uregency to replace it with something of good quality because they write in java, not lua

frank elbow
#

I'm holding on (perhaps foolishly) to hope that it'll be replaced eventually

sour island
#

Half the player facing code is Lua though

frank elbow
#

I understand it's not urgent & that's fine but goodness

drifting ore
frank elbow
#

Microsoft PZ is a truly cursed thought and I'm glad we don't live in that timeline

drifting ore
#

IDK, Bedrock is doing pretty well. And FWIW Microsoft is the least pozzed of big tech companies.

frank elbow
#

I'm working on a team that is maintaining two separate versions of the same product (one is newer) and even maintaining parity in that can be a pain. Separate teams would be (read: is) worse

drifting ore
#

Oh yeah 100%. Bedrock and JE don't even have the 1:1 same gameplay

#

Anyway I think it's technically possible to mixin into PZ and swap out kahlua for an alternative implementation, perhaps have it glued to LuaJ. But that's a dog and a half.

shadow willow
#

Can someone give me some advice ? I'm trying to made some UI for my mod but i get an error each time i use my function. What is wrong with it ?

CODE: ||function _UITest() local infoText = "Hello world" local window = ISCollapsableWindow:new(100, 100, 300, 200) window.title = "window" window:addToUIManager() local richText = ISRichTextPanel:new(0, 16, window.width, window.height - 16) richText:setText(infoText) richText:addToUIManager() richText:paginate() window:addChild(richText) end||

LOG: ||ERROR: General , 1721418916060> ExceptionLogger.logException> Exception thrown java.lang.IllegalStateException at UIManager.update line:685. ERROR: General , 1721418916060> DebugLogStream.printException> Stack trace: java.lang.IllegalStateException at zombie.ui.UIManager.update(UIManager.java:685) at zombie.GameWindow.logic(GameWindow.java:262) at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71) at zombie.GameWindow.frameStep(GameWindow.java:765) at zombie.GameWindow.run_ez(GameWindow.java:681) at zombie.GameWindow.mainThread(GameWindow.java:495) at java.base/java.lang.Thread.run(Unknown Source)||

drifting ore
#

That would be the one Java mod that people would be glad to use.

sour island
frank elbow
#

The "illegal state" here is that it's handled by the UI manager (directly) but also has a parent

rancid panther
#

when using math for a function, is it better to make the calculation on its own function and call it when it is being used?

shadow willow
bronze yoke
red tiger
#

Well that was certainly a read..

#

What would be the ideal solution for Kahlua? Replacement? Which one?

sour island
#

Isn't it already customized/old/no longer supported?

red tiger
#

I would absolutely be the mad man that would try to implement a replacement interp for Kahlua.

bronze yoke
#

all three

sour island
#

yeah, so the ideal solution would probably be to get someone to go in and polish it up

#

doubt finding a new alternative would be less work

bronze yoke
#

i think it probably would be a lot easier to just replace it

sour island
#

not to mention breaking every mod/knowledge base

bronze yoke
#

it shouldn't break any mods or knowledge bases

red tiger
#

I've already done this in the past. The architecture of the LVM and Kahlua itself are dated.

bronze yoke
#

lua is lua

sour island
#

Oh you guys mean the actual interpreting, I thought you meant the whole API for some reason

#

replacing that would be a good manually installed mod right? better performance?

red tiger
#

Honestly the only argument TIS has that is valid for them to use Kahlua is that they already use it and the time spent working on replacement can be time better spent on content.

#

Business stuffs.

#

It's very likely discussed over time and is put in a back-log of post-release improvements.

sour island
#

The original author or capsid was aiming to make a more exposed LuaManager - although he really just wanted to make a java loader

#

but couldn't find anyone willing to write mods in java

red tiger
#

Hahaha

#

He didn't look far.

sour island
#

He was not pleasant

red tiger
#

His idea of solutions for players / new modders is unpleasant. Umbrella is a response to that.

sour island
#
  • making java mods would eliminate the whole steamworkshop aspect for the most part - which it's for better or for worse tied to PZ modding
bronze yoke
#

java mods can be hosted on the steam workshop fine

red tiger
sour island
#

I just meant the idea to manually install every mod would be a pita

bronze yoke
#

that's the idea of a mod loader though

red tiger
#

But yes if you want to stay in the Workshop realm and keep things comfy for modders and players alike then yes.

bronze yoke
#

manually install a mod loader that automatically loads java mods from the workshop

sour island
#

I think someone wrote a loader

#

but the capsid guy basically hated Lua and wanted to avoid it all together

red tiger
#

I designed and wrote a dynamic Jar plugin framework 10 years ago.

#

It's amazing how capsid never even contacted me.

#

Guess he either didn't know me or didn't like my work.

sour island
#

He would have probably found you threatening

sour island
#

he also jumped into modding with out actually playing the game or modding before

red tiger
#

Why tho????

#

hahahah what

sour island
#

idfk, basic mechanics had to be explained

bronze yoke
#

😧

sour island
#

he tried teaching me Java by force too

red tiger
#

That's so wild.

sour island
#

not a fun guy

red tiger
#

I'm just a silly man poking fun at a sandbox codebase.

bronze yoke
#

i've seen a couple people like that pop up but they unsurprisingly vanish pretty fast

red tiger
#

Who would want to learn Java? Do Kotlin or C#.

drifting ore
#

Java is fine. C# is kind of a worse version of Java.

sour island
#

very early on EHE, he tried making java test suites for vector2, but didn't understand what a vector was, I did research (googling) and tried to explain it to him, and he got upset he wasn't understanding. Said the changes to the test suite were 'wrong' and spent like 30 minutes walking me through gitbash commands to rename/merge commits. 🥲

#

The day I ditched him EHE made leaps and strides lol

bronze yoke
#

he didn't understand what a vector was...?

red tiger
sour island
#

Tried to explain that to him too, and he got really upset

#

Kept saying to just write the entire mod in java

#

But yeah, his capsid stuff is good lol

red tiger
#

I disagree but more on the concept and approach.

sour island
#

he is the author of pzStorm

red tiger
#

Yeah.

sour island
#

I don't even know what that is for, I guess a loader?

red tiger
#

I took a brief look at it. It's cool yeah but not something I'd call practical at scale.

sour island
#

he didn't even understand the workshop/mods folder formats

#

his first draft of capsid required to setup a workflow for each mod 🥲

red tiger
#

He sounds like someone who is incredibly talented however also weighed down by their idea of standards or what / what not to do.

#

Really sad to see so often.

sour island
#

Oh for sure - everything had to be planned dozens of times before you start typing

drifting ore
#

sounds like severe case of tism enhanced perfectionism

bronze yoke
#

capsid kind of drove me crazy back when people were still using that

#

the hoops you had to jump through to get it to work

sour island
#

Thank god for Konijima at the time

red tiger
sour island
#

That was another quirk of his - really really bad documentation/guides

bronze yoke
#

i'm guessing now it's such a pain because the java stuff was always the priority and the lua stuff was just tagged onto that reluctantly

red tiger
#

Don't need to compile your typings when you got the thing on a repo.

drifting ore
red tiger
#

For those who have the desire to dig deeper into things like what Capsid thought was a worthy journey that's what Candle is. Candle is literally my Capsid typings generator.

drifting ore
#

still waiting for a workshop-compatible addon that compiles scripts to native code instead of running them through a giant switch-case.

red tiger
#

Kahlua needs to be trashed.

#

That's like the only serious take I have in this convo.

drifting ore
#

don't get me wrong it's all really cool stuff with a lot of practical application, but it's kinda just a matter of personal preference, there isn't an objective winner there, if I were to switch from Lua to Python it would be a sidegrade. If Python support was as simple as clicking "subscribe" on the steam workshop page.

red tiger
#

Even checksums.

#

Even the file overloads.

drifting ore
#

I'm looking for a practical upgrade, not something that's more to my tastes. If there were a system that adds Rust scripting support to PZ in an extremely transparent fashion, I'd be willing to use even something as scripting-hostile (and in my baseless opinion - disgusting to look at) as Rust.

bronze yoke
#

you don't have to use it if it doesn't suit your needs

red tiger
#

You find what suits your needs.

#

It's better to have options.

#

Modding is the beating heart of supplying options when they canonically don't exist.

#

It was the same thing if not even more hardcore about this fact in 2003 when I started modding games. =)

#

Back when most mods were packaged in the same way as viruses attached themselves to PE's.

#

Was a lot of fun watching mod groups stress that their mod files weren't viruses.

drifting ore
#

Yeah IDK. As someone who got a modicum of economy & business higher education, I'm looking at this from perspective of finding patrons, not from perspective of selecting the language I like the most.

red tiger
#

:D

#

And maybe cook some silly projects in the meantime that sometimes people find useful.

drifting ore
#

Like I said, I think it's all pretty cool, but the way I see it, it either need to just work, or be the best thing since sliced bread.

#

Python in particular is kinda like Lua but different but also pretty much the same if you zoom out.

bronze yoke
#

it's not really the language that's important, it's integrated completely differently to how lua is

drifting ore
#

If you found a way to get it running just by clicking "subscribe" that would be legendary.

bronze yoke
#

it's more of an alternative to java modding than to lua modding

red tiger
#

I still think it's cool that something like this works:

from zombie.ui import UIManager, UIElement, UIFont #type: ignore
from zombie.core.fonts import AngelCodeFont # type: ignore
from com.asledgehammer import Jythoid #type: ignore

class PythonUIElement(UIElement):
    
    def renderText(self, x, y, font, text, red, green, blue, alpha):
        # type: (int, int, UIFont | AngelCodeFont, str, float, float, float, float) -> None
        if isinstance(font, UIFont):
            self.DrawText(font, text, x, y, red, green, blue, alpha)
        elif isinstance(font, AngelCodeFont):
            font.drawString(x, y, text, red, green, blue, alpha)

    def render(self):
        super(PythonUIElement, self).render()
        self.renderText(64, 64, UIFont.Cred1, "Hello, Python 2!", 1, 1, 1, 1)
    
    def isMouseOver(self):
        return super(PythonUIElement, self).isMouseOver()

# This allows for Kahlua to play with the object like a Java class
Jythoid.expose(PythonUIElement)

def mainmenu_enter():
    print('Adding Custom UI..')
    element = PythonUIElement()
    UIManager.AddUI(element)

Events['OnMainMenuEnter'].add(mainmenu_enter) # type: ignore
#

Even better that the expose method I made makes this something that can be indexed by Kahlua.

#

This compiles to a runtime class instance in the JVM unlike Kahlua which is even better.

drifting ore
#

it IS cool. Particularly the part where it compiles to JVM bytecode. But it runs the same problem as modloaders: people need to have it. If one extremely popular mod was using it, then this wouldn't be a problem. But there's basically no way Steam users would manually install anything for a trivial or unpopular mod.

frank elbow
#

This is an existing problem with Java mods

frank elbow
red tiger
#

It'll throw yellow warnings.

frank elbow
#

Gotcha, makes sense

red tiger
#

It's a non-source supply of typings which the interp extension Pylance considers a warning.

frank elbow
#

Calls for some .pyi generation I suppose

#

I supposed correctly 😄

bronze yoke
#

i hope pycharm likes those typings, they're not the ones i'm used to seeing and even the support for those is a little shakey at times

red tiger
#

Yes I call them .pyi files.

#

I put them in typings/ at the root atm.

red tiger
frank elbow
#

I'm used to the inline typing as well

#

Which is what the .pyi is using, so I'm assuming the above was just for reference/testing

bronze yoke
#

ah, i didn't inspect that

red tiger
#

Learned all of this in one week.

frank elbow
#

The fun thing about Python is that there are usually like 5 right ways

drifting ore
#

no that's Lua

frank elbow
#

Something something zen of python

drifting ore
#

in python there's THE PYTHONIC way

frank elbow
#

Oh, I misremembered apparently: "There should be one-- and preferably only one --obvious way to do it."

drifting ore
#

which usually looks like something bizarre to people who started off with C or pretty much anything else than Python

red tiger
#

there's le_snek and then there's the LE_SCREAMY_SNEK

drifting ore
#

you know like defining lists is done either by comprehension or by calling list() depending on what kind of data you're putting in it

#

i looked at hte canonical pythonisms once and decided to not bother with any of that

frank elbow
#

Yeah I used Python almost exclusively as a young teen & I didn't think at all about whether my code was "pythonic"

#

Usually more concerned with whether it was functioning correctly

#

The pythonistas would have my head

drifting ore
#

as far as C python goes, the correct way to use it is to use anything else (in the form of C libraries) except Python

#

numpy entered the chat, followed by 20 million other libs

bronze yoke
#

my initial learning was mostly python and i don't think i learned a single bit of pythonic practice, even accidentally

#

these days i force myself to be good and stick to snake case even though every part of me hates it

#

when writing python anyway

drifting ore
#

Eh it's just coding style. Sooner or later you stop caring about it. Like you eventually stop caring about desktop wallpaper and the condition of the downloads folder.

#

It's the architecture style that actively contributes to bad code maintainability that's hard to live past.

frank elbow
#

I'll have you know my Desktop and my downloads folder are pristine

drifting ore
#

I decided to take a screenshot and I had to minimise 5 fullscreen windows of various apps. Just so you have some idea about the way I might make use of the desktop.

bronze yoke
#

i see my desktop once when i turn on my computer

#

the state of it is of no consequence to me

drifting ore
#

the bottom screen is a tablet and it's turned off lol

frank elbow
#

I also rarely see mine but I just can't bring myself to allow icons to build up there

drifting ore
#

the whole reason there isn't more junk on my desktop is because wangblows 11 doesn't have desktop in quickbar so i can't easily select desktop files

#

well i guess i can just add it manually to custom quickbar

red tiger
#

I'm cursed because my first 10 years of coding experience is Java.

#

I'm Java-ic.

#

Moreso TypeScript-ic

drifting ore
#

Java is fine. It's a little more obtuse and less flexible than C++ but it's allright.

#

If your first 10 years were Javascript, then this might've been an issue.

red tiger
#

I don't think it's fine haha but that's me.

red tiger
#

I'd rather be using TS / JS right now for PZ.

#

I can back up that insanity (with more insanity)

drifting ore
#

If it ran in JIT then it would be OK. It's really needlessly complicated for the purposes of embedded scripting language API-wise. But for the end user it would be basically the same as using Lua.

red tiger
#

Oh man how I love me some object-orient'n.

#

Like an actual language-defined object framework.

drifting ore
#

JS objects are effectively the same as Lua objects though.

red tiger
#

Yes. JS ES5 is most-like Lua.

#

metatable vs prototype model.

drifting ore
#

the differences are pretty technical to the point that one needn't care

red tiger
#

I wrote code that shows that.

drifting ore
#

anyway if you so choose you can use classes in Lua, it works completely fine

drifting ore
#

it's a whole other subject that OOP has always been a meme and with years it only becomes more obvious, so why would you even do this?

shadow willow
#

is there an other way than getPlayer():getStats():setPain() to force a pain level ? I can't keep it to the value i want

drifting ore
#

particularly in the 90s it was such a huge meme that a language that entirely cannot function without classes was created

drifting ore
# red tiger

not you as a framework developer. Whoever uses it.

bronze yoke
#

typescript to lua transpiling is pretty popular

#

it makes sense for pz to have a solution for it

drifting ore
# red tiger

also if you want to use class objects, you shouldn't even be using functionality like "derive". There should only be "mixin".

frank elbow
red tiger
#

I've considered writing some code that "lifts" Lua to TypeScript.

shadow willow
frank elbow
shadow willow
frank elbow
#

Pain is from 0 to 100

#

So it's probably working, but adding very little (assuming severity is also 0-1)

red tiger
drifting ore
#

when I learned that some moodles use 0-1 scale and others use 0-100 scale I was like
B R U H

frank elbow
#

Always a joy to have to just remember which ones are 0-1

bronze yoke
#

i'm more bothered by the fake boredom

drifting ore
#

i get it that these were written by different people. But geez how hard could it be to follow the same data standard as the guy before you?

frank elbow
#

Impossible

drifting ore
#

NIH or bust

frank elbow
#

Code review is an art that is lost to time

shadow willow
#

and the math.min to 100

drifting ore
#

mistakes and misjudgements accumulate and nobody is allowed to speak up or they get fired for being disruptive

#

for context Artemis has you launch 6 starships to go to the moon, but Appollo did it in 1 launch, but that's with original musk performance figures (tm) which have been dialed back over time, so now it's more like 20 launches to go to the moon. Given the cost of the thing, it's just not gonna happen.

sour island
#

Review my code poppa

drifting ore
#
  • peppa
shadow willow
drifting ore
#

starship looked promising but it went so far south that the whole reason it stays afloat is NASA life support

#

i mean it looked promising to me. The good old grumpy briton thunderfoot thought it was junk from day 1.

frank elbow
shadow willow
#

A 5k tons rocket for a 10 tons payload to LEO is kinda absurd

drifting ore
frank elbow
#

That's probably best, since the overall pain considers those

#

Just need to make sure it won't stay the same during an update if you want the pain to stick

shadow willow
#

I didn't even think about that.

#

And it is way better since it should be focused on the belly

drifting ore
rancid panther
#

im stumped

frank elbow
#

Hi stumped

rancid panther
#

i dont understand how to use lerp at all even with your tips coldsteel

drifting ore
#

well what's your setup

#

what's the data that needs to have this curve in it?

rancid panther
#

i watched a video on youtube so i understand it is returning a value between the two numbers based on the distance marked between them

#

im gonna mark the same graph i posted before with labels of things that are needed

shadow willow
#

the curve of the lerp is the acceleration yours values will get toward their end point

drifting ore
#

if you set up lerp correctly, it will produce the exact results as were shown on your math plot

#

in fact if you take the equations in that plot and rearrange them, you get lerp

rancid panther
drifting ore
#

ok so

rancid panther
#

blue green and black are all values i need to be customizable

drifting ore
#

percent = lerp(start_percent, peak_percent, math.max(0, math.min(1, (current_day - start_day) / days_from_start_to_peak_blackout)))

rancid panther
#

if i wanted to print in debug to test with arbitrary numbers do i just put everything starting from 'lerp' in print()

drifting ore
#

also the start day is the blackout start day

rancid panther
#

and is this assuming i have a lerp function or is lerp inherent in the code

drifting ore
#

you need to have lerp defined yes. You can assign it from PZ java code, or you can use the one-liner function.

rancid panther
#

ok thanks, that helped a lot

drifting ore
#

you will need to somehow detect current day. It doesn't really matter as long as you use the same time units (days, minutes, millseconds, etc) in all three variables (current day, starting day, and days from start to peak)

rancid panther
#

i use getGameTime():getNightsSurvived()

drifting ore
#

that works (but i'm not entirely sure how it works though)

rancid panther
#

so when i print this lerp, what value is actually being pushed out?

drifting ore
#

value of % blackout for the current day

#

it will start at the start % value until the blackout start day, then it will gradually increase to peak % value as additional number of days from start to peak pass, and then it will stay at that value

rancid panther
#

it seems to be going down instead of up

drifting ore
#

you can just swap around the % variables

rancid panther
#

ah wait

#

i think the start day is the peak day

drifting ore
#

local function lerp(left, right, i) return left * (i-1) + right * i end

rancid panther
#

wait nvm again

#

im confusing myself

drifting ore
#

nah i just messed up the function definition when typing off the top of my head

rancid panther
#

ah ok

shadow willow
drifting ore
rancid panther
#

it's returning a negative of my minimum chance when i am before the start day

#

should i invert it somewhere in the function to fix that?

drifting ore
#

can you show your code? The relevant parts.

rancid panther
#

it's just in its own file rn for testing

drifting ore
#

gog danm it

#

there was another typo

rancid panther
#

lol

drifting ore
#

it should be 1 - i instead of i - 1

rancid panther
#

ah

#

i see

#

return left * (1 - i) + right * i here?

drifting ore
#

yeah

rancid panther
#

yep it works!

#

thanks!

drifting ore
#

dammit i hate it when my brain makes dumb mistakes like it's chatgpt

rancid panther
#

it's okay, you helped a lot!

drifting ore
#

(chatgpt would probably be unlikely to make this particular mistake)

rancid panther
#

the ramp up feature is something a lot of people have been wanting for a very long time and i kept giving up on it because i was not asking the right questions

#

only a week ago i started getting hints and realized i was going in the wrong direction

shadow willow
shadow willow
#

Too many mod enabled xD

rancid panther
#

it should be! but im trying to make the mod as natural and customizable as people expect it to be

#

right now the way blackouts peak is for it to roll twice when you are two weeks away from the full blackout

shadow willow
#

Well it seem to work since when i returned to PZ i played roughtly 100h without even realizing it was a mod

rancid panther
#

:D

#

i havent changed anything in a while. burryaga has been fixing things and cleaning up my amateur mess but we got it to a spot where it works well enough until i finally decide to add features

shadow willow
#

1st rule of programming: If it works, don't touch it

rancid panther
#

very true

#

until u realize it's something i wrote

#

🤣

shadow willow
#

i'm 10+ in today just because i delete something yesterday and now nothing work

rancid panther
#

F

#

i havent touched this mod (and game) in so long i need to reacquaint myself with everything

shadow willow
#

I'm a bit extreme, i wasn't satisfied with what i wrote, i decide to rewrite everything

#

two times xD

rancid panther
#

oof

#

i have done that with stuff before

shadow willow
#

and it barely work, i'm pulling my hair since this morning and it's 2AM now

rancid panther
#

especially with base building games

#

i always end up resetting from scratch

shadow willow
#

I'm trying to add food intolerances and allergies to the game. I have a system that work well for the food stuff but i I can't get any symptoms to work properly.

rancid panther
#

ah, i cant help since i dont know much myself

#

good luck tho!

#

have you already looked at other mods and seen their approach?

shadow willow
#

when I will finally figure out how to apply pain consistently, everything will be fine

rancid panther
#

gl!

shadow willow
#

Yeah, But I hadn't done lua for 10+ years so I no longer understood anything. And I tried to jump right back into it lol

rancid panther
#

the blackout start and end functions are the most important functions in this mod, so i really dont wanna mess anything up here

#

(ofc have a backup)

shadow willow
#

I should make a commit before messing it up another time

teal slate
#

Can you make zombies engage in player animations? I watched Land of the Dead, 100% completed Lab of the Dead, and am about to watch Day of the Dead, so I'm really interested in the idea of a mod incorporating ideas from that—researching, training, etc. zombies.

bright fog
#

Wdym by engage in player animations ?

teal slate
#

Like reloading a gun, for example.

sour island
#
function itemFields.getFieldAssociatedFunctions(item)

    local fields

    local movable = instanceof(item, "Moveable") and item
    if movable then
        fields = fields or {}
        fields.worldSprite = "setWorldSprite"
        fields.isLight = "setLight"
        fields.usesBattery = "setLightUseBattery"
        fields.hasBattery = "setLightHasBattery"
        fields.lightBulb = "setLightBulbItem"
        fields.lightPower = "setLightPower"
        fields.lightDelta = "setLightDelta"
        fields.lightR = "setLightR"
        fields.lightG = "setLightG"
        fields.lightB = "setLightB"
    end

    return fields
end
        local fieldFunc = itemFields.getFieldAssociatedFunctions(item)

        for field,func in pairs(fieldFunc) do
            local value = fields[field]
            local associatedFunc = item[func]
            if associatedFunc and value then
                item[associatedFunc](item, value)
            end
        end
#

Would item[associatedFunc](item, value) be equal to item.associatedFunc(item, value)?

#

assuming I can't recreate : using inline text macros 🤔

#

Looking into upgrading my shops mod to account for some item's having cosmetic fields