RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Is it possible?...

Started by J-Crew, October 31, 2006, 01:16:39 AM

0 Members and 1 Guest are viewing this topic.

J-Crew

 ??? I was wondering if you could incorperate in-game variables into windows. For example: You want the number that variable #1 equals in a common pop up window. Would you use anything other than the draw_text method? When I tried that, it said it could not convert fixnum to string. Please help. Thanks! ???

Blizzard

You can use $game_variables[X] where X is the ID to refer to variables. And you need to use following syntax for the draw_text:

self.contents.draw_text(x, y, w, h, string, align)
(but you know that already.)

You should also be careful with strings. Numbers are not strings until you "convert" them to such with .to_s

For example:

num = 5
self.contents.draw_text(0, 0, 320, 32, 3.to_s + " - 1 is " + num.to_s)


You will get as output

Quote3 - 1 is 5

But using

num = 5
self.contents.draw_text(0, 0, 320, 32, 2 + " - 1 is " + num)


will result in the same typeerror you just got.
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

J-Crew

You my friend ... are the best! I can't thank you enough for the help.