Enable/Disable Gauges Mid-Battle

Hey All,

I have been experimenting and researching online for a way to make this work.

Essentially I want the game to start with no TP gauge showing for the party. At a certain point in the game there will be a battle where the characters "learn" how to use TP. I have been able to remove the TP skill from the battle menu but I want to have the TP bar not show until this point in the game. This will be happening during a battle sequence. I am using Yanfly plugins but I cant for the life of me sort this out. I HAVE figured out how to hide the TP bar using a class note tag from Yanfly SkillCore. Seems like I just need to find a way to reverse that "gauge swap" note tag during battle if that is possible or re evaluate what I need to do to make this work. I hope this makes sense! Cheers!
It's a bit of a strange workaround, but you could add a sort of Tutorial state to your characters, and use the state note tag instead of the class note tag from Yanfly's Skill Core. Then remove the Tutorial state at the right part of the game and the gauge will go back to normal.
It's a bit of a strange workaround, but you could add a sort of Tutorial state to your characters, and use the state note tag instead of the class note tag from Yanfly's Skill Core. Then remove the Tutorial state at the right part of the game and the gauge will go back to normal.

I think I am understanding what you mean but im getting a little hung up on the execution. I think I have the state set up with the note tag correctly. When I put this note tag in a class it removes the TP bar but it doesnt appear to be doing that in this case. When my battle event begins the first thing that happens is the entire part is assigned the NO TP state which should theoretically remove the bar. Then further into the battle the state is removed. However, when I enter the battle the bar still seems to exist. Perhaps there is something really simple that I am missing here?
This snippet should do the trick:

Code:
(function(){

Game_System.prototype.showTp = function(bool) {
    this.showTpBool = bool;
    $gameParty.battleMembers().forEach(function(actor){actor.refresh()});
}

var _Astfgl_newWBDAT = Window_Base.prototype.drawActorTp
Window_Base.prototype.drawActorTp = function(actor, x, y, width) {
 if ($gameSystem) {
  if ($gameSystem.showTpBool){
    _Astfgl_newWBDAT.call(this,actor, x, y, width)
   }
  }
}

})()

Just copy it in a text file, save it as a .js, name it whatever, and put it in your project.
When you'd like to show tp, just use the following command in an event script: command:
Code:
$gameSystem.showTp(true) //to show the tp bars
$gameSystem.showTp(false) //to hide the tp bars
This snippet should do the trick:

Code:
(function(){

Game_System.prototype.showTp = function(bool) {
    this.showTpBool = bool;
    $gameParty.battleMembers().forEach(function(actor){actor.refresh()});
}

var _Astfgl_newWBDAT = Window_Base.prototype.drawActorTp
Window_Base.prototype.drawActorTp = function(actor, x, y, width) {
 if ($gameSystem) {
  if ($gameSystem.showTpBool){
    _Astfgl_newWBDAT.call(this,actor, x, y, width)
   }
  }
}

})()

Just copy it in a text file, save it as a .js, name it whatever, and put it in your project.
When you'd like to show tp, just use the following command in an event script: command:
Code:
$gameSystem.showTp(true) //to show the tp bars
$gameSystem.showTp(false) //to hide the tp bars


This worked perfectly! Thank you so much!
You're welcome.
BTW, for the record, by modifying all instances of "Tp" to "Hp" or "Mp", you can use this snippet to toggle the display of the hp or mp gauges too.
If you do it in the same .js file, you'll need to change "_Astfgl_newWBDAT" too, just add a number behind it.
Example spoiler'd below:
Spoiler
Code:
Game_System.prototype.showHp = function(bool) {
   this.showHpBool = bool;
   $gameParty.battleMembers().forEach(function(actor){actor.refresh()});
}

var _Astfgl_newWBDAT2 = Window_Base.prototype.drawActorHp
Window_Base.prototype.drawActorHp = function(actor, x, y, width) {
 if ($gameSystem) {
  if ($gameSystem.showHpBool){
   _Astfgl_newWBDAT2.call(this,actor, x, y, width)
   }
  }
}

You'd then call $gameSystem.showHp(true), or $gameSystem.showHp(false)

Edit: I'm unsure, but it should even work with 'Name', 'Class', 'Level', 'Face', 'Nickname', 'Icons', 'Character'.

Original thread: https://forums.rpgmakerweb.com/threads/enable-disable-gauges-mid-battle.86067/