[XP] Ring menu mods [RESOLVED]

Started by mroedesigns, December 29, 2010, 10:00:49 pm

Previous topic - Next topic

mroedesigns

December 29, 2010, 10:00:49 pm Last Edit: January 01, 2011, 04:31:50 pm by mroedesigns
I absolutely love the ring menu for RPGmXP. I think it's super awesome, so I'm using it. But I'm also using Blizz ABS, so I had to add options for Hotkeys, and AI Behavior and Triggers. I don't know a whole lot about scripting, but I can do basic things like this. I got the additions there, and they're working, but there are a few little errors and things that need changed.

First off, does anyone know how I can bypass the actor selection window? My game only has one character in the party at any given time, so there's really no need for that window to pop up.

Another issue I can't figure out how to fix, is that when you use one of the new additions (Hotkeys, behavior, or triggers) and hit 'Esc' to return to the menu, it instead takes you directly back to the map.

If anyone could help me, that'd be great.
Here's the modified script.

Spoiler: ShowHide
#===================================================
# ¦ Ring Menu - Show Player Location - Release #1 (Enhanced By Dubealex)
#===================================================
# For more infos and update, visit:
# asylum.dubealex.com
#
# Original Ring Menu by: ?? (From XRXS)
# Original Edit and Fix by: Maki
# Show Player Location Version by: Dubealex
#
# You can customize this script at line #35 - Have fun !!
# If you want to show more stuff, its easy to do, you can try to ask in the forum.
#
# alex@dubealex.com
#===================================================


#===================================================
# ? CLASS Scene_Menu Begins
#===================================================

class Scene_Menu
#--------------------------------------------------------------------------
# ?? ?I?u?W?F?N?g??????
#     menu_index : ?R?}???h??J?[?\????????u
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
 @menu_index = menu_index
 $location_text=[]
 $window_size=[]
 $ring_menu_text=[]
 $chara_select=[]
 @window_opacity=[]
 @chara_select=[]
 @window_position=[]

  #--------------------------------------------------------------------------------------------------
  # ¦ Ring Menu Customization Section: (By Dubealex)
  #--------------------------------------------------------------------------------------------------
  # Those variables defines how the script will act.
  # Simply change the value by those you want.
  # Remember that changing the font size has its limitation due to text space allocation.
  #
  # ? TEXT SETTINGS FOR SHOW PLAYER LOCATION WINDOW:
  $location_text[0]="Tahoma"      # Font Type
  $location_text[1]=22                # Font Size
  $location_text[2]=6                  # Location Title Color
  $location_text[4]=0                  # Map Name Color
  $location_text[3]="Location:"     # Customize the "Location" Title Text

  # ? SHOW LOCATION WINDOW SETTINS:
  @show_location_window=true                       #Set to false to not use it !
  @window_opacity[0]=255                             # Border Opacity
  @window_opacity[1]=130                             # Background Opacity
  $window_location_skin="001-Blue01"            # Window Skin
  @window_position[0]=20                             # X Axis Position
  @window_position[1]=20                             # Y Axis Position
  $window_size[0]=160                                  # Lengh
  $window_size[1]=96                                    # Heigh

  # ?  TEXT SETTINGS FOR INSIDE THE RING MENU:
  $ring_menu_text[0]="Tahoma"      # Font Type
  $ring_menu_text[7]=6                  # Font Color
  $ring_menu_text[8]=22                # Font Size
  $ring_menu_text[1]="Items"         # Items Menu Text
  $ring_menu_text[2]="Skills"          # Skills Menu Text
  $ring_menu_text[3]="Hotkeys"      
  $ring_menu_text[4]="Equipment"         # Equip Menu Text
  $ring_menu_text[5]="Stats"          # Stats Menu Text
  $ring_menu_text[6]="Behavior"
  $ring_menu_text[7]="Triggers"
  $ring_menu_text[8]="Save"          # Save Menu Text
  $ring_menu_text[9]="Quit"           # Quit Menu Text

  # ?  CHARACTER SELECTION WINDOW SETTINGS :
  @chara_select[0]=400               # X Axis Position
  @chara_select[1]=0                  # Y Axis Position
  $chara_select[0]="Tahoma"       # Font Type
  $chara_select[1]=0                   # Font Color
  $chara_select[5]=22                  # Font Size
  $chara_select[2]=255               # Window Border Opacity
  $chara_select[3]=130               # Window Background Opacity
  $chara_select[4]="001-Blue01"  # Window Skin to use
 #--------------------------------------------------------------------------------------------------

end
#--------------------------------------------------------------------------
# ?? ???C?????
#--------------------------------------------------------------------------
def main

 # Show Player Location Feature:
 if @show_location_window==true  
 @window_location = Window_Location.new
    @window_location.x = @window_position[0]
    @window_location.y = @window_position[1]
    @window_location.opacity = @window_opacity[0]
    @window_location.back_opacity = @window_opacity[1]
    end
 #End of Show Player Location

 # ?X?v???C?g?Z?b?g???? ?
 @spriteset = Spriteset_Map.new
 # ?R?}???h?E?B???h?E???? ?
 px = $game_player.screen_x - 15
 py = $game_player.screen_y - 24
 @command_window = Window_RingMenu.new(px,py)
 @command_window.index = @menu_index
 # ?p?[?e?B l ??? 0  l??????
 if $game_party.actors.size == 0
   # ?A?C?e???A?X?L???A?????A?X?e?[?^?X????????
   @command_window.disable_item(0)
   @command_window.disable_item(1)
   @command_window.disable_item(2)
   @command_window.disable_item(3)
 end
 @command_window.z = 100
 # ?Z?[?u??~??????
 if $game_system.save_disabled
   # ?Z?[?u???????????
   @command_window.disable_item(4)
 end
 # ?X?e?[?^?X?E?B???h?E???? ?
 @status_window = Window_RingMenuStatus.new
 @status_window.x = @chara_select[0]
 @status_window.y = @chara_select[1]
 @status_window.z = 200
 @status_window.opacity=$chara_select[2]
 @status_window.back_opacity=$chara_select[3]
 @status_window.visible = false
 # ?g?????W?V???????s
 Graphics.transition
 # ???C?????[?v
 loop do
   # ?Q?[????????X V
   Graphics.update
   # ???????????X V
   Input.update
   # ?t???[???X V
   update
   # ????? ????????????[?v?????f
   if $scene != self
     break
   end
 end
 # ?g?????W?V????????
 Graphics.freeze
 # ?X?v???C?g?Z?b?g??????
 @spriteset.dispose
 # ?E?B???h?E??????
 if @show_location_window==true
 @window_location.dispose
 end
 @command_window.dispose
 @status_window.dispose
end
#--------------------------------------------------------------------------
# ?? ?t???[???X V
#--------------------------------------------------------------------------
def update
 # ?E?B???h?E???X V
 if @show_location_window==true
 @window_location.update
 end
 @command_window.update
 @status_window.update
 # ?R?}???h?E?B???h?E???A?N?e?B?u??????: update_command ?????
 if @command_window.active
   update_command
   return
 end
 # ?X?e?[?^?X?E?B???h?E???A?N?e?B?u??????: update_status ?????
 if @status_window.active
   update_status
   return
 end
end
#--------------------------------------------------------------------------
# ?? ?t???[???X V (?R?}???h?E?B???h?E???A?N?e?B?u??????)
#--------------------------------------------------------------------------
def update_command
 # B ?{?^??????????????
 if Input.trigger?(Input::B)
   # ?L?????Z?? SE ?????t
   $game_system.se_play($data_system.cancel_se)
   # ?}?b?v????? ?????
   $scene = Scene_Map.new
   return
 end
 # C ?{?^??????????????
 if Input.trigger?(Input::C)
   # ?p?[?e?B l ??? 0  l???A?Z?[?u?A?Q?[???I????O??R?}???h??????
   if $game_party.actors.size == 0 and @command_window.index < 4
     # ?u?U?[ SE ?????t
     $game_system.se_play($data_system.buzzer_se)
     return
   end
   # WIDNOW INDEX HANDLEING
  $ring_menu_text[1]="Items"         # Items Menu Text
  $ring_menu_text[2]="Skills"          # Skills Menu Text
  $ring_menu_text[3]="Hotkeys"      
  $ring_menu_text[4]="Equip"         # Equip Menu Text
  $ring_menu_text[5]="Stats"          # Stats Menu Text
  $ring_menu_text[6]="Behavior"
  $ring_menu_text[7]="Triggers"
  $ring_menu_text[8]="Save"          # Save Menu Text
  $ring_menu_text[9]="Quit"           # Quit Menu Text
   case @command_window.index
   when 0  # Items
     # ????  SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?A?C?e??????? ?????
     $scene = Scene_Item.new
     
   when 1  # Skills
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?X?e?[?^?X?E?B???h?E???A?N?e?B?u?????
     @command_window.active = false
     @status_window.active = true
     @status_window.visible = true
     @status_window.index = 0
     
   when 2  #Hotkeys
     $scene = Scene_Hotkeys.new
     
   when 3  # Equipment
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?X?e?[?^?X?E?B???h?E???A?N?e?B?u?????
     @command_window.active = false
     @status_window.active = true
     @status_window.visible = true
     @status_window.index = 0
     
   when 4  # Stats[?^?X
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?X?e?[?^?X?E?B???h?E???A?N?e?B?u?????
     @command_window.active = false
     @status_window.active = true
     @status_window.visible = true
     @status_window.index = 0
     
   when 5 #Behavior
     $scene = Scene_AI_Behavior.new
     
   when 6 #Triggers  
     $scene = Scene_AI_Triggers.new
     
   when 7  # Save
     # ?Z?[?u??~??????
     if $game_system.save_disabled
       # ?u?U?[ SE ?????t
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?Z?[?u????? ?????
     $scene = Scene_Save.new
     
   when 8  # Quit
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?Q?[???I??????? ?????
     $scene = Scene_End.new
     
   end
   return
 end
 # ?A?j???[?V??????????J?[?\??????? ???s?????
 return if @command_window.animation?
 # ??or?? ?{?^??????????????
 if Input.press?(Input::UP) or  Input.press?(Input::LEFT)
   $game_system.se_play($data_system.cursor_se)
   @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
   return
 end
 # ??or?? ?{?^??????????????
 if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)
   $game_system.se_play($data_system.cursor_se)
   @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
   return
 end
end
#--------------------------------------------------------------------------
# ?? ?t???[???X V (?X?e?[?^?X?E?B???h?E???A?N?e?B?u??????)
#--------------------------------------------------------------------------
def update_status
 # B ?{?^??????????????
 if Input.trigger?(Input::B)
   # ?L?????Z?? SE ?????t
   $game_system.se_play($data_system.cancel_se)
   # ?R?}???h?E?B???h?E???A?N?e?B?u?????
   @command_window.active = true
   @status_window.active = false
   @status_window.visible = false
   @status_window.index = -1
   return
 end
 # C ?{?^??????????????
 if Input.trigger?(Input::C)
   # ?R?}???h?E?B???h?E??J?[?\????u?????
   case @command_window.index
   when 1  # ?X?L??
     # ????A?N?^?[???s?? ????? 2 ??????????
     if $game_party.actors[@status_window.index].restriction >= 2
       # ?u?U?[ SE ?????t
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?X?L??????? ?????
     $scene = Scene_Skill.new(@status_window.index)
   when 2  # ????
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ????????? ?????
     $scene = Scene_Equip.new(@status_window.index)
   when 3  # ?X?e?[?^?X
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?X?e?[?^?X????? ?????
     $scene = Scene_Status.new(@status_window.index)
   end
   return
 end
end
end

#===================================================
# ? CLASS Scene_Menu Ends
#===================================================


#===================================================
# ? CLASS Window_RingMenu  Begins
#===================================================
class Window_RingMenu < Window_Base
#--------------------------------------------------------------------------
# ?? ?N???X?? ?
#--------------------------------------------------------------------------
STARTUP_FRAMES = 20
MOVING_FRAMES = 5
RING_R = 64      
ICON_ITEM   = RPG::Cache.icon("I_Chest02")
ICON_HOTKEYS = RPG::Cache.icon("I_Scroll02")
ICON_SKILL  = RPG::Cache.icon("S_Buff01")
ICON_EQUIP  = RPG::Cache.icon("E_Wood04")
ICON_STATUS = RPG::Cache.icon("S_Holy03")
ICON_BEHAVIOR = RPG::Cache.icon("W_Book02")
ICON_TRIGGERS = RPG::Cache.icon("W_Book04")
ICON_SAVE   = RPG::Cache.icon("038-Item07")
ICON_EXIT   = RPG::Cache.icon("S_Light03")
ICON_DISABLE= RPG::Cache.icon("")
SE_STARTUP = "056-Right02"
MODE_START = 1
MODE_WAIT  = 2
MODE_MOVER = 3
MODE_MOVEL = 4
#--------------------------------------------------------------------------
# ?? ?A?N?Z?T
#--------------------------------------------------------------------------
attr_accessor :index
#--------------------------------------------------------------------------
# ?? ?I?u?W?F?N?g??????
#--------------------------------------------------------------------------
def initialize( center_x, center_y )
 super(0, 0, 640, 480)
 self.contents = Bitmap.new(width-32, height-32)
 self.contents.font.name = $ring_menu_text[0]
 self.contents.font.color = text_color($ring_menu_text[7])
 self.contents.font.size = 22
 self.opacity = 0
 self.back_opacity = 0
 s1 = $ring_menu_text[1]
 s2 = $ring_menu_text[2]
 s3 = $ring_menu_text[3]
 s4 = $ring_menu_text[4]
 s5 = $ring_menu_text[5]
 s6 = $ring_menu_text[6]
 s7 = $ring_menu_text[7]
 s8 = $ring_menu_text[8]
 s9 = $ring_menu_text[9]
 @commands = [ s1, s2, s3, s4, s5, s6, s7, s8, s9 ]
 @item_max = 9
 @index = 0
 @items = [ ICON_ITEM, ICON_SKILL, ICON_HOTKEYS, ICON_EQUIP, ICON_STATUS, ICON_BEHAVIOR, ICON_TRIGGERS, ICON_SAVE, ICON_EXIT ]
 @disabled = [ false, false, false, false, false, false, false, false, false ]
 @cx = center_x - 16
 @cy = center_y - 16
 setup_move_start
 refresh
end
#--------------------------------------------------------------------------
# ?? ?t???[???X V
#--------------------------------------------------------------------------
def update
 super
 refresh
end
#--------------------------------------------------------------------------
# ?? ??????`??
#--------------------------------------------------------------------------
def refresh
 self.contents.clear
 # ?A?C?R?????`??
 case @mode
 when MODE_START
   refresh_start
 when MODE_WAIT
   refresh_wait
 when MODE_MOVER
   refresh_move(1)
 when MODE_MOVEL
   refresh_move(0)
 end
 # ?A?N?e?B?u??R?}???h???\??
 rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32)
 self.contents.draw_text(rect, @commands[@index],1)
end
#--------------------------------------------------------------------------
# ?? ??????`??(????????)
#--------------------------------------------------------------------------
def refresh_start
 d1 = 2.0 * Math::PI / @item_max
 d2 = 1.0 * Math::PI / STARTUP_FRAMES
 r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
 for i in 0...@item_max
   j = i - @index
   d = d1 * j + d2 * @steps
   x = @cx + ( r * Math.sin( d ) ).to_i
   y = @cy - ( r * Math.cos( d ) ).to_i
   draw_item(x, y, i)
 end
 @steps -= 1
 if @steps < 1
   @mode = MODE_WAIT
 end
end
#--------------------------------------------------------------------------
# ?? ??????`??(??@??)
#--------------------------------------------------------------------------
def refresh_wait
 d = 2.0 * Math::PI / @item_max
 for i in 0...@item_max
   j = i - @index
   x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
   y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
   draw_item(x, y, i)
 end
end
#--------------------------------------------------------------------------
# ?? ??????`??(???]??)
#  mode : 0=?????v???? 1=???v????
#--------------------------------------------------------------------------
def refresh_move( mode )
 d1 = 2.0 * Math::PI / @item_max
 d2 = d1 / MOVING_FRAMES
 d2 *= -1 if mode != 0
 for i in 0...@item_max
   j = i - @index
   d = d1 * j + d2 * @steps
   x = @cx + ( RING_R * Math.sin( d ) ).to_i
   y = @cy - ( RING_R * Math.cos( d ) ).to_i
   draw_item(x, y, i)
 end
 @steps -= 1
 if @steps < 1
   @mode = MODE_WAIT
 end
end
#--------------------------------------------------------------------------
# ?? ?????`??
#     x :
#     y :
#     i : ???????
#--------------------------------------------------------------------------
def draw_item(x, y, i)
 #p "x=" + x.to_s + " y=" + y.to_s + " i=" + @items.to_s
 rect = Rect.new(0, 0, @items.width, @items.height)
 if @index == i
   self.contents.blt( x, y, @items, rect )
   if @disabled[@index]
     self.contents.blt( x, y, ICON_DISABLE, rect )
   end
 else
   self.contents.blt( x, y, @items, rect, 128 )
   if @disabled[@index]
     self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
   end
 end
end
#--------------------------------------------------------------------------
# ?? ??????????????
#     index : ???????
#--------------------------------------------------------------------------
def disable_item(index)
 @disabled[index] = true
end
#--------------------------------------------------------------------------
# ?? ???????A?j???[?V??????????
#--------------------------------------------------------------------------
def setup_move_start
 @mode = MODE_START
 @steps = STARTUP_FRAMES
 if  SE_STARTUP != nil and SE_STARTUP != ""
   Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)
 end
end
#--------------------------------------------------------------------------
# ?? ???]?A?j???[?V??????????
#--------------------------------------------------------------------------
def setup_move_move(mode)
 if mode == MODE_MOVER
   @index -= 1
   @index = @items.size - 1 if @index < 0
 elsif mode == MODE_MOVEL
   @index += 1
   @index = 0 if @index >= @items.size
 else
   return
 end
 @mode = mode
 @steps = MOVING_FRAMES
end
#--------------------------------------------------------------------------
# ?? ?A?j???[?V?????????????
#--------------------------------------------------------------------------
def animation?
 return @mode != MODE_WAIT
end
end

#===================================================
# ? CLASS Window_RingMenu Ends
#===================================================


#===================================================
# ? CLASS Window_RingMenuStatus Begins
#===================================================

class Window_RingMenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ?? ?I?u?W?F?N?g??????
#--------------------------------------------------------------------------
def initialize
 super(204, 64, 232, 352)
 self.contents = Bitmap.new(width - 32, height - 32)
 self.contents.font.size = $chara_select[5]
 refresh
 self.active = false
 self.index = -1
end
#--------------------------------------------------------------------------
# ?? ???t???b?V??
#--------------------------------------------------------------------------
def refresh
 self.contents.clear
 self.windowskin = RPG::Cache.windowskin($chara_select[4])
 self.contents.font.name = $chara_select[0]
 self.contents.font.color = text_color($chara_select[1])
 @item_max = $game_party.actors.size
 for i in 0...$game_party.actors.size
   x = 80
   y = 80 * i
   actor = $game_party.actors
   draw_actor_graphic(actor, x - 40, y + 80)
   draw_actor_name(actor, x, y + 24)
 end
end
#--------------------------------------------------------------------------
# ?? ?J?[?\??????`?X V
#--------------------------------------------------------------------------
def update_cursor_rect
 if @index < 0
   self.cursor_rect.empty
 else
   self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
 end
end
end
#===================================================
# ? CLASS Window_RingMenuStatus Ends
#===================================================


#===================================================
# ? CLASS Game_Map Additional Code Begins
#===================================================
class Game_Map

#Dubealex Addition (from XRXS) to show Map Name on screen
def name
 $map_infos[@map_id]
end
end

#===================================================
# ? CLASS Game_Map Additional Code Ends
#===================================================


#===================================================
# ? CLASS Scene_Title Additional Code Begins
#===================================================
class Scene_Title

#Dubealex Addition (from XRXS) to show Map Name on screen
 $map_infos = load_data("Data/MapInfos.rxdata")
 for key in $map_infos.keys
   $map_infos[key] = $map_infos[key].name
 end
end

#===================================================
# ? CLASS Scene_Title Additional Code Ends
#===================================================


#===================================================
# ? CLASS Window_Location Begins
#===================================================

class Window_Location < Window_Base

def initialize
super(0, 0, $window_size[0], $window_size[1])
 self.contents = Bitmap.new(width - 32, height - 32)
 self.contents.font.name = $location_text[0]
 self.contents.font.size = $location_text[1]
refresh
end

def refresh
self.contents.clear
self.windowskin = RPG::Cache.windowskin($window_location_skin)
self.contents.font.color = text_color($location_text[2])
self.contents.draw_text(4, 0, 120, 32, $location_text[3])
self.contents.font.color = text_color($location_text[4])
self.contents.draw_text(4, 32, 120, 32, $game_map.name, 2)
end
end
#===================================================
# ? CLASS Window_Location Ends
#===================================================

#===================================================
# ? Ring Menu - Show Player Location R1 - Ends
#===================================================

yuhikaru

December 30, 2010, 07:28:17 pm #1 Last Edit: December 30, 2010, 07:30:42 pm by yuhikaru
Hi there. First of all, I'm not a scripter. But it's really easy, so I think I can help you.

In def update_command you have to change what happens when the player selects equipment, skills and stats. What the code says is to show and activate the @status_window (the character select thingy). You just have to remove that and call the scene directly from there.
Taking 'Skills' as an example, in def update_command:
when 1  # Skills
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?X?e?[?^?X?E?B???h?E???A?N?e?B?u?????
     @command_window.active = false
     @status_window.active = true
     @status_window.visible = true
     @status_window.index = 0

Would become something like this:
when 1  # Skills
     # ???? SE ?????t
     $game_system.se_play($data_system.decision_se)
     # ?X?e?[?^?X?E?B???h?E???A?N?e?B?u?????
     $scene = Scene_Skill.new
     


After you did that for all the other options, you can remove all that refers to the @status_window in this script, in def main, def update, def update_status and so on, as you won't be needing it. I'm almost sure that's all you have to do, if not, someone please correct me =/

As for the other question, you have to search where the scene is closed. As you said, pressing esc (B). In this script for example, it would be this part, in def update_command:

if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   $scene = Scene_Map.new
   


When you press the cancel key, it calls $scene = Scene_map.new. You just have to change that, type $scene = Scene_Menu.new instead. You can use it like $scene = Scene_Menu.new(1), 1 being the index of the command menu. This way it would return to the command menu on the skill option.

Hope it helps, good luck with that ^^

mroedesigns

Quote from: yuhikaru on December 30, 2010, 07:28:17 pm
Hi there. First of all, I'm not a scripter. But it's really easy, so I think I can help you.


Any help is appreciated :)

Quote from: yuhikaru on December 30, 2010, 07:28:17 pm
In def update_command you have to change what happens when the player selects equipment, skills and stats. What the code says is to show and activate the @status_window (the character select thingy). You just have to remove that and call the scene directly from there.
Taking 'Skills' as an example, in def update_command:
#...

Would become something like this:
#...



Ahh, that fixed that problem :D I was just making it too complicated :p Thanks!


Quote from: yuhikaru on December 30, 2010, 07:28:17 pm
As for the other question, you have to search where the scene is closed. As you said, pressing esc (B). In this script for example, it would be this part, in def update_command:

if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   $scene = Scene_Map.new
   


When you press the cancel key, it calls $scene = Scene_map.new. You just have to change that, type $scene = Scene_Menu.new instead. You can use it like $scene = Scene_Menu.new(1), 1 being the index of the command menu. This way it would return to the command menu on the skill option.


One would think. However, here's the odd thing.

Only the three options that I added (Hotkeys, Behavior, and Triggers) return to scene_map. All other options return to the menu, however they return on the previous index. (Equipment returns on the hotkeys option, stats returns on the equipment option, ect) Items and skills, the two before 'Hotkeys' work fine and return correctly.

So it's obviously got something to do with the way that I added the options, or something that I did incorectly in the indexes. But since the script isn't mine,
im not a very skilled scripter, and there are no comments, I'm somewhat lost. That and the fact that some of them are returning correctly, makes me thing there must be something in the script I'm missing. Here's the current script, I commented on the parts that I edited.

http://pastebin.com/WHwF9biY

yuhikaru

Actually, it's in the scenes themselves. You have to search in each scene (Skills, hotkeys, equipment.....) for the exiting part and change it.
The default indexes are                     0 = items 1 = skills 2 = equipments 3 = Stats 4 = Save 5 = Exit.
But with your modifications, it became 0 = items 1 = skills 2 = hotkeys 3 = equipment 4 = stats 5 = Behavior 6 = Triggers 7 = save 8 = quit
So the equipment scene, by default, returns to the command menu index 2, that's why it returns to hotkeys.

(I'm assuming you are using the default scenes)
In the Scene_Equip you have to look for
$scene = Scene_Menu.new(2)

in def update_right and exchange (2) for (3), the new index.

The same for all of them, stats, save and exit.

Now, in the hotkeys, Behavior and Triggers scenes you probably just have to look for:
$scene = Scene_Map.new

And substitute it for
$scene = Scene_Menu.new(x)

x being 2 for hotkeys, 5 for behavior and 6 for triggers.

Well, try that xD I'm not familiar with BlizzABS at all, so I'm not sure... =/
Happy new year, by the way <3

mroedesigns

Ahh! I figured it out, thank you!! :D :D

It was a pain because a few of them were in the Blizz ABS script [pt 3 if anyone else is wondering], and a few of them were in the Z-Hud script I was using.
But I got it all working now, I'm gonna go post it in the scripts section for others.

Thanks a ton guys!
And happy new years to you as well