Azrik

Veteran
Veteran
Joined
Jun 19, 2015
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMMV
I'm using Yanfly's plugins in RMMV and I'm sure there is a way to do this, but I'm not super familiar with java script. I'm trying to make a few skills/states that cause the player to recover HP/MP/TP when attacking an enemy, but only for specific values like getting 1 mp every time you use a basic attack. I'd also like to figure out how to set up a way that states or equipment can recover these values at specific amounts as a regen effect.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,559
Reaction score
2,913
First Language
English
Primarily Uses
RMMV
The function for recovering MP is user.gainMp(X)

For a state, you'd simply put that inside of a Custom Regenerate Effect notetag.
 

Azrik

Veteran
Veteran
Joined
Jun 19, 2015
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMMV
I tried doing that, but for some reason it wouldn't work for me. Here is what I entered.

<Custom Regenerate Effect>

user.gainMp 10

</Custom Regenerate Effect>
 

eomereolsson

Veteran
Veteran
Joined
Sep 29, 2021
Messages
182
Reaction score
153
First Language
German
Primarily Uses
RMMV
Well, that is a plain syntax error. If you open your console via F8 you should see that. You must not leave out the brackets.
JavaScript:
<Custom Regenerate Effect>

user.gainMp(10)

</Custom Regenerate Effect>
This should work.
 

Azrik

Veteran
Veteran
Joined
Jun 19, 2015
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMMV
I actually tried that one as well. I just tried re-downloading the buffstatscore as well to see if my version was just outdated and it still isn't working. I'm not sure what's going on...
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
753
Reaction score
1,136
First Language
German
Primarily Uses
RMMV
Then can you show us a screenshot of your code and where you put it?

We can only make a proper problem assessment with more information.
 

Azrik

Veteran
Veteran
Joined
Jun 19, 2015
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMMV
I made a couple samples and neither worked. Here is what I did

The version I tried giving it to a class...
MV class sample.png

...and to a armor.MV ring sample.png
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,559
Reaction score
2,913
First Language
English
Primarily Uses
RMMV
...you're putting it in a class and an armor. Both my post and the documentation for the plugin say that notetag functions in a state.

If you want the class or the armor to give the actor a state with that notetag, you'll need to use the Auto Passive States plugin.
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
753
Reaction score
1,136
First Language
German
Primarily Uses
RMMV
The notetag you are trying to use only works with states.

You would need to create an invisible state (no icon) and give it to the character you want to have the effect.

Something like YEP_AutoPassiveStates could make this easier by applying the state automatically.

PS: As a piece of advice, most plugins have documentation on how to use them. These are the texts you can read when adding new plugins.

In your example, the notetag you used is found here:

1.png

edit: ninja'd by my arch-nemesis @ATT_Turan
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
753
Reaction score
1,136
First Language
German
Primarily Uses
RMMV
@ATT_Turan
I'm pretty sure you already landed on multiple peoples' black list already. Without even knowing it.
Not that you should care anyways.

As for me:

4f8alf.jpg

Well okay for real though, let's try to not derail the thread with memes :D

@Azrik
Anyways, tell us if you need further help with setting things up.
But invisible states + YEP_AutoPassiveStates should do the trick.

Make sure to follow the plugin documentation to avoid any plugin related issues.
 

Azrik

Veteran
Veteran
Joined
Jun 19, 2015
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMMV
Thank you so much. Now that part works. I need to pay more attention to those details.

Now the question is if I can set up a way to have basic attacks regen 1 MP.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,559
Reaction score
2,913
First Language
English
Primarily Uses
RMMV
Why not? You just do the exact same thing in your damage formula.
Code:
a.gainMp(1); then your damage formula

You may find this thread helpful:
 

Azrik

Veteran
Veteran
Joined
Jun 19, 2015
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMMV
Thank you both so much. That did the trick. I do have one more unrelated question though. I'm using the Yanfly selection control plugin and I was trying to only have specific skills have the option of choosing if they target all enemies or not. So I set the "Single Multiple" parameter to "false" to try to disable all skills from having the option, but it still shows up whenever I do a test battle. Is there something else I need to change to prevent this from effecting all skills?

Edit: Ok. Ignore that last part. It seems to be working now. Not sure what changed. Thanks for all your help.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

NUMINA Part 1 is finally out ✨ Get it now with a 10% launch discount!
Made this simple Training Dummy :D

obraz_2022-07-01_095700524.png
I'm still undecided weather or not I should add minor swearing to my game. Like I'm going for an all ages demographic... but the idea of a cartoon character saying dammit, hell, or crap in normal conversation is really funny to me.
If we assume an Elf's strong suit is Dexterity (AGI) & Intellect (MAT), I imagine Strength (ATK) & Constitution (DEF) would be among their lowest stats. But I'm having a hard deciding which should be lower, Strength or Constitution?

Forum statistics

Threads
123,221
Messages
1,155,018
Members
161,602
Latest member
YellowAngelBon
Top