Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: BanisherOfEden on March 12, 2013, 06:25:07 pm

Title: (RMVXA) Moving Window_Command
Post by: BanisherOfEden on March 12, 2013, 06:25:07 pm
Hello. I don't know how to script, but I know how to use basic logic. >_>

I wanted to change the default menu script. I wanted to swap the commands and status.
I started with change
gold_window.x = 0

to
gold_window.x = 384


I then moved on to the status_window. I saw that it didn't have the x/y thing, so I just added it.
    @status_window.x = 0
    @status_window.y = 0


Now I'm at the window_command... I don't know what to do here.  :(

I've tried a few things... including~
@Window_MenuCommand.x = 384
@Window_MenuCommand.y = 99


@Window_Command.x = 384
@Window_Command.y = 99


and

@Command_Window.x = 384
@Command_Window.y = 99


I just can't figure out how to make it move. ~_~
Title: Re: (RMVXA) Moving Window_Command
Post by: Blizzard on March 13, 2013, 02:20:03 am
I'm not too fond of the scripting system in VXA, but if it follows a model that most do, then there should be an "update" method somewhere in that scene. The update method is called every frame so it gets executed repeatedly. If you added something like "@Command_Window.x += 1" there, it would move by 1 to the right every frame. You could then add some additional stopping condition and you could have something like:

if @Command_Window.x < 500
  @Command_Window.x += 4
end
Title: Re: (RMVXA) Moving Window_Command
Post by: BanisherOfEden on March 13, 2013, 03:45:20 am

Thank you.
I am now one step closer to world domination completing my project.
Title: Re: (RMVXA) Moving Window_Command
Post by: Blizzard on March 13, 2013, 04:59:16 am
So am I. To completing my project of course, not world domination. I would never try to dominate the world. Ever. *realizes that everybody knows he has no project*
Title: Re: (RMVXA) Moving Window_Command
Post by: bigace on March 13, 2013, 05:35:03 am
This should also work as well.

class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias ace_scene_menu_start_ame start
  def start
    ace_scene_menu_start_ame
    relocate_windows
  end
  #--------------------------------------------------------------------------
  # new method: relocate_windows
  #--------------------------------------------------------------------------
  def relocate_windows
    @command_window.x = Graphics.width - @command_window.width
    @gold_window.x = Graphics.width - @gold_window.width
    @status_window.x = 0
  end
end