Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Easy Menu Positions, Now you can edit your menu in seconds.
Genshyu
post Feb 11 2009, 02:45 PM
Post #1


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




Introduction:
This script allows you to edit your menu's positions, and height of windows with ease. This is for beginner scripters.



Instructions:
Paiste this code above main and it should work perfectly.

CODE
=begin
Genshyu's Easy menu Designer.
Instructions.



1: use WINDOW_M_X to change the X position of the Command Windows X
2: same with WINDOW_M_Y.
3: Use WINDOW_M_HEIGHT to change the height of the command window.
4: Window M2 is the Actor window.
5: MG means Menu Gold.



=end
class Scene_Menu < Scene_Base
  def initialize(menu_index = 0)
  @menu_index = menu_index
  @WINDOW_M_X = 384
  @WINDOW_M_Y = 0
  @WINDOW_M_HEIGHT = 360
  @WINDOW_M2_X = 0
  @WINDOW_M2_Y = 0
  @WINDOW_MG_X = 384
  @WINDOW_MG_Y = 360
  end
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(@WINDOW_MG_X, @WINDOW_MG_Y)
    @status_window = Window_MenuStatus.new(@WINDOW_M2_X, @WINDOW_M2_Y)
  end
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.x = @WINDOW_M_X
    @command_window.y = @WINDOW_M_Y
    @command_window.height = @WINDOW_M_HEIGHT
    if $game_party.members.size == 0      
      @command_window.draw_item(0, false)  
      @command_window.draw_item(1, false)  
      @command_window.draw_item(2, false)    
      @command_window.draw_item(3, false)  
    end
    if $game_system.save_disabled            
      @command_window.draw_item(4, false)    
    end
  end
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0    
        $scene = Scene_Item.new
      when 1,2,3
        start_actor_selection
      when 4      
        $scene = Scene_File.new(true, false, false)
      when 5    
        $scene = Scene_End.new
      end
    end
  end
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1
        $scene = Scene_Skill.new(@status_window.index)
      when 2  
        $scene = Scene_Equip.new(@status_window.index)
      when 3
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end


CODE
Genshyu's Easy menu Designer.
Instructions.



WINDOW_M_X = Command Window X.
WINDOW_M_Y = Command Window Y
WINDOW_M_HEIGHT = Command Window Height.
WINDOW_M2_X = Party Window X.
WINDOW_M2_Y = Party Window Y.
WINDOW_MG_X = Window Gold X.
WINDOW_MG_Y = Window Gold Y

.

This post has been edited by Genshyu: Feb 11 2009, 02:48 PM


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   
sasofrass
post Feb 11 2009, 03:02 PM
Post #2


I can event anything.
Group Icon

Group: Revolutionary
Posts: 254
Type: Event Designer
RM Skill: Masterful




Works 100% so far. smile.gif


__________________________
Eventing Tutorials (updated Mar-5-2011)

Easy Eventing Tutorial Submissions - All done by me!
1.] Easy Money Banking System (May-16-2010)
2.] Easy Random Lightening System (Jul-31-2010)
3.] Mining System with Events (Aug-1-2010)
4.] Easy Item Looting (Aug-8-2010)
5.] Locks (Aug-8-2010)
6.] Event Movement to Location (Jan-2-2011)
7.] Evented Locations (Feb-21-2011)
8.] Slippery Floors (Mar-5-2011)
Go to the top of the page
 
+Quote Post
   
Genshyu
post Feb 11 2009, 03:04 PM
Post #3


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




QUOTE (sasofrass @ Feb 11 2009, 03:02 PM) *
Works 100% so far. smile.gif

^^. Shouldn't really be any problems with any other script.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   
sasofrass
post Feb 11 2009, 03:11 PM
Post #4


I can event anything.
Group Icon

Group: Revolutionary
Posts: 254
Type: Event Designer
RM Skill: Masterful




QUOTE (Genshyu @ Feb 11 2009, 06:04 PM) *
QUOTE (sasofrass @ Feb 11 2009, 03:02 PM) *
Works 100% so far. smile.gif

^^. Shouldn't really be any problems with any other script.

yeah it isn't, I have like 30 other scripts and it fits perfectly inside them. =)


__________________________
Eventing Tutorials (updated Mar-5-2011)

Easy Eventing Tutorial Submissions - All done by me!
1.] Easy Money Banking System (May-16-2010)
2.] Easy Random Lightening System (Jul-31-2010)
3.] Mining System with Events (Aug-1-2010)
4.] Easy Item Looting (Aug-8-2010)
5.] Locks (Aug-8-2010)
6.] Event Movement to Location (Jan-2-2011)
7.] Evented Locations (Feb-21-2011)
8.] Slippery Floors (Mar-5-2011)
Go to the top of the page
 
+Quote Post
   
Genshyu
post Feb 11 2009, 03:17 PM
Post #5


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




QUOTE (sasofrass @ Feb 11 2009, 03:11 PM) *
QUOTE (Genshyu @ Feb 11 2009, 06:04 PM) *
QUOTE (sasofrass @ Feb 11 2009, 03:02 PM) *
Works 100% so far. smile.gif

^^. Shouldn't really be any problems with any other script.

yeah it isn't, I have like 30 other scripts and it fits perfectly inside them. =)

Hehe ^^.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   
BigEd781
post Feb 11 2009, 04:19 PM
Post #6


No method: 'stupid_title' found for `nil:NilClass'
Group Icon

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed




The will definitely be incompatibilities with menu add-ons. Instead of completely redefining create_command_window, you can simply call an alias and then move it around.


__________________________
`
Give me teh codez!!!


I am the master debator!
Go to the top of the page
 
+Quote Post
   
Genshyu
post Feb 11 2009, 04:41 PM
Post #7


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




QUOTE (BigEd781 @ Feb 11 2009, 04:19 PM) *
The will definitely be incompatibilities with menu add-ons. Instead of completely redefining create_command_window, you can simply call an alias and then move it around.

Only one problem. I have no skills in scripting like what so ever.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   
BigEd781
post Feb 11 2009, 05:06 PM
Post #8


No method: 'stupid_title' found for `nil:NilClass'
Group Icon

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed




QUOTE (Genshyu @ Feb 11 2009, 04:41 PM) *
QUOTE (BigEd781 @ Feb 11 2009, 04:19 PM) *
The will definitely be incompatibilities with menu add-ons. Instead of completely redefining create_command_window, you can simply call an alias and then move it around.

Only one problem. I have no skills in scripting like what so ever.


lol, well, we can fix that. Try this instead:

CODE
alias genshyu_create_command_window :create_command_window
def create_command_window
  genshyu_create_command_window
  @command_window.x = @WINDOW_M_X
  @command_window.y = @WINDOW_M_Y
  @command_window.height = @WINDOW_M_HEIGHT
end


__________________________
`
Give me teh codez!!!


I am the master debator!
Go to the top of the page
 
+Quote Post
   
Genshyu
post Feb 11 2009, 05:51 PM
Post #9


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




QUOTE (BigEd781 @ Feb 11 2009, 05:06 PM) *
QUOTE (Genshyu @ Feb 11 2009, 04:41 PM) *
QUOTE (BigEd781 @ Feb 11 2009, 04:19 PM) *
The will definitely be incompatibilities with menu add-ons. Instead of completely redefining create_command_window, you can simply call an alias and then move it around.

Only one problem. I have no skills in scripting like what so ever.


lol, well, we can fix that. Try this instead:

CODE
alias genshyu_create_command_window :create_command_window
def create_command_window
  genshyu_create_command_window
  @command_window.x = @WINDOW_M_X
  @command_window.y = @WINDOW_M_Y
  @command_window.height = @WINDOW_M_HEIGHT
end


Wow O.o. Thanks, dude biggrin.gif.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 12:56 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker