The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: darthatron on February 07, 2007, 12:44:06 AM

Title: Fixnum into String
Post by: darthatron on February 07, 2007, 12:44:06 AM
Hey guys, I just wanted to know if there was a way to show a variable in a hud through Script...?

    self.contents.draw_text(384, 16, 120, 32, $game_variables[0012])

That code doesn't work, so help would be very good. :)
Title: Re: Fixnum into String
Post by: Blizzard on February 07, 2007, 10:03:38 AM
2 mistakes. It should be

    self.contents.draw_text(384, 16, 120, 32, $game_variables[12].to_s)

.to_s converts values into strings.
And leading zeroes can cause bugs.
Title: Re: Fixnum into String
Post by: darthatron on February 07, 2007, 11:37:07 AM
Thnaks for that, works great! :)