The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: &&&&&&&&&&&&& on January 01, 2008, 09:11:22 PM

Title: CMS help.
Post by: &&&&&&&&&&&&& on January 01, 2008, 09:11:22 PM
I don't know why, but after leaving the Save and status menu, the CMS does this weird thing were it goes to an empty slot.



Attached.

What I have so far.

Main
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2FBoe-2.jpg&hash=808e17f330633bf80ca690bc4e151376448df70f)

Menu
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2FBoeMenu.jpg&hash=f6566d9ecc79d1bccba552798b7da4d72e2f715c)

Item
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2FBoeItem.jpg&hash=3089e3c28d747b6766db94b8b6fd1e52f7695d89)

New status screen. ^_^
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2Fstatus.jpg&hash=eef0e278f7b40ed87eb010b322722d80c3acc52c)
Title: Re: CMS help.
Post by: modern algebra on January 01, 2008, 11:49:38 PM
If I were to hazard a guess, I would say that the index that you assign when you are calling the menu from those scenes does not correspond to the correct option.

EDIT:

Yup, that's it: Look at line 52 in Scene_BoeStatus:

Code: [Select]
      $scene = Scene_Boe.new(3)

The number there ought to be 0 I should think. For the save menu, I suspect it is the same problem but it ought to be 1. The lines are at 33 and 50 in Scene_Save. Are you writing this script yourself? It's a nice design.

If I might make a suggestion though, given the similarity between Scene_Boe and Scene_BoeMenu, I would merge the two and just make two command windows, one for the menu and one for the pre-menu. Then you could switch between them easily by activating one and deactivating the other.
Title: Re: CMS help.
Post by: &&&&&&&&&&&&& on January 02, 2008, 04:23:27 AM
If I were to hazard a guess, I would say that the index that you assign when you are calling the menu from those scenes does not correspond to the correct option.

EDIT:

Yup, that's it: Look at line 52 in Scene_BoeStatus:

Code: [Select]
      $scene = Scene_Boe.new(3)


The number there ought to be 0 I should think. For the save menu, I suspect it is the same problem but it ought to be 1. The lines are at 33 and 50 in Scene_Save.

I didn't know what that number meant, thanks. ^_^

Are you writing this script yourself? It's a nice design.

I'm not really "writing" it. I'm taking bits from the RTP scripts. (not from anywhere else.)
I noticed, that I got what most of what the script meant, so here I am now, trying to make a CMS.


If I might make a suggestion though, given the similarity between Scene_Boe and Scene_BoeMenu, I would merge the two and just make two command windows, one for the menu and one for the pre-menu. Then you could switch between them easily by activating one and deactivating the other.

;_;  I have no clue how to do that. I can't think of a place in the RTP that I could go and look how it's done.


PS. Thank you, and in my restless dreams, I see that town. Silent Hill. You promised you'd take me there again someday. But you never did. Well I'm alone there now... In our 'special place'... Waiting for you...
Title: Re: CMS help.
Post by: modern algebra on January 02, 2008, 01:31:26 PM
Alright,  ;D. If you ever have trouble knowing what an argument is for, take a look at the method being called. In your case, it is the initialize method of Scene_BoeMenu:

Code: [Select]
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end

It helps to have the official version for the translation of the comments, but as you see, that tells you exactly what the argument you pass is (just in case you didn't know, when you call another method and you pass something on to it, then that thing that you pass on is an argument. For instance, in the line, @command_window = Window_Command.new (x, y), x and y are the arguments)


Anyway, if you want a tip on doing it the way I suggested, take a look at the similarities between the scripts you have. Particularly, notice:

Code: [Select]
    # main
    s1 = "Item"
    s2 = "Status"
    s3 = "Equip"
    @command_window = Window_Command.new(160, [s1, s2, s3])
and
Code: [Select]
    s1 = "Menu"
    s2 = "Save"
    @command_window = Window_Command.new(160, [s1, s2])

I think you know what both are, and so what we want are two command windows in the same scene, so we can just rename them and have them in one script:



Code: [Select]
    # main
    s1 = "Menu"
    s2 = "Save"
    @command_window = Window_Command.new(160, [s1, s2])
    @command_window.index = @menu_index
    @command_window.x = 340
    @command_window.y = 300
    s1 = "Item"
    s2 = "Status"
    s3 = "Equip"
    @command_window2 = Window_Command.new(160, [s1, s2, s3])
    @command_window2.index = @menu_index
    @command_window2.x = 340
    @command_window2.y = 300
    @command_window2.visible = false
    @command_window2.active = false

You'll see that I added the two last lines there. Basically, by visible = false I am making the window invisible, since we are working with the other command window first. by active = false I am making sure that we can act on the first one without the second one responding

Now, let's take a look at our update method:

Code: [Select]
def update
    # ????????
    @command_window.update
    @spriteset.update
    # ??????????????????: update_command ???
    if @command_window.active
      update_command
      return
    end
    # ???????????????????: update_status ???
    if @status_window.active
      update_status
      return
    end
  end


Specifically, notice this:

Code: [Select]
    if @command_window.active
      update_command
      return
    end

So, when you think about it, all you really need to add in is:

Code: [Select]
    if @command_window2.active
      update_command_2
      return
    end

and you have to pull in the update_command method from Scene_BoeMenu and rename it to update_command_2.

Just to mention this, much of your update command methods are unnecessary: 2 - 5 can never run because you have removed them as options. Anyway, all you need to do now is change it so that instead of everywhere that you would normally switch between scenes using these codes:

Code: [Select]
$scene = Scene_Boe.new

$scene = Scene_BoeMenu.new

you can do it by these codes:

Code: [Select]
# Disable Menu window
@command_window2.active = false
@command_window2.visible = false
# Enable Pre Menu window
@command_window.index = 0
@command_window.active = true
@command_window.visible = true

# Disable Pre Menu window
@command_window.active = false
@command_window.visible = false
# Enable Menu window
@command_window2.index = 0
@command_window2.active = true
@command_window2.visible = true


I might have forgotten something, but that is roughly the idea.
Title: Re: CMS help.
Post by: &&&&&&&&&&&&& on January 06, 2008, 03:04:15 PM
I hit a wall. ~_~
Title: Re: CMS help.
Post by: &&&&&&&&&&&&& on January 07, 2008, 02:33:48 PM
OMG, double post of death. It's almost done. =D
All I need to do is fix the status thing, and It's finished. ^_^
Title: Re: CMS help.
Post by: modern algebra on January 07, 2008, 03:12:26 PM
Cool, well good luck with it. I take it you fixed whatever the problem was from the post above? Or should I take a look anyway?
Title: Re: CMS help.
Post by: &&&&&&&&&&&&& on January 08, 2008, 09:38:49 AM
Cool, well good luck with it. I take it you fixed whatever the problem was from the post above? Or should I take a look anyway?

It would make me happy if you did.  :D

E: I was thinkings. Is there a way to show icons next to the menu options?
   
                                Menu (icon) -> Items (icon)
                                Save (icon)      status (icon)
                                                        equip (icon)

E2:

Main
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2FBoe-2.jpg&hash=808e17f330633bf80ca690bc4e151376448df70f)

Menu
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2FBoeMenu.jpg&hash=f6566d9ecc79d1bccba552798b7da4d72e2f715c)

Item
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2FBoeItem.jpg&hash=3089e3c28d747b6766db94b8b6fd1e52f7695d89)

New status screen. ^_^
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2Fstatus.jpg&hash=eef0e278f7b40ed87eb010b322722d80c3acc52c)

Equip
It's still default.
Title: Re: CMS help.
Post by: Falcon on January 08, 2008, 11:55:26 AM
yeah, you can, look for constance's menu or the old shitty Default Menu edit I made, both use icons.