DoubleX 209 Posted August 29, 2014 (edited) Note This script is extremely similar to Yanfly Engine Ace - Battle Engine Add-On: Enemy HP Bars so crediting DoubleX or his alias will violate this script's terms of use. Prerequisites Yanfly Engine Ace - Ace Battle Engine(Created by Yanfly) Script name DoubleX RMVXA Enemy MP/TP Bars Addon to Yanfly Engine Ace - Ace Battle Engine Author DoubleX: - This script Yanfly: - Yanfly Engine Ace - Ace Battle Engine Terms of use Same as that of Yanfly Engine Ace - Ace Battle Engine except that you're not allowed to give DoubleX or his alias credit Introduction Displays the enemy mp or/and tp bars #==============================================================================| # ** Mp bar notetags | #------------------------------------------------------------------------------| # * Notetag <hide mp gauge>, <show mp gauge> | # Hides or shows mp gauge for that enemy in battle. The guage appear whenever| # that enemy is targeted for battle or taking mp damage. Using the latter | # will bypass the requirement for needing to defeat that enemy once. | #------------------------------------------------------------------------------| # * Notetag: <back mp gauge: x> | # Sets the colour of that enemy's mp back gauge of to text color x. | #------------------------------------------------------------------------------| # * Notetag <mp gauge 1: x>, <mp gauge 2: x> | # Sets the colour 1 and 2 of that enemy's mp gauge to text color x. | #------------------------------------------------------------------------------| # * Notetag <mp display: x> | # Displays that enemy's mp in the form of: | # Don't display if x is 0 | # Percentage if x is 1 | # Actual number if x is 2 | #==============================================================================| # ** Tp bar notetags | #------------------------------------------------------------------------------| # * Notetag <hide tp gauge>, <show tp gauge> | # Hides or shows tp gauge for that enemy in battle. The guage appear whenever| # that enemy is targeted for battle or taking tp damage. Using the latter | # will bypass the requirement for needing to defeat that enemy once. | #------------------------------------------------------------------------------| # * Notetag: <back tp gauge: x> | # Sets the colour of that enemy's tp back gauge of to text color x. | #------------------------------------------------------------------------------| # * Notetag <tp gauge 1: x>, <tp gauge 2: x> | # Sets the colour 1 and 2 of that enemy's tp gauge to text color x. | #------------------------------------------------------------------------------| # * Notetag <tp display: x> | # Displays that enemy's tp in the form of: | # Don't display if x is 0 | # Percentage if x is 1 | # Actual number if x is 2 | #------------------------------------------------------------------------------| #==============================================================================| # ** You only need to edit this part as it's about what this script does | #------------------------------------------------------------------------------| module DoubleX_RMVXA module YEA_BattleEngine_Enemy_MP_TP_Bars_Addon #------------------------------------------------------------------------------| # * MP Bars | #------------------------------------------------------------------------------| # SHOW_ENEMY_MP_GAUGE, default = true # Show the enemy mp gauge if SHOW_ENEMY_MP_GAUGE is true SHOW_ENEMY_MP_GAUGE = true # ANIMATE_MP_GAUGE, default = true # Animate the enemy mp gauge if ANIMATE_MP_GAUGE is true ANIMATE_MP_GAUGE = true # MP_DEFEAT_ENEMIES_FIRST, default = false # Show the enemy mp gauge only if it's been defeated before MP_DEFEAT_ENEMIES_FIRST = false # ENEMY_MP_GAUGE_WIDTH, ENEMY_MP_GAUGE_HEIGHT, default = 80, 20 # Sets the enemy mp gauge width and height as ENEMY_MP_GAUGE_WIDTH and # ENEMY_MP_GAUGE_HEIGHT respectively ENEMY_MP_GAUGE_WIDTH = 48 ENEMY_MP_GAUGE_HEIGHT = 12 # ENEMY_MP_GAUGE_COLOUR1, ENEMY_MP_GAUGE_COLOUR2, default = 22, 23 # Sets the colour 1 and colour 2 of the enemy mp gauge as # ENEMY_MP_GAUGE_COLOUR1 and ENEMY_MP_GAUGE_COLOUR2 respectively ENEMY_MP_GAUGE_COLOUR1 = 22 ENEMY_MP_GAUGE_COLOUR2 = 23 # ENEMY_MP_BACKGAUGE_COLOUR, default = 15 # Sets the enemy mp back gauge colour as ENEMY_MP_BACK_GAUGE_COLOUR ENEMY_MP_BACKGAUGE_COLOUR = 15 # ENEMY_MP_DISPLAY, default = 2 # Display the enemy's mp in the form of: # Don't display if 0 # Percentage if 1 # Actual number if 2 ENEMY_MP_DISPLAY = 2 # (v1.03a+)MP_PERCENTAGE_DECIMAL_DIGHT_NUMBER, default = 0 # Sets the number of decimal digits when showing mp percentages MP_PERCENTAGE_DECIMAL_DIGHT_NUMBER = 0 # MP_TEXT_SIZE, default = ENEMY_MP_GAUGE_HEIGHT # Sets the size of the text shown on enemy mp bars as MP_TEXT_SIZE MP_TEXT_SIZE = ENEMY_MP_GAUGE_HEIGHT + 4 # (v1.00b+)FIX_LARGE_MP_TEXT, default = false # Fixes issues when MP_TEXT_SIZE is much larger than ENEMY_MP_GAUGE_HEIGHT FIX_LARGE_MP_TEXT = false # (v1.02a+)MP_CRISIS_TEXT_COLOR, default = 17 # Sets the mp text color with mp crisis as MP_CRISIS_TEXT_COLOR MP_CRISIS_TEXT_COLOR = 17 # (v1.01a+)MP_TEXT_COLOR, default = 16 # Sets the mp text color as MP_TEXT_COLOR MP_TEXT_COLOR = 0 # (v1.01a+)MP_TEXT_X_OFFSET, MP_TEXT_Y_OFFSET, default = 0, 0 # Sets the x and y offsets of the mp text relative to the mp bar MP_TEXT_X_OFFSET = 0 MP_TEXT_Y_OFFSET = 0 #------------------------------------------------------------------------------| # * TP Bars | #------------------------------------------------------------------------------| # SHOW_ENEMY_TP_GAUGE, default = true # Show the enemy tp gauge if SHOW_ENEMY_TP_GAUGE is true SHOW_ENEMY_TP_GAUGE = true # ANIMATE_TP_GAUGE, default = true # Animate the enemy mp gauge if ANIMATE_TP_GAUGE is true ANIMATE_TP_GAUGE = true # TP_DEFEAT_ENEMIES_FIRST, default = false # Show the enemy tp gauge only if it's been defeated before TP_DEFEAT_ENEMIES_FIRST = false # ENEMY_TP_GAUGE_WIDTH, ENEMY_TP_GAUGE_HEIGHT, default = 80, 20 # Sets the enemy tp gauge width and height as ENEMY_TP_GAUGE_WIDTH and # ENEMY_TP_GAUGE_HEIGHT respectively ENEMY_TP_GAUGE_WIDTH = 48 ENEMY_TP_GAUGE_HEIGHT = 12 # ENEMY_TP_GAUGE_COLOUR1, ENEMY_TP_GAUGE_COLOUR2, default = 20, 21 # Sets the colour 1 and colour 2 of the enemy tp gauge as # ENEMY_TP_GAUGE_COLOUR1 and ENEMY_TP_GAUGE_COLOUR2 respectively ENEMY_TP_GAUGE_COLOUR1 = 20 ENEMY_TP_GAUGE_COLOUR2 = 21 # ENEMY_TP_BACKGAUGE_COLOUR, default = 15 # Sets the enemy tp back gauge colour as ENEMY_TP_BACK_GAUGE_COLOUR ENEMY_TP_BACKGAUGE_COLOUR = 15 # ENEMY_TP_DISPLAY, default = 2 # Display the enemy's tp in the form of: # Don't display if 0 # Percentage if 1 # Actual number if 2 ENEMY_TP_DISPLAY = 2 # (v1.03a+)TP_PERCENTAGE_DECIMAL_DIGHT_NUMBER, default = 0 # Sets the number of decimal digits when showing tp percentages TP_PERCENTAGE_DECIMAL_DIGHT_NUMBER = 0 # TP_TEXT_SIZE, default = ENEMY_TP_GAUGE_HEIGHT # Sets the size of the text shown on enemy mp bars as TP_TEXT_SIZE TP_TEXT_SIZE = ENEMY_TP_GAUGE_HEIGHT + 4 # (v1.00b+)FIX_LARGE_MP_TEXT, default = false # Fixes issues when MP_TEXT_SIZE is much larger than ENEMY_MP_GAUGE_HEIGHT FIX_LARGE_TP_TEXT = false # (v1.01a+)TP_TEXT_COLOR, default = 16 # Sets the tp text color as TP_TEXT_COLOR TP_TEXT_COLOR = 0 # (v1.01a+)TP_TEXT_X_OFFSET, TP_TEXT_Y_OFFSET, default = 0, 0 # Sets the x and y offsets of the tp text relative to the tp bar TP_TEXT_X_OFFSET = 0 TP_TEXT_Y_OFFSET = 0 #==============================================================================| Video https://www.youtube.com/watch?v=C9NAGpaP230 Features Almost no scripting knowledge is needed to use this script(some is needed to edit it) Instructions Open the script editor and put this script into an open slot between the script Yanfly Engine Ace - Ace Battle Engine and Main. Save to take effect. Compatibility Same as that of Yanfly Engine Ace - Ace Battle Engine FAQ None Changelog v1.03b(GMT 1000 21-5-2023): - Fixed not updating the enemy mp and tp bars when their mp and tp becomes 0 respectively v1.03a(GMT 1000 10-10-2022): - Added MP_PERCENTAGE_DECIMAL_DIGHT_NUMBER and TP_PERCENTAGE_DECIMAL_DIGHT_NUMBER v1.02b(GMT 1000 21-5-2016): - Fixed not updating mp/tp bar fill ratio for mp/tp change on battle start - If mmp is 0, the mp bar will be fully filled to show the mmp is 0 v1.02a(GMT 0200 6-4-2015): - Added MP_CRISIS_TEXT_COLOR v1.01e(GMT 0900 14-2-2014): - Fixed the mp and tp bars of the hidden enemies being shown bug - Further increased efficiency and reduced lag v1.01d(GMT 0400 4-10-2014): - Further increased efficiency and reduced lag v1.01c(GMT 0300 4-9-2014): - Updated compatibility with DoubleX RMVXA Percentage Addon to Yanfly Engine Ace - Battle Engine Add-On: Enemy HP Bars v1.01b(GMT 0500 2-9-2014): - Further increased efficiency and reduced size of this script - Reduced lag induced from v1.00b efficiency upgrade v1.01a(GMT 1700 1-9-2014): - Added mp and tp texts x and y offsets relative to respective bars - Added MP_TEXT_COLOR and TP_TEXT_COLOR v1.00b(GMT 1600 1-9-2014): - Fixed undesirable results when text size > bar height - Increased efficiency and reduced size of this script v1.00a(GMT 0500 29-8-2014): - 1st version of this script finished Download Link Edited May 21 by DoubleX Share this post Link to post Share on other sites
Rudi Sihabudi 31 Posted August 29, 2014 (edited) I got this message when I started my project with this script; I had put below YEA Battle Engine: Edited March 14, 2015 by Turt Share this post Link to post Share on other sites
DoubleX 209 Posted August 30, 2014 I got this message when I start my project with this script (I had put below YEA Battle Engine): It's because the 1st draft of this script requires YEA-EnemyHPBars as well, but later I decided to remove this requirement. I thought it's completely removed but your report tells me otherwise. I've updated my script so now it should work without YEA-EnemyHPBars now. I didn't make a version update for this as I don't think such a change needs it. Anyway thanks for your report Share this post Link to post Share on other sites
Rudi Sihabudi 31 Posted August 30, 2014 (edited) Since I use Sideview Battle System, how to change bars position (so it can be lower): Edit line between 922-932 (update_position)? How? It looks like edit "dy", but I'm not sure Edited October 18, 2014 by Turt Share this post Link to post Share on other sites
DoubleX 209 Posted August 30, 2014 (edited) Since I use Sideview Battle System, how to change bars position (so it can be lower): Edit line between 922-932 (update_position)? How? It looks like edit "dy", but I'm not sure Try: def update_position dx = @battler.screen_x - @start_width / 2 dy = @battler.screen_y self.rect.x = dx self.rect.y = dy dh = self.rect.height + 1 dh += 2 unless @type == :back || @type == :percent dy = [@battler.screen_y, Graphics.height - dh - 120].min dy += 1 unless @type == :back || @type == :percent # Add this line dy += sprite_height # sprite height is the height of the battler's sprite; battler can be accessed by @battler # self.rect.y = dy end # update_position Do this for both mp and tp bars(both Enemy_MP_Gauge_Viewport and Enemy_TP_Gauge_Viewport classes). Edited August 30, 2014 by DoubleX Share this post Link to post Share on other sites
Rudi Sihabudi 31 Posted August 30, 2014 Thanks! Problem solved! Share this post Link to post Share on other sites
DoubleX 209 Posted September 1, 2014 (edited) Updates v1.01d(GMT 0400 4-10-2014): - Further increased efficiency and reduced lag v1.01c(GMT 0300 4-9-2014): - Updated compatibility with DoubleX RMVXA Percentage Addon to Yanfly Engine Ace - Battle Engine Add-On: Enemy HP Bars v1.01b(GMT 0500 2-9-2014): - Further increased efficiency and reduced size of this script - Reduced lag induced from v1.00b efficiency upgrade v1.01a(GMT 1700 1-9-2014): - Added mp and tp texts x and y offsets relative to respective bars - Added MP_TEXT_COLOR and TP_TEXT_COLOR v1.00b(GMT 1600 1-9-2014): - Fixed undesirable results when text size > bar height - Increased efficiency and reduced size of this script Edited October 4, 2014 by DoubleX Share this post Link to post Share on other sites
DoubleX 209 Posted February 14, 2015 Updates v1.01e(GMT 0900 14-2-2014): - Fixed the mp and tp bars of the hidden enemies being shown bug - Further increased efficiency and reduced lag Share this post Link to post Share on other sites
DoubleX 209 Posted April 6, 2015 Updates v1.02a(GMT 0200 6-4-2015): - Added MP_CRISIS_TEXT_COLOR Share this post Link to post Share on other sites
bloodyliao 5 Posted May 19, 2016 It is not compatible with RGSS3 Plane v1.3.5 by FenixFyreX. There's a Compatibility Patch for FenixFyreX's Plane class rewrite and Yanfly Battle Engine Add-On: Enemy HP Bars, can there be a similar Compatibility Patch for Enemy MP/TP Bars Addon? 1 Share this post Link to post Share on other sites
DoubleX 209 Posted May 19, 2016 It is not compatible with RGSS3 Plane v1.3.5 by FenixFyreX. There's a Compatibility Patch for FenixFyreX's Plane class rewrite and Yanfly Battle Engine Add-On: Enemy HP Bars, can there be a similar Compatibility Patch for Enemy MP/TP Bars Addon? I remember that I've seen that patch before, but I think I already forgot how it works and/or where to find it. I only recall that I've spent several days trying to figure out how that FenixFyreX script works, but I still ended up having no idea at all Share this post Link to post Share on other sites
bloodyliao 5 Posted May 21, 2016 I think I've find how to deal with that. Just simply replace all "Plane" to "RGSS3Plane" in these scripts and the bars will appear. But there's another minor problem and I don't think it has any thing to do with the plane script. When I choose to show tp of enemy, at the very beginning of battle, when i use attack command or some skills that point to enemy, the tp bar of that enemy is full like the hp bar! As the skill is executed, with a damage dealt, shorten of hp bar (bright part), the tp bar becomes empty at first and then charge to a certain amount that is due to the damage (enemy charge tp by taking damage). This seems weird. I think the tp bar should be empty at the start, and then change with current value, instead of such a strange way that it is full at first and then become empty and then charge to current value. Is it when the bars are created, they are created as full bars, and they update only when the value changes? Is it possible to update once at the start of battle for tp bars? Since I'm using TP manager, different monsters may have different initial tp values when the battle starts, so hopefully tp bars should update and show correct values at the very start, instead of a full one. 1 Share this post Link to post Share on other sites
DoubleX 209 Posted May 21, 2016 Updates v1.02b(GMT 1000 21-5-2016): - Fixed not updating mp/tp bar fill ratio for mp/tp change on battle start - If mmp is 0, the mp bar will be fully filled to show the mmp is 0 I think I've find how to deal with that. Just simply replace all "Plane" to "RGSS3Plane" in these scripts and the bars will appear. As I failed to find any way to detect the existence of RGSS3 Plane v1.3.5 by FenixFyreX, according to your solution, I'd propose this change: Search this line in this script: @sprite = Plane.new(self) And replace that line with this: @sprite = RGSS3Plane.new(self) Share this post Link to post Share on other sites
bloodyliao 5 Posted May 21, 2016 It shows " undefined method 'mpequals_mp_tp_addon' for #<Game_Actor:0xf72306c> " as I put the new script into my game... 1 Share this post Link to post Share on other sites
DoubleX 209 Posted May 21, 2016 It shows " undefined method 'mpequals_mp_tp_addon' for #<Game_Actor:0xf72306c> " as I put the new script into my game... That's because of an extremely silly typo lol Now it should be fixed, so you may want to download the script again Share this post Link to post Share on other sites
DoubleX 209 Posted October 10, 2022 Updates v1.03a(GMT 1000 10-10-2022): - Added MP_PERCENTAGE_DECIMAL_DIGHT_NUMBER and TP_PERCENTAGE_DECIMAL_DIGHT_NUMBER Share this post Link to post Share on other sites
DoubleX 209 Posted May 21 Updates v1.03b(GMT 1000 21-5-2023): - Fixed not updating the enemy mp and tp bars when their mp and tp becomes 0 respectively Share this post Link to post Share on other sites