[Solved] How do I activate this window?

● ARCHIVED · READ-ONLY
Started by Adellie 6 posts View original ↗
  1. I am trying to activate a command/selectable window

    but if that window is part of an array, it doesn't work.

    Code:
    class MyList < Window_Command  def make_command_list    add_command("The first Option", :foo)    add_command("A Second Option",  :foo)    add_command("A Third Option",   :foo)  endendclass MyScene < Scene_Base  def start    super    #Doesn't Work:    @orderly_cats = []    @orderly_cats[0] = MyList.new(0,0)    @orderly_cats[0].activate        #Does Work:    @stray_cat = MyList.new(200,0)    @stray_cat.activate  endend
  2. Just a wild&quick guess. But do you also call the update method for each window in the array?
  3. That's all there is to the script, and update isn't running for the window in the array.

    edit: This is what i've added to MyScene < Scene_Base

    def update_all_windows super for i in 0..(@orderly_cats.size-1) @orderly_cats.update end endThe windows work but Is there a better way to do this?

    Sorry i'm such a noob.
  4. My gut feeling is that the index of the orderly cat in the cat array is irrelevant.

    From this I suggest the following change:

    def update_all_windows  super  for cat in @orderly_cats    cat.update  endendChanging the setup section to the following could also be beneficial.

    @orderly_cats = []orderly_cat = MyList.new(0,0)orderly_cat.activate@orderly_cats << orderly_catNote: Didn't actually try this code so it might not work initially. The concept is the more important part of the equation here.

    *hugs*
  5. (Sorry about all the edits; brain fart. I do use the indexes... just not there. @-@; )

    Much obliged, both!

    *returns hugs*
  6. 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.