Yanfly's Skill Rewards plug in, double value display bug

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
40
First Language
German
Primarily Uses
RMMV
I think I've come across a bug in Yanfly's Skill Rewards plug in.



What I basically want to do with this skill is use up to 40 TP and recover 1% HP for each TP used. Note: I wanted the user to be able to use this ability with 1 TP, 5 TP, 30 TP, 100 TP or whatever.
I didn't know how to substract 40 TP without setting the TP cost of the skill other than 0, so I had the idea to use the hit reward notetag.

The issue with this is, using this notetag, Yanfly's plug in will display the healed value twice.



Does anybody know a fix for this? Or alternatively how I can substract TP while the skill cost is still 0?
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
399
Reaction score
221
First Language
English
Primarily Uses
RMMV
I don't have any experience using Yanfly's Skill Rewards so I can't offer a solution there. You could try running one of these at the start of your damage formula to deduct 40TP though.

Code:
a.gainTp(-40);
//may show a popup for tp lost.

a.gainSilentTp(-40);
//shouldn't show a popup for tp lost.
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
40
First Language
German
Primarily Uses
RMMV
Code:
a.gainTp(-40);
//may show a popup for tp lost.

a.gainSilentTp(-40);
//shouldn't show a popup for tp lost.

Awesome, thanks! That did the trick! Before I tried a.tp -= 40; . :biggrin:
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
399
Reaction score
221
First Language
English
Primarily Uses
RMMV
You'll usually find that actors parameters referenced using .atk or .tp are just getters that execute a function, eg a.param(2). To refer to the actual value you use the version with an underscore, eg a._tp, or a._params[2].

If you're planning on doing things using code I'd advise taking a look at this page:
https://kinoar.github.io/rmmv-doc-web/classes/game_actor.html#atk

While I'm not sure it covers Everything it's a pretty good jumping off point for finding functions that will do what you need without having to open the games code or backtrack from Game_Actor to Game_Battler to Game_BattlerBase looking for one function.
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
40
First Language
German
Primarily Uses
RMMV
Ah, good to know. I still have a lot to learn.

Instantly bookmarked. Thank you for the link! Will be very useful. :LZSsmile:
 

Latest Threads

Latest Posts

Latest Profile Posts

Well.. I was going to post my randomly generated road experiments... But the new "Attach Files" on profile posts seems to be quite buggy. Also there's no more option to insert Imgur images. Highly unfortunate. Guess I'll give them a bit to fix it and go back to messing with stuff.
my first day back to working on my project and i'm pooped!! hope to get back in the rhythm soon!
I just came up with a very original RPG Idea. This is so well written that it might be the first RPG I actually finish making. (I’ve stopped all my projects halfway through development. I don’t think this one will be the same.)
Became a news junkie... except for those times I got inspired and published a chapter of any of my crazy stories. XD
Finally returning to one of my least favorite parts of game deving - mapping.
Me, adding new map: Okay, so this map will be the - wait...Map 501?! O.O E-excuse me?!
So, yup...breaking into the 500's for map count. Some are placeholders for now, since I haven't gotten around to actually mapping them yet. But soon. Very soon...oof, I'm scared.

Forum statistics

Threads
107,584
Messages
1,030,768
Members
139,692
Latest member
mmch1234
Top