RMMV SOLVED - Help with Yanfly Limited Skill Uses recovery

rue669

RueToYou
Veteran
Joined
Aug 29, 2016
Messages
477
Reaction score
386
First Language
English
Primarily Uses
RMMV
Hi all,

Hope everyone is doing well and staying safe and that ya'll are getting vaccinated!!

I'm hoping someone can help me out.

I use Yanfly's Limited Skill Uses for some of the skills in my game. Then I have another skill that can recover all limited uses.

So it works like this:
Various actors have skills that have limited uses (3/3 or 2/2).

Once those uses are used up in a battle, there is a skill an actor can use that recovers all the limited uses for all allies.

I tried the Recover All Uses but then realized that's just for the Recover All command which I don't want to use (I don't want everyone's HP and MP to recover every time you use this skill). I just want the limited uses on skills to recover completely.

Is there a way to do this? I find it odd that it's not already built into the plugin but perhaps I'm just missing it. Any help you can provide would be appreciated. Thank you!
 

Htlaets

Veteran
Veteran
Joined
Feb 1, 2017
Messages
219
Reaction score
118
First Language
English
Primarily Uses
Have a skill with the following notetag:
<Global Limited Uses: +X>
It's a little confusing but I'm fairly certain that that notetag doesn't increase maximum uses, so you could make the +9999.
For specific skills there's another notetag.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,475
Reaction score
2,601
First Language
English
Primarily Uses
RMMZ
You can do this with a script call: [battler].recoverAllLimitedSkillUses()
 

rue669

RueToYou
Veteran
Joined
Aug 29, 2016
Messages
477
Reaction score
386
First Language
English
Primarily Uses
RMMV
Thanks guys! I’m gonna try both of those!

@Trihan by battler, is that the actor id? And do I write it in []? I suppose I would call the script as a comment event in the skill?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,159
Reaction score
636
First Language
English
Primarily Uses
RMMV
The trick is that if you just use the Global Limited Uses tag, I don't see how you'd avoid it replenishing that skill as well. So unless your intention is to have that always available, you'd want to use a loop with the script call Trihan mentioned. (and if it is your intention to have that always available...why bother? Just replenish all your skills at the end of each battle).

@Trihan by battler, is that the actor id? And do I write it in []?
No, a battler is an actor variable, not the id of one. So an example of usage would be
Code:
$gameParty.actors()[0].recoverAllLimitedSkillUses();
to recover for the first actor in your party.

If you wanted to recover for the entire party except the person who is casting the replenish skill, you could do this:
Code:
for (var i=0; i<$gameParty.actors().length; i++)
{
    if ($gameParty.actors().id!=X)
        $gameParty.actors()[i].recoverAllLimitedSkillUses();
}
where X is the ID of the actor who gets that skill. If you want to include him in the replenishment, then just take out the line starting with "if" (but see my comment above).
I suppose I would call the script as a comment event in the skill?
You can do it anywhere JavaScript is recognized. Yes, you can call a common event that includes that in a script box. Since you're using Yanfly's stuff, he has tons of places you can include code to be run, such as in action sequences, various times in combat using states, etc.
 

rue669

RueToYou
Veteran
Joined
Aug 29, 2016
Messages
477
Reaction score
386
First Language
English
Primarily Uses
RMMV
And it works!!

Thanks everyone so much for your help with this. Much appreciated on the quick and informative responses.
 

Latest Threads

Latest Posts

Latest Profile Posts

For a long time I always consider XP soundtracks as the best one.
Just listened to some of MZ tracks from the free version.
It's... Quite mindblowing. xD
Only listened to the battles, towns, and fields.
But I'm sure the rest are equally good. :D
What do you guys want to see for the new Jump into Javascript? A continuation of the rpg_objects, or would you prefer a "lesson 0" where I go back to the absolute basics of Javascript and cover the fundamentals of the language and its construction?
Hey RPG members!!

How do you finish projects? Some new game developers start off strong but end up losing momentum. What keeps you motivated while working on new projects?
Feeling wee sleepy.. ZzzZ
So many threads to move to the right place. My post count is awesome, but 95% of it is due to moving things.

Forum statistics

Threads
112,452
Messages
1,068,383
Members
146,107
Latest member
kenjum
Top