[XP] Wizered67's Speed Menu

Started by Wizered67, June 09, 2010, 01:27:31 am

Previous topic - Next topic

Wizered67

Wizered67's Speed Menu
Authors: Wizered67
Version: 0.30
Type: On-map Menu System
Key Term: Custom Menu System



Introduction
Hello, and welcome to my first script. I understand that it is probably not very good and messy, but I wanted to post it anyway. (At least for critique). Recently, I have noticed an increase in the amount of people trying to make an online game with
RMX-OS and Blizz-abs. However, one common problem is that the default menu (and most others) pause the game while other players continue to play and take advantage of this. I know this from experience, as I too am trying to create a game like this, and this has been a major setback. Thereofre, I began looking through google. However, I only could find one script (which btw required SDK  >:() that did what I needed it to. This was ztorm's speed menu. However, the demo was missing. therefore, I attempted to learn scripting to make the script I needed. I don't know if anyone will use it, but oh well


Features


  • On-map menu
  • doesn't pause game
  • my first script  ;)

Right now, I haven't made special windows for item, equip, skills , etc and plan on adding that later. (Note how its only version 0.30)


Screenshots

Spoiler: ShowHide



Demo

None yet, but I can make one


Script

Place the script above main, but below menu and map scenes.
Spoiler: ShowHide

#------------------------------------------------------------------------------
#This is my Speed Menu by Wizered67. If you have any questions,
#visit www.chaos-project.com. To show the menu on the map,
#you press shift. To move the cursor over or select an option, you have
#to hold down control and move the arrow keys. I hope this is easy enough and works
#fine. This curently doesn't support mouse control or have any of the scenes.

##############################################################################
#SPEED MENU
#By Wizered67
#version 0.30
##############################################################################
#-------------------------------------------------------------------------------
#==============================================================================
# ** Window_Speed_Menu
#------------------------------------------------------------------------------
#  This window displays the menu in a window like format on the map instead
#  of the menu scene.
#==============================================================================

class Window_Speed_Menu < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(0, 64, 640, 64)  
   self.contents = Bitmap.new(width - 32, height - 32)
   @item_max = 5
   @column_max = 4
   @commands = ["Item", "Skill", "Equip","Status","End Game"]
   refresh
   self.index = 0
end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i)
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #--------------------------------------------------------------------------
 def draw_item(index)
   x = 4 + index * 160
   self.contents.draw_text(x, 0, 128, 32, @commands[index])
  end
end
#-----------------------------------------------------------------------------
# Update Menu
#-----------------------------------------------------------------------------
def update_speed_menu
#-------------------------------------------------------------------------
#Check for input (Select Choice)
#-------------------------------------------------------------------------
if Input.press?(Input::Key['Ctrl'])
if Input.trigger?(Input::C)
   case @window_speed_menu.index
       when 0
         $game_system.se_play($data_system.decision_se)
         
         @window_speed_menu.active = false
         @window_speed_menu.visible = false
         $speed_menu_showing = false
         $scene = Scene_Item.new
         when 1
         $game_system.se_play($data_system.decision_se)
         
         @window_speed_menu.active = false
         @window_speed_menu.visible = false
         $speed_menu_showing = false
         $scene = Scene_Skill.new
       when 2
         $game_system.se_play($data_system.decision_se)
       
         @window_speed_menu.active = false
         @window_speed_menu.visible = false
         $speed_menu_showing = false
         $scene = Scene_Equip.new
       when 3
         $status_window_showing = true
         $game_system.se_play($data_system.decision_se)
         
         @window_speed_menu.active = false
         @window_speed_menu.visible = false
         @status_window = Window_MenuStatus.new
         $speed_menu_showing = false
         @status_window.opacity = 160
       @window_gold = Window_Gold.new
@window_gold.opacity = 160
@window_gold.x = 480
@window_gold.y = 350
         when 4
         $game_system.se_play($data_system.decision_se)
         @window_speed_menu.active = false
         @window_speed_menu.visible = false
         $speed_menu_showing = false
         $scene = Scene_End.new
       end
end
end
#-----------------------------------------------------------------------
#Check for Escape Key
#-----------------------------------------------------------------------
if Input.trigger?(Input::Key['Esc']) and ($speed_menu_showing == true or $status_window_showing == true)
  if @window_speed_menu.visible == true
  @window_speed_menu.active = false
 @window_speed_menu.visible = false
 $speed_menu_showing = false
 end
 if $status_window_showing == true
   @window_gold.dispose
   @status_window.dispose
   $status_window_showing = false
   end
 end
#-------------------------------------------------------------------------
#Check for input (Move cursor)
#-------------------------------------------------------------------------
 if Input.press?(Input::Key['Ctrl'])
  if Input.trigger?(Input::RIGHT)
    @window_speed_menu.active = true
    unless @window_speed_menu.index == 3
    $game_system.se_play($data_system.cursor_se)
      @window_speed_menu.index += 1
  else
    $game_system.se_play($data_system.cursor_se)
    @window_speed_menu.index = 0
  end
    end
  if Input.trigger?(Input::LEFT)
    @window_speed_menu.active = true
    unless @window_speed_menu.index <= 0
    $game_system.se_play($data_system.cursor_se)
      @window_speed_menu.index -= 1
  else
    $game_system.se_play($data_system.cursor_se)
    @window_speed_menu.index = 3
    end
end
end
end
#--------------------------------------------------------------------
#Scene_Map
#   def update
# This part of the scene was put into this script with slight differences for plug and play.
#---------------------------------------------------------------------
class Scene_Map
 def update
   # Loop
   loop do
     # Update map, interpreter, and player order
     # (this update order is important for when conditions are fulfilled
     # to run any event, and the player isn't provided the opportunity to
     # move in an instant)
     $game_map.update
     $game_system.map_interpreter.update
     $game_player.update
     # Update system (timer), screen
     $game_system.update
     $game_screen.update
     if @window_speed_menu
     @window_speed_menu.active = true
       update_speed_menu
     end
     # Abort loop if player isn't place moving
     unless $game_temp.player_transferring
       break
     end
     # Run place move
     transfer_player
     # Abort loop if transition processing
     if $game_temp.transition_processing
       break
     end
   end
   # Update sprite set
   @spriteset.update
   # Update message window
   @message_window.update
   # If game over
   if $game_temp.gameover
     # Switch to game over screen
     $scene = Scene_Gameover.new
     return
   end
   # If returning to title screen
   if $game_temp.to_title
     # Change to title screen
     $scene = Scene_Title.new
     return
   end
   # If transition processing
   if $game_temp.transition_processing
     # Clear transition processing flag
     $game_temp.transition_processing = false
     # Execute transition
     if $game_temp.transition_name == ""
       Graphics.transition(20)
     else
       Graphics.transition(40, "Graphics/Transitions/" +
         $game_temp.transition_name)
     end
   end
   # If showing message window
   if $game_temp.message_window_showing
     return
   end
   # If encounter list isn't empty, and encounter count is 0
   if $game_player.encounter_count == 0 and $game_map.encounter_list != []
     # If event is running or encounter is not forbidden
     unless $game_system.map_interpreter.running? or
            $game_system.encounter_disabled
       # Confirm troop
       n = rand($game_map.encounter_list.size)
       troop_id = $game_map.encounter_list[n]
       # If troop is valid
       if $data_troops[troop_id] != nil
         # Set battle calling flag
         $game_temp.battle_calling = true
         $game_temp.battle_troop_id = troop_id
         $game_temp.battle_can_escape = true
         $game_temp.battle_can_lose = false
         $game_temp.battle_proc = nil
       end
     end
   end
   # If B button was pressed
   if Input.trigger?(Input::B)
     # If event is running, or menu is not forbidden
     unless $game_system.map_interpreter.running? or
            $game_system.menu_disabled
       # Set menu calling flag or beep flag
      # $game_temp.menu_calling = true
       #$game_temp.menu_beep = true
     end
   end
   if Input.trigger?(Input::A) && ($speed_menu_showing != true)
     $speed_menu_showing = true
     @window_speed_menu = Window_Speed_Menu.new
    @window_speed_menu.active = true
       @window_speed_menu.visible = true
     @window_speed_menu.opacity = 140
     end
   # If debug mode is ON and F9 key was pressed
   if $DEBUG and Input.press?(Input::F9)
     # Set debug calling flag
     $game_temp.debug_calling = true
   end
   # If player is not moving
   unless $game_player.moving?
     # Run calling of each screen
     if $game_temp.battle_calling
       call_battle
     elsif $game_temp.shop_calling
       call_shop
     elsif $game_temp.name_calling
       call_name
     elsif $game_temp.menu_calling
       call_menu
     elsif $game_temp.save_calling
       call_save
     elsif $game_temp.debug_calling
       call_debug
     end
   end
 end
end
#----------------------
#End Scene Map
#----------------------
#---------------------------------------
#Scene_Menu
# This is just a small edit so that you can't go to the menu scene
#----------------------------------------

class Scene_Menu
 def main
   $scene = Scene_Map.new
 end
end
 
 
 
 
 




Instructions

To open the menu, press shift. To move cursor or select on the menu you MUST be holding down ctrl.


Compatibility

Requires Tons ,Blizz-abs ,or RMX-OS for custom controls
None other issues known.


Credits and Thanks


  • Wizered67, me
  • Blizzard for inspiring me
  • Ztorm for the inspiration to make my own speed menu when his demo was missing.




Author's Notes
This is my first script. I don't really expect anyone to use it, but I figured I might as well post it to get critique. Hit me with your best shot!

nathmatt

June 09, 2010, 03:28:24 pm #1 Last Edit: June 16, 2010, 02:28:00 pm by nathmatt
some points for 1 to disable menu call just use this since your already messing with scene map the return isnt really necessary but anyway
class Scene_Map

def call_menu
    $game_temp.menu_calling = false
  end
end


next you never have to redefine anything if all your doing is adding to it use

alias wizered67's_speed_menu_update update
def update
 wizered67's_speed_menu_update
 if @window_speed_menu
   @window_speed_menu.active = true
   update_speed_menu
 end
end


your script alignment is every where i suggest defining update_speed_menu in the Scene_map class
if you don't know what i mean by the alignment check out other ppls scripts  

edit fixed menu disable
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


SBR*

Hmm... So you're overwriting Scene_Map? Doesn't this mean that it is incompatible with any script that overwrites Scene_Map? Oh, and nath, you want to alias the update method of Scene_Map? Doesn't Scene_Map have an own update loop, so if you enter a map and the menu isn't active, you can't access the menu anymore? It's late, so I didn't really read the script...