Status
Not open for further replies.

RPGM12321

Villager
Member
Joined
Feb 23, 2021
Messages
15
Reaction score
1
First Language
Eng
Primarily Uses
RMXP
Hi fellow RPG'ers!

I was wondering if it was possible to have the game menu show certain aspects as the game goes on.

E.g.

At the start, when you press ESC is shows the default Item, Skill, Equip etc. I want it to only show Item.

As the game goes on, you can unlock Skill, Equip etc.

Apologies if this is script and I have put it in the wrong area!

TIA!
 

RPGM12321

Villager
Member
Joined
Feb 23, 2021
Messages
15
Reaction score
1
First Language
Eng
Primarily Uses
RMXP
So I played around a bit and found if I change line 26 on the Scene_Menu script to:

@command_window = Window_Command.new(160, [s1])

It only shows the Items option. However, still struggling to find a way to add the 2nd and 3rd option etc after certain events (such as speaking to an NPC who teaches you about Skills will allow you to see Skills under Items).

Not sure if amending line 26 is even the best way to go about this.
 

RPGM12321

Villager
Member
Joined
Feb 23, 2021
Messages
15
Reaction score
1
First Language
Eng
Primarily Uses
RMXP
I figured this out through a bit of trial and error.

What needs to be done is a parallel event to disable the menu. Then, create a new script (a copy of Scene_Menu) which shows line 26 amended as my above post.

Then to create an event with conditional branching of 'if button B is pressed' and an event script of $scene = Scene_Menu1.new(0).

This shows a new menu but with only Items.

To make it that when you come out of Items, you go back to this new menu (of showing items only) and not the default menu, you need to create a new script again (a copy of Scene_Item) and then change line 28 to $scene = Scene_Item1.new (in the new menu script).

Line 71 of this new Item menu should also read $scene = Scene_Menu1.new(0)

Make sure that line 7 on both of these new scripts show the class as whatever you names in (in my case it is Scene_Menu1.

I have just been playing around for days now and not that clued up on scripting, so I am not sure if the (0) is needed, but it works for me! Hopefully someone can shed some light on this or even better my method!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,908
Reaction score
14,546
First Language
English
Primarily Uses
RMMV
[dpost]@RPGM12321[/dpost]

You have 3 posts in less than 48 hours.

[move]RGSS Script Requests[/move]
 

orochi2k

The Mad King of Neolithic
Veteran
Joined
Jan 2, 2021
Messages
82
Reaction score
91
First Language
Chinese
Primarily Uses
RMXP
When you make the selection list.
Do this
@list = [] @list.push $data_system.words.item if some condition it can be a global variable or something you throw in. @list.push $data_system.words.skill @list.push $data_system.words.equip end ..... @command_window = Window_Command.new(160, @list)

Instead of @command_window = Window_Command.new(160, [s1,s2....] )

When you check against which item is selected.
Rather than check against the index.
But, let's find out what exactly the index is

case @list[@command_window.index] when $data_system.words.item $game_system.se_play($data_system.decision_se) @command_window.active = false @command_window3.visible = true @command_window3.active = true .......

You will no longer need to make 2 scenes.
It also applies to anywhere you want to use the Window_Command.
Thus, it will be even better to make a function inside Window_Command to let it tell you what item is exactly selected. You want a string, not an index. So that you can be flexible to organize the items getting rid of the pre-destined fate of those indexes...
 

RPGM12321

Villager
Member
Joined
Feb 23, 2021
Messages
15
Reaction score
1
First Language
Eng
Primarily Uses
RMXP
Hi

I'm a little bit confused here.

So I have changed the script to show the list with the push data lines which seems to work, however if I set it to be only showing Items as default in the menu (as follows)

@list = []
@list.push $data_system.words.item
@command_window = Window_Command.new(160, @list)

how do I then create an event to show the menu as Item and Skill

@list = []
@list.push $data_system.words.item
@list.push $data_system.words.skill
@command_window = Window_Command.new(160, @list)

TIA
 

orochi2k

The Mad King of Neolithic
Veteran
Joined
Jan 2, 2021
Messages
82
Reaction score
91
First Language
Chinese
Primarily Uses
RMXP
There are many ways.
One of the most direct ways is using a global variable to control. (More advanced tips will ask you to just send parameters to the class. But, let's do it one step at a time)

Here is an example.
You can do
$game_variables[1] = 1 #this means game variable No.1 is set to one $scene = Scene_Menu.new

In the code of Scene_Menu.
You can decide which items to show base on $game_variables[1]
For example.
@list = [] @list.push $data_system.words.item if $game_variables[1] == 1 @list.push $data_system.words.skill end @command_window = Window_Command.new(160, @list)

Now, if you want to show "skill" as an option in the window.
You may use the following code
$game_variables[1] = 1 $scene = Scene_Menu.new
If you don't want skill to appear in the window
You may use the following code
$game_variables[1] = 0 $scene = Scene_Menu.new

As global variables are global, you do not need to worry about the namespace right now.
But, you may need to consider using that certain variable only to serve this one purpose just to avoid any conflicts.

A much much darker magic trick is to make a global $list instead of a local @list.
So that you can customize the entire list outside Scene_Menu before calling
$scene = Scene_Menu.new
It's very powerful but chaotically dangerous if you can't control its power. :kaoswt2:
 
Last edited:

RPGM12321

Villager
Member
Joined
Feb 23, 2021
Messages
15
Reaction score
1
First Language
Eng
Primarily Uses
RMXP
Perfect, I understand now and it works!

Thank you so much! :)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,908
Reaction score
14,546
First Language
English
Primarily Uses
RMMV
[closed].[/closed]
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Updated the dev logs for the game I'm working on! Check it out here
Alright, I left the modern girl in fantasy brain's hands while I get my - MODERN GIRL WHAT HAPPENED?! I blame fantasy brain for this.

WinaElemental.png
I just realized that, while I was waiting for our little Easter Game to be approved in the Completed Games Thread, the game was already listed for more than a week, without me noticing x.x

So ... very delayed happy easter to everyone I guess? : D
WIP
[IMG width="280px"]https://images.plurk.com/3t2Xc52pKS7ptwWCFMrSen.png[/IMG]

Forum statistics

Threads
110,561
Messages
1,054,262
Members
143,673
Latest member
hesena
Top