How do I query an actor's Max TP?

I know that querying current TP is $gameActors.actor(x).tp, but I can't find out how to query the Max TP on the Script Calls spreadsheet. Might anyone know?

Usage: I'm using a skill that can restore TP, and I'd like to include a conditional branch that checks to see if TP is already at max. I'd like to throw both current TP and max TP to variables, then go from there.

If anyone has any alternate ideas on how to do this, please let me know! But I think once I have the script call it should work.

Thanks! :LZSgrin::LZSjoy::LZSgrin:
i am prety sure its always 100

but u can just try

$gameActors.actor(1).mtp (for actor 1 example)
Screenshot_1.png


i guess this info is also needed if making a tp bar or Hud
Max TP is always 100 by default.
Thanks all -- is there any simple means of increasing max TP, I'm wondering?
actor.maxTp()
To increase Max TP for actor you need either plugin or edit function by yourself, like I did.
JavaScript:
(function(){
    Game_Actor.prototype.maxTp = function() {
        var base = Number($dataActors[this.actorId()].meta.tpBase) || 0;
        
        if (base === undefined){
            base = 10;
        }
        
        return Math.floor((base + (this.atk * 5) + (this.level * 5) * 1.55) / 10) * 10 || 100;
    };   
})();

(You can save it as plugin in your project)

Tip: you can also add notetag to your actor(s) to increase amount, if JS to hard for you:
<tpBase:x> where X is your number.
To increase Max TP for actor you need either plugin or edit function by yourself, like I did.
JavaScript:
(function(){
    Game_Actor.prototype.maxTp = function() {
        var base = Number($dataActors[this.actorId()].meta.tpBase) || 0;
       
        if (base === undefined){
            base = 10;
        }
       
        return Math.floor((base + (this.atk * 5) + (this.level * 5) * 1.55) / 10) * 10 || 100;
    };  
})();

(You can save it as plugin in your project)

Tip: you can also add notetag to your actor(s) to increase amount, if JS to hard for you:
<tpBase:x> where X is your number.


Thank you very much for this -- just one question though: how would I increase TP in an event? I'm not looking to have an actor begin with more TP, I'd like to increase Max TP as the player levels up.

This is amazing to have though, I'm grateful. But it would be amazing to be able to increase Max TP as a player levels up 🙂
To increase max TP via event you must include in above function game variable, so the final formula will be:
Code:
Math.floor((base + (this.atk * 5) + (this.level * 5) * 1.55) / 10) * 10 + $gameVariables.value(idVariable) || 100;

and in your event just change it value, but be aware that way will affect TP of ALL actors in group, but how to make it just for one specific actor IDK.

Edit: in my formula maxTP grows with level:
this.level * 5 - means actor's current level multiplied by 5.

Edit2: I mean I know a way to make to increase max TP with variables for separate actors, but my method is lame and later in game is causing troubles, so you must ask someone more qualified than me.
To increase max TP via event you must include in above function game variable, so the final formula will be:
Code:
Math.floor((base + (this.atk * 5) + (this.level * 5) * 1.55) / 10) * 10 + $gameVariables.value(idVariable) || 100;

and in your event just change it value, but be aware that way will affect TP of ALL actors in group, but how to make it just for one specific actor IDK.

Edit: in my formula maxTP grows with level:
this.level * 5 - means actor's current level multiplied by 5.

Edit2: I mean I know a way to make to increase max TP with variables for separate actors, but my method is lame and later in game is causing troubles, so you must ask someone more qualified than me.

Very interesting 🙂 I very much appreciate your effort here. Thank you!
Also, just for the record...
I know that querying current TP is $gameActors.actor(x).tp, but I can't find out how to query the Max TP on the Script Calls spreadsheet.
Max TP is (currently) on row 137 on the Related Scripting sheet:
https://docs.google.com/spreadsheet...tfKDOetnvh7OHs/edit#gid=1186334695&range=C137

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-query-an-actors-max-tp.142343/