#mod_development
1 messages · Page 256 of 1
reasons: it can break the game, sometimes in very subtle ways that are virtually impossible to predict, and because it destroys mod compatibility
There is
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
besides fixing core game bugs i can't think of an example that needs overriding vs decorating
also in some cases undoing undesired effects is literally not possible
read above
i read it, did not convince me
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
sometimes your override is so significant that mod compatiblity isn't something worth thinking about anymore
And for legit reasons
in the main menu example, how is a mod going to stay compatible with that just because you didn't delete their hook
everything is a use case, i'm arguing that it's not a valid use case to delete the previously defined function wholesale
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
it's better to just save yourself the complexity and performance overhead and hard overwrite

Sometimes you have to overwrite everything, that's it
i have a concrete example. One guy made a mod that fixes spear repair counter resetting every time you craft and reset spears.
For what you're trying to achieve
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
well what I did is re-wrote it to use a decorator instead of overwriting
But when a decoration or using what was originally there can't be done, you don't have any choice 
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
And it's okay if you know what you are doing and CLEARLY state that your mod overides a specific function
nobody is saying you should always or even usually use hard overwrites
And that's an example which CAN use a decoration
how about this
the blanket advice against overwriting is like the blanket advice against using GOTO
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
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
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
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

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
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
that is the default advice
Has always been
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.

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
for some reason, no loot is spawning in these containers
ive tried regenerating the loot in these over and over but nothing works
Have they being grabbed and replaced by players?
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
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.
You mean something that replaces ammo and weapons with dead rats, for example
As a hypothetical, yes
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
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...
Just add a check to not replace the chilli cans itself
Otherwise it will remove itself and add itself back
you can swap it OnFillContainer, that should be simpler and not have that issue
Needless processing
Yeah I assumed that would create a nasty feedback loop
i hazard a guess that this is caused by the recipe being incomplete rather than any problem with the game, which would warrant changing the function code to include it manually
Exactly, but the recipe is a function
what do you mean exactly? recipe is a PZ item script normally
i.e. it has nothing to do with lua
player:getInventory():AddItem(DifficultDanceBook[ZombRand(#DifficultDanceBook)+1]);
end``` this is in the original, after a table with 26 entries (instead of 30)
most recipes use lua functions to implement more advanced functionality
Because a closed Kosmotsars generate an open kosmotsars + a dance card]
oh i see
in this case you need to modify DifficultDanceBook table, not the funciton
Yea, but its local
rats
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
i don't really see how making an exact duplicate but which uses a different table would break it
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
You probably should upload that as a fix, or submit it to the original author.
I did comment on the mod
Writing that directly in the workshop mod folder is liable to get removed when anything updates.
can we see your code? we can't really know why it doesn't work otherwise
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
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?
i think the issue is that it's called "recipecode.lua"
it overrides the entire vanilla file
There is a vanilla file that is called recipecode.lua?
yeah
that would actually cause the opposite issue but yeah you really need to use unique filepaths
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
when I was doing this kind of thing my issue was that my recipecode file was overriding the vanilla, and since i was making decorators it caused it to crash because there were no functions to decorate
I'll do it anyway, just because I honestly dont know what else could be
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
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
in this case decoration isn't really useful
Well then. I'll remove it so its not bloating the code
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.
it's not random
I think I'll need to add a new recipe and override it on recipes too
that's not how the game loads lua files
i mean yea sure it's not random, it's deterministic
if multiple names have the same filepath the one in the mod latest in the load order is the only one that is loaded
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
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
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/
you can set up a local mod, it doesn't even requires game restart, just lua reload
you should just test locally, this won't behave differently in multiplayer and it's quite literally a hundred times faster
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
I mean, I play on a dedicated server that I host myself on my computer
same deal
wait no, only if you play through the normal game using "host" option
or is it? i'm not so sure
is it even at all different form hosting from a normal game?
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
however this is code that runs on the client (despite being in the server folder) so it doesn't usually behave differently in multiplayer
I mean, not that insane. Its like 3 mins top?
the differences are usually down to certain functions not triggering gamestate sycnrhonization so you need to do it manually
mine take a lot longer than that and singleplayer takes about five seconds
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
how come you have 2 recipes though
I had another file
do you also carry a bunch of files that define identical recipes?
as a fix your mod only needs the fixed files, you need to delete everythign else
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
you need loot respawn to be enabled
otherwise even if you change anything, then only newly spawned containers will have the items
The home tapes are hard coded inside the game
So once they spawn, the ID get stored in a table
use ModData
moddata isj ust tables to store whatever you want in
moddata is a lua table that can store anything
Mod data
local modData
Events.OnInitGlobalModData.Add(function()
modData = ModData.getOrCreate("MyUniqueKey")
end)
As long as I know the key, I can read and edit it, right?
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
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
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
yeah, mod load order does very little - a lot of people are really superstitious about it, changing it will rarely resolve issues
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
only if they have to override a file, usually they don't
or a function
otherwise you create a function and then the original overrides your fix with the broken one
mod load order does not affect the order in which lua files load
doesn't it? what does it do then?
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
i hate overwriting lua files
it doesnt work for all clients . but if the mod only had local functions and didnt return it then theres no choice
Nothing with the code itself, I mean.
well for my mod which need to decorate functions I resolved the issue by using require which forces lua load order
if you begin your file with require "TheOriginalFile" that file will be forced to load before your one regardless
I'll keep that in mind
I'm just happy that I'll be able to finish my dance card collection
if you keep having trouble, there are ways to 'disable' files that don't export anything at all
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
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
iirc not much has been heard from them for a bit over a year
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)
you're thinking of true music
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.
is it not parody
well i'm not joking either
huh?
uh what
'is it not parody' referring to the kosmotsar pun
nope, that's how it's spelled on the box
no, it's spelled kosmostars on the box
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.
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
This is what I'm doing for another mod. So glad that licenses exist ヽ(ー_ー )ノ
yeah if it's MIT or BSD or GPL then it's even completely fine to do this
the original mod is under gplv3 like my mods so it works well
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.
I think it is reasonable
It's 100% reasonable. Most of the time people reupload FOSS projects is either as a fork or because the original was abandoned.
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?
it depends on the item's module
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
how should i go about figuring out what to use
i was thinking of adding the last of guns remastered weapons
Can I set a sandbox option to only be visible in debug mode ?
I don't know about that, but why would you need to do it anyway?
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
Why not just check if getDebug() and load them anyway?
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.
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
What debug functions do you use in your code?
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
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
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
``
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)
``
probably? but i've never had issues with those
they stack rather than override each other
one of the most commoni ssues people come here with is making an items.txt or a recipes.txt and deleting the entire game
huh, in my mod i've got items.txt living happily and not messing anything up
Actually, I was trying to fix some items manually, since the patch i subscribed to didn't seem to work
are you sure this mod is supposed to load stuff in non-debug? there's not that many behaviour differences it could depend on, it sounds deliberate - do these mods work without your changes?
it also sounds like something they would absolutely not do deliberately but otherwise i have no clue 😅
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
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
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
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.
ok
\Zomboid\mods\Inventory Tetris - Susceptible Patch\media\lua\client\InventoryTetris\TetrisDataPack_susceptiblemasks.lua
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
gotcha
modID clashing is the biggest contributor to faulty loading
that's correct for a mods/ mod
is the other mod's file also called TetrisDataPack_susceptiblemasks?
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"?
if any of them are exact duplicates then this might cause gamebreaking errors
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
the filenames are fine it looks like. What about mod IDs?
is your mod ID an exact duplicate of another installed mod?
no, its just a local machine mod, not in the workshop
no I mean the PZ mod ID, the text one. The numerical one is Workshop ID.
ahh, let me check
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
id=Inventory Tetris Susceptible Mask Patch
Why is there no e-girl bathwater mod, and how do I add one?
Are whitespaces allowed? ModIDs are usually spelled without non-alphanumeric characters.
idk, ill change it to underscores and test
Also not sure if modID must match folder names
No, the folders can be different
I do this 😭
But I never use Base and only use my own module, so maybe this somehow does not cause any issues?
copy and paste item script for a bottle of water and change the name and translation to e-girl text.
Where does one find that script. never actually done a mod for PZ before.
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
so basically in mods add a directory called e-girl_bathwater, then just add an empty items.txt and then put in my script?
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
(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?
you can just reuse existing ones
I don't think there's a bright pink glass jar in the game though. lol
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
I assume I can also add effects to the item too? like, happiness decrease on drinking?
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.
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
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?
not sure if you can autodrink anything other than plain water
I auto drink pop all the time, I think?
not without a mod
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?
well the param you pass to ZombRand (which is a double) gets explicitly casted to a long, then gets implicitly casted to an int, then ultimately gets explicitly casted back into a double for output
for the bits, iirc it's 32 or something like that (because ultimately it's being processed as an int)
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.
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.)
food itemas have OnEat callback, you can define a Lua function that does whatever you want
cigarettes use it to reduce stress and interact with the smoker trait
It does half use java's Random class if thats what u mean
ZombRand calls func from Rand which calls func from Random
it calls from CellularAutomatonRNG which uses a version I can't find on the internet
oh wait true, it extends random
yeah theoretically it should be from 0 to int's max value
idk why it wouldnt
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.
but it returns 31 uniquely random bits ;-;
or it's supposed to
also it literally uses the exact version
the latest uncmmons math api is version 1.2.3 which they literally bundle with the game
so it says but it doesn't have nextInt and nextFloat in it
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
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! ❤️
Is there a way to make and apply only the tile set? The tile set has already been made. Please let me know..
I had a lot of fun back in 2014 replacing the forced high-quality PRNG with a really fast one as a patch for build 30 / 31. It helped a lot of people with really weak processors play PZ a little better.
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.
but what if they are not using other functions?
anyways about "disable"
toggleModActive(ChooseGameInfo.Mod mod,
boolean active)
this might be a solution but it affects the whole mod
Yeah, I agree that there probably should've been a like more performant and more pseudo-random options so you can choose which one you need the most.
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.
Python support is coming soon via a mod
Gotta explore some conventions with python and see if I can get them in.
I mean I can figure out lua
Alright. Thought I'd let you kno
It's been quite fun working on the project for the past month.
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
yeah it is and I need some distractions sometimes from the other stuff I programm
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)
print()
Called from client
😄
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
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
Ok thanks
Which wont necessarily make complete sense until you brush up on fundamentals of scope in programming
Got it thanks
@meager belfry
https://www.lua.org/pil/1.html
This is official resource for learning Lua but lots of unofficial ones all over the place also helpful
Here's official Java to help you understand how to call and use Java functions, but that is generally only done through Lua in PZ to be clear
https://docs.oracle.com/javase/tutorial/
There are also many events you can use for firing specific things on specified occasions
https://pzwiki.net/wiki/Lua_Events
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
These are the best resources for reviewing available events @meager belfry
Thanks, I'll take a look, the scope doesn't look difficult to understand at all.
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
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.
or you can allow harvesting of flowers
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
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...
for pz typings you can use https://github.com/asledgehammer/Umbrella, and for lua syntax highlight https://marketplace.visualstudio.com/items?itemName=sumneko.lua
Just for an update on this subject, I did leave a discussion and pointed in the comments the fix. Also, about the mod creator, I am not sure how safe he is to mess with the mods, since he is russian as far as I can tell, so this fix is the closest we can do to deal with this inconsistency in the mod
can someone make mod that changes all silencers to have infinite durability?
You are someone
i dont know how to mod
From what mod ?
Bcs most mods that adds silencers have options to make them unbreakable
oh ok i didnt know that im new to game
Check their respective sandbox options
You should start to know how to mod
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
if it doesn't interact with things external to the file then it's not really able to affect the game at all

you have a point
A lot of times i get into this situation when its about zombie behavior
i have problems with other mods that control the zeds behavior or changes their properties, variables, walk type etc
i just tell people my mod isnt compatible with those mods
it would be great to add function on their side that checks if the zombie has custom moddata first before they take control
Is it possible to modify the skills in the game? healing type level 10 gives +150% and modifying this part adds 50%?
Depends on the type of skill but yes, there's a few skills you can modify
In fact there's a few mods that do it
I believe that one ?
No not that one
I just want to change the part of the work, medicine, kitchen mechanics, carpenter and so on.
Umbrella???
Has the events doc in it
not the text version
Does anyone here know how to make mods from scratch? Do I need a mod to stop a server?
You can change the percentages by making it more difficult for the child, carpenter mechanic and so on, just that part
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 …”)
items added this way aren't registered in the world dictionary so they can't be saved/loaded
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?
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.
Keep track of campfires in a table. Every minute, cycle through your list of campfires, check if lit and if yes then access inventory and create a coal item within it (might need to check if there's space in the campfire idk)
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?
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
That's great to hear! Where would you suggest starting or looking for resources?
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.
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.
Interesting, i will avoid adding items that way. So, is it okay regarding the recipes?
Does anyone here know how to make mods?
you never edit the game's original files - that counts as "corrupted files" and is reset by Steam. You code them as mods, no matter how tiny your change is.
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
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
Nice 👌
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
It is possible to change the skills in relation to the job, like putting the % lower?
Ah shit. That makes sense, I had a feeling I'd need to code it as a mod. Can you suggest where I'd start to do this? Do I need any coding knowledge or specific programs?
Grab a mod that adds an Item, check the distribution file inside that mod. Usually they have distributions in their name. It is a lua file. Then just make a mod adding the distribution you want. Just name it something like MaxPotatoDistributions.lua so it wont conflict with another mod
So basically copy-paste the code from another item spawning mod, then edit the item ID and spawn area?
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
Stellar! Bicscalabur mod, here I come haha.
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
Ah, maybe not the best one to start with then. Probably better to start with a solid working base.
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?
Yep
You would make a copy of that to your own mod
Remember that the folder structure needs to be the same
So like, 'My Mod > Media > Lua > Server > MyProceduralDistributions.lua'?
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?
Should be just that
Since you are not even implementing a new item. Just adding it to a new spawn
And to change the item do I just change the line "Local item = bic.pen" to "Huntingvest_gray"?
I'm not sure if you need to add "Base." in front of it, but try it
I mean the gray hunting vest is pretty based, but for my own curiosity, why does 'Base.' matter?
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'
Ah, I getcha. So it's like a category and a subcategory.
Yep. So when you try to spawn in admin mode it shows on its own tab too
Righto. Divvit question here again, but I just wanna be sure I'm getting this done clean.
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
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
Considering you are doing the bic mod as reference, yes
Cool, and I can just copy the numbers afterward from the camo vest as well to keep it at the same rarity?>
Yes
Something you might need to do is change the function name a little bit down
Because I THINK it is a custom function
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.
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
🙏
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??
its doable
just remove the infection
and add moddata
till that data becomes 100
then set the infection
thank you so much for the answer... i'll start studying. i'm a very novice modder with little knowledge 😅. but i'm stubborn 🤣. So i'll try! And i'll bother you a bit if i don't succeed 🤣🤣🤣
Yes, I do that
Not needed
Check out how I do it here:
https://steamcommunity.com/sharedfiles/filedetails/?id=3248766883
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
oh yeah use the time.. never thought of that..
it doesn't sound like you were doing the same thing
yesh but they wanted to accumulate the infection i think
so they shouldnt be infected till it reaches 100 they said
sorry for my bad English 🤣 it takes a while to understand 😅
im going make the first chatgpt mod
is that an good idea?
I mean, yeah
then i will do it
idk why you'd ask me, no shit it's a good idea, just do it
ye
Ok! I'll try I'll try and try again until I succeed
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 😅
@mystic vessel can you add me?
Wait .......
I thought you meant like have ChatGPT talk in-game
ChatGPT doesn't know shit about PZ modding
Stop your shit, you were already banned from the modding Discord for a good reason, don't get your ass banned from here too because you keep DMing modders to ask them for stuff
i wont ask him stuff i will just give him money
only that
Why ask HIM specifically ?
Also you're lying
well i wanted to pay an modder to make my idea
You already did that move, to potentially propose money
like an comission
in reais
yeah i give up i will no longer forever tlak about modding i think
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?
how do i make a player gain/lose temperature with a craft
@bright fog may I get an invite to the modding discord, please?
how come I banned on a server I never visited?
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
Either you were unfortunate enough to have an IP overlap with someone who got banned or you have the maximum amount of servers, maybe
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.
it's rare but I've seen it happen multiple times
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
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?
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.
idk
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
I tried joining it and I'm not banned :\
exactly. It's not normal for people to be banned in places they never visited in the first place.
(Hmm you need to link a steam account to a discord account to post on Mod Discussion channels in that discord server :/ )
but that should not stop you from joining
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. :|
It's good for preventing alt accounts and scammers
People also often get prebanned when their behaviors on one server are seen as toxic to an unwelcome degree. I known many Discord hosts who preban people from other servers who have bad communication habits.
Really no need to give someone 10 chances on 10 servers when you can see how they behave in 1.
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
I think if you get yourself prebanned by communicating poorly, you got what you deserved. If you get prebanned "maliciously", that's another context entirely and I would have to know the details.
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
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.
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
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++.
I know, you've mentioned it before.
-# (nice idea technique btw)
But this is not the same realm of incomprehensibility.
what do you mean, they're both work fine if you know how it works
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
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?
Yes that is true, but I am not saying it does not work. I am saying you're taking a completely valid suggestion and making a complaint out of it for no reason
I am talking about the outlandish part of the lua code burryaga suggested and nothing related to C or C++
But you even admitted to being incorrect, so why strike up a complaint if there is nothing to complain about?
i didn't say the construct didn't work. I momentarily thought there was an end missing. Which was incorrect.
A while true repeat loop is not the same as a for loop implementing continue
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.
of course not. I'd normally use goto but it doesnt' work here
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.
This
It is clever. It just upsets me in the same way as 10[array] upsets other people.
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?
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.
Just to let you know, I personally doubt that the whole lua continue thing was the sole reason for you being pre-banned.
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?
I hope not
that is why I am so adamant that the reason is not that in it's entirety (if at all)
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.
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.
agree ^
I didn't intend to join that server. I thought it was a link to this channel.
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 😅 )
that's how it originally went. I said it was weird and that was that.
🤷
you can ban people that never set foot in your discord?
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
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
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).
I understand the point you're trying to make but the NASA example seems random as hell 
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 
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.
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.
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...
There was someone else who made another video using this one as the basis. Maybe it was thunderfoot? I'm not sure. The bloke says a lot of deeply disagreeable things, but he haven't been wrong yet.
-# Thunderfoot... back when I enjoyed confirmation bias I liked watching his videos making fun of creationists and dogmatic people.
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.
-# (Solar Freaking Roadways)
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.
<_<
hang on
I AM NOT BEFOOLED BY THIS
SIRE
Oh yeah there's a thunderfoot video about the guy and his video https://www.youtube.com/watch?v=nxG0WAwwrGk
Kinda... THIS!
https://www.youtube.com/watch?v=OoJsPvmFixU
You can support this channel directly through patreon:
https://patreon.com/Thunderf00t
or at my amazon affiliate store:
https://www.amazon.com/shop/thunderf00t
or my other channel: https://www.youtube.com/channel/UCUrdmVprSahXaPKqr04VfgQ
Louis Rossman something something.
By "like normal people" I mean because in my experience people normally make up ideas, and believe them without the ideas being proven. They also do things like try to change the topic, walk away, plug their ears, and if online ignore and unfriend and block.
I think avoiding disagreement with an idea isn't a rational reason to agree with it.
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)
I have a lot of partly made mod and video game things T_T
The system should be failproof, not have good potential for success. It's the necessary mindset.
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.
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.
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)
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.
ADHD is when you quit it on the same day because you started another making another mod. This is more like a burn out. It's easier to avoid when there are no roadblocks such as lacking API.
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
You can't
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
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.
Hmm that's an even more different thing but definitely similar
0_0 anyone else have these issues (I'm not diagnosed with adhd)
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.
I do believe reanimated makes them properly unique actually
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
the difficulty is that you need to get worn items by body location and none of these functions return arraylist
BodyVisuals
Which ones? The gotta top and start on another on the same day or gotta stop this and almost ever work on it again?
Can you elaborate please? I've looked at it but couldn't see anything relating to my issue.
I feel like that's most likely about hitting a barrier, and the courage to start working on it again
I personally change clothings on zombies by modifying their itemVisuals
You can change the item, remove it, add a new one, add blood, change the hue etc etc
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
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
(deleted)
Sounds like a massive project
I think maybe it's not exactly that I hit a barrier and then that happens, though maybe something like that can happen to me or maybe not idk
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
a little of both. I often start new projects and then push the on top of the stack with high priority and then completely neglect the other ones and never end up finish any, then repeat
that one seems a bit more like me
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
(deleted)
Yes it's an array
So you get every visuals with a simple get(i)
And each you can modify
Gives an ItemVisual
well in that case I suppose you can simply check if the 1st item is your key, and insert it as the 1st item
Yeah you can just add an item. But just have to test how the game handles these whenever you reload. I believe the game keeps the visuals when a zombie is reloaded
If you do some tests I'm interested in knowing the results actually
I might test that today later I'll see
(deleted)
my concern is more with syncing it online actually. Will just sendClothing work or not? transmitCompleteItem? That kind of stuff.
No idea idk these methods
What are you trying to do exactly ?
well I had no way around using those when reanimating skeletons
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
Yes, but there's a twist, it's not perfect
ideally i'd want to even turn them to aggressive skeleton NPCs but that's way out of scope for now
An entity zombie doesn't keep its class
But it keeps one thing: it's persistent outfit ID
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.
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
the problem i found with online id is it doesn't work for offline like u mention and also its not persistent which doesn't matter too much but sometimes I want that
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
I was suspecting as such when you said outfit lol
So I use it to have persistant zombie data, but this data can be shared
could've been as simple as using incremental IDs instead of completely random ones
but there really isn't a ZombieId or something like vehicles have?
(deleted)
Yeah well there's a lot of things devs could have done better lmao
What's that
well you know how vehicles have unique identifier on them
yeah it's a random integer value from 0 to 1000. So not exactly unique. Also there's no getter for it so using it is not very easy.
I don't know anything about vehicles ngl
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
Sadly there is no unique and persistant identifier for zombies
so there is one? or is this explaining something else
No that's the pID, but the value given is not unique
I have yet to experience with setting the pID
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
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
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
can you do bit manipulation in lua like bitshifting? that would open up literally Pandora's box
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

yeah actually it might not save them
(there's the other "save" but it just finds its own save file and calls this function)
bit shifting is just base 2 math
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)
Isn't bitshifting quite literally faster than bitwise operations
it only uses 1 cycle instead of multiple depending on the operation
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
the more you know
I thought there was some special behind the scenes stuff done to edit the bits themselves idk why tho
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.
I was about to say
long division in binary is really cool. You just flip some bits.
Hmm
No idea
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```
Yes you can. The problem is more about it being slow.
ghostping 
even in C bitbanging is slow. Ho dear boy I got a lot of performance boost by leaving the bytes alone instead of trying to cram 2 data samples into 1 byte when using a 180 MHz Cortex chip. And mind you with whole bytes it's bottlenecked by USB speed.
(If I just looked at this I wouldn't have guessed Coldsteel should be prevented from discussing PZ online)
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.
project zomboid mods are serious beans. Gotta have the data packets cryptographically signed. 😛
When you write anti-cheats, yes.
While I have my Gists open, here's a modified utility for JSON support in the PZ Lua environment. (The original source breaks)
Is there really that many man-in-the-middle attacks on PZ servers purely for game cheating?
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 😅
Go to a mod file, open the lua file, and see how it does X task.
in order to have perfectly clean hands, you just shouldn't copy and paste the contents into your own mod when you upload it
Oh, but viewing it is fine?
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.
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.
so you want to try to make a kind of map editor?
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
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.
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.
ahhhh ok
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 😅
I think someone mentioned that placing normals trees are mostly handled by java-side, didn't find the chat in question after a quick search, so I can just go off of what I remember (which might be totally wrong)
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?
IIRC in debug there's a "bug" where some tile(s) don't really load, haven't really played in forever to say for sure, but it shouldn't be there when outside debug.
Should be able to easily confirm by save & quitting at said location and restartin outside debug and continue there to see if it still occurs.
If this becomes a conversation in my court of affairs, my writing style quickly resolves the issue. It's more of a person-to-person issue so each case is different. I write things as utilities first because many people can try to solve the same issue, small or big so those utilities will be there and ready, expecting to be used.
Also personally all I ask for is attribution.
"Hey. He did this." That's all I ask for in my case. =)
all I ask is that Kevin stops showing everyone my fucking DeviantArt
Admission of guilt is the first step in the healing process.
what did I miss? 👀
teleports behind you pssh... nothin personnel,,,,,,,,, kid
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
and yeah, just seen it with code as well (and in some instances fully understandable)
Personally not against it so long as it's not essentially a full mod reupload with just one tiny change. (Might as well have been a single file as Coldsteel mentioned then)
But yes, depends on the people.
I would say that in a situation where someone squats a "fix" that's honestly the only way to perform a certain task and demands some form of tribute or limits the availability of the fix is also a potential problem.
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.
Ya lost me there, didn't understand that part. 😅
Oh. I'm saying if there's one way to do something with some kind of file or something in PZ and someone does this and then tries to shut down others who can only use this approach or technique.
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.
ah yes the software patents except even less sensible by a factor of 10
Oh yeah, I just meant more like "Hey this mod adds a whole new feature and such" - "Hey I copied said mod, allowing for more of XYZ" is rather the issue, especially if nearly nothing was changed
Yes this is bad.
I'm giving you the other end of that spectrum.
Your case is almost 100% of the stupid situations honestly.
That's the point though.
If it can be done without a blatant copy, it should be done without a blatant copy.
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.
There are scenarios where the mod is almost perfect but it has flaws and the dev refuses to fix them. Your only solution is to make changes and upload, all of concerns notwithstanding.
Can I use it in a mod I'm working on?
Modding bytecode is way better IMO. xD
Absolutely.
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.
For context I lean copy-centric.
Even copy-left can be toxic.
And do you have an idea of how well would handle reading through a large volume of code, say around +30k lines?
Oof. Benchmark it.
That's a lot of data.
Plottwist: You can essentially make a mod that reads the file as string, edits said string to include fixes and run that instead of the original! (Annoying way, to just prevent a full reupload but theoretically possible)
-# Hopefully we don't reach a point that will ever be necessary.
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.
if I find out a mod does eval i'm never touching it
I use loadstring
yeah that
But it's for a specific case.
that's a big fat no for me dawg
You're entitled to your decisions.
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
Why do you think I work on anti-cheats?
=)
i mean beyond just cheating
I know.
Now include taking the content for that from the web 😰
like these?
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.
👍
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
Bootloader to fraction out code from the server-side with encryption. It's to avoid theft in the workshop and also secure any custom-made code for things like anti-cheat.
Also for TypeScript-built environments. (Separate project)
I'll be back in like 20 minutes.
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.
I am copy-neutral in that I believe that I don't need to force your source to be available and that I don't believe I have the option to force your code from being closed off.
I do not believe I should force your hand to make actions based off the use of my works.
That's copyright.
Not forcing code available = not copyleft.
Not forcing code closed = not anything really.
Closing your own code = copyright.
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.
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.
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.
I guess a more apt description of your position on this spectrum is "copy-none of my business and none of yours".
So copy-centric.
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)
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)
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
It's actually quite effective at executing annonymous functions not referenced to anything. It can't be reloaded. It can't be overridden.
if you want to override a recipe you need to use the module it's defined in
consider me educated
Thanks
This is the code used by the mod
module Susceptible { imports { Base }
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.
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
Even then the expectation of a response-call from the packaged code will alert the server and can handle it.
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
)
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
@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.
problem with that is it just replaces the first one every time, it's an oversight in the way overrides are set up
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?
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
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
Doing 10 things at the same time sry
does it define the result of opening a box as a mask, times 50?
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
recipe Open Box of Face Masks
{
destroy MaskBox_Blue,
Result:Hat_SurgicalMask_Blue=50,
Time:5.0,
Category:Misc,
Sound:PutItemInBag,
OnCreate:OpenMaskBoxBlue
}
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 }
this lua script should find all recipes by that name and change the result amount to 20
Figured it was only a matter of changing the 50 for a 20 and adding Override:true, at the end before the brackets
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
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
there might be a recipe for that? takes 100 nails and makes a box of nails
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
you could use a similar script to the one i just posted to disable all of those recipes and just make your own instead
Good idea
The lua file should start with this line, yes?
Events.OnGameBoot.Add(function()
it doesn't really matter if you do it on an event or not
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"?
recipe:setIsHidden(true) seems like it should work
