#mod_development
1 messages ยท Page 3 of 1
the tag system is underutilized for sure
pretty sure it has plans for the future tho
we can see recently its started to be used a bit more in vanilla
but I still think there would be a benefit to merging all the inventory Item subtypes or making the weapon/clothing/container/food behaviors a referenced object so you can mix and match features
I forgot this was a thing, but turning items into weapons makes the loader toss them out
probably for the sake of avoiding bogus variables
but being able to grab so many things as weapons is just a better experience
personal opinion of course
and I can't make purses a weapon because it would break the bag functionality
unless I store the original and swap it on unequip
which I don't think would work very well
@sour island
that the TS stuff?
Yeha i
i made a command line tool
to create and manage a project
Not completed but when i finishes everything and feels like its ready ill show how to use this
did you skip reading the tutorial? lol
i dont think so
i followed every step
i got the intelliJ IDEA and kept following everything
could you send me a screenshot of where i could find it?
hmm lemme check the tutorial again
there's a step about moving the files out of generated
depending where you setup your capsid project directory it will be in a directory named lib
if after the setupWorkspace config completion its not there, chance are there was an error in one of the task
Most of the time it would be caused by the java version used
I wonder if that folder could be generated ready to go
could even pull the version number
make a new directory
What is getting me confused is when I create a new project, it shows me this
odd
and I have no idea how to go on, because it differs from the tutorial
now, I forgot how did I complete the tutorial lol
My tutorial only explain using gradle
Even tho it would be possible using groovy and maven but me personally idk about those xD
im noob with java environment
I can't even tell what are those ๐
Yeah me neither its ok
lol
Gotta accept that we dont know everything cause there too much to learn in this world
brain overheating sometime
@sour island now I have a problem like this guy
i only use shareX for gif making disable all screenshot stuff
I have mine not even make a local file
stays as a clipboard
exception is for gifs
which sometimes need editing
i prefer https://app.prntscr.com/en/index.html for my screenshot its a bit lighter than shareX
But shareX is amazing for the video and gif stuff
why do people even use stuff like that for normal screenshots instead of the builtin ones lol
hum built in doesnt have much features
like selecting part of the screen
adding quick arrows or shapes
macOS has a better printscreen vanilla feature but bill gate dont care
yeah the context menu when you right click the icon takes 3 pages lol
xD
but this is way too many features lol
what a fraud
cant trust nothing these days
really low effort lol
Have you seen my posters?
much better than this
its epic
you're an artist
I also did all the scrap posters
but your github pic turn me off
can't a man pick his nose with his firearm?
๐
oh, it's a gun? I thought it was a pipe ๐
for the sake of TOS it's a pipe
did you draw those?
uploaded all my old pfps so I dont spam chat https://imgur.com/a/2qWnhDS
very unique art style
the fallout one got me lul
we need a random fart, burp mod that you can do with some unused keybind, like in gta 2
there we go
I'm ready for my gallery show
hard to tell but that cowboy hat is tig welded, so is the baseball hat
that's huge if you can make it to work in MP and everyone can hear the same sound
Reminds me of SS13's poop system that got quickly removed
i loved that feature in gta2, especially i was only like 8 yr old
the definition of fun
all their liquids are interchangeable with food
as in food contains "liquids" for hunger and other effects
they made poop hold a liquid of poop
you can uh... put 2 and 2 together
wasnt that just a joke thing on a few servers
involuntary vomiting was also a thing
Yeah because every round literally turned to shit and it got really unfunny
i feel like i remember one server had the poop system enabled occasionally as a joke round
that's just fake inconvenience
we need STUFF
?
REALISM
well there is a defecation mod already
cause there's NO OTHER way we could achieve that
i think it also have random fart
time to port the animal defecation from b42 to humans
plus poop can be used for fertilizer
scat fetishists are crusaders
just like ark
I feel like ark does it right in that it's just an item
you can't do vile stuff like in SS13 lol
I feel like it doesn't belong in PZ
There is this mod, but it got abandoned https://steamcommunity.com/sharedfiles/filedetails/?id=2197666984
The question is can we turn the conditional-speech into conditional-voice?
i feel small needs like bladder should be there but just as simple as sims game
Oh yeah that'd be ok
no graphics
back
make players wash their hands before eating
just got home to my own apartment
germs could be a fun mod
well in my past server i had a mod i made and never release where dish would be dirty after using it, you had to clean it. using liquidsoap and possibly a towel and sponge for a faster cleaning
using dirty dish could effect the happyness of your cooking
konijima, the script you gave me does not work. It throws and error, heck it won't even open crafting menu
I feel like this would be good if it was automatic
(fetching error code)
and not like 5-6 different recipes
could work if you had the context menu be a slider
youll have to refresh my memory about what i sent you cause ive sent a lot of stuff recently
sure, one sec, let me just post the error code
[25-07-22 18:40:32.295] LOG : General , 1658767232295> Init ISContextManager.
[25-07-22 18:40:32.336] LOG : General , 1658767232336> ModOptions: Loading ini data....
[25-07-22 18:40:32.338] LOG : General , 1658767232338> ***** Bottling of Meat MOD *****.
[25-07-22 18:40:32.338] LOG : General , 1658767232338> It was added to the game system!.
[25-07-22 18:40:32.746] LOG : General , 1658767232746> FirstNAME:MayaAGCM.
[25-07-22 18:40:37.436] LOG : General , 1658767237436> -------------------------------------------------------------
attempted index: 1.0 of non-table: null.
[25-07-22 18:40:37.436] LOG : General , 1658767237436> -----------------------------------------
STACK TRACE
-----------------------------------------
function: @stdlib.lua -- file: null line # 10
function: setVisible -- file: ISCraftingUI.lua line # 30
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1366
function: onPressKey -- file: ISCraftingUI.lua line # 1380.
[25-07-22 18:40:37.437] ERROR: General , 1658767237437> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: 1.0 of non-table: null at KahluaThread.tableget line:1689..
[25-07-22 18:40:37.437] ERROR: General , 1658767237437> DebugLogStream.printException> Stack trace:.
[25-07-22 18:40:37.438] LOG : General , 1658767237438> -----------------------------------------
STACK TRACE
-----------------------------------------
function: @stdlib.lua -- file: null line # 10
function: setVisible -- file: ISCraftingUI.lua line # 30
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1366
function: onPressKey -- file: ISCraftingUI.lua line # 1380.
[25-07-22 18:40:37.439] ERROR: General , 1658767237439> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: at KahluaUtil.fail line:82..
[25-07-22 18:40:37.439] ERROR: General , 1658767237439> DebugLogStream.printException> Stack trace:.
[25-07-22 18:40:37.440] LOG : General , 1658767237440> -----------------------------------------
STACK TRACE
-----------------------------------------
function: @stdlib.lua -- file: null line # 10
function: setVisible -- file: ISCraftingUI.lua line # 30
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1366
function: onPressKey -- file: ISCraftingUI.lua line # 1380.
[25-07-22 18:40:38.552] LOG : General , 1658767238552> -------------------------------------------------------------
attempted index: view of non-table: null.
[25-07-22 18:40:38.553] LOG : General , 1658767238553> -----------------------------------------
STACK TRACE
-----------------------------------------
function: getRecipeListBox -- file: ISCraftingUI.lua line # 21
function: refresh -- file: ISCraftingUI.lua line # 60
function: setVisible -- file: ISCraftingUI.lua line # 38
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1369
function: onPressKey -- file: ISCraftingUI.lua line # 1380.
[25-07-22 18:40:38.553] ERROR: General , 1658767238553> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: view of non-table: null at KahluaThread.tableget line:1689..
[25-07-22 18:40:38.554] ERROR: General , 1658767238554> DebugLogStream.printException> Stack trace:.
[25-07-22 18:40:38.556] LOG : General , 1658767238556> -----------------------------------------
STACK TRACE
-----------------------------------------
function: getRecipeListBox -- file: ISCraftingUI.lua line # 21
function: refresh -- file: ISCraftingUI.lua line # 60
function: setVisible -- file: ISCraftingUI.lua line # 38
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1369
function: onPressKey -- file: ISCraftingUI.lua line # 1380.``` sorry about wall of text
Could be as simple as hovering over parts of the context menu to change what you're using
#mod_development message
(When i test clikc this, i still need to scroll up a bit more, but not by much...)
although making that work would be a pain
Hi everyone, sorry for the basic question, new to PZ modding. I'm looking to get and set the value of the character's calories. I haven't yet found a full reference, what would be the place to look up what methods are exposed for doing that?
Subscribe to this and check the code
ok I'll check it out, thanks for the tip.
wait, female calories are hardcoded vs males? um... Indie stoooonee~~ What were you thinking???
realism
oh?
lol
maybe an oversight
and probably not that necessary of a feature I think lol
dm me with your code
not sure what is going on in your error
that is interesting. i was doing this in the first place because i was getting a little sick of living off of 1 fruit salad a day to keep the same weight. it felt entirely ridiculous
I agree, but I think it stems from calories being added after alot of other features
while timed actions burn calories alot of basic activity does not
With some testing I noted that my character, while being quite active, burns about 900 calories per day, and I felt like I needed to see if I could do something about that.
What do you mean about being active?
moving around, looting, carrying zombie corpses around
things that should be burning a good bit
you can see the timed action rates based on file names
I think jogging sprinting does change it too
but I'd have to check
I see that yeah, now I know that only timed action and running really burns some, but either way
jogging does yes, I know by watching it in debug and running around.
private void updateCalories() {
float var1 = 1.0F;
if (!this.parent.getCharacterActions().isEmpty()) {
var1 = ((BaseAction)this.parent.getCharacterActions().get(0)).caloriesModifier;
}
if (this.parent.isCurrentState(SwipeStatePlayer.instance()) || this.parent.isCurrentState(ClimbOverFenceState.instance()) || this.parent.isCurrentState(ClimbThroughWindowState.instance())) {
var1 = 8.0F;
}
float var2 = 1.0F;
if (this.parent.getBodyDamage() != null && this.parent.getBodyDamage().getThermoregulator() != null) {
var2 = (float)this.parent.getBodyDamage().getThermoregulator().getEnergyMultiplier();
}
float var3 = (float)(this.getWeight() / 80.0D);
if (this.parent.IsRunning() && this.parent.isPlayerMoving()) {
var1 = 1.0F;
this.setCalories(this.getCalories() - (this.isFemale ? this.caloriesDecreraseFemaleExercise : this.caloriesDecreaseMaleExercise) * var1 * var3 * GameTime.getInstance().getGameWorldSecondsSinceLastUpdate());
} else if (this.parent.isAsleep()) {
this.setCalories(this.getCalories() - (this.isFemale ? this.caloriesDecreraseFemaleSleeping : this.caloriesDecreaseMaleSleeping) * var1 * var2 * var3 * GameTime.getInstance().getGameWorldSecondsSinceLastUpdate());
} else {
this.setCalories(this.getCalories() - (this.isFemale ? this.caloriesDecreraseFemaleNormal : this.caloriesDecreaseMaleNormal) * var1 * var2 * var3 * GameTime.getInstance().getGameWorldSecondsSinceLastUpdate());
}
if (this.getCalories() > this.caloriesMax) {
this.caloriesMax = this.getCalories();
}
if (this.getCalories() < this.caloriesMin) {
this.caloriesMin = this.getCalories();
}
}
this is the process
timed action modifer gets set first
if they're climbing it sets it to 8
that... shouldn't be flat
I think 80 is considered normal so it modifies what you burn if you are above or below normal
mhmm i think they fixed the female balance in .73
that's good
there is not as much of difference anymore
My really overly simple solution was just going to be to have it steal like 1000 calories from me every time the day ticks over.
orrr just use nutrition tweaker and make it go down faster ๐
you could tack on more burning in update
especially for climbing
that seems unfair
Yeah that mod actually might solve my problem by itself lol though I wonder if it works the same for single player, and also it uses the sandbox settings so not sure if I can put it in an ongoing playthrough
also is it me or the inventory weight not accounted for?
Just from testing, inventory weight doesn't appear to be
only running/jogging it appeared
which is basically walking in squat
and timed action ofc
all PZ players going to have some nice buns from all that squating
what do you mean tack on more burning in update?
OnPlayerUpdate
depending on when stats are calculated
you could add onto the burning rate
for singleplayer you can use https://steamcommunity.com/sharedfiles/filedetails/?id=2670674997 but you will have to go back to main menu and load again for the setting change to take effect
also once you are satisfied with the settings you can disable the mod from your save game to remove the context menu (for Change Sandbox Options mod)
Thank you. I'll play around with your mod a bit it looks like it might do exactly what I want already.
if you test as admin in a host server, make sure to remove godmode as the values wont move otherwise
I was going to use it in a solo sandbox
If you use debug mode you will be able to get the UI to see how fast it decrease at least for the time you set it up
right, ok
you can also use this mod to check the values without debug https://steamcommunity.com/sharedfiles/filedetails/?id=2833096579
rewrite from an old Eris mod
ya i wish this was vanilla cause i hate my graphics
It's an area of the game I think needs some love overall for sure
nutrition's update is called before onplayerupdate
I think that's good? I guess one would have to redo some math eitherway
private void updateWeight() {
aw
oh it's both private
private void updateCalories() {
w e l l
should take me about 15 minutes after I eat
are they tweaking onplayerupdate or the values for each food?
it appears to modify the values on each tick
each tick it gets what the value is set to, then bumps it up or down depending
that is what I would be doing - but what values?
nutrition:getCalories()
hm
or nutrition:getProteins(), etc...
yus
yeah since i cannot prevent the original update from happing this mod only adds up
and can only make decreasing faster
originally made it for real-time server where nutrition would be way too slow
I'm thinking ultimately I will use the code from nutrition tweaker and just pull out the part about looking for sandbox config and just put in the values I want
but this wouldn't take into account what the player is doing
nah it doesnt
it ultimatly just make it faster because its uses getGameTime():getGameWorldSecondsSinceLastUpdate()
so if game time is set to real time its just way too slow
I was going to rewrite the updateWeight() as lua lol
but even if you do there is no way to prevent the java update to happen originally
yeah
but there is no problem to do it tho
if you want to add up to the original decreasing logic
One part I'm not quite getting. Why are you multiplying the decrease by the amount of seconds since last update?
that is what make the nutrition values relative to game world time
gamespeed
aah I see
should not
if (this.parent.IsRunning() && this.parent.isPlayerMoving()) {
var1 = 1.0F;
this.setCalories(this.getCalories() - (this.isFemale ? this.caloriesDecreraseFemaleExercise : this.caloriesDecreaseMaleExercise) * var1 * var3 * GameTime.getInstance().getGameWorldSecondsSinceLastUpdate());
} else if (this.parent.isAsleep()) {
this.setCalories(this.getCalories() - (this.isFemale ? this.caloriesDecreraseFemaleSleeping : this.caloriesDecreaseMaleSleeping) * var1 * var2 * var3 * GameTime.getInstance().getGameWorldSecondsSinceLastUpdate());
} else {
this.setCalories(this.getCalories() - (this.isFemale ? this.caloriesDecreraseFemaleNormal : this.caloriesDecreaseMaleNormal) * var1 * var2 * var3 * GameTime.getInstance().getGameWorldSecondsSinceLastUpdate());
}
base game does the same thing
you can set gamespeed to x1000
that'd melt CPUs if you ticked that much lol
it might even lower the ticks if anything, to compensate with faster world computation
idk
technically could but there's visual elements that update
here some calories for you
lol
if you can't see them. make sure they aren't by the IDE. there are some file types it will automatically hide in IDEA
ok this works! I basically just did like I said, took konijima's mod and pulled out the sandbox settings and split screen support portion and went with it.
does exactly what i was hoping for beyond that
neat
fancy
haha i like how chuck always start with the poster
and then you look i my posters and they just white with black text (how original)
I like the write up, I'm looking forward to getting to try it out
Sorta off topic but related to this chat, another game I play a lot (VRChat) just announced they are banning ALL mods to the game tomorrow lmfao
The opposite of project zomboid
you probably need to make the text briefer because from experience people on the workshop will somehow manage to not read it and then ask about something really basic that was already clarified in the description
yeah lmao its insane that theyre trying to add anticheat to a game with literally no stakes or gameplay
pretty much but theyre adding anticheat to specifically stop people from using modded clients that add in new features
Ah yeah seems like a legal step they kind of had to take
their statement
damned if you do damned if you don't - for them
less anticheat and more user security
EAC will do worse than the mods that prevent the current issues with VRC
i don't really buy the user security thing tbh it sounds more like them seeing the modded clients as a threat to the subscription service they have
In VRC there is 0 encryption atm
Aren't they a free game?
Sims4 has a checkbox where you allow script mods and most likely agree with the risk of using it. I mean people should be responsible for their own safety
You can pull anyone's IP and crash any server instance
And those modders would be silly to provide an entirely working client with out the base game - free or not
yeah but they have a premium sub that adds stuff like profile pictures and other stuff like that
and i think it also gives you more favourite slots?
Most likely what is happening is VRC is prepping for a hand off to a buyer, as it's been inching that way for years now
most modded clients gives you unlimited favourites
ah
please no zuckerberg here
Games don't usually enforce EAC (which was bypassed for VRC in the first five minutes of the announcement) unless they are selling to a Corp
yeah vrchat does seem like something that would be a good purchase for a corp
zuckerburg buying it would be the funniest possible outcome honestly
It would make sense
First oculus gets pushed out, then oculus headsets become 80% or so of the playerbase, then they buy VRC IP and take a ready audience for ad revenue and whatever else

they about faced their FB requirement for quest accounts
they're floundering a bit with what the hell to do with the tech
FB did?
- there's more competition coming in
Yes, they're getting rid of the FC acc requirement - you have to create an oculus acc or lose your library though lmao
Yeah I hate FB lol, I hope they fail. They made cool jumps in developing more mobile VR tech, but other companies should be in the ring not just the one
Well there is more now
Not to mention in the TOS you submit your rights to biometric data :)
probably why they're getting on their best behavior
The new oculus killed a lot of cool startups I was excited for
Decca VR was going to have the first 30 point face tracking, was wild... But they ran out of chips due to them not being a high bidder against FB
you know - there was a japanese vr MMO released recently
doesn't have a logout option
lmao
wanted to share a fun bug a mod Konijima gave me:
The illusive Triple Heavy Duty Battery.
was to funny not to share ๐
Damn lol
tried to google it just now
what is it called? operators?
I only know it as shorthand / inline macros
It's a conditional typr
As all things should be
I think that the ternary operation is performed as such:
local foo = bar and val1 or val2
bar being the condition.
I recently rewatched the whole series, apart from the second season.
alicization was pretty good
When I saw the first ep release for it I thought it was just a reimagining of SAO as kids and walked away. Came back and tried it and honestly it's the best arc IMO.
It really pushes the main characters in a way that brings about an amazing story.
Sorry it took longer than I thought, what I have so far:
local caloriesDecreaseExercise = 0.13 --as per vanilla
---@param player IsoPlayer|IsoGameCharacter
local function RCB_updateCalories(player)
if not player then return end
local pNutrition = player:getNutrition()
if not pNutrition then return end
---base caloric burning rate
local baseRate = 1
---thermoModifier
local thermoModifier = 1
local pBodyDamage = player:getBodyDamage()
if pBodyDamage then
local pbdThermoregulator = pBodyDamage:getThermoregulator()
if pbdThermoregulator then
thermoModifier = pbdThermoregulator:getEnergyMultiplier()
end
end
---weightModifier
local weightModifier = (pNutrition:getWeight() / 80)
local inventoryModifier = player:getInventoryWeight() / player:getMaxWeight()
if player:isAttacking() or player:isClimbing() or player:isClimbingThroughWindow() then
baseRate = math.max(8, 8*inventoryModifier)
end
if player:isMoving() then
baseRate = baseRate * (caloriesDecreaseExercise/2)
end
baseRate = baseRate * weightModifier * thermoModifier * getGameTime():getGameWorldSecondsSinceLastUpdate()
pNutrition:setCalories(pNutrition:getCalories()-baseRate)
return baseRate
end
what is climbing besides a window, like up a sheet rope?
this might double calorie burning for attacks and climbing... hold on
yes
I think sheet rope and fence I assume
I think isclimbing is fence
and through window includes up sheet ropes
not sure tbh there's no getter for it
oh right, fences. Yeah I like this.
Im going off the vanilla calorie update either way
although an extra 8 calories burned won't kill anyone lol
No, that's for sure.
It's definitely a more detailed solution than adding a straight multiplier, I think the most work here is going to come in testing the balance
I don't know in what way the other nutrients come in to play, like as in what impact it will have, if anything, if you scale the calories but not the other 3
Nothing for weight gain or loss I know, but if it matters for other things, since you will have to be eating more, and so gaining more of the others
weight gain only looks at calories iirc
I believe that's right, I just don't really understand what impact the others have if any, in vanilla, if anything.
If I had to assume endurance/fitness stuff
could check it out when I tackle update weight
It might be worth looking, to scale relative to your baseRate?
Since you have to eat that much more food
I mean the change would be pretty mild
I could actually make it ignore sleep/normal and ignore if sprinting
๐ค
public boolean isRunning() {
return this.getMoodles() != null && this.getMoodles().getMoodleLevel(MoodleType.Endurance) >= 3 ? false : this.bRunning;
}
heh
{
AGCMOddThingy=2,
[base.Mugl/base.MugRed/base.MugWhite/base.MugSpiffo],
Result:AGCMDuplarino2Half,
Sound:Hammering,
Time:10.0,
Category:AGCM,
}```Would this work?
Or am i useing the multiple item thing wrong?
I wonder why running would be set to false if endurance is over 3? is that when you can't run?
as far as i can see, i don't need the squre brackets... alright, good to know
I don't think you're supposed to use the [] like that
I think you should remove the []'s ?
i did ^_^
aye
I think it expects a table as a result
Had a moment of clarity and probably over thought this but:
basically recreates the vanilla rate stores it and then applies changes
at which point it takes the vanilla rate and subtracts the new rate
which is then the burned calories
so it won't burn extra
I probably need to throw in an abs() in there
.
This is text
This is text
This is text
546869732069732074657874
and
VGhpcyBpcyB0ZXh0
Why?
No clue... Just felt like it ๐
yeah later endurance moodles stop you from being able to sprint, then run, until eventually you can only walk
If i want to use a mod to change the name of an base. item, how do i do this?
I want to change the name of the keyring to "Magical Key Ring"
How were you seeing calorie burning in real time?
I wonder if I don't have to do weight loss if I can just adjust the calories
using the moodles section in debug mode, it's towards the bottom
I wouldn't think so, I mean weight kind of takes care of itself based on the calories
that's what I was thinking
I'll test it out
do you think the inventory weight in general should contribute? or just being over capacity?
i would say just over capacity, maybe a bit more at each capacity tier
almost instantly lol
hmmmm
I have a feeling onplayerupdate is running more times than nutrition update
do you see where the real time calorie readout is?
yup that
is that normal?
i dont usually see it bump up and down quite like that
does it drop at that speed?
wow i think i need coffee or something, it's looped obviously lol
yes that looks about normal
a bit faster than normal
i usually compare by passing like 2 hours or something, and find the difference in that amount of time
on fast speed
did you end up doing it on the weight or the moodle level?
it's on weight - I'm trying to see what they're doing to decide moodle level
and maybe use the same logic
not easy to find
can you just grab the moodle level once its already applied?
found it
float var7 = 2.8F;
switch(this.Moodles.getMoodleLevel(MoodleType.HeavyLoad)) {
case 1:
var7 = 1.5F;
break;
case 2:
var7 = 1.9F;
break;
case 3:
var7 = 2.3F;
}
I'd rather use the fraction used for heavyload
ah, cool
Very active day here.
I'm busy making sound packs for Random Sound Events. Lots of possibilities.
Going to probably pull an all-nighter.
Nice.
updated pzpw along with the template
Oh hey. Nice.
Hwo do i change the name of the keyring?
and, is it just me, or is tooltips VERY finicy getting to work???
Item tooltips are a pain
Off the top of my head here
item:setName("YOUR CUSTOM NAME")
item:setTooltip("YOUR CUSTOM TOOLTIP")
Note, however:
- although some modified item properties are "persistent" (ie they will be the same after quitting a reloading, etc.), not all modified item properties are persistent.
- Modified names are persistent; modified tooltips are persistent.
- Behind the scenes we are talking about making more modified item properties persistent, such a tooltips, for modding purposes.
- I don't know what modified item properties are persistent or not; testing is the best way to find out unfortunately.
alright, cool, i saved you message in a .txt file, will look into figuring out how to actually apply it once i wake up tomorrow it's 3am
https://steamcommunity.com/sharedfiles/filedetails/?id=2840487215 leave a comment and I'll add you as an author
Also if you wanna tweak it / etc https://github.com/ChuckTheSheep/RebalancedCalorieBurning
lol damn you steam
gotta go find the damn PZ file launcher
@sour island by the local file you mean the standard /Zomboid folder right?
yes
shweet
Any pointers for the direction on a recipe mod?
I was looking into how to add the custom launcher for testing mods on your post in pins
you could look at the RecipeScript file/class
shows you alot of features that aren't widely used
le pog
as for lua coding on the recipes, is that client or server facing?
ah yeah that's a game changer - I don't haveto keep unsubbing from my own mods lol
scripts are their own thing - just a .txt with specific formats
java prases them
hm, I mean more so like if I wanted to make a recipe mod, could I change the java end and not worry about having to distribute to my playerbase
If its client facing and I use java, I have to have everyone then download the file
I am not sure
server facing and they don't need to worry
@wraith root look in this file for examples of recipes steamapps\common\ProjectZomboid\media\scripts\recipes.txt
I would assume server facing
thank ya
Im trying to find a good extension for VScode to emulate IntelliJ
I could just use both, but I like VScode lol
media/lua/server/recipecode.lua this is where the lua stuff you can inject is located
so I would assume it's 100% server facing
that's good, I might make a java file then for the custom recipe
most of the flexibility of recipes is lua sided + the tags param
you recommend Lua instead of Java here?
I guess its a small change, however I don't feel I would need to dedicate a whole workshop item to it
depends on what you want out of it
Over time I will add more simple recipes
what the hell?
Right now its simply a notebook and battery recipe
Notebook => 15 pages
Battery (for mobile devices) => 1 Aluminum roll + 1 scrap part + 1 electronic part OR 2 small sheet metal + 1 electronic part
what have you done!!
ah very nice! did you get the balance to where you were happy with it?
i don't know what it means
cool, I'll play around with it sometime soon
I'm soooo confused as to why this mod talks about creative... ... wtf
It shouldnt be adding that much more caloric loss - the main difference is the inventory factor and the moving which is half of the exercise factor
just the moving part alone will probably make a big difference overall
if you want zip it to me in DM and ill check the structure of it and let you know if anything looks wrong
but honestly i never saw that error
Literally just screen shot the contents/ folder
He has something in there other than a directory named the allowed terms
I've done that by accident including an image inside of contents
You can also mess up if you point your GitHub there
OR have you been developing your mod on your local files and just now set up the upload folder?
maybe there are .git in your mod folder?
Workshop/Name/Contents/mods/Name/media?
Yep
but I want to go that route.. ree ... digging continues
not to mention I would have to decompile and recompile crossing my fingers it translates right 
The entirety of recipes is script based the Java just parses the text and holds methods
UI_WorkshopError_FolderNotAllowedInContents = "There are unrecognized folders in your Contents/ folder.\nThe following folders are the only ones permitted in Contents/:\n%1",
well if its already based in script might as well continue the scripting
He probably doesn't have the right structure
going for that small footprint in my environment approach lmao
well it turns out
Contents/mods/
if you write Mods directory not in lowercase it wont work
sadge
I mean if it can be used on an ongoing save without problems
@sour island I grabbed it from github and swapped it in to my save. I'll let you know how it feels after I play with it for a little while.
Appreciate it ๐
both work fine for my server
hmm.. so, I could do fun stuff and just directly edit the recipes.lua file, but what is the method one would use to make a recipe (either a separate file or in the file itself) and then add it to workshop for my server?
I guess I don't have to add it to workshop but it would be good to learn the process of getting one up there
I mean... I could write a script, extend Recipecode.lua to it, then call the functions it contains within recipecode...
no need to extend
its already global
you can use any of those vanilla functions if needed
oh NO not unannounced globals
it has to

for this at the very least
if you want to make your own you can just create a file in lua/server with a proper name such as YourModName_Recipecodes.lua and copy the 6 first lines and rename Recipe for your mod name
hellelua
As for enforcing downloads of the mod by clients, is that necessary as it is server facing?
clients actually runs the server scripts
to prevent a server lua script to run on a client but allow it to run in singleplayer just use
if isClient() then return; end
at the top of that server file or where ever that must not be executed on a client
as for these safeguards? What are they up to
good to know, luckily here the goal is for a dedicated server
well bascially a mod should be compatible for singleplayer, host and dedicated without no efforts
singleplayer will run client,server,shared, clients too, and host/dedi server will run server/shared
For this mod as it is server based, I am looking to avoid hurdles for singeplayer
I'm not looking to add compatibility for lone users unless there is an elegant way to do so
isValid checks if the item is in the inventory / tools needed are present, not broken, etc
OnCreate is the added lua function stuff I mentioned - has params equal to ingredients and recipe stuff - can be a bit weird as ingredients are only taken after onperform
for something like this, I will have to make an assignment in my own code no?
As this is a nice call to the function
gosh this file is a bit hard to digest
Okay wait
lot of unrelated things going on
sure, that sounds good
I used to mod for GTA, never this game so this is new for me
(Much different lol. Similar languages though)
all you need is
-- Create a global table with my mod name
YourModName_Recipe = {}
-- Prepare sub tables for the type of functions you could need
YourModName_Recipe.GetItemTypes = {}
YourModName_Recipe.OnCanPerform = {}
YourModName_Recipe.OnCreate = {}
YourModName_Recipe.OnGiveXP = {}
YourModName_Recipe.OnTest = {}
-- Define the actual functions you need here
so an example you could need is
function YourModName_Recipe.OnCreate.GiveMoreItems(items, result, player)
player:getInventory():AddItem(result:getFullType()); -- add an extra result item
end
then inside your recipe script .txt file you would just use:
recipe Make something {
stuff,
result:resultStuff,
OnCreate:YourModName_Recipe.OnCreate.GiveMoreItems,
}
@thin hornet will you be here tomorrow too?
I have no idea where i will be in 10 minutes
oh
interdimensional being
Google could reupload me back for software updates
just hit me up tomorrow and if im here ill reply
it's 4am, so i think i wish to head to bed - but if there is low chance to meet you tomorrow, then i honestly fear for the mods future
hm
it's sooo close to being done
what is the file structure necessary for the game to properly parse my files
YouModID/
-mod.info
-poster.png
-media/
--lua/
---client/
----YouModID/
---server/
----YouModID/
---shared/
----YouModID/
is a .info just the readME?
i suggest adding an additional directory inside client/server/shared with the mod ID again
is there a Mod ID generator, or does the workshop assign it
Mod id should be your mod name with no space preferably
for example
ModID: MySuperMod
ModName : My Super Mod
ahh I meant the workshop ID, I think steam makes that then
this structure here must be inside your workshop directory like this:
MyDocument/
- Zomboid/
-- workshop/
--- MyModId/
---- workshop.txt
---- preview.png
---- Contents/
----- mods/
------ YouModID/
------- mod.info
------- poster.png
------- media/
-------- lua/
--------- client/
---------- YouModID/
----------- MyClientScript.lua
--------- server/
---------- YouModID/
----------- MyServerScript.lua
--------- shared/
---------- YouModID/
----------- MySharedScript.lua
@thin hornet i know you juggle a lot, but any chance we could try fix to final bug before i head to bed?
look into C:\Users\<user>\Zomboid\Workshop\ModTemplate
thats the default template to start with
after writing this directory structure message above i realized its not as simple as i though xD (at least to visualize)
So basically you mod structure inside the media/ directory will most likely mimic the base game media/ structure
your mod C:\Users\Konijima\Zomboid\Workshop\ModTemplate\Contents\mods\ModTemplate\media
game : C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media
then if you add lua, scripts, textures, ui, etc thats the same structure
if you were to add the same file in the same directory you would most likely overwrite the vanilla one when your mod loads
prefer not to lol, but that's why I am asking the simple questions as I know I wont be the only one looking in the future
looks alright, so now if you add lua script inside your client/RecipeModBatteryJournals directory and need to require an other of your lua file you would use require('RecipeModBatteryJournals/myotherfile').
Wouldn't it make more sense to have separate files since for client you are going to add a check to disable the server script? I still didn't understand that step myself
which mean that require() statement base bath is the stuff after client/ shared/ server/. Which is why i told you to add those other directory with your mod id
makes sense
So if your mod just need server scripts you can omit adding a client/ directory it doesnt matter
any client/ script can require other client and shared lua script.
any server/ script can require other server and shared lua script.
client cannot require server and server cannot require client.
eventually once I get the server side running, I'd like to do the steps to make this a workshop item so I know for the future
yeah for now as you develop it you can use the C:\Users\Konijima\Zomboid\mods\mymod\ directory
well where is your RecipeModBatteryJournals main directory
in an unrelated directory atm
ah you wont be able to load it in the game
so just drag it inside C:\Users\Konijima\Zomboid\mods for now and it will be loadable in host and self hosted dedi
I swapped it on over
For the naming conventions it looks as if it implies I can only make one recipe per mod
which.. we both know isn't trye
true*
haha
take a look at
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts
the game uses txt script, which is a custom format for pz itself.
the directory i sent you above contains all the base game script which is where the items, recipes, definitions are
is it going to be angry if formats are not matched ?
so for your own mod you will replicate the directory strucutre
more so in whitespace
only thing that matter is the stuff inside the { }
oh what i mean is that for your mod scripts TXT you will add a scripts directory in your media directory
Okay, the mod works 99%
I just need to move the key item to the Dupe mod instead of the other one (easy enough)
Then i need to make an icon for the key item.
Thanks a ton Konijima!
if you wanted to add sound you would create the a sound directory exactly how the base game media directory does
After having moved the item, i just need to make sure the script looks in the right module, then save, upload and then bed time!
fair enough
ah you say directory and I assume folder, I think I got confused as to me I call them files inside their directory
quick question, can recipes and item definitions co-exists in the same file?
it can yes (for the sake of keeping it clean I suggest you use 2 file, myItems.txt and myRecipes.txt
awesome, cause i only got one item, no need to make a new text file just to have a recipe for it while i got a 2nd file for it's def
looks like I need to extend the Base
unless the module would be my mod here as its not "vanilla" as a recipe
module MyModId {
imports {
Base,
}
// yours stuff
}
Okay, now i just need to upload and then passout ๐
I see here in the example it uses / to denote options for a recipe
If a recipe has two options, but each option uses different multiple items, what would that look like?
I guess I could keep digging to see Im sure an example is in here
just thinking aloud
well the upper part lets call it ingredients
recipe Craft some cool stuff {
ingredient1,
keep ingredient2,
}
recipe Fabricate Small Battery
{
Aluminum,
ScrapMetal,
ElectronicsScrap
Result:SmashedBottle,
Time:20,
Sound:BreakGlassItem,
}
there is multiple way of adding optional ingredients such as when a recipe could use different type of hammer
the bottle is stuff I havent touched just yet
Lets say you have these two options
Aluminum + ScrapMetal + ElectroScrap
OR
SmallSheetMetal=2 + ElectroScrap
so would the / be between all of it?
or more so options per item
Aluminum + ScrapMetal + ElectroScrap
Aluminum,
ScrapMetal,
ElectronicsScrap,
OR
SmallSheetMetal=2 + ElectroScrap
SmallSheetMetal=2,
ElectronicsScrap,
oh you mean your recipe have different possible combination?
mhm
if thats the case, then you will probably need 2 recipe
so the \ means that it can be this item or an other
but only for that ingredient "slot"
hm
I could just make it more dynamic and add options for the current stuff
there
recipe Make 4 Bowls of Soup
{
PotOfSoup/PotOfSoupRecipe,
Bowl=4,
Result:SoupBowl=4,
OnCreate:Recipe.OnCreate.MakeBowlOfSoup4,
Time:80.0,
Category:Cooking,
OnGiveXP:Recipe.OnGiveXP.None,
}
So for this recipe you could make 4 bowl of soup if you have 4 empty bowl and (a pot of soup OR a pot of soup recipe)
ya in that case you need aluminium or smallsheet AND scraptmetal or electronic scrap
perfecto
thats the aim there since the two exclusive recipes might be too uh... deceptive
also
for the way to write it (its weird i know) but it should be
Aluminum/SmallSheetMetal;2,
ScrapMetal/ElectronicScrap;2,
some stuff like that might be confusing but look at example and youll find out
instead of = its a ; cause you using multiple possible variant
ah fair enough
as for category, I presume that is for XP gain
is there a way to enable XP gain on my recipe's? (Sure there is! But h o w lol)
no the Category is for the Tab in which the recipe will be in the crafting menu
take a look at a cooking recipe such as recipe Make Pie Dough
it give cooking XP using a function defined in recipecodes.lua
which is why you can have your own recipe codes lua file in media/lua/server/YourModId_RecipeCodes.lua
yeah take a bite at a time
search for Recipe.OnGiveXP.Cooking10 in the recipecodes.lua you had open earlier
so that function look like this
function Recipe.OnGiveXP.Cooking10(recipe, ingredients, result, player)
player:getXp():AddXP(Perks.Cooking, 10);
end
the parameters are that and nothing else for OnGiveXP
recipe Make Cake Batter
{
Bowl,
Flour=2,
Butter/Lard/Margarine/OilVegetable;15,
[Recipe.GetItemTypes.Sugar];10,
[Recipe.GetItemTypes.Egg]=2,
Yeast,
[Recipe.GetItemTypes.Milk];5,
Result:CakeBatter,
NeedToBeLearn:true,
Time:50.0,
Category:Cooking,
OnGiveXP:Recipe.OnGiveXP.Cooking10,
OnTest:Recipe.OnTest.WholeEgg,
}
there she is
open C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\recipecode.lua
youll see what is going on
at this point ill have to write a tutorial xD
things changes alot theses days so this is why there is not really a tutorial since its prone to change
these definitions are not required for modding right?
nah your to low in the file got up a bit
as in, for my mod, I won't need to define a new custom definition
ignore everything under -- These functions are defined to avoid breaking mods.
not in your own files no
function Recipe.OnGiveXP.Cooking10(recipe, ingredients, result, player)
player:getXp():AddXP(Perks.Cooking, 10);
end
I see the dingaling
this is the only ref to it other than the ignored zone
yeah here you go, that function will be called when cooking a cake batter
whats going on with these testing functions? for debugging?
Does anyone know how to get rid of the chug that happens as you continuously fire an auto weapon, I've played with the scripts and none of the numbers seem to affect this. Seeing if anyone else has had this issue.
OnTest is called before adding the recipe to the context menu, so if that function would return false that would mean you cannot do that recipe.
exemple
function Recipe.OnTest.DismantleElectronics(sourceItem, result)
if sourceItem:hasTag("Screwdriver") then return true end
return not sourceItem:isFavorite()
end
this just do some checking to make sure the items are valid
Done,. and goodnight everyone - Konijima, Thank you soooo much!
night man
I should likely implement a test then to check my items?
only if anything special to test for
Im a bit confused on how it checks when it already checks in the main function
as in is the food cooked?
does it check for tools as well?
Like if I need a crowbar or something to make certain items
well there is not much to check about it
what would you check on a crowbar? other than its condition which is already handled by default
more so if I need a crowbar in my inventory to make say a car battery break down into lithium bars
then you would just add keep Crowbar, as one of the ingrediant
so instead of asking for a car battery
I check to see if I have a crowbar in hand/in my inventory on top of the crowbar
w e i r d
recipe Dismantle Video Game
{
VideoGame, // WILL CONSUME THE VIDEOGAME
keep [Recipe.GetItemTypes.Screwdriver], // WILL KEEP THE SCREWDRIVER
Result:ElectronicsScrap, // WILL GIVE ELECTRONIC SCRAP
Time:30.0,
OnTest:Recipe.OnTest.DismantleElectronics, // THIS ONE SEEM TO CHECK IF THE VIDEOGAME IS NOT FAVORITED
OnGiveXP:Recipe.OnGiveXP.DismantleElectronics, // THIS GIVE YOU ELECTRONIC XP
Category:Electrical, // RECIPE WILL SHOW INSIDE ELECTRICAL TAB
AnimNode:Disassemble, // PLAY THE DISASSEMBLE ANIMATION
Prop1:Screwdriver, // SET THE SCREWDRIVER AS MAIN PROP (IN HAND)
Prop2:CDplayer, // ETC
}
thats a good example there
keeping that in mind for XP, I could just extend the base recipe file and reuse the XPgain for Electronics2
for the sake of it I will make my own
sure
so before you ask take a look at Recipe.GetItemTypes.Screwdriver in recipecodes
lolll i had the feeling
well actually
look at
function Recipe.GetItemTypes.SharpKnife(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("SharpKnife"))
addExistingItemType(scriptItems, "FlintKnife")
addExistingItemType(scriptItems, "HuntingKnife")
addExistingItemType(scriptItems, "KitchenKnife")
addExistingItemType(scriptItems, "Machete")
end
what's this fellow up to
so instead of typing all this as possible ingrediant
FlintKnife\HuntingKnife\KitchenKnife\Machete
you made a GetItemTypes function
that kind of get all possible items for ingredient
VideoGame, // WILL CONSUME THE VIDEOGAME
keep [Recipe.GetItemTypes.Screwdriver],
it will call that function and know all possible variant of usable ingredients for that line
As in tools that do the same job
Exactly
if you were to have 3 different screwdriver and an electrical screwdriver well you want them all to be usable in that recipe without typing it all everytime
So far its not that bad he?
gives a lot of freedom
Wrote another mod https://steamcommunity.com/sharedfiles/filedetails/?id=2840527826
does it mean eating food doesnt heal too?
that was quick
damn
I get the sniffles then croak
fuuuuck

impossible mod
pretty nifty
I am starting to see some of the strings that tie things in
did you decompile the source?
I have it yeah
then have a look at zombie\scripting\objects\Recipe.java
you ll find out everything to know about recipe txt script
I've perused it a bit, just wasn't sure when to use Java versus Lua but so far from my discussions with another user, they agreed that Lua is client facing / simpler mods and Java is server facing / complex mods
this isn't entirely true I know, but in saving a headache from developing mods in java that I would then have to have every player manually install? no lol... stick to lua for that
unless its server ended, then don't gotta worry too much on it
yeah thats why we stick to lua at least for the clients
like logging mods for my admins
I will eventually be getting a detailed logger bot up and going to log all item grabs and player activities so I can keep an eye on peeps
if you feel like you need something in your own server then knock yourself out and do it ๐
All the injury timers are set to a corresponding stored value or their current value whichever is higher
so you can bandage and stich but that should be about it
does food heal over time?
it does
hmm
eating is how HP goes back up
a full belly is a healthy person based on PZ logic ๐ so im super healthy
did we say if the timers in PZ are milli or second based? I presume seconds
so for your question about the Time:30 in recipe, its hard to answer cause it relative to the speed of the game. Its not second and not minutes and not ticks, but a value of 30 is fast as f
you kind of mess around with it and youll get the feel of the timing
and i probably need to dig the source and get the real answer about it
lol
I can scan the times on items Ive made before and get a good feeling for it there
recipe time is the same kind of time value as the TimedActions
once this mistery is resorve we will be good
@sour islandSo I played through a typical day in my game with your calorie rebalance on. In 24 hours I burned 1956 calories. This is compared to my test just vanilla of burning just about 1000 calories per day, so I burned about double. Now on this day I did a lot of running around with very heavy weight, moving zombie bodies and furniture, so it's probably just about the worse case scenario for burning calories.
Yes, this, we deliberately tried to both provide exiting templates for this stuff as well as examples for creating new functions in this vein for mods..
konijima's weight scale mod was fantastic for keeping track of this without having to be in debug mode btw
poggers
Oh yeah i really love that new feature, was it just added since .42? or its been a while
It's existed since the tags system was added in the fall of 2021-ish?
oh but was is not used massivly in the scripts txt since recently?
The broken glass and gasmask recipecode stuff is for mods and not vanilla.
๐ค
its just me i dont make recipe often so i didnt see it since recently
it was used with screwdrivers and hammers
and a few other things
Nah, it's been used in scripts since tags were added.
The "modder accomodation"/example recipecode.lua stuff is new however.
There's several functions in recipecode.lua that aren't used in vanilla, but are intended for mod functionality and example purposes.
an example would be write being added in, but the write tag exsisted before as it is needed for maps/journals but there was no gettype for it
i see i see ๐ ๐
To be fair there should be an example function for adding a tag to an item in recipecode.lua etc, but in our defense 1.0 is a longs ways away?
1.0 of what?
The Broken Glass tag was added as an easter egg for scrap weapons; if/when DjVirus comes back that will make the scrap weapons scrap shiv recipe "easier".
I'm a $20 Patreon for DjVirus so ๐
I thought you said you were full!
shhhuuutt
I'm several drinks in so this is the perfect time to try and finesse me?
hahaha
๐๏ธ๐ ๐๏ธ
Nah im not abusing drunks
d a m
But yeah, there's a couple of non-vanilla-functional "modder stubs" in recipecode.lua.
i used to have patrons when i had my server, but ive stopped the machine so next time!
sadge
No work no pay
gasmask/brokenglass
gasmask as in easily making a headgear act as a gas mask?
Nah; just having one in your inventory. It was just an accomodation for Hydrocraft etc.
like if i create a darth vador mask all i need is to add the gasmask tag for it to be protective of corpse fume
ah right, its a mod that does that
The gasmask tag does not currently protect from corpse fume.
Okay, the wizard of oz is gonna pull back the curtain here however.
I don't think this is unreasonable of me to leak this here now.
๐
But yeah, this is an instance, where, if it works, we'll try and provide advance notice?
Added a couple feature with the random Nuke blowing up, it make you sick, can burn random part of your body and scare the f out of you, so i have to make usage of the hazmat suit for radioactive protection
But also, in general, we are working to provide more "implied functionality" for both clothing items and items in general?
how does it work ?
me after a day of work https://www.youtube.com/watch?v=uXwRgnZ990I
Fashion Studio 7 Interviews Crazy Man
Visit our Website: http://www.fashionstudio7.com
each body part has a health getter and setter
local noHealingRecord = {}
---@param player IsoPlayer|IsoGameCharacter
local function noHeal(player)
noHealingRecord[player] = noHealingRecord[player] or {}
local pBodyDamage = player:getBodyDamage()
local pbdBodyParts = pBodyDamage:getBodyParts()
for i=0, pbdBodyParts:size()-1 do
---@type BodyPart
local BodyPart = pbdBodyParts:get(i)
local bpIndex = BodyPart:getIndex()+1
noHealingRecord[player][bpIndex] = noHealingRecord[player][bpIndex] or {}
noHealingRecord[player][bpIndex]["lastHealth"] = math.min((noHealingRecord[player][bpIndex]["lastHealth"] or BodyPart:getHealth()), BodyPart:getHealth())
BodyPart:SetHealth(noHealingRecord[player][bpIndex]["lastHealth"])
noHealingRecord[player][bpIndex]["lastScratchTime"] = math.max((noHealingRecord[player][bpIndex]["lastScratchTime"] or 0), BodyPart:getScratchTime())
BodyPart:setScratchTime(noHealingRecord[player][bpIndex]["lastScratchTime"])
noHealingRecord[player][bpIndex]["lastCutTime"] = math.max((noHealingRecord[player][bpIndex]["lastCutTime"] or 0), BodyPart:getCutTime())
BodyPart:setCutTime(noHealingRecord[player][bpIndex]["lastCutTime"])
As well, when we do add new items, we are going to try and go the extra mile in making that new item "special" and giving it expected functionality?
noHealingRecord[player][bpIndex]["lastBiteTime"] = math.max((noHealingRecord[player][bpIndex]["lastBiteTime"] or 0), BodyPart:getBiteTime())
BodyPart:setBiteTime(noHealingRecord[player][bpIndex]["lastBiteTime"])
noHealingRecord[player][bpIndex]["lastBleedingTime"] = math.max((noHealingRecord[player][bpIndex]["lastBleedingTime"] or 0), BodyPart:getBleedingTime())
BodyPart:setBleedingTime(noHealingRecord[player][bpIndex]["lastBleedingTime"])
noHealingRecord[player][bpIndex]["lastBurnTime"] = math.max((noHealingRecord[player][bpIndex]["lastBurnTime"] or 0), BodyPart:getBurnTime())
BodyPart:setBurnTime(noHealingRecord[player][bpIndex]["lastBurnTime"])
noHealingRecord[player][bpIndex]["lastFractureTime"] = math.max((noHealingRecord[player][bpIndex]["lastFractureTime"] or 0), BodyPart:getFractureTime())
BodyPart:setFractureTime(noHealingRecord[player][bpIndex]["lastFractureTime"])
noHealingRecord[player][bpIndex]["lastDeepWoundTime"] = math.max((noHealingRecord[player][bpIndex]["lastDeepWoundTime"] or 0), BodyPart:getDeepWoundTime())
BodyPart:setDeepWoundTime( noHealingRecord[player][bpIndex]["lastDeepWoundTime"])
end
end
Events.OnPlayerUpdate.Add(noHeal)
thanks Blair lol
Would anyone know the spawn command for the Agrotsar Plough-69 from the Agrotsar Farming Company mod? A friend of mine is trying to get the plough, but can't find it so I was just going to spawn it in for him. However, I can't seem to get the spawn command right
but basically it tracks a value over onplayerupdate - for injuries it grabs the highest value available and for health the lowest
Cant you find it in the Spawn Vehicle UI?
mhm
I think it's a pretty good challenge, was watching a streamer and the idea came out of spitballing
Almost forgot to reply - I think that makes more sense? I mean that seems like a very busy day
Yeah so far it feels about right to me overall
honestly had this idea months ago but I got yelled at by people in pzchat
module RecipeModBatteryJournals {
imports {
Base,
}
recipe Fabricate Small Battery
{
Aluminum/SmallSheetMetal,
ScrapMetal/ElectronicsScrap;4,
keep [Recipe.GetItemTypes.Screwdriver],
Result:Battery=4,
Time:60,
Category:Electrical,
AnimNode:Disassemble,
Prop1:Screwdriver,
Prop2:CDplayer,
OnCreate:batteryJournal_Recipe.OnCreate.SmallBattery,
OnGiveXP:batteryJournal_Recipe.OnGiveXP.MakeBattery,
}
recipe Fabricate Small Battery
{
SheetPaper2=15,
Twine/Thread/Glue;0.25/Woodglue;0.5/Paperclip;6,
Result:Journal,
Time:80,
Category:Literature,
AnimNode:RipSheets,
Sound:ClothesRipping,
OnCreate:batteryJournal_Recipe.OnCreate.PaperNotebook,
}
}
there we go
Another thing that we do need to provide is a working example for modders of adding a new funtional tag.
just the idea that losing calories felt off
Well yeah its a good challenge, i did think about not healing from eating food at some point and hope someone make it, it would actally make doctor more valuable as their bandage and all is more effective
One thing I did notice though, and I never tested this out vanilla so i can't compare, but my lipids/protein/carbs are pretty much always pinned at -500
setting health from food doesn't seem to do anything
I think the addition is coming after onplayer update
I will test with a full belly
what do you mean?
hmmm
i dont think your mod messes with them at all though so probably out of scope for it unless you want to get into that layer
Alrighty
Result:Battery=4, i dont think this will work you will maybe need to add the extra battery in the OnCreate function
now that I have my mods
hm.. I saw some other examples where items returned could have a value > 1
Well it's possible to add new tags to items, and new recipecode tag functions, so ideally an "educational file" that shows how to add tags to items + make new recipecode tag functions would be an worthwhile educational example?
ah then its alright
Does healing have to do with calories?
So you mean like adding a tag to items, and using it inside a GetItemType recipe function? or there is something else to use tag with
Off the top of my head, an example mod that adds the "TieHair" tag to elastic bands and also modifies the hairstyle code to require an item with the TieHair tag to tie a ponytail? And returns said used item when untying a ponytail.
I think he just means it's not widely used - most modders learn from others' codes to begin with
there's a few params in the recipescript class that isn't even used
EHE adds 'canOpenBoxes' to items
probably not what you'd imagine modders doing but
EHE_Recipe.typesThatCanOpenBoxes = EHE_Recipe.typesThatCanOpenBoxes or {}
---Sub-mod authors will have to use the following function to add more types
EHE_Recipe.convertNumericListToKeyedTable(
---List param
{"Base.IcePick","Base.HandScythe","Base.MeatCleaver","Base.LetterOpener","Base.Katana","Base.Scalpel","Base.GardenFork",}
---Table param
,EHE_Recipe.typesThatCanOpenBoxes)
EHE_Recipe.additionalTagChecks = EHE_Recipe.additionalTagChecks or {}
EHE_Recipe.convertNumericListToKeyedTable(
---List param
{"Screwdriver","DullKnife","SharpKnife","Write","ChopTree","CutPlant","Scissors","Fork","Spoon"}
---Table param
, EHE_Recipe.additionalTagChecks)
---Scans through every item, checks for types listed above as well as additional tag checks - avoids redundant tags
function EHE_Recipe.addCanOpenBoxesTagToTypesThatCan()
---Adds "CanOpenBoxes" tag to scripts for type
local allItems = ScriptManager.instance:getAllItems()
local debugText = "EHE: Added Tag 'CanOpenBoxes' to: "
for i=0, allItems:size()-1 do
---@type Item
local itemScript = allItems:get(i)
local itemFullName = itemScript:getFullName()
local tags = itemScript:getTags()
local addCanOpenBoxesTag = EHE_Recipe.typesThatCanOpenBoxes[itemFullName]
local tagString = ""
for i=0, tags:size()-1 do
---@type string
local tag = tags:get(i)
if EHE_Recipe.additionalTagChecks[tag] then
addCanOpenBoxesTag = true
end
tagString = tagString..tag..";"
end
if addCanOpenBoxesTag then
debugText = debugText..itemFullName..", "
itemScript:DoParam("Tags = "..tagString..";CanOpenBoxes");
end
end
print(debugText)
end
Events.OnGameBoot.Add(EHE_Recipe.addCanOpenBoxesTagToTypesThatCan)
adds the tag to all items with either a matching type or other tag of choice
the convertNumericListToKeyedTable is just a for loop that adds keys = true, cause I'm lazy
ah i see
Yeah, just keeping the example mod vanilla-adjacent makes it more broadly applicable?
Sure
Anyways, this is just lines of pixie dust?
Point being that Tags are a very powerful tool for modders and there's a lot more that we can do to educate modders in that regard? ๐
like dynamically adding tags
would catch items from other mods using those vanilla tags
If you need a dummy to test the ease of education, I ain't rock bottom for programming, but for PZ modding I am

Honestly, we (TTIS) can't manage handling mod tags?
But using the wiki modding section to list all the tags that mods use would be an excellent use of the wiki?
I wrote a function that prints all used tags in a game session - could post it there
For inter-mod compatibility.
Well making a list of ideas of possible application of tags then we can write example for each usage and add a more complete tutorial on the wiki page
using gettagtype would be the most ideal way to grab tools
I think any initiative that encourages modders to use tags in innovative ways would be an excellent idea?
Tags are very powerful tools.
You used tags for fuel API?
I will say, the more thorough the docs with examples the better
Sounds like a no brainer, but even now the docs for modding are extensive, yet still not as informative as you'd wanna see / too expansive for its own good
Clearly the main usage of tag is mostly to grab any or all objects with a specific tag. But yeah there is many possible application to this.
The issue with comprehensive documentation is that the game is nowheres near 1.0 and a lot of systems are in flux.
It frustrates me as well, but TBH, in general we can't do much until 1.0 is closer.
fair enough
Couldn't the javadoc be automated?
Yeah documentation needs to be collectively maintained, but soon with a community project that is about to pop, a complete intellisense and auto-complete will be available with everything details such as params etc.
for a while there was no 41 javadoc because it wasn't technically released
it wasnt updated for a long time until Co does it i think
when starting a local HOST server for my mod, think another mod ended up breaking
I think they did update it when 41 became public
