Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed
Ok so a bit of background: I am fairly new at this, I mean a day at most. And I am messing with a menu script trying to make so that it only shows, item, load, close game, and that's it. Well to show the player and his HP only with a little quote.
I was getting close to that but I hit a brick wall. I can't get load to work, I thought I had written it well enough, but It seems not. when I try to run the game and open the menu it says there is a problem (screenshot below) Thing is I don't know how to fix it. So if one of you kind souls could point it oiut and help me out here.
Error image.
script:
CODE
#=============================================================================== # # DT's One Person Menu # Author: DoctorTodd # Date (02/19/2012) # Type: (Menu) # Version: (1.0.0) (VXA) # Level: (Simple) # Email: BeaconGames2011@gmail.com # #=============================================================================== # # NOTES: 1)This script will only work with ace, you may find my VX version on # RMRK.net and the rpg maker web forums. # #=============================================================================== # # Description: A menu that is modified to work as if you are only using one # actor. # # Credits: Me (DoctorTodd) # #=============================================================================== # # Instructions # Paste above main. # #=============================================================================== # # Contact me for commercial use, other wise just credit me and don't repost # without my permission. # #=============================================================================== # # Editing begins 40 and ends on 59. # #=============================================================================== module DTOPM
#Window skin to use, place in system. WINDOW = ('Window')
class Window_MenuInfo < Window_Base #-------------------------------------------------------------------------- # * Object Initialization # x : window X coordinate # y : window Y coordinate #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 300, 221) refresh end
class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * Initialize Command Selection Position (Class Method) #-------------------------------------------------------------------------- def self.init_command_position @@last_command_symbol = nil end #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0) select_last end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Get Number of Lines to Show #-------------------------------------------------------------------------- def visible_line_number item_max end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list add_main_commands add_original_commands add_save_command add_load_command add_game_end_command end #-------------------------------------------------------------------------- # * Add Main Commands to List #-------------------------------------------------------------------------- def add_main_commands add_command(Vocab::item, :item, main_commands_enabled) #add_command(Vocab::skill, :skill, main_commands_enabled) #add_command(Vocab::equip, :equip, main_commands_enabled) #add_command(Vocab::status, :status, main_commands_enabled) end #-------------------------------------------------------------------------- # * For Adding Original Commands #-------------------------------------------------------------------------- def add_original_commands end #-------------------------------------------------------------------------- # * Add Save to Command List #-------------------------------------------------------------------------- def add_save_command add_command(Vocab::save, :save, save_enabled) end #-------------------------------------------------------------------------- # * Add Load to Command List #-------------------------------------------------------------------------- def add_load_command add_command(Vocab::load, :load, load_enabled) end #-------------------------------------------------------------------------- # * Add Exit Game to Command List #-------------------------------------------------------------------------- def add_game_end_command add_command(Vocab::game_end, :game_end) end #-------------------------------------------------------------------------- # * Get Activation State of Main Commands #-------------------------------------------------------------------------- def main_commands_enabled $game_party.exists end #-------------------------------------------------------------------------- # * Get Activation State of Formation #-------------------------------------------------------------------------- def formation_enabled $game_party.members.size >= 2 && !$game_system.formation_disabled end #-------------------------------------------------------------------------- # * Get Activation State of Save #-------------------------------------------------------------------------- def save_enabled !$game_system.save_disabled end #-------------------------------------------------------------------------- # * Get Activation State of Load #-------------------------------------------------------------------------- def load_enabled !$game_system.load_disabled end #-------------------------------------------------------------------------- # * Processing When OK Button Is Pressed #-------------------------------------------------------------------------- def process_ok @@last_command_symbol = current_symbol super end #-------------------------------------------------------------------------- # * Restore Previous Selection Position #-------------------------------------------------------------------------- def select_last select_symbol(@@last_command_symbol) end end
__________________________
A journey of a thousand steps must still start with a single one.
Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120
From what I've gathered, it looks like the editor recognizes Vocab::load as a method and not as a constant... If you modify line 255, replacing Vocab::load with a string (i.e. "Load"), is the error still present?
Anyway, I checked it. The Vocab module isn't provided with the load member. You can't use that method, you just have to replace Vocab::load with a proper string and you're done
I hope this can help,
Jens
__________________________
"Thorns are the rose's sweetest essence..." -Jens of Zanicuud
Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed
You mean change this:
#-------------------------------------------------------------------------- # * Add Load to Command List #-------------------------------------------------------------------------- def add_load_command add_command(Vocab::load, :load, load_enabled) end
If you what do I change in the Vocab::load I don't know what the proper string is...Actually to be honest i don't know what a string is.
__________________________
A journey of a thousand steps must still start with a single one.
Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120
I mean Vocab::load doesn't exist and this make RMVXA going nuts!
Try replacing what you wrote with this:
CODE
#-------------------------------------------------------------------------- # * Add Load to Command List #-------------------------------------------------------------------------- def add_load_command add_command("Load", :load, load_enabled) end
replacing "Load" with the word you want to display when the load function is called. I hope this can help
Jens
P.S. A string is a variable kind present in most of the programming language. It's a sort of collection of letters, and it's commonly used to save and display words, numbers or statements. In Ruby, strings are denoted by "" (opening and closing quotes).
__________________________
"Thorns are the rose's sweetest essence..." -Jens of Zanicuud
Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed
Thank you, I had to tweak it a little more but it worked. It can be changed to resolved. If it is not much to ask were should I pose questions about making custom background for the menus and that stuff?
This post has been edited by JoshuaWalden: Feb 9 2013, 08:59 AM
__________________________
A journey of a thousand steps must still start with a single one.
Group: Local Mod
Posts: 904
Type: Scripter
RM Skill: Skilled
Rev Points: 120
QUOTE (JoshuaWalden @ Feb 9 2013, 05:57 PM)
Thank you, I had to tweak it a little more but it worked. It can be changed to resolved. If it is not much to ask were should I pose questions about making custom background for the menus and that stuff?
Custom background resources or custom background addon via script? I mean, if you need a script which adds a custom background to the Menu (or related questions), you can keep on posting here If you need a full script or a certain custom graphics, you need at least 100 posts to request that.
Anyway, you are free to ask for further information
Jens
__________________________
"Thorns are the rose's sweetest essence..." -Jens of Zanicuud