Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

Like this?

// Make Milk Volume = Production Rate × Time - Expression Rate × Time, capped by Max Capacity

const productionRate = stats.find(s => s.name === 'Production Rate')?.value || 0;

const expressionRate = stats.find(s => s.name === 'Expression Rate')?.value || 0;

const timeElapsed = stats.find(s => s.name === 'Time Elapsed')?.value || 0;

const maxCapacity = stats.find(s => s.name === 'Max Capacity')?.value || 500;

// Calculate current milk volume

let milkVolume = (productionRate - expressionRate) * timeElapsed;

// Clamp milkVolume between 1 and maxCapacity

milkVolume = Math.max(1, Math.min(milkVolume, maxCapacity));

return milkVolume;

Test Code                                                                                                                  Result: 1


i have no idea how the script worked,  i just ask to AI generate to this

(2 edits)

okay I realized the current stat system is too limiting, I’ll try to greatly improve it next update sorry! I see you’re trying to add to the milk stat, but right now you can only return the value.

To get this setup to work, you are almost there, but the milk value need to take into account the previous milkVolume. For example

// Calculate current milk volume
let milkVolume =  stats.find(s => s.name === 'Milk Volume')?.value || 0;
milkVolume += (productionRate - expressionRate);
(2 edits)

"Don't worry, making scripts is hard, even I can't write JavaScript. GPT is my hero.

Even with GPT I don’t know HOW its work, if it will work or not.

Four milk stats: Lactation, Breastmilk Volume (Milk Storage), Leakage, and Milk Accumulation, just for experimentation.

Maybe later, I’ll incorporate Milk Storage with Breast Size—bigger breasts have more storage—and also incorporate it with Lactation.