#mod_development

1 messages · Page 256 of 1

drifting ore
#

there's never a scenario in which you should override the entire function and not simply undo undesired effects and pass through

#

reasons: it can break the game, sometimes in very subtle ways that are virtually impossible to predict, and because it destroys mod compatibility

bright fog
#

It sure will make your mod incompatible with other mods that do it

#

But there are uses to it

#

Such as overwriting the main menu visuals to make your own

drifting ore
#

besides fixing core game bugs i can't think of an example that needs overriding vs decorating

bronze yoke
#

also in some cases undoing undesired effects is literally not possible

drifting ore
#

i read it, did not convince me

bright fog
#

Yet it's a use case, idk wtf you want more

#

10YL does it with their launcher addon

#

I can most likely find quite a few other examples that do it

bronze yoke
#

sometimes your override is so significant that mod compatiblity isn't something worth thinking about anymore

bright fog
#

And for legit reasons

bronze yoke
#

in the main menu example, how is a mod going to stay compatible with that just because you didn't delete their hook

drifting ore
bright fog
#

It's fine a mod being incompatible with another one, as long as they clearly state it that other mods doing something with that specific thing might break

bronze yoke
#

it's better to just save yourself the complexity and performance overhead and hard overwrite

bright fog
#

Sometimes you have to overwrite everything, that's it

drifting ore
#

i have a concrete example. One guy made a mod that fixes spear repair counter resetting every time you craft and reset spears.

bright fog
#

For what you're trying to achieve

drifting ore
#

That mod had incompatibility with a lot of cool stuff such as SOMW and Weapon Stats

#

purely for the single reason of overwriting the function instead of decorating it

bronze yoke
#

yes, hard overwrites are bad ever

#

that's not what we were disagreeing about

drifting ore
#

well what I did is re-wrote it to use a decorator instead of overwriting

bright fog
drifting ore
#

and it worked

#

so there was no reason to overwrite that function in the first place

#

and of course my mod did not had such compatibility issues

bright fog
#

And it's okay if you know what you are doing and CLEARLY state that your mod overides a specific function

bronze yoke
#

nobody is saying you should always or even usually use hard overwrites

bright fog
drifting ore
#

how about this

#

the blanket advice against overwriting is like the blanket advice against using GOTO

bright fog
#

I literally never said that you shouldn't do decorations: YOU SHOULD
But if what you are trying to achieve requires a full rewrite, do it, as long as you clearly state it in your mod page, that is not a problem

drifting ore
#

if you really know what you're doing then it's fine as long as you do it properly

#

but otherwise it should be avoided

bright fog
#

Yeah it should, I never said the contrary but if it's the only way: do it

#

If you had read my messages since the start, you would have understood I was never against avoiding an overwrite

#

But if what you are trying to achieve requires a full rewrite, do it

#

as long as you clearly state it in your mod page, that is not a problem

drifting ore
#

don't put that in bold caps please, some newbie coder might be reading it

#

and in their mind a minor addition ot base function = requires full override

bright fog
#

I literally don't give a shit, I've stated 10 times in this conversation that you should do it if you know what you are doing AND you can only use that

drifting ore
#

but we can agree that we shold help foster environment where mods are compatible, right?

#

so my opinion is that the default advice on the matter should be: do decorate, don't override

bronze yoke
#

that is the default advice

bright fog
#

Has always been

drifting ore
#

great!

I suppose this entire argument hten is just a case of miscommunication again, but this time on my side. The way you said it made it sound to me like "as long as you state that it makes your mod incompatible it's cool to override whatever you want" but that's just how I saw it, seems like it was a warped view of what you meant.

bright fog
alpine scroll
#

I'll try this decoration thing to change it. All I wanted to do is to make the dict being used by the function to include the other items from the mod

#

In True Actions v3 - Dancing, there are collectibles you get from the cereal, and they are numbered as (01 of 30) , (02 of 30) etc. However, while there are 30 items, the recipe only has 26 of those in the dictionary called by the function. So I was overwriting it to add a complete dictionary instead

#

But yea, it didnt work when I tried overwriting it. Maybe because its a recipe thing? Dunno

#

I'll see if doing decoration works

unreal pewter
#

for some reason, no loot is spawning in these containers

#

ive tried regenerating the loot in these over and over but nothing works

alpine scroll
#

Have they being grabbed and replaced by players?

unreal pewter
#

no im testing this singleplayer in my map, sorry should have stated that

#

ive messed a little with loot pools, such as adding books and magazines and stuff, but all of that stuff is encased in the same function, which correctly puts loot into other containers and stuff

#

and i didnt even touch wardrobes at all, so

#

not sure whats wrong there

tall moss
#

I got a question, figured this might be the appropriate channel for it: how hard would it be to create a mod that is a script that replaces items of two specific categories with a singular specific item? It would be a gag mod for a running private joke I have with mates who also play this game.

alpine scroll
tall moss
#

As a hypothetical, yes

alpine scroll
#

You would have to set a trigger, one of the OnEvents things, and make a function that would check the inventory of the player, remove the item if found, and then add a new item

#

Dont think it would be that hard

#

On one of the Expanded helicopter mods, there is a zombie that eats your socks. So it is an example of how to remove something from a player

tall moss
#

For real? That's awesome xD

#

I'll have to look into it. Thanks.

#

And for clarity, friend of mine has put us in harms way trying to open a can of chilli, while he was driving! So now I seek to replace every spawned non-perishables and perishables with just chilli cans. Load up a game and just enjoy his reaction.

#

Almost crashed the car and killed us all...

alpine scroll
#

Just add a check to not replace the chilli cans itself

#

Otherwise it will remove itself and add itself back

bronze yoke
#

you can swap it OnFillContainer, that should be simpler and not have that issue

alpine scroll
#

Needless processing

tall moss
#

Yeah I assumed that would create a nasty feedback loop

drifting ore
alpine scroll
drifting ore
#

what do you mean exactly? recipe is a PZ item script normally

#

i.e. it has nothing to do with lua

alpine scroll
#
    player:getInventory():AddItem(DifficultDanceBook[ZombRand(#DifficultDanceBook)+1]);
end``` this is in the original, after a table with 26 entries (instead of 30)
bronze yoke
#

most recipes use lua functions to implement more advanced functionality

alpine scroll
#

Because a closed Kosmotsars generate an open kosmotsars + a dance card]

drifting ore
#

oh i see

#

in this case you need to modify DifficultDanceBook table, not the funciton

alpine scroll
#

Yea, but its local

drifting ore
#

rats

alpine scroll
#

Thats why I was trying to overwrite everything

#

It would be easier if it wasnt local

#

And simply copying the function and adding to a new mod breaks the +dancecard function

drifting ore
#

i don't really see how making an exact duplicate but which uses a different table would break it

alpine scroll
#

Ok, not an exact duplicate

#

I am trying just to replace the .lua that has a problem, not upload another version of the mod itself

#

So my version, on itself, will not work

#

It would require the original to apply the fix

drifting ore
#

You probably should upload that as a fix, or submit it to the original author.

alpine scroll
#

I did comment on the mod

drifting ore
#

Writing that directly in the workshop mod folder is liable to get removed when anything updates.

bronze yoke
#

can we see your code? we can't really know why it doesn't work otherwise

alpine scroll
#

Of course. First the original:

#
"TAD.BobTA_Afoxe_Samba_Raggae_card", 
"TAD.BobTA_Belly_Dancing_One_card", 
"TAD.BobTA_Belly_Dancing_Three_card", 
"TAD.BobTA_Belly_Dancing_Two_card", 
"TAD.BobTA_Boogaloo_card", 
"TAD.BobTA_Charleston_card", 
"TAD.BobTA_Gandy_card", 
"TAD.BobTA_House_Dancing_card", 
"TAD.BobTA_Locking_card", 
"TAD.BobTA_Robot_One_card", 
"TAD.BobTA_Robot_Two_card", 
"TAD.BobTA_Salsa_Two_card", 
"TAD.BobTA_Samba_Olodum_card", 
"TAD.BobTA_Samba_Pagode_card", 
"TAD.BobTA_Slide_Step_card", 
"TAD.BobTA_Snake_card", 
"TAD.BobTA_Tut_One_card", 
"TAD.BobTA_Tut_Two_card", 
"TAD.BobTA_Wave_One_card", 
"TAD.BobTA_Wave_Two_card", 
"TAD.BobTA_Rick_Dancing_card", 
"TAD.BobTA_Moonwalk_Two_card", 
"TAD.BobTA_Northern_Soul_Spin_and_Floor_Work_card", 
"TAD.BobTA_Northern_Soul_Spin_Dip_and_Splits_card", 
"TAD.BobTA_Breakdance_1990_card", "TAD.BobTA_Breakdance_Freezes_Combo_card",
}


function Recipe.OnCreate.OpenKosmotsars(items, result, player)
    player:getInventory():AddItem(DifficultDanceBook[ZombRand(#DifficultDanceBook)+1]);
end```
#

Now mine:

#
"TAD.BobTA_Afoxe_Samba_Raggae_card", 
"TAD.BobTA_Belly_Dancing_One_card", 
"TAD.BobTA_Belly_Dancing_Three_card", 
"TAD.BobTA_Belly_Dancing_Two_card", 
"TAD.BobTA_Boogaloo_card", 
"TAD.BobTA_Charleston_card", 
"TAD.BobTA_Gandy_card", 
"TAD.BobTA_House_Dancing_card", 
"TAD.BobTA_Locking_card", 
"TAD.BobTA_Robot_One_card", 
"TAD.BobTA_Robot_Two_card", 
"TAD.BobTA_Salsa_Two_card", 
"TAD.BobTA_Samba_Olodum_card", 
"TAD.BobTA_Samba_Pagode_card", 
"TAD.BobTA_Slide_Step_card", 
"TAD.BobTA_Snake_card", 
"TAD.BobTA_Tut_One_card", 
"TAD.BobTA_Tut_Two_card", 
"TAD.BobTA_Wave_One_card", 
"TAD.BobTA_Wave_Two_card", 
"TAD.BobTA_Rick_Dancing_card", 
"TAD.BobTA_Moonwalk_Two_card", 
"TAD.BobTA_Northern_Soul_Spin_and_Floor_Work_card", 
"TAD.BobTA_Northern_Soul_Spin_Dip_and_Splits_card", 
"TAD.BobTA_Breakdance_1990_card", 
"TAD.BobTA_Breakdance_Freezes_Combo_card",
"TAD.BobTA_Thriller_One_card",
"TAD.BobTA_Thriller_Two_card",
"TAD.BobTA_Thriller_Three_card",
"TAD.BobTA_Thriller_Four_card",
}


function Recipe.OnCreate.OpenKosmotsars(items, result, player)
    player:getInventory():AddItem(DifficultDanceBook[ZombRand(#DifficultDanceBook)+1]);
end```
#

And the structure

drifting ore
#

do you replace the contents of the original file, or is this a different file, or is it in a different folder but under the same name as the original?

alpine scroll
#

This is a new file

#

A new mod

#

I want my mod to be complementary to this mod

drifting ore
#

i think the issue is that it's called "recipecode.lua"

#

it overrides the entire vanilla file

alpine scroll
#

There is a vanilla file that is called recipecode.lua?

drifting ore
#

yeah

bronze yoke
#

that would actually cause the opposite issue but yeah you really need to use unique filepaths

alpine scroll
#

I dont think that it is that, but sure, I'll change the filename

#

Because the recipe of making a closed cereal becoming an open cereal still works

drifting ore
alpine scroll
#

I'll do it anyway, just because I honestly dont know what else could be

bronze yoke
#

they're replacing a mod's function

#

the wrong filepath would break most of the recipes in the game but not the one it's changing

alpine scroll
#

Btw, I'll change my code to this: ```local oldfunction = Recipe.OnCreate.OpenKosmotsars
local DifficulTADnceBook = {
"TAD.BobTA_Afoxe_Samba_Raggae_card",
"TAD.BobTA_Belly_Dancing_One_card",
"TAD.BobTA_Belly_Dancing_Three_card",
"TAD.BobTA_Belly_Dancing_Two_card",
"TAD.BobTA_Boogaloo_card",
"TAD.BobTA_Charleston_card",
"TAD.BobTA_Gandy_card",
"TAD.BobTA_House_Dancing_card",
"TAD.BobTA_Locking_card",
"TAD.BobTA_Robot_One_card",
"TAD.BobTA_Robot_Two_card",
"TAD.BobTA_Salsa_Two_card",
"TAD.BobTA_Samba_Olodum_card",
"TAD.BobTA_Samba_Pagode_card",
"TAD.BobTA_Slide_Step_card",
"TAD.BobTA_Snake_card",
"TAD.BobTA_Tut_One_card",
"TAD.BobTA_Tut_Two_card",
"TAD.BobTA_Wave_One_card",
"TAD.BobTA_Wave_Two_card",
"TAD.BobTA_Rick_Dancing_card",
"TAD.BobTA_Moonwalk_Two_card",
"TAD.BobTA_Northern_Soul_Spin_and_Floor_Work_card",
"TAD.BobTA_Northern_Soul_Spin_Dip_and_Splits_card",
"TAD.BobTA_Breakdance_1990_card",
"TAD.BobTA_Breakdance_Freezes_Combo_card",
"TAD.BobTA_Thriller_One_card",
"TAD.BobTA_Thriller_Two_card",
"TAD.BobTA_Thriller_Three_card",
"TAD.BobTA_Thriller_Four_card",
}

function Recipe.OnCreate.OpenKosmotsars(items, result, player)
dancecard = DifficulTADnceBook[ZombRand(#DifficulTADnceBook)+1]
print("DANCE BOOK" .. dancecard)
player:getInventory():AddItem(dancecard);
return oldfunction
end```

#

To decorate it and to find it on the console in case it errors

drifting ore
#

in this case decoration isn't really useful

alpine scroll
#

Well then. I'll remove it so its not bloating the code

drifting ore
#

anyway just try your original approach, but give your file a unique name

#

i mean consider the "require" command

#

if you have multiple files called "recipecode.lua" which one is required? because only one is required

#

the game doesn't know which to choose, so it's more or less random. Which causes issues one way or another.

bronze yoke
#

it's not random

alpine scroll
#

I think I'll need to add a new recipe and override it on recipes too

bronze yoke
#

that's not how the game loads lua files

drifting ore
#

i mean yea sure it's not random, it's deterministic

bronze yoke
#

if multiple names have the same filepath the one in the mod latest in the load order is the only one that is loaded

drifting ore
#

from modders' perspective it's as good as random

#

you as a modder can't control what mods are installed and what's the load order

bronze yoke
#

if it's specifically recipecode.lua or any other vanilla file require is meaningless anyway

#

you should require the original mod's file that defines this function to ensure your file never loads before it, but if your file is breaking the original that probably isn't the cause of the problem you're having

#

the load order of lua files is (mostly) alphabetical so load order isn't too unpredictable

#

'load order' here being unrelated to mod load order, which apart from resolving file conflicts like that doesn't really do anything

alpine scroll
#

I am testing on a multiplayer server, so it requires a server restart to get the lastest version from the workshop

#

So thats why its taking so ling

#

Long/

drifting ore
#

you can set up a local mod, it doesn't even requires game restart, just lua reload

bronze yoke
#

you should just test locally, this won't behave differently in multiplayer and it's quite literally a hundred times faster

drifting ore
#

wait what are we even saying lmao

#

the same mechanism that allows you to publish mods to workshop, allows you to play these very mods locally

#

so just unsub from your workshop mod and enable it as local

alpine scroll
#

I mean, I play on a dedicated server that I host myself on my computer

drifting ore
#

same deal

#

wait no, only if you play through the normal game using "host" option

#

or is it? i'm not so sure

alpine scroll
#

Oh no, its a separate instance

#

Like the dedicated server thing

drifting ore
#

is it even at all different form hosting from a normal game?

alpine scroll
#

It MAY have an option to easy reload

#

But well

#

Connecting here

bronze yoke
#

test in singleplayer, servers take an insane amount of time to start up, if you're worried about it not working in multiplayer test it in a server after you've got it working

alpine scroll
#

Also, I'll check the console.txt

#

See if it has any problem

bronze yoke
#

however this is code that runs on the client (despite being in the server folder) so it doesn't usually behave differently in multiplayer

alpine scroll
drifting ore
#

the differences are usually down to certain functions not triggering gamestate sycnrhonization so you need to do it manually

bronze yoke
#

mine take a lot longer than that and singleplayer takes about five seconds

alpine scroll
#

So

#

The good news is that somehow now its working?

#

The bad news is that I have two recipes

#

So possibly the reason was the recipecode.lua

drifting ore
#

how come you have 2 recipes though

alpine scroll
#

I had another file

drifting ore
#

do you also carry a bunch of files that define identical recipes?

alpine scroll
#

That I tried to do the override thing

drifting ore
#

as a fix your mod only needs the fixed files, you need to delete everythign else

alpine scroll
#

This

#

Yea

#

I'll delete this

#

Btw, changing the subject a bit

#

Do any of you know a way to load a table that exists in the save file, to alter its contents?

#

Mod wise

#

Because I would like to be able to clear the Home Tapes table from time to time

#

So it can spawn again

drifting ore
#

you need loot respawn to be enabled

alpine scroll
#

Oh no

#

Not that

#

The respawn is on

#

HOWEVER

drifting ore
#

otherwise even if you change anything, then only newly spawned containers will have the items

alpine scroll
#

The home tapes are hard coded inside the game

#

So once they spawn, the ID get stored in a table

bronze yoke
#

use ModData

alpine scroll
#

And never again spawn

#

ModData even tho its not from a mod?

bronze yoke
#

moddata isj ust tables to store whatever you want in

drifting ore
#

moddata is a lua table that can store anything

bronze yoke
#
local modData
Events.OnInitGlobalModData.Add(function()
    modData = ModData.getOrCreate("MyUniqueKey")
end)
alpine scroll
#

As long as I know the key, I can read and edit it, right?

bronze yoke
#

oh you want to edit an internal list that already exists

#

you'll have to go find out how that system actually works, that system is half java so it might use moddata or it might use something else that may or may not actually be reachable

alpine scroll
#

Here

#

So its stored inside a homeVhsSpawned array when its spawned, otherwise it ignores and doesnt spawn it anymore

#

Also, my code didnt work

#

god dammit

alpine scroll
#

Im seriously considering just adding a translation file to make it (1 of 26) instead of (1 of 30)

#

GOD DAMMIT IT WORKED NOW

#

@bronze yoke Thanks for mentioning that lua loads in ALPHABETICAL ORDER

#

God dammit

#

Why bother to have a mod variable in servertest.ini if its not being respected

bronze yoke
#

yeah, mod load order does very little - a lot of people are really superstitious about it, changing it will rarely resolve issues

drifting ore
#

it fixes issues caused by load order. Most mods are built in a way that it doesn't matter. But for fix mods, it does.

#

fix mods need to always load after the original

bronze yoke
#

only if they have to override a file, usually they don't

drifting ore
#

or a function

#

otherwise you create a function and then the original overrides your fix with the broken one

bronze yoke
#

mod load order does not affect the order in which lua files load

drifting ore
#

doesn't it? what does it do then?

bronze yoke
#

it resolves filename conflicts

#

there's some special handling for maps too

alpine scroll
#

So, my problems were not the fact that I did something wrong. My idea was right at the first iteration. However my 1st mistake was naming it recipecode.lua and the second mistake having a name that was alphabetically before the one I wanted to change

ancient grail
alpine scroll
#

Nothing with the code itself, I mean.

drifting ore
#

well for my mod which need to decorate functions I resolved the issue by using require which forces lua load order

bronze yoke
#

if you begin your file with require "TheOriginalFile" that file will be forced to load before your one regardless

alpine scroll
#

I'll keep that in mind

#

I'm just happy that I'll be able to finish my dance card collection

bronze yoke
#

even if a file uses only locals, locals need to either call external functions to do anything or are triggered by them, so you can just cut them off from doing anything at those points

alpine scroll
#

Works

#

Finally

#

I added the original mod as a requirement

drifting ore
#

now you just need to make edit the original mod's picture by pasting "FIXED" on top of it, and upload it to steam

#

maybe add a small picture that shows something like (1 of 26) => (1 of 30)

#

but what's the original mod's developer standing in this? do they not want to fix it or something?

#

i mean i can see how this can be an intentional jab at cereal gacha prizes where the cool rare ones straight up don't exist

bronze yoke
#

iirc not much has been heard from them for a bit over a year

drifting ore
#

well if it's abandonware then you can straight up reupload the entire thing with fixes and take over as the maintainer this way

#

since this is a modding scene i will completely neglect the IP aspect of it

#

(in a gamedev scene it's a quick way to lose your life savings) (but here in the modding scene, where this mod violated a lot of copyrights in the first place, it's moot to even discuss anything)

bronze yoke
#

you're thinking of true music

drifting ore
#

pretty sure "Kosmostars" flakes is a protected trademark and all associated imagery are protected by copyrights

#

and yet here we are. See this is modding not gamedev, aspects like this wholly don't matter. Worst thing that can happen is that Nintendo thinks your Mario Amiibo mod infringes on their property and issue a C&D to you.

bronze yoke
#

is it not parody

drifting ore
#

well i'm not joking either

bronze yoke
#

huh?

drifting ore
#

uh what

bronze yoke
#

'is it not parody' referring to the kosmotsar pun

drifting ore
#

nope, that's how it's spelled on the box

bronze yoke
#

no, it's spelled kosmostars on the box

drifting ore
#

I'm not a lawyer so i can't tell if this razor thin margin passes as fair use or is a copyright infringement. But also like I said this matter is not even relevant here.

hollow lodge
#

I just updated my More Jackets mod and I was curious if you guys can propose outfits suggestions to spawn on zomboids. I know it's a very common piece of clothing but I suck at fashion, any feedback is welcome

grizzled fulcrum
drifting ore
#

yeah if it's MIT or BSD or GPL then it's even completely fine to do this

grizzled fulcrum
#

the original mod is under gplv3 like my mods so it works well

drifting ore
#

Here I recall the lamentations of people who made Lugaru (if I recall this correctly) for people reuploading their game. I don't know if they actually lost any profits because of it - seems like the same exact deal as with regular piracy, except it's technically not illegal.

#

In any case, charging people for complete binaries of otherwise open source project is a common monetization strategy for FOSS software.

#

Also software licenses don't cover game assets.

grizzled fulcrum
#

I think it is reasonable

drifting ore
#

It's 100% reasonable. Most of the time people reupload FOSS projects is either as a fork or because the original was abandoned.

prisma wren
#

how does one spawn modded items in the lua scripts?

#

i was thinking that the last stand accumulator scenario would be cool with some modded weapons

#

looking at the code it uses like

#

"Base.Shotgun"

#

would it instead be like "amodsID.aWeaponsId"

#
    self:createItemButton(16, y, "Base.Shotgun", 500)
    self:createItemButton(120, y, "Base.ShotgunShells", 90)

what do the numbers mean here as well? height and width?

bronze yoke
#

the first line of a script file will name the module

#

usually it's supposed to be something like the mod id but a lot of modders just throw things in base

prisma wren
#

how should i go about figuring out what to use

#

i was thinking of adding the last of guns remastered weapons

astral geode
#

Can I set a sandbox option to only be visible in debug mode ?

grizzled fulcrum
#

I don't know about that, but why would you need to do it anyway?

astral geode
#

For testing so I can have my mod load separate values that make debugging easier but wouldn't be balanced at all for actual gameplay

#

Would prefer to hide the option from most people

grizzled fulcrum
#

If you are going to end up using those separate values to make debugging easier, and no single player in prod is going to use them (since it's debug only) then you might as well just load them as is.

limber onyx
#

Hi guys. Sorry to intrude. Need some help figuring out a problem I'm having with a mod.
I got Inventory Tetris and recently installed some compatibility patches and made some changes of my own in debug mode that changes the stack limit and grid value of various items and containers.

For some reason, these changes only seem to take effect as long as I'm playing with debug mode. The moment I disable Debug from the game properties, the modifications to the items are gone.

What puzzles me is that most of the changes are made by mods, even if I'm screwing up with placing the lua file with my own manual modifications, I don't see why the changes made by mods should stop working as well. Help please

drifting ore
#

What debug functions do you use in your code?

limber onyx
#

The tetris mod has a buit in editor that exports a lua file that you must save into your mods folders, let me fetch it, just a sec

drifting ore
#

do you mean inventory tetris' own debug mode?

#

and not PZ -debug mode?

limber onyx
#

Both. In order to use the one from Tetris, I must be using -debug to have the option to edit the items.

#

It occurred to me that maybe I'm not placing the exported file where it needs to be, but then the modifications made by other patches i subscribed from the workshop should work, and they don't unless I have -debug activated

drifting ore
#

it could be filename clash issue

#

apparently it's OK to have identically named PZ scripts but identically named Lua scripts in different folders is generally not allowed

bronze yoke
#

huh?

#

identically named scripts is bad

limber onyx
#

``
Events.OnGameBoot.Add(function()

local itemPack = {
    ["Base.Hat_SurgicalMask_Blue"] = {
        ["height"] = 1,
        ["width"] = 1,
        ["maxStackSize"] = 5,
    },
    ["Base.Hat_SurgicalMask_Green"] = {
        ["height"] = 1,
        ["width"] = 1,
        ["maxStackSize"] = 5,
    },
    ["Base.Bowl"] = {
        ["height"] = 1,
        ["width"] = 1,
        ["maxStackSize"] = 4,
    },
}
TetrisItemData.registerItemDefinitions(itemPack)
TetrisContainerData.registerContainerDefinitions(containerPack)

end)
``

drifting ore
#

they stack rather than override each other

bronze yoke
#

one of the most commoni ssues people come here with is making an items.txt or a recipes.txt and deleting the entire game

drifting ore
#

huh, in my mod i've got items.txt living happily and not messing anything up

limber onyx
#

Actually, I was trying to fix some items manually, since the patch i subscribed to didn't seem to work

bronze yoke
#

it also sounds like something they would absolutely not do deliberately but otherwise i have no clue 😅

drifting ore
#

yeah debug mode itself doesn't really change any behaviors (from what I can tell) it only activates Lua debugger and a bunch of editors/spawners

limber onyx
#

I play witht he SUSCEPTIBLE mod that makes you get sick from the airborne Knox infection

This mod includes some Surgical Masks and Surgical Mask Boxes

When you play with Tetris and open a box, 50 of them pop out and cannot be stacked
So I subscribed to a "Tetris ALL MODS" patch that claimed to fix this since Susceptible was included in their supported mod list

When i went to play, the same happens. Box opens and you get 50 individual masks taking up all the grid space

drifting ore
#

do tetris fix modpage says anything about debug mode? what do people say in comments?

#

having mods straight up broken is par for the course and you can't assume that everything is functioning as claimed

limber onyx
#

They say that when you modify any item stats with their editor, it exports a lua file that you must then manually turn into a mod installed in your machine locally or uploaded to the workshop.

drifting ore
#

ok well where did you put it?

#

paste the filepath

limber onyx
#

ok

#

\Zomboid\mods\Inventory Tetris - Susceptible Patch\media\lua\client\InventoryTetris\TetrisDataPack_susceptiblemasks.lua

drifting ore
#

the entire path please, down to the lua file

#

that looks correct though i'm not positive
in order to upload that to workshop it needs to be in /Zomboid/Workshop/MODNAME/Contents/mods/MODNAME(s)/media...

#

just to be sure do check that there is no modID clash between your patch and anything else

limber onyx
#

gotcha

drifting ore
#

modID clashing is the biggest contributor to faulty loading

bronze yoke
#

that's correct for a mods/ mod

#

is the other mod's file also called TetrisDataPack_susceptiblemasks?

limber onyx
#

Nope, its just TetrisDataPack.lua

#

the mod page says to give it another name to avoid issues

#

Oh you mean the one that is supposed to be a compatibility patch for "All the mods"?

drifting ore
#

if any of them are exact duplicates then this might cause gamebreaking errors

limber onyx
#

The All the mods patch is called: TetrisDataPack_AllTheMods.lua

#

again, its weird since that patch claims to support the Mask items for SUSCEPTIBLE but it does nothing when i load it into the game

drifting ore
#

the filenames are fine it looks like. What about mod IDs?

#

is your mod ID an exact duplicate of another installed mod?

limber onyx
#

no, its just a local machine mod, not in the workshop

drifting ore
#

no I mean the PZ mod ID, the text one. The numerical one is Workshop ID.

limber onyx
#

ahh, let me check

drifting ore
#

It's easy to know if you pasted mod.info from somewhere else without checking, or if you pasted the modID string from somewhere else

limber onyx
#

id=Inventory Tetris Susceptible Mask Patch

fossil salmon
#

Why is there no e-girl bathwater mod, and how do I add one?

drifting ore
#

Are whitespaces allowed? ModIDs are usually spelled without non-alphanumeric characters.

limber onyx
#

idk, ill change it to underscores and test

drifting ore
#

Also not sure if modID must match folder names

limber onyx
#

No, the folders can be different

grizzled fulcrum
#

But I never use Base and only use my own module, so maybe this somehow does not cause any issues?

drifting ore
fossil salmon
drifting ore
#

it's in Project Zomboid/media/scripts/items_food.txt

in order to make it as a mod you need to make your own items.txt file in your personal mod folder but with the same game file path, paste in it code for water bottle from the original and tweak it. Change script moduel to your own mod's.

#

your mod folder is C:/User/Zomboid/Workshop/YOURMOD/Contents/mods/YOURMOD and in there you add /media/scripts/items.txt

#

in the mod folder there needs to exist a bunch of auxiliary files, adapt them from example folder

fossil salmon
#

so basically in mods add a directory called e-girl_bathwater, then just add an empty items.txt and then put in my script?

drifting ore
#

yeah pretty much. Note that the script for the item itself needs to be wrapped in module YOURMOD { } same as in the original file

#

well there's also a matter of adding it to distributions table so it can spawn

fossil salmon
#

(If you can point me at a wiki or something, I can dig into it in a bit.

#

I assume I also need to come up with a model/icon too?

drifting ore
#

you can just reuse existing ones

fossil salmon
#

I don't think there's a bright pink glass jar in the game though. lol

drifting ore
#

if you feel like making putting an actual effort into this then you can change the water bottle icon and world item texture

#

or a glass jar i guess

#

glass jars exist in the game i think

fossil salmon
#

I assume I can also add effects to the item too? like, happiness decrease on drinking?

drifting ore
#

yeah sure

#

you can look at soda bottle and wine bottle to check the stats code

fossil salmon
#

What would be a good balance for it. I want it to give a massive debuff to happiness

#

but not sure what to balance that with.

drifting ore
#

nothing

#

it doesn't needs to be balanced

#

it's kinda like drinking bleach - there is no added benefit that outweighs the poisoning

#

or since it's, you know, just tap water - there are no additional effects

fossil salmon
#

Is there a way to set drink priority for auto drink so that if you have this time bomb in your main inventory and you end up auto drinking it you get the debuff?

drifting ore
#

not sure if you can autodrink anything other than plain water

fossil salmon
#

I auto drink pop all the time, I think?

slow hound
#

not without a mod

drifting ore
#

does anyone knows how many usable bits ZombRand produces?

#

in other words what's the maximum value you can pass to ZombRand before it starts skipping numbers?

grizzled fulcrum
#

for the bits, iirc it's 32 or something like that (because ultimately it's being processed as an int)

drifting ore
#

i'm asking because it's not using the standard library RNG so I can't tell how many useful bits it produces. I've already ran into RNG clipping issues with PZ RNG and it wasn't anywhere close to 32 bits so I'm producing a long RNG value by stitching several short ones (not adding).
i.e. some naive implementations of RNG use longs internally but only produce about 20 bits of actual RNG and the rest have no entropy, for any given useful bits the rest are the same each time. It's like making a bigger integer by multiplying a small integer by 1000 - the trailing bits are all 0s.

fossil salmon
#

Can food effects be proc'd? Like if I wanted to give this bathwater item a 0.001% chance to cause insta-death?

#

(I'd rather that it cause insta-zombification.)

drifting ore
#

cigarettes use it to reduce stress and interact with the smoker trait

grizzled fulcrum
#

ZombRand calls func from Rand which calls func from Random

drifting ore
#

it calls from CellularAutomatonRNG which uses a version I can't find on the internet

grizzled fulcrum
#

oh wait true, it extends random

drifting ore
#

PZ uses a different version

#

also like i said just because PRNG has large range doesn't mean its entropy actually covers that range

#

imagine if RNG returned only a few random bits and the rest were zeroes. In reality it's not so simple and mitigating it is not trivial, but it affects the quality of RNG numbers the same way.

grizzled fulcrum
#

or it's supposed to

grizzled fulcrum
#

the latest uncmmons math api is version 1.2.3 which they literally bundle with the game

drifting ore
#

so it says but it doesn't have nextInt and nextFloat in it

grizzled fulcrum
#

ye that calls Random.nextInt

#

it doesn't override nextInt

#

thats why my initial thought was hey it's using Random

#

but it does override next which nextInt calls so I think it will either end up calling CellularAutomatonRNG.next or not

#

I am not sure if calling a method (CellularAutomatonRNG.next) from a function in the extended class (Random.nextInt which calls Random.next) will call CellularAutomatonRNG.next or Random.next, but my bet is on Random.next which renders CellularAutomatonRNG completely useless for ZombRand in this case

glass sentinel
#

say, is it possible to edit ''Restore Utilities'' to make it only work by individual regions and not the whole Knox Country, specifically using on a server. And if it is, will it be heavy in a server? Thanks! ❤️

drifting ore
#

Is there a way to make and apply only the tile set? The tile set has already been made. Please let me know..

red tiger
#

I used an implementation of the XOR128 algorithm and it worked faster than the default java.util.Random and worked beautifully.

#

Weird how we don't have a choice of what randoms to use here in PZ though.

ancient grail
grizzled fulcrum
unborn saddle
#

Hi is there any nice tutorial you can follow on how to create a mod for dummies. I am no stranger to python and C++ but I never modded a game.

red tiger
#

Gotta explore some conventions with python and see if I can get them in.

unborn saddle
red tiger
#

It's been quite fun working on the project for the past month.

unborn saddle
#

yeah I just wanna do this for learning purpose

#

just starting small

red tiger
#

There're type stubs for the entire runtime environments of pz available for python now.

#

I'm also having fun learning some stuff.

#

Pz is a great sandbox

unborn saddle
#

yeah it is and I need some distractions sometimes from the other stuff I programm

meager belfry
#

What's the code for passing a piece of debug to the console window in-game? (understanding of course, if that code runs a lot of times you can potentially create a tsunami of notifications)

meager belfry
#

Thanks

thick karma
#

😄

meager belfry
#

I assume you can set a global variable, if you only want to have a debug console notification display only once or a handful of times...

#

Can you do that in a mod?

#

debugVar=0 or something

thick karma
#

Yes. You may want to start by studying what other mods have done by reading through their code and reading through fundamentals of Lua / Java to get an idea for what is easily doable in PZ modding

#

You don't need a global variable for that

#

You just need the variable to be in a scope that contains the function's scope

meager belfry
#

Ok thanks

thick karma
#

Which wont necessarily make complete sense until you brush up on fundamentals of scope in programming

meager belfry
#

Got it thanks

thick karma
#

This is official resource for learning Lua but lots of unofficial ones all over the place also helpful

thick karma
#

These are the best resources for reviewing available events @meager belfry

meager belfry
#

Thanks, I'll take a look, the scope doesn't look difficult to understand at all.

thick karma
#

E.g. you can do something every time world creates a player character after they join game

#

By using OnCreatePlayer

#

But there are too many examples to explain all the possibilities for achieving your general goal

#

If you clarify what you want to do in gameplay terms, people might have more specific answers about how to do it

#

@meager belfry

meager belfry
#

I'm building a mod to grow outdoor flowers and plants. Rather than using the build menu, I'm using the Farming mechanic (and so you have to worry about keeping the things alive), but, one challenge is that PZ has it's own ideas about when growth occurs, and does not.

#

So I'll be avoid the growth state 5/6 possibly since that adds the option to harvest, I'd rather just work with 0-4. But ultimately if the plant blossoms in July I want that to reflect in the mod... If it's January then it shouldn't be on it's blossom sprite.

#

So, I think just keep knocking the growth state back, if the month is wrong.

drifting ore
#

or you can allow harvesting of flowers

bright fog
#

Yeah

#

You could still give the ability to harvest flowers

#

Some flowers can be used in some cooking recipes for example

#

That could be an amazing feature

long hull
#

Also, is there any kind of coding environment for lua that I can use to do syntax checks and such? Finding a missing { or whatever is freaking tedious...

coarse sinew
alpine scroll
hexed ferry
#

can someone make mod that changes all silencers to have infinite durability?

hexed ferry
#

i dont know how to mod

bright fog
#

Bcs most mods that adds silencers have options to make them unbreakable

hexed ferry
#

oh ok i didnt know that im new to game

bright fog
dire oracle
cerulean sonnet
#

Hello, I'm building an RP server, I just wanted to add some professions like a mechanic who can repair cars, a doctor who can heal faster, a pharmacist who can make medication, a gunsmith who makes firearms, he only needs the gun parts to assemble and forged that can make weapons and other items. in the table part I already have the Crafting Enhanced Core in the miners part I already have Dynamic Mining I'll just modify it, take out some miners and add a copper just what I wanted, change the rafting skiils like those who are doctors will be normal but those who don't have the tag doctor lv 10 will be normal but he doesn't have the doctor tag and I had the medicine lv 10 there will be a cure with only 15% of cure I would like to put a tag for each one choose a profession and need someone else to fix the car who is a mechanic etc and it is possible to do this?

#

sorry for the big text

bronze yoke
ancient grail
cerulean sonnet
#

Is it possible to modify the skills in the game? healing type level 10 gives +150% and modifying this part adds 50%?

bright fog
#

In fact there's a few mods that do it

#

I believe that one ?

#

No not that one

cerulean sonnet
#

I just want to change the part of the work, medicine, kitchen mechanics, carpenter and so on.

red tiger
#

Has the events doc in it

bronze yoke
#

not the text version

red tiger
#

Forgot about that

cerulean sonnet
#

Does anyone here know how to make mods from scratch? Do I need a mod to stop a server?

cerulean sonnet
#

You can change the percentages by making it more difficult for the child, carpenter mechanic and so on, just that part

magic halo
#

Is it okay to add new items/recipes scripts to the client after the game has loaded the save? Do you know of any issues with this method?

For example:

ScriptManager.ParseScript(“Script string …”)
bronze yoke
#

items added this way aren't registered in the world dictionary so they can't be saved/loaded

mystic vessel
#

Good evening everyone, I wanted to make a code/system that

Tile "X" every so often will generate an item inside it
example: Campfire every 1 minute
They will generate coal within their inventory, how do I do that?

solar rover
#

I've asked beard before and he didnt seem to know, wondering if maybe someone here did. Where he heck does the game save the location to Respawn In Safehouse? I have a few players that are being spawned way outside their safe zone.

bright fog
clever coyote
#

Quick question, but I'm looking to do some (hopefully basic) modding. How simple is it to add existing items to loot tables? Is it as basic as changing some lua files in notepad, or is there more to it?

drifting ore
#

all you need to do is to make your own file that adds the changes

#

actually doing it is the easy part

#

the hard part is figuring out how to do it, because the amount of documentation in existence is basically nil

#

the topic of loot tables specifically is not obscure, so you picked an easier point of entry

clever coyote
drifting ore
#

in the original game's steam folder

#

specifically, /media/

#

spawn table distributions are done via lua so that's files in /media/lua/shared and /media/lua/server

#

items and recipes are created via so-called scripts, which are purely declarative text spreadsheets kinda like JSON or Lua tables, but function as neither and have a bunch of their own quirks, so not to be confused with what people normally understand as "Script"

#

and the translation table which sits in Lua folder but isn't Lua, and by the way the name of the translation file must be one of the hardcoded options otherwise it doesn't load

#

basically most of the wheels here are reinvented as platonic solids and the game does not accept round wheels instead - which is the main difficulty with modding anything

#

even Lua itself wasn't spared and isntead of something like LuaJIT we've got a badly mangled mess that even has bugs in it, which you'd think would not be a thing for something like a programming language

#

on the other hand there are perfectly regular XML files for storing clothing visual settings, but it requires you to manually generate and handle their GUIDs because why not right

#

anyway that was a wide tangent if you have specific questions there are a lot of people here who might know hte answers

#

"might" is the keyword. For one, nobody had any idea how to make zombies change clothes via Lua and I had to painstakingly figure it out over the course of an entire evening.

clever coyote
#

Wow, that's a really in depth look into it, thanks. I'm at work the now but if you're about when I get home do you mind if I hit you up with some further questions? I think having someone to explain the process would make things a ton easier

#

So to add an item to an existing spawn location, would I just be editing the distribution file, or would I have to make changes any of the spreadsheets as well?

#

I was hoping it would be as simple as going into the item distributions, finding where hunting vests spawn, and adding the id for the gray one to the list, but I'm not sure if it works like that.

magic halo
cerulean sonnet
#

Does anyone here know how to make mods?

drifting ore
#

Luckily, the game has adequate modding support so simply putting together a few files and folders will get it recognized and loaded by the game.

#

modifying distributions is a little complicated compared to just adding an item - you need to make a correct lua program

#

I've never touched that so I have no clue how it works, only that there are 2 files - one defines "groups of items", and the other defines what groups of items spanw in which container

alpine scroll
#

I would like to share that, with some help from @red tiger , I've managed to make a little "patch" for the server I run tat I can reset the spawn all the home vhs . Still needs a bit of testing to see if there isnt any unintended effect, but for now it seems to work

#

Sad part is that it requires changing .class files from the server, so its not something that can be done via workshop

bright fog
#

Nice 👌

alpine scroll
#

I'll study some more to see if I can do something similar via lua, but for now, I can change an option on servertest.ini and, when the server loads, it tells the game its ok to spawn the home vhs sets once more. So its not like they are being treated as retailVhs. It just allow they to respawn once more

cerulean sonnet
#

It is possible to change the skills in relation to the job, like putting the % lower?

clever coyote
alpine scroll
clever coyote
#

So basically copy-paste the code from another item spawning mod, then edit the item ID and spawn area?

alpine scroll
#

Yep. Grab something that works, poke on it until it works again, and voila

#

The community has great modders, so maybe people do things differently. The great part in zomboid modding is that, as long its published, you can see what they did

clever coyote
#

Stellar! Bicscalabur mod, here I come haha.

alpine scroll
#

Just be aware that the 4 color bic mod has a broken config. So as long as you are not copying the config portion of it, you should be fine

#

They did manage to add the settings to the sandbox, but the distribution happens before it or something like that, so it never checks correctly, making the bicsalibur always spawn

clever coyote
#

Ah, maybe not the best one to start with then. Probably better to start with a solid working base.

alpine scroll
#

Distribution tables are kinda simple

#

So any mod can do it, really

clever coyote
#

Righto, so. Sorry, I may need a bit of guidance here if that's okay :S

#

In the 4 colour bic pen mod, I've found a file under lua>server named 'Bic PenProceduralDistributions.lua'

#

Would that likely be the file I want to edit?

alpine scroll
#

Yep

#

You would make a copy of that to your own mod

#

Remember that the folder structure needs to be the same

clever coyote
#

So like, 'My Mod > Media > Lua > Server > MyProceduralDistributions.lua'?

alpine scroll
#

Yep

clever coyote
# alpine scroll Yep

Grand. Now, my thought process here is to copy the code from the bic pen, then replace the spawn locations with the spawn locations used for the camo hunting vest, which should cause my item to spawn in the same locations, right?

alpine scroll
#

Should be just that

#

Since you are not even implementing a new item. Just adding it to a new spawn

clever coyote
#

And to change the item do I just change the line "Local item = bic.pen" to "Huntingvest_gray"?

alpine scroll
#

I'm not sure if you need to add "Base." in front of it, but try it

clever coyote
#

I mean the gray hunting vest is pretty based, but for my own curiosity, why does 'Base.' matter?

alpine scroll
#

Haha, because its on the "Base" module of items

#

Thats why there is a bic.pen

#

Because its the item 'pen' inside the module 'bic'

clever coyote
#

Ah, I getcha. So it's like a category and a subcategory.

alpine scroll
#

Yep. So when you try to spawn in admin mode it shows on its own tab too

clever coyote
#

Righto. Divvit question here again, but I just wanna be sure I'm getting this done clean.

alpine scroll
#

Knowing what to do is just half of the fun. The other half is why it isnt working when it should

#

No fun in a mod that works first try

clever coyote
#

The camo hunting vest I'm using as a reference for spawning appears in 'CrateRandomJunk', 'CrateCamping', 'CampingStoreClothes', 'SurvivalGear', 'HuntingLockers', and 'Hunter'

#

Is this section here where I drop those locations?

#

I feel like I know the answer, but I'm not techy, let alone a modder haha

alpine scroll
#

Considering you are doing the bic mod as reference, yes

clever coyote
#

Cool, and I can just copy the numbers afterward from the camo vest as well to keep it at the same rarity?>

alpine scroll
#

Yes

#

Something you might need to do is change the function name a little bit down

#

Because I THINK it is a custom function

clever coyote
#

I'm just coming to that now actually, I think.

#

This is where I'm at so far, with my edits to the item and to its spawn locations and chances in the top section, but I've not touched anything else yet.

uneven jay
#

yo bro its me a year later how you doing

(i was scrolling thru old msgs)

#

also dm me this aint the place to chat i dont wanna be muted for off-topic again

#

🙏

silk pike
#

Do you think it's possible to use a mod to change the way you contract the zombie infection? I was thinking of an accumulation of infection until reaching 100% (each type of wound caused by zombies would give a certain percentage of infection. When reaching or exceeding 100%, the real infection starts and the consequent transformation into a zombie. Do you think it's possible to do this with a mod?
Would this be a very difficult mod to implement??

ancient grail
silk pike
bright fog
#

If it's a bite near the top of the body, I set the infection time to 5-15 minutes

#

(die in 5-15 minutes)

#

If it's middle it's a bit longer and bottom it's even longer

#

It's a very simple line of code in fact

ancient grail
#

oh yeah use the time.. never thought of that..

bronze yoke
#

it doesn't sound like you were doing the same thing

bright fog
#

Ah no sry I didn't fully read it

#

mb 😅

ancient grail
#

yesh but they wanted to accumulate the infection i think
so they shouldnt be infected till it reaches 100 they said

bright fog
#

Yeah mod data then

#

Then set the infection

silk pike
#

sorry for my bad English 🤣 it takes a while to understand 😅

bright fog
#

np that's on me

#

Anyway my answer is that it's easy to do hahalol

stone garden
#

is that an good idea?

bright fog
#

I mean, yeah

stone garden
#

then i will do it

bright fog
#

idk why you'd ask me, no shit it's a good idea, just do it

stone garden
#

ye

silk pike
silk pike
# stone garden im going make the first chatgpt mod

I'm not a programmer...and I don't know much English..but the few mods I've made (especially recipe and crafting) I've done with the help of chat gpt. Now I'm creating a mod that allows the PC to force locked doors with a crowbar. and incredibly it works. Now I want to include the possibility that the PC gets hurt by failing the action. chat gpt helps a lot especially for someone like me with little knowledge 😅

stone garden
#

@mystic vessel can you add me?

bright fog
#

Wait .......

#

I thought you meant like have ChatGPT talk in-game

#

ChatGPT doesn't know shit about PZ modding

bright fog
stone garden
#

only that

bright fog
#

Also you're lying

stone garden
#

well i wanted to pay an modder to make my idea

bright fog
#

You already did that move, to potentially propose money

stone garden
#

like an comission

#

in reais

#

yeah i give up i will no longer forever tlak about modding i think

brittle jackal
#

Hi, I'm modding a vehicle and I would like to be able to modify the colors with the vehicle's color menu like on other vehicles. Do you know how to do it?

uneven jay
#

how do i make a player gain/lose temperature with a craft

astral geode
#

@bright fog may I get an invite to the modding discord, please?

drifting ore
#

i thought it was a link to this channel so i clicked join just for laughs and it says i'm banned

#

well it says "the user is banned" i'm assuming that means me

young edge
#

Either you were unfortunate enough to have an IP overlap with someone who got banned or you have the maximum amount of servers, maybe

drifting ore
#

i'm only on 3 servers and i think the odds of IP overlap are slim. Unless my entire ISP is range banned which would be weird and silly.

young edge
#

it's rare but I've seen it happen multiple times

drifting ore
#

i mean i get it, when i'm on my phone i sometimes run into someone else's bans. But this is a cable internet service.

#

weird

tiny juniper
#

Hello gang! I wanto to make patches for zomboid mods - I come from modding skyrim so all this is new to me. Is creating a patch as simple as overwriting a script from another mod, or should it be done as a completely new script?

drifting ore
#

from what I can tell, overriding files is not reliable or straightforward. The best way to go about it is to make your own files that override specific contents or code.

grizzled fulcrum
undone crag
# tiny juniper Hello gang! I wanto to make patches for zomboid mods - I come from modding skyri...

Something like this would be better than overwriting things
https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md#overwriting-vanilla-code

local original_render = ISToolTipInv.render
function ISToolTipInv:render()
    if not CONDITION then
        original_render(self)
    end
    -- ... some custom code ...
end
GitHub

Guide to modding various aspects of Project Zomboid - FWolfe/Zomboid-Modding-Guide

undone crag
drifting ore
undone crag
#

(Hmm you need to link a steam account to a discord account to post on Mod Discussion channels in that discord server :/ )

grizzled fulcrum
undone crag
#

yes this is correct it did not stop me from joining.

#

I was just mentioning another thing. I don't want to link my steam account. :|

grizzled fulcrum
#

It's good for preventing alt accounts and scammers

thick karma
#

Really no need to give someone 10 chances on 10 servers when you can see how they behave in 1.

young edge
#

Yeah, I've seen a couple of servers do that as well. Not sure where I stand on the issue, given the fact that a lot of servers I've seen it on overused it severely and also used it maliciously

#

Back then, we only shared IDs of people who genuinely shouldn't be on Discord to begin with. But these days, T&S works a little faster than they did before with their small team

thick karma
young edge
#

It's less the server in question prebanning maliciously and more the server in the sharing program either filing a false report because they dislike the person or putting them into the system over something that usually wouldn't be actionable on other servers. That being said, that's neither here nor there. It's something that would need to be communicated privately to begin with

drifting ore
#

Oh I see. It's the guy who blocked me when a newbie lua user was asking some basic questions about lua and he said something like "use while true do repeat if cond then break end until true end" and I said something like "what are you smoking bro".

#

And it's the same guy who influenced the decision to pre-ban me there.

#

when i saw that i said there was an additional end missing which is wrong since repeat loops close with until and not with end but I doubt that was the reason hahaha
Oh well, can't control how other people see things, if that's their view of "excessively toxic to the point of needing a pre-ban" then that's their opinion. Unfortunately due to the suggestion algorithms on twitter & such creating information bubbles, where people live in an environment where virtually no one disagrees with them on anything, this became par for the course over the past 2 decades.

grizzled fulcrum
#

who is this

#

I don't like getting too invested but I will defend someone if they are correct. If you are talking about burryaga, he did nothing wrong and all of the instances I saw you replying to burryaga in response to a code snippet of anything relating to repeat, it was a for loop and none of the syntax was incorrect.

The instances below are the only examples I can find that fit your description, and both times burryaga's suggestion is correct
#mod_development message
#mod_development message

#

and it's not like this code is outlandish to recommend, it is simply implementing a continue statement where there is none

drifting ore
#

As soon as he said "no it's correct" i went to check it and it was indeed correct. So I was wrong on it. But it's not like being wrong once on something, occasionally, is a sign of being toxic. Being wrong is being wrong.

It was very outlandish. I've been coding for almost 2 full decades and never saw anything like it before.

#

It does works. It's just super weird. Especially as a suggestion to someone who's only today seeing Lua for the first time.

#

You know like 10[array] is a perfectly valid construct in C++.

grizzled fulcrum
#

I know, you've mentioned it before.

undone crag
#

-# (nice idea technique btw)

grizzled fulcrum
#

But this is not the same realm of incomprehensibility.

drifting ore
#

what do you mean, they're both work fine if you know how it works

grizzled fulcrum
#

One is implementing continue in a readable way inside of Lua (which is very easy to mentally map) and one is doing some weird C pointer array thing

drifting ore
#

10[array] is the same as array[10] - since it's more or less *(array + 10) or *(10 + array) either way it's the same result

#

and yet see how outlandish you find it?

grizzled fulcrum
grizzled fulcrum
#

But you even admitted to being incorrect, so why strike up a complaint if there is nothing to complain about?

drifting ore
#

i didn't say the construct didn't work. I momentarily thought there was an end missing. Which was incorrect.

grizzled fulcrum
#

A while true repeat loop is not the same as a for loop implementing continue

drifting ore
#

and again, it's the same deal as the pointer thing I mentioned. You don't use C++ too much so it looks alien to you, but you use Lua a fair amount so it looks fine. Now imagine that you use neither.

drifting ore
thick karma
#

That was shared with me originally by Fenris Wolf, one of the og modders here who is now working for IS. I take no credit for its brilliance.

thick karma
drifting ore
#

It is clever. It just upsets me in the same way as 10[array] upsets other people.

grizzled fulcrum
#

I am not here to judge how large or little people know languages, but I will point out if you say something is correct and it is not. You say "what are you smoking bro" which implies that you are disagreeing with the code posted, but then you even mention (in the past) that there was nothing wrong with it to begin with.
I do not know why you act like bringing up this completely valid conversation of the past to present just to tack it on to the laundry list of figurative complaints you have all because you were pre-banned from a discord server; which has nothing to do with literally anything about the code burryaga posted.
You literally mention you were wrong, past and present, and yet why bring it up as a justification as to why you were pre-banned at all?

drifting ore
#

It sounds like you think I'm upset about the situation. But I never even went to that server, and never will, and they don't even want to see me there. Everything is well for all parties involved. It's just I found it bizzare that I was apparently banned from a place I never visited, and then i found it bizzare that the reason was a mild disagreement in a different place entirely.

#

I'm not gonna justify "what are you smoking" as benign, I can see how people thought that was too much.

grizzled fulcrum
#

Just to let you know, I personally doubt that the whole lua continue thing was the sole reason for you being pre-banned.

drifting ore
#

that was just the catalyst for the disagreement

#

the disagreement itself was the reason

#

or so I think. There's no way i was banned because I errorneously said "it's missing another end" right?

grizzled fulcrum
#

I hope not

#

that is why I am so adamant that the reason is not that in it's entirety (if at all)

drifting ore
#

Anyway this conversation ran its course and nothing of value was figure out. I'll just refer back to when I mentioned the negative influence of media platform algorithms - at this point just having disagreements is reason enough to ban people.

dry chasm
#

You could try reaching out to a person who manages said server if you're curious and would ever potentially like to join it. (Best to do so rather than just guess around)
Though if you do not plan on ever joining that server, then just forget about it and leave it be (no need to dig further into it in such cases, it is what it is, life goes on, no need to get upset about anything or get others upset about it)
Atleast that's my personal opinion on that topic.

grizzled fulcrum
#

agree ^

drifting ore
dry chasm
#

Just meant in general for this currently prolonged topic at the moment, not how it lead to it at the beginning.
(And yes, I did notice you mentioning it already being more than discussed enough, but I wasn't fast enough in readin and still responded 😅 )

drifting ore
#

that's how it originally went. I said it was weird and that was that.

grizzled fulcrum
#

🤷

fleet bridge
#

you can ban people that never set foot in your discord?

grizzled fulcrum
#

If you have their ID which you can get very easily

#

or username*

drifting ore
#

makes me wonder if there is a banbot like on twitter that combs through people's contacts and if their bacon's number against some "undesirables" is too low they get autobanned, but for discord

grizzled fulcrum
#

I would say so but they can't access friends unless it's part of server verification, then they would be able to do exactly that

drifting ore
#

then again discord friends is not nearly the same as twitter followers. And the effect is more limited.

#

on a larger scale this really sucks. At the 99% risk of sounding like "we live in a society" meme the whole echochambering really does a number on the bigger world. NASA is already at the point where nobody can say anything about the projects doomed for failure due to systemic errors in them because they'd get fired.

#

Which is why Artemis program would need 50x more launches to go to the moon than Appollo (assuming Elon delivers properly, which was already cut back on).

#

It was 12 launches to begin with, but with updated Starship performance figures that was raised by the factor of 4.

#

(don't quote me on exact figures. It was from a video of a video about a presentation at NASA. But it was in this quite ridiculous ballpark).

young edge
# dry chasm You could try reaching out to a person who manages said server if you're curious...

I understand the point you're trying to make but the NASA example seems random as hell KEK

Anyway, similar to aoqia, I don't like to continue this topic too much, but if I may speak from the POV of a retired owner of a large server, let me kind of attach myself to what Shurutsue said. A lot of servers are conceived as safe spaces. And even in those which are not, drama and such is not appreciated. If you disturb the peace of the places you're in, you'll eventually just end up alienating yourself and others until someone eventually takes care of you. I spoke earlier about autobans and such and the pitfalls thereof. But without wanting to step on your toes or insult you, another way of getting banned on servers is simply by word of mouth and people simply not wanting to associate with you. People make mistakes and it's perfectly okay. But it requires you to recognize and fix your own issues. The only person you can fix is yourself, not others.

This is a very longwinded way of saying the following: You should probably take what Aoqia and Shurutsue, as well as what Burryaga said and think about how you can make that work for yourself. And it's the last thing I'll say on the topic, since i think we've tested the mods' patience and have been offtopic for long enough

#

a. Sorry for the ping Pain_Peko

grizzled fulcrum
drifting ore
# young edge I understand the point you're trying to make but the NASA example seems random a...

Random tangents are funny. They always come out of nowhere.

I used to own a BB forum in the late 00s. It ran fine. Disruptive individuals were given a PM asking them kindly to chill out, and so they did. I never felt the need to ban anyone. Things just worked. And I've been participating in discussion like everyone else under normal account, and I never mentioned I was the main admin. But I've known for a long time that a lot of people who have the power to ban others don't have the same standards. Some are chill like me, and some are plain unhinged: I remember getting banned once because I was saying kind words to a person down on their luck and in a bad mood - "it'll work out, don't give up", that kind of stuff. But it's becoming the norm to ban people over just having disagreements.

#

For example, when you go to reddit and subscribe to content that has "the other camp" of it, you get to see the content from your camp, stuff you generally agree with, for example /r/business and /r/antiwork. Within that, you will see the comments most people already agree with, and people with the other opinion are hidden. And that just people's self-ranking of content creating these positive feedback loop infobubbles. Not even to say anything about places like YouTube and Twitter which use software tools to serve you content based on whatever you agree with the most. So it's becoming increasingly less normal to see a lot of people who disagree with you. What you see is that almost everyone agrees with you, and then the lizard brain thinks that the few people that don't should just go away.

drifting ore
#

Safe spaces are necessary when you are a victim of wrongdoing, so that you don't have to deal with people blaming you for having suffered it. But in general living in that kind of space is unhealthy for your mind. You lose the ability to function properly in groups of people where not everyone is supporting your opinions - i.e. basically everywhere outside of the safe space.

#

As a modder this will probably have little effect. But if you want to become a recognized indie developer, you will have a bad time. People will rip into you for every possible reason and you will have no safe space to retreat into.

undone crag
#

Maybe you meant this NASA video. https://www.youtube.com/watch?v=OoJsPvmFixU

I used to browse the TheIndieStone forum about 10 years ago and I saw a repeating pattern with the moderation acting toxic and like normal people. The pattern was, or was something like:

  • User has an idea.
  • Administrator says the ideas is bad, and that the idea should not be discussed. Maybe tells the user to only discuss this in PM's.
  • User thinks that the goodness or badness of the idea should be discussed. Maybe gives a quote about free speech and about someone having the right to say something even if you disagree with it.
  • Administrator says that the user tried to make a public scene instead of using PM's, "which tells me all I need to know about you", maybe posts a comic calling the user an "ass", and locks the thread (maybe also banning the user, I think?).

So the administrator was confident in his reasoning. If he was mistaken, who would tell him? The guy he just banned?

If you'd like to consider joining the Patreon Sticker Team, Click Here!
👉 https://www.patreon.com/smartereveryday 👈

A big thanks to the Jim Way, Executive Director of the American Astronautical Society
for Inviting me to Speak: https://astronautical.org/

A big thanks to The University of Alabama in Huntsville for Hosting:
https://www.uah.edu...

▶ Play video
drifting ore
undone crag
#

-# Thunderfoot... back when I enjoyed confirmation bias I liked watching his videos making fun of creationists and dogmatic people.

drifting ore
#

Yeah that was a long time ago. Since then he shifted to dunking all over poorly thought out water-related projects and sometimes physics in general. EEVBlog does the same things but only if it's related to digital electronics.

#

Both are experts in their respective fields so I can't complain even if I disagree.

undone crag
#

-# (Solar Freaking Roadways)

drifting ore
#

Have you heard of the hot new stuff? Solar freaking fences. And unlike solar freaking roadways, they actually work. You just need to put them in exactly north-south orientation.

#

Biplanar solar arrays they're called or something. They don't have an opaque layer on the backside so they can collect sunlight from there as well. They benefit the most from collecting albedo illumination which is normally completely wasted on normal sun-facing panels, and in poor weather that's an extremely large fraction of total insolation. And of course they don't suffer from snow buildup. The downside is that obviously they never face the sun, and at noon where the sunlight is most intensive, they get zero direct sunlight. Their power output chart is duck-shaped.

undone crag
#

<_<

#

hang on

#

I AM NOT BEFOOLED BY THIS

#

SIRE

drifting ore
#

Louis Rossman something something.

undone crag
drifting ore
#

The #1 pitfall game developers face is that when they think of an idea, they think how it can be great, and not how it can be terrible. (when normal people suffer from the same cognitive bias it's not an issue because it doesn't affect anything)

undone crag
#

I have a lot of partly made mod and video game things T_T

drifting ore
#

The system should be failproof, not have good potential for success. It's the necessary mindset.

undone crag
#

I also spent something like several weeks on a PZ mod but the base systems weren't all finished and stuff and it'll take a long time but maybe I actually have ADHD? I stopped working on it.

drifting ore
#

Of course you won't know for certain until you try. But it's a good rule of thumb to use adversarial arguments about any ideas you have.

#

Figure out all the ways the would-be system is broken before you even made it. Chances are you would be able to recognize if it's dead on arrival, and never start wasting time on it in the first place.

#

I mean just look at the amount of cut content every single game has in it. All of that were things that passed the arguments whether it can even be good, and turned out not good anyway.

undone crag
#

But it's a good rule of thumb to use adversarial arguments about any ideas you have.
:nods: (no emoji for nodding so you'll have to imagine nodding or something)

drifting ore
#

Who could've predicted that smart tactical AI in half-life 2 would be viewed as too broken and oppressive in single-player campaign, so they'd have to cut it down to "approach player, stand, and shoot"

#

And even that is considered far too much by a lot of players.

drifting ore
#

Like I'm facing right now. I can't figure out how to tell when a zombie was spawned. There's no associated event, and there's no clear way to tell if the zombie was reused. Additionally, their frickin inventories don't reset when they are reused, only worn items which are a separate section of data.

#

modData doesn't reset either which is a pretty baffling oversight to be honest

bright fog
#

It's the source of a lot of problem, not being able to identify reused zombies and new zombies

#

But if you ever find a solution, I'm extremely interested in it

drifting ore
#

That's my issue precisely. I have 2 mods right now that hinge upon being able to tell if a zombie is "fresh" or "stale".

#

Both do this to distribute items. It's a simple idea really, if a zombie is fresh then it qualifies to get an item.

bright fog
#

Hmm that's an even more different thing but definitely similar

grizzled fulcrum
drifting ore
#

Worn items reset so in principle I think I can use an amulet of sorts as an indicator. I also thought that setting zombies as reanimated players makes them save and load all data correctly, however this might've been confirmation bias since I recall that I never tested the cases where the zombie would appear mid-game, only right at the start.

#

When the zombie first spawns, it changes AI state from nil to idle. Not sure if it ever does this again mid-game.

bright fog
#

The amulette yeah I thought about too, haven't tested it

#

Could give a specific visual to zombies, even an invisible one, and see if it's persistant or not

drifting ore
#

the difficulty is that you need to get worn items by body location and none of these functions return arraylist

undone crag
drifting ore
bright fog
bright fog
#

You can change the item, remove it, add a new one, add blood, change the hue etc etc

drifting ore
#

well uh, this is specifically how I do this zombie:getHumanVisual():addClothingItem(zombie:getItemVisuals(), item)

#

when I loked at itemvisuals i couldn't figure out how to use that

bright fog
#

Check from this line how I handle visuals

#

It's actually really not hard

#

You can manage to do a lot of stuff

#

In this case it's a more complex use where I handle visuals based on a set of data of a zombie type

undone crag
#

(deleted)

bright fog
#

Sounds like a massive project

undone crag
bright fog
# undone crag I think maybe it's not exactly that I hit a barrier and then that happens, thoug...

I already got a burnout one day about one my mods, hit a big barrier on animation making and had been hitting my head on it for a month, then ended up ragequiting for a month. I didn't stop modding, I wasn't mad at modding, just burnt out for working so many hours on a singular and I needed some fresh air

Now whenever I feel like I'm getting less motivation on my main mod, I go mod something funny I like, then come back to my main mod, finally finish the part that had tired me out now that I'm fresh and finally start working on things I like

grizzled fulcrum
undone crag
bright fog
#

Zomboid Forge and TLOU Infected will always be my success, my big baby mod but I can't deny the love I have for my smaller projects on the side, they helped me still love modding by allowing me some fresh air as well as discovering new fields of modding, making me even better at modding

#

ZF and TLOU Infected are a mix of technicality as well as having some fun here and there, but sometimes you need something new

undone crag
#

(deleted)

drifting ore
#

oooohhhh ItemVisuals inherits from ArrayList

#

I've never noticed that before

bright fog
#

So you get every visuals with a simple get(i)

#

And each you can modify

#

Gives an ItemVisual

drifting ore
#

well in that case I suppose you can simply check if the 1st item is your key, and insert it as the 1st item

bright fog
#

If you do some tests I'm interested in knowing the results actually

#

I might test that today later I'll see

undone crag
drifting ore
#

my concern is more with syncing it online actually. Will just sendClothing work or not? transmitCompleteItem? That kind of stuff.

bright fog
#

What are you trying to do exactly ?

drifting ore
#

well I had no way around using those when reanimating skeletons

grizzled fulcrum
#

hey jvla, since you did so much work on zombies, did you ever find a way or have an idea for uniquely identifying zombies? I remember someone asking before and I was curious but they never got an answer

bright fog
drifting ore
#

ideally i'd want to even turn them to aggressive skeleton NPCs but that's way out of scope for now

bright fog
#

But it keeps one thing: it's persistent outfit ID

drifting ore
#

uniquely identifying zombies is generally not possible, but for the purposes of telling them apart you can just keep the reference to their java object. If you play online then they have OnlineID but otherwise it's -1.

bright fog
#

This persistent outfit ID is a 16 bit number, and whenever a zombie has its hat falling, there's a bit swap so that's easy to detect and Chuck created a method which outputs the trueID (without fallen hat) for a zpmbie whenever its hat fell or not, so you can have a persistant marker which is the trueID for a zombie entity

grizzled fulcrum
bright fog
#

The twist is that this pID is technically not unique as this pID depends on the outfit and an outfit has 1000 ID possible, and it's given randomly to zombies so it means 2 zombies can have the same pID

grizzled fulcrum
#

I was suspecting as such when you said outfit lol

bright fog
#

So I use it to have persistant zombie data, but this data can be shared

drifting ore
grizzled fulcrum
#

but there really isn't a ZombieId or something like vehicles have?

undone crag
bright fog
grizzled fulcrum
#

well you know how vehicles have unique identifier on them

drifting ore
bright fog
#

I don't know anything about vehicles ngl

grizzled fulcrum
#

I was saying that is there really not such things for zombies too? especially when you would want to have one for a lot of purposes imo

bright fog
#

Sadly there is no unique and persistant identifier for zombies

grizzled fulcrum
bright fog
#

I have yet to experience with setting the pID

drifting ore
#

to give an example I know of. IsoDeadBody has ObjectID which is unique and persistent. Zombies don't have anything like it. They techically have zombieID field but it's just this.zombieID = ZombRand(1000);

#

and they have OnlineID but it's always -1 in singleplayer and even in multiplayer it can be -1

bright fog
#

But I believe the solution would be adding your own bit information to the pID but I'm not sure changing it keeps the changes when reloading

#

I need to do further tests on it

grizzled fulcrum
#

yeah that's why I'm so confused. vehicles have own id, dead body has its own id. but not zombies, the main entities of the game that are like the most synced thing to other people

grizzled fulcrum
#

I tried looking before and didn't find anything but maybe there's a Java method that does some shifting or something

#

I'll search for it tmr using regex assuming I'm not still sick as bricks

drifting ore
drifting ore
#

so you can manipulate bits without using bitwise operators. It'll be slow though. (even in C it's really slow so there's that)

young edge
#

Isn't bitshifting quite literally faster than bitwise operations

#

it only uses 1 cycle instead of multiple depending on the operation

drifting ore
#

i'm pretty sure all integer operations except multiplication and division take 1 cycle on modern CPUs

#

the issue is that you always need a lot of them

#

so unless you're really trying to save space, bitbanging is actively detrimental compared to giving each bit its own whole integer

grizzled fulcrum
#

I thought there was some special behind the scenes stuff done to edit the bits themselves idk why tho

drifting ore
#

i mean there literally are special circuits dedicated to flipping individual bits

#

but at the core it's just a bunch of math operations, which conveniently happen to involve just flipping individual bits

#

well, you know. The entire base 2 math is just flipping individual bits.

young edge
#

I was about to say

drifting ore
#

long division in binary is really cool. You just flip some bits.

drifting ore
#

Anyway. Shifting right = dividing by a whole power of 2. Shifting left = multiplying. You can extract a bit by modulo the number against the bit's power of 2 and dividing without remainder by the 1-lesser power of 2.

#

Not sure about setting, clearing or flipping, but it's along those lines somewhere.

#

You can clear the bits by subtracting modulo'd value from the number. Then you can set the bits by adding them to the bitcleared number.

#

or you can do like

   local bit = number % 2
   table.insert(bits, bit)
   number = (number - bit) / 2
end```
red tiger
young edge
#

ghostping reeee

drifting ore
undone crag
#

(If I just looked at this I wouldn't have guessed Coldsteel should be prevented from discussing PZ online)

red tiger
#

I wrote bite to support AES on the LuaNet service in PZ.

#

The fact that it operated 100% in the LVM made it more secure.

#

Was slow as heck but it did the job.

drifting ore
red tiger
#

While I have my Gists open, here's a modified utility for JSON support in the PZ Lua environment. (The original source breaks)

drifting ore
#

Is there really that many man-in-the-middle attacks on PZ servers purely for game cheating?

stoic kayak
#

I asked in support, but realized it might be better suited to ask here- sorry if mistaken 😅
Just to make sure, I can look at and maybe edit for personal use, stuff right? I just can't upload it? Stuff in my downloaded workshop mods folder. B/c that's how I normally learn a game's API and how to mod it 😅

drifting ore
#

what do you mean?

#

@stoic kayak

stoic kayak
#

Go to a mod file, open the lua file, and see how it does X task.

drifting ore
#

in order to have perfectly clean hands, you just shouldn't copy and paste the contents into your own mod when you upload it

stoic kayak
#

Oh, but viewing it is fine?

drifting ore
#

but in general it doesn't really matter. As long as you don't reupload the entire thing unchanged, it's almost not objectionable.

#

If you want to tweak or fix a mod, it's normally possible to just make 1 file and upload it separately from everything else.

stoic kayak
#

I am curious b/c I have no idea about the API, and so I'll love to see how cheat menu or something gets and sets tiles.

drifting ore
#

so you want to try to make a kind of map editor?

stoic kayak
#

Err- I just wanna see if I can set multiple tiles x3

#

And so, I do my own version of what cheat menu does for every tile between point A and B

drifting ore
#

well, looking into game's original files is the main way you figure out how to make your own mods so nobody can blame you for it. The same applies to other people's mods.

stoic kayak
#

I am also curious if it's possible to play a tree xP

#

place*

drifting ore
#

I've no clue. To answer the original question, it's completely fine to look at the code. It's generally acceptable to copy and paste the code as a concession, since making your own code isn't easy for most people - you know, you gotta do what you gotta do. Copying and pasting assets like models and textures is generally not acceptable if you do it without permission, even if you modify them.

stoic kayak
#

ahhhh ok

dry chasm
# stoic kayak I asked in support, but realized it might be better suited to ask here- sorry if...

You're free to look at it and edit it for personal use (no one can really check for that anyway)
The problems do occur if you do redistribute/share it however (virtually or physically).

It's generally acceptable to copy and paste the code as a concession
I'd personally have to disagree - as I'd say this HEAVILY depends on the amount. If it's like a simple loop, slight changes, sure, but lots/whole would be an entirely different matter IMO.
So if that were to be an intention of yours (to upload it to workshop or share it differently included) then I'd guess asking for permission would be best. (I heavily doubt people would be against it all that much unless it's pretty much a copy of all the code? Personally wouldn't be against it either way, but I can't really speak for others)

But yes, learning from others and their mods is the most common way to learn PZ modding - as for code, ideally just not direct copy pastes of it (Seen such complaints before, although in most of those cases it was a lot of the code and not just a single little part or something)
And as Coldsteel said, if you just wish to adjust/extend another mod:

it's normally possible to just make 1 file and upload it separately from everything else.
So usually shouldn't require a full blown copy of another's mod to tweak it, leaving most sides happy.
-# If I did overlook anything or misunderstood something, apologies, still wanted to throw my two cents out there 😅

dry chasm
drifting ore
#

speaking of trees. I'm getting question mark tiles that kinda look like they were supposed to be trees. That said I'm playing in debug mode. Is this normal?

dry chasm
red tiger
#

Also personally all I ask for is attribution.

#

"Hey. He did this." That's all I ask for in my case. =)

drifting ore
#

all I ask is that Kevin stops showing everyone my fucking DeviantArt

red tiger
drifting ore
#

teleports behind you pssh... nothin personnel,,,,,,,,, kid

stoic kayak
#

So I booted into debug more and it seems like brush tool, selecting tile, and then placing a tree works.
Also- oh my gosh- Do map makers actually have to get each and every tile they want? o.O

#

no I'm assuming

dry chasm
red tiger
#

This is what I worry about.

#

This is even more of a reason for my tools to exist because if there's such a situation, I can at least front the solution without that happening.

dry chasm
red tiger
#

Sorry.. I've seen too much silly shit happen in my 20 years of modding. x)

#

People can be some of the most creative assholes.

drifting ore
dry chasm
red tiger
#

I'm giving you the other end of that spectrum.

#

Your case is almost 100% of the stupid situations honestly.

dry chasm
#

That's the point though.
If it can be done without a blatant copy, it should be done without a blatant copy.

red tiger
#

When you get into scenarios where machine code is used to open up games or software to modding, the situation I've mentioned becomes more of a thing.

drifting ore
coarse sinew
red tiger
#

Modding bytecode is way better IMO. xD

red tiger
#

I'm not sure if I made a fix for a custom userdata type but it should be simple to add if you ever see this error.

red tiger
#

Even copy-left can be toxic.

coarse sinew
#

And do you have an idea of how well would handle reading through a large volume of code, say around +30k lines?

red tiger
#

That's a lot of data.

dry chasm
red tiger
#

This is a modified JSON library that used optimized, non-present Lua functions so it might be slower than the original in a proper Lua environment.

drifting ore
red tiger
drifting ore
#

yeah that

red tiger
#

But it's for a specific case.

drifting ore
#

that's a big fat no for me dawg

red tiger
drifting ore
#

PZ Lua environment has its wing clipped all the way up to the neck, but you never know what other bugs kahlua might have which can be maliciously exploited

red tiger
#

=)

drifting ore
#

i mean beyond just cheating

red tiger
ancient grail
dry chasm
ancient grail
#

like these?

red tiger
#

You're talking about getting into that territory and I'm very familiar with this realm in other software. People paid me to fix vulnerabilities and exploits in the past.

#

A couple fixes in PZ are from reports I made privately with the devs in the past.

#

👍

drifting ore
#

allright well real question though: what's your use case for loadstring since it does the same thing that PZ Lua loader already does

#

by which i mean everything is a use case but what's your case that warrants using it

red tiger
#

Also for TypeScript-built environments. (Separate project)

#

I'll be back in like 20 minutes.

drifting ore
#

I don't get it. You said you were "copy-neutral" which means stuff like MIT right? I don't see how does "preventing mod theft" works into that. I also don't see why anticheat needs to be eval'd when putting everything as local accomplishes the same thing pretty much.

red tiger
#

I do not believe I should force your hand to make actions based off the use of my works.

drifting ore
#

That's copyright.

red tiger
#

That's not.

#

You are wrong.

drifting ore
#

Not forcing code available = not copyleft.

#

Not forcing code closed = not anything really.

#

Closing your own code = copyright.

red tiger
#

You have your rights to modify my code as the copyright holder yes. Even copy-left licensing has the rights as a copyright holder.

#

This is a legal conversation, not modding.

drifting ore
#

Well no I don't mean legal definitions, just general direction.

#

Copyright in relation to source code genrerally means proprietary, closed. Copyleft means forcibly open so you can't sublicense it as closed.

#

Legally speaking the creator of source code always holds the copyright and it's pretty difficult to waive it and put in public domain, not to mention that public domain has different rules in different countries.

red tiger
#

I'm not holding a gun to anyone's head and they're not about to sue me for "Damages" mentioned in those licenses that sit in the center. That's basically my position.

#

It doesn't contradict the work I've mentioned above.

#

I open-sourced the code that's encrypted and sent.

drifting ore
#

I guess a more apt description of your position on this spectrum is "copy-none of my business and none of yours".

red tiger
#

So copy-centric.

drifting ore
#

I'd put it outside of the scale altogether.

#

Centric means between extremes, and here it's copyleft and proprietary code, and the place between them is generally recognized as permissive FOSS>

#

i.e. the code that under its licensing terms can be used either way

#

as open source or as proprietary

#

copyleft licenses prevents the use of code as proprietary, and proprietary prevents the use of code as open source

#

allright well that was a pointless tangent and I didn't need to ask. Can you say why the anticheat needs to be eval'd though?

#

is it purely for the sake of making the code marginally harder to decipher?

#

loadstring("foo") is the same as requiring a file with contents "foo"

#

(with an asterisk)

drifting ore
#

I'm just not seeing it as a good use case which could not have been just a file. You need eval when you fetch code from the internet as text, like Shurutsue said. Or when you JIT-compile scripts to machine code (that's not really eval but it's the same idea)

limber onyx
#

Hi guys, having some problems replacing recipies from a mod.
I'm trying to create a patch for a mod so it works better with inventory tetris, so I wanted to reduce the number of items given by a recipe

This mod has it's own module in the code, I'm not sure if I should be using Base or the mod's module on the imports, since its generating additional recipes instead of overriding them

red tiger
bronze yoke
#

if you want to override a recipe you need to use the module it's defined in

limber onyx
red tiger
# drifting ore consider me educated

The only way to interact with the function is to somehow obtain the LuaCallback object from a walled-off LuaEventManager sub-class collection and destroy it in the Kahlua environment.

#

This or MITM packets.

limber onyx
#

So I figured I'd just use the modlue Susceptible to override the recipes aded by that mod, but it seems to create another instead or replacing the existing ones even though I'm using override:true

red tiger
#

Even then the expectation of a response-call from the packaged code will alert the server and can handle it.

bronze yoke
#

if there's multiple originals the override method won't work (it only looks for the first recipe by that name and replaces that one tired)

limber onyx
#

Should I create a script for each individual recipe i want to replace then?

#

I tried placing the override line inside each recipe and still doesnt work

red tiger
#

@drifting ore The best part about writing security solutions is trying to break it.

#

Kahlua has so many kinks and little nuances that even vulnerabilities can be used to strengthen security.

#

It's a wild game.

bronze yoke
#

you can mess with recipes through lua to get around this but it's a lot more of a pain, what exactly are you changing about the recipes?

limber onyx
#

Original mod adds a box of surgical masks, when you open it, it gives you 50 masks

I want to change it so it only gives you 20

bright fog
#

DoParam

#

No ?

#

Not sure

#

Wait no

#

It's a function

#

function OpenMaskBoxBlue(items, result, player)
    player:getInventory():AddItems("Susceptible.EmptyMaskBox_Blue",1);
end
function OpenMaskBoxGreen(items, result, player)
    player:getInventory():AddItems("Susceptible.EmptyMaskBox_Green",1);
end
function OpenDustmaskBox(items, result, player)
    player:getInventory():AddItems("Susceptible.EmptyDustmaskBox",1);
end

#

no nvm

#

That's the empty sry

drifting ore
#

doesn't doparam only works on items?

#

i.e. not recipes?

bright fog
#

Doing 10 things at the same time sry

drifting ore
bronze yoke
#
local recipes = ScriptManage.instance:getAllRecipes()
for i = 0, recipes:size()-1 do
    local recipe = recipes:get(i)
    if recipe:getFullType() == "Susceptible.RecipeName" then
        recipe:getResult():setCount(20)
    end
end
bright fog
#
recipe Open Box of Face Masks
    {
        destroy MaskBox_Blue,
        Result:Hat_SurgicalMask_Blue=50,
        Time:5.0,
        Category:Misc,
        Sound:PutItemInBag,
        OnCreate:OpenMaskBoxBlue
    }    
limber onyx
#

the original recipe looks like this
recipe Open Box of Face Masks { destroy MaskBox_Blue, Result:Hat_SurgicalMask_Blue=50, Time:5.0, Category:Misc, Sound:PutItemInBag, OnCreate:OpenMaskBoxBlue }

bronze yoke
limber onyx
#

Figured it was only a matter of changing the 50 for a 20 and adding Override:true, at the end before the brackets

drifting ore
#

and there are a bunch of thse and they're all called "open box of face masks" yeah i see what would be the issue

limber onyx
#

there's 3

Dust masks, green surgical masks and blue surgical masks

#

each one with 2 recipes to open a box and give you masks or put masks in a box

#

At least I was able to fix the problem i had a few days ago regarding the Inventory Tetris stack values only changing when -debug was enabled (a huge thanks for the help btw)

#

To be honest. I don't even like the mask boxes, gives WAY too many of them when you open it and also gives you an empty box.
I wish I could just change it so it works like the box of nails when the cardboard box magically materializes when you have a certain amount

drifting ore
#

there might be a recipe for that? takes 100 nails and makes a box of nails

limber onyx
#

Yeah, i'll just have to learn how to work around the override limitations with lua
I barely know how to make the most basic of scripts and edit existing lua files. But this is uncharted territory for me

bronze yoke
#

you could use a similar script to the one i just posted to disable all of those recipes and just make your own instead

limber onyx
#

Good idea

#

The lua file should start with this line, yes?

Events.OnGameBoot.Add(function()

bronze yoke
#

it doesn't really matter if you do it on an event or not

limber onyx
#

Thanks. sorry, i have nearly 0 lua knowledge.
So I just took the code you posted

local recipes = ScriptManage.instance:getAllRecipes() for i = 0, recipes:size()-1 do local recipe = recipes:get(i) if recipe:getFullType() == "Susceptible.RecipeName" then recipe:getResult():setCount(20) end end

#

If i were to use the code to disable the recipes added by the original mod as you suggested. How would that look after the "Then"?

bronze yoke
#

recipe:setIsHidden(true) seems like it should work

limber onyx
#

thanks mate, I'll get to work on it and let you know how it goes

#

I assume I have to create the new recipes with a different name or the lua function will hide them too, right?