#mod_development
1 messages ยท Page 481 of 1
yeah, i figured out what was happening
and now i've made a big damn spreadsheet and have made a tool to quickly let pillow fix this shit by me mostly just going through and grabbing matching spawns and listing their line number (and the fix if i get around to it)
cos like
okay at this point, am i an altruism masochist or something?
lmfao
https://docs.google.com/spreadsheets/d/1TZy2OyWeHWVhd-_lS4ma5lbNXSzXhp9KxUjIGTcrMr0/edit?usp=sharing
Sheet1
ABSOLUTEX,ABSOLUTEY,WORLDX,WORLDY,POSX,POSY,spawnpoints.lua line number,comment,fix (i'll go through a few of these),search string,search string construction
14550,4980,48,16,150,180,12,unemployed,worldX = 48, worldY = 16, posX = 150, posY = 180,worldX =
12922,6945,43,23,22,45,Could not ...
looks like not all the coords are even from the professions file
so it'll be other spawns from other parts of the mod
I think its a complex solution to a simple problem lol
true, but there's a greater than 0.00% chance it'll help pillow
so i'm dumb enough to try it
hello everyone, could someone give advice? just started out whit britta's, arsenal 26, (https://steamcommunity.com/workshop/filedetails/?id=2587063527) actually theese mods, and the problem is that i cant make any metalworking, it looks like some things missing from loot distribution, and i cant find any solution for that. made couple options, to have proper items spawns, like DIXIE EP TOOLS no success... Anyone had issue ?
Britas distros are borked RN
Also that modpack is FULL of mods that are way out of date and have known issues
@lapis wedge yeah Brittas is being updated and is not ready
Also, and this is just my opinion, with how PZ is in this state where build 41 is changing significantly every couple of weeks or months, breaking many mods, using mod collections is a mistake.
People should just not make or use them until build 41 is stable. Period.
Aside from the stability issue people will just jam collections willy nilly into their games without paying any attention to what mods thay are adding or what they do.
This has become evident here, in tech support, and reddit. That people are adding all the mods in a collection, no matter how out of date or broken they are, without evaluating the individual mods in the least.
People regularly have no idea what is Vanilla, what is mod, what mods they have active in their games, or what those mods are intended to do.
Perhaps there are solutions to this problem
if the problem is even that severe to begin with
Such as?
Just curious.
how do you shoot the grenade launcher under a gun rail ?
How to Have Items Spawn on the Corpses of Zombies Wearing Specific Outfits
require 'Items/Distributions'
SuburbsDistributions.all.Outfit_Police = SuburbsDistributions.all.Outfit_Police or {rolls = 1,items = {},junk= {rolls =1, items={}}}
table.insert(SuburbsDistributions["all"]["Outfit_Police"].items, "Base.BlairsBestItem")
table.insert(SuburbsDistributions["all"]["Outfit_Police"].items, 100)
how does the outfit system work? does it pull from local building/room definitions? Be cool seeing a hospital and hundred(s) of zombies in the area wearing only the patient gowns.
I know it's probably more likely to spawn them near things like that, I've seen them near crashed ambulance stories etc but turning the 'weight' up would be cool
Yes, but I'm not the guy for the fancy technical explanations? I just play with the lego pieces until it works myself.
The answers are in ProjectZomboid\media\lua\shared\NPCs\ZombiesZoneDefinition.lua
@quiet rampart clothing on zombies will depend on the zone assigned to the area while making the map. Much like foraging zones. You can assign them for military, police, fire..etc
Zombies having zone based settings too could be interesting, Blair I know you have the labs alpha complex mod, an underground facility with strict sprinter zombies in patient gowns would be an interesting endgame challenge.
I just looked into map making and the changes a few hours ago. I plan to update the how to make a map tutorial and include that in it
I take it zombie definitions (speed, toughness) based on zone are off the table from the current systems? I know some mods tinker with randomness in zombie stats.
Could make zombie soldiers tougher due to some botched inoculation, so you could scale game difficulty up in military zones.
all kinds of stuff I guess.
Is there a combustible lemon mod?
if not, then get to work and stop dissapointing cave johnson
Yes it does that. You can define what spawns in a building/area down to the room its in.
question regarding skills: is 10 hardcoded as the max level?
https://theindiestone.com/forums/index.php?/topic/40331-mod-more-tapes-spawn/
If anyone is looking for more tapes spawns, I got you covered.
By default in 41.54, VHS tapes only spawn in CrateVHSTapes, LivingRoomShelf(with tape, small chance. Other living room shelves have a no tape list) or MovieRentalShelves (not even sure these are spawning). The result is that finding movies is very, very rare. This mod aims to fix that. VHS tapes ...
<@&671452400221159444>
๐
Uhgg shit, I wanted get nitro
hi there, so I was using a cigarette mod which was probably outdated, wouldn't allow me to open "canned food"
which is weird but some people already experienced this
disabling the cigarette mod however seems to have deleted cigarettes from the game
which is a problem since I got the smoker trait
can anyone suggest any workaround?
I am working on a mod. I need to know how to retain some keyboard functionality while having a textbox opened. Currently my character is stuck in one place when the console is open. I could use someone with some experience in LuA help me with this.
Not sure if it will pan out but I'm trying to allow for a speech to text function in the game. So far I kind of have it working. It's certainly usable for meBut full keyboard control while using speech-to-Text would be amazing thanks in advance!
Well so everyone here gets a spiffo for all the great mods!
I realize this question may be rather random
Hi hi! I might be mentally challenged or just stupid, but for some reason trying to overwrite two items makes one work and the other one stay the same, been modding for a while and this game is the first one that has this kind of weird behavior, please, let me know what is the problem, I wanna learn so I can create something I'm proud of!
Here you have the "code"
And here is the problem
Just to be clear, normal coal is perfectly modified, but charcoal doesn't wanna change.
Hit me in my DM's if you can help me please! I barely enter servers ;-,
Instead of creating an existing item, better modify it
You just want change the weight?
In this case, the weight is part of what I want to do
The problem is, I modified both coal and charcoal
And only one is actually getting modified
Idk why
that's the problem, you're creating a item that already exists and probably some variables aren't changing
Yeah, the plan is to overwrite the current items
The difference is you've overwritten charcoal and coal, instead of modifying.
Additionally, I do see a * on the file name on the tab, sure you saved the change?
And last but not least, which I can just recommend:
#mod_development message
Interesting, and yeah, everything is saved I was testing some other things
It bogles my mind tho, that one changes and the other keeps the same code, this is so weird, not even 7dtd was this complicated, and that one was one of it's own
I think that is the wrong way to overwrite, wait me a second, I finish a guide and I will make a code for that, isn't really hard
Also, unsure on how the game handles existing items in a save with changes made afterwards, so it could be that you require a fresh save? Not sure though, so best to await Dislaik's answer ๐
Preexisting items keep the old data and new ones get the new one, I fiddled for an hour or so before coming
Tried new save, same problem
It's late af, Imma hit the bed, @ruby urchin hit my dm's i'll answer your as soon as I wake before I go to work
Thanks for your time guys! I hope I can make it out with your halp! ๐ค
i just got back from the weekend and im resuming work on this mod. i know you guys told me how to do it from a lua file but i feel like there is just something wrong with mine even when i am running it from a script. the stunstick sounds so weird, like it is bouncing between my speakers, but the rest of the sounds in game are very clear and the source in game is obvious
i am wondering if anyone has an explanation for this behavior. the only thing i am doing is calling the sound from a script on the item.
i have been toying with lua and trying to figure out the api for about an hour
i am wondering the difference between SoundEngine and SoundManager? which is better for playing soundfx on the fly?
and also what class has access to music? I could not get getSoundManager():StopMusic(); to work
Here it is, for server side, just work for new items spawned
local changeWeightItem = {
"Base.Coal",
"Base.Charcoal"
}
local SetChangesItemProperties = function()
for v in pairs(changeWeightItem) do
local item = ScriptManager.instance:getItem(changeWeightItem[v])
item:setActualWeight(2.0)
end
end
Events.OnGameStart.Add(SetChangesItemProperties)
does anyone know the fastest/easiest way to get access to the player, or does anyone know what class getPlayer() is in? i am seeing this method in other snippets of code but i cant find it in IsoPlayer or anything
well it turns out getPlayer() does return an IsoPlayer, but i don't think IsoPlayer has a field for IsoGridSquare, so I am wondering if there is any other way to play a sound in a certain spot that doesnt require an IsoGridSquare argument
local square = getPlayer():getSquare()
You're going to get better results looking at the actual lua code of PZ + mods in an investigatory fashion than whatever that is IMO?
i have been using examples to figure out what i need to access and then searching the api for what i can do with what i learned
i have gotten the sound to generate in the world, now i just need to make it happen when i hit a zombie with the stunstick
Ah okay, nvm then, I though you were just navigating just by the ape or whatever.
https://pzwiki.net/wiki/Modding:Lua_Event also for this page i am wondering how this even works? I have tried Events.OnWeaponSwing.Add(playStunSound()) but it always throws an error and i just don't really get what is going on when i run this line
(the same goes with all the events, not just OnWeaponSwing)
just the function name, you're passing a function as the parameter, but if you add the ()at the end of a function name, it's a call instead, so in other words that would try to pass the return value of the function playStunSound
shiiiit ok
Events.OnWeaponSwing.Add(playStunSound())
should hence turn into:
Events.OnWeaponSwing.Add(playStunSound)
and so does that make playStunSound run every time the player swings a weapon?
so long as the event exists and is run, yes, it should
cool ok thank you
i feel like this is not all that i have to do
the wiki page says that there are parameters for the event?
yes, parameter 1 is the attacker, parameter 2 is the weapon according to the wiki
and of course, you need a function with the name playStunSound
i am confused as to where the parameters are going?
example:
function customWeaponSwings(attacker, weapon)
-- your code here, you can use the variabels attacker and weapon now, as they get passed into your function in this order, whenever
-- someone swings a weapon after you add it to the event
end
Events.OnWeaponSwing.Add(customWeaponSwings)
so OnWeaponSwing will run customWeaponSwings() and pass it the attacker as the player and the weapon as the player's weapon?
right
hm ok, thank you, that makes more sense. i am going to experiment with this
though, keep in mind to define the names of the parameters in your function as in the example above (how you name them however, is up to you - the clearer you name them, the easier it'll be to edit later
is the weapon parameter going to allow this to work? halflife.StunBaton is the id for the item in the script
actually i can check the api for HandWeapon
lol I had no idea that parameters were passed to lua ๐คฆโโ๏ธ
LuaEventManager.triggerEvent("OnWeaponSwing", isoGameCharacter, useHandWeapon)
are the items that modders define in scripts IsoWorldInventoryObjects?
What you define exactly in a script.txt should end up as an ScriptItem (Item Object on java side)
Actual items then would (i believe) end up as inventoryItem -> or subclass like Handweapon, Food, ComboItem, Clothing etc.
hm, so how could i identify if the weapon is a specific script item?
i think it's :getFullType()
should IIRC return something like Base.Needle or something, so the module dot originalItemName
yep works perfectly
on a sidenote, is there a way to put comment lines in the .txt script files? i feel like i should comment that the sound is going to be handled in a lua file just so i dont forget later
alternatively, but most likely unnecessary, you could probably do something like :getScriptItem():getFullName() or something
/* defines the start of a comment and */ defines the end of a comment to my knowledge
or // for single line comments (unsure here though)
(taken from wiki the info) based on the passed parameter of the event OnZombieUpdate being an IsoZombie, i guess IsoZombie would be the type of object a zombie would be? ๐คทโโ๏ธ
i was thinking more for OnWeaponHitCharacter? i want the swing sound to play for the OnWeaponSwing, but another one for the OnWeaponHitCharacter
Good question, trial and error i guess?
oh shoot, IsoZombie inherits from IsoGameCharacter according to the api
i think this should work
guess the player itself isn't IsoGameCharacter then either
would make sense
i wonder what the point of making IsoLivingCharacter even is
actually probably for npcs
it has been a long night, but i did finally get the sounds to generate in world space and i have learned a lot. thanks everyone
I'm curious if pcall() is slowing down the game speed and causing lags? It's a kind of "try..catch" to run some lua code in sandbox.
You could probably test it out doing the same in both and checking elapsed time I think. (Obviously should be something that's a bit more "workload" than just a print I guess)
I know I suggested that myself - so I could just as well do it myself... but let me know of the result! I'm curious now as well ๐
It's strange, but pcall is even faster a bit.
test_tm(freeze) -- 1.134 secs avg
test_tm(function() pcall(freeze) end) -- 1.112 secs avg
test_tm - is my function as well as freeze
quick question, how can i relatively easily limit a float (i believe) to a certain number of decimals?
round(x,2) -- 2 decimals i guess
oh sweet, even shorter than what i just found out now!
string.format("%0.2f", x)
thanks
I... might've just ... slightly overdone the testing on my end... 100.000 tests of each 400.000 calculations seperated by 100.000 in a simple for loop and 100.000 via a function call... the game seems frozen cough cough let's hope it still runs it all and isn't literally stuck because of something ๐
It was better to start from 1.000, and then increase this number if test finished too fast.
I did so)
just thought 100.000 runs would be a good count to get averages from ๐
If X number of tests takes 0.5 sec and you want to wait 20 seconds, you need X*40 tests, obviously. ๐
But if X number of tests takes forever, you can only wait and pray ๐
well, each test did take around 0.02 alone (for both) with, via simple single calls with pcall being slightly slower, though that all could've been due to other things happening as well, hence i just thought crank it right up ๐
Atleast i now know to... well, limit myself.
Time to turn on the tv, get something to drink and come back a while later.
alright, canceled and shortened to 10.000 after i accidentally caused the game to crash.
Result:
Larger function, with a lot of calculations and all: Pretty much the same in speed (very very slightly slower)
Smaller functions, with something that could be a one-liner: Took more than double the time.
Test / elapsed:
Function call with 100.000 Calculations in a for loop: Average of 0.02 seconds | pcall: average of 0.02 seconds
100.000 function calls with calculations: Average of 0.04 seconds | pcall: average of 0.09 seconds
As such, atleast on my end, it seems that pcall doesn't really affect the speed all too much, especially not if it actually does some bigger workload, though shouldn't really be used for one-liners.
what happened to the kentucky carnage weapon pack?
nothing
its private
being entirely redone from the ground up
oh, cool!
i redid every model, added more weapons, added new icons, and redid distributions
i am just tweaking now and i have more projects that need to be dealt with that have more priority
did you want to screw with it?
someone without a girlfriend

in all seriousness they are probably not in this channel
what did you want to know?
i wanted to know if i can edit it
like do i need some kind of permission or something
all its doing is overwriting those textures
if no i already did my edits
wat
Cant you register on steam for free xd?
iam using free steam account
it tells me i need to pay 10 dollars to be able to chat and add people which is absurd
Thanks mate! I'll try it out ๐
wtf lmao, i dont remember that. Actually one of reallife friends got steam and i dont think they paid anything.
was like 6 months ago
im trying to google where it says that u need to pay 10$ to have friends on steam lmao
ah wait i googled it. you need to buy a game from steam that is worth 5$ or more. This is done to prevent scammers from making accounts and scamming others. seems like a good change to me
rip me
Wait, how do you not have a steam account with any games on it?
Dont you have project zomboid on steam to use the workshop?
I just joined and someone got exposed
To be fair, I do have a steam account and I do not have Zomboid on it. I have it on GOG. I do have other games.
I think if the topic drifts off that much, #offtopic_non_pz ๐
it does
"Scavids", doing a post apocalypse zombies jam. Like Geared Zombies, but with trashy wasteland warrior zeds.
dam they look like they have a story to tell
like people gather up thinking they can fend of the zeds and they get geared and all just to fail
does this count as a mod ?
no?
yes
Does the wiki link to the keyboard layout?
RoboMat tutorial doesn't seem to have it anymore - at least I didn't find it. But it can be useful to people here.
https://theindiestone.com/forums/index.php?/topic/9799-key-code-reference/
Just thought I'd share this with everyone. Comes in handy when working with the OnKeyPressed event:
Please do not burn yourself out, your mods make PZ โ mmmhhhโ
Hi!
Does the ZombRand generates a random number between a given minimum and maximum value, right? for example: ZombRand(0, 100)
I want to confirm, because I have seen it with only one parameter too and I don't really get that one ๐ค
I assume the one parameter is exactly as this:
local randomNumber1 = math.random(1, 10) --Returns a number between 1 and 10.
local randomNumber2 = math.random(10) --Also returns a number between 1 and 10.
But would like to confirm why use ZombRand instead of math.random
both act as a random number, but ZombRand returns a class Rand and goes through a process called CellularAutomatonRNG I thinkg both perform the same function but by different process(? idk
ZombRand counts digits from 0
Math.random isn't exposed or is locked up somehow in PZ
ZombRand(10) = 10 numbers starting from 0, so 0-9
Providing a minimum and maximum I believe counts from min to max or max-1 -- I'd have to check.
Is the typo intentional?
Oooh, nice to know that it exclude the last digit. Thank you for the explanation ๐
Np, you can do a test by running math.rand 1000+ times and count the results to confirm.
I'm not 100% sure why math.random is locked out
All of the other math functions are exposed fine as far as I know.
Is it possible to make a character blackout aka fall asleep "forced"
it is a feature for this drink, I want to add in PZ
If it's exposed yes, but would not work right for MP
Maybe a extremely sleepy effect would have to do
i feel like a dumbass
i thought ibrrus and aiteron were the same person
Don't drink the water. They put something in it to make you forget. I don't even remember how I got here.
https://steamcommunity.com/sharedfiles/filedetails/?id=2613274731 drink some nuka cola
sometimes, I dream about Cheese...
the cheese
You talking about that guy who released a empty npc mod?
Literally has like NOTHING IN IT?
Wish I still had nitro to attach my "kick me" emoji.
No? they're the guys who make Autotsar, Aquatsar, Better Lockpicking etc...
Hi! is there a limitation in the amount of modData that I can use in the player? ๐ค
You can use also global ModData. Sometimes player moddata bugs
How's that? Because I need that each player has it uniques values to manage certain things
Is that possible with the global?
@tame mulch Hey man I have see you have been a little on the downlow for your NPC mod, is everything ok with it?
what's the mod ID something related to steam?
I am working now on NPC. Done save/loading function. Working on some features and will publish alpha build in october
sweet
Sometimes other mods define player's modData as {} completely wiping it.
When you mentioned that the moddata bugs, what you mean? I'm using like 10 different moddata, and they all work perfect, I added one more exactly the same as always and it simply doesn't work ๐ค
I'm doing my test with only my mod
ModData can't save objects - but other than that it should NOT very easily bug.
-- INITIALIZATION FOR SMOKER TRAIT
if player:getModData().DTdaysSinceLastSmoke ~= nil then
return
else
player:getModData().DTdaysSinceLastSmoke = 0;
end
I mean, it is exactly the same code and that one works, but this one doesn't
-- INITIALIZATION FOR ALCOHOLIC TRAIT
if player:getModData().DThoursSinceLastDrink ~= nil then
return
else
player:getModData().DThoursSinceLastDrink = 0;
end
When I try to use it in my function it simply throws a null like if it wasn't ever initialized
As per the error, the initialization itself, because later on I try to use that value player:getModData().DThoursSinceLastDrink and basically the lua error is something like is not defined
player:getModData().DThoursSinceLastDrink = player:getModData().DThoursSinceLastDrink + 1;
This is failing inside the function, but it is supposed that that moddata was initialized in the OnPlayerCreation so it should be ready to be used in the function
Question why is it checking if the value is not nothing then setting?
You could do:
Value = Value or 0
Because I only need that it initialise once, then the value will change depending on certain things but I don't it to be initialised always
Completing eliminating the nil check but I'm not sure if that'd fix your problem with the error.
I'm using the nil check for other 9 modData and it does works, it has been always like that. The problem is in this new one ๐ค
And your sure it's in the initializing and not the other functions?
As you can see, this is the initialisation for the whole mod. All the modData works except for the latest two that are new.
And I'm using the same logic ๐ค
Could it be that the other functions where you check these are running before it's initialized?
Events.EveryHours.Add(alcoholicTrait);
Events.OnDawn.Add(alcoholicTraitAbstinence);
I assume that those function shouldn't run before the OnCreatePlayer. Anyway in case that could be the issue, it should fail once, not everyhour ๐ค
Do you have the modData.DTDays since and not some Hours?
Could be trying to check something mislabeled.
My concern is why it does work for all other modData but for this fails, if it fails for everything then something with the code is wrong but... I just don't get it ๐
Try adding:
If not X then print("error FUNC") end
Where X I'd the value and FUNC is the function name
To where you are checking for the trait
That will print where ever it can't define the modData value
Sometimes you have to hamfist debugging cause your brain is ignoring a typo somewhere
I've spent like 30 minutes before looking for an error and it was a missing ,
when i put 1 in weight does it mean 1 kilo or lbs ?
I thing 1.0
It is not specified, do not give importance
No, the functions it should go inside of are the alcoholicTrait and alcoholicTraitAbstinence functiins
Your basically checking where it's used and confirming if it's actually defined
You said it spits an error every hour so it could be inside the hourly function
Got it, will check
i could try something
Iโm not talking about aiteron, Iโm talking about ibrrus
0.017
Ok I don't f get it... I added that to debug but now it started to work? like I can't debug because it is working...?
I didn't even change the code ๐ฌ
I fucking love and hate modding at the same time... seems like it works now... I don't know why
OK? And I said no he isn't the one who released an empty NPC mod, he's the guy who released Autotsar & Aquatsar...
so when i make an item do i put all the items in 1 block
or just put each item in its own block
this doesn't explain item types
how can you make a mic item like the lipstick and the eyeshadow items ?
Huh indeed he is, sorry my reason for that original question is because Jug had commented on a mod that says it adds NPCโs yet, is literally just a empty folder (mod dev even says itโs empty as heโs โworking on itโ) and thought he was talking about the guy making that NPC mod due to his comment, my apologies
And considering aiterons also making a NPC mod I thought he got the two people confused
So I was askin
"WorldStaticModel = item" <<< what does this do
Sets the 3D model for when the item is in the game world (on the ground or placed on a table/counter/etc)
StaticModel is when the player is holding the 3D model (like when you drink a soda)
what about the "metal value = item"
Metal scrap value when melting it down for blacksmithing
ty one last thing
" MakeUpType = lips " is this restricted to lips face and eyes?
It looks like the options are FullFace, Eyes, EyesShadow, Lips
ty ty vm
cab i add a 5th option some how ?
It looks like you can, yes. The file you'll want to check out is at C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\shared\Definitions\MakeUpDefinitions.lua
It lets you define a category, then define the individual textures for it.
All of the current makeup textures are at C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\textures\Body\MakeUp
The event "OnDawn" does run on an specific hour in the morning? does somebody knows?
thanks a bunch
โค๏ธ
You're most welcome ๐
cat.avatarYOffset = 0; is for up and down right
and the x variant is for left and right?
what if i wanna rotate tho
That's what I would assume. You might not be able to, otherwise you can see if cat.avatarZOffset does anything. I'd try setting it to 0.5 or 0.25 and see if it spins it or if you just get an error
oh wait i can't enable the mod in game did i fuck up ?
Did a little red box pop up in the bottom right corner of the game window? If not, then it shouldn't be broken
no error but it won't let me enable
Hmm, what does the file/folder structure of the mod files look like?
Should be something like this:
its media containing the folders and lua containing more folders
inside the media
media/lua/shared/definitions
etc
Hmm, it might not like the avatarZOffset then. If you just get rid of that line, does it still break?
lemme try
yep its the avatarZoffset
Quick question: can you access an inventory that is part of an object that isn't currently loaded?
Looks like that's not an available option then. So you probably can't flip/rotate them
its ok
As in it's in a different part of the map, or hasn't been added yet?
different part of map
you cant make 2 makeups overlap right?
@agile coral
I'm not sure if the game will reject it after a specific distance away or not, but getWorld():getCell():getGridSquare(X, Y, Z) will target a square at the given X,Y,Z coordinates, and then you can get all objects on that square with :getObjects()
I don't believe so
Yeah, maybe it will reject it... I meant if you store the reference to a specific inventory, can you access that inventortru if it's on the other side of the map?
i can do multi definitions and make 1 item use them tho but idk how
i really apricate you helping us valrix your a blessing
Hmm, I'm not sure if you can store an object reference in moddata, so it would only last until quit. But if that will suffice, then you should be able to just keep the object:getInventory()/object:getItemContainer() somewhere and use that until you exit the game. Otherwise you have to store the X,Y,Z and object:getObjectIndex() to fetch it from the map. I've had to do this for a mod I'm making that makes coolers work after putting a coldpack inside
This is how I'm doing it at the moment:
QoLES.watchCoolers = function(square, item, player)
if item:getType() == "Cooler" then
local watched = ModData.getOrCreate("QoLES_Coolers");
table.insert(watched, square:getX().."_"..square:getY().."_"..square:getZ());
ModData.add("QoLES_Coolers", watched);
end
end
QoLES.unwatchCoolers = function(square, item, player)
local watched = ModData.get("QoLES_Coolers");
local id = square:getX().."_"..square:getY().."_"..square:getZ();
for k,v in pairs(watched) do
if v == id then
watched[k] = nil;
ModData.add("QoLES_Coolers", watched);
return;
end
end
end
QoLES.transferWatch = function(item, source, destination, player)
if item:getType() ~= "Cooler" then return end
local watched = ModData.get("QoLES_Coolers");
if destination:getType() == "floor" then
-- object is being dropped, watch the square
local parent = source:getParent();
QoLES.watchCoolers(getWorld():getCell():getGridSquare(parent:getX(), parent:getY(), parent:getZ()), item, player);
else
-- object is being grabbed, unwatch the square if no more coolers
local parent = item:getContainer():getParent();
QoLES.unwatchCoolers(getWorld():getCell():getGridSquare(parent:getX(), parent:getY(), parent:getZ()), item, player);
end
end
Yeah, I'd have to store it in moddata.
I haven't really messed with makeup myself, so I'm not sure either and would probably just start jamming things together until something stuck, haha. And you're welcome, it's nice to help out sometimes
i figured it out
You'll probably want to store it in the global moddata like I do above then
reading the code the eyeshadow tool has 2 catalogs 1 for eyes and 1 for eyeshadows under the eyeshadow tool
maybe if i make a tattoo needle ill have to sub catalog the tattoos into each body part
Yeah, I guess I'll just have to test if I can extract the container from a remote object. Thanks!
like arms legs torso and back 4 is enough for a start
Interesting, can't wait to see what you come up with!
You're most welcome ๐ hopefully it works for you
look at this
and then
also
they are all in makeup type body but each has there own category
Ayy nice
TY but we arent done yet
you know makeup isn't permeant
so basically anything you add will be removed in the next wash
F
i only want you to be able to remove it when you use the lactic acid that ill add to the game along with the needle and inks
also you need the ink and mirror to use the needle
@agile coral
and i have 0 idea how to do that
You can remove the MetalValue line if it's not going to be melted down for blacksmithing. And I don't think items can be used to define use for makeup.
To prevent your desired makeup from being removed on wash you could probably modify ISWashYourself:perform() to remove all makeup that isn't considered a tattoo
function ISWashYourself:perform()
self:stopSound()
local visual = self.character:getHumanVisual()
local waterUsed = 0
for i=1,BloodBodyPartType.MAX:index() do
local part = BloodBodyPartType.FromIndex(i-1)
if self:washPart(visual, part) then
waterUsed = waterUsed + 1
if waterUsed >= self.sink:getWaterAmount() then
break
end
end
end
self.character:resetModelNextFrame();
triggerEvent("OnClothingUpdated", self.character)
-- remove makeup
self:removeAllMakeup()
ISTakeWaterAction.SendTakeWaterCommand(self.character, self.sink, waterUsed)
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self);
end
in which file definitions?
I have a file in my client\TimedActions folder that contains my overrides. For yours it'd probably look a bit like this:
-- Create a global object to prevent re-patching the same file
if not SharedModData then SharedModData = {} end
-- Override the WashYourself timed action
if not SharedModData.isWashYourselfPatched then
SharedModData.isWashYourselfPatched = true;
ISWashYourself.oldPerform = ISWashYourself.perform;
function ISWashYourself:perform()
self:stopSound()
local visual = self.character:getHumanVisual()
local waterUsed = 0
for i=1,BloodBodyPartType.MAX:index() do
local part = BloodBodyPartType.FromIndex(i-1)
if self:washPart(visual, part) then
waterUsed = waterUsed + 1
if waterUsed >= self.sink:getWaterAmount() then
break
end
end
end
self.character:resetModelNextFrame();
triggerEvent("OnClothingUpdated", self.character)
-- remove makeup
local item = self.character:getWornItem("MakeUp_FullFace");
if item.name ~= "EllieTat1" then
self:removeMakeup(item);
end
item = self.character:getWornItem("MakeUp_Eyes");
self:removeMakeup(item);
item = self.character:getWornItem("MakeUp_EyesShadow");
self:removeMakeup(item);
item = self.character:getWornItem("MakeUp_Lips");
self:removeMakeup(item);
ISTakeWaterAction.SendTakeWaterCommand(self.character, self.sink, waterUsed)
-- needed to remove from queue / start next.
ISBaseTimedAction.perform(self);
end
end
so instead of removing all
it just removes face eyes and lips make up ?
The above does the same as the original, I just pulled the insides of the removeAllMakeup() function out so you can specify which ones not to remove. I'll touch up the above a bit to explain what I mean
if i am correct i should make it "makeup_body" and change the self: remove makeup to something else
or should i specify each part on its own as torso arms legs and back
Since when washing it only cleans these 4 locations, anything that isn't on that spot should never get removed when washing
So as long as they're not added to FullFace, Eyes, EyesShadow or Lips, then they should be permanent. Otherwise you'll need to do like the above and filter out things you don't want washed away
Yeah, if you only attach to places like the Back, Arms, Legs, etc then those will stay
perfect
by default you need a mirror to use the needle
idk if its a good idea to make a recipe that fills the needle with ink so you can use it
since you can't restrict the player from using it if they don't have it
For that you'd want to make the needle a Drainable item. Then you can have a recipe to use the ink and refill the needle
item Yoyo
{
Weight = 0.2,
Type = Drainable,
UseDelta = 0.02,
UseWhileEquipped = true,
ReplaceOnDeplete = BrokenYoyo,
DisplayName = Yoyo,
Icon = Yoyo,
WorldStaticModel = Yoyo,
}
Here's a modded Yoyo that I have in a mod
The important parts are 'Type = Drainable' and 'UseDelta = 0.02'
The UseDelta is a division of 1, so this setting allows for 50 uses before it breaks and turns into a BrokenYoyo
module ElliesTattooParlor {
imports {
Base
}
item TattooNeedle
{
Type = Drainable,
DisplayName = Tattoo Needle,
Icon = TattooNeedle01,
UseDelta = 0.1,
Weight = 0.01,
WorldStaticModel = TattooNeedle_W,
StaticModel = TattooNeedle_S,
}
item InkBoxes
{
Type = Normal,
DisplayName = Ink Boxes,
Icon = InkBoxes01,
Weight = 0.5,
WorldStaticModel = InkBoxes_W,
StaticModel = InkBoxes_S,
}
item LacticAcid
{
Type = Normal,
DisplayName = Lactic Acid,
Icon = LacticAcid01,
Weight = 0.1,
WorldStaticModel = LacticAcid_W,
StaticModel = LacticAcid_S,
}
}
since the the needle is drainable i should do the same for the acid and ink
Only if you want to use a part of them instead of all of it at once
Yeah that should work
and then to refill it
module ElliesTattooParlor
{
imports
{
Base
}
recipe Fill Tattoo Needle
{
EmptyTattooNeedle,
TattoosInkBox=1,
Result:FilledTattooNeedle,
Time:80.0,
}
}
And you can replace the 1 with however many uses you want to spend to refill it
and time is in ticks, which are about 1/30th of a second
i am really learning a ton here ty really
Awesome, I'm glad to be of help
so if i put 2 that means i can use the ink box to refill 2 times
It would mean 5 uses. Since you have the UseDelta for the ink at 0.1, that means it has 10 uses. (1/0.1 = 10) If the recipe says it takes 2 uses, then it spends 0.2 each time. 1/0.2=5
iam sure i set up the ink to 0.5
and uses to 1
means it will use half of the ink to fill 1 needle
Yep, the bottle has 2 uses and the recipe uses 1, so 50% each time
and then the filled needle can be used up to 5 times?
20 seconds might be a bit long though
correct
600/30=20s
it does take long
every 90 is 1 in-game minute, just for reference
oh yeah, PZ considers a tick to be about 1/30th of a second, give or take
at least according the their TimedActions
now you need to fill the needle then use it when its empty it will be changed to the empty ver of it
which is a drainable
or should i just make it normal
It should just be normal since the recipe is just a complete refill
i must credit you when this mod is done
If you were only refilling part of it then you'd only have the needle and wouldn't need an empty one, but you'd have to change the way it was refilled to use a TimedAction. Much like when water is being transferred between containers.
Haha, thanks, I appreciate that
aha no need to go all complicated then
its good as is maybe in future updates if i plan to do so ... which might not be needed really
Nice, it's a cool mod idea
i just like tattoos tbh and i really did find a few to none going for them
i even tried to replace my char textures a few times for it
Looks like it sorta worked for ya, but the mod would definitely make it easier
They'll need to be added to distribution tables
the tutorial covers those no ?
Blair pinned an example page on how new distributions work
The new additions make it quite a bit more complicated since you can now specify specific tiles and rooms to spawn things in, so don't feel bad if it takes a bit to understand it. Pretty sure nobody here fully understands it yet lol
Anyone how many different first aid animations there, and where I could see them?
Yeah, you can just add them as the game does without the new stuff. Just depends on if it spawns them enough/where you want. I had to tweak mine a bit because I wanted certain items to spawn in counters with soda fountains on them, for example.
It looks like there are 8 bandaging anims
and the models for them
i want them to spawn here
but i can't find it anywhere
Hey, didn't read everything, just flew over all those messages a bit, but wouldn't it be better to inject it in this way?
if not SharedModData then SharedModData = {} end
if not SharedModData.isWashYourselfPatched then
SharedModData.isWashYourselfPatched = true
ISWashYourself.oldRemoveMakeup = ISWashYourself.removeMakeup
function ISWashYourself:removeMakeup(item)
if item and item.name ~= "EllieTat1" then
return self:oldRemoveMakeup(item)
end
end
end
That way, possible future changes to the original removeMakeup function will still take effect, while it'd ignore the tattoo?
Thankfully it seems what she wants to do won't require filtering them out, so it doesn't need to be overwritten after all. But yeah probably
Nvm. then ๐
I'm willing to bet it doesn't have its own room definition
it doesn't
flipped the whole tables up side down nothing

I have a way of checking the room type while in-game, one min while I check that location
thanks
how ?? -debug ?
Yeah, and the mod I'm working on has a container check to help with distribution. It looks like it counts as part of the aesthetic table
pog ty
so what i should do now copy the distributions from the base game and add my items to it ?
You inject your loot into the existing loot tables
There's an example in the pinned messages from Blair, but I can probably whip up a custom example in a few minutes
i read they example
its kind of hard to comprehend as Blair was quite frustrated while writing it XD
Scratch that, got another idea
@craggy furnace how would someone go about adding in modded items to your supply drops from EHE?
@drifting ore Alright here's what I got for ya
require "Items/SuburbsDistributions";
require "Items/ProceduralDistributions";
-- Add your table to possible spawn tables
table.insert(ProceduralDistributions.list.SalonCounter.items, "ElliesTattooParlor.EmptyTattooNeedle")
table.insert(ProceduralDistributions.list.SalonCounter.items, 2);
table.insert(ProceduralDistributions.list.SalonCounter.items, "ElliesTattooParlor.TattoosInkBox")
table.insert(ProceduralDistributions.list.SalonCounter.items, 8);
table.insert(ProceduralDistributions.list.SalonCounter.items, "ElliesTattooParlor.LacticAcid")
table.insert(ProceduralDistributions.list.SalonCounter.items, 6);
-- SalonCounter = {
-- rolls = 4,
-- items = {
-- "BathTowel", 10,
-- "BathTowel", 10,
-- "Comb", 8,
-- "Hairspray", 6,
-- "Hairspray", 6,
-- "Hairgel", 2,
-- "Razor", 4,
-- "Scissors", 8,
-- },
-- junk = {
-- rolls = 1,
-- items = {
-- "HairDyeBlonde", 2,
-- "HairDyeBlack", 2,
-- "HairDyeGinger", 2,
-- "HairDyeLightBrown", 2,
-- "HairDyeBlue", 1,
-- "HairDyeGreen", 1,
-- "HairDyeRed", 1,
-- "HairDyeYellow", 1,
-- "HairDyeWhite", 1,
-- }
-- }
-- }
i still don't understand how it works i am not gonna use what i don't understand
and really it will be stealing if i just take the code
DistributeTo is just a helper for adding items to the tables without having to do two table.insert() calls, then the other lines add your items to the game's distribution tables. That way when it adds items to containers your stuff has a chance to spawn
alternatively if you want to figure out distributions later, you can set your pz launch options to "-debug" and spawn items in with the tools it gives you when you play the game
i could test that out yea
do you know what i am talking about? i can show you how to do it if you have never done it before
yes its the steam options you go there and put -debug it lets you use stuff like god mode etc
๐
I changed it to just use the most basic functions. That's the most simple way you can do what you need without breaking any other spawning
For testing you can bump the numbers to 100 or more
hey simple question, or at least it was supposed to be simple, how do i add more mods to an existing save? i was told that i need to place them in the save file, the only thing i found in the save file was a .txt referencing the mods, so i placed the extra mod names in the text, but nothing happened.
would it be possible for me to make a mod that changes the drop rate of katanas, and could I make it so they are more likely to spawn in police stations
i think ogrm did something like this in the past
Yes
nice
Anyone know how make the equivalent of Thread.Sleep() ?
You want to freeze the game for a certain time? As, that is if i'm correct, lua runs on a single thread no?
Or is the goal simply to have something like a timer, to do something in specific intervals, or with a specific delay? o.o
this
in the load screen, select the save you want and on the right panel there is a "More" button, there you can access the mod list
Basically, I need make triggerEvent until get a variable
You could probably add a function onto the OnTick Event (Events.OnTick.Add(functionName)) and the function:
local delay = 100; -- replace 100 with the delay expected
local nextAction = os.time() + delay;
function myFunction()
if os.time() >= nextAction then
-- your tasks
if ValueReceived then
Events.OnTick.Remove(myFunction);
end
-- Refresh the next action time
nextAction = os.time() + delay;
end
end
Events.OnTick.Add(myFunction);
or something?
Probably can be done better, so this should just serve as an idea to solve the issue. If i misunderstood something, sorry ๐
Not sure though wether or not the onTick event runs when game is in a paused state
thank you.
Yeah! thx
hey lads
im playing with the better lock picking mod
but i cant lockpick vehicles at all for some reason
it doesnt show up on rightclick of v menu
Could somebody link me the discord to cherbourg?
Finally
LuaEventManager.AddEvent("OnTest")
LuaEventManager.triggerEvent("OnTest", "something")
local Test = function(a)
print(a)
end
Events.OnTest.Add(Test)
Wait wait, your question was regarding a custom event and not a timed action itself?
If so, I apologize for having misunderstood it that much ๐
wait a minute, is it possible to create custom events?!
yes, so long as you have a trigger. See Dislaik's code above as a simple example.
Damn... that would have helped a while ago ๐ well for sure I will make use of it
the truth is that I also needed that jaja
Oh, so both? Meaning i didn't get it all wrong! Good ๐
So you can use the Trigger your event whenever you want.
I assume the Events has to be created when the game launches or something like that so they are ready to be used later
I modified it a bit, I did a script ideal for a framework
FRAMEWORK.lua (Framework mod example)
DiS = {}
DiS.Test = "Testito from ZAD"
LuaEventManager.AddEvent("getSharedObject")
Events.getSharedObject.Add(function(cb)
cb(DiS)
end)
anything.lua (a random mod)
local Dislaik = nil
Events.OnTick.Add(function()
if Dislaik == nil then
LuaEventManager.triggerEvent("getSharedObject", function(obj) Dislaik = obj end)
else
Events.OnTick.Remove(self)
end
end)
print(Dislaik.Test) -- Returns: "Testito from ZAD"
Uncertain on what it'd be useful for (I might just be missing some imagination, sorry), but gj! ๐
Assuming the mods are loaded alphabetically (info obtained from the forum) with this technique you don't need to worry about that nor of generic variables that cause conflicts with other mods (obviusly you still need use local), you can shared data from mod to mod (need new functions for that)
So, the idea is for it to check if a certain mod is loaded of sorts?
Basically, waits for the data to be loaded
But, in case of requirement of another mod existing, you can use require, to my knowledge, even for modded files, which should (in theory) ensure that their global variables and such are loaded before it executes one's own.
While it would provide a possible way of sharing data with less chance of incompatibility due to global variable naming and such, most mods'll probably try to get the data instantly and act on it, instead of delayed (even if it's just one more tick, for example.)
Atleast, from what i imagine the most common incompatibility issues arise from injection into functions and doing stuff (possibly even completely overwriting it without ever again running the original) or due to naming fashion of variables, which get overwritten due to two mods using something similar, but naming it the same. ๐ค
(and well, items and such as well, but that's less on the lua side i guess, unless it's in regards to lua item tweaks)
I might currently be on a whole different thought train though, so I apologize if I'm completely wrong ๐
If I'm not wrong, require() just load the mod\file.lua again right?
no no
require causes a certain file to load, however, it will not load a file again, even if you have 2 different files with require "modFile"
similar to lua's "doFile", with the exception that it won't load the file again (to avoid duplicates)
Not entirely sure if it accepts files from mods though, but i would guess it does.
I mean, what happens if I have a mod, and the initial data of a variable was changed, if I make a call that mod/file.lua with require, what do i get? The initial data or the data changed?
btw, I think the version of lua who uses the game is old lmao
well, it's kahlua to be exact to my knowledge, so not "actual" lua
I thought so, there are functions in the documents that are not in the game
But if you have require for a certain mod file, you just ensure that the variables are defined from that other mod. (local variables will still be unaccessable)
so if there are any changes to them, you'll have them on the other side as well
hm? Functions that do not exist?
sorry, I'm sleeping
all good, im tired as well ๐
Ok, I will test require, I haven't used it yet, I completely forgot that environment variables don't apply here
Well, now another aesthetic snippet
..\media\lua\client.blablabla.lua
local loadConfigFile = function(path)
local readFile = getModFileReader("DCPbyDislaik", path, false)
local code = ""
if readFile then
while true do
local scanLine = readFile:readLine()
if scanLine ~= nil then
if code == "" then
code = code .. scanLine
else
code = code .. "\n" .. scanLine
end
else
break
end
end
end
return loadstring("return function() local " .. code .. " return Config end")()()
end
local config = loadConfigFile("Config.lua")
print(config.Test) --Returns "This is a testito"
..\media\Config.lua
Config = {}
Config.Test = "This is a testito"
that's... confusing... ๐
Yeah, clean code is not one of my strong points 
it's clean enough. Though using lua as a config is in my own opinion kind of confusing
though, I don't have any points that speak against it, so do not worry about it ๐
Is there anything like Events.OnCellLoad.Add()
The only ones I found that slightly go in the direction on map/cell/zone:
Events.OnPreMapLoad.Add(...) -- no args received (?)
Events.OnLoadMapZones.Add(...) -- no args received (?)
According to pzwiki, there's also
Events.LoadGridsquare -...
Events.ReuseGridsquare -...
Events.OnFillContainer -...
Events.OnMapLoadCreateIsoObject -...
Events.OnPostMapLoad -...
Events.OnSpawnRegionsLoaded -...
Events.OnSeeNewRoom -...
Events.OnTileRemoved -...
Events.OnGridBurnt -...
Events.OnPostFloorSquareDraw -...
Events.OnPostFloorLayerDraw -...
Events.OnPostTileDraw -...
Events.OnPostWallSquareDraw -...
But wether they actually exist or not(or not anymore) i don't know ๐ค (also might've overlooked some, not sure)
thanks
Headsup, careful with print() in Events.LoadGridsquare.Add(...)
froze for several minutes, so i terminated the process and changed it to just count a variable up. After finishing loading it had 38181 Gridsquare's loaded, roughly 2k more after a few steps
yea it would load print for every grid square it loads haha'
just had to realize the amount that's loaded at once... ๐
welp time to try and test out the thang
thang?
Ayy! Congrats! ๐
Events.OnTick
Events.OnTickEvenPaused
Events.EveryTenMinutes
Events.EveryDays
Events.EveryHours
how hard is map making?
can you help me for sec
I can try atleast
now you have the needle brush ink acid
the empty ones aren't usable
and the filled ones are usable for make up
how can i make it drain each time i use a make up ?
@dry chasm
i know these items drain when you drink etc. but make up was always a normal item
Hmm... never used makeup before and never did a drainable item before.
Though, how's it acting at the moment? Does it just "disappear" instead of "draining" (using parts of it)?
it's unusable ATM as you can click makeup the menu comes out empty
so i can't really tell if it will disappear or stay
So the first hurdle would be to make it useable, right?
i am new to modding and programming in general
but yes looks like we need to make it work first
Now, for the beginning you could have it possibly add "normal" makeup, instead of custom tattoos, for that i'd suggest making a backup of your file there first and then treat the needle (if it's intended to only use the needle that is) as that makeup item
so, i would guess the "MakeUpType" should change to something already existing, so instead of Body, it'd be FullFace or something
Then you could test and see if it uses it up bit by bit, or just doesn't use up any of it, or if it completely uses the item up, instead of just a part of it
Take your time ๐
so i commented out the body in definitions
and will change the item to lips for example
๐ค ? You mean you change the needle's "MakeUpType" to lips or something? Then yes (just ensure you keep most of the file somehow save to easily revert any changes - best done by saving the file in another location - preferrably with an indicator in file name to ease the work needed to find the correct one when you have a need to revert changes)
Especially when new to modding, I can't stress enough on how useful backups can be.
Still doesn't show any options?
just to ensure, how's the item looking now?
item FilledTattooNeedle{
Type = Drainable,
UseDelta = 0.2,
ReplaceOnDeplete = EmptyTattooNeedle,
DisplayName = Filled Tattoo Needle,
Icon = FilledTattooNeedle01,
MakeUpType = Lips,
Weight = 0.01,
WorldStaticModel = FilledTattooNeedle_W,
StaticModel = FilledTattooNeedle_S,
}
like so?
yes it is the same
item FilledTattooNeedle
{
Type = Drainable,
UseDelta = 0.2,
ReplaceOnDeplete = EmptyTattooNeedle,
DisplayName = Filled Tattoo Needle,
Icon = FilledTattooNeedle01,
MakeUpType = Lips,
Weight = 0.01,
WorldStaticModel = FilledTattooNeedle_W,
StaticModel = FilledTattooNeedle_S,
}
just to ensure though, a normal lipstick does show the option, right?
sec
its bugged
normal one isn't working
hmm
ok, it does work on my side
do you have anything that overwrites original functions?
yea definitions i removed it and trying it out
Oh wait, you removed the normal Makeup definitions?
wouldn't it be better to add onto the base one, instead of overwriting?
idk iam new
i could copy the base one and edit on it
sadly it doesn't drain or disappear after you use it
require "Definitions/MakeUpDefinitions"
-- adding a new category:
local customCategory = {
name = "Body",
avatarZoom = 10, -- Unsure how it's exactly used, possibly zoom on character model to see it better?
avatarYOffset = -0.30, -- Probably similar to above, just offset to the height
avatarXOffset = 0.00, -- can be left out if not necessary
category = "Body"
};
MakeUpDefinitions.categories["Body"] = customCategory;
-- adding a new Makeup:
local customMakeup = {
name = "TattooFullBody1", -- Just the tattoo name? Probably usable with Translation?
category = "Body", -- Category the makeup is supposed to be for
item = "ModModule.TattooItem", -- the item referring to the tattoo, not the one needed to apply the tattoo (not the needle)
makeuptypes = {
All = true, -- No clue, not used makeup enough to understand it.
},
};
table.insert(MakeUpDefinitions.makeup, customMakeup);
Possibly?
oops
insert yea
good catch
was checking the parameters on the wiki to see if there is one that can make me drain on make up
but no nothing there
Also you are correct that AvatarZoom and AvatarOffset determine the location where the menu zooms on the player character. Itโs quite adjustable.
Thanks for confirmation! ๐
You can use that to zoom in on any region of the character.
so when making definitions for a mod i just use the base code and edit on it
then add it to my mod folder?
You could probably inject onto the onApplyMakeup method of ISMakeUpUI
local originalOnApplyMakeUp = ISMakeUpUI.onApplyMakeUp; -- either this
-- local ISMakeUpUI.originalOnApplyMakeUp = ISMakeUpUI.onApplyMakeUp; -- or this
function ISMakeUpUI:onApplyMakeUp()
if self.item:getFullName() == "ElliesTattooParlor.FilledTattooNeedle" then -- check if the item used for the makeup is infact your needle
self.item:Use() -- unsure here, like i said, never made or did anything modwise with drainables ^^'
end
return originalOnApplyMakeup(self) -- either this
-- return self:originalOnApplyMakeUp() -- or this
end
no no, as it's just variables (tables) you can just expand on them straight away without having to overwrite them like in my example above (unless i made a mistake)
the local variables are just for the file you're currently in and beneath both local variables in the example above, we add the local variable onto the original definitions
MakeUpDefinitions.categories["Body"] = customCategory; is so to speak the same as MakeUpDefinitions.categories.Body = customCategory;
as MakeUpDefinitions.categories already exists due to the original definitions file, we just add your category definition onto it in the same fashion the original one expands it (in this case, might be changed in the future though, who knows)
As for the other one, it uses a table like a list, instead of like an object.
The difference here is that an object can have named properties (or variables for simplified matters)
while a "list" can be iterated with numbers, if you wish to have a slightly more detailed explanation I can try my best (though i may just link this here for starters)
https://www.lua.org/pil/1.html
but won't it trigger each time i open the ui?
the onApplyMakeUp? It will only trigger once you hit the "Apply" button, if available
great
the lua docs are usefull
@dry chasm
like this
wait, have you just copied the whole file over into your own? ๐
that's what i said

Sorry to interrupt, is the steam workshop broken for someone else? the discussion sections within the mod pages are gone for me, and the mods don't display dependencies/required items.
Not all mods have dependencies, so I guess in that regard it's depending on the mod and regarding discussions/comments, it is possible that the mod-author disabled comments/discussion on it.
(Personally no issue on my end)
Workshop is also hosted on its own server and it's not very stable at times
Yeah, I checked Arsenal26's gunfighter mod since I know that mod has dependencies and has an active discussion section for bug finding and seems like they are having the same issue.
anyone knows a way to add a body location under the bandages ?
like this but i don't wanna edit the base file as i want it as a mod
So are most clothes (basically everything except hats, jackets, skirts, and dresses) just textures mapped on to the body?
Did they change the way clothing was coded into the game, I was trying to add clothing recipes, but it stops the crafting menu from working(I might just be stupid tbh)
ok I compared my code with another mods code and I still have no idea what I did wrong
maybe
Yes. A quick way to tell without knowing anything about 3D modeling here is to look at the characterโs feet. XD
Hi all, bit new and trying to figure out how to properly handle a system i'm making for special zombies, I can see a zombieUpdate event which I'm assuming is just a processing event, but is there any way to do something to a zombie on its creation?
has anyone noticed the discussion tab on mods in the workshop has disappeared?
yes
update history is gone too
Oh shit really?
What happened?
Weird
is steam bugged? or did an update happen that they didnt tell us about?
wait did the entire discustion tab of steam disappear too?
no but the search engine isnt working
nvm didnt have enough terms for it to work with xux'
the tabs are back now >.>
weird....
Probably was maintenance related. If they wanted to permanently remove them, they would have created an announcement about it.
I know that is very easy to do it, but for an average user might like
My first mod lmao https://steamcommunity.com/sharedfiles/filedetails/?id=2614689655
cranks up military spawn rate to 100%
finally more fallout mods
Nuka victory and nuka shine has just been added, we basically have all flavors now
also that's very cool lol
how many flavors?
10+
All models are 3D and quantum has some life saver combat effects
Drink one and you are back in fighting shape
I am going to make a stimpack mod, just not the stimpacks from fallout but from stalker anomaly

Still stimpacks that will aid in healing
Well should be easy to make a model for fallout stimpacks if the code is done
Might consider it
congratz
Also you'll don't need anymore flashlight or anything because you will glow blue during night
We could not figure out the lighting for quartz and quantum, will maybe coming in a later update, with updated models
hallo newbie here, evolvedrecipe is for starting cooking right (e.g. Prepare Stew)? and recipe is just for the normal crafting menu? thanks
You're right. But cooking can be done through standard recipes too. Evolved are needed when ingredients are variable, picked from a list
Thanks! And should I want to add vanilla ingredients to my evolvedrecipe, I use itemtweaker? to add EvolvedRecipe = to the item/ingredient?
wait, does itemtweaker ammend or replace? of course it replaces duh sorry for the stupid question
Yeah, if you want vanilla items in your recipe you need to override that value
hhmmm I should probably write a function so that multiple mods can override that value with no conflicts
Yea just adding your items to the evolved recipe param would be better. Can't think of any solution out the top of my head tho
. Thanks a lot for the help!
https://github.com/ssjshields/pz-crash-auto-launcher this is a tool for anyone interested in not constantly having to open and close PZ 24/7 while testing stuff (like tweaking text files) or having constant crashes
Is it possible to spawn particle effects? I know it's possible to do smoke by spawning grenade effects but I was curious what else is possible
That's nice and all but can't most stuff be reloaded with F11?
some scripts and textures cannot
Oh, ok. Got it. Ty
some of find a large bulk of our time redoing that over and over lol
iirc on the top of my head the only stuff that resets is xml, models, and (i think?) lua
I did that for a long time before finding out f11 could be used to reload stuff.
i'm only learning about this ๐ฎ
which part?
Anyone know the name of the mod where you can spawn with food?
It's like preparedness or something like that
The f11 to reload lua stuff? Yeah it's useful info. Took me some lurking to learn about it.
Lua can be reloaded via the debug's F11 menu if necessary. Though, it can cause issues depending on what and when one reloads.
For example a file that just adds on to variable would just add unnecessary duplicates to it, so the original file defining those should be reloaded first and such.
Alternatively, when "injecting" into other functions and one has an error there for example, that too would require the original to be reloaded first, then the modded file.
Then there's also the possibility of adding on to non-lua defined stuff, reloading those files doesn't help either.
So once issues come up, it's best to go back to main menu and just reload all lua/mods or even better yet, completely restart the game for those issues (to ensure it's all run nicely). So yea, restarting's still a good thing for lua as well, depending on what exactly one works on ๐
In vanilla you can start with a survivor bag in the sandbox options. The mod I know that does this with professions is
https://steamcommunity.com/sharedfiles/filedetails/?id=1908499360
good to know, ive only written stuff sparingly for zomboid
i mostly do mapping/sprites, map stuff always needs a new game anyway, but i'll have to check reloading for sprites or tile properties when i can
i have yet to try that myself
i just learned that (some) scripts actually do reload?
bizarre
Can some please make a mod to bring back 360 degrees shooting from a vehicle with a window open... miss it so much lol
You can add maps to an existing save!
Bit of a dark art if you've already explored the area in question, but if you've never explored the area you want to add the map to then its actually really easy!
I wrote it down somewhere...
"If you've found a new map that you'd like to add to an ongoing playthrough please follow the following steps:
- Subscribe to new map mod(s).
- Enable the new map mod(s) on an existing save (Save A).
- Create a new game with the same map mod(s) enabled (Save B).
- Quit back to main menu.
- Find Save B's files (usually located in C:\Users\USERNAME\Zomboid\Saves) and copy and replace 'map_ver.bin' to Save A's file location (backup original).
- Load Save A.
- ???
- Profit.
Removing maps or clearing an area where you'd like to add a map (in the case you've already traveled to the area before adding the map) can be done similarly, however every cell ('map_XXX_YYY' and chunkdata_XX_YY) associated with that map mod needs to also be deleted (which can be quite an arduous task to figure out exactly which those are). I recommend using the PZ Map website to help identify the coordinates if you choose to undertake this task (https://map.projectzomboid.com/).
Also, you can update the games settings mid-save by following the same process for the map_sand.bin file."
yeah, not fast at all when you're wanting to test small changes, but thanks
Oh definitely not for quick QA testing
that's helpful stuff otherwise!
cool
Does anyone know which event to check when the player performs an attack on a zombie, is it possible to make attack animations with which event I make animations?
its ok i got it
I have no idea if this would work or not
and if so how do I make it so that it drains batteries?
Does anyone know where I can find Recipe.OnTest.TorchBatteryInsert?
Or maybe I can just use that for the videogame?
this is what im going with
-- Return true if recipe is valid, false otherwise
function Recipe.OnTest.TorchBatteryInsert(sourceItem, result)
if sourceItem:getType() == "Torch" or sourceItem:getType() == "HandTorch" or sourceItem:getType() == "Rubberducky2" then
return sourceItem:getUsedDelta() == 0; -- Only allow the battery inserting if the flashlight has no battery left in it.
end
return true -- the battery
end```
lua\server\recipecode.lua
-- Return true if recipe is valid, false otherwise
function Recipe.OnTest.TorchBatteryInsert(sourceItem, result)
if sourceItem:getType() == "Torch" or sourceItem:getType() == "HandTorch" or sourceItem:getType() == "Rubberducky2" then
return sourceItem:getUsedDelta() == 0; -- Only allow the battery inserting if the flashlight has no battery left in it.
end
return true -- the battery
end
-- When creating item in result box of crafting panel.
function Recipe.OnCreate.TorchBatteryInsert(items, result, player)
for i=0, items:size()-1 do
-- we found the battery, we change his used delta according to the battery
if items:get(i):getType() == "Battery" then
result:setUsedDelta(items:get(i):getUsedDelta());
end
end
end
Looks like the Recipe.OnCreate.TorchBatteryInsert is what you want
I suggest you copy this function and make one for your mod rather than making a new copy of recipecode.lua and altering it 
Yeah I agree, Im definitely not advanced enough to doing that
just make a lua file on lua\server\ then add your function to it. The recipe.txt file can find it as long as it's global
Here's how I do it in one of my mods
Umm this might be dumb but I can use notepad++ to edit those lua files right?
yup!
sweet
idk if you get syntax highlighting but it should work even in normal Notepad
Thats neat! economy mod? and yeah i figured but i had it and wanted to make sure real quick, gonnna go mess around with it for a bit
Couldnt I just edit recipecode directly?
You theoretically could, but if the game updates and the devs change something in recipecode.lua, you would have to update it on your mod aswell.
Good point, Ill make a new file then
It's best practice to just make a lua file containing the function for your own needs
I have zero training in Lua, just a basic general programming class
But I understand that
Yea it is daunting at first but you'll get the hang of it
Yeah, just have to update it for distribution changes
Also making the money stack weight change as you gain more money
faT
guys are you ready for the tattoo poll vote closes in 24h
We need a marine corps tattoo
marine raiders boi
luckily it'll be just as easy to add new tattoos as it is to make clothes once the mod is released
Any reason there was not a military option?
dw iam planning on a elliesoutfitshop soon XD
hehe
poll is limited
but dw if i see your vote ill leave eyes on it
Okay, so everythings looking good, battery goes in, battery goes out. neat. but now it looks like this recipe duplicates the videogame everytime i go to play
hello question on recipes, is it possible to add multiple outputs in the script file? or are we just stuck with just spawning it through lua? would like to see the output through the crafting menu tho
sorry thats not the recipe
this is, idk why it duplicates the item when i go to use this recipe
What does the code for your OnCreate event look like?
I think you need to have destroy VideoGame
Ahh, yeah that's what is missing
recipe Play Video Game
{
destroy VideoGame,
Result:VideoGame,
...
idk kinda janky but i think that works
why not make it a timed action?
yea makes more sense that way
Isnt it already timed?
i have added more options also you can check https://www.pitbulltattoothailand.com/tattoo-knowledge/top-10-tattoo-styles/ before you post your vote just in case you wanna better understand what your looking for https://www.poll-maker.com/poll3916683xf2A1241A-124 vote end in 11 pm eu time tomorrow
โ Learn more about the different tattoo styles. โ No matter if youโre looking for traditional tattoos or modern art โ Find your style
So while you guys are right about destroy videogame, now the battery level doesnt save and just makes it so it has full battery everytime i use it ๐ซ
i think filcher's right, making it into a timed action (context menu) makes more sense if you are using it (not replacing batteries) instead of making it a recipe. Haven't tried making timed actions so i can't help you there sorry. Try looking at the base game timed actions and see if some files can help you
do you know an example of a base timed action?
check luaexamples\testtimed.lua
thank you!
Here's one of the simple TimedActions I use
Feel free to copy it so you can change it for your use
My food mod is nearly done, what translations are mostly used?
russian and chinese
i see the soul filcher
would you be interested in
There are a lot of Russian players, so definitely that. There's also some Chinese, Spanish, and Portuguese
whatever was common in 90s US
aighty thanks!
"The tattoo trends of the 90s were heavily dictated by popular celebrities of the decade. The barbed-wire arm band became hugely popular thanks to Pam Anderson; both men and women flocked to get tattoos to match the Baywatch beauty.
We canโt forget the classic 90s tattoo fads โ sun tattoos, Chinese letters, and tribal designs were massively popular during the 1990s. Upper arm tattoos were big during this decade.
You werenโt anybody in the 1990s if your tattoo didnโt match one of these super trendy fads; if the Spice Girls did it, you knew it was cool."
Sounds like we'll need the obligatory "MOM" tat

lol
is it possible to create an armor and some sort of upgrade for it? I know a bit of modeling but I have no idea if it's possible to do something like that
Any guides for 3d item models? forgot i needed to make those
pins
Alright I give up, timed actions is way beyond my skill level
what are the things you need it to do?
decrease unhappiness by 10, decrease boredom by 10, drain battery by 20% per use, time to use should be 300
and obviously no uses when battery is 0
How do I reference items that aren't in Base inside of a custom script? I have a trait mod that adds new traits and inventory items to traits but I don't know how to import items from, say, camping into it so that I can reference them without generating errors. I'm apparently not great at LUA.
I was trying to do a big update to my Embark mod but hit this quite embarrassing barrier when I realized all my camping derived items were spewing errors. ๐ซ
This should do the trick for you
require "TimedActions/ISBaseTimedAction";
QoLESPlayAction = ISBaseTimedAction:derive("PlayGameAction");
function PlayGameAction:isValid()
return self.character ~= nil and self.item ~= nil and self.item:getUsedDelta() > 0 and (self.bodyDamage:getBoredomLevel() > 0 or self.bodyDamage:getUnhappynessLevel() > 0);
end
function PlayGameAction:update()
self.item:setJobDelta(self:getJobDelta());
end
function PlayGameAction:start()
self.item:setJobDelta(0.0);
end
function PlayGameAction:stop()
self.item:setJobDelta(0.0);
ISBaseTimedAction.stop(self);
end
function PlayGameAction:perform()
-- Reduce uses
self.item:Use();
-- Change mood
self.bodyDamage:setBoredomLevel(math.max(self.bodyDamage:getBoredomLevel() - 10, 0));
self.bodyDamage:setUnhappynessLevel(math.max(self.bodyDamage:getUnhappynessLevel() - 10, 0));
-- needed to remove from queue / start next.
self.item:setJobDelta(0.0);
ISBaseTimedAction.perform(self);
end
function PlayGameAction:new(item, character)
local o = ISBaseTimedAction.new(self, character);
setmetatable(o, self);
self.__index = self;
o.stopOnWalk = false;
o.stopOnRun = true;
o.character = character;
o.bodyDamage = character:getBodyDamage();
o.item = item;
o.maxTime = 300; -- Time until the action finishes (in ticks; ~30/sec)
return o;
end
300 ticks, drops each by 10 and does one use for 20%
Sorry so just import that into timed actions? How do i call it?
save that as a file in your mod's lua/client/TimedActions folder
then you can call it with PlayGameAction:new(item, player)
and that would go under the item VideoGame?
You can add PlayGameAction:new() to your OnCreate function
and I assume you pass through the item & player variables
oh wait
sorry dont mind me that was wrong

no, since you are not using a recipe
that'll get you banned my guy
it's not ready for MP, so they're very against anyone trying to mod or hack it in
they're going to break your game in one way or another each update, so no point really
true
do we know WHEN its coming?
no hard date, but the latest blog posts make it sound like it's going well so far
good
Around December from what we heard
Here's how you can make it work by creating a new context menu item with the option to "Play Video Game" and will start the timed action as long as it has uses
MyMod.createMenu = function(_player, context, items)
if #items ~= 1 then return end
local item = items[1];
if type(item) == "table" then
-- We jump over the dummy item that is contained in the item-table.
item = item.items[1];
end
if instanceof(item, "InventoryItem") then
local player = getSpecificPlayer(_player);
if item:getType() == "VideoGame" then
context:addOption("Play Video Game", item, MyMod.playGame, player);
end
end
end
MyMod.playGame = function(game, player)
PlayGameAction:new(game, player)
end
Events.OnPreFillInventoryObjectContextMenu.Add(MyMod.createMenu);
You'll want to change "MyMod" to whatever your mod's module ID is of course
And that file gets saved to lua/client/UI in your mod folders
Brilliant man, you solved all my questions, I'm gonna finish this thing tonight!
Awesome, hope it works how you want it!
How do I check when right clicking the world if it's a zombie I'm clicking at?
- a dead zombie
oh
got it
require('camping'); require('farming');
Is this correct for accessing non-Base items using inv.additem?
Also I think that UI file should put in the client/context, right?
or the ISUI probably
Added optional vehicle.passenger.showPassenger=true|false parameter for iBrRus.
can't wait for tsar's motorcycles and bikes
Idk if anyone can review this but this wont show up in my mod list and I dont know why
Are the old sound files (before the soundworks update) still in the game files?
MODDING
- Added optional vehicle.passenger.showPassenger=true|false parameter for iBrRus.
When true, the player model isn't hidden when entering, exiting or sitting in that particular seat.
Motorcycles
Ye
Oh shit early implementation of a piece of the car rework?
Cars with no roofs
Can sit in toilet to use tp.
Shit mod when?
I've fixed it so that it loads into the mod list and shows the right-click menu, but I'm off to bed now so I pass it back to you lol
Are vehicle gas tanks always on the left side?
ok I think vanilla vehicles are always on the left and Filibuster has some on the right. Kinda annoying. Time to make a fuel indicator mod.
is there a mod to make portable coolers that workings?
make it more balanced by have to find ice pack to keep food fresh and the cooler has small volume only so 5 kg of food maximum
it would be cool so i can ride around my car and i am not sad when my egg sandwich is rotten
https://steamcommunity.com/sharedfiles/filedetails/?id=2613596656&searchtext= cool mod (literally)
saved my burgers too
thank you so much
np
will save my egg sandwich too
Hm, but if I do like inv.AddItem("camping.CampingTentKit"); for example, it results in an error message and I'm not sure why. All items from Base work though (like Base.Sheet, etc). I mean, I guess I can try again, maybe I'm making some kind of spelling/capitalization mistake.
hi does anyone know which color is XYZ 
and does kahlua support vector3(x,y,z) or do i have to calculate distance manually 
Usually red X, green Y and blue Z
Thanks!
He said : not .
There's a difference between the two, : supplies inv as the first argument :)
Sorry, to be clear that is what I'm doing. I made a mistake in my Discord message.
I'm in IWBUMS
Yeah, base items all work, but stuff in the camping/farming category do not
hmm then I'm not sure personally. Sorry
what error does it throw
(Why aren't all items just in base, the camping category is literally like 5 items... ๐ ) lol
by the way, module and item name is case sensitive as well, so you should ensure those are correct
Yeah, camping and farming modules should be all lowercase, right?
farming not sure, but on my quick test right now, camping is lowercase
and works on my end
Hm, so frustrating
so as example getPlayer():getInventory():AddItem("camping.CampingTentKit")
in the command console did work
alternatively, there's also the possibility, depending on when you try to add it, that for some reason the module hasn't loaded yet, which I can't imagine actually happening.
Yeah that seems pretty unlikely - my mod is a trait mod that adds items to your inventory when you finish character creation and load into the map during the black screen (which is also when the error pops) and those camping/farming items are the only ones that pop errors
what exactly is the error message?
Not very descriptive unfortunately, here's what's in the console.txt
function: initEmbarkItems -- file: EmbarkTraits.lua line # 97
But doesn't say what the issue is...?
is it an actual error throw, or a LOG : GENERAL ,x>ERROR: ItemContainer.AddItem: can't find...
aside from the location, shouldn't it throw more info?
Or, is this supposed to be the full error?
`LOG : General , 1633073838007> -----------------------------------------
STACK TRACE
Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@b4a69738
function: initEmbarkItems -- file: EmbarkTraits.lua line # 97`
<@&671452400221159444>
wtf
don't click the link
line 97 is the playerinventory.AddItem()?
Yeah it is
oo im stumped also
wouldn't hurt to restart pz ๐ i just had an error that wouldn't go away and it magically disappeared when I restarted
but you're sure other items do work?
100% sure
That's why I originally asked if I was supposed to like... "import" farming/camping into the script somehow... I feel a bit dumb, I've been doing C# coding for years but I'm shite at debugging lua
kahlua on top of that, vanilla lua is easy to debug but slap lua on java and it gets blurry as hell
i haven't had any errors on my end yet that weren't informative ๐
most of mine were like this:
Also my mod is quite popular and I feel bad that I'm too stupid to update it with this stuff I'm adding. lol
simply the "Object tried to call nil in console" type of issues is such a great help for example.
Hmm, yeah
this was the guy that was bugging me for an hour until I restarted and it was gone lolol
Interesting... I mean, I can try restarting the game with the mod still loaded and see if that somehow jiggles it to work
I'd be pretty mad, but ๐
sometimes it needs a lil slappin
if you hadn't done that yet at least once, you should... xD
i assume you slapped that function into an onEvent or similar?
In such cases, it's best to remove the original from the onEvent first and then add in the new one. You can even do it via the command console
That way you're able to avoid having to restart it in this case
yea, doing it right now since it's been tested and works
Oh my god I'm going to hide myself for the rest of my life, I don't even want to say what the problem was
lol
we all make silly mistakes. From bad typos, to commenting something out and ignoring it for the rest of our lifes bashing our head against the walls. (just sliiightly overexaggerated, but you get the gist)
So, I HAVE been using : like a good smart boy the whole time in the rest of the script, but as I said I am a C# programmer and... for that ONE line, I fell into the habit of using the . and so whoever pointed that out earlier, I really should have double checked the actual script
I think I need a coffee
you can continue using . in most cases, you'll just have to remember passing the object you call it from as the first parameter
did you know that if you comment in difnentions the file wont work XD
Might not be the best solution, but if necessary i don't think that it'll cause issues
in definitions? as in lua/shared/Definitions?
yea
YES that also bugged me yesterday lmao
i checked the console XD and dam that was funny
but... i do have comments in there?

not sure where the problem should be, as it works on my ends with comments o.o
just to ensure though:
You don't mistake script comments with lua comments and the other way around right? o.o
i use ctrl+/ on lua (vsc) and manual on scripts
not using vsc so no clue there. ๐
probably inside a texture pack
oh right, i remember seeing these with the zomboid logo
