Hide TP Counter for certain characters until relevant

So... For this game i'm making one of the gimmicks is Transformations. I envision them to function similar to the Trance system from Final Fantasy 9.

However. Through Tsukuhimes Shapeshift and Active Costs scripts I can get the forms to run and cancel out when the required Stat is low enough. I still feel the forms need a bit more limiting for balance as I cannot do Active cost in percentage.

While I can use the TP bar as a work around. The problem is I only wan't the TP counter to be present until the characters (who have the skills anyway) have learnt said skill and to be able to hide it again On the circumstance such as they are unable to transform (I.E Garnet's State of shock late game)

Scripts I am using
Tsukuhime - Shapeshift
Tsukuhime - Active Cost
Tsukuhime - Effects Manager
Hm, let me get this straight. You want to show TP once the player gets a certain skill and only hide it again for certain states. Doable, I think. Actors have a @skill array, and it seem that forget_skill shows this array can be affected by skill_id, which is simply the list number of the skill. So therefore, @skill should be able to be affected with include? to determine if a certain skill exists. So two versions you can try:

Code:
class Window_BattleStatus < Window_Selectable

  def draw_gauge_area(rect, actor)
    if trance_display(actor)
      draw_gauge_area_with_tp(rect, actor)
    else
      draw_gauge_area_without_tp(rect, actor)
    end
  end

  def trance_display(actor)
    return false unless $data_system.opt_display_tp
    return false if actor.state?(15) #Garnet's Shock state, no TP display
    return actor.skill_trance_check?
  end

end

class Game_Actor < Game_Battler
 
  def skill_trance_check?
    return true if id == 1 and @skills.include? 23
    return true if id == 2 and @skills.include? 26
    return false
  end

end

Code:
class Window_BattleStatus < Window_Selectable

  def draw_gauge_area_with_tp(rect, actor)
    draw_actor_hp(actor, rect.x + 0, rect.y, 72)
    draw_actor_mp(actor, rect.x + 82, rect.y, 64)
    draw_actor_tp(actor, rect.x + 156, rect.y, 64) if trance_display(actor)
  end

  def trance_display(actor)
    return false unless $data_system.opt_display_tp
    return false if actor.state?(15) #Garnet's Shock state, no TP display
    return actor.skill_trance_check?
  end

end

class Game_Actor < Game_Battler
 
  def skill_trance_check?  #assign the actor id and skill id to make TP show up
    return true if id == 1 and @skills.include? 23
    return true if id == 2 and @skills.include? 26
    return false
  end

end

First version extends MP bar, second leaves a space for TP. Anyway the two places you edit in either one is the state for that State of Shock and the skill_trance_check? where you assign an actor and their respective Trance skill. Yeah, that doesn't look fancy, but it's a start.
Ok. I'm a bit confused on some of the details. mostly on whether i need to put a specific call in the Actor's note sections or not
sXuI92.jpg

This is what i have attempted thus far
Oops, I thought I had edited the code. You need to replace $data_system.opt_display_tp inside the draw_gauge_area method with trance_display(actor) to get this to work.

Anyway, no note-tag yet, but if it makes it easier, I'll whip one up in a bit.
Oops, I thought I had edited the code. You need to replace $data_system.opt_display_tp inside the draw_gauge_area method with trance_display(actor) to get this to work.

Anyway, no note-tag yet, but if it makes it easier, I'll whip one up in a bit.
Alright. And the ID refers to the Skill type or the Actor ID?
The id is the actor's id. The number after @skills.include? should be the skill's id.

===

Anyway, I just came up with the notetag version. Haven't tried it yet, but should be easier to manage.

Code:
module DL
  module Trance_Skill
    NoTPDisplay = 30 #Garnet's Shock state, no TP display
    Regex = /<TranceID:\s*(\d+)\s*>/i
  end
end

module RPG
  class BaseItem
    def trance_skill
      load_notetag_enemy_class unless @class_id
      return @class_id
    end
  
    def load_notetag_enemy_class
     trance_id = 0
      if self.note =~ DL::Trance_Skill::Regex
        trance_id = $1.to_i
      end
     return trance_id
    end
  end
end

class Game_Actor < Game_Battler
  def skill_trance_check?  #use <TranceID: X> to show TP when you have that skill
    trance_skill_id = actor.trance_id
    return true if trance_skill_id  > 0 and skills.include? trance_skill_id
    return false
  end
end

class Window_BattleStatus < Window_Selectable

  def draw_gauge_area(rect, actor)
    if trance_display(actor)
      draw_gauge_area_with_tp(rect, actor)
    else
      draw_gauge_area_without_tp(rect, actor)
    end
  end

  def trance_display(actor)
    return false unless $data_system.opt_display_tp
    return false if actor.state?(DL::Trance_Skill::NoTPDisplay)
    return actor.skill_trance_check?
  end

end

For this one, the state id for no TP display is moved to the top for easier editing, and you can use <TranceID: X> in your Actor notebox to assign the skill needed to show TP (instead of making that list).
UYk5w4.jpg

I think I've done something wrong
return true if trance_skill_id > 0 @skills.include? trance_skill_id
I don't see a ',' (comma) in that line for Harosata's code.
This line:
Code:
return true if trance_skill_id  > 0 @skills.include? trance_skill_id
Got a syntax error.
I think, it should be:
Code:
return true if trance_skill_id > 0 && @skills.include? trance_skill_id
But there is really no need to check if trance_skill_id is higher than 0 or not, because the @skills array will never contain a 0 anyway.
That method can be reduced to this instead:
Code:
  def skill_trance_check?  #use <TranceID: X> to show TP when you have that     skill
    return @skills.include?(actor.trance_id)
  end

Btw, no idea if this is relevant to you or not, but the instance variable @skills is not equal the method skills in Game_Actor.
The variable @skills will return the learned skills only, without any skills gained from actor, class, equipment, or state features.
The method skills will return all skills, including the ones gained from feature objects.

Ohh, and use brackets for argument passing, pretty please! *.*
Huh, I forgot the and. And I forgot to look for that skills method. Corrected the notetag code to reflect these changes. Thank you for pointing them out.

Original thread: https://forums.rpgmakerweb.com/threads/hide-tp-counter-for-certain-characters-until-relevant.90310/