#mod_development

1 messages ยท Page 3 of 1

thin hornet
#

so what ever is a fruit tag can get added to the waffle for example

sour island
#

the tag system is underutilized for sure

thin hornet
#

pretty sure it has plans for the future tho

#

we can see recently its started to be used a bit more in vanilla

sour island
#

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

thin hornet
#

@sour island

sour island
#

that the TS stuff?

thin hornet
#

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

ornate locust
#

Where do i get the zdoc-lua.jar?

#

and zomboid.jar too

cosmic condor
#

did you skip reading the tutorial? lol

ornate locust
#

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?

cosmic condor
#

hmm lemme check the tutorial again

sour island
#

there's a step about moving the files out of generated

thin hornet
#

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

sour island
#

I wonder if that folder could be generated ready to go

#

could even pull the version number

#

make a new directory

cosmic condor
#

What is getting me confused is when I create a new project, it shows me this

sour island
#

odd

cosmic condor
#

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

thin hornet
#

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

cosmic condor
#

I can't even tell what are those ๐Ÿ™ƒ

thin hornet
#

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

cosmic condor
#

@sour island now I have a problem like this guy

sour island
#

sounds like that guy didn't read lmao

#

you can configure it if you hit yes

thin hornet
#

i only use shareX for gif making disable all screenshot stuff

sour island
#

I have mine not even make a local file

#

stays as a clipboard

#

exception is for gifs

#

which sometimes need editing

thin hornet
#

But shareX is amazing for the video and gif stuff

winter bolt
#

why do people even use stuff like that for normal screenshots instead of the builtin ones lol

thin hornet
#

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

sour island
#

I think sharex has that too tbh

#

but yeah it has got alot of bells and whistles

thin hornet
#

yeah the context menu when you right click the icon takes 3 pages lol

sour island
thin hornet
#

xD

cosmic condor
#

but this is way too many features lol

sour island
#

Oh my god it's got inscreen cropping....

thin hornet
#

what a fraud

sour island
thin hornet
#

cant trust nothing these days

sour island
thin hornet
#

lol

#

low budget fraud

cosmic condor
#

really low effort lol

sour island
#

Have you seen my posters?

thin hornet
#

much better than this

sour island
#

I made that fist and steering wheel using the smudge tool

thin hornet
#

its epic

cosmic condor
#

you're an artist

sour island
#

I also did all the scrap posters

cosmic condor
#

but your github pic turn me off

sour island
#

?

#

oh, how come?

cosmic condor
sour island
#

can't a man pick his nose with his firearm?

cosmic condor
#

๐Ÿ˜†

sour island
#

this was my old one

cosmic condor
sour island
#

for the sake of TOS it's a pipe

thin hornet
#

did you draw those?

cosmic condor
#

a pipe it is lol

sour island
thin hornet
#

xD

#

you look sane

cosmic condor
#

very unique art style

sour island
#

I could draw normal stuff but that's boring

thin hornet
#

the fallout one got me lul

sour island
#

can't find the scrap poster's originals

#

hmmm

thin hornet
#

we need a random fart, burp mod that you can do with some unused keybind, like in gta 2

sour island
#

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

cosmic condor
sour island
#

Reminds me of SS13's poop system that got quickly removed

thin hornet
#

i loved that feature in gta2, especially i was only like 8 yr old

sour island
#

frightening

cosmic condor
#

the definition of fun

sour island
#

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

winter bolt
sour island
#

involuntary vomiting was also a thing

sour island
winter bolt
#

i feel like i remember one server had the poop system enabled occasionally as a joke round

cosmic condor
#

we need STUFF

sour island
#

?

cosmic condor
#

REALISM

sour island
#

ah yes

#

so we can track players

thin hornet
#

well there is a defecation mod already

sour island
#

cause there's NO OTHER way we could achieve that

thin hornet
#

i think it also have random fart

sour island
#

we NEED toliet paper and poop

#

lmao

winter bolt
#

time to port the animal defecation from b42 to humans

thin hornet
#

plus poop can be used for fertilizer

sour island
#

scat fetishists are crusaders

thin hornet
#

just like ark

sour island
#

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

cosmic condor
#

The question is can we turn the conditional-speech into conditional-voice?

thin hornet
sour island
#

Oh yeah that'd be ok

thin hornet
#

no graphics

sour island
#

just no puddles...

#

yeah lmao

#

just call it hygiene

thin hornet
#

there you go

#

lol

sour island
#

toleitpaper can be used to wipe their faces for all I care

#

or armpits

open abyss
#

back

sour island
#

make players wash their hands before eating

open abyss
#

just got home to my own apartment

sour island
#

germs could be a fun mod

thin hornet
#

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

open abyss
#

konijima, the script you gave me does not work. It throws and error, heck it won't even open crafting menu

sour island
open abyss
#

(fetching error code)

sour island
#

and not like 5-6 different recipes

#

could work if you had the context menu be a slider

thin hornet
open abyss
#

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
sour island
#

Could be as simple as hovering over parts of the context menu to change what you're using

open abyss
sour island
#

although making that work would be a pain

opaque spire
#

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?

opaque spire
#

ok I'll check it out, thanks for the tip.

open abyss
#

wait, female calories are hardcoded vs males? um... Indie stoooonee~~ What were you thinking???

sour island
#

realism

thin hornet
#

The rates are hardcoded

#

but female is wayyyy to low (as in female dont lose weight)

sour island
#

oh?

thin hornet
#

lol

open abyss
#

maybe an oversight

sour island
#

and probably not that necessary of a feature I think lol

thin hornet
#

not sure what is going on in your error

opaque spire
#

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

sour island
#

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

opaque spire
#

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.

sour island
#

What do you mean about being active?

opaque spire
#

moving around, looting, carrying zombie corpses around

#

things that should be burning a good bit

sour island
#

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

opaque spire
#

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.

sour island
#
   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

opaque spire
#

I see, yeah

#

Interesting it specifies male in particular

sour island
#

seems like wearing extra clothes burns calories too?

#

aslo weight/80 is interesting

opaque spire
#

I think 80 is considered normal so it modifies what you burn if you are above or below normal

thin hornet
#

mhmm i think they fixed the female balance in .73

sour island
#

that's good

thin hornet
#

there is not as much of difference anymore

opaque spire
#

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.

thin hornet
#

orrr just use nutrition tweaker and make it go down faster ๐Ÿ˜›

sour island
#

you could tack on more burning in update

#

especially for climbing

#

that seems unfair

opaque spire
#

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

sour island
#

also is it me or the inventory weight not accounted for?

opaque spire
#

Just from testing, inventory weight doesn't appear to be

sour island
#

does moving normally?

#

like walking? sneaking?

opaque spire
#

only running/jogging it appeared

sour island
#

which is basically walking in squat

opaque spire
#

and timed action ofc

sour island
#

all PZ players going to have some nice buns from all that squating

opaque spire
#

what do you mean tack on more burning in update?

sour island
#

OnPlayerUpdate

#

depending on when stats are calculated

#

you could add onto the burning rate

thin hornet
#

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)

opaque spire
#

Thank you. I'll play around with your mod a bit it looks like it might do exactly what I want already.

thin hornet
#

if you test as admin in a host server, make sure to remove godmode as the values wont move otherwise

opaque spire
#

I was going to use it in a solo sandbox

thin hornet
#

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

opaque spire
#

right, ok

thin hornet
#

rewrite from an old Eris mod

opaque spire
#

oh nice

#

Oh you did water dispenser, I use that all the time lol

thin hornet
#

ya i wish this was vanilla cause i hate my graphics

sour island
#

I might write a passive calorie mod

#

if you wanna tweak it lol

opaque spire
#

It's an area of the game I think needs some love overall for sure

sour island
#

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

opaque spire
#

nice

#

I'm poking around in the code of the nutrition tweaker mod

sour island
#

are they tweaking onplayerupdate or the values for each food?

opaque spire
#

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

sour island
#

that is what I would be doing - but what values?

opaque spire
#

nutrition:getCalories()

sour island
#

hm

opaque spire
#

or nutrition:getProteins(), etc...

sour island
#

so it shifts the values on that end

#

oh konjima wrote it lol

opaque spire
#

yus

thin hornet
#

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

opaque spire
#

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

sour island
#

but this wouldn't take into account what the player is doing

thin hornet
#

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

sour island
#

I was going to rewrite the updateWeight() as lua lol

thin hornet
#

but even if you do there is no way to prevent the java update to happen originally

sour island
#

yeah

thin hornet
#

but there is no problem to do it tho

#

if you want to add up to the original decreasing logic

opaque spire
#

One part I'm not quite getting. Why are you multiplying the decrease by the amount of seconds since last update?

thin hornet
#

that is what make the nutrition values relative to game world time

sour island
#

gamespeed

opaque spire
#

aah I see

sour island
#

the game updates in ticks but the game doesn't tick faster if sped up

#

I think?

thin hornet
#

should not

sour island
#
      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

thin hornet
#

it might even lower the ticks if anything, to compensate with faster world computation

#

idk

sour island
#

technically could but there's visual elements that update

thin hornet
#

here some calories for you

sour island
#

lol

shadow geyser
opaque spire
#

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

thin hornet
#

neat

opaque spire
#

thanks!

#

and thanks chuck as well

sour island
#

first step to any good mod

#

making a poster

opaque spire
#

fancy

thin hornet
#

haha i like how chuck always start with the poster

sour island
#

it's to motivate me

#

can't let the poster not be seen

thin hornet
#

and then you look i my posters and they just white with black text (how original)

opaque spire
#

I like the write up, I'm looking forward to getting to try it out

wraith root
#

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

winter bolt
# sour island

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

sour island
#

it's a reference to caloriemate

#

isn't vrchat all mods?

winter bolt
#

pretty much but theyre adding anticheat to specifically stop people from using modded clients that add in new features

sour island
#

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

wraith root
#

EAC will do worse than the mods that prevent the current issues with VRC

winter bolt
#

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

wraith root
#

In VRC there is 0 encryption atm

thin hornet
#

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

wraith root
#

You can pull anyone's IP and crash any server instance

sour island
#

And those modders would be silly to provide an entirely working client with out the base game - free or not

winter bolt
#

and i think it also gives you more favourite slots?

wraith root
#

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

winter bolt
#

most modded clients gives you unlimited favourites

sour island
#

ah

sour island
#

that makes sense

#

being a freegame they don't have that bump of money right away

thin hornet
#

please no zuckerberg here

wraith root
#

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

winter bolt
#

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

wraith root
#

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

sour island
#

they about faced their FB requirement for quest accounts

#

they're floundering a bit with what the hell to do with the tech

wraith root
#

FB did?

sour island
#
  • 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

wraith root
#

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

sour island
#

Well there is more now

wraith root
#

Not to mention in the TOS you submit your rights to biometric data :)

sour island
#

probably why they're getting on their best behavior

wraith root
#

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

winter bolt
#

if zuck buys vrchat this year then the prophecy will be true

sour island
#

you know - there was a japanese vr MMO released recently

#

doesn't have a logout option

#

lmao

open abyss
#

wanted to share a fun bug a mod Konijima gave me:
The illusive Triple Heavy Duty Battery.

#

was to funny not to share ๐Ÿ˜„

wraith root
#

Damn lol

sour island
#

Does lua have a ? : format?

#

Always wondered about that

wraith root
#

Wouldn't be hard to check

sour island
#

tried to google it just now

#

what is it called? operators?

#

I only know it as shorthand / inline macros

wraith root
#

It's a conditional typr

sour island
#

"dont think it has one but you can also make one"

#

should be Lua's tagline

wraith root
jagged ingot
#

bar being the condition.

jagged ingot
# winter bolt

I recently rewatched the whole series, apart from the second season.

winter bolt
#

alicization was pretty good

jagged ingot
#

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.

sour island
# opaque spire I like the write up, I'm looking forward to getting to try it out

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
opaque spire
#

what is climbing besides a window, like up a sheet rope?

sour island
#

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

opaque spire
#

oh right, fences. Yeah I like this.

sour island
#

Im going off the vanilla calorie update either way

#

although an extra 8 calories burned won't kill anyone lol

opaque spire
#

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

sour island
#

yeah

#

added a normal sleeping check

#

realized that would have an impact

opaque spire
#

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

sour island
#

weight gain only looks at calories iirc

opaque spire
#

I believe that's right, I just don't really understand what impact the others have if any, in vanilla, if anything.

sour island
#

If I had to assume endurance/fitness stuff

#

could check it out when I tackle update weight

opaque spire
#

It might be worth looking, to scale relative to your baseRate?

#

Since you have to eat that much more food

sour island
#

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

open abyss
#
    {
        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?
sour island
#

I wonder why running would be set to false if endurance is over 3? is that when you can't run?

open abyss
#

as far as i can see, i don't need the squre brackets... alright, good to know

sour island
#

I don't think you're supposed to use the [] like that

#

I think you should remove the []'s ?

open abyss
#

i did ^_^

sour island
#

ah ok

#

the brackets grab the function with the same name [functionName]

open abyss
#

aye

sour island
#

I think it expects a table as a result

open abyss
#

yeah, possibly

#

i only need the recipe to target those items specifically

sour island
#

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

open abyss
#

.
This is text
This is text
This is text
546869732069732074657874
and
VGhpcyBpcyB0ZXh0

Why?
No clue... Just felt like it ๐Ÿ˜›

opaque spire
#

yeah later endurance moodles stop you from being able to sprint, then run, until eventually you can only walk

open abyss
#

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"

sour island
#

I wonder if I don't have to do weight loss if I can just adjust the calories

opaque spire
#

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

sour island
#

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?

opaque spire
#

i would say just over capacity, maybe a bit more at each capacity tier

sour island
#

I could look into how the weight moodle decides thing

#

could do * moodlelevel

opaque spire
#

yeah

#

I think that would be good

sour island
#

almost instantly lol

#

hmmmm

#

I have a feeling onplayerupdate is running more times than nutrition update

opaque spire
#

do you see where the real time calorie readout is?

sour island
opaque spire
#

yup that

sour island
#

is that normal?

opaque spire
#

i dont usually see it bump up and down quite like that

sour island
#

does it drop at that speed?

opaque spire
#

wow i think i need coffee or something, it's looped obviously lol

#

yes that looks about normal

#

a bit faster than normal

sour island
#

shouldn't be anymore than normal

#

although I can write up a debug print for changes

opaque spire
#

i usually compare by passing like 2 hours or something, and find the difference in that amount of time

#

on fast speed

sour island
#

may need a cap on overload

#

carring 40/10 makes you burn so many calroies

opaque spire
#

did you end up doing it on the weight or the moodle level?

wraith root
#

hm

#

I need to make some recipes

#

How do

#

o3o

#

time to dig

sour island
#

and maybe use the same logic

#

not easy to find

opaque spire
#

can you just grab the moodle level once its already applied?

sour island
#

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

opaque spire
#

ah, cool

sour island
#

I can cap it at 2.8

#

so carrying 400% won't give you super calorie loss

jagged ingot
#

Very active day here.

cosmic condor
#

I'm busy making sound packs for Random Sound Events. Lots of possibilities.

jagged ingot
#

Going to probably pull an all-nighter.

thin hornet
jagged ingot
wraith root
#

how would one make a recipe mod ๐Ÿค”

#

having some trouble finding a good example

open abyss
#

Hwo do i change the name of the keyring?

#

and, is it just me, or is tooltips VERY finicy getting to work???

agile coral
#

Item tooltips are a pain

willow estuary
# open abyss Hwo do i change the name of the keyring?

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.
open abyss
#

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

sour island
wraith root
#

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?

sour island
#

yes

wraith root
#

shweet

sour island
#

like c:/users/you/zomboid

#

why?

wraith root
#

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

sour island
#

you could look at the RecipeScript file/class

#

shows you alot of features that aren't widely used

wraith root
#

as for lua coding on the recipes, is that client or server facing?

sour island
sour island
#

java prases them

wraith root
#

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

sour island
#

you can add lua functions on certain params tho

#

oh uh

wraith root
#

If its client facing and I use java, I have to have everyone then download the file

sour island
#

I am not sure

wraith root
#

server facing and they don't need to worry

open abyss
#

@wraith root look in this file for examples of recipes steamapps\common\ProjectZomboid\media\scripts\recipes.txt

sour island
#

I would assume server facing

wraith root
#

Im trying to find a good extension for VScode to emulate IntelliJ

#

I could just use both, but I like VScode lol

sour island
#

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

wraith root
#

that's good, I might make a java file then for the custom recipe

sour island
#

most of the flexibility of recipes is lua sided + the tags param

wraith root
#

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

sour island
#

depends on what you want out of it

wraith root
#

Over time I will add more simple recipes

open abyss
#

what the hell?

wraith root
#

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

thin hornet
open abyss
#

i tried to upload my mod...

#

that didn't go well..

opaque spire
open abyss
#

i don't know what it means

sour island
#

I capped the inventory impact to 2.8

#

That's about it lol

opaque spire
#

cool, I'll play around with it sometime soon

open abyss
#

I'm soooo confused as to why this mod talks about creative... ... wtf

sour island
#

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

opaque spire
#

just the moving part alone will probably make a big difference overall

thin hornet
#

but honestly i never saw that error

sour island
#

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?

cosmic condor
open abyss
#

nope

#

i don't use git

sour island
#

Workshop/Name/Contents/mods/Name/media?

wraith root
#

hrmm

#

making a recipe mod might be a little trickier in java lol

sour island
#

Yep

wraith root
#

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 ded

sour island
#

The entirety of recipes is script based the Java just parses the text and holds methods

cosmic condor
#

UI_WorkshopError_FolderNotAllowedInContents = "There are unrecognized folders in your Contents/ folder.\nThe following folders are the only ones permitted in Contents/:\n%1",

wraith root
sour island
#

He probably doesn't have the right structure

wraith root
#

going for that small footprint in my environment approach lmao

thin hornet
#

well it turns out

#

Contents/mods/

#

if you write Mods directory not in lowercase it wont work

sour island
#

Ye

#

Simple mistake

wraith root
#

sadge

ember crane
#

is the lying mod save compatible?

#

and what about the expanded helicopter?

wraith root
#

save?

#

godDAMN look at that long recipe file

#

lmfao

ember crane
opaque spire
#

@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.

wraith root
#

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...

thin hornet
#

its already global

#

you can use any of those vanilla functions if needed

wraith root
#

oh NO not unannounced globals

thin hornet
#

it has to

wraith root
thin hornet
#

for this at the very least

wraith root
thin hornet
#

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

wraith root
#

As for enforcing downloads of the mod by clients, is that necessary as it is server facing?

thin hornet
#

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

wraith root
#

as for these safeguards? What are they up to

wraith root
thin hornet
#

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

wraith root
#

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

sour island
#

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

wraith root
#

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

thin hornet
#

Okay wait

wraith root
#

lot of unrelated things going on

thin hornet
#

lets take it simple

#

lol

wraith root
#

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)

thin hornet
#

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,
}
open abyss
#

@thin hornet will you be here tomorrow too?

thin hornet
open abyss
#

oh

wraith root
#

interdimensional being

thin hornet
#

Google could reupload me back for software updates

#

just hit me up tomorrow and if im here ill reply

open abyss
#

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

wraith root
#

hm

open abyss
#

it's sooo close to being done

wraith root
thin hornet
#
YouModID/
-mod.info
-poster.png
-media/
--lua/
---client/
----YouModID/
---server/
----YouModID/
---shared/
----YouModID/
wraith root
#

is a .info just the readME?

thin hornet
#

i suggest adding an additional directory inside client/server/shared with the mod ID again

wraith root
#

is there a Mod ID generator, or does the workshop assign it

thin hornet
#

Mod id should be your mod name with no space preferably

#

for example

ModID: MySuperMod
ModName : My Super Mod
wraith root
#

ahh I meant the workshop ID, I think steam makes that then

thin hornet
#

it will be generated when first uploaded

#

file will auto-update

thin hornet
# thin hornet ``` YouModID/ -mod.info -poster.png -media/ --lua/ ---client/ ----YouModID/ ---s...

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
wraith root
#

That is embedded as well?

#

The first three directories are not made by myself no?

open abyss
#

@thin hornet i know you juggle a lot, but any chance we could try fix to final bug before i head to bed?

thin hornet
#

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)

thin hornet
#

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

open abyss
wraith root
#

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

thin hornet
#

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').

wraith root
#

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

thin hornet
#

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

wraith root
#

makes sense

thin hornet
#

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.

wraith root
#

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

thin hornet
#

yeah for now as you develop it you can use the C:\Users\Konijima\Zomboid\mods\mymod\ directory

wraith root
#

Ah I just made a standalone directory

#

I can move it over

thin hornet
#

well where is your RecipeModBatteryJournals main directory

wraith root
#

in an unrelated directory atm

thin hornet
#

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

wraith root
#

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*

thin hornet
#

haha

wraith root
#

making two recipes for the mod, one to fabricate batts and another to make journals

thin hornet
#

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

wraith root
#

is it going to be angry if formats are not matched ?

thin hornet
#

so for your own mod you will replicate the directory strucutre

wraith root
#

more so in whitespace

thin hornet
#

whitespace is trimed and all

#

you can also use /* comment */

wraith root
#

nice

#

as for directory structure, I thought this current structure worked alright?

thin hornet
#

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

wraith root
open abyss
#

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!

thin hornet
#

if you wanted to add sound you would create the a sound directory exactly how the base game media directory does

open abyss
#

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!

wraith root
#

fair enough

wraith root
open abyss
#

quick question, can recipes and item definitions co-exists in the same file?

thin hornet
open abyss
#

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

wraith root
#

looks like I need to extend the Base

#

unless the module would be my mod here as its not "vanilla" as a recipe

thin hornet
#
module MyModId {
  imports {
     Base,
  }

  // yours stuff  

}
open abyss
#

Okay, now i just need to upload and then passout ๐Ÿ˜›

wraith root
#

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

thin hornet
#

well the upper part lets call it ingredients

#
recipe Craft some cool stuff {
  ingredient1,
  keep ingredient2,
  
}
wraith root
#
    recipe Fabricate Small Battery
    {
        Aluminum,
        ScrapMetal,
        ElectronicsScrap

        Result:SmashedBottle,
        Time:20,
        Sound:BreakGlassItem,
    }
thin hornet
#

there is multiple way of adding optional ingredients such as when a recipe could use different type of hammer

wraith root
#

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

thin hornet
#

Aluminum + ScrapMetal + ElectroScrap

Aluminum,
ScrapMetal,
ElectronicsScrap,

OR
SmallSheetMetal=2 + ElectroScrap

SmallSheetMetal=2,
ElectronicsScrap,
#

oh you mean your recipe have different possible combination?

wraith root
#

mhm

thin hornet
#

if thats the case, then you will probably need 2 recipe

wraith root
#

sadge

#

but makes sense

thin hornet
#

so the \ means that it can be this item or an other

#

but only for that ingredient "slot"

wraith root
#

hm

#

I could just make it more dynamic and add options for the current stuff

#

there

thin hornet
#
    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)

thin hornet
# wraith root

ya in that case you need aluminium or smallsheet AND scraptmetal or electronic scrap

wraith root
#

perfecto

#

thats the aim there since the two exclusive recipes might be too uh... deceptive

thin hornet
#

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

wraith root
#

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)

thin hornet
#

no the Category is for the Tab in which the recipe will be in the crafting menu

wraith root
#

ahh

#

nifty

thin hornet
#

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

wraith root
#

my brain overheating

thin hornet
#

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

wraith root
#
    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

thin hornet
#

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

wraith root
#

not a bad idea

#

I scan these posts like a hawk when I look through here

thin hornet
#

things changes alot theses days so this is why there is not really a tutorial since its prone to change

wraith root
#

these definitions are not required for modding right?

thin hornet
#

nah your to low in the file got up a bit

wraith root
#

as in, for my mod, I won't need to define a new custom definition

thin hornet
#

ignore everything under -- These functions are defined to avoid breaking mods.

wraith root
#

Will I ever need to do that?

#

:p

thin hornet
#

not in your own files no

wraith root
#

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

thin hornet
#

yeah here you go, that function will be called when cooking a cake batter

wraith root
#

whats going on with these testing functions? for debugging?

ionic sun
#

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.

thin hornet
#

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

open abyss
#

Done,. and goodnight everyone - Konijima, Thank you soooo much!

thin hornet
#

night man

wraith root
thin hornet
#

only if anything special to test for

wraith root
#

Im a bit confused on how it checks when it already checks in the main function

thin hornet
#

as in is the food cooked?

wraith root
#

does it check for tools as well?

#

Like if I need a crowbar or something to make certain items

thin hornet
#

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

wraith root
#

more so if I need a crowbar in my inventory to make say a car battery break down into lithium bars

thin hornet
#

then you would just add keep Crowbar, as one of the ingrediant

wraith root
#

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

thin hornet
#
    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 
    }
wraith root
#

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

thin hornet
#

sure

#

so before you ask take a look at Recipe.GetItemTypes.Screwdriver in recipecodes

wraith root
#

lmao

#

before I ask, you know me too well

thin hornet
#

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
wraith root
#

what's this fellow up to

thin hornet
#

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

wraith root
#

As in tools that do the same job

thin hornet
#

Exactly

wraith root
#

I see a list element

#

nice

thin hornet
#

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

thin hornet
wraith root
#

damn

#

I get the sniffles then croak

#

fuuuuck

#

impossible mod

wraith root
#

I am starting to see some of the strings that tie things in

thin hornet
wraith root
#

I have it yeah

thin hornet
#

then have a look at zombie\scripting\objects\Recipe.java

#

you ll find out everything to know about recipe txt script

wraith root
#

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

thin hornet
#

yeah thats why we stick to lua at least for the clients

wraith root
#

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

thin hornet
#

if you feel like you need something in your own server then knock yourself out and do it ๐Ÿ˜„

wraith root
#

yesssir

#

also, is Lua's time milliseconds or full seconds

sour island
#

so you can bandage and stich but that should be about it

#

does food heal over time?

wraith root
sour island
#

hmm

thin hornet
#

eating is how HP goes back up

wraith root
#

yep

#

more injuries more hungry you get

thin hornet
#

a full belly is a healthy person based on PZ logic ๐Ÿ˜„ so im super healthy

wraith root
#

goddamn I must be pristine then

#

Im always full cherrypie

sour island
#

hm

#

I just assumed it helped injury timers speed up

wraith root
#

did we say if the timers in PZ are milli or second based? I presume seconds

thin hornet
#

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

wraith root
#

ahhh

#

its tic time

#

fuk

#

minecraft moment

thin hornet
#

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

wraith root
#

I can scan the times on items Ive made before and get a good feeling for it there

thin hornet
#

recipe time is the same kind of time value as the TimedActions

#

once this mistery is resorve we will be good

sour island
#

getHealthFromFoodTimer

#

damn

opaque spire
#

@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.

willow estuary
opaque spire
#

konijima's weight scale mod was fantastic for keeping track of this without having to be in debug mode btw

wraith root
#

poggers

thin hornet
sour island
#

no, type searches have been around

#

tags were just very under used

willow estuary
thin hornet
#

oh but was is not used massivly in the scripts txt since recently?

willow estuary
#

The broken glass and gasmask recipecode stuff is for mods and not vanilla.

wraith root
#

๐Ÿค”

thin hornet
#

its just me i dont make recipe often so i didnt see it since recently

sour island
#

and a few other things

willow estuary
#

There's several functions in recipecode.lua that aren't used in vanilla, but are intended for mod functionality and example purposes.

sour island
#

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

wraith root
#

all over my head

thin hornet
#

i see i see ๐Ÿ‘€ ๐Ÿ‘€

willow estuary
#

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?

wraith root
#

1.0 of what?

willow estuary
#

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 ๐Ÿ˜›

thin hornet
#

Hey how about my patreon lol ๐Ÿ˜›

#

I need fooood me hungryyy

#

lol

wraith root
#

I thought you said you were full!

thin hornet
#

shhhuuutt

willow estuary
thin hornet
#

hahaha

wraith root
thin hornet
#

Nah im not abusing drunks

wraith root
#

d a m

thin hornet
#

Id rather you do it with a clear head

#

it will be more deserved

willow estuary
#

But yeah, there's a couple of non-vanilla-functional "modder stubs" in recipecode.lua.

thin hornet
#

i used to have patrons when i had my server, but ive stopped the machine so next time!

wraith root
#

sadge

thin hornet
#

No work no pay

willow estuary
#

gasmask/brokenglass

thin hornet
#

gasmask as in easily making a headgear act as a gas mask?

willow estuary
#

Nah; just having one in your inventory. It was just an accomodation for Hydrocraft etc.

thin hornet
#

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

willow estuary
#

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.

wraith root
thin hornet
#

Dont drink n Leak

#

its always a bad awaking in the morning

wraith root
#

pog

#

I got front row

#

๐Ÿ‘จโ€๐Ÿฆฏ if someone asks

willow estuary
#

๐Ÿ™Š

thin hornet
#

๐Ÿ˜„

#

It just remind me i have to update Random Sound Event sooon

willow estuary
#

But yeah, this is an instance, where, if it works, we'll try and provide advance notice?

thin hornet
#

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

wraith root
#

that kewl

#

be even cooler if you made radiation zones

willow estuary
#

But also, in general, we are working to provide more "implied functionality" for both clothing items and items in general?

wraith root
#

like that one mod

#

but thats too deeeeep

sour island
#

Ended up just getting and setting a stored health value

sour island
#

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"])
willow estuary
sour island
#
        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

abstract spruce
#

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

sour island
thin hornet
abstract spruce
#

Not sure which one I need

sour island
#

I think it's a pretty good challenge, was watching a streamer and the idea came out of spitballing

sour island
opaque spire
#

Yeah so far it feels about right to me overall

sour island
#

honestly had this idea months ago but I got yelled at by people in pzchat

wraith root
#
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

willow estuary
#

Another thing that we do need to provide is a working example for modders of adding a new funtional tag.

sour island
#

just the idea that losing calories felt off

thin hornet
opaque spire
#

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

sour island
#

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

opaque spire
#

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

wraith root
#

Alrighty

thin hornet
wraith root
#

now that I have my mods

#

hm.. I saw some other examples where items returned could have a value > 1

willow estuary
# thin hornet what do you mean?

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?

thin hornet
#

ah then its alright

wraith root
#

Now to do... install

#

how do :3

sour island
#

ah eating does heal just a bit even with the healing pinned

#

weird

wraith root
#

Does healing have to do with calories?

thin hornet
willow estuary
sour island
#

I think he just means it's not widely used - most modders learn from others' codes to begin with

wraith root
#

uh oh

sour island
#

there's a few params in the recipescript class that isn't even used

sour island
#

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

thin hornet
#

ah i see

willow estuary
#

Yeah, just keeping the example mod vanilla-adjacent makes it more broadly applicable?

sour island
#

Sure

willow estuary
#

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? ๐Ÿ™‚

sour island
#

like dynamically adding tags

#

would catch items from other mods using those vanilla tags

wraith root
#

If you need a dummy to test the ease of education, I ain't rock bottom for programming, but for PZ modding I am

willow estuary
#

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?

sour island
#

I wrote a function that prints all used tags in a game session - could post it there

willow estuary
#

For inter-mod compatibility.

thin hornet
#

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

sour island
#

using gettagtype would be the most ideal way to grab tools

willow estuary
#

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?

wraith root
#

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

thin hornet
#

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.

willow estuary
wraith root
#

fair enough

sour island
#

Couldn't the javadoc be automated?

thin hornet
sour island
#

for a while there was no 41 javadoc because it wasn't technically released

wraith root
#

hm

thin hornet
wraith root
#

when starting a local HOST server for my mod, think another mod ended up breaking

sour island
#

I think they did update it when 41 became public