How to edit the TP formula?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,977
Reaction score
849
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
567
Reaction score
278
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,977
Reaction score
849
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
567
Reaction score
278
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.
 

Latest Threads

Latest Posts

Latest Profile Posts


When you thought you'd be finished with the grid, and spend ~8-9 hours on an arrow. How is this more difficult to than player movement?

Still some bugs hiding in there, but it's nearly complete.

I'm having it strictly follow the path a user draws, because there will be booby trap and other similar mechanics where you want to avoid specific cells.
I feel like banging my head against a wall every time I want to find that post that shows all the plugin header codes. Then I think "next time I find it, I'm going to bookmark it". Then I think "wait a minute ... maybe I bookmarked it last time because it took me so long to find it". Check bookmarks, and there it is :)
... a few of my main characters standing around doing nothing lol. I mostly wanted to see them together on screen.

Forum statistics

Threads
107,823
Messages
1,032,442
Members
139,975
Latest member
Lucimountfort
Top