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.

Making a variable appear in via edited scripting (SOLVED)

Ok I have a custom menu script but I cant for the life of me figure out how to make a variable appear when I open the menu up.  I tried putting in the usual /v[xxxx] as if you were doing it in the game dialog editor but it doesnt work.  Here is a little sample of what I mean:

    self.contents.draw_text(4, 32, 120, 32, text, 2)
    self.contents.draw_text(4,64,140,32,"Sub-Quests : ")
    self.contents.draw_text(4,64,140,32,"Main Quests: ")
    self.contents.draw_text(4,64,140,32,"Game Tokens: ")

After Sub-Quests, Main Quests and Game Tokens a variable needs to be there but I cant get it.  Please help!
 

Haki

Member

Try this:
Code:
    self.contents.draw_text(4, 32, 120, 32, text, 2)
    self.contents.draw_text(4,64,140,32,"Sub-Quests : " + $game_variables[1].to_s)
    self.contents.draw_text(4,64,140,32,"Main Quests: " + $game_variables[2].to_s)
    self.contents.draw_text(4,64,140,32,"Game Tokens: " + $game_variables[3].to_s)
I haven't tested it, but it should work.
 
Ok one last thing... how would I go about making the font size smaller so that it fits in the window properly?  I know if has to do with $fontsize=## right?  But I have no clue where to put it or anything lol.  BTW it did work thank you!
 

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