Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Creating a "submenu" within the command window

ikos

Member

Alright, this may be a little weird, but in the command window, I would like a smaller window to popup when I select a certain command.
Such as;

Item
Skill
Equip
Status
SYSTEM
  [Save]
  [Load]
  [Exit]
 
Within the main method of the scene, create an extra command window with those commands, and make it invisible and inactive like so
Code:
@command_window2 = Window_Command.new(160,['Save','Load','Exit'])
@command_window2.x = your x position
@command_window2.y = your y position
@command_window2.visible = false
@comand_window2.active = false

You can also just have a method call in the main with the method defined as above, to make the code look neater i.e.
Code:
make_command_window_2

Then, in the update method of the scene, there'll be a clause saying something like
Code:
if Input.trigger?(Input::C)
  case @command_window.index
  when x
    do stuff
  when y
    do more stuff
  when z
    do other stuff
etc...
For the correct index of the command menu, just write the code
Code:
when index
  @command_window2.active = true
  @command_window2.visible = true
  @command_window.active = false
  @command_window.index = -1

That would pretty much achieve it. From there you can just use the regular methods and such to ensure stuff happens in the sub-menu. If you need more help, feel free to ask
 

e

Sponsor

Remember guys and gals, lads and lasses, this is the support forum; we help out, but we don't script for you. Well, anyway, we're not supposed to.

If you're requesting help to get you started, I'll do so; if it's a script request (i.e.: you want someone else to do it), then this needs to be posted in the Script Request forum.
 

ikos

Member

etheon":sebck3zj said:
Remember guys and gals, lads and lasses, this is the support forum; we help out, but we don't script for you. Well, anyway, we're not supposed to.

If you're requesting help to get you started, I'll do so; if it's a script request (i.e.: you want someone else to do it), then this needs to be posted in the Script Request forum.

Oh, sorry, mate.
I just figured since I wasn't asking for the exact script but more like how I'd get started; it would go here.
 
I thought this was a good way to start him off ;P
I'm sure you can handle it from here, if you know how to use command windows etc. That's a pretty good basis you can easily use.
 

e

Sponsor

ikos":2uvy1542 said:
etheon":2uvy1542 said:
Remember guys and gals, lads and lasses, this is the support forum; we help out, but we don't script for you. Well, anyway, we're not supposed to.

If you're requesting help to get you started, I'll do so; if it's a script request (i.e.: you want someone else to do it), then this needs to be posted in the Script Request forum.

Oh, sorry, mate.
I just figured since I wasn't asking for the exact script but more like how I'd get started; it would go here.

No need to be sorry, you posted in the right place. It's just sometimes it's hard to discern between both.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top