RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] One Character Menu

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 60
Creativity is all I have.
So, you're creating a game with only one party member. You've decided that the player will not control a second one and for that, you need some changes in your menu. I'm going to show you, while trying to make it understandable, how to add the menu for just one character. Not only will this show your determination, the menu itself will also be faster to navigate through.

I advice all to follow every step. If not, you could become confused with the lines.



So, let's start with opening the script editor and finding the Scene_Menu script. There are some windows that you won't be using most of the time and we're going to hide them. It could be that you need them for something later, so we're avoiding anything that would involve the delete button.

Code: On the 42th line, you'll find the following. [Select]
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 224


For now, we don't need this option, lets hide it. We'll change that little piece of code into something else. X and Y give the position of the window. Don't need it so we change them slightly.

Code: Change the variables [Select]
@playtime_window = Window_PlayTime.new
@playtime_window.visible = false
@playtime_window.active = false

If you took your time, you should know what we added. We told the engine that the visibility of the Playtime screen is non existent. We also deactivated the window, just to be sure. If one would want to activate the window or the visibility, change false into true. Or change the code back of course. You should do the same with the steps and gold windowa, found on line 46 - 48 and 50 - 52.


Now, that wasn't so hard! Next stop would be the status screen. We need to hide it, so that we only have the command window (With all the options to choose). If you payed attention, you should already know what to do here.

Code: Line 54 - 56 [Select]

@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0

into
Code: Line 54 - 56 [Select]

@status_window = Window_MenuStatus.new
@status_window.visible = false
@status_window.x = 0
@status_window.y = 0

I also changed the x variable, because I want the status window to fill the whole screen once used. Now the only thing that should be changed, is the command window itself. Scroll down to the 26-27 lines and add the following in between. Take note that I've already added them in the code, so replacing the two lines should also work. Still, try to do it on your own!

Code: Line 26-27 [Select]
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
Should be
Code: [Select]
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.x = 250
@command_window.y = 128
@command_window.index = @menu_index



So, done with how it looks. Unfortunately, while the status window is invisible, it still activates if one were to select skills and equipment. The status option itself can also be seen as broken. Let us fix that and make it run smoothly. On line 108, you'll see the definition update_command. In this def, it is stated what every option in the menu does. If you tried the menu out a little, you should know that only the Items window appears with one press of a button. The others give you the invisible status window, forcing you to press once again to get the screen you wish. Let us check what the difference is.

Code: Line 127-131 [Select]
when 0  # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new

Code: Line 132-138 [Select]
when 1  # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0

So, do you see the difference? The first sentence of both gives the game information about which option to use. 0 being Items and 1 being Skill. What comes next is important. The item window is directly called if selected, while the skill option calls out the status window. We don't want that, so let us change.

Code: Line 132-136 [Select]
when 1  # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
$scene = Scene_Skill.new

By removing the last three variables that call out and adjust the status window and adding a command to call out the Skill Window, we made our goal. Do the same with the equip option just below the skill option and your lines should look like this.

Code: Line 127-141 [Select]
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        $scene = Scene_Skill.new
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        $scene = Scene_Equip.new


Hell yeah! You're almost done! Almost all options in your menu should work. The only thing we need to fix now is the status window itself. On line 142, you see the status option. You can see that it deactivates the command window while activating the status window. Unfortunately, we have to edit the visibility of the windows into the script ourselves.

Code: Line 142-148 [Select]
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0

After adding the visibility
Code: Line 142-150 [Select]
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @command_window.visible = false
        @status_window.active = true
        @status_window.visible = true
        @status_window.index = 0

This should fix the menu itself. One small problem remains and that is returning from the status window itself. We just messed with the update_command definition. The next definition, found on line 174, will be our second-to-last task. Take a good look at line 182-184. Looks familiar? It's the same as what you changed before this but the other way around! So, let's go!

Code: Line 180-182 [Select]
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
After adding the visibility
Code: Line 180-184 [Select]
      @command_window.active = true
      @command_window.visible = true
      @status_window.active = false
      @status_window.visible = false
      @status_window.index = -1


You did it! The menu should be working right now. Only one small detail remains and that's done in a wink. The status window doesn't fill the whole screen. Go to Window_MenuStatus in the script editor and find line 12.

Code: Line 12 [Select]
    super(0, 0, 480, 480)
Can be changed into..
Code: Line 12 [Select]
    super(0, 0, 640, 480)



There ya go. It can be done in seconds and understood in a hour. It took me two days of poker and studying the Scene_Menu to get this on my own. I hope this will lessen the time for you guys. I'll be adding more to this later, as we have some options still available! But that, is for the future! I also won't be giving out a demo (while I have on). Follow the steps and there is no need for a demo!  :police:

**
Rep:
Level 60
Creativity is all I have.

**
Rep:
Level 60
Creativity is all I have.

**
Rep:
Level 60
Creativity is all I have.