Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Closed TopicStart new topic
> Super Simple Mouse Script
shaz68
post Aug 2 2010, 05:47 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 8
Type: Scripter
RM Skill: Advanced




SUPER SIMPLE MOUSE SCRIPT

Version - 1.0
Credits - Amaranth, Near Fantastica, SephirothSpawn, Shaz
Release Date - August 2, 2010



Introduction
This script will let you play your RMXP game with the keyboard or a mouse.


Features
  • Pathfinding
  • Icons on events
  • Custom mouse cursors
  • Mouse-enabled menus


Screenshot
Event commands for mouse system


Enter the icon name as a comment on the first line. The mouse pointer will change to this icon when it moves over the event.
Other options go on the second line (if using both the Mouse and the Name option, Name must come second):
  • Mouse[x-offset,y-offset] will make the PC walk to the offset, then turn and interact with the event
    So, Mouse[1, 2] will make the player walk one tile to the right and two tiles below the event, turn up, and trigger the event.
    Useful for reading signposts, mailboxes, bookshelves, etc, where you want the player to approach from a specific direction
  • Name abc def will make the name appear next to the event when you move the mouse over it



In game


Shows hand icon (Arrow3), Name appears beside the mouse/event, and the player will always approach this chest from the bottom


DEMO
Attached File  SuperSimpleMouseSystem.zip ( 315.66K ) Number of downloads: 507



Script
Copy the following scripts and paste them above Main.
Start Game
CODE
module StartGame

   $game_mouse = true
  
end



Mouse 1
CODE
#==============================================================================
# ** Modules.Mouse Input (7.0)              By Near Fantastica & SephirothSpawn
#==============================================================================
module Mouse
  #--------------------------------------------------------------------------
  # * Mouse to Input Triggers
  #
  #   key => Input::KeyCONSTANT (key: 0 - Left, 1 - Middle, 2 - Right)
  #--------------------------------------------------------------------------
  Mouse_to_Input_Triggers = {0 => Input::C, 1 => Input::B, 2 => Input::A}
  #--------------------------------------------------------------------------
  # * API Declaration
  #--------------------------------------------------------------------------
  GAKS          = Win32API.new('user32',    'GetAsyncKeyState', 'i',     'i')
  GSM           = Win32API.new('user32',    'GetSystemMetrics', 'i',     'i')
  Cursor_Pos    = Win32API.new('user32',    'GetCursorPos',     'p',     'i')
  $ShowCursor   = Win32API.new('user32',    'ShowCursor',       'i',     'l')
  Scr2cli       = Win32API.new('user32',    'ScreenToClient',   %w(l p), 'i')
  Client_rect   = Win32API.new('user32',    'GetClientRect',    %w(l p), 'i')
  Findwindow    = Win32API.new('user32',    'FindWindowA',      %w(p p), 'l')
  Readini       = Win32API.new('kernel32',  'GetPrivateProfileStringA',
                               %w(p p p p l p), 'l')
                              
  # if graphical effects turned on, show fancy cursor
  $ShowCursor.call($game_mouse ? 0 : 1)
  
  @triggers     =   [[0, 1], [0, 2], [0, 4]]
  @old_pos      =   0
  @pos_i        =   0
    
  #--------------------------------------------------------------------------
  # * Mouse Grid Position
  #--------------------------------------------------------------------------
  def self.grid    
    # Return Nil if Position is Nil
    return nil if @pos.nil?
    
    # Get X & Y Locations  
    x = (@pos[0] + $game_map.display_x / 4) / 32
    y = (@pos[1] + $game_map.display_y / 4) / 32
    
    # Vehicle Stuff
    $mouse_x = x
    $mouse_y = y
    
    # Return X & Y
    return [x, y]
    
  end
  #--------------------------------------------------------------------------
  # * Mouse Position
  #--------------------------------------------------------------------------
  def self.position
    return @pos == nil ? [0, 0] : @pos
  end
  #--------------------------------------------------------------------------
  # * Mouse Global Position
  #--------------------------------------------------------------------------
  def self.global_pos
    # Packs 0 Position
    pos = [0, 0].pack('ll')
    # Returns Unpacked Cursor Position Call
    return Cursor_Pos.call(pos) == 0 ? nil : pos.unpack('ll')
  end
  
  #--------------------------------------------------------------------------
  # * Screen to Client
  #--------------------------------------------------------------------------
  def self.screen_to_client(x=0, y=0)
    pos = [x, y].pack('ll')
    return Scr2cli.call(self.hwnd, pos) == 0 ? nil : pos.unpack('ll')
  end  
    
  #--------------------------------------------------------------------------
  # * Mouse Position
  #--------------------------------------------------------------------------
  def self.pos

    global_pos = [0, 0].pack('ll')    
    gx, gy = Cursor_Pos.call(global_pos) == 0 ? nil : global_pos.unpack('ll')

    local_pos = [gx, gy].pack('ll')
    x, y = Scr2cli.call(self.hwnd, local_pos) == 0 ? nil : local_pos.unpack('ll')
    
    # Begins Test
    begin
      # Return X & Y or Nil Depending on Mouse Position
      if (x >= 0 && y >= 0 && x <= 640 && y <= 480)
        return x, y
      else
        return -20, -20
      end
    rescue
      return 0, 0 #nil
    end
    
  end  
    
  #--------------------------------------------------------------------------
  # * Update Mouse Position
  #--------------------------------------------------------------------------
  def self.update
    
    # Update Position
    old_pos = @pos
    @pos = self.pos
    
    # agf = hide system mouse
    if !$mouse_sprite.visible && old_pos != @pos
      $mouse_sprite.visible = true
    end
    
    # when mouse leaves game window, show system mouse
    if old_pos != [-20, -20] && @pos == [-20, -20]
      $ShowCursor.call(1)
    # when mouse is in game window, show custom mouse if it's turned on
    elsif old_pos == [-20, -20] && @pos != [-20, -20]
      $ShowCursor.call($game_mouse ? 0 : 1)
    end

    # Update Triggers
    for i in @triggers
      # Gets Async State
      n = GAKS.call(i[1])
      # If 0 or 1
      if [0, 1].include?(n)
        i[0] = (i[0] > 0 ? i[0] * -1 : 0)
      else
        i[0] = (i[0] > 0 ? i[0] + 1 : 1)
      end
    end
    
  end
  #--------------------------------------------------------------------------
  # * Trigger?
  #     id : 0:Left, 1:Right, 2:Center
  #--------------------------------------------------------------------------
  def self.trigger?(id = 0)
    
    #only user trigger if in range of screen
    pos = self.pos
    if pos != [-20,-20]
    
    case id
      when 0  # Left
        return @triggers[id][0] == 1
      when 1  # Right (only when menu enabled)
        if @triggers[1][0] == 1 && !$game_system.menu_disabled
          return @triggers[id][0] == 1      
        end
      when 2  # Center
        return @triggers[id][0] == 1
    end    
    
    end
    
  end
  #--------------------------------------------------------------------------
  # * Repeat?
  #     id : 0:Left, 1:Right, 2:Center
  #--------------------------------------------------------------------------
  def self.repeat?(id = 0)
    if @triggers[id][0] <= 0
      return false
    else
      return @triggers[id][0] % 5 == 1 && @triggers[id][0] % 5 != 2
    end
  end
  #--------------------------------------------------------------------------
  # * Screen to Client
  #--------------------------------------------------------------------------
  def self.screen_to_client(x=0, y=0)
    # Pack X & Y
    pos = [x, y].pack('ll')
    # Return Unpacked Position or Nil
    return Scr2cli.call(self.hwnd, pos) == 0 ? nil : pos.unpack('ll')
  end
  #--------------------------------------------------------------------------
  # * Hwnd - window handle
  #--------------------------------------------------------------------------
  def self.hwnd
    if @hwnd.nil?
      # Finds Game Name from ini file
      game_name = "\0" * 256
      Readini.call('Game', 'Title', '', game_name, 255, ".\\Game.ini")
      game_name.delete!("\0")
      # Finds Window
      @hwnd = Findwindow.call('RGSS Player', game_name)
    end
    return @hwnd
  end
  #--------------------------------------------------------------------------
  # * Client Size
  #--------------------------------------------------------------------------
  def self.client_size
    # Packs Empty Rect
    rect = [0, 0, 0, 0].pack('l4')
    # Gets Game Window Rect
    Client_rect.call(self.hwnd, rect)
    # Unpacks Right & Bottom
    right, bottom = rect.unpack('l4')[2..3]
    # Returns Right & Bottom
    return right, bottom
  end
end

#==============================================================================
# ** Input
#==============================================================================

class << Input
  #------------------------------------------------------------------------
  # * Alias Listings
  #------------------------------------------------------------------------
  unless self.method_defined?(:seph_mouse_input_update)
    alias_method :seph_mouse_input_update,   :update
    alias_method :seph_mouse_input_trigger?, :trigger?
    alias_method :seph_mouse_input_repeat?,  :repeat?
  end
  #------------------------------------------------------------------------
  # * Frame Update
  #------------------------------------------------------------------------
  def update
    # Update Mouse
    Mouse.update
    # Original Update
    seph_mouse_input_update
  end
  #--------------------------------------------------------------------------
  # * Trigger? Test
  #--------------------------------------------------------------------------
  def trigger?(constant)
    # Return true if original test is true
    return true if seph_mouse_input_trigger?(constant)
    # If Mouse Position isn't Nil
    unless Mouse.pos.nil?
      # If Mouse Trigger to Input Trigger Has Constant
      if Mouse::Mouse_to_Input_Triggers.has_value?(constant)
        # Return True if Mouse Triggered
        mouse_trigger = Mouse::Mouse_to_Input_Triggers.index(constant)
        return true if Mouse.trigger?(mouse_trigger)      
      end
    end
    # Return False
    return false
  end
  #--------------------------------------------------------------------------
  # * Repeat? Test
  #--------------------------------------------------------------------------
  def repeat?(constant)
    # Return true if original test is true
    return true if seph_mouse_input_repeat?(constant)
    # If Mouse Position isn't Nil
    unless Mouse.pos.nil?
      # If Mouse Trigger to Input Trigger Has Constant
      if Mouse::Mouse_to_Input_Triggers.has_value?(constant)
        # Return True if Mouse Triggered
        mouse_trigger = Mouse::Mouse_to_Input_Triggers.index(constant)    
        return true if Mouse.repeat?(mouse_trigger)
      end
    end
    # Return False
    return false
  end
end


#==============================================================================
#  ¦ Path Finding
#==============================================================================
# Near Fantastica
# Version 1
# 29.11.05
#==============================================================================

  class Game_Character
    #--------------------------------------------------------------------------
    alias nf_pf_game_character_initialize initialize
    alias nf_pf_game_character_update update
    #--------------------------------------------------------------------------
    attr_accessor :map
    attr_accessor :runpath
    attr_accessor :ovrdest
    #--------------------------------------------------------------------------
    def initialize
      nf_pf_game_character_initialize
      @map = nil
      @runpath = false
      @ovrdest = false
    end
    #--------------------------------------------------------------------------
    def update
      run_path if @runpath == true
      nf_pf_game_character_update
    end
    #--------------------------------------------------------------------------
    def run_path
      return if moving?
      step = @map[@x,@y]
      if step == 1
        @map = nil
        @runpath = false
        return
      end
      
      dir = rand(2)
      case dir
      when 0
        move_right if @map[@x+1,@y] == step - 1 and step != 0
        move_down if @map[@x,@y+1] == step - 1 and step != 0
        move_left if @map[@x-1,@y] == step -1 and step != 0
        move_up if @map[@x,@y-1] == step - 1 and step != 0
      when 1
        move_up if @map[@x,@y-1] == step - 1 and step != 0
        move_left if @map[@x-1,@y] == step -1 and step != 0
        move_down if @map[@x,@y+1] == step - 1 and step != 0
        move_right if @map[@x+1,@y] == step - 1 and step != 0
      end
    end
    #--------------------------------------------------------------------------
    def find_path(x,y, force = true)
      sx, sy = @x, @y
      result = setup_map(sx,sy,x,y)      
      @runpath = result[0]
      @map = result[1]
      @map[sx,sy] = result[2] if result[2] != nil
      $game_player.ignore_movement = @runpath ? force : false
    end
    #--------------------------------------------------------------------------
    def clear_path
      @map = nil
      @runpath = false
      @ovrdest = false
      $game_player.ignore_movement = false
    end
    #--------------------------------------------------------------------------
    def setup_map(sx,sy,ex,ey)
      map = Table.new($game_map.width, $game_map.height)

      # Shaz - adding this comment to the second line of the event commands
      #     Mouse[0,1]
      # will cause the player to go to the tile BELOW the event, turn up,
      # and interact with the event ([0,1] is x+0, y+1)
      tx = ex
      ty = ey
      event = $game_map.event_at(ex, ey)
      if !event.nil? && !event.list.nil? && !event.erased &&
        event.list.size > 1 && event.list[1].code == 108
        text = event.list[1].parameters.to_s
        text.gsub!(/[Mm][Oo][Uu][Ss][Ee]\[([-,0-9]+),([-,0-9]+)\]/) do
          tx = ex + $1.to_i
          ty = ey + $2.to_i
          map[ex, ey] = 999
          @ovrdest = true
        end
      end
      
      update_counter = 0
      map[tx,ty] = 1
      old_positions = []
      new_positions = []
      old_positions.push([tx, ty])
      depth = 2
      $path_allow = false
      depth.upto(100){|step|
        loop do
          break if old_positions[0] == nil
          x,y = old_positions.shift
          return [true, map, step-1] if x == sx and y == sy
          if map[x,y + 1] == 0 and $game_player.passable?(x, y, 2, step, tx, ty)
            map[x,y + 1] = step
            new_positions.push([x,y + 1])
          end
          if map[x - 1,y] == 0 and $game_player.passable?(x, y, 4, step, tx, ty)
            map[x - 1,y] = step
            new_positions.push([x - 1,y])
          end
          if map[x + 1,y] == 0 and $game_player.passable?(x, y, 6, step, tx, ty)
            map[x + 1,y] = step
            new_positions.push([x + 1,y])
          end
          if map[x,y - 1] == 0 and $game_player.passable?(x, y, 8, step, tx, ty)
            map[x,y - 1] = step
            new_positions.push([x,y - 1])
          end
          
          # If we've checked quite a few tiles, allow graphics and input
          # to update - to avoid the 'script hanging' error
          update_counter += 1
          if update_counter > 100
            Graphics.update
            update_counter = 0
          end
        end
        
        old_positions = new_positions
        new_positions = []
      }
      
      @ovrdest = false
      return [false, nil, nil]        
        
    end
  end
  
  class Game_Map
    #--------------------------------------------------------------------------
    alias pf_game_map_setup setup
    #--------------------------------------------------------------------------
    def setup(map_id)
      pf_game_map_setup(map_id)
      $game_player.clear_path
    end
  end
  
  class Game_Player
    #--------------------------------------------------------------------------
    alias pf_game_player_update update
    #--------------------------------------------------------------------------
    def update
      $game_player.clear_path if Input.dir4 != 0
      pf_game_player_update
    end
  end
  
  class Interpreter
    #--------------------------------------------------------------------------
    def event
      return $game_map.events[@event_id]
    end
  end


Mouse 2
CODE
#==============================================================================
# ** MouseCursor
#==============================================================================

module MouseCursor
    Default_Cursor = 'Arrow'
    Event_Cursor   = 'Arrow3'
    Actor_Cursor   = 'Arrow'
    Enemy_Cursor   = 'Arrow4'
    Item_Cursor    = true
    Skill_Cursor   = true
    Dummy = Bitmap.new(32, 32)
end

#==============================================================================
# ** Sprite_Mouse
#==============================================================================

class Sprite_Mouse < Sprite
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super
    self.z = 10100
    self.ox = 4
    update
  end
  #--------------------------------------------------------------------------
  # ** Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    
    # Update Visibility
    self.visible = $scene != nil
    
    # If Visible
    if self.visible
      
      # If Non-nil Mouse Position
      if Mouse.position != nil
        
        # Gets Mouse Position
        mx, my = *Mouse.position
        
        # Update POsition
        self.x = mx unless mx.nil?
        self.y = my unless my.nil?      
        
      end
      
      # If Scene changes or Mouse is Triggered
      if @scene != $scene.class || Mouse.trigger?
        
        # Update Scene Instance
        @scene = $scene.class
        
        # Update Bitmap
        set_bitmap(MouseCursor::Default_Cursor)
      end
      
    end
    
  end
  #--------------------------------------------------------------------------
  # ** Set Bitmap
  #--------------------------------------------------------------------------
  def set_bitmap(cursor, xNPCname = nil)
    
    # show fancy cursor only if custom mouse on
    if $game_mouse
            
      # If Cursor Info matches
      if (@_cursor == cursor) && (@_NPCname == xNPCname)
        return
      end
      
      # Reset Cursor Info
      @_cursor      = cursor
      @_NPCname     = xNPCname
      
      # Gets Dummy
      dummy = MouseCursor::Dummy
      
      # Gets Item Cursor Bitmap
      item_cursor = cursor.nil? ? MouseCursor::Default_Cursor : cursor
      
      # Start Cursor Bitmap
      bitmap = RPG::Cache.icon(item_cursor) if item_cursor != ''

      # Show NPC name
      if @_NPCname != nil
        # Get name width
        w = dummy.text_size(@_NPCname).width
        h = dummy.font.size
        b = RPG::Cache.icon(item_cursor)
        # Create New Bitmap
        bitmap = Bitmap.new((bitmap.nil? ? w : 40 + w), [b.height, h + 2].max)
        bitmap.font.size = dummy.font.size
        bitmap.blt(0, 0, b, b.rect)
        # Draw NPC Name
        x = item_cursor == '' ? 0 : 32
        bitmap.font.color = Color.new(0, 0, 0, 255) # black
        bitmap.draw_text(b.width + 9, 0, w, h, @_NPCname) # 0
        bitmap.draw_text(b.width + 11, 0, w, h, @_NPCname) # 0
        bitmap.draw_text(b.width + 10, -1, w, h, @_NPCname) # -1
        bitmap.draw_text(b.width + 10, 1, w, h, @_NPCname) # 1
        bitmap.font.color = Color.new(255, 255, 255, 255) # white
        bitmap.draw_text(b.width + 10, 0, w, h, @_NPCname)
      end    

      # Set Bitmap
      self.bitmap = bitmap
      
    elsif self.bitmap
      @_cursor = nil
      self.bitmap = nil
      
    end
    
  end
  #--------------------------------------------------------------------------
  # ** Frame Update : Update Event Cursors
  #--------------------------------------------------------------------------
  def update_event_cursors
    
    # If Nil Grid Position
    if Mouse.grid.nil?
      # Set Default Cursor
      set_bitmap(MouseCursor::Default_Cursor)
      return
    end
    
    # Gets Mouse Position
    x, y = *Mouse.grid
    
    # Gets Mouse Position
    mx, my = *Mouse.position    
    
    # Gets Mouse Event
    event = $game_map.event_at(x, y)
    
    # If Non-Nil Event or not over map HUD
    unless event.nil?
      # If Not Erased or Nil List
      if event.list != nil && event.erased == false && event.list[0].code == 108
        # Get the cursor to show
        icon = event.list[0].parameters
        icon = icon.to_s
        if !((icon == "Arrow2") ||
           (icon == "Arrow3") ||
           (icon == "Arrow4") ||
           (icon == "Arrow5") ||
           (icon == "Arrow6") ||
           (icon == "Arrow7"))
           icon = MouseCursor::Default_Cursor
        end        
        xNPCname = nil
        if event.list.size > 1 && event.list[1].code == 108
          text = event.list[1].parameters.to_s
          text.gsub!(/[Nn][Aa][Mm][Ee] (.*)/) do
            xNPCname = $1.to_s
          end
        end
        set_bitmap(icon, xNPCname)    
        return
      end
      return
    end
    
    # Set Default Cursor
    set_bitmap(MouseCursor::Default_Cursor)
    
  end
end

#==============================================================================
# ** Input
#==============================================================================

class << Input
  #------------------------------------------------------------------------
  # * Alias Listings
  #------------------------------------------------------------------------
  unless self.method_defined?(:sephlamchop_mousesys_input_update)
    alias_method :sephlamchop_mousesys_input_update,   :update
  end
  #------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    $mouse_sprite.update if $mouse_sprite.visible
    # Original Update
    sephlamchop_mousesys_input_update
  end
end


Mouse 3 (part 1)
CODE
WORLD_MAP_ID = 1

#==============================================================================
# ** Game_Map
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # * Event At
  #--------------------------------------------------------------------------
  def event_at(x, y)
    for event in @events.values
        return event if event.x == x && event.y == y
    end
    return nil
  end
  
  #--------------------------------------------------------------------------
  # * Events At (returns multiple events at the same position in an array)
  #--------------------------------------------------------------------------
  def events_at(x, y)
    eventarray = []
    for event in @events.values
      eventarray.push event if event.x == x && event.y == y
    end
    return eventarray if eventarray.size > 0
    return nil
  end

end

#==============================================================================
# ** Game_Event
#==============================================================================

class Game_Event
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :erased                  # trigger
  attr_accessor :mouse_autostart         # mouse autostart boolean
  attr_accessor :mouse_cursor_icon       # mouse cursor icon
  attr_accessor :mouse_cursor_desc       # mouse cursor desc
  attr_reader   :name                    # name of event
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_gmevt_refresh, :refresh
  #--------------------------------------------------------------------------
  # * Start Event
  #--------------------------------------------------------------------------
  def start
    # If list of event commands is not empty
    if @list && @list.size > 1
      @starting = true
    end
  end  

  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------  
  def refresh
    # Original Refresh
    sephlamchop_mousesys_gmevt_refresh
    # Click triggers event for action button, player or event touch
    @mouse_autostart   = [0, 1, 2].include?(@trigger)
    @mouse_cursor_icon = MouseCursor::Event_Cursor
    @mouse_cursor_desc = nil
    # Return if Erased or Nil List
    #return if @erased || @list.nil?
    
  end
end

#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
  
  def passable?(x, y, d, step = 999, tx = nil, ty = nil)
    
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    
    # If coordinates are outside of map
    unless $game_map.valid?(new_x, new_y)
      return false
    end
    
    # If through is ON
    if @through
      return true
    end
    
    # Able to leave current tile in desired direction?
    # SHAZ: for counter, must be old, counter, new, in a straight line
    unless $game_map.passable?(x, y, d, self) || (step == 2 && $game_map.event_at(x, y)) ||
      (step == 3 && $game_map.counter?(x, y) && tx != nil && ty != nil &&
      new_x - x == x - tx && new_y - y == y - ty)
      return false
    end
    
    # Able to enter adjoining tile in current direction?
    unless $game_map.passable?(new_x, new_y, 10 - d) ||
      (step == 2 && $game_map.counter?(new_x, new_y))
      return false
    end

    # SHAZ - ignore events sitting on a counter next to the destination
    if step != 2 || !$game_map.counter?(new_x, new_y)          
      # Loop all events
      for event in $game_map.events.values
        # If event coordinates are consistent with move destination
        if event.x == new_x and event.y == new_y
          @state = true
          # If through is OFF
          unless event.through
            # If self is event
            if self != $game_player
              return false
            end
            # With self as the player and partner graphic as character
            if event.character_name != ""
              return false
            end
          end
        end
      end
    end
    
    # If on world map, don't allow to go through events.  Otherwise,
    # the event will be triggered while the PC is walking
    if $game_map.map_id == WORLD_MAP_ID && @state == false
      return false
    end      

    # If player coordinates are consistent with move destination
    if $game_player.x == new_x && $game_player.y == new_y && self != $game_player
      # If through is OFF
      unless $game_player.through
        # If your own graphic is the character
        if @character_name != ""
          return false
        end
      end
    end

    return true
    
  end
end

#==============================================================================
# ** Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_gmplyr_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Unless Interpreter Running, Forcing a Route or Message Showing
    unless $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
          
      # Find Path If Mouse Triggered
      if Mouse.trigger?(0) && Mouse.grid != nil

        # Check if mouse is over HUD on map
        screen_x,screen_y = Mouse.pos
        
        # Gets Mouse X & Y
        mx, my = *Mouse.grid
        
        # Turn Character in direction
        newd_x = (@x - mx).abs
        newd_y = (@y - my).abs
        
        if @x > mx
            turn_left if newd_x >= newd_y
        elsif @x < mx
            turn_right if newd_x >= newd_y
        end  
            
        if @y > my
            turn_up if newd_x < newd_y
        elsif @y < my
            turn_down if newd_x < newd_y
        end

        # Run Pathfinding
        find_path(mx, my, false)
        
        # Gets Event
        @eventarray = @runpath ? $game_map.events_at(mx, my) : nil
        # If Event At Grid Location
        unless @eventarray.nil?
          @eventarray.each do |event|
            # If Event Autostart
            if !event.mouse_autostart
              @eventarray.delete(event)
            end
          end
          @eventarray = nil if @eventarray.size == 0
        end
        
      end
    end
    
    if @move_route_forcing
      clear_path
      @eventarray = nil
    end
    
    # Original Update
    sephlamchop_mousesys_gmplyr_update
    # If Non-nil Event Autostarter
    if @eventarray != nil && !moving? &&
      (!@ovrdest || @map.nil? || @map[@x,@y] == 1)
      # Gets Event
      @eventarray.each do |event|
      
        # If Event Within Range
        if event and (@x == event.x or @y == event.y)
          # SHAZ - trigger event when:
          # - Action button and standing on or beside, or with a counter between
          # - player/event touch and standing as close as possible (on, if possible)
          distance = Math.hypot(@x - event.x, @y - event.y)
          dir = @x < event.x ? 6 : @x > event.x ? 4 : @y < event.y ? 2 : @y > event.y ? 8 : 0
          if (event.trigger == 0 and (distance < 2 or (distance == 2 and
            $game_map.counter?((@x+event.x)/2, (@y+event.y)/2)))) or
            ([1,2].include?(event.trigger) and ((distance == 0 and
            $game_player.passable?(@x, @y, dir)) or (distance == 1 and
            !$game_player.passable?(@x, @y, dir))))
            # Turn toward Event
            if @x == event.x
              turn_up if @y > event.y
              turn_down if @y < event.y
            else
              turn_left if @x > event.x
              turn_right if @x < event.x
            end
            # Start Event
            clear_path
            event.start
            @eventarray.delete(event)
            @eventarray = nil if @eventarray.size == 0
          end
        end
      
      end      
    end

  end
  
  def passable?(x1, y1, d, step = 999, tx = nil, ty = nil)
    super
  end
  
end

#==============================================================================
# ** Mouse Selectable Windows
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 2.1
#==============================================================================
#==============================================================================
# ** Window_Base
#==============================================================================

class Window_Base
  #--------------------------------------------------------------------------
  # * Frame Update : Mouse Cursor - Item
  #--------------------------------------------------------------------------
  def update_mouse_cursors_item(item, cursor, show)
    # Return if not Active
    return unless self.active
    # Return if nil Position
    return if Mouse.position.nil?
    # Gets Mouse Position
    mx, my = Mouse.position
    # Gets Cursor Position
    cr = self.cursor_rect
    cx, cy = cr.x + self.x + 16, cr.y + self.y + 16
    cw, ch = cr.width, cr.height
    # If Not on Item
    if mx.between?(self.x, self.x + self.width) == false ||
       my.between?(self.y, self.y + self.height) == false || item.nil? ||
       @item_max == 0 || mx.between?(cx, cx + cw) == false ||
       my.between?(cy, cy + ch) == false
      # Clear Mouse Index
      @mouse_index = nil
      # Set Mouse to Default Cursor
      $mouse_sprite.set_bitmap(MouseCursor::Default_Cursor)
      return
    end
    # If Index is different than mouse index and window active
    if @mouse_index != @index
      # Reset Index
      @mouse_index = @index
      # set to item icon if cursor is true
      cursor = item.icon_name if cursor
      # Set Bitmap
      $mouse_sprite.set_bitmap(cursor)
    end
  end
  
end

class Window_Selectable
  #--------------------------------------------------------------------------
  # * Default Settings
  #--------------------------------------------------------------------------
  Default_Mouse_Selectable = true
  Default_Window_Padding   = 16
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :mouse_selectable
  attr_accessor :window_padding
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_mouseselectable_wndslct_init,   :initialize
  alias_method :seph_mouseselectable_wndslct_update, :update
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    # Original Initialization
    seph_mouseselectable_wndslct_init(x, y, width, height)
    # Set Mouse Selectable Flag
    @mouse_selectable = Default_Mouse_Selectable
    @window_padding   = Default_Window_Padding
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    
    # agf = hide mouse
    if $mouse_sprite.visible == true
    
    # If Mouse Selectable, Active, at Least 1 Item and Non-negitive index
    if self.mouse_selectable && self.active && @item_max > 0 && @index >= 0
      # Gets Mouse Position
      mouse_x, mouse_y = *Mouse.position
      
      # If Mouse Within Window      
      if mouse_x.between? (self.x, self.x + self.width) &&
         mouse_y.between? (self.y, self.y + self.height)
        # Calculates Mouse X and Y Position Within Window
        mouse_x -= self.x; mouse_y -= self.y
        # Subtracts Window Padding
        mouse_x -= @window_padding; mouse_y -= @window_padding
        # Subtracts Mouse Oh
        mouse_y -= self.mouse_oh
        # Gets Cursor Width
        cursor_width = (self.width / @column_max - 32)
        # Passes Through Item Max
        for i in 0...@item_max
          # Calculates Index Position
          x = i % @column_max * (cursor_width + 32)
          y = i / @column_max * self.oh - self.oy
          # If Mouse Between Rect
          if mouse_x.between?(x, x + cursor_width) &&
             mouse_y.between?(y, y + self.oh)
            # Set Index
            prev_index = @index
            @index = i
            if prev_index != @index
              $game_system.se_play($data_system.cursor_se)
            end
            break
          end
        end
      end
    end
    
    end
    
    # Original Update
    seph_mouseselectable_wndslct_update
  end
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 32
  end
  #--------------------------------------------------------------------------
  # * Mouse Oh
  #--------------------------------------------------------------------------
  def mouse_oh
    return 0
  end  
  
end


Mouse 3 (part 2)

Attach the following to the end of the previous script - I had to split it into two as I couldn't add it as a spoiler otherwise.

CODE
#==============================================================================
# ** Window_MenuStatus
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 60
  end
end

#==============================================================================
# ** Window_Target
#==============================================================================

class Window_Target < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 105
  end
end

#==============================================================================
# ** Window_BattleReserve
#==============================================================================

class Window_BattleReserve < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 105
  end
end

#==============================================================================
# ** Window_EquipRight
#==============================================================================

class Window_EquipRight < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 50
  end
  
  #--------------------------------------------------------------------------
  # * Mouse Oh
  #--------------------------------------------------------------------------
  def mouse_oh
    return 140
  end  
  
end

#==============================================================================
# ** Window_Message
#==============================================================================

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # * Mouse Oh
  #--------------------------------------------------------------------------
  def mouse_oh
    return $game_temp.choice_start * 32
  end
end

#==============================================================================
# ** Window_Party
#==============================================================================

class Window_Party < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 52
  end
end


#==============================================================================
# ** Window_Menu
#==============================================================================

class Window_Menu < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 35
  end
end

#==============================================================================
# ** Window_ActorCommand
#==============================================================================

class Window_ActorCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    if $mouse_sprite.visible
      
      # if Mouse sleectable, active, at least 1 item and non-negative index
      if self.mouse_selectable && self.active && @item_max > 0 && @index >= 0
        # Get / check mouse position
        mouse_x, mouse_y = *Mouse.position
        
        if mouse_x.between?(self.x, self.x + self.width) &&
          mouse_y.between?(self.y, self.y + self.height)
          
          # Calculates mouse position within window
          mouse_x -= self.x
          mouse_y -= self.y
          
          # Subtracts widnow padding and overhead
          mouse_x -= @window_padding
          mouse_y -= @window_padding - self.mouse_oh
          
          # Look through all items
          for i in 0...@item_max
            ix,iy = @positions[i]
            if mouse_x.between?(ix, ix + 32) && mouse_y.between?(iy, iy + self.oh)
              if i != @index
                $game_system.se_play($data_system.cursor_se)
              end
              @index = i
              break
            end
          end
        end
      end
    end
    
    super
  end
  
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 32  
  end
end


#==============================================================================
# ** Window_NameInput
#==============================================================================

class Window_NameInput < Window_Base
  #--------------------------------------------------------------------------
  # * Default Settings
  #--------------------------------------------------------------------------
  Default_Mouse_Selectable = true
  Default_Window_Padding = 16
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :mouse_selectable
  attr_accessor :window_padding
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :shaz_mouseselectable_wndslct_init,   :initialize
  alias_method :shaz_mouseselectable_wndslct_update, :update
  #--------------------------------------------------------------------------
  # ● Initialize the Name Input window
  #--------------------------------------------------------------------------
  def initialize
    # Original Initialization
    shaz_mouseselectable_wndslct_init
    # Set Mouse Selectable Flag
    @mouse_selectable = Default_Mouse_Selectable
    @window_padding = Default_Window_Padding
  end

  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------

  def update
    
    # if mouse selectable, visible, active, and non-negative index
    if $mouse_sprite.visible && self.mouse_selectable && self.active &&
      @index >= 0
      
      # Get mouse position
      mouse_x, mouse_y = *Mouse.position
      
      # If mouse within window
      if mouse_x.between? (self.x, self.x + self.width) &&
        mouse_y.between? (self.y, self.y + self.height)
        
        # Calculates mouse X and Y positions within window
        mouse_x -= self.x; mouse_y -= self.y
        
        # Subtracts window padding
        mouse_x -= @window_padding; mouse_y -= @window_padding
        
        # Subtracts mouse oh
        mouse_y -= self.mouse_oh
        
        # Gets cursor width
        cursor_width = 28
        
        # If not Submit button, pass through all items
        if mouse_x.between?(428, 428+48) && mouse_y.between?(9*32, 9*32+32)
          $game_system.se_play($data_system.cursor_se) if @index != 180
          @index = 180
        else
          for i in 0..90  
            
            # Calculate index position
            x = 140 + i / 5 / 9 * 180 + i % 5 * 32
            y = i / 5 % 9 * 32
            
            # If mouse between rect
            if mouse_x.between?(x, x + cursor_width) &&
              mouse_y.between?(y, y + self.oh)
              # set index
              prev_index = @index
              @index = i
              if prev_index != @index
                $game_system.se_play($data_system.cursor_se)
              end
              break
            end
          end
        end
      end
    end
    
    # Original update
    shaz_mouseselectable_wndslct_update
  end
  
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  
  def oh
    return 32
  end
  
  #--------------------------------------------------------------------------
  # * Mouse Oh
  #--------------------------------------------------------------------------
  
  def mouse_oh
    return 0
  end
  
end


#==============================================================================
# ** Scene_File
#==============================================================================

class Scene_File
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_scnfl_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    
    # agf = hide mouse
    if $mouse_sprite.visible == true    
    
    # If Mouse Position isn't Nil
    if Mouse.pos != nil
      
      # Gets Mouse Position
      x, y = Mouse.pos
      y = y + 32
      
      # Pass Through Savefile Windows
      for i in 0...@savefile_windows.size
        
        # Gets Window
        w = @savefile_windows[i]
        
        # Don't allow user to select autosave slot in Load Menu
        if @autosave_slot == false
          i = 1 if i == 0
        end
        
        # If Within Window Range
        if x.between?(w.x, w.x + w.width) &&
           y.between?(w.y, w.y + w.height) && w.active
                      
          prev_index = @file_index
          
          # Set File Index
          @file_index = i
          
          # Turns Window On
          w.selected = true
          
          # Play SE
          if prev_index != @file_index
            $game_system.se_play($data_system.cursor_se)
          end          
          
          # Unhighlight remaining windows
          for j in 0...@savefile_windows.size
            if j != i
               @savefile_windows[j].selected = false
            end
          end        

          # Don't select autosave slot in Load Menu
          if @autosave_slot == false
            @savefile_windows[0].selected = false if i == 1
          end
          
          # Break Main Loop
          break            
        end
      end
    end
  
    end
  
    # Original Update
    sephlamchop_mousesys_scnfl_update
  end
end


#==============================================================================
# ** Game_Battler
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Battler Width
  #--------------------------------------------------------------------------
  def battler_width
    return RPG::Cache.battler(@battler_name, @battler_hue).width
  end
  #--------------------------------------------------------------------------
  # * Battler Height
  #--------------------------------------------------------------------------
  def battler_height
    return RPG::Cache.battler(@battler_name, @battler_hue).height
  end
end

#==============================================================================
# ** Arrow_Enemy
#==============================================================================

class Arrow_Enemy < Arrow_Base
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_mouseselectablewindows_arrenmy_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Original Update
    seph_mouseselectablewindows_arrenmy_update
    
    if $mouse_sprite.visible == true
      # Return if Nil Mouse Position
      return if Mouse.position.nil?
      # Gets Mouse Position
      mx, my = *Mouse.position
      # Pass Through Enemies
      $game_troop.enemies.each do |enemy|
        # Skip if Non-Existing Enemy
        next unless enemy.exist?
        # Gets Paddings
        w, h = enemy.battler_width / 2, enemy.battler_height
        # If Within Mouse Padding Range
        if mx.between?(enemy.screen_x - w, enemy.screen_x + w) &&
           my.between?(enemy.screen_y - h, enemy.screen_y + 10)
          # Set Index
          @index = $game_troop.enemies.index(enemy)
          # Set mouse cursor to bitmap
          $mouse_sprite.set_bitmap(MouseCursor::Enemy_Cursor)
          return
          # break
        end
      end
    
      # Set Mouse to Default Cursor
      $mouse_sprite.set_bitmap(MouseCursor::Default_Cursor)
    end
    
  end
end

#==============================================================================
# ** Arrow_Actor
#==============================================================================

class Arrow_Actor < Arrow_Base
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_mouseselectablewindows_arractr_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Original Update
    seph_mouseselectablewindows_arractr_update
    # Return if Nil Mouse Position
    return if Mouse.position.nil?
    # Gets Mouse Position
    mx, my = *Mouse.position
    # Pass Through Actors
    $game_party.actors.each do |actor|
      # Gets Paddings
      w, h = actor.battler_width / 2, actor.battler_height
      # If Within Mouse Padding Range
      if mx.between?(actor.screen_x - w, actor.screen_x + w) &&
         my.between?(actor.screen_y - h, actor.screen_y + 10)
        # Set Index
        @index = $game_party.actors.index(actor)
      end
    end
  end
end

#==============================================================================
# ** Scene_Map
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_scnmap_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Unless Message Showing
    unless $game_temp.message_text
      # Update Event Cursors
      $mouse_sprite.update_event_cursors
    end
    # Original Update
    sephlamchop_mousesys_scnmap_update
  end
end

#==============================================================================
# ** Interpreter
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :shaz_mousesys_intrprtr_command_101, :command_101
  #--------------------------------------------------------------------------
  # * Show Text
  #--------------------------------------------------------------------------
  def command_101
    # return mouse sprite to default cursor
    $mouse_sprite.set_bitmap(MouseCursor::Default_Cursor)
    # original command_101
    shaz_mousesys_intrprtr_command_101
  end
end

$mouse_sprite = Sprite_Mouse.new

# game mouse is visible, system mouse is hidden
$mouse_sprite.visible = true





Customization
  • This script uses the four Arrow cursors contained in the Graphics/Icons folder, which can be modified.
  • To add new mouse cursors, add your image to the Icons folder, and to the Mouse 2 script (at the top, and around line 151).


Compatibility
  • This script redefines Game_Character.passable? - if you have made any additions to this function, or you use any other scripts that have made mods to this function, they will need to be reapplied here.
  • If you have scripts for any new Window_Selectable based windows that use item sizes other than the default, you may need to define oh or mouse_oh functions similar to those contained in the Mouse 3 script.



FAQ


Terms and Conditions
You can use this script in your freeware or commercial game.
Please put Amaranth, Near Fantastica, SephirothSpawn and Shaz in your credits.

This post has been edited by shaz68: Aug 2 2010, 06:49 PM
Go to the top of the page
 
+Quote Post
   
romeboy109
post Aug 2 2010, 08:30 PM
Post #2


Level 5
Group Icon

Group: Member
Posts: 60
Type: Event Designer
RM Skill: Intermediate




Sounds interesting, [trying it now].


__________________________
The Names Romeboy. Romeboy109.

Yo, who likes to write stories or poems? Come to this website if thats you: http://trstories.spruz.com/

[Show/Hide] Games in Production

Cyrus -
Resident Evil XP -
Naruto: The Lost Stories & Missions -
Cyrus 2



Cyrus' Curse

My New game: Cyrus' Curse. This is the link to the website, and I just uploaded the demo not too long ago.

Cyrus' Curse Website

The the direct link to the demo:

Cyrus' Curse Demo






User-Bars (some I copied from other people because they related to me...will I get in trouble?)







Go to the top of the page
 
+Quote Post
   
jomarcenter
post Aug 6 2010, 03:16 AM
Post #3


Level 2
Group Icon

Group: Member
Posts: 17
Type: Developer
RM Skill: Masterful




what i got a problem
when play i got an error about your script which is line 334 pls. help because of my game will release in a few month so help!!!


__________________________
jomarcenter games. we beveled that games never put a price on...
link to the jomarcenter games forums : jomarcenter forums site
User suspended until their 13th birthday -Staff
Go to the top of the page
 
+Quote Post
   
stripe103
post Aug 6 2010, 04:26 AM
Post #4


PHP ERROR: Couldn't get value from UInteger. Value too large
Group Icon

Group: Revolutionary
Posts: 740
Type: Mapper
RM Skill: Intermediate




Since there is two script sections that have that many lines you might maybe tell us what script part it is.

shaz. Really good script. But is there any way to have it check for the characters height. Because moving events is quite hard to click at. The area where you can click is too small I think.

EDIT: Just forgot. Is there any way that you can make a Right Click script that fits with this one? I would really want a right click menu that can be accessed from anywhere as long as you can see the event.


__________________________

By Axerax

The rest of my sig



Go to the top of the page
 
+Quote Post
   
Locke
post Aug 6 2010, 04:28 PM
Post #5


Level 10
Group Icon

Group: Revolutionary
Posts: 151
Type: Mapper
RM Skill: Intermediate




Ah nicely done, pretty simple and..... mouse biggrin.gif


__________________________
We are one (Really i,m not joking)



I've seen many things when mankind rule the land


Which Final Fantasy Character Are You?
Go to the top of the page
 
+Quote Post
   
shaz68
post Aug 8 2010, 01:26 PM
Post #6


Level 1
Group Icon

Group: Member
Posts: 8
Type: Scripter
RM Skill: Advanced




@jomarcenter, what does the error say? Try going to the Mouse 3 script and adding the following after line 78:

CODE
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :ignore_movement          # ignore movement when finding path AGF MOUSE
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_gmchrinitialize, :initialize

  def initialize
    sephlamchop_mousesys_gmchrinitialize
    @ignore_movement = false;
  end


@stripe103, the script checks for the position of the event. I agree, it'd be nice if you could click anywhere on the sprite instead of just the lower part. I'll look into it.

To monitor for right-click, try to add
CODE
  if Input.trigger?(Input::B)
    ... do whatever
  end


We have this in Scene_Map.update to open the menu, but you can probably tinker a bit if you wanted to attach a right-click function to events.
Go to the top of the page
 
+Quote Post
   
jomarcenter
post Aug 9 2010, 04:33 AM
Post #7


Level 2
Group Icon

Group: Member
Posts: 17
Type: Developer
RM Skill: Masterful




QUOTE (shaz68 @ Aug 9 2010, 05:26 AM) *
@jomarcenter, what does the error say? Try going to the Mouse 3 script and adding the following after line 78:

CODE
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :ignore_movement          # ignore movement when finding path AGF MOUSE
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_gmchrinitialize, :initialize

  def initialize
    sephlamchop_mousesys_gmchrinitialize
    @ignore_movement = false;
  end


@stripe103, the script checks for the position of the event. I agree, it'd be nice if you could click anywhere on the sprite instead of just the lower part. I'll look into it.

To monitor for right-click, try to add
CODE
  if Input.trigger?(Input::B)
    ... do whatever
  end


We have this in Scene_Map.update to open the menu, but you can probably tinker a bit if you wanted to attach a right-click function to events.

the erroe code are"mouse 1"in line 334


__________________________
jomarcenter games. we beveled that games never put a price on...
link to the jomarcenter games forums : jomarcenter forums site
User suspended until their 13th birthday -Staff
Go to the top of the page
 
+Quote Post
   
stripe103
post Aug 9 2010, 04:51 AM
Post #8


PHP ERROR: Couldn't get value from UInteger. Value too large
Group Icon

Group: Revolutionary
Posts: 740
Type: Mapper
RM Skill: Intermediate




that says the script section and the line, but the whole errorbox is important.

@ Shaz

Yea I saw that, but I don't yet have the scripting knowledge to make one myself.
This was what I was thinking.
Have a script that checks if you right click on an event and then checks all the event pages after a one that starts with the comment %Right-Click% and run that event. That event can have a script call that is like RIGHTCLICK([The menu commands here as an array], "Title of menu") that runs the menu. When something is clicked, the script sets a predefined variable to the index value that that option have. If the player clicks outside of the menu the menu and event stops.


__________________________

By Axerax

The rest of my sig



Go to the top of the page
 
+Quote Post
   
shaz68
post Aug 10 2010, 11:59 PM
Post #9


Level 1
Group Icon

Group: Member
Posts: 8
Type: Scripter
RM Skill: Advanced




@jomarcenter, did you add that code to that part of the script? It should fix the error.

@stripe103, are you talking about just opening up the regular menu with a right-click? That should work already - start a new game and just right-click - it should open up the menu for you. But I'm thinking you're after something more specific that would only be on some events, and not all events would have the same setup. If you want to do something like a Show Choices when the player clicks on the NPC, you'd just have the necessary comments at the top of the event tab, then your Show Choices commands. When the player clicks, the PC will walk up to the NPC, then the choices dialogue will open.
Go to the top of the page
 
+Quote Post
   
stripe103
post Aug 11 2010, 12:26 AM
Post #10


PHP ERROR: Couldn't get value from UInteger. Value too large
Group Icon

Group: Revolutionary
Posts: 740
Type: Mapper
RM Skill: Intermediate




That is the thing, I don't want the player to move to the event. When the player right click an event I want to have a menu pop up beneath the event with options that I've set in the event. Also, since your script involves a Path Finder you could probably make it like this.

A call script: Menu([a], [b]) where a is an array of the options and b is an array with ones and zeros because then it is possible to specify specific options if the player should move to the event before executing the next event command. Like this

If there is a 1 for a option:
When the player click the option, he first moves to the event and then executes the next event command.
Or when there is a 0 for a option:
When the player click the option, he executes the event without moving to it.

This way you can make a menu like
Menu([Speak, Examine, Cancel], [1, 0, 0])

If the player clicks speak, he automatically moves to the event before executing the next event command. If he click any of the other, he don't walk to them, just executes the command from where he is standing.


__________________________

By Axerax

The rest of my sig



Go to the top of the page
 
+Quote Post
   
jomarcenter
post Aug 11 2010, 01:39 AM
Post #11


Level 2
Group Icon

Group: Member
Posts: 17
Type: Developer
RM Skill: Masterful




QUOTE (shaz68 @ Aug 11 2010, 03:59 PM) *
@jomarcenter, did you add that code to that part of the script? It should fix the error.

@stripe103, are you talking about just opening up the regular menu with a right-click? That should work already - start a new game and just right-click - it should open up the menu for you. But I'm thinking you're after something more specific that would only be on some events, and not all events would have the same setup. If you want to do something like a Show Choices when the player clicks on the NPC, you'd just have the necessary comments at the top of the event tab, then your Show Choices commands. When the player clicks, the PC will walk up to the NPC, then the choices dialogue will open.

i didn't add any extra to that script not even once so find what really the problem
some people didn't understand hear the error code
Attached File  problem_1.jpg ( 156.92K ) Number of downloads: 54


This post has been edited by jomarcenter: Aug 11 2010, 01:44 AM


__________________________
jomarcenter games. we beveled that games never put a price on...
link to the jomarcenter games forums : jomarcenter forums site
User suspended until their 13th birthday -Staff
Go to the top of the page
 
+Quote Post
   
PhantomHive000
post Aug 22 2010, 04:09 PM
Post #12


Level 1
Group Icon

Group: Member
Posts: 9
Type: Scripter
RM Skill: Intermediate




I got a problem here it is
when i try to launch the game it says
Error Mouse 3 line 890

$mouse_sprite = Sprite_Mouse.new name error occurred
uninitialized constant Sprite_Mouse

please answer i really want this script dry.gif
Go to the top of the page
 
+Quote Post
   
carnie_natas
post Sep 7 2010, 01:27 PM
Post #13


~Noctem~Shinai~
Group Icon

Group: Revolutionary
Posts: 261
Type: Developer
RM Skill: Advanced




if these peoples problems get worked out i will consider using this script,but im not so sure about it's compatability with my current project/projects.


__________________________
Light one up!
You can run.....But you'll only die tired!
Go to the top of the page
 
+Quote Post
   
jomarcenter
post Sep 9 2010, 03:41 AM
Post #14


Level 2
Group Icon

Group: Member
Posts: 17
Type: Developer
RM Skill: Masterful




problem solved the problem is mouse 3 i post the edited script just for you
mouse 3 edited script
CODE
WORLD_MAP_ID = 1

#==============================================================================
# ** Game_Map
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # * Event At
  #--------------------------------------------------------------------------
  def event_at(x, y)
    for event in @events.values
        return event if event.x == x && event.y == y
    end
    return nil
  end
  
  #--------------------------------------------------------------------------
  # * Events At (returns multiple events at the same position in an array)
  #--------------------------------------------------------------------------
  def events_at(x, y)
    eventarray = []
    for event in @events.values
      eventarray.push event if event.x == x && event.y == y
    end
    return eventarray if eventarray.size > 0
    return nil
  end

end

#==============================================================================
# ** Game_Event
#==============================================================================

class Game_Event
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :erased                  # trigger
  attr_accessor :mouse_autostart         # mouse autostart boolean
  attr_accessor :mouse_cursor_icon       # mouse cursor icon
  attr_accessor :mouse_cursor_desc       # mouse cursor desc
  attr_reader   :name                    # name of event
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_gmevt_refresh, :refresh
  #--------------------------------------------------------------------------
  # * Start Event
  #--------------------------------------------------------------------------
  def start
    # If list of event commands is not empty
    if @list && @list.size > 1
      @starting = true
    end
  end  

  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------  
  def refresh
    # Original Refresh
    sephlamchop_mousesys_gmevt_refresh
    # Click triggers event for action button, player or event touch
    @mouse_autostart   = [0, 1, 2].include?(@trigger)
    @mouse_cursor_icon = MouseCursor::Event_Cursor
    @mouse_cursor_desc = nil
    # Return if Erased or Nil List
    #return if @erased || @list.nil?
    
  end
end

#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
    #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :ignore_movement          # ignore movement when finding path AGF MOUSE
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_gmchrinitialize, :initialize

  def initialize
    sephlamchop_mousesys_gmchrinitialize
    @ignore_movement = false;
  end
  
  def passable?(x, y, d, step = 999, tx = nil, ty = nil)
    
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    
    # If coordinates are outside of map
    unless $game_map.valid?(new_x, new_y)
      return false
    end
    
    # If through is ON
    if @through
      return true
    end
    
    # Able to leave current tile in desired direction?
    # SHAZ: for counter, must be old, counter, new, in a straight line
    unless $game_map.passable?(x, y, d, self) || (step == 2 && $game_map.event_at(x, y)) ||
      (step == 3 && $game_map.counter?(x, y) && tx != nil && ty != nil &&
      new_x - x == x - tx && new_y - y == y - ty)
      return false
    end
    
    # Able to enter adjoining tile in current direction?
    unless $game_map.passable?(new_x, new_y, 10 - d) ||
      (step == 2 && $game_map.counter?(new_x, new_y))
      return false
    end

    # SHAZ - ignore events sitting on a counter next to the destination
    if step != 2 || !$game_map.counter?(new_x, new_y)          
      # Loop all events
      for event in $game_map.events.values
        # If event coordinates are consistent with move destination
        if event.x == new_x and event.y == new_y
          @state = true
          # If through is OFF
          unless event.through
            # If self is event
            if self != $game_player
              return false
            end
            # With self as the player and partner graphic as character
            if event.character_name != ""
              return false
            end
          end
        end
      end
    end
    
    # If on world map, don't allow to go through events.  Otherwise,
    # the event will be triggered while the PC is walking
    if $game_map.map_id == WORLD_MAP_ID && @state == false
      return false
    end      

    # If player coordinates are consistent with move destination
    if $game_player.x == new_x && $game_player.y == new_y && self != $game_player
      # If through is OFF
      unless $game_player.through
        # If your own graphic is the character
        if @character_name != ""
          return false
        end
      end
    end

    return true
    
  end
end

#==============================================================================
# ** Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_gmplyr_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Unless Interpreter Running, Forcing a Route or Message Showing
    unless $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
          
      # Find Path If Mouse Triggered
      if Mouse.trigger?(0) && Mouse.grid != nil

        # Check if mouse is over HUD on map
        screen_x,screen_y = Mouse.pos
        
        # Gets Mouse X & Y
        mx, my = *Mouse.grid
        
        # Turn Character in direction
        newd_x = (@x - mx).abs
        newd_y = (@y - my).abs
        
        if @x > mx
            turn_left if newd_x >= newd_y
        elsif @x < mx
            turn_right if newd_x >= newd_y
        end  
            
        if @y > my
            turn_up if newd_x < newd_y
        elsif @y < my
            turn_down if newd_x < newd_y
        end

        # Run Pathfinding
        find_path(mx, my, false)
        
        # Gets Event
        @eventarray = @runpath ? $game_map.events_at(mx, my) : nil
        # If Event At Grid Location
        unless @eventarray.nil?
          @eventarray.each do |event|
            # If Event Autostart
            if !event.mouse_autostart
              @eventarray.delete(event)
            end
          end
          @eventarray = nil if @eventarray.size == 0
        end
        
      end
    end
    
    if @move_route_forcing
      clear_path
      @eventarray = nil
    end
    
    # Original Update
    sephlamchop_mousesys_gmplyr_update
    # If Non-nil Event Autostarter
    if @eventarray != nil && !moving? &&
      (!@ovrdest || @map.nil? || @map[@x,@y] == 1)
      # Gets Event
      @eventarray.each do |event|
      
        # If Event Within Range
        if event and (@x == event.x or @y == event.y)
          # SHAZ - trigger event when:
          # - Action button and standing on or beside, or with a counter between
          # - player/event touch and standing as close as possible (on, if possible)
          distance = Math.hypot(@x - event.x, @y - event.y)
          dir = @x < event.x ? 6 : @x > event.x ? 4 : @y < event.y ? 2 : @y > event.y ? 8 : 0
          if (event.trigger == 0 and (distance < 2 or (distance == 2 and
            $game_map.counter?((@x+event.x)/2, (@y+event.y)/2)))) or
            ([1,2].include?(event.trigger) and ((distance == 0 and
            $game_player.passable?(@x, @y, dir)) or (distance == 1 and
            !$game_player.passable?(@x, @y, dir))))
            # Turn toward Event
            if @x == event.x
              turn_up if @y > event.y
              turn_down if @y < event.y
            else
              turn_left if @x > event.x
              turn_right if @x < event.x
            end
            # Start Event
            clear_path
            event.start
            @eventarray.delete(event)
            @eventarray = nil if @eventarray.size == 0
          end
        end
      
      end      
    end

  end
  
  def passable?(x1, y1, d, step = 999, tx = nil, ty = nil)
    super
  end
  
end

#==============================================================================
# ** Mouse Selectable Windows
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 2.1
#==============================================================================
#==============================================================================
# ** Window_Base
#==============================================================================

class Window_Base
  #--------------------------------------------------------------------------
  # * Frame Update : Mouse Cursor - Item
  #--------------------------------------------------------------------------
  def update_mouse_cursors_item(item, cursor, show)
    # Return if not Active
    return unless self.active
    # Return if nil Position
    return if Mouse.position.nil?
    # Gets Mouse Position
    mx, my = Mouse.position
    # Gets Cursor Position
    cr = self.cursor_rect
    cx, cy = cr.x + self.x + 16, cr.y + self.y + 16
    cw, ch = cr.width, cr.height
    # If Not on Item
    if mx.between?(self.x, self.x + self.width) == false ||
       my.between?(self.y, self.y + self.height) == false || item.nil? ||
       @item_max == 0 || mx.between?(cx, cx + cw) == false ||
       my.between?(cy, cy + ch) == false
      # Clear Mouse Index
      @mouse_index = nil
      # Set Mouse to Default Cursor
      $mouse_sprite.set_bitmap(MouseCursor::Default_Cursor)
      return
    end
    # If Index is different than mouse index and window active
    if @mouse_index != @index
      # Reset Index
      @mouse_index = @index
      # set to item icon if cursor is true
      cursor = item.icon_name if cursor
      # Set Bitmap
      $mouse_sprite.set_bitmap(cursor)
    end
  end
  
end

class Window_Selectable
  #--------------------------------------------------------------------------
  # * Default Settings
  #--------------------------------------------------------------------------
  Default_Mouse_Selectable = true
  Default_Window_Padding   = 16
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :mouse_selectable
  attr_accessor :window_padding
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_mouseselectable_wndslct_init,   :initialize
  alias_method :seph_mouseselectable_wndslct_update, :update
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    # Original Initialization
    seph_mouseselectable_wndslct_init(x, y, width, height)
    # Set Mouse Selectable Flag
    @mouse_selectable = Default_Mouse_Selectable
    @window_padding   = Default_Window_Padding
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    
    # agf = hide mouse
    if $mouse_sprite.visible == true
    
    # If Mouse Selectable, Active, at Least 1 Item and Non-negitive index
    if self.mouse_selectable && self.active && @item_max > 0 && @index >= 0
      # Gets Mouse Position
      mouse_x, mouse_y = *Mouse.position
      
      # If Mouse Within Window      
      if mouse_x.between? (self.x, self.x + self.width) &&
         mouse_y.between? (self.y, self.y + self.height)
        # Calculates Mouse X and Y Position Within Window
        mouse_x -= self.x; mouse_y -= self.y
        # Subtracts Window Padding
        mouse_x -= @window_padding; mouse_y -= @window_padding
        # Subtracts Mouse Oh
        mouse_y -= self.mouse_oh
        # Gets Cursor Width
        cursor_width = (self.width / @column_max - 32)
        # Passes Through Item Max
        for i in 0...@item_max
          # Calculates Index Position
          x = i % @column_max * (cursor_width + 32)
          y = i / @column_max * self.oh - self.oy
          # If Mouse Between Rect
          if mouse_x.between?(x, x + cursor_width) &&
             mouse_y.between?(y, y + self.oh)
            # Set Index
            prev_index = @index
            @index = i
            if prev_index != @index
              $game_system.se_play($data_system.cursor_se)
            end
            break
          end
        end
      end
    end
    
    end
    
    # Original Update
    seph_mouseselectable_wndslct_update
  end
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 32
  end
  #--------------------------------------------------------------------------
  # * Mouse Oh
  #--------------------------------------------------------------------------
  def mouse_oh
    return 0
  end  
  
end


#==============================================================================
# ** Window_MenuStatus
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 60
  end
end

#==============================================================================
# ** Window_Target
#==============================================================================

class Window_Target < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 105
  end
end

#==============================================================================
# ** Window_BattleReserve
#==============================================================================

class Window_BattleReserve < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 105
  end
end

#==============================================================================
# ** Window_EquipRight
#==============================================================================

class Window_EquipRight < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 50
  end
  
  #--------------------------------------------------------------------------
  # * Mouse Oh
  #--------------------------------------------------------------------------
  def mouse_oh
    return 140
  end  
  
end

#==============================================================================
# ** Window_Message
#==============================================================================

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # * Mouse Oh
  #--------------------------------------------------------------------------
  def mouse_oh
    return $game_temp.choice_start * 32
  end
end

#==============================================================================
# ** Window_Party
#==============================================================================

class Window_Party < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 52
  end
end
[Show/Hide] Part 2, append at end of part 1
CODE
#==============================================================================
# ** Window_Menu
#==============================================================================

class Window_Menu < Window_Selectable
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 35
  end
end

#==============================================================================
# ** Window_ActorCommand
#==============================================================================

class Window_ActorCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  def update
    if $mouse_sprite.visible
      
      # if Mouse sleectable, active, at least 1 item and non-negative index
      if self.mouse_selectable && self.active && @item_max > 0 && @index >= 0
        # Get / check mouse position
        mouse_x, mouse_y = *Mouse.position
        
        if mouse_x.between?(self.x, self.x + self.width) &&
          mouse_y.between?(self.y, self.y + self.height)
          
          # Calculates mouse position within window
          mouse_x -= self.x
          mouse_y -= self.y
          
          # Subtracts widnow padding and overhead
          mouse_x -= @window_padding
          mouse_y -= @window_padding - self.mouse_oh
          
          # Look through all items
          for i in 0...@item_max
            ix,iy = @positions[i]
            if mouse_x.between?(ix, ix + 32) && mouse_y.between?(iy, iy + self.oh)
              if i != @index
                $game_system.se_play($data_system.cursor_se)
              end
              @index = i
              break
            end
          end
        end
      end
    end
    
    super
  end
  
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  def oh
    return 32  
  end
end


#==============================================================================
# ** Window_NameInput
#==============================================================================

class Window_NameInput < Window_Base
  #--------------------------------------------------------------------------
  # * Default Settings
  #--------------------------------------------------------------------------
  Default_Mouse_Selectable = true
  Default_Window_Padding = 16
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :mouse_selectable
  attr_accessor :window_padding
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :shaz_mouseselectable_wndslct_init,   :initialize
  alias_method :shaz_mouseselectable_wndslct_update, :update
  #--------------------------------------------------------------------------
  # ● Initialize the Name Input window
  #--------------------------------------------------------------------------
  def initialize
    # Original Initialization
    shaz_mouseselectable_wndslct_init
    # Set Mouse Selectable Flag
    @mouse_selectable = Default_Mouse_Selectable
    @window_padding = Default_Window_Padding
  end

  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------

  def update
    
    # if mouse selectable, visible, active, and non-negative index
    if $mouse_sprite.visible && self.mouse_selectable && self.active &&
      @index >= 0
      
      # Get mouse position
      mouse_x, mouse_y = *Mouse.position
      
      # If mouse within window
      if mouse_x.between? (self.x, self.x + self.width) &&
        mouse_y.between? (self.y, self.y + self.height)
        
        # Calculates mouse X and Y positions within window
        mouse_x -= self.x; mouse_y -= self.y
        
        # Subtracts window padding
        mouse_x -= @window_padding; mouse_y -= @window_padding
        
        # Subtracts mouse oh
        mouse_y -= self.mouse_oh
        
        # Gets cursor width
        cursor_width = 28
        
        # If not Submit button, pass through all items
        if mouse_x.between?(428, 428+48) && mouse_y.between?(9*32, 9*32+32)
          $game_system.se_play($data_system.cursor_se) if @index != 180
          @index = 180
        else
          for i in 0..90  
            
            # Calculate index position
            x = 140 + i / 5 / 9 * 180 + i % 5 * 32
            y = i / 5 % 9 * 32
            
            # If mouse between rect
            if mouse_x.between?(x, x + cursor_width) &&
              mouse_y.between?(y, y + self.oh)
              # set index
              prev_index = @index
              @index = i
              if prev_index != @index
                $game_system.se_play($data_system.cursor_se)
              end
              break
            end
          end
        end
      end
    end
    
    # Original update
    shaz_mouseselectable_wndslct_update
  end
  
  #--------------------------------------------------------------------------
  # * Oh
  #--------------------------------------------------------------------------
  
  def oh
    return 32
  end
  
  #--------------------------------------------------------------------------
  # * Mouse Oh
  #--------------------------------------------------------------------------
  
  def mouse_oh
    return 0
  end
  
end


#==============================================================================
# ** Scene_File
#==============================================================================

class Scene_File
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_scnfl_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    
    # agf = hide mouse
    if $mouse_sprite.visible == true    
    
    # If Mouse Position isn't Nil
    if Mouse.pos != nil
      
      # Gets Mouse Position
      x, y = Mouse.pos
      y = y + 32
      
      # Pass Through Savefile Windows
      for i in 0...@savefile_windows.size
        
        # Gets Window
        w = @savefile_windows[i]
        
        # Don't allow user to select autosave slot in Load Menu
        if @autosave_slot == false
          i = 1 if i == 0
        end
        
        # If Within Window Range
        if x.between?(w.x, w.x + w.width) &&
           y.between?(w.y, w.y + w.height) && w.active
                      
          prev_index = @file_index
          
          # Set File Index
          @file_index = i
          
          # Turns Window On
          w.selected = true
          
          # Play SE
          if prev_index != @file_index
            $game_system.se_play($data_system.cursor_se)
          end          
          
          # Unhighlight remaining windows
          for j in 0...@savefile_windows.size
            if j != i
               @savefile_windows[j].selected = false
            end
          end        

          # Don't select autosave slot in Load Menu
          if @autosave_slot == false
            @savefile_windows[0].selected = false if i == 1
          end
          
          # Break Main Loop
          break            
        end
      end
    end
  
    end
  
    # Original Update
    sephlamchop_mousesys_scnfl_update
  end
end


#==============================================================================
# ** Game_Battler
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Battler Width
  #--------------------------------------------------------------------------
  def battler_width
    return RPG::Cache.battler(@battler_name, @battler_hue).width
  end
  #--------------------------------------------------------------------------
  # * Battler Height
  #--------------------------------------------------------------------------
  def battler_height
    return RPG::Cache.battler(@battler_name, @battler_hue).height
  end
end

#==============================================================================
# ** Arrow_Enemy
#==============================================================================

class Arrow_Enemy < Arrow_Base
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_mouseselectablewindows_arrenmy_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Original Update
    seph_mouseselectablewindows_arrenmy_update
    
    if $mouse_sprite.visible == true
      # Return if Nil Mouse Position
      return if Mouse.position.nil?
      # Gets Mouse Position
      mx, my = *Mouse.position
      # Pass Through Enemies
      $game_troop.enemies.each do |enemy|
        # Skip if Non-Existing Enemy
        next unless enemy.exist?
        # Gets Paddings
        w, h = enemy.battler_width / 2, enemy.battler_height
        # If Within Mouse Padding Range
        if mx.between?(enemy.screen_x - w, enemy.screen_x + w) &&
           my.between?(enemy.screen_y - h, enemy.screen_y + 10)
          # Set Index
          @index = $game_troop.enemies.index(enemy)
          # Set mouse cursor to bitmap
          $mouse_sprite.set_bitmap(MouseCursor::Enemy_Cursor)
          return
          # break
        end
      end
    
      # Set Mouse to Default Cursor
      $mouse_sprite.set_bitmap(MouseCursor::Default_Cursor)
    end
    
  end
end

#==============================================================================
# ** Arrow_Actor
#==============================================================================

class Arrow_Actor < Arrow_Base
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :seph_mouseselectablewindows_arractr_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Original Update
    seph_mouseselectablewindows_arractr_update
    # Return if Nil Mouse Position
    return if Mouse.position.nil?
    # Gets Mouse Position
    mx, my = *Mouse.position
    # Pass Through Actors
    $game_party.actors.each do |actor|
      # Gets Paddings
      w, h = actor.battler_width / 2, actor.battler_height
      # If Within Mouse Padding Range
      if mx.between?(actor.screen_x - w, actor.screen_x + w) &&
         my.between?(actor.screen_y - h, actor.screen_y + 10)
        # Set Index
        @index = $game_party.actors.index(actor)
      end
    end
  end
end

#==============================================================================
# ** Scene_Map
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :sephlamchop_mousesys_scnmap_update, :update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Unless Message Showing
    unless $game_temp.message_text
      # Update Event Cursors
      $mouse_sprite.update_event_cursors
    end
    # Original Update
    sephlamchop_mousesys_scnmap_update
  end
end

#==============================================================================
# ** Interpreter
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias_method :shaz_mousesys_intrprtr_command_101, :command_101
  #--------------------------------------------------------------------------
  # * Show Text
  #--------------------------------------------------------------------------
  def command_101
    # return mouse sprite to default cursor
    $mouse_sprite.set_bitmap(MouseCursor::Default_Cursor)
    # original command_101
    shaz_mousesys_intrprtr_command_101
  end
end

$mouse_sprite = Sprite_Mouse.new

# game mouse is visible, system mouse is hidden
$mouse_sprite.visible = true


Spoilt for your reading pleasure - Night_Runner

This post has been edited by Night_Runner: Nov 22 2010, 12:37 AM


__________________________
jomarcenter games. we beveled that games never put a price on...
link to the jomarcenter games forums : jomarcenter forums site
User suspended until their 13th birthday -Staff
Go to the top of the page
 
+Quote Post
   
carnie_natas
post Sep 9 2010, 09:42 PM
Post #15


~Noctem~Shinai~
Group Icon

Group: Revolutionary
Posts: 261
Type: Developer
RM Skill: Advanced




mouse 3 what part?


__________________________
Light one up!
You can run.....But you'll only die tired!
Go to the top of the page
 
+Quote Post
   
flowerthief
post Sep 12 2010, 07:39 AM
Post #16


Level 4
Group Icon

Group: Member
Posts: 57
Type: None
RM Skill: Undisclosed




When I try to run the demo I get "RGSS104E.dll could not be found." What's it mean?


__________________________
Customizable datesim in development. Will need serious beta-testers! Please contact me if interested in helping.

Idolcraft -- Bishoujo training simulation
Go to the top of the page
 
+Quote Post
   
carnie_natas
post Sep 15 2010, 09:35 AM
Post #17


~Noctem~Shinai~
Group Icon

Group: Revolutionary
Posts: 261
Type: Developer
RM Skill: Advanced




if this script was compatible with all custom menu's,events,yada yada and worked in fullscreen without errors id definately use it,but i tryed it out and it was glitchy anyway,the cursor has a 1 second lag and it doesn't allow me to click on the menu or any menu or any events or anything.basicly it seemed as though all you could do was move a cursor around the screen,not sure if that was just me but it wasnt useful at all....if it worked id use it,hope you can fix these problems.


__________________________
Light one up!
You can run.....But you'll only die tired!
Go to the top of the page
 
+Quote Post
   
54tan666
post Oct 22 2010, 12:15 PM
Post #18


Level 1
Group Icon

Group: Member
Posts: 9
Type: None
RM Skill: Beginner




QUOTE (flowerthief @ Sep 12 2010, 05:39 PM) *
When I try to run the demo I get "RGSS104E.dll could not be found." What's it mean?

I also had that problem. i did it like this:
open the .ini file of the demo and one of your projects (its game called).
copy the 3rd line of your .ini file and replace the 3rd line of the demo-.ini file with this.
hope yo understood that ,)
Go to the top of the page
 
+Quote Post
   
coachdog
post Nov 21 2010, 05:11 PM
Post #19



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Intermediate




Well, There was a problem with this thing but I tried to import all the information off my project and put it all into the Mouse System project and i runned it. it worked fine untill i clicked on were to go, but all my character did was move one square over. Help!

Great it lets me play it but my character only moves 1 square over every time I click.

Please don't double post - Night_Runner
Go to the top of the page
 
+Quote Post
   
MangaGaston
post Apr 28 2011, 08:23 PM
Post #20



Group Icon

Group: Member
Posts: 2
Type: Mapper
RM Skill: Masterful




The best script I saw in my life woot.gif , the game Aveyond using this script is fantastic thank you very much because now I can play or the mouse or keyboard woot.gif thanks.gif
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
Closed TopicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th June 2013 - 06:39 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker