Jump to content
Sign in to follow this  
snow

Display MP and TP costs - with Yanfly Battle Engine addon (updated 03/19)

Recommended Posts

Display MP and TP costs

 

Info:

By default, TP overrides the MP display. This script will fix that and have them display side-by-side if the skill uses both.

You don't have to use both scripts; it's one or the other. Use the default script for normal projects, it will work with almost any battle system.

Otherwise, you can choose the add-on to have this work in Yanfly Battle Engine.

 

 

 

Screenshots:

Default MP and TP script

 

snowscreen.png

 

 

Add-on script for Yanfly Battle Engine

 

untitled-29.png

 

 

Instructions:

- Place under Materials, and underneath any battle scripts

- Plug 'n Play script.

- Will have issues with other scripts that customize skill cost display (not skills themselves, but the cost display).

No credit needed, this is just a snippet.

 

Updates:

03/17 - MP and TP now have a visible space between them.

03/19 - Add-on available for Yanfly's Battle Engine

 

Script:

Normal MP and TP display script:

 

 

#==============================================================================
# â–  [sNOW] Display MP and TP
#------------------------------------------------------------------------------
# This script will display TP and MP in the Skill List if both are required.
# For RPG Ace. Place under Materials.
#==============================================================================
class Window_SkillList < Window_Selectable
 def draw_skill_cost(rect, skill)
if @actor.skill_tp_cost(skill) > 0  
  change_color(tp_cost_color, enable?(skill))
  draw_text(rect, @actor.skill_tp_cost(skill), 2)
end
  if @actor.skill_mp_cost(skill) > 0  
   change_color(mp_cost_color, enable?(skill))
   rect.width -= 35	# Set to 30 if you want no space between MP and TP.
   draw_text(rect, @actor.skill_mp_cost(skill), 2)
  end
 end
end

 

 

Yanfly Battle Engine add-on (place underneath the battle scripts):

 

#==============================================================================
# â–  [snow] MP and TP display addon for Yanfly's Ace Battle Engine
#------------------------------------------------------------------------------
# This script will display TP and MP in the Skill List if both are required.
#------------------------------------------------------------------------------
# This was made for people who use Yanfly's Ace Battle Engine.
# It repositions the actor window when bringing up the skill window, so that
# the MP and TP costs get the space they need.
#------------------------------------------------------------------------------
# Place UNDER Yanfly's Ace Battle Engine. Plug 'n Play script.
#==============================================================================
class Scene_Battle < Scene_Base  
 def create_battle_status_aid_window
   @status_aid_window = Window_BattleStatusAid.new
   @status_aid_window.status_window = @status_window
   @status_aid_window.x = 0
   @status_aid_window.y = 176
 end

 def create_skill_window
   scene_battle_create_skill_window_abe
   @skill_window.height = @info_viewport.rect.height
   @skill_window.width = 544
   @skill_window.y = Graphics.height - @skill_window.height
 end  
end

class Window_SkillList < Window_Selectable  
  def draw_skill_cost(rect, skill)
   if @actor.skill_tp_cost(skill) > 0    
  change_color(tp_cost_color, enable?(skill))
  draw_text(rect, @actor.skill_tp_cost(skill), 2)
   end
  if @actor.skill_mp_cost(skill) > 0   
    change_color(mp_cost_color, enable?(skill))
    rect.width -= 35
    draw_text(rect, @actor.skill_mp_cost(skill), 2)
  end
 end
end

 

Edited by snow

Share this post


Link to post
Share on other sites

On your screenshot for "Mana Test" the mana and tp costs are scrunched together, but not for the skills on the right, is that intentional?

Other than that a good script, simple, but does exactly what it set out to do. Excellent job. :D

Share this post


Link to post
Share on other sites

On your screenshot for "Mana Test" the mana and tp costs are scrunched together, but not for the skills on the right, is that intentional?

Other than that a good script, simple, but does exactly what it set out to do. Excellent job. :D

 

No, both columns had the exact same distance between the MP and TP. But the skill on the left had "100" mp and "100" tp, where as the skills on the right had "10" and "10".

So there was more space between the numbers on the right because they had shorter numbers. ^_^

 

Regardless, there is a new screenshot to display 3-digit costs in both columns so that it doesn't look confusing.

I've updated the script to display a space between the MP and TP costs, since it seems that would be common sense, maybe it's what people would prefer.

I've left a comment in the script with an instruction on how to revert the change.

Edited by snow

Share this post


Link to post
Share on other sites

Sorry for the double post, but there was error with my script before where a "<" was a ">". I made this error when editing my post since the forum turns those symbols into "&--63" or something like that. I put ">" instead of "<" to fix it lol. xP

 

Anyway the script is fixed now >.>

Share this post


Link to post
Share on other sites

Ah, I will take a look at Yami's CATB script. It may not be ready until Wednesday though..

 

And yes, I will also add the option to have MP and TP displayed after the costs, if you want it. But be warned that this does take a lot of space in the skill names :P

Share this post


Link to post
Share on other sites

I felt like I should add this for any user who might run into the problem. If you are using both the YEA Battle System AND a Sideview (in my case, Victor's) then you might run into this problem, where the targeting is funky. If so, use the non YEA version. This might not be the best work-around but I find it works.

 

Grab2012-04-28at55448PM.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted