Hide TP Counter for certain characters until relevant

JonicOokami7

Villager
Member
Joined
Jan 15, 2018
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
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.
 
Last edited:

JonicOokami7

Villager
Member
Joined
Jan 15, 2018
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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

This is what i have attempted thus far
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
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.
 

JonicOokami7

Villager
Member
Joined
Jan 15, 2018
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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?
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
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).
 
Last edited:

JonicOokami7

Villager
Member
Joined
Jan 15, 2018
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMVXA

I think I've done something wrong
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
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! *.*
 

Harosata

Dramatic Lightning's BFF
Veteran
Joined
Aug 20, 2015
Messages
246
Reaction score
70
First Language
English
Primarily Uses
RMVXA
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top