Where can I find a list of Game_Command methods, as well as the format such must be in?

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
I'm trying to make a custom command show up in the menu, this is what I have so far:

CommandManager.register:)Summons,  :party_menu)

 

class MenuCommand_Summons < Game_Command

end

 

 

class Game_Party < Game_Unit

  

  

  def add_menu_command_Summons(args)

    cmd = CommandLoadGame.new("Summoms", :Summons)

    add_menu_command(cmd)

  end

end

 

As you can see, after "class MenuCommand_Summons < Game_Command", there's no methods yes.

 

Note I would also like to tie the command to a switch, if someone wants to help by dirrectly giving me the script segments to finish that.

 

Also so people don't get confused, I'm using Hime's Command Manager: http://www.himeworks.com/2013/11/08/menu-command-manager/?relatedposts_exclude=425
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
go to the main part of the script, it should be there...


also you load should be


cmd = MenuCommand_Summons.new("Summoms", :Summons)


since that was your custom class...


Though personally, I think you're better off just writing them the normal way, using that script looks more tedious to me...
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
go to the main part of the script, it should be there...

also you load should be

cmd = MenuCommand_Summons.new("Summoms", :Summons)

since that was your custom class...

Though personally, I think you're better off just writing them the normal way, using that script looks more tedious to me...
Ok, I'll check it again(couldn't find it the first time).

Lol whoops yea, you're right, thanks I'll fix that.

edit: So it is, I must've missed it the first time, but I'm having a problem figuring out the format for applying such.

I put it on the next line, indented, like code is usually written out, but a error is returned for undefined user, so yea(kind of expected, I should've saw that coming)how would I write the define user line in this instance?

I can read script, and even edit it as I wish in most cases, but I can't script from scratch to save my life sigh(even simple things like this, I can't seem to get/remember).
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
All default commands are defined in Command Manager in the lower half of the script.

Note I would also like to tie the command to a switch, if someone wants to help by dirrectly giving me the script segments to finish that.
I documented it in the script in the headers but I don't think I explicitly wrote a blog post about it.

There are two methods defined in Game_Command

#----------------------------------------------------------------------------- # Whether the command should be shown #----------------------------------------------------------------------------- def enabled?(user) true end #----------------------------------------------------------------------------- # Whether the command is usable #----------------------------------------------------------------------------- def usable?(user) true endWhich determines whether it's shown or not, and whether it's disabled or not (ie: greyed out, when you try to select, buzzer sound)The reason why your custom command class is empty is because it simply inherits all of the settings from the Game_Command class.

Let's say the command should only be SHOWN when switch 1 is ON.

This is trivial, since you already have your own Summon Command, and you just need to tell it when it should be shown.

Code:
class MenuCommand_Summons < Game_Command  def enabled?(party)    $game_switches[1]  endend
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
I documented it in the script in the headers but I don't think I explicitly wrote a blog post about it.

There are two methods defined in Game_Command

#----------------------------------------------------------------------------- # Whether the command should be shown #----------------------------------------------------------------------------- def enabled?(user) true end #----------------------------------------------------------------------------- # Whether the command is usable #----------------------------------------------------------------------------- def usable?(user) true endWhich determines whether it's shown or not, and whether it's disabled or not (ie: greyed out, when you try to select, buzzer sound)The reason why your custom command class is empty is because it simply inherits all of the settings from the Game_Command class.

Let's say the command should only be SHOWN when switch 1 is ON.

This is trivial, since you already have your own Summon Command, and you just need to tell it when it should be shown.

class MenuCommand_Summons < Game_Command def usable?(party) $game_switches[1] endend
Omg, I'm gonna crawl under a rock, and hide now if you don't mind, thank you(I literally only needed to put def before such lol, not a whole other line of code, defining it lol).

Ok cool, I knew tying it to a switch would be really simple, I just had no idea how to do it(so nomatter how simple it is, I would still be screwed), thanks.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I'm assuming you're using another script that provides the summon scene.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
I'm assuming you're using another script that provides the summon scene.
Not yet, I still need to type out the script for the Summon Scene, that's the next, and last part.

Edit: Here's the finished script, but the command Isn't showing up in my menu(yes I put a event in the game to turn on the switch)


CommandManager.register:)Summons,  :party_menu)

 

class MenuCommand_Summons < Game_Command

  def enabled?(party)

    $game_switches[15]

  end

  

  def usable?(party)

    True

  end

end

 

 

 

class Game_Party < Game_Unit

  

  

  def add_menu_command_Summons(args)

    cmd = CommandSummons.new("Summoms", :Summons)

    add_menu_command(cmd)

  end

end

 

class Scene_Menu < Scene_MenuBase

  

  

  def command_summons

    SceneManager.call($game_temp.reserve_common_event 8)

  end

end

 

After a bunch of minor variations of the above(none returning errors mind you), I can't even get my command to show up on the menu, so I don't even know if the common event proc call will work like that(I think it should)

 

I'm wondering if another script is breaking the command listing or something. For instance maybe Yanfly's System Script, that adds the System Command?

 

Menu SS.png

 

 

 

 
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
your custom class was MenuCommand_Summons, yet you are using CommandSummons.new
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I'm assuming you added it to the list of menu commands in the configuration.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
I'm assuming you added it to the list of menu commands in the configuration.
Yes ofcourse, it just doesn't want to show up though, and I can't figure out why(everything seems to be in check, yet It's not showing up)..
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
It works fine for me. When the switch is off, I don't see it, but when the switch is on, then I see it.


Remove the `enabled?` condition. Maybe there is something wrong there.


You should also show how you set up the command list.


I don't think there should be compatibility issues but that is something you should check in a new project.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
It works fine for me. When the switch is off, I don't see it, but when the switch is on, then I see it.

Remove the `enabled?` condition. Maybe there is something wrong there.

You should also show how you set up the command list.

I don't think there should be compatibility issues but that is something you should check in a new project.
For laughs, and giggles, I tried deleting the whole enabled part, and nope still nothing.

Here's a pic showing that it is indeed in the configuration Command script SS.png

The only cript I'm using that might be causing issues, is Yanfly's systems Script(as it adds the System Command to the menue, and moves the end game command into it as well.

I can try deleting that script, just to see if that fixes it, give me a minute.

Edit: Nope, It's still not showing up. Aside from that script, the only other script I'm using that actually effects the game, is The Yanfly's Engine Sce+It's add on(I tried deleteing that as well, but as suspected, that wasn't the problem).

Every other script I use, are development tool type scripts(your equip event script, your page condition scipt yanfly's message script, and a region coding script)
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Ruby is case-sensitive.


"Hello" and "hello" are not the same thing.


Review your configuration and/or script.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Ruby is case-sensitive.

"Hello" and "hello" are not the same thing.

Review your configuration and/or script.
the configuration list requires all lower case for some reason(even if the word in the list is suppose to have a capital), but I'll check all the others to make sure i'm using capital S's.

No all had capital letters where they needed.

here it is

CommandManager.register:)Summons,  :party_menu)

 

class MenuCommand_Summons < Game_Command

   def enable?(party)

     $game_switches[15]

  end

  

  def usable?(party)

    True

  end

end

 

 

 

class Game_Party < Game_Unit

  

  

  def add_menu_command_summons(args)

    cmd = Command_Summons.new("Summons", :Summons)

    add_menu_command(cmd)

  end

end

 

class Scene_Menu < Scene_MenuBase

  

  

  def command_summons

    SceneManager.call($game_temp.reserve_common_event 8)

  end

end

 

I notice you use a lower case l when typing :load but if I use a lower case S in the same situation, it errors out, while if I use the Upper case S for Summons in that situation, it doesn't errot.

 

I did find a typo though, where it says "Summons"  I had a 3rd m there instead of a n, but even after I fixed that, it still wont work

 

 

 

 

I
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Things don't work because you insist on using uppercase when you're writing your command. If you want to use upper-case you're going to have to read the generic tutorial provided in the Command Manager which explains how to properly name your methods.


Just follow the tutorial as-is and register a lower-case name.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Things don't work because you insist on using uppercase when you're writing your command. If you want to use upper-case you're going to have to read the generic tutorial provided in the Command Manager which explains how to properly name your methods.

Just follow the tutorial as-is and register a lower-case name.
I tried that(exactly how are your examples write each part out), and it errors, but I'll try again.

Edit ok there, iher'es the exact format going by your example blog:

CommandManager.register:)summons,  :party_menu)

 

 

class MenuCommand_Summons < Game_Command

   def enable?(party)

     $game_switches[15]

  end

  

  def usable?(party)

    True

  end

end

 

 

 

class Game_Party < Game_Unit

  

  

  def add_menu_command_summons(args)

    cmd = Command_SummonsGame.new("Summons", :summons)    Note: this is line 20

    add_menu_command(cmd)

  end

end

 

class Scene_Menu < Scene_MenuBase

  

  

  def command_summons

    SceneManager.call($game_temp.reserve_common_event 8)

  end

end

 

This is the error I get:  Line 20: NameError occured

                                     uninitialized constant Game_party:Command_SummonsGame
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I see the problem with the tutorial: there's an inconsistency in the class name. I likely changed it at some point to make it more natural.

Line 20 would look like this

Code:
cmd = MenuCommand_Summons.new("Summons", :summons)
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
I see the problem with the tutorial: there's an inconsistency in the class name. I likely changed it at some point to make it more natural.

Line 20 would look like this

cmd = MenuCommand_Summons.new("Summons", :summons)
Omg I fixed the Game part originally, because I knew that was a mistake, but I over looked the fact the Menu was missing infront of Command_Summons.New, I can't believe I missed that(now you know why I rather event things whenever something could be evented, because even the smallest mistakes will break it if you script it).

Now It's showing up, Bloody hell, thanks :)

Now  I just need to get it to call the common event, I looked up the proc_call for common events, but the script evidently doesn't like how I wrote it:  ($game_temp.reserve_common_event 8) 
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
SceneManager.call requires a scene class passed in. You're going to have to find an appropriate scene for it.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
SceneManager.call requires a scene class passed in. You're going to have to find an appropriate scene for it.
But Isn't the common event in this case, the scene(note: I did try puting Scene_ infront of the common event proc_call, but that didn't work) ?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top