MZ Turn TP on or Off?

Hey Im using the tp gauge as a sorta overlimit bar, so most of my skills dont use TP till very later. I think it would be distracting to the player to see a gauge they cant use for a while now. So my question is is there a plugin that allows the turning off and on of the TP bar? I am using Visustella stuff. Thanks in advance.
You can change the visibility of TP bar with script $dataSystem.optDisplayTp = true or $dataSystem.optDisplayTp = false , but that only lasts until you close the game session, so you'd have to update it when you load or start new game. Maybe someone can tell you how to save that value to a save file or something.
Yeah been trying to make a script doing just that but to no avail, even went to chat gbt for help and no avail...
You can create a property under $gameSystem that will persist throughout the game.

I will use $gameSystem._optDisplayTp as the property (you can name it anything that helps you remember).

(Untested) You will also need to overwrite some of the base code that uses $dataSystem:

JavaScript:
Window_StatusBase.prototype.placeBasicGauges = function(actor, x, y) {
    this.placeGauge(actor, "hp", x, y);
    this.placeGauge(actor, "mp", x, y + this.gaugeLineHeight());
    if ($gameSystem._optDisplayTp ?? $dataSystem.optDisplayTp) {
        this.placeGauge(actor, "tp", x, y + this.gaugeLineHeight() * 2);
    }
};
Window_BattleStatus.prototype.basicGaugesY = function(rect) {
    const bottom = rect.y + rect.height - this.extraHeight();
    const numGauges = ($gameSystem._optDisplayTp ?? $dataSystem.optDisplayTp) ? 3 : 2;
    return bottom - this.gaugeLineHeight() * numGauges;
};

I am not sure if there are other places but this should be most of it, if not all.

To make changes, use any one of these in a script call (set to true, false, or null):
JavaScript:
// show TP
$gameSystem._optDisplayTp = true;
// hide TP
$gameSystem._optDisplayTp = false;
// revert to default setting in editor
$gameSystem._optDisplayTp = null;
@bass2yang I think the problem with that is that they said they were using VisuStella which changes functions related to that.

If they don't find another solution, I'd just use plugins to run common events on new game and after load to manipulate the $dataSystem.optDisplayTp based on a switch or something.
@bass2yang I think the problem with that is that they said they were using VisuStella which changes functions related to that.

If they don't find another solution, I'd just use plugins to run common events on new game and after load to manipulate the $dataSystem.optDisplayTp based on a switch or something.
Good call - I think your approach would be simpler since you could just base it on a game switch which gets saved with the game.

(Edit: I was thinking about the nullish operator and just decided to make something for it haha... definitely not needed. The switch works great and can be evented without needing to touch the code. Hopefully it translates with VS).

JavaScript:
$dataSystem.optDisplayTp = $gameSwitches.value(1);
Good call - I think your approach would be simpler since you could just base it on a game switch which gets saved with the game.

(Edit: I was thinking about the nullish operator and just decided to make something for it haha... definitely not needed. The switch works great and can be evented without needing to touch the code. Hopefully it translates with VS).

JavaScript:
$dataSystem.optDisplayTp = $gameSwitches.value(1);
Just tried and while the script works fine if you load into the game, if you close out and re open it turns the tp back on, which is the issue I was coming across DX
But the point was to have those common events run on new game and loads. Doesn't it then always manipulate the setting to the correct position? VisuStella Core Engine has an option to run common event on new game. Don't think they have on load common event, but Galv has MZ Auto Common Events. You could check if they work with VisuStella. Or maybe you can just add it yourself at the end of onLoadSuccess.
if you close out and re open it turns the tp back on,
can you tell us what exactly you're talking about here?

As the post above explains by default you can get into the game with either "new game" or "load game", and both should be covered by now.

And I somehow get the impression that you're talking about a third way other than that, or were you indeed referring to a new game?
can you tell us what exactly you're talking about here?

As the post above explains by default you can get into the game with either "new game" or "load game", and both should be covered by now.

And I somehow get the impression that you're talking about a third way other than that, or were you indeed referring to a new game?
Im talking about loading a game, So what happens is I use the script, and it works, it shuts off the tp, and I load from the main menu and the tp remains off. But the moment I shut down the client and load the save, the TP shows up again. So for some reason the TP on or off function does not retain after the client is shut off.

Edit: I misunderstood what you all were saying, I'll try the common event method when I get home =D sorry for the misunderstanding >.<
Im talking about loading a game,
perhaps, but you still contradict yourself in a single post:

I load from the main menu and the tp remains off.
load the save, the TP shows up again.

What is the difference between those two loading options?
That is what we need to know, because the load function should be the same and work the same.

Or are you loading different saves, with one of them stored before the changes? That may be the cause because adding or removing plugins has a chance to make saves incompatible.
So first testing method, I save after using the script, then I load the game from there. Tp gauge is off.
then I return to the main menu and load the game from the main menu, again tp is off.
I close out of the game, open the game and load the same save, now the Tp is on.

That said I found a solution. I created an event and have it running parallel when a specific move is learned I have it set to a trigger flips it and turns the tp on again thanks for the help and patience all =) sorry for my lack of ability to explain, next time I'll post a video instead ahahah.
perhaps, but you still contradict yourself in a single post:




What is the difference between those two loading options?
That is what we need to know, because the load function should be the same and work the same.

Or are you loading different saves, with one of them stored before the changes? That may be the cause because adding or removing plugins has a chance to make saves incompatible.
I save after using the script,
did you create the plugin file for the first part or not?

because the script calls given in post #4 will not work without the first part being added as a plugin
did you create the plugin file for the first part or not?

because the script calls given in post #4 will not work without the first part being added as a plugin
YesI have the plugin isntalled, dont ask me why it didnt work, I coultnd tell ya but all i know is if you completely close out the game it does not keep unless im running a parallel process that is initiating the script on load so \o/
I have a TP plugin made for MV, but SHOULD work for MZ ok.

Actor TP
If all else fails, I have a similar thing in my game where the characters don't have access to their limits until a certain story point.

This is my bodge solution: when they unlock their TP gauge, I change their class.

Their starting class has these tags in the notes:


Code:
<Replace HP Gauge: HP>
<Replace MP Gauge: MP>
<Replace TP Gauge: none>

Later, I swap them to an otherwise identical class (preserving EXP of course) but now they have these tags.

Code:
<Replace HP Gauge: HP>
<Replace MP Gauge: MP>
<Replace TP Gauge: TP>

If you need to flip back and forth between having TP and not, I imagine simply swapping class back and forth works? I have so far not encountered issues doing it this way but if there's a glaring issue with that I'm sure one of the more experienced members can fill us in!

I forget which plugin utilises these note tags, but I'm 95% sure it's something Visustella.

EDIT: Just found it - it's VisuMZ_1_SkillsStatesCore

Original thread: https://forums.rpgmakerweb.com/threads/turn-tp-on-or-off.180345/