#mod_development
1 messages Β· Page 460 of 1
Did... the swat mod get taken down?
https://steamcommunity.com/sharedfiles/filedetails/?id=2091564445
Oh it looks like it got updated/changed to this?
Nice.
Yup, updated to the new one and all good again π
Does anyone know if instaceof() picks up on extended classes? Like will IsoPlayer also register as an IsoGameCharacter?
It does, noice
Are autosaves with backups be something you guys would be interested in? It would be a mod that automatically creates a new save file every time you sleep allowing you to load a save from for example last day when you happen to die
Yea I like the idea of one backup save personally as well
another thing I would like to see: continuing a save be less painful.
like maybe have all professions give double the stats after a month of play time if you decide to continue a save
or a new character made after a month on a save would get a x2 exp boost for levels 1-4 of a skill
Do you still need to do that thing of copying and pasting files for some reason?
Those are interesting ideas
It would definitely be easier for players to continue after dying
yeah like new characters are just so painful I see most just start a new save. You loose all your stats, you get no tv boosts, if it's like a month after the start then you need to deal with 1.5x zombie population, all the 'fresh' food will be rotten / gone so you have less resources to scavenge up.
Characters generated later on in the game need to start with some gear and clothes
Probably at some random location on the map (not really random but not just a house)
With some more skills like you mentioned to show that they are survivors
yeah, any reason to actually continue a save beyond the first death would be welcomed
how would one go about adding items into the loot table of bags, gun cases etc
can't seem to find much of anything about them in the game's files
table insertion!
I would've hoped it's that simple, but I can't seem to figure out what the tables are for these
you get your items and the values and you put them on the tables
the tables are on the lua/server/items and it's called suberbDistrubtions
you can also look at mods like brita's, scrap armor/weapons, ect to see how they do the insertion
I've already added items to the tables, but I mean specifically the ones that govern whatever spawns in bags and such
Like you know how gun cases can have a gun and a magazine in it
it's a table in the table
FirstAidKit = {
rolls = 1,
items = {
"Bandaid", 200,
"Bandaid", 200,
"Bandaid", 200,
"Bandaid", 70,
"Bandage", 200,
"Bandage", 20,
"Bandage", 10,
"CottonBalls", 200,
"CottonBalls", 70,
"CottonBalls", 30,
"Disinfectant", 100,
"AlcoholWipes", 200,
"AlcoholWipes", 70,
"AlcoholWipes", 30,
"Tweezers", 100,
"SutureNeedle", 100,
"SutureNeedle", 50,
"SutureNeedleHolder", 50,
"Scalpel", 5,
"Gloves_Surgical", 5,
"Scissors", 5,
},
fillRand = 0,
},
Tote = {
rolls = 10,
items = {
"Plasticbag", 55,
"Plasticbag", 50,
"Plasticbag", 50,
"Plasticbag", 50,
"Plasticbag", 50,
"Plasticbag", 50,
"Plasticbag", 50,
"Plasticbag", 50,
},
fillRand = 3,
},
PistolCase1 = {
rolls = 1,
items = {
"Pistol", 100,
"9mmClip", 100,
},
fillRand = 0,
},
so you just need to insert your item into these tables
oooh nice, thank you
out of curiousity which file are these initialized in?
for some reason I couldn't find it
Not that I know of, I just subbed to the new mod and was good to go.
media\lua\server\Items Distributions
fair warning, that loot table format will be changing over the coming updates
look into procedural_distributions.lua within the same items folder to see how it works in conjunction with the distribution.lua file
Can you provide an explanation as to what it does differently?
@undone heron have you looked inside of ISWearClothing.LUA?
looks like they use function ISWearClothing:isValid() return self.character:getInventory():contains(self.item); end
to check if the player has clothing on or not
that checks the inventory to see if it has an item, which is the whole inventory. not if it's on a slot or not
Right but you could then probably check if it is equipped or not from there
there is also local location = self.item:getBodyLocation()
and, self:setAnimVariable("WearClothingLocation", WearClothingAnimations[location] or "")
in summary, a room's containers decide which of the procedural_distribution entries they will use and then roll against those items, so you could have one counter with plates and then the next full of canned foods in a kitchen rather than just a massive mashup list like is presently used for most room defs
look at how gigmart entries are structured as example
also check out the bedroom example for variation based on furniture present in room
ah, so gigamart already used this to some extent before?
sounds much better honestly
anyway to disable or reduce car spawns from swat pack?
I'll see if Relih can reduce it a tad
no problem, i think it was a bug from 90's balance(it was for redux so when it was used with the new update it just spawned swat trucks everywhere lol)
New Snow Ghillie and CEDA Hazmat zombies
peach youre the best modder i know
#i-love-peach
The mod's already on the workshop, although it doesn't feature the west point gun store key working for the door, that's just test bed stuff.
Given how everything is made out of paper mache + how easy it is to farm keys, specific door keys as loot is kind of silly given the contortions needed to make them work and spawn.
what is this key mod called >.>
hold up before i sub to this mod would it change anything like the main menu or the song when starting a new game?
it says on the mod page that it might do those, so just get it and see i guess
honestly i have been thinking of getting it for a bit but i dont think that its compatible with a lot of different things that i have
and besides, i dont think that i am THAT much of a masochist
@nimble spoke Hey man, wheat seems to be throwing an error once it reaches the rotting stage
Or am I doing something wrong?
Finally, my Piano mod is ready! https://steamcommunity.com/sharedfiles/filedetails/?id=2465017864
Actually, you can watch the demo here: https://youtu.be/PZjSgizQyfc
Simple Playable Pianos is a mod for Project Zomboid. This is a demo.
Mod is available at: https://steamcommunity.com/sharedfiles/filedetails/?id=2465017864
Have your Project Zomboid character learn how to play the piano!
- New animation for playing the piano
- 11 levels of piano levels
- Unlock new songs every time you gain a level
- Play th...
Looking great!
Thanks for teaching me about PZ custom animations!
you sir are amazing. i would actually like to incorporate this into my custom map world eventually. hopefully it is configurable for further expansion
@late hound regarding the pinball animations, in a similar stream to my above quote, will these be configurable to add new tiles such as DaddyDirk's arcade tiles. Hopefully all us mappers need to do is add a simple mod check and tell it to add functionality to additional tiles on the map.
These arcade and pinball machine animations are referenced by string values in the lua. So yes, they can be used for whatever you want.
Anyone ever think about making something that would consolidate all the items that can pour into themselves? Like thread. Tedious when you have man and are trying to save on weight.
I believe this mod will slap together threads that are at lower than 100% into larger stacks
So say you have 10 thread at 50%
It will stack them into 5thread
which then unstacks into 5 full thread
not exactly what you want but sorta
Thank you will try now.
@hollow cloud Actually, scratch that (unless you also want that mod).
This is exactly what you're looking for: https://steamcommunity.com/sharedfiles/filedetails/?id=1912072507
I have that one. Issue is that it all needs to be done by hand
If you have 70 thread you have to click on each to consolidate it into another one. Was looking for an option to be able to click or hotkey and allow script to run filling up all partials
heh
the stacking one should help then
you can make some pretty fat stacks with it and as far as i can remember it also consolidates in one action
OK. Trying now
Does anyone know of a mod, or if it's possible to make one, that separates the addition of spices from the addition of condiments/meats to food?
you mean like a different item catagory?
Yeah, I got a few players reporting that one. I will update the mod as soon as I find why
Thanks man
Piano mod looks neat! Are there any old jazz standards that would work on it?
Stardust or King Porter Stomp would be neat
Any mod recommendations to spice up the game? (For build 41)
you didn't add What Was Lost as a playable song, bad mod
;P
petition to make this man add What Was Lost
That's kind of funny. I'm currently learning Take the A Train on piano, but I didn't include ANY jazz in the song list. I guess once I have A Train down, I'll have to go update the mod with a few jazz pieces!
I don't know that song. Can you hum a few bars?
hehehe
everyone who plays this game knows WWL
https://www.youtube.com/watch?v=RExBRIA63EQ @grave solstice
Music created by Zach Beever
Cool Main Menu by Indie Stone
Download the track (MP3)
https://soundcloud.com/kenneth-chou-406977656/project-zomboid-remastered-ost-what-was-lost
(Click the "... more" button and then downloads to obtain the mp3 file, tell me if there's any problems).
I've got tons of Duke Ellington's stuff on file. Nice choice!
wrong version
Project Zomboid game by The Indie Stone. Song composed by Zach Beever.
newest version
everyone knows What Was Lost π
How can a PZ song exist in PZ? Well, no issue since the song didn't exist in 1993.
B
R
i mean
PAWS exists in the game
yet it didn't exist in 1993
Β―_(γ)_/Β―
whatever i tried
Hey, is there a efficient way of defining the loot distribution or you can only do it by hand in each place that you want?
I'm working on that currently.
i hate fucking with distro's
When I'm done you'll be able to define contents for stuff by just messing with the procedural containers instead of room by room 'RandomStoreThings' and 'OtherStoreStuff', etc..
'StoreCounterTobacco' 'BookstoreBags' 'ClothesStoreHatsFormal', etc.
store counters don't even hold loot anymore xD
Ooohhh that's really nice
I'm staying away from professional recordings in the mod, since a random Zombie Apocalypse survivor is unlikely to be that good. But I'm sure I can scare some recordings of my favorite jazz pieces for the mod. Stardust would be near the top of the list.
Fantastic! Even some lousy MIDIs of Scott Joplin tunes would make me smile like an idiot
Maple Leaf Rag is already there.
Oh, sorry I only watched the first part of the video.
Custom anims being a thing blows my mind
Not in the video, but it is one of the 40+ pieces in the mod.
The custom animation doesn't look right with Maple Leaf Rag's tempo, but I did like the way it looked when I hit fast forward!
Maybe in the next version I'll give each piece a tempo designation, and adjust the animation speed accordingly.
That sounds fantastic. Piano is one of those things I really wish I had been taught as a kid.
What's your impression of 'Finger Buster' lol
Here's my final (for now anyway) take on this rocking tune. This piece is so damn fun to play that I thought I'd have another go at it, this time played even faster than my first two attempts. Enjoy!
Crazy.
One question
Procedural means that the item will 100% spawn without roll? depending on the min and max amount?
The min/max is how many of that container type will spawn. Check the containers in ProceduralDistributions.lua and you'll see the rolls/items
the item roll itself is contained in the procedural_dsitro table. the min/max in distribution is as Baph said, the amount of times that particular loot table might be used
looking at the item rolls themselves, things like antique oven have 10,000 set for their roll
That's a bit overkill but was intended to ensure the item always spawns lol
btw baph, noticed more changes in the distro change log today π
already prepping my map for those changes
look like furniture will be in crates....more themed industrial locations is good
Not sure if they'll end up in warehouses/factories but they'll fit nicely in storage units and furniture storage rooms. They're good for disassembly for XP/mats too
yeah. i actually always wanted to have crates with furniture in rear of furniture shops rather than tools and other odd bits
the changes will really add flavor to locations
So Procedural is mostly used for a large amount of loot that has to go in the same place over and over? like the ones used in the kitchen: "KitchenDishes" ?
Bingo!
Can be used for places with loads of containers to give them a bit more variety instead of having each one be a big grab bag of each item. Pots in one thing, cans in another, etc..
The tool store for example. Big piles of stuff. I'll organize things a touch more, certain tools with other tools. By function or something
Ohhhh that's really nice, doens't spawn too much of one thing in one container
If in my mod distribution list I change a container from procedural to the other type with rolls and put one single item in there, will it mess up the Vanilla Distribution?
conflict or something
Yep! The game will crash actually lol
If a container has been switched over to procedural, it can't have loose items because the entries under procList need to be tables with values 'name', 'min', 'max' etc..
If it's an item, it'll return a string instead then throw a fit
lol
then I better not mess with it for now
Honestly, at this point, my advice is that everybody just hold off on anything distro related until Baph's distro-pocalypse improvement goes live?
That business is seriously fucking with my own plans right now .
Furniture related mod crafting too.
The workshop comments etc. are going to be a complete clusterfuck when this distro business goes down.
@red matrix Hopefully I got this right and its worthy of a pin
you should properly pin that
I think the smaller dresser is also type wardrobe? You can see the type via the top bar in inventory-- I think 'wardrobe' is Cabinet
Yeah, i assumed it was sidetable....my bad
i dont think it will make a diff explaining things
the bed is also a custom coloring of mine π
'junk' is also more of a 'non-modifier' version of the item roller. The numbers aren't affected by the world's loot stuff-- the thing that ties zombie density to loot
Like, if I put '10' for an item that isn't under 'junk' it won't actually be '10', but something messed around with by the various modifiers. Even '100' won't necessarily result in an item always spawning in that container-- unless it's under junk
I like the color job! Nice bed!
@red matrix updated version removing the sidetable line
Huh, I had no idea junk was more likely to spawn.
its so hard explaining the loot system to mappers without having an image showing all three elements side by side
Nice job!
Ohhh, so junk isn't affected by zombie density?
So the stuff I want to have a 0.000001 spawn chance will actually have that spawn chance if I put it in the junk table?!?!?
Yep!
Oh thank goat, that zombie density business was such a pain in the ass for super rare stuff like necronomicons.
i kind of figured that would be the case when i noticed some entries repeated in that section. i always thought junk was a nice to have thing
Or porno mags-- or bags loaded with firearms
Thinking those things would be rare in rural kentucky....
@willow estuary there was the porn mag drought of '92 IIRC π
i cannot read the text xD
click on 'open original' to see full size
also u might need to zoom to full size in your image previewer depending on associated app
"Groovy"
I see a lot of complaints about distributions very often in this channel so it is time for me to ask.
If you could make a request to the developers themselves what would be your ideal way to register new and change existing item distribution entries?
I could use a hand, Iβve almost got my profession exclusive traits working but I have one last hurdle
The listbox.item is a trait of sorts, but itβs not the same as the trait factory.getTrait? It has a getLabel() function but not a getName() function
So I run into the problem when trying to compare if the list has the trait or not because getLabel() is returning βLab Grownβ while the internal trait name is βlabGrownβ
Would traitFactory.getTrait(x):getLabel() work?
Great, so that works and now my conditions are passing correctly, but these functions don't work?
self.listboxTrait:addItem(traitToCheck.traitName, TraitFactory.getTrait(traitToCheck.traitName));
elseif tableContainsTrait(self.listboxTrait.items, TraitFactory.getTrait(traitToCheck.traitName):getLabel()) then
print("removing trait?")
self.listboxTrait:removeItem(traitToCheck.traitName);
end```
removeItem and addItem, I have gotten both to work previously using the same code yet they aren't working here?
if I remove the :getLabel() from the first if statement then it will continually add the trait every time you click on the prof and remove it when clicking off, but, what
it doesn't remove it from the list when you start?
for _, value in pairs(t) do
if value.item:getLabel() == e then
print("Found value in table, returning " .. value.item:getLabel())
return true
end
end
return false
end```
here's the log, it literally should be working, what?
LOG : General , 1619187538294> Item is: unemployed
LOG : General , 1619187538294> Profession is: unemployed
LOG : General , 1619187538294> Attempting to filter traits
LOG : General , 1619187538294> false
LOG : General , 1619187538294> Found value in table, returning Lab Grown
LOG : General , 1619187538294> removing trait?```
Ehhhh?! Well I got it to work once because removeItem needed to be using :getLabel() but it doesn't work once you click on a different prof and add it back...
Yeah.. it's strange behaviour is making me think that it gets added correctly originally, and can be found and removed, but then when I add it back, it isn't added back correctly and can't be found to be removed
The apocalypse is better, IMO, with more trash, and more corpses.
Cache is the place. Keys are for testing, and not representative of the final version.
Not just pretty scenery, but useful as well....
Half are caches. Other half are landmines
π«
Ladies and gentlemen, we got em'
Profession exclusive traits, now for the cool ones like genetic mutations π
What's the plan for test tube experiment?
My custom challenge map, Facility-7. Giant underground research lab you must escape. It'll have custom professions like the Test Tube Subject who spawns, naked, in a test tube.
You'll have the options for extremely awesome and unique traits, and around the lab will eventually be modules and genes and such you can inject into yourself to get unique traits
Will probably do a Cyborg profession eventually too
They'll have custom clothes you can't take off to represent the cyborg transition and such. Thanks mate!
Does anyone know how to find out if a file exists in the PZ install directory? I'm trying to programmatically determine if my custom animation file is in the correct directory. I could probably solve the problem if I knew how to determine the path to the install directory.
I could use a hand with this as I am unsure of the how to do it, the xpUpdate is a list but I want to overwrite the levelPerk function in it
this clearly doesnt work
Hmm, so I need to add it to the function under Event.LevelPerk or whatever it is?
tarkov?
perks related to the passive skills are for show and don't do anything. I.E if you have strength over 6, you get stout. if you have strength 4 or under, you gain weak
oh you said you wanted to overwrite it. it would only trigger on level up so gotta gain exp in a perk to test the print function
any guides out there to making clothing? I wanna make some custom clothing
Hi everyone!
Does this code has worked for someone? I'm being able to add the "Thin skin" trait but no matter how I try, I can't remove it again
player:getTraits():remove("Thinskinned");
yeah worked for me
That remove has been working for me for all traits, except this one, I can't understand why, I add it but once I add it I can't remove it
That method will return false if the trait was not removed
Could you have added more than 1 copy to the list?
real shit?
Is the name wrong?
I don't think so, when the trait is created it is named as this: Thinskinned
I'm basically adding and removing it with this:
This one works
if not player:HasTrait("Thinskinned") then
player:getTraits():add("Thinskinned");
end
This one doesn't
if player:HasTrait("Thinskinned") then
player:getTraits():remove("Thinskinned");
end
It is strange because it only happens with this trait, the others works
Also, does anyone know if ZombRand returns an int or or float?
this is such an awesome idea π
I keep getting an error that says tsarslib under my other mods that are installed. Not sure how to fix it
Float between 0 and 1, I think 0 is not included
Makes sense, thanks
This is real, Snake's Mansion available in my mod pack!
SuperHero outfit included (Easter Egg - Annoted Map)! xD
Go into PZ workshop, search for the Tsarslib (Tsar's Common Library) and download. It's probably just that
Hey, what program do I use to open .X Files from animsX? I have an idea using assets from the PZ itself but i don't know to put it all together yet
So uh, anyone know how to add a level directly for a perk (stat)?
owner:LoseLevel(perk);
that works to remove a level
but I can only find AddXP functions for the alternative
Thanks @marble folio !
hell yes
If you want to try it, you can download my mod pack from my blog: (Recommended use this pack alone for better gaming experience) http://pzmodding.blogspot.com/2020/08/pack-de-mods-by-snake.html
Owner:setPerkLevel(Perks.Fitness) = 10
I think that should work as an example, I dont know if you can add by one bur you can set the level you want
Wrecks with parts
https://www.microsoft.com/en-us/download/details.aspx?id=6812
Here is DirectX SDK development kit. It includes the DirectX viewer application that I use to view the .X files.
thank youu
hmmmm, what reason could there be for a new clothing item texture to not show up?
media -> Script folder, create the item. Item shows up correctly
item Strap_Dress
{
Type = Clothing,
DisplayName = Strap Dress,
ClothingItem = Strap_Dress,
BodyLocation = Dress,
BloodLocation = ShortsShort;Shirt,
Icon = DressShortWhite,
Insulation = 0.1,
WindResistance = 0.05,
FabricType = Cotton
}
media -> clothing -> clothingItems. Created the XML file by coping the Dress xml and re-naming it to Strap_dress. Then changed the file texture path to the correct one
<m_BaseTextures>clothes\dress\strap_dress</m_BaseTextures>
texture file is in clothes -> dress, and is named strap_dress
am I missing a step?
maybe case sensitive?
in the code is Strap_Dress
and in the textures that you said is strap_dress
(I'm still learning and idk if the names are case sensitive like that)
nope, still not showing. made sure it was the exact same
Is the model invisible or are you getting the red and white checkerboard?
what does the model normally look like? If it was a missing texture, it would show a red and white checkerboard texture on it.
it should just be the dress model with a new texture
ok what does the .xml Clothingitem say?
Dress_Long (the one I copied)
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel></m_MaleModel>
<m_FemaleModel></m_FemaleModel>
<m_GUID>99f1aa77-0c9c-4f83-a903-c9ba97ab52e8</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomTint>true</m_AllowRandomTint>
<m_AttachBone></m_AttachBone>
<m_BaseTextures>clothes\dress_textures\dress_long</m_BaseTextures>
</clothingItem>
Mine
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
<m_MaleModel></m_MaleModel>
<m_FemaleModel></m_FemaleModel>
<m_GUID>02dbb571-5244-4dfe-ab5f-a0f191557ea0</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomTint>true</m_AllowRandomTint>
<m_AttachBone></m_AttachBone>
<m_BaseTextures>clothes\dress\Strap_Dress</m_BaseTextures>
</clothingItem>
<m_BaseTextures>clothes\dress\Strap_Dress</m_BaseTextures>
Did you create a new folder called "dress"?
yes
going to try to make one called dress_textures and see
nope, still invisible
it feels like there is something I am missing
can you send me a .zip of your mod?
kk
neat
I hate the burnt car system >-> would rather have rusted/100% wrecked cars over burnt
it would be really nice
help
I'm learning to make a mod by following Blackbeard tutorial on youtube and trying to add a custom soda to the game, but something is going wrong and I tried to find out what for almost 2 days but I still don't know. The item doesn't spawn in game and the console shows this:
GRAVE: Error found in LUA file: C:/Users/Gomberg/Zomboid/mods/Dolly Guarana/media/lua/server/items/DLY-Distributions.lua
ERROR: General , 1619226548009> ExceptionLogger.logException> Exception thrown se.krka.kahlua.vm.KahluaException: DLY-Distributions.lua:274: unexpected symbol near<eof>at LexState.lexerror line:279.
ERROR: General , 1619226548063> DebugLogStream.printException> Stack trace:
se.krka.kahlua.vm.KahluaException: DLY-Distributions.lua:274: unexpected symbol near<eof>
I've checked the code and there is nothing at the end, just this that I have no idea (yet) what it does
table.insert(Distributions, 1, distributionTable);
--for mod compat:
SuburbsDistributions = distributionTable;
GRAVE ERROR
you have a bad symbol in your file
the error happened at 279. in your file
ye... I gonna have to re-re-recheck it then and learn more about lua. Thank youu
hey, is there a guide somewhere on how to make my own custom clothes
and maybe templates?
You've really been going H.A.M, Blair, but this takes the cake. Those are really impressive
Ahaha, it's all sketchfab + creative commons and not me π
i would like to make a mod, but eh i wanna start with something simple, and like idk what i should do first though
Hi, I like the MRE mod but they are way way too abundant. I found the distribution file, what kind of numbers can I put in that make them really rare?
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "USMRE.MREmenu01");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 0.05);```
even at 0.05 they are too common on zeds
Ah, I think the problem here is that the chance of something spawning is modified by the number of zombies in the vicinity, so items that are supposed to be rare will always spawn too often when zombies are around.
I'd just strike out the park where they spawn on zombies entirely.
yeah, fair enough. I think I'll do that and modify the mre box spawn chance to be rarer
can the distributions go into the thousandths?
Yeah, but it, in testing, makes no difference.
Zombies affecting the chance pretty much means that there's a practical floor to what the chance really is.
I've tried 0.0000001 and it spawns just as often as 0.1
Pretty much anywhere items spawn, there are zombies so
How can I make custom Challanges?
Now, apparently, the junk table entries are not affected by zombies, but there is no junk table for corpse inventories.
Adding a junk table to zombie inventories isn't impossible, but it's not really a "beginner" thing and also frankly it seems like a huge fuckaround as opposed to just setting it so zombies don;t drop MREs?
Now, assuming that you are new to modding for PZ/lua, I'sd say that's not a feasible "beginner" project and you should try making some simple mods first to get a handle on things.
If not, then I'd say it's a matter of time + repeated, repeated, repeated trial and error.
π Just asking around
Yeah, not trying to discourage anyone, I'm just a big advocate of learning simple stuff and working up from that?
It took me a year and a ton of mods before I felt like I knew anything and could actually implement the ideas I had that were past simple hack jobs.
Granted, in my case, I'm a huge dummy.
You could try modifying an existing challenge and see where that gets you.
I would recommend learning the basics of the language you want to be working in first
Then learning how to setup your development working environment
Yeah the working environment is really important.
For example I try to have a cup of coffe and an ashtray with a couple of pre-rolled joints within arms reach when working on stuff.
Maybe in 1950 π
Yeah I get it, new to this game but not to modding games in general. So I get the process
If you are looking to learn how to do Lua modding I can share some resources
With Lua modding I mean Project Zomboid Lua modding
No thank you, just looking around. I have another modding project I need to finish before I jump into another one
Don't know why you are asking for information if you are not interested in it
Cause I thought it would be relatively simple, but now I know that it is not I rather not get into it for the time being
It is relatively simple, but not if you are not willing to even read documentation
Good luck with your other projects though
Oh good, well then you got a leg up on most peeps π
Fenris wrote up a good starter guide, it's incomplete but dude is probably the smartest person in the PZ community and really knows his shit and best practices
https://github.com/FWolfe/Zomboid-Modding-Guide
...really knows his shit and best practices
I do not agree with this, he believes that modders should stay away from IDE's
Working in notepad is not best practice when it comes to modding
A map of Raven Creek. In case anyone wants it for their game, I know I did.
An army base right at the city entrance? Nice
lookin' good!
Does anyone know some good mods for 41 and a good map?
https://steamcommunity.com/sharedfiles/filedetails/?id=2451744908
paw low loot isnt that needed, but the extra gear is cool
i mostly use it for the clothing
It's very well done for sure
man
TIS really needs to just cut the laser on the laser pointer
it looks so bad
idk, it doesn't look so bad in-game when equipped I thought
Well, yeah, that part isnt so great
Just added my new favorite trait to my facility map. "Doomed" gives you a random timer of 6 to 12 months, affected by lucky/unlucky, that once your time is up, every day there is a chance for your doom to begin
and once doomed, well... you'll be dead within the day
man, having cancer in zomboid would be so depressing
i got back in TWD recently and theres a callback episode which is basically scavenging for chemo drugs
so brutal
Here's Negan?
yep
a great episode
didnt wanna spoil
Yeah.. good episodes, definitely a sad story.
I figured it would add an interesting aspect to the game, and there's also a genetic mutation trait that adds and removes traits randomly (probably will limit the traits it can add/remove) so that may be the only option to remove the doomed trait from your character
I was considering a very rare and special cure procedure but... nah
Hmm, having an issue where my mod's traits aren't being saved on my character and become considered unkown?
My thought is that since my traits are added OnGameBoot
that they do not work properly when I am just reloading the LUA via the "Continue" button
Anyone know about this?
O wait, maybe there was just a bug, hold on
Is there a mod for tying a brick or something heavy to the drivers wheel of a car to set off the alarm? To like attract zombozals
And I know about the police cars sirens, it would be nice if you could do that to normal cars
Where can I find a list of events I can add to? Looking to add an event to player spawn
@late hound damn, animations broke my game lol
@craggy furnace What happened?
Correct. All the pros use Notepad++
I use it a hell of a lot more than IntelliJ. IDE's are like flying a space shuttle for a crop dusting run. Yoke and throttle works just as fine as fly-by-wire.
IntelliJ is more useful when it comes to java modding. but when it comes to just lua...
notepadd++ all the wya Β―_(γ)_/Β―
Hrm.. does anyone know how I can get the player's profession once they've loaded into the game?
I can't find a getProfession() function, not sure where to look
Does anyone know the compat between Moonslime's extra traits and Dynamic traits?
nah use atom, bad asses dont need to debug
idk
VSC is great if you want something modular
you can even assign presets and make templates on the fly
I haven't been able to see anything but guess I'll ask, has anyone seen anyway to prevent the player from being dragged down/changing the drag down script?
@willow estuary Hey man! I'm not 100% sure this is correlated to the coke baggie but I'm pretty sure.
I did a line, and my character hasn't needed to sleep for many, many days. So I checked with the healthbar mod and my fatigue is stuck at something like 2^-6, is that to be expected or did something explode?
(from marching powder)
Probably another mod. Just tested, doesn't happen to me and fatigue doesn't go below o.
How many other mods are you using?
βοΈ π
I've done a few lines in the past and nothing went amiss, was just this last one that's been a doozy
And a few mods but nothing that affects endurance. Just wanted to be sure it wasn't expected behavior, thanks for the response π
Do you know of a way to reset the fatigue value?
This is the original video released entitled 'No No No' by singer and song writer Dawn Penn.
@willow estuary fwiw I used the cheat menu mod to enable and then disable god mode and it fixed it
reset fatigue to 0 and it started behaving normally again
You can setup intelliJ with zomboid's exposed functions and have it autocomplete list them as you're typing
I rarely go digging in the java to see what does what anymore- and I've been able to replace the entire helicopter event, add preset options, event scheduler, etc
IDE's have a place and a purpose
if you can get away with using a text editor for minutia then go for it
i dont like using space ships for what is basically going from point A to B
Hey.. anyone know how I can force a zombie to be shoved back/fall over?
there is hitConsequences(HandWeapon weapon, IsoGameCharacter wielder, boolean bIgnoreDamage, float damage, boolean bKnockdown) but I just get errors
my error is being super helpful too
I am not convinced that PZ devs use Notepad++ to write game code
But perhaps you don't consider them professionals
I am working directly with them and they are most assuredly professional π
Very lovely people!
the darkest dungeon devs use Notepad++ for a good chunk of thier code
I guess my comfort factor depends on how familiar I am with all the things that tool can do. Notepad++ has fewer functions/features that aren't relevant to what I'm working on. I can use a Swiss army knife to cut fruit, but I've also got a paring knife.
The devs use IntelliJ for their stuff, if others were wondering. I really wish I had spent time in school learning this stuff instead of doodling robots and big swords and stupid shit like that.
Of course they do, and this is what you are suppose to use for modding as well
Pretending like there is no need is just setting low expectation for fellow modders
My monocle just fell into my martini glass. Good heavens.
You are not helping the community when you recommend Notepad over IDE
You're not helping the community by being such a lovely person.
I've already been warned by others that you're rude
Nice rep my man.
Don't know why you are trying to pick a fight with me
But I've said what I wanted, now you can continue with your sarcasm
Forgive me, Data. The vagaries of language are indeed confusing. 'setting low expectation's and 'not helping the community' are hard to perceive as non-adversarial statements.
Clearly my shit needs recalibrating. You are very polite.
For others who are wondering I advise threading the wires through your ferrite cores with the tools provided if you want your landing program to execute correctly.
Do not use your fingertips. The oils will corrode the copper and offgas in non-atmospheric conditions, adversely affecting their conductive qualities.
Make sure to smoke Chesterfields every 15 minutes to keep your hands steady. Thanks for watching
Well.. if anyone knows anything about staggering/knocking over/knocking back zombies, I would greatly appreciate to hear it. I guess I'll just move on for now
---@public
---@param arg0 boolean
---@return void
function IsoZombie:knockDown(arg0) end
Speaking to the topic, the only benefit to having an IDE setup is having exposed things tied to it in a library
cause you can find this stuff rather quickly
If you're just tweaking vanilla stuff, or someonelse's mod, you're probably better off using notepad++ with a few plugins
Also decompiling, code navigation, debuging, unit testing and more
oh sweet! That's super simple. I guess the docs are a little outta date
Thanks so much!
Running the game outof intelliJ and getting more accurate debug info is useful, yes
That was handy! I'd like to be able to cut out the stuff I don't need
The vector logic we worked on would not be possible to do without IDEA
Those were your words as far as I remember π€
Oh shit you gotta back him up now, or you're in hot water!
It would have been done either from having the IDE generate the information needed, or dig through java files -- looking through Java files would have taken longer
You figured out the logic by running unit tests
Alarm lights I need to remove
Some weird map object
was trying to make blinking lights ages ago but not enough is exposed from what I remember
from having the IDE generate the information needed,
What information is IDE generating that you are using?
what's actually exposed
That is not generated by IDE
Ah man it's been a long while since I looked at it, there is a light class and I could set up the light but I couldn;t figure out how to update it quickly enough
it is when you have your gradle scripts setup
it would change the stats on time but the lighting itself never updated
The Lua library you are referring to is generated by ZomboidDoc
Would be really great if IDE did it automatically though
Might be doable by, on every so many player updates, by checking the surrounding squares for the specific tiles with your lights and toggling them, but may slow down the game.
Yeah, I was able to make it work by toggling the light component but... that was just the game switching a literal light switch on and off lol
you could even hear the sound effect of the switch flipping
I may take another look again soon
Ah yeah, that sounds like an unwanted complication π
Maybe something the electronics rework might make feasible?
Isn't there a bunch of deprecated/nonfunctional stuff related to lights? I remember having a hell of a time getting them to shut off/delete during some tinkering with a 'more burned' house
You just had to remind me of the nonfunctional functions π’
If you've ever wondered what a building looks like with 100% burn coverage, it's awful. Remove the roofs first π
were you using the setActive() function?
briefly looking at the java, but that one has the light switch built in
try switchLight(boolean)
I assume true is on
is it ok to modify some mods that i got from workshop a bit?
setActive calls it after it goes through a bunch of stuff
May have deleted that one out of frustration
and it looks like it turns on the lights
Yes of course
Oh! Found it
hm i see
isoLight:setRadius(maxRadius)
isoObject:switchLight(true)
elseif radius >= maxRadius then
isoLight:setRadius(minRadius)
isoObject:switchLight(false)
end```
looks like I had found that function, yet it did not work
Ah well
where can i find the textures for the game?
nvm i found it, just gotta find the ingame files
oh but i cant find the ones for the icons that appear in the inventory
these icons, where can i find these?
ok i think i found a way
i wanna like, try to make some sort of mod that allows for multiple skins of already existing items, like that extra color for some clothing items for example
which object were you trying to apply it to?
it's supposed to be called on the IsoLightSwitch
and this would be to flicker the lights in the room
just to clarify
local isoLight = isoObject:getLights():get(0)
should be an IsoLightSwitch
getlights doesn't appear to be an isoobject function
getlights is an isoLightSource function
to get the lights connected to the switch
getlights returns an array of IsoLightSources
weirdly enough lightsources don't have functions to tturn them off lol
thats handled by their switches
you can setactive but that just changes their field
it doesn't register an update
is the isoobject in this case the lightswitch?
Yes I believe it is
Do you run your game in debug?
I do! Although the current tile is not in my game
you'd be able to see errors- if you're trying to call the wrong function
Also, my newest trait
oh is it?
Handy to know π
do you have it apply to IsoZombie?
ah, nvm, I was going to suggest making it IsoGameCharacter to apply to players but knockdown is strictly zombie only
it's just knocking them down right, not killing them?
literally so powerful they die by just touching ya lol
Not die* they'll get right back up
basically unstoppable force vs movable object lol
It's an 8 cost trait for a reason, but it isn't as strong as it looks. If not in god mode you'll hit the zombies, likely slow down, maybe trip even. Knockdown is also a random chance
@sour island while you're around, do you happen to know anything about preventing play dragdown?
I know there's a sandbox option for it
also if you're in ghost mode it doesn't happen
Both I am aware of, meaning it is a toggleable, in theory, value
are they killing you just by there being too many around?
Nah it's not an issue with Bulwark, but my Undying trait it is an issue
as it knocks down all nearby zombies if your health is really low, heals you to full and all, but... being dragged down doesn't change your HP
so if 3 zombies gang up on you, I can't activate the trait because, once in the animation, as far as I am aware, you're dead
you can override IsoGameCharacter :setDeathDragDown()
idk if the game will freak out tho lol
I was looking in BodyDamage.java's AddRandomDamageFromZombie()
it calls if there if there's enough zombies around you
I figured if you made it return false instead depending on the situation
it should prevent it
wait
with undying zombies shouldn't attack right?
They still attack, it triggers when you're at less than 10 HP, heals all your wounds, and knocks over all nearby zombies
you could override IsoGameCharacter:getSurroundingAttackingZombies()
to always return 0 with specific parameters
this is called a bit earlier in the dragdown process
should be more reliable
Yeah I've just opened my script and found it, hmmm
looks like the way to go for sure
(I forgot I had jd installed lol)
are you familiar with overriding?
Yeah, had to do it a bunch to add profession exclusive traits
alrighty, neat work so far
function IsoGameCharacter:getSurroundingAttackingZombies()
--Incase I need to add something
oldGetSurroundingZs()
end```
just to be safe though, that should work, yes?
Of course, just simply talking about the overriding part
Oh it does? neat to know
Thanks for all the help man!
Anytime
Gas Siphoning that needs a hose
Smart!
just a more realistic fueling system? based
i just thought that the survivor had a long tongue
Israel's order
hm?
@undone heron you think that nerfed carpentry could be a mod?
yeah, shouldn't be too hard
is skin texture 5 supposed to use skin 1's zombie textures?
it doesnt have any in the files and ingame it just switches to the palest skin's zombie textures
Don't shoot I'm just vitamin D deficient
I think someone made a mod for healthier looking skintones
harry did one as far as i know
Sorry, meant to link it alot sooner was listening to the piano mod demo
that thing is nicely done
Anyone familiar with getting a cell's trees?
the way I'm going about it feels too convoluted- but it's what the code suggests is the right way
welp, I guess a cell's Trees list is depreciated as it's empty, and IsoGrideSquares list is private
can somone teach me how to add a new cookible item into the game
How hard would it be to make a mod that just makes picked food never go bad?
Absolutely 0 coding knowledge, but it should just be deleting one thing and adding another right?
I'm on a roll adding these traits now, they're a ton of fun to add
Scratches, Lacerations, and Deep wounds will randomly appear based on several factors. Traits that effect it: Lucky, Unlucky, prone to Illness, Resilient, Thin-Skinned, Thick Skinned. Stats that affect the chances of wounds appearing: Stress level, fatigue level, panic level, and sadness
Is a mod even necessary? Surely you could just turn food spoilage off. I'm not a wizard with sandbox settings like some are, but I remember seeing something similar.
Didn't gas pumps already run out of gas eventually?
Or does this just lower how much gas is left on the pumps when the world is loaded
2000 units, so 400 gas cans, afaik
Oh
Yeah this mod makes more sense now
Will keep it in mind when i make a 6 months later game
Gas pumps in Vanilla never run out.
There's code for them running out, but it looks like it was disabled.
i had no idea that was a thing
It's a common misconception that they hold so much that people never empty them.
But it's not the case.
Thanks for the mod then, the challenge is part of the fun
How much is there on the pumps on average, or is that just randomized?
It's randomized but I have a policy of not explaining exact details like that, as I think it's more fun to learn through playing.
Fair
That also explains what your mods say on the description because for the longest time it seemed to me that you believed other people were an annoyance
Ah, there's certainly a loud, demanding minority that have proven to be enough of a bother that I've chosen to close certain avenues of communication.
Hmm... I'm trying to get a list of all the traits the player has, but it's being picky
Do I need to use that descriptor thing?
Nope.. not that
There's an isoGameCharacter.getTraits() but I just keep getting the error tried to call a non-function
@sour island would you happen to know anything about this? Apologies for the @
use :
local player = _player;
for i,traits in player:getTraits() do
print(traits:getLabel());
end
end```
I am, that's my function, I've tried just printing traits, traits:getName(), and traits:getLabel()
doesn't work, because it gets stuck on player:getTraits()
get traits doesn't return a list
it's an arraylist
also you have to use pairs() in lua - if it was a lua friendly list
you can use :size() on what it returns, and get()
some functions in PZ return table/arrays (lists) that Lua can use
some return arrayLists which it can't
well it can
but you have to use the exposed arrayList functions
I might have an example handy hold on
That would be super useful!
--- Raise the dead
function DEBUG_TESTS.raiseTheDead()
local player = getSpecificPlayer(0)
local squaresInRange = getIsoRange(player, 15)
local reanimated=0
for sq=1, #squaresInRange do
---@type IsoGridSquare
local square = squaresInRange[sq]
local squareContents = square:getDeadBodys()
for i=1, squareContents:size() do
---@type IsoDeadBody
local foundObj = squareContents:get(i-1)
if instanceof(foundObj, "IsoDeadBody") then
reanimated = reanimated+1
foundObj:reanimateNow()
end
end
end
print("-- Reanimated: "..reanimated)
end
Haha no worries
arrayLists start at 0
something to keep in mind, most things in java start at 0 when numerated
Aha it is working indeed
Lua starts at 1
Right, so you need the -1
you can also just do i=0
Ah, makes sense
I find it's cleaner that way
now I know why some of the dead bodies don't get up lol
print(player:getTraits():get(i));
end```
there's nothing wrong with that loop, right?
it worked so I don't see what would be lol
damn i'm tired
you're right you do need the -1 on size
but yeah that's fine
Idk why I had i-1 on each iteration lol
Happens all the time when overthinking things in the name of simplicity lol
Thanks for all the help, I can get this Multi personality disorder working now π
Pretty much! It gets all your chosen traits, then will change personalities to a secondary selection of traits. That secondary selection consists of the polar opposites of all your chosen traits, and if it has no opposite, a random trait instead.
It also does not swap body related ones like weight or asthmatic
Updated my Playable Arcade Machines mod with AuthenticPeach's custom animations! I have an in-world laundromat commercial that shows the new animations off! https://www.youtube.com/watch?v=mwbR0b9KQXE
New Arcade Animations in the updated Playable Arcade Machines mod for Project Zomboid.
Ned has remodeled the laundromat in East Muldraugh. Number 1 on the list - Arcade Machines!
Animations by Authentic Peach
Subscribe to the mod here: https://steamcommunity.com/sharedfiles/filedetails/?id=2445720450
How would one go about changing the item variables with lua? Changing weight of an item for example
I assumed it would be in this class but not sure https://projectzomboid.com/modding/zombie/inventory/InventoryItem.html
I see there's methods for some, but not all
theres one that i found that changes some items into a weapon, like the kettle or mug
idk much about modding but if you check the code, there probs should be lines of code that might help changing some variables
A mod that does that you mean? Any idea what the mod is called in that case?
i think its something like vanilaa revamped? icant remember, however you might find what i mean by typing sillyplunger or silly plunger in the search bar, as its like an extra mod for that
@random terrace
wait i found it
and i guess if you want to edit it like this way, you have to download that item tweaker mod
The item tweaker api does look like it could solve my problem, thank you
Anyone who has experience with this though, can I change only the current instance of an item?
last updated 2015 lel
lol
i tried playing with this and that mod before
seems like it works still though
you may have to try it for yourself if it works, or ask someone else, again i got no experience from modding lol
Item properties modified by item tweaker have nothing to do with translations, that person is mistaken.
Changing item names via translation files is also one of the easiest things to do in the game. I don't know what this person is going on about.
Item tweaker doesn't need to be updated. The code that makes it work has nothing to do with changes to PZ since 2015.
Lots of people use it; it's the gold standard for modifying items.
You don't use it and you get silliness like changes to b41 breaking items like people's "better hammers" mods not working when b41 changes to the tag system.
Not with item tweaker.
Also, FYI, a good 50% of all posts on workshop comments are complete nonsense, so don't pay them too much heed.
Yeah, I shouldn't be too surprised to be honest
Thank you for the info though
In this case though, if there's no setter method for the specific thing im trying to change, is it undoable?
Well, if you mean modifying specific qualities of an instance of an item, you can edit some of the values with things like being an admin in MP or using debug mode.
But only some of the item properties that are modified will be persistent between saving/reloading etc.
I don't recall which ones though.
Yeah, I noticed it's doable in debug mode, which is the main reason im even trying to get it done, more specifically I want to add it to my mod though, so doing it through admin or debug mode isn't what im looking for
Trying to make it so if a specific attachement is on a gun, it can't be put in a normal holster
Is there a way I can create folders in the mod screen to organize my mods?
This is probably your best bet in that vein: https://steamcommunity.com/sharedfiles/filedetails/?id=2404803647
π© thank you
That person was probably using itemtweaker to translate before translations were easier lol.
Itemtweaker is such a barebones technique but that also makes it solid. It grabs the item after it's been defined and adjusts specific variables. Which means two mods can change the same item aslong as it's not the same variable there won't be any issue. More mods should use it.
Scripts are usually all or nothing per item- so you always have a competition.
Say, anyone know how I can trigger a song to play? Would love to trigger an intense song when the player resists death with the Undying trait of mine
Ahah! I've found it!
Now epic music will play when you resist death, and sad music will play when your doom begins hehe
hrm.. or maybe not - or maybe so, got it working
Hi guys!
Does someone knows how to apply an exp bonus on a player skill? I know that addXPBoost add the exp bonus based on a trait, but is there a way to apply the bonus directly to a skill?
look for references to Perks
huh, i see now
The workshop comments.... .....are not reliable to say the least.
i guess sometimes it is, sometimes its not huh
I'll keep that in mind
how hard is it to convert a mod from b40 to b41?
There's no simple answer to that.
Many of the systems in PZ are the same in b41 as b40, while the others are completely different.
i see i see, so it could be very easy to do, or it would be hard that it might need a complete overhaul
Also, the when b41 stable is released, it will have a lot of changes from the current build, so even a converted mod might have the wheels come off and the engine start smoking when it releases, just to be forewarned.
Does somebody knows what the "getTimeSinceLastSmoke" returns? it is a float, but I can't understand what it means, also if I print the value and I speed up the game to see how it evolve, it reaches a maximum value of 10 before even finishing the first day so π€
Absolutely nothing if you don't have the smoker trait
I know what you're trying to do cause I tried too xD
If you have the smoker trait, it increases over a day and increases stress.
If you don't have the smoker trait, then the value does nothing and doesn't function
π€£
I want to remove the smoker trait once a certain amount of time happened in the game and the player did not smoked on that time
But the counter only counts up to ten
Okay, so if you just want to remove the trait, then that's possible
So basically you create a modData value called X since last smoked
You then add a lua event on hours, minutes, or days (that will be X).
In this event, you check if last smoked is at 10, and if it is, increase the counter. If it isn't, you reset the counter
Then once say... X gets to 100 (if hours do like 1000). Remove the smoking trait
The issue becomes once you loose smoking, can't get it back since the getTimeSinceLastSmoke stops functioning and is stuck at 10
when you smoke it doesn't reset?
Not without the trait
ah, true
Pretty easy to either set it manually or just keep track yoruself
Oh? How would you get a specific item being used
Use(
doesn't each item have that function?
OnUse(*
You could insert the time of smoking + arbitrary time to lose it into a table saved in the player's modData, then in OnPlayerUpdate delete times that match it as you go
if that list ever get's over a certain length add smoker trait
you can also make it so new entries could have longer cooldown times based on the length of the list so it's more likely to develop the addiction
I don't think I seen OnUse, but wouldn't know how to really call it without using constant player update events
half the game is calling constant ontick events
don't be scared to throw in your own
Yeah I try to avoid if possible
not an issue if it's short and sweet
like I wouldn't use a for in the update
you can abuse lua tables' keys for quicker lookup
I don't want to add more (if possible).
I know I can plug into the 'smoke' time action most likely. Tho from testing with literacy and some other mods, I haven't figured out how to plug into a timed action that completes.
(unless that's the preform function. Which sucked when I tested it)
----- OnEat_Cigarettes IS NOT RECIPE CODE. IT IS CALLED BY IsoGameCharacter.Eat() -----
-- smoking cigarettes gives more bonus to a smoker
function OnEat_Cigarettes(food, character, percent)
Like wanting to increase/reset a variable on action complete and not if they stop.
I assume eat is called under Use( for food....unless can a player just eat them?
Same, haven't seen that event π€
would make all the addict traits
----- OnEat_Cigarettes IS NOT RECIPE CODE. IT IS CALLED BY IsoGameCharacter.Eat() -----
-- smoking cigarettes gives more bonus to a smoker
function OnEat_Cigarettes(food, character, percent)
local script = food:getScriptItem()
percent = percent * (food:getStressChange() * 100) / script:getStressChange()
local bodyDamage = character:getBodyDamage()
local stats = character:getStats()
if character:HasTrait("Smoker") then
bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 10 * percent);
if bodyDamage:getUnhappynessLevel() < 0 then
bodyDamage:setUnhappynessLevel(0);
end
stats:setStress(stats:getStress() - 10 * percent);
if stats:getStress() < 0 then
stats:setStress(0);
end
local reduceSFC = stats:getMaxStressFromCigarettes()
stats:setStressFromCigarettes(stats:getStressFromCigarettes() - reduceSFC * percent);
character:setTimeSinceLastSmoke(stats:getStressFromCigarettes() / stats:getMaxStressFromCigarettes());
else
-- bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() + 5);
-- if bodyDamage:getUnhappynessLevel() > 100 then
-- bodyDamage:setUnhappynessLevel(100);
-- end
bodyDamage:setFoodSicknessLevel(bodyDamage:getFoodSicknessLevel() + 14 * percent);
if bodyDamage:getFoodSicknessLevel() > 100 then
bodyDamage:setFoodSicknessLevel(100);
end
end
end
you can litterally just have time since last smoke tracked here
like move it outside of the check for smoker trait
it's the last line of the if smoker block
Is that from the timed actions file?
Never looked in there cause didn't think on use would be in there. Ty for point out the right place.
tbh I'm just using ctrl+shift+f "TimeSinceLastSmoke"
Yeah, I can do like what I did for the tooltips. Store the original in a variable, overwrite the original function, have it perform the original task, and then do my non-smoker variable tracking
I think I was thinking of recipes OnUse stuff
but it appears that's how this function is called for smoking
item Cigarettes
{
Count = 20,
HungerChange = 0,
Weight = 0.005,
RequireInHandOrInventory = Lighter/Matches,
Type = Food,
DisplayName = Cigarettes,
StressChange = -5,
Icon = IckySticks,
CustomContextMenu = Smoke,
CantBeFrozen = TRUE,
OnEat = OnEat_Cigarettes,
StaticModel = Cigarette,
EatType = Cigarettes,
CustomEatSound =
}
also this is what i've been working on
eating ciggies delish
it's for a range scan code
I had it partially working- but I needed a visual to confirm
For a bomb?
for heli attacks
Ahhh yes
ooo π§
it grabs all those tiles, and counts the zombies with in each 3x3
Ahh, I saw the empty square in the middle
center is still counted- just not rendered
I figure I should give it center by default
but it's adjustable
between how wide the red should go
Hmmm, does it do a variable amount of damage in each 3x3 section, a set amount to each zed in it, or a set total in each section?
this is just to identify which grid area might have more zombies
I now noticed that I don't fully understand this, when you say "modData", is that some sort of table to save custom values or something?
I'm still new to this world of modding π
And mostly new to lua
Yes
all objects have modData- it's just a table
just be aware other people's mod may use modData
getPlayer():getModData().newVariableHere
Use highly specific names for it to avoid conflict
Like I use moonSlimeVariableName to avoid any mod data conflicts
oooooh that's awesome and could have resolve many doubts I had before π
This opens a new world of possibilities
You can also pack lists into it
I use it only when I have to. Atm my mod is causing issues with suprub survivors with modData
like moonSlimeVariableName = {1,2,3,4,5}
SS uses chunks of LetMeSpeak! - what issues are you having?
Dunno how to fix atm so I just separated that section out of the main mod.
My main problem for many things was that I didn't know how to save variable values that didn't reset once the lua is re-loaded but that helps a lot now
it's not limited to players either
I use the world's GameTime object's ModData to store stuff
In the organized evolution section of my trait mod, I track item movement in the players mod data so it's saved between quitting and starting.
I call this data when the player's weight is changed and increases it. This throws an error if suprub is installed
item movement?
Yeah if they moved something in or out of their inventory (inventory weight changes)
ah
The stacktrace should be pretty obvious?
I honestly don't think many mods use modData
you could be unintentionally wiping it
then SS is scrambling to use it
How do you store a new variable into the modData so you can use it later?
This is the error I have atm from the mod page
function: organizedEvolution -- file: OrganizedEvolutionTrait.lua line # 38
ERROR: General , 1618473362203> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: __add not defined for operands in organizedEvolution at KahluaUtil.fail line:82.
ERROR: General , 1618473362204> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: __add not defined for operands in organizedEvolution
what is line 38
modData is read as {} (a table), so you can fit things in it
you can do what slime does and use this format:
getPlayer():getModData().newVariableHere = value
or getPlayer():getModData()["newVariableHere"] = value
they're both the same
I can get you that in 15 to 20 minutes. Once I get home
yeah, I wouldn't use table.insert
cause then it has no key, and it's just a hanging value
Great, will check what I can do with all this information, really valuable π
I use a check on the player create event to see if the variable is equal to nil. If it is, then I set it to the default / base values
okay I am home now
local function organizedEvolution(_player)
-- Get the player and check for the trait
local player = getPlayer();
local inventory = player:getInventory():getContentsWeight();
local modData = player:getModData();
-- Check to see if the stored weight is equal to the current weight the player has
if modData.moonCurrentWeight == inventory then
-- Do nothing
else
-- If the player's weight is different, add on to the variable total items moved
(Line 39) modData.moonTotalItemsMoved = modData.moonTotalItemsMoved + 1;
-- Set the stored weight variable to be equal to the new inventory variable
modData.moonCurrentWeight = inventory;
end
-- Check to see if the player has moved roughly 10,000 items to and from his inventory. if so move on...
if modData.moonTotalItemsMoved >= 10000 then
-- Reset the count to 0
modData.moonTotalItemsMoved = 0;
-- Check to see if the player does NOT have Organized or Disorganized
if not player:HasTrait("Organized") and not player:HasTrait("Disorganized") then
-- Give the player Organized
player:getTraits():add("Organized");
-- If the above check fails, check to see if they have Disorganized
elseif player:HasTrait("Disorganized") then
-- Remove Disorganized
player:getTraits():remove("Disorganized");
end
end
-- player:Say(tostring(inventory) .. " / " .. tostring(modData.moonCurrentWeight) .. " / " .. tostring(modData.moonTotalItemsMoved), 1.0, 1.0, 1.0, UIFont.Dialogue, 30.0, "radio");
end
for some reason
modData.moonTotalItemsMoved = modData.moonTotalItemsMoved + 1;
is breaking if it's a supurb survivor
lmao ikr
__add ... error means you're trying to add something that can't be added iirc
could organizedEvolution be called before modData is loaded
or set to default?
It happens on the player update event.
I don't think that event could happen before player create event.
when is your modData set
Player create event
Also: this error only happens if SS is installed. If SS isn't installed,it works fine
So from what you said, it seems like it isn't making the modData when SS spawns a fake player/npc
So adding one more check to see if the value is nil should fix it, if I am understanding it
yeah
it might be creating the AI or some sort of template for the AI on standby
you could drop a print somewhere in there to print the player's name
I had a similiar issue with SS and conditional speech- where my character was speaking for all the AI in the world
Hmm.. anyone know where I would be able to change a firearms accuracy while the player is aiming?
Trying to make a Run N Gun trait where the player aim is barely effected by movement
I know of OnWeaponSwing but attaching anything to that just seems to cause some bugs
He was the voice of the machines
This has probably been asked a million times, but what the heck, here goes nothing - Is there any easy way to spawn a specific vehicle in singleplayer? I'm going for an RP scenario/challenge and would like to spawn a specific vehicle. I'm not sure if I can do that via Debug mode?
cheat menu mod -> right click the world -> spawn vehicle
or
debug menu -> right click the world -> spawn vehicle story -> pick any one (I like doing the replacing a tire). After the story is spawned, click the car to bring up the context menu -> vehicle scripts -> pick the car you wnat
Thank you so much!
Hello im pretty new to pz modding as i got the game 2 days ago. Would anyone help me with the load order please?
How do I see whatβs causing an error message when my game starts? I donβt see any red text for mods that arenβt installed/incompatible etc.
console
How do I look at that? Thanks!
boat mod super pog
what is vehiclesuniversaltex in \media\textures\Vehicles ?
it has 3 spokes wheel, a door panel and sides, a headliner and a bottom view of a car and a license plate
defo unused textures but what for ?
Texture for all vehicles like one wheel for all cars, interior and etc.
Unused for now
oh ok
Damnnn
nice.
Reminds me of the first COD zombies map w/ the plane crash. Whats your plan for the plane crash?
Just scenery.
Like the honking big truck as well.
- well, you might be able to pull a battery/headlights/gas out of the truck.
Well, the truck will be practically un-towable, and will spawn on the roads, and is big, so it'll function as a permanent driving hazard as well.
That's pretty awesome, will love to see stuff like that around
Thanks!
I once saw her kill 100 zombies in a lab with nothing.. but.. a.. fork..
@undone heron you were making that trait where sunlight made your eyes hurt, right?
I'm looking for a way to get the light level of the tile the player is on, I think your code had something to do with that, any pointers?
Does anyone have a collection of mods that are compatible for multiplayer
(remote play)
b41
Most mods should be fine I would imagine
You would have to avoid mods that use getSpecificPlayer(0)
Yeah that's the only thing to be wary of
@sour island you wouldn't happen to know anything about getting a tiles "light level" would you? I've been file digging but the stuff I've found has made little sense
I've been combing though em' because of that
but nothing has been super clear
I've found ColorInfo[] lightInfo
that's for weather I think
Yeah, that's what I was thinking
it's an array of floats with 4 values for the color
I found a function called getDarkMulti() 
Guess I'll see what this does
oh? That might work.. getDarkMulti() just returned an error so that aint working
There's a mod on the workshop that disables the ability to read if the light level is too low; I'd take a peek at it.
local function getPlayerLight(Player)
local player_id = Player:getPlayerNum()
local square = Player:getCurrentSquare()
local colors = {
square:getVertLight(0, player_id),
square:getVertLight(1, player_id),
square:getVertLight(2, player_id),
square:getVertLight(3, player_id),
square:getVertLight(4, player_id),
square:getVertLight(5, player_id),
square:getVertLight(6, player_id),
square:getVertLight(7, player_id),
}
local light = 0
for i, color in ipairs(colors) do
local hex_str = string.format("%x", color) -- exaple: "ffa1b2c3"
light = math.max(
tonumber(string.sub(hex_str, 3, 4), 16) or 0, -- "a1"
tonumber(string.sub(hex_str, 5, 6), 16) or 0, -- "b2"
tonumber(string.sub(hex_str, 7, 8), 16) or 0, -- "c3"
light
)
end
return light
end```
ew lol
any interesting set of actions to calculate it 
Thankfully! Someone has already done the heavy lifting for this monstrosity
is the first argument the z level?
I- do not know, I think so
public int getVertLight(int i,
int playerIndex)
--[[ light in room (without windows, door is closed, no light-source)
01:00 13:00
with NightVision 48 99
no NightVision 35 103
]]```
thats the values the creator used
Sheesh
TIL there's a getsquare and getcurrentsquare
Haha might help optimize/shorten some functions
one return's current, the other returns square
Anybody else encountered something like this when adding custom .x models?
Ah thats a pretty neat little model! Makeshift bag?
Yeah, with extremely low loot I was getting tired of having to use tote bags and purses lol
Good for survivors living off in the woods
Most definitely, worth having!
should be able to bundle a sheet up
Right? tie it on the end of a stick, problem solved!
Speaking of issues, anyone know about why my character might be getting locked up after reloading their gun? I added player:setBeenMovingFor(0); is the only thing I added. It seems when I set it the character locks up after reloading and I have to press escape a couple times for it to finish?
are you on debug?
Yes
Oh really?! Sweet, that means it actually works then
if you wait long enough your character will randomly decide to finish reloading lol
LEt me give myself a bunch of ammo and see if it works properly then lol
Yeah and I cheated for it. I just check if it's dayy time, the player is outside, and if there is any weather.
I was considering doing that as it gets the job done for most cases, but being a shadow assassin requires a little more work
however... looking into that light code could very well help with a few traits and / or adding a more simplified version to literacy
Hey @sour island and @undone heron thank you both, today I was able to do what I wanted to do because you helped with that yesterday π thank you both!

ye, I am as well able to make an addiction pack for my traits mod. so thanks chuck for the help!
np lol
and was able to re-add organize to the main package
I promise this time i won't take down my mods
no houdini stuff
99% of you peeps don't know me anyway π€¦
Hello there; i need help for fouding something on the base game... i search about the rules for taking (or consuming) an item like an pills or things like that... i already found the item itself but not the rules of what happend if i take it
media-> lua -> server -> recipecode
take a look in there
if you know the item then you know the function and you can search it in there
am i wrong or in this particular file, i just found the cigarettes thing.. but anything about painkiller/beta block pills etc...
i cannot do thee thing i want to do with just the cigarette model thing... i manage to create items that are substitute to the vanillia painkillers and others pills like that.. and without the call of any fonction, i don't think it'll work ^^
let me take a peak
item PillsVitamins
{
FatigueChange = -2,
Weight = 0.2,
UseDelta = 0.1,
Type = Drainable,
UseWhileEquipped = FALSE,
DisplayName = Vitamins,
Icon = Vitamins,
Tooltip = Tooltip_Vitamins,
StaticModel = PillBottle,
Medical = TRUE,
}
for vitamins its just fatiguechange in the item itself
quite easy
the item can be found in media -> scripts -> newitems
item Antibiotics
{
Weight = 0.1,
Type = Food,
DisplayName = Antibiotics,
Icon = Antibiotics,
ReduceInfectionPower = 50,
CustomContextMenu = Take,
CantBeFrozen = TRUE,
Tooltip = Tooltip_Antibiotics,
Medical = TRUE,
}
pain killers?
i mean painkillers yep
lets peak again
(btw thank you for your time)