Drawing actor parameters values

Hey all,

I'm redoing my equipment scene, and I don't like the way the system draws the parameters. I'm trying to change it to my own, with direct control of where things are place. However, I'm finding it unusually difficult to display a character's respective stat value. This is what I'm currently using:

draw_number(x, y - 4 + 22*0, 100, @actor.mhp, 4, 0, Color.new(255,255,255,100))Draw_Number is nothing but a customized way to draw text (typically, as you may assume, numbers). The important part is "@actor.mhp". I'm getting an error (undefined method 'mhp' for nil:NilClass). I'm still very much a coding newbie, but I still do not know what's going wrong exactly. Draw_Number and the new parameter function is defined in Window_Base and the actuall call is done in the Window_EquipStatus during Scene_Equip. Would anybody be able to point me in the right direction?

Any help is appreciated.

The function I'm using it for:

Spoiler
Window_Base def draw_current_param_rello(x, y) change_color(normal_color) self.contents.font.size = 20 draw_number(x, y - 4 + 22*0, 100, @actor.mhp, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*1, 100, @actor.mmp, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*2, 100, @actor.atk, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*3, 100, @actor.def, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*4, 100, @actor.mat, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*5, 100, @actor.mdf, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*6, 100, @actor.agi, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*7, 100, @actor.luk, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*8, 100, @actor.hit, 4, 0, Color.new(255,255,255,100)) #draw_number(x, y - 4 + 22*9, 100, @actor.eva, 4, 0, Color.new(255,255,255,100)) reset_font_settings end
Window_EquipStatusWhere it's being called:

Spoiler
Code:
  def draw_item(dx, dy, param_id)    #draw_background_colour(dx, dy)    #draw_param_name(dx + 4, dy, param_id)    #draw_current_param(dx, dy, param_id) if @actor    drx = (contents.width + 22) / 2 + 18    #draw_new_param(drx + 22, dy, param_id) if @temp_actor    #reset_font_settings    draw_param_name_rello(dx + 4, dy + 4)    draw_current_param_rello(dx, dy)  end
sounds like you haven't defined @actor yet. Would have to see more of your code
Would it be better for me to PM you or for me to just post it on here?

Edit: I but the script on there. It probably should've been there in the first place.

Edit: I added

@actor = $game_party.menu_actorto the def and it seems to be working okay now.

This is solved. Thread can be closed. :]

Original thread: https://forums.rpgmakerweb.com/threads/drawing-actor-parameters-values.27345/