RPGMXP: Enemy Stat blocks for battle debugging

● ARCHIVED · READ-ONLY
Started by Tiamat5774 2 posts View original ↗
  1. I need help with editing (altering) this script The original script showed the enemy's hp, but I've got it to show other stats. I'm trying to event a level up system for the enemies and I need something visual DURING the battles to see if my events are working. I know there are monster adaption/difficulty/level up scripts out there, but they don't work the way I want them to. Should be able to create an event that will do the same thing. I just need to see the event's workings in detail as I test play.

    this script works with the scripts I have, as is. However, I'm requesting help in modifying the script to do what I need or for some one with more know-how to modify it for me.

    Spoiler
    class Window_EnemyHP < Window_Base def initialize super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 @old_enemy = [] refresh end def refresh self.contents.clear for i in 0...$game_troop.enemies.size @enemy = $game_troop.enemies @old_enemy = @enemy.clone unless @enemy.hp == 0 self.contents.font.size = 15 self.contents.font.bold = true self.contents.font.color = Color.new(0,0,0) self.contents.font.color = normal_color self.contents.draw_text(0, i * 45 + 37, 100, 32, @enemy.name) draw_actor_hp(@enemy, 0, i*45 + 50) draw_actor_sp(@enemy, 80, i*45 + 50) draw_actor_parameter(@enemy, 160, i*45 + 50, 0) draw_actor_parameter(@enemy, 240, i*45 + 50, 1) end end end def update for i in 0...$game_troop.enemies.size enemy = $game_troop.enemies if enemy.hp != @old_enemy.hp || enemy.sp != @old_enemy.sp || enemy.atk != @old_enemy.atk || enemy.pdef != @old_enemy.pdef || enemy.mdef != @old_enemy.mdef || enemy.str != @old_enemy.str || enemy.dex != @old_enemy.dex || enemy.int != @old_enemy.int || enemy.agi != @old_enemy.agi refresh end end endend
    The problem I'm having now is coordinates (placement and spacing of the information). So far all I understand is that y is vertical and x is horizontal. The numbers are to what degree they are spaced on the 2 axis. No matter how I fiddle with the coordinates of the stats , it winds up like this:

    Hell hound

    HP 888/888 SP 888/888 ATK 100 PDEF 100 (with about 10 to 20 spaces between stat name and value. really spaced out)

    I'm also wondering why there are so many spaces between the stat name and the value.

    example: ATK <- about 10-20 spaces -> 100

    Basically, all the way across the screen, and with some coordinate changes, the stat names and the values would overlap. What I'm trying to accomplish is something like this:

    Hell hound

    HP 888/888 SP 888/888

    ATK 100 PDEF 100

    something to that effect, anyway
  2. If you've been fiddling with things then you probably already know the key lines are:

    draw_actor_hp(@enemy, 0, i*45 + 50)
    draw_actor_sp(@enemy, 80, i*45 + 50)
    draw_actor_parameter(@enemy, 160, i*45 + 50, 0

    draw_actor_parameter(@enemy, 240, i*45 + 50, 1)

    so in each of these, the setup is similar. They take an enemy, an x-coordinate, and a y-coordinate in that order. The draw_actor_parameter method takes an additional value that denotes which parameter to draw with 0 meaning ATK and 1 meaning PDEF. So because all of their y-values are the same, they will all draw on the same line. So try changing the third value of the draw_actor_parameter methods from "i*45+50" to "i*45+75" and see how that changes things. If it's too much or too little just change it again until you find a value that works for you. Now that will cause those lines to move down, but they'll still be spaced out to the left. So change their second parameter from 160 & 240 respectively to - say - 0 & 80 like above. That should mostly align ATK with HP and PDEF with SP. 

    This is a very simplistic approach and may require a lot of trial and error, but it should get the job done. As for the spacing problem, basically these methods are all defined somewhere else. That location is Window_Base in the script editor, and it controls the spacing. To keep it short, we can redefine the methods and reduce the spacing but that's going to be a little bit more work, so try my above suggestions first and see where that gets you.