Parallax Panda

Veteran
Veteran
Joined
Oct 29, 2015
Messages
1,113
Reaction score
1,343
First Language
Swedish
Primarily Uses
RMMV
Yanfly made this video long ago for how you could use his Job Points (JP) plugin to make passive skills that allows you to upgrade your basic parameters such as HP, MP, ATK, DEF, etc.


This here being the code snippet he provides in the video:
Code:
<Learn Cost: 500 JP>

user._paramPlus[0] +=500;
user.forgetSkill(21);
user.refresh();
</Learn Cost Eval>

I have two questions in regards to this.

First one being in regards to the compatibility between a system like this and the general increase of parameters upon level up. Because in the database you don't specify the gain of each parameter at certain level (right?), but rather what they should be. So it's more of a "set this parameter to value X", and not "add X to this parameter upon reaching this level".
Unless I'm incorrect I assume there isn't a simple fix for this? I'd really love to allow organic stat growth to happen automatically upon level up, as well as allowing the player to further invest into certain stats they're more interested in (at the cost of having less JP to spend on skills).

I'm mostly looking for some insight on this and not necessarily a solution, unless the solution is very easy and/or I've completely misunderstood how things work.

Second question is pretty easy, I think. Well, I'm pretty sure it's fairly simple at least.

In Yanfly's updated video he added a counter to how many times the skill has been bought by that actor and used that variable to increase the cost of the skill. See that video here:


I don't want the cost to increase but rather keep count of how many times the actor has bought the skill and set a limit to it. To keep it simple, make it so you can only buy the passive "Upgrade HP" (etc) skill X amount of times before it's maxed out.

As always, if you got to the bottom, thanks for reading all the way down here. :kaoluv:
 

hosercanadian

Veteran
Veteran
Joined
Jul 18, 2016
Messages
55
Reaction score
17
First Language
English
Primarily Uses
I tackled this problem in a slightly different way than a direct add to parameters.

I created a series of Passive States (another Yanfly plug-in). These are applied when a skill is learned, and those skills are otherwise placeholders that never show-up once learned. I can show my notes if needed, but very simple process for each of the plug-ins.

The result are stat buffs with a scaled increase (normally 10% each). It does mean characters could quickly become over-powered. The most obvious example is when you use the test battle which has the characters knowing all possible skills. A 50% increase to all stats means they are untouchable, but if you factor in that possibility for end-game stages it is less of a concern. In my game players earn very small numbers per enemy killed and a modest bump per level meaning they essentially can only learn a new skill every level and approximately every 5 levels a new skill from enemies slain.
 

Parallax Panda

Veteran
Veteran
Joined
Oct 29, 2015
Messages
1,113
Reaction score
1,343
First Language
Swedish
Primarily Uses
RMMV
@hosercanadian
Well, while I'm not against using buffs as a workaround, wouldn't that mean that if I allow the player to buy a skill many times I'd have to add and remove buffs behind the scene each time though...

My game uses very specific low number values for the parameters.

My idea or well, wish, was that I'd allow any class to max out any parameter if the player chose to just put JP into it. In my game, the max you can have (with equipment) is 99. Without equipment it's 69. And to take a healer as an example, their ATK would max out at 28 (41 points below what you can have). I wanted you to be able to spend 1 JP to gain 1 ATK, and the amont of times you'd be able to do this depends on the class. For the healer it's 41 times because that would max it out at 69. Other classes might have slightly higher ATK so therefore I'd have to make different "stat boost" skills for each class and that's also why I asked about enforcing a maximum times you're allowed to buy the skills.

As you can tell, having the player buy the skill 41 times for it's healer would probably make buffs not really work well as a solution I think?
 

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,370
Reaction score
1,985
First Language
English
Primarily Uses
RMMV
You could create variables for the actors and have the skill give +1 to the actor variable (which could be displayed using Yanfly's YEP_X_ActorVariables plugin to keep track) and then make the skill unavailable if it reaches X amount.

Edit: Hell to make it easier, you could even use a state w/ a counter on it and give the skill a conditional requirement to learn.
 

Parallax Panda

Veteran
Veteran
Joined
Oct 29, 2015
Messages
1,113
Reaction score
1,343
First Language
Swedish
Primarily Uses
RMMV
Yeah I'm pretty sure that, with the correct knowledge of JS, I could just have some kind of "if" statement in the skill that checks how many times the skill has been bought before it decides to forget the skill again or not. But I don't know how to write that myself... :kaoswt:
 

LunaFamiliar

Veteran
Veteran
Joined
Jan 24, 2021
Messages
48
Reaction score
6
First Language
English
Primarily Uses
RMMV
Hi @Parallax Panda
Sorry to bring up a year+ old topic but did you ever end up finding a solution to this that didn't involve messing around with States a ton?
I have basically zero JavaScript knowledge and also want to try and achieve what you were going for in your first post, but haven't been able to figure it out :/
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,152
Reaction score
1,863
First Language
English
Primarily Uses
RMMV
@LunaFamiliar right in the first post is a link to "Stat Upgrades with Increasing Costs," which has the solution basically there (for that matter, I have no idea why these earlier responses were messing with states and stuff at all).

The increasing costs adds into the Learn Cost Eval: user._upgradeParam[id] += 1;
(You'll also need to add the two lines in the Learn JP Cost where it defaults the upgrade parameter)

Therefore, if you want to stop being able to upgrade the stat after a certain number of times, you would add into the skill the notetag:
Code:
<Learn Show Eval>
value=user._upgradeParam[X]<Y;
</Learn Show Eval>
where X is what you set id to in the other notetags, and Y is the number of times you want the player to be able to upgrade.

You may, actually, instead of adding the defaulting lines in the Learn JP Cost, need to initialize the array before the skill will be visible now.

So make an autorun event on your first map, go to Script on the last page of event commands, and put:
Code:
for (var i=1; i<$dataActors.length; i++)
    $gameActors.actor(i)._upgradeParam=[0, 0, 0, 0, 0, 0, 0, 0];

then have the event self-switch itself off.

You could, first, try this to see if it shows for a character who hasn't bought an upgrade yet:
Code:
<Learn Show Eval>
value=typeof user.upgradeParam == 'undefined' || user.upgradeParam[X]<Y;
</Learn Show Eval>

If that shows properly, you don't need the autorun script.
 
Last edited:

Latest Threads

Latest Profile Posts

Ugh, can't decide what to make next!
The Dystopia
ikW0BYF.png
Recently got RPG Maker MZ. A bit slower with my current PC but I will be getting a new one soon.
evening progress; pretty happy where this is at so i'll take the rest of the night to myself =w=
5NJGyKY.png
It would seem learning JS is not a know it all for making plugins. While it has enabled me to understand what I'm looking at, I still have to find the relevant information in the core scripts. This is much harder than learning JS IMO.

Forum statistics

Threads
118,403
Messages
1,115,673
Members
155,343
Latest member
sograyish
Top