Main Menu

Menu Script(Not a request that i was too lazy to look for. its new.)

Started by LiLTreLL1217, October 11, 2006, 08:57:50 PM

0 Members and 1 Guest are viewing this topic.

LiLTreLL1217

Does anyone know how to add another option in the menu.
For instance:
*items
*skills
*equip
*save
"*maps*

you know something like that. In my case it will be abilities instead of maps. Can anyone help me?

Owner of ChaosDreamz© Productions.
Progress of:
Silent Dynasty©-Death Nightmare       
Storyline:  |||||||||| [62%]
Mapping:    |||||||||| [3%]
Scripting:  |||||||||| [1%]
Database:   |||||||||| [1%]
Audio:      |||||||||| [1%]
Overall:    ||||||||||[3%]
Demo:    ||||||||||[75%]

Shinami

Are you using a standard, unmodified Scene_Menu script? If you are, then this is what you'll do.

Find this little bit of text near the very first part of Scene_Menu.

s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])


s1, s2, s3 ect. are local variables used inside an array. These make up the commands in the menu. To add to the command, you would type this beneath s6 = "End Game".
s7 = "insert command"

Then you'd go to the piece of code right beneath it. @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
I'll break down what this does. @command_window is a public instance variable that can be used through out the entirety of a class. Window_Command.new is a class being activated by the .new and (160, [s1, s2, s3, s4, s5, s6]) are the arguments passed along to Window_Command.

So if you wanted to add a command to the window, you'd do this.

s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    s7 = "Insert command here"    #the new command you want to add is now stored in a local variable
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])#if you don't add the new variable you made, the command won't show up


That last snippet of code is what you do just to get your command to show up. Getting the command to work requires a bit more effort. This is where things get really tricky, depending on what you want to do. Once I know what you want the command to do, I can explain the rest to you.