- Joined
- Jun 21, 2020
- Messages
- 27
- Reaction score
- 4
- First Language
- English
- Primarily Uses
- RMMV
Hello all.
I'm looking to use Yanfly's Level Up Growth Effects plugin to give players stats based on a specific formula that involves a certain degree of randomization, using variables that, at specific thresholds, will give the player different amounts of a stat on level up. Basically, it's going to look something like this (not actual JS code):
On level-up:
1. MHPlevelupvariable +rand.(5-40)
2. rand. (1-100) + MHPlevelupvariable
3. if (result = 0-99), MHP +0, MHPlevelupvariable stays at value given at step 1
4. else if (result = 100-199), MHP+1, reset MHPlevelupvariable to 0
5. else if (result = 200+), MHP+2, reset MHPlevelupvariable to 0
It seems fairly straight forward enough to enable this custom code using Yanfly's plugin (the obvious issues being that I need to actually learn the proper JS tags and how to set these specific variables for each actor), however it isn't clear in the plugin's help settings whether this will completely overwrite the game's parameter gain on level up, or if it adds to the gain. I want to completely ignore the engine's built-in stat gain on levels and use only this formula.
Can anyone with experience with this plugin give me advice on how best to work this out? It's very frustrating that you can't disable the exp/stat curves in this engine, or at least make it so that the amounts provided are static/randomized to a certain degree. I have the idea and a basic understanding of how to make part of it work, but it won't work at all if it's being interfered with by the game's built-in system.
Edit 1: Can confirm, this plugin works WITH the engine's default curve. I need to figure out a way to disable this entirely, or possibly alter my formula so that it takes into account the stats gained by the engine's built-in system and removes it.
Edit 2: Figured out how to disable the parameters entirely; if you set both the lvl 1 and level 99 parameters to 1, the game will not add any stat per level. So that issue is fixed.
However, as I know very little about javascript, I'm having issues getting the following code to work, added in via notetags as explained in Yanfly's Level Up Growth Effects:
I'm still trying to figure out how to set a permanent variable for the example I provided above (MHPlevelupvariable), but at the moment if I can just figure out how to give a random stat per level without it for now as a proof of concept it'd still be progress. I know the logic of the idea is sound, I'm just not at all certain how to actually successfully do so. Really need some help on this one.
Edit 3: So I've managed to strip it down for testing purposes. This works:
The issue lie in the fact that I need it to be different based on the random number that is generated at the start of the code. Still researching to see if I can't figure it out on my own.
Edit 4: Final update for tonight, I don't think there's much more I can do on this for now. I've managed to get the code working in a way that it rolls a random number, then based on what that number is gives either 0, 1 or 2 stats (noticed that for some reason, spoiler kills indentation; please note that everything is properly indented on my end):
The only step that is left is to figure out how to set a hidden variable for this stat (MHP in this case), that is tied to one actor, as I need to be able to have the number be different for every single levelable stat for each character, and then add that into the above code to be called, compared and reset within the code. If anyone can give assistance on this it would be greatly appreciated.
I'm looking to use Yanfly's Level Up Growth Effects plugin to give players stats based on a specific formula that involves a certain degree of randomization, using variables that, at specific thresholds, will give the player different amounts of a stat on level up. Basically, it's going to look something like this (not actual JS code):
On level-up:
1. MHPlevelupvariable +rand.(5-40)
2. rand. (1-100) + MHPlevelupvariable
3. if (result = 0-99), MHP +0, MHPlevelupvariable stays at value given at step 1
4. else if (result = 100-199), MHP+1, reset MHPlevelupvariable to 0
5. else if (result = 200+), MHP+2, reset MHPlevelupvariable to 0
It seems fairly straight forward enough to enable this custom code using Yanfly's plugin (the obvious issues being that I need to actually learn the proper JS tags and how to set these specific variables for each actor), however it isn't clear in the plugin's help settings whether this will completely overwrite the game's parameter gain on level up, or if it adds to the gain. I want to completely ignore the engine's built-in stat gain on levels and use only this formula.
Can anyone with experience with this plugin give me advice on how best to work this out? It's very frustrating that you can't disable the exp/stat curves in this engine, or at least make it so that the amounts provided are static/randomized to a certain degree. I have the idea and a basic understanding of how to make part of it work, but it won't work at all if it's being interfered with by the game's built-in system.
Edit 1: Can confirm, this plugin works WITH the engine's default curve. I need to figure out a way to disable this entirely, or possibly alter my formula so that it takes into account the stats gained by the engine's built-in system and removes it.
Edit 2: Figured out how to disable the parameters entirely; if you set both the lvl 1 and level 99 parameters to 1, the game will not add any stat per level. So that issue is fixed.
However, as I know very little about javascript, I'm having issues getting the following code to work, added in via notetags as explained in Yanfly's Level Up Growth Effects:
<Custom Level Up Effect>
var randomnumber = console.log(Math.round(Math.random() * 100))
if (randomnumber >= 29) {
$gameActors.actor(1).addParam(0, 0);
} else {
if ((randomnumber < 30) && (randomnumber >= 59)) {
$gameActors.actor(1).addParam(0, 1);
} else {
$gameActors.actor(1).addParam(0, 2);
}
</Custom Level Up Effect>
var randomnumber = console.log(Math.round(Math.random() * 100))
if (randomnumber >= 29) {
$gameActors.actor(1).addParam(0, 0);
} else {
if ((randomnumber < 30) && (randomnumber >= 59)) {
$gameActors.actor(1).addParam(0, 1);
} else {
$gameActors.actor(1).addParam(0, 2);
}
</Custom Level Up Effect>
I'm still trying to figure out how to set a permanent variable for the example I provided above (MHPlevelupvariable), but at the moment if I can just figure out how to give a random stat per level without it for now as a proof of concept it'd still be progress. I know the logic of the idea is sound, I'm just not at all certain how to actually successfully do so. Really need some help on this one.
Edit 3: So I've managed to strip it down for testing purposes. This works:
<Custom Level Up Effect>
$gameActors.actor(1).addParam(0, 1);
</Custom Level Up Effect>
$gameActors.actor(1).addParam(0, 1);
</Custom Level Up Effect>
The issue lie in the fact that I need it to be different based on the random number that is generated at the start of the code. Still researching to see if I can't figure it out on my own.
Edit 4: Final update for tonight, I don't think there's much more I can do on this for now. I've managed to get the code working in a way that it rolls a random number, then based on what that number is gives either 0, 1 or 2 stats (noticed that for some reason, spoiler kills indentation; please note that everything is properly indented on my end):
//HP//
<Custom Level Up Effect>
var rnum = Math.floor(Math.random() * 100);
if (rnum <= 29) {
$gameActors.actor(1).addParam(0, 0);
} else {
if (rnum >= 30 && rnum <= 69) {
$gameActors.actor(1).addParam(0, 1);
} else {
$gameActors.actor(1).addParam(0, 2);
}
}
</Custom Level Up Effect>
<Custom Level Up Effect>
var rnum = Math.floor(Math.random() * 100);
if (rnum <= 29) {
$gameActors.actor(1).addParam(0, 0);
} else {
if (rnum >= 30 && rnum <= 69) {
$gameActors.actor(1).addParam(0, 1);
} else {
$gameActors.actor(1).addParam(0, 2);
}
}
</Custom Level Up Effect>
The only step that is left is to figure out how to set a hidden variable for this stat (MHP in this case), that is tied to one actor, as I need to be able to have the number be different for every single levelable stat for each character, and then add that into the above code to be called, compared and reset within the code. If anyone can give assistance on this it would be greatly appreciated.
Last edited: