The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: djkdjl on October 10, 2007, 04:35:59 AM

Title: [RESOLVED]Window_MenuStatus Displaying a game_variable
Post by: djkdjl on October 10, 2007, 04:35:59 AM
Hi everyone,,PLEASE help me out!

I have an in-game-variable #139 that counts the total amount of experience gained by the hero.  How can I display what's stored in game_variable[139] in the Window_MenuStatus.

Here is the refresh method for Window_MenuStatus:
----------------------------------------------
def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors['i'] <---- this 'i' isn't in quotes,,I added quotes because html code thinks I am declaring an italics font
      draw_actor_graphic(actor, x - 40, y + 80)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x, y + 64)  <--- this line I want to get rid of and replace it with a line that displays the contents stored in game_variable[139] roughly at the same x, y position.
      draw_actor_hp(actor, x + 236, y + 32)
      draw_actor_sp(actor, x + 236, y + 64)
    end
  end
----------------------------------------------

Thx in advance
Title: Re: [HELP]Window_MenuStatus Displaying a game_variable
Post by: modern algebra on October 10, 2007, 10:53:05 AM
    self.contents.font.color = system_color
    self.contents.draw_text(x, y+64, 24, 32, "E")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 24, y+64, 84, 32, $game_variables[139].to_s, 2)
    self.contents.draw_text(x + 108, y+64, 12, 32, "/", 1)
    self.contents.draw_text(x + 120, y+64, 84, 32, actor.next_exp_s)
Title: Re: [RESOLVED]Window_MenuStatus Displaying a game_variable
Post by: djkdjl on October 10, 2007, 03:09:40 PM
Woohoo,,it works,,thx modern
Title: Re: [RESOLVED]Window_MenuStatus Displaying a game_variable
Post by: Kokowam on October 10, 2007, 07:26:24 PM
Go check out the syntax books at CreationAsylum when you need to find stuff like that. I think they have that there.
Title: Re: [RESOLVED]Window_MenuStatus Displaying a game_variable
Post by: djkdjl on October 10, 2007, 07:30:36 PM
I figured modern will bail me out faster on this one,,and he has  ;D
Title: Re: [RESOLVED]Window_MenuStatus Displaying a game_variable
Post by: Kokowam on October 10, 2007, 07:31:41 PM
Lol. I'm just saying for future reference (syntax ones, in fact) when you need them. CA has a great variety of things on syntax.
Title: Re: [RESOLVED]Window_MenuStatus Displaying a game_variable
Post by: modern algebra on October 10, 2007, 08:09:33 PM
I find looking at the help file more to the point, or if you know enough, even to look at the class you are trying to use. I find it atrociously annoying to sift through hundreds of syntax codes when it can be more to the point to just investigate the class you are looking at.