How to edit the TP formula?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,969
Reaction score
845
First Language
French
Is there a way to change how TP is increased when a character receives some damage?
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
564
Reaction score
274
First Language
German
Primarily Uses
Hey there,

If you just want to adjust the magnitude of the values, you could try to change the "TP Charge Rate" special parameter for your battlers through traits (this multiplies TP gain from both damage and items though).

If you want to make deeper changes to the formula, you could try to add a new plugin and customize this function in it:
Code:
Game_Battler.prototype.chargeTpByDamage = function(damageRate) {
    var value = Math.floor(50 * damageRate * this.tcr);
    this.gainSilentTp(value);
};
"damageRate" is the fraction of the targets lost HP bar here, "this.tcr" is the receivers TP charge rate.

There might be other plugins out there that already allow to do this easier though... :)
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,969
Reaction score
845
First Language
French
Isn't there a way to edit the formula directly in the native plugins of MV?
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
564
Reaction score
274
First Language
German
Primarily Uses
You should be able to find and edit the original function if you search for it in the "rpg_objects.js" file too if you prefer that.

I just generally think it's cleaner to copy these functions into a new javascript file and to do your edits there. If you have multiple versions of the same function, the latest (the one in your custom plugin) takes precedence.

Using a separate file might make further modifying, removing or porting of your feature to other projects easier (although especially for features that require more than one function edit), you won't run the risk of forgetting what you changed 3 months down the line and wondering why your game does what it does, it might make possible conflicts with other third party plugins a bit easier to resolve since you don't have to dig through the original plugins as much and can also swap the plugin positions if needed.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Happy Thanksgiving everyone! What are you thankful for? I'm thankful that I no longer have PTSD, and that I get to enjoy a good meal with my mom and stepdad! It might not be the same as before COVID, but at least I still get to enjoy the holiday!


Made another map, this one even has a cool moving waterfall. I'll have an animated GIF later whenever I'm done adding stuff. :LZSwink:
Back here again?! RPG MAKER, I can't quit you. :kaosigh:
um... why didn't anyone tell how easy it is to add motions to Sideview battlers? I literally copied the last one, changed the name and index, said where it should play, and boom... I've got intro motions.
Lately when I listen to 1970s songs, I always think that the "real world" is still at mid 70s. What we experience now is a futuristic dream. With this point of view, even 80s and 90s looks super futuristic. :D

Forum statistics

Threads
105,541
Messages
1,014,486
Members
137,220
Latest member
broiderers
Top