Question about L's 1-Person Menu
#1
One of games I'm working on uses the 1 Person Menu found here. (The one without SDK)
It includes the ability to show a Variable that I haven't used yet, but I would like to.
Problem is: I don't know how.
Code:
#Draw Variable
    self.contents.font.color = system_color
    self.contents.draw_text(412,0,120,32,'Variable Name')
    self.contents.font.color = normal_color
    self.contents.draw_text(540,0,120,32,'Variable')
  end
That's the Codesnipet for it and as far as I can tell that's all.
I can name the Variable just fine, but I can't figgure out how to actually show a certain Variable in that spot.
Again I wish I'd have a better understanding of scripting but since that's not the case I'll hope that one of you, who is more knowledgable then I am is willing to help me.
It may not be something really importand, but it's still d tad annoying to know that the possibility is there and you're just unable to figgure it out.
Thanks in advance.
Reply }
#2
The Game_Variables class is the class that holds your variables, much like Game_Switches is for the switches...

print $game_variables[3]
Would print the value of the 3rd variable (0003).

So I guess...
Code:
self.contents.draw_text(540,0,120,32,$game_variables[var_id])
Where you know the variable id (var_id)
Reply }
#3
I tryed it and I get an error when I try to open the menu.

Script '1-Person Menu' line 144: TypeError occured.
cannot convert Fixnum into String
Reply }
#4
DOH!

Sorry. I forgot to add the .to_s suffix:

Code:
self.contents.draw_text(540,0,120,32,$game_variables[var_id].to_s)
Reply }
#5
Winking with a tongue sticking out Things like that happen to the best of us.

It's working now, thanky you very much ^-^



Edit:
Actually...looking at other parts of the script now with the new knowledge as to how it worked, I might would have been able to figgure it out myself after all...but then again, I didn't know how it worked befor XD
But I think I'm a step closer to understanding how to configure scripts now =D (It's always nice to have the feeling that you understood something that you couldn't understand befor ^^)
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 3 111 Yesterday, 07:02 PM
Last Post: JayRay
   Question about ACBS (Atoa Custom Battle System) aeliath 10 12,782 08-08-2019, 02:50 PM
Last Post: aeliath
   Need help with my menu - Current issue is item grid layout LilyFrog 41 39,475 09-24-2018, 02:03 AM
Last Post: LilyFrog
   Special Items Separate Menu Diorm 41 42,501 02-10-2018, 06:06 PM
Last Post: Diorm
Question  Mog Menu script: help me stop the crazy picture movement during transitions Zachariad 4 9,871 05-31-2017, 05:10 AM
Last Post: Zachariad
   XAIL MENU from RPG VX ACE to RPG XP RASHIDA12 46 52,326 05-02-2016, 08:08 PM
Last Post: RASHIDA12
Tongue  Healing Spell doesn't work right in Menu? Bounty Hunter Lani 8 12,509 01-15-2015, 07:45 PM
Last Post: Bounty Hunter Lani
   My Options Menu needs help firestalker 0 3,292 08-11-2014, 02:31 PM
Last Post: firestalker
   Vx Ace Custom Menu help? Skitzen 1 5,417 10-07-2013, 03:10 PM
Last Post: JayRay
   Dargor's Large Party script and shop menu Simon Greedwell 2 6,593 08-28-2013, 10:12 PM
Last Post: Simon Greedwell



Users browsing this thread: 1 Guest(s)