Hello friends! So Pharmacology is an s-param that can only be adjusted through states, weapons, and armor, it seems. Please correct me if I'm wrong because I'm going crazy trying to figure this out, lol.
I want items to increase my player's pharmacology stat - it's renamed to Alchemistry, but I'll call it pha in this post. They are "recipes" that have no other function than as a collectible with the benefit of adding to pharmacology by 1% for each. The goal is to collect them all. Super fun.
So I've been trying to figure out how to get this to work. I figure for every chest that contains a recipe item, I adjust the pharmacology in that event. Can't do it through the engine as that only changes the regular params.
My attempts:
I wrote a lot so I put them in spoilers!
VisuStella States
VisuStella Core
Hakuen Dynamic Parameters: https://hakuenstudio.itch.io/eli-dynamic-parameters-for-rpg-maker
Nat Dynamic Traits: https://sleepy-kitten-games.itch.io/dynamic-traits-rmmz
If anyone has any ideas on how I can just add 1% to PHA over the course of the game, I will give you ALL the virtual hugs.
Thank you!!
I want items to increase my player's pharmacology stat - it's renamed to Alchemistry, but I'll call it pha in this post. They are "recipes" that have no other function than as a collectible with the benefit of adding to pharmacology by 1% for each. The goal is to collect them all. Super fun.
So I've been trying to figure out how to get this to work. I figure for every chest that contains a recipe item, I adjust the pharmacology in that event. Can't do it through the engine as that only changes the regular params.
My attempts:
I wrote a lot so I put them in spoilers!
VisuStella States
I tried making a State that gives Pharmacology 101% and then made that a "Passive" state with the "<Passive Stackable>" notetag. My thought was that every time the state was applied, it would stack. But that didn't do anything and I assume it's because "passive" states can't be "added."
I tried making it not a passive state and just adding, but the stat wouldn't go above 101%.
I tried making it not a passive state and just adding, but the stat wouldn't go above 101%.
VisuStella Core
I then went into the parameter settings and tried this code:
Then I did this code to add to the variable in an event:
Console log says this works well:
But it doesn't actually update my PHA value in the game.
It's weird. Starting the game and opening up the stats, PHA is 0%, which tells me it might be working because initially the variable is 0. When I spam this event to add to it, it stays at 0%.
When I start the game and don't open the stats, and then spam this event, the PHA becomes 100%. But it also stays at 100%.
So I don't know if there's an issue in updating...? Or what...
JavaScript:
// Determine the variables used in this calculation.
let sparamId = arguments[0];
let base = this.traitsPi(Game_BattlerBase.TRAIT_SPARAM, sparamId);
let plus = this.sparamPlus(sparamId);
let paramRate = this.sparamRate(sparamId);
let flatBonus = this.sparamFlatBonus(sparamId);
if (sparamId === 3) {
// If sparamId is 3 (PHA), apply the variable's value to paramRate
value = (base + plus) * $gameVariables.value(25) + flatBonus;
} else {
// For other s-params, use the default calculation
value = (base + plus) * paramRate + flatBonus;
}
// Final value
return value;
Then I did this code to add to the variable in an event:
JavaScript:
const currentBonus = $gameVariables.value(26) + 1; // Increment the cumulative bonus by 1%
$gameVariables.setValue(26, currentBonus); // Save the new cumulative bonus
const newPharmacology = 1.0 + (currentBonus * 0.01); // Base Pharmacology (100%) plus the cumulative bonus as a decimal
$gameVariables.setValue(25, newPharmacology); // Store the new Pharmacology value in Variable ID 25 as a decimal
console.log(`New Pharmacology Value: ${newPharmacology * 100}% stored as ${newPharmacology} in Variable 25`);
But it doesn't actually update my PHA value in the game.
It's weird. Starting the game and opening up the stats, PHA is 0%, which tells me it might be working because initially the variable is 0. When I spam this event to add to it, it stays at 0%.
When I start the game and don't open the stats, and then spam this event, the PHA becomes 100%. But it also stays at 100%.
So I don't know if there's an issue in updating...? Or what...
Hakuen Dynamic Parameters: https://hakuenstudio.itch.io/eli-dynamic-parameters-for-rpg-maker
Trying a different plugin now, returning VS sparam code to default.
I put the notetag <DynParams: Alchemistry> in a State, and then added the State as a Passive (VS). Pharmacology starts at 100% and then goes to 200% when I spam the event (same code as above to adjust the variable), but it stays at 200%.
So then I tried this code to set the variable:
and then the parameter becomes "10,200%" - SO CLOSE!
But removing the * 100 makes it stick to 200%
Not sure what else to do here. My math is probably wrong.
I put the notetag <DynParams: Alchemistry> in a State, and then added the State as a Passive (VS). Pharmacology starts at 100% and then goes to 200% when I spam the event (same code as above to adjust the variable), but it stays at 200%.
So then I tried this code to set the variable:
JavaScript:
const currentBonus = $gameVariables.value(26) + 1; // Increment the cumulative bonus
$gameVariables.setValue(26, currentBonus); // Save the updated bonus
const newPharmacology = 1 + (currentBonus * 0.01); // Calculate the new Pharmacology value
$gameVariables.setValue(25, newPharmacology * 100); // Store as a percentage in Variable 25
console.log(`New Pharmacology Value: ${newPharmacology * 100}% stored in Variable 25`);
and then the parameter becomes "10,200%" - SO CLOSE!
But removing the * 100 makes it stick to 200%
Not sure what else to do here. My math is probably wrong.
Nat Dynamic Traits: https://sleepy-kitten-games.itch.io/dynamic-traits-rmmz
This one doesn't support variables, but that's okay cause the plugin command makes it easy enough.
Adding .01 or even .5 doesn't change it. Adding 1 changes it to 200% and then no further.
There was some attempt I was able to get it to 103% and then it got stuck at 103% but I can't replicate that so I'm not sure what I did there...
Adding .01 or even .5 doesn't change it. Adding 1 changes it to 200% and then no further.
There was some attempt I was able to get it to 103% and then it got stuck at 103% but I can't replicate that so I'm not sure what I did there...
If anyone has any ideas on how I can just add 1% to PHA over the course of the game, I will give you ALL the virtual hugs.
Thank you!!
I promise.
