Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

I need a variable related window

Hi,
In my game, I'm using a system not unlike the Legend of Dragoon 'stardust' side-quest, It all works with variables, but I have need of a tiny piece of script to put in the menu to display the variable.

I would like it, if possible to be in the place of the 'Steps taken' window.

I have tried a little bit of it, But I have no idea how to make it display a variable.

Code:
#==============================================================================
# ** Window_Signet
#------------------------------------------------------------------------------
#  This window displays signet count on the menu screen.
#==============================================================================

class Window_Signet < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Signets")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 120, 32, $game_variable = 0007)
  end
end

But all it looks like is:
Signets:   <-title of window
Signet     <- Name of the variable

I want to know how to make it display the value of the variable, but I only get errors

   
Code:
self.contents.draw_text(4, 32, 120, 32, $game_variable = 0001)
this is the line which should display the value of the variable.

I know it'll be simple for you guys so I have no worries that you wont be able to do it  :smile:
Thanks
 

Zeriab

Sponsor

That's due to a small typo from FireRaven's side between $game_variable and $game_variables. Try this instead:
Code:
self.contents.draw_text(4, 32, 120, 32, $game_variables[7].to_s)

*hugs*
- Zeriab
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top