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,867
Reaction score
14,520
First Language
English
Primarily Uses
RMMV

@RPGM12321, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.



You have 3 posts in less than 48 hours.

I've moved this thread to RGSS Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

orochi2k

The Mad King of Neolithic
Veteran
Joined
Jan 2, 2021
Messages
79
Reaction score
81
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
79
Reaction score
81
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,867
Reaction score
14,520
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Jeez...
I finally decide, after several ppl asking me to, to create a gamethread about project M... And my internet craps out on me halfway through the process :(
making my first game is like trying to stuff all my experience with old games into one
so its slow and painful when i dont get it right... i bet the next game is gonna be finished earlier!
When you don't find any time to work... :kaocry:
First Ten Minutes of my Caretaker inspired game

Finally, I got a good Gmail message [from smg5urded]
"This game does look a bit plain, but, I'm sure this does not destroy the experience as a whole. Monsters fit your style of game-play, mapping looks crude but I'm sure you can make it better if you do a remake of Forgotten Eclipse"

Forum statistics

Threads
110,397
Messages
1,052,965
Members
143,456
Latest member
DavishKK
Top