Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: nathmatt on March 24, 2010, 08:31:41 pm

Title: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on March 24, 2010, 08:31:41 pm
Mouse Controller Enhancement Script
Authors: Nathmatt
Version: 1.72
Type: ADD_ON
Key Term: Custom Movement System



Introduction
Adds movement by clicking the mouse to the Mouse Controller Script by Blizzard
Requires Mouse Controller by Blizzard


Features



Screenshots
no screenshot needed


Demo

No Demo


Script
Spoiler: ShowHide
http://pastebin.com/tNayigqG



Instructions

place below Mouse Controler

in the script


Compatibility
not compatible with pixel movement will automatically turn it off


Credits and Thanks




Author's Notes
Any suggestions for updates are appreciated
Title: Re: [XP] Mouse Path Finder Add On
Post by: ForeverZer0 on March 24, 2010, 08:42:06 pm
Great job, man. I've been wanting something like this. This should work well..

*powers up*
Title: Re: [XP] Mouse Path Finder Add On
Post by: G_G on March 24, 2010, 09:22:17 pm
WEll it doesnt have path pathfinding at all. It has some. It won't avoid obstacles to get to the designated area though.
Title: Re: [XP] Mouse Path Finder Add On
Post by: Blizzard on March 25, 2010, 07:04:15 am
You beat me to it. Yes, I was going to say the same. It's not a path finder, it's a direct movement controller.
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on March 25, 2010, 07:23:39 am
yea i noticed that working on ripping the 1 from Blizz~ABS  with credit of course

edit: forget to say i successfully ripped the path finder from Blizz~ABS
Title: Re: [XP] Mouse Path Finder Add On
Post by: Ryex on March 27, 2010, 07:27:10 pm
p result unless result == nil

... you forgot to remove the debug stuff
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on March 27, 2010, 07:33:16 pm
oops my bad will remove now

edit actually you can go ahead and remove the entire Game_Player class in my script it doesn't use that  
Title: Re: [XP] Mouse Path Finder Add On
Post by: element on March 28, 2010, 04:12:44 am
It doesn't work with me.
I set up everything in blizz abs, do i have to set anything up in the pathfinder ?

EDIT : OK... I'ts not compatible with Blizz-ABS V 2.57  :^_^':
I was still using that version becouse of all of the sprites you have to make in 2.7...
Think I should start thinking of hopping over to V 2.7  :<_<:
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on March 31, 2010, 09:41:17 am
update fixed small error with the y to fix it

replace
def pos
   x, y = self.position
   x = ( x + $game_map.display_x / 4) / 32
   y = ( y + $game_map.display_x / 4) / 32
   return x, y
 end

with this
def pos
   x, y = self.position
   x = ( x + $game_map.display_x / 4) / 32
   y = ( y + $game_map.display_y / 4) / 32
   return x, y
 end


edit:    I made it with Blizz-ABS ver 2.57 i am not sure y it wouldn't be working for you ?
edit 2: Are you getting an error message or is it just not working ?
edit 3: Fixed where if you were to click the mouse for the message window the  player would move
Title: Re: [XP] Mouse Path Finder Add On
Post by: element on March 31, 2010, 12:44:25 pm
just won't work
But i'll look in to it another time
Don't have much time to check things that can cause it now.
Title: Re: [XP] Mouse Path Finder Add On
Post by: Ryex on April 01, 2010, 07:55:46 pm
Quote from: nathmatt on March 31, 2010, 09:41:17 am
update fixed small error with the y to fix it

replace
def pos
   x, y = self.position
   x = ( x + $game_map.display_x / 4) / 32
   y = ( y + $game_map.display_x / 4) / 32
   return x, y
 end

with this
def pos
   x, y = self.position
   x = ( x + $game_map.display_x / 4) / 32
   y = ( y + $game_map.display_y / 4) / 32
   return x, y
 end


edit:    I made it with Blizz-ABS ver 2.57 i am not sure y it wouldn't be working for you ?
edit 2: Are you getting an error message or is it just not working ?
edit 3: Fixed where if you were to click the mouse for the message window the  player would move


um those codes are exactly the same...
Title: Re: [XP] Mouse Path Finder Add On
Post by: Wizered67 on April 01, 2010, 08:01:46 pm
Quote from: Professor Ryexander Elm on April 01, 2010, 07:55:46 pm
Quote from: nathmatt on March 31, 2010, 09:41:17 am
update fixed small error with the y to fix it

replace
def pos
   x, y = self.position
   x = ( x + $game_map.display_x / 4) / 32
   y = ( y + $game_map.display_X / 4) / 32
   return x, y
 end

with this
def pos
   x, y = self.position
   x = ( x + $game_map.display_x / 4) / 32
   y = ( y + $game_map.display_Y / 4) / 32
   return x, y
 end


edit:    I made it with Blizz-ABS ver 2.57 i am not sure y it wouldn't be working for you ?
edit 2: Are you getting an error message or is it just not working ?
edit 3: Fixed where if you were to click the mouse for the message window the  player would move


um those codes are exactly the same...


no they aren't, look at X and Y on second line
Title: Re: [XP] Mouse Path Finder Add On
Post by: Tyril132 on April 01, 2010, 08:25:39 pm
In the first code snippet, $game_map.display_x is listed twice.

In the second code snippet, this is addressed by changing the second variable to $game_map.display_y, as was probably the original intent.
Title: Re: [XP] Mouse Path Finder Add On
Post by: Ryex on April 02, 2010, 10:34:14 am
*facepalm*
Title: Re: [XP] Mouse Path Finder Add On
Post by: Subsonic_Noise on April 02, 2010, 01:28:18 pm
I like this script, especially the part where it does nothing at all in my game. But that probably is my fault.
Title: Re: [XP] Mouse Path Finder Add On
Post by: Tyril132 on April 02, 2010, 01:45:08 pm
Quote from: Shiny Magikarp on April 02, 2010, 01:28:18 pm
I like this script, especially the part where it does nothing at all in my game. But that probably is my fault.


Nothing at all is better than a fatal script error. Well... unless you're intentionally trying to break the script for testing. :P
Title: Re: [XP] Mouse Path Finder Add On
Post by: Subsonic_Noise on April 02, 2010, 02:09:03 pm
Quote from: Tyril132 on April 02, 2010, 01:45:08 pm
Quote from: Shiny Magikarp on April 02, 2010, 01:28:18 pm
I like this script, especially the part where it does nothing at all in my game. But that probably is my fault.


Nothing at all is better than a fatal script error. Well... unless you're intentionally trying to break the script for testing. :P

My game has about 30-40 scripts, some of them are written by myself and don't do anything. It was about time for compatibility issues.
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on April 02, 2010, 04:37:51 pm
are you making sure you have either tons custom controls on or Blizz-ABS are you also making sure that you have the original mouse script by blizzard and that they are both below Blizz-ABS
Title: Re: [XP] Mouse Path Finder Add On
Post by: Subsonic_Noise on April 02, 2010, 04:41:55 pm
Quote from: nathmatt on April 02, 2010, 04:37:51 pm
are toy making sure you have either tons custom controls on or Blizz-ABS are you also  making sure that you have the original mouse script by blizzard and that they are both below Blizz-ABS

yep, I checked both, it's in the right order. Still nothing happens when I click. oO
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on April 02, 2010, 05:46:52 pm
Is Scene_Map update being aliased in any of the scripts you are using i may be using a variable or or something one of the many scripts you are using is using.

Spoiler: ShowHide
Did i just use the word using 4 times lol.
Title: Re: [XP] Mouse Path Finder Add On
Post by: Wizered67 on April 05, 2010, 12:45:23 pm
Great script! It works very well except for 1 thing. Whenever I click to move somewhere else, it still counts it as if you just pressed the enter button triggering unwanted events.
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on April 05, 2010, 06:07:12 pm
i have been trying to fix it but having problems
Title: Re: [XP] Mouse Path Finder Add On
Post by: Wizered67 on April 05, 2010, 06:16:18 pm
Ok, thanks for trying.
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on April 08, 2010, 12:27:55 pm
updated: 1.14  fixed where it would activate an event if it was in front of you
Title: Re: [XP] Mouse Path Finder Add On
Post by: Wizered67 on April 08, 2010, 02:12:06 pm
i get a syntax error on line 355.....
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on April 08, 2010, 02:23:45 pm
updated: 1.15 fixed a few bugs
Title: Re: [XP] Mouse Path Finder Add On
Post by: Wizered67 on April 08, 2010, 02:28:42 pm
now I get it on line 361 which is just an "end"....
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on April 08, 2010, 02:36:17 pm
did you recopy the entire script because you are missing an end just add 1 more end that should fix it
Title: Re: [XP] Mouse Path Finder Add On
Post by: Wizered67 on April 08, 2010, 02:41:54 pm
great, that fixed it! and yes, I'm pretty sure I completely re-pasted the script.
Title: Re: [XP] Mouse Path Finder Add On
Post by: Subsonic_Noise on April 08, 2010, 06:50:29 pm
I disabled every single script except this, the mouse controller and BlizzABS, and clicking still doesn't do anything... what's happening? lol
Title: Re: [XP] Mouse Path Finder Add On
Post by: nathmatt on April 08, 2010, 07:40:18 pm
make a demo and i will look at it
Title: Re: [XP] Mouse Path Finder Add On
Post by: Subsonic_Noise on April 12, 2010, 03:57:48 pm
Quote from: nathmatt on April 08, 2010, 07:40:18 pm
make a demo and i will look at it

Thanks! I'll strip my game down until it isn't 590mb anymore, though, that might need a bit, lol.
Title: Re: [XP] Mouse Path Finder
Post by: nathmatt on April 12, 2010, 04:07:40 pm
update: 1.16 added a configurable no click terrain tag for areas an reachable.
Noticed if you click somewhere you cant reach you couldn't click again until the path finder makes sure you can't get there.  

edit: no need to strip your game just make a new project with all the scripts u are using and upload it here or pm me it
edit: 2 unless ur sure its not script related
update: 1.17 fixed where if using this on RMX-OS player position would not be updated when you clicked
update: 1.18 made it compatible with my Character Drop Down Menu
edit: edited the script but not updated some how i had removed the cant go terrain so added it back
update: 1.19  the script no longer aliases Scene_Map making it more compatible with other scripts
Title: Re: [XP] Mouse Path Finder
Post by: cyclope on May 31, 2010, 04:23:11 pm
This is a great script but it doesnt work with some CMS and CTS
I am using MOG's Animated Title Screen (http://forum.chaos-project.com/index.php/topic,2655.0.html (http://forum.chaos-project.com/index.php/topic,2655.0.html)) and this CMS
Spoiler: ShowHide
class Bitmap
  def draw_text(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)
    # if x2 is a rectangle
    if x2.is_a?(Rect)
      # set temporary variables
      x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
    else
      # set temporary variables
      x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
    end
    # save old font color
    save_color = self.font.color.clone
    # set new font color (black)
    self.font.color = Color.new(128, 128, 128)
    # restore original color
    self.font.color = save_color
    # drw text at normal postion
    draw_text_shaded_later(x, y, w, h, text, a)
  end
end

#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
#  This window displays amount of gold.
#==============================================================================

class Window_Gold_Location < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.size = 16
    self.contents.font.bold = true
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # set font color
    self.contents.font.color = system_color
    # draw "G"
    self.contents.draw_text_full(90, 12, 20, 20, 'G')
    # set font color
    self.contents.font.color = normal_color
    # draw party's gold   
    self.contents.draw_text_full(10, 12, 80, 20, $game_party.gold.to_s, 2)
    # draw party's location   
    self.contents.draw_text_full(10, 32, 100, 20, $game_map.name, 1)
  end
end

#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 256)
    self.contents = Bitmap.new(width, height)
     # set font
    self.contents.font.name = 'Arial'
    # set font size
    self.contents.font.size = 16
    # set font to bold
    self.contents.font.bold = true
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 0
      y = i * 64
      actor = $game_party.actors
      self.contents.font.size = 16
      self.contents.draw_text_full(x+13, y+8, 102, 20, actor.name.to_s, 1)
      self.contents.font.size = 14
      color = Color.new(255, 255, 255, 127)
      self.contents.fill_rect(x+13, y+28, 102, 13, color)
      self.contents.fill_rect(x+13, y+42, 102, 13, color)
      # set current variables
      hp = actor.hp
      maxhp = actor.maxhp
      sp = actor.sp
      maxsp = actor.maxsp
      rate = (maxhp > 0 ? hp.to_f / maxhp : 0)
      # draw gradient bar
      self.contents.gradient_bar_hud(x+13, y+28, 100, rate, 'hud_green_bar', 0)
      # draw HP
      self.contents.draw_text_full(x+13, y+28, 102, 11, hp.to_s, 1)
      rate = (maxsp > 0 ? sp.to_f / maxsp : 0)
      # draw gradient bar
      self.contents.gradient_bar_hud(x+13, y+42, 100, rate, 'hud_blue_bar', 0)
      # draw HP
      self.contents.draw_text_full(x+13, y+42, 102, 11, sp.to_s, 1)
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(6, @index * 64 + 6, self.width - 44, 52)
    end
  end
end
#==============================================================================
# ** Window_Selectable_FE
#------------------------------------------------------------------------------
#  This window class contains cursor movement and scroll functions.
#==============================================================================

class Window_Selectable_FE < Window_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :index                    # cursor position
  attr_reader   :help_window              # help window
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x      : window x-coordinate
  #     y      : window y-coordinate
  #     width  : window width
  #     height : window height
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item_max = 1
    @row_max = 1
    @index = -1
  end
  #--------------------------------------------------------------------------
  # * Set Cursor Position
  #     index : new cursor position
  #--------------------------------------------------------------------------
  def index=(index)
    @index = index
    # Update Help Text (update_help is defined by the subclasses)
    if self.active and @help_window != nil
      update_help
    end
    # Update cursor rectangle
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # * Get Col Count
  #--------------------------------------------------------------------------
  def col_max
    # Compute rows from number of items and columns
    return (@item_max + @row_max - 1) / @row_max
  end
  #--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------
  def left_col
    # Divide y-coordinate of window contents transfer origin by 1 row
    # height of 32
    return self.ox / 32
  end
  #--------------------------------------------------------------------------
  # * Set Top Row
  #     row : row shown on top
  #--------------------------------------------------------------------------
  def left_col=(col)
    # If row is less than 0, change it to 0
    if col < 0
      col = 0
    end
    # If row exceeds row_max - 1, change it to row_max - 1
    if col > col_max - 1
      col = col_max - 1
    end
    # Multiply 1 row height by 32 for y-coordinate of window contents
    # transfer origin
    self.ox = col * 32
  end
  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_col_max
    # Subtract a frame height of 32 from the window height, and divide it by
    # 1 row height of 32
    return (self.width - 28) / 28
  end
  #--------------------------------------------------------------------------
  # * Get Number of Items Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_item_max
    # Multiply row count (page_row_max) times column count (@column_max)
    return page_col_max * @row_max
  end
  #--------------------------------------------------------------------------
  # * Set Help Window
  #     help_window : new help window
  #--------------------------------------------------------------------------
  def help_window=(help_window)
    @help_window = help_window
    # Update help text (update_help is defined by the subclasses)
    if self.active and @help_window != nil
      update_help
    end
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    col = @index / @row_max
    # If current row is before top row
    if col < self.left_col
      # Scroll so that current row becomes top row
      self.left_col = col
    end
    # If current row is more to back than back row
    if col > self.left_col + (self.page_col_max - 1)
      # Scroll so that current row becomes back row
      self.left_col = col - (self.page_col_max - 1)
    end
    # Calculate cursor width
    cursor_height = self.height / @row_max - 32
    # Calculate cursor coordinates
    x = @index / @row_max * 28 + 4
    y = 18
    # Update cursor rectangle
    self.cursor_rect.set(x, y, 28, 28)
    #UPDATE TEXT
    self.contents.font.color = normal_color
    self.contents.font.size = 17
    self.contents.font.bold = true
    rect = Rect.new(32, 2, 224, 16)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[@index], 1)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # If cursor is movable
    if self.active and @item_max > 0 and @index >= 0
      # If pressing down on the directional buttons
      if Input.repeat?(Input::RIGHT)
        # If column count is 1 and directional button was pressed down with no
        # repeat, or if cursor position is more to the front than
        # (item count - column count)
        if (@row_max == 1 and Input.trigger?(Input::DOWN)) or
           @index < @item_max - @row_max
          # Move cursor down
          $game_system.se_play($data_system.cursor_se)
          @index = (@index + @row_max) % @item_max
        end
      end
      # If the up directional button was pressed
      if Input.repeat?(Input::LEFT)
        # If column count is 1 and directional button was pressed up with no
        # repeat, or if cursor position is more to the back than column count
        if (@row_max == 1 and Input.trigger?(Input::UP)) or
           @index >= @row_max
          # Move cursor up
          $game_system.se_play($data_system.cursor_se)
          @index = (@index - @row_max + @item_max) % @item_max
        end
      end
      # If the right directional button was pressed
      if Input.repeat?(Input::DOWN)
        # If column count is 2 or more, and cursor position is closer to front
        # than (item count -1)
        if @row_max >= 2 and @index < @item_max - 1
          # Move cursor right
          $game_system.se_play($data_system.cursor_se)
          @index += 1
        end
      end
      # If the left directional button was pressed
      if Input.repeat?(Input::UP)
        # If column count is 2 or more, and cursor position is more back than 0
        if @row_max >= 2 and @index > 0
          # Move cursor left
          $game_system.se_play($data_system.cursor_se)
          @index -= 1
        end
      end
      # If R button was pressed
      if Input.repeat?(Input::R)
        # If bottom row being displayed is more to front than bottom data row
        if self.left_col + (self.page_col_max - 1) < (self.col_max - 1)
          # Move cursor 1 page back
          $game_system.se_play($data_system.cursor_se)
          @index = [@index + self.page_item_max, @item_max - 1].min
          self.left_col += self.page_col_max
        end
      end
      # If L button was pressed
      if Input.repeat?(Input::L)
        # If top row being displayed is more to back than 0
        if self.left_col > 0
          # Move cursor 1 page forward
          $game_system.se_play($data_system.cursor_se)
          @index = [@index - self.page_item_max, 0].max
          self.left_col -= self.page_col_max
        end
      end
    end
    # Update help text (update_help is defined by the subclasses)
    if self.active and @help_window != nil
      update_help
    end
    # Update cursor rectangle
    update_cursor_rect
  end
end

#==============================================================================
# ** Window_Command_FE
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================

class Window_Command_FE < Window_Selectable_FE
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     width    : window width
  #     commands : command text string array
  #--------------------------------------------------------------------------
  def initialize(height, commands)
    # Compute window height from command quantity
    super(0, 0, commands.size * 32, height)
    @item_max = commands.size
    @commands = commands
    self.contents = Bitmap.new(width, height)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #     color : text color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    bitmap = RPG::Cache.icon('CMSFE_'+index.to_s+'.png')
    src_rect = Rect.new(0, 0, 24, 24)
    self.contents.blt(28 * index+6, 20, bitmap, src_rect)
    if @index == index
      self.contents.font.color = normal_color
      self.contents.font.size = 16
      rect = Rect.new(32, 4, 168, 16)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.draw_text(rect, @commands[index])
    end
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #     index : item number
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
end

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    $game_system.windowskin_name = 'AppleMilkNOBG'
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Your Status"
    s5 = "Set Keys"
    s6 = "Save"
    s7 = "Load"
    s8 = "Exit"
    @command_window = Window_Command_FE.new(96,
      [s1, s2, s3, s4, s5, s6, s7, s8,])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    @command_window.x = 128
    @command_window.y = -16
    @command_window.z = 1000
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    @goldtime_window = Window_Gold_Location.new
    @goldtime_window.x = -16
    @goldtime_window.y = -16
    @goldtime_window.z = 1000
    # set in_battle flag
    $game_temp.in_battle = true
    # if MINIMAP is turned on and minimap active
    if BlizzABS::Config::MINIMAP && $game_system.minimap > 0
      # create HUD
      @minimap = Minimap.new
      # create HUD
      @minimap.update
    end
    # create spriteset
    @spriteset = Spriteset_Map.new
    @hudbg = HudBG.new(4)
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = -16
    @status_window.y = 48
    @status_window.z = 1000
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    $game_system.windowskin_name = 'AppleMilkNOBG'
    # delete spriteset
    @spriteset.dispose
    [@hud, @parhud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
    # Dispose of windows
    @command_window.dispose
    @status_window.dispose
    @goldtime_window.dispose
    @hudbg.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @status_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # Item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to Item screen
        $scene = Scene_Item.new
      when 1  # Skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # Equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # Status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # Hotkeys
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to Hotkeys screen
        $scene = Scene_Hotkeys.new
      when 5  # AI Behavior
                # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to Save screen
        $scene = Scene_Save.new
       
      when 6  # AI Triggers
      # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to Load screen
        $scene = Scene_Load_Menu.new 
      when 7  # Save
      # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to End Game screen
        $scene = Scene_End.new
      end
      return
    else
      # iterate through all number keys
      BlizzABS::Cache::Keys.each {|i|
          # if number key i was triggered
          if Input.trigger?(Input::Key[i.to_s])
            @command_window.index = (i+9)%10
            case @command_window.index
            when 0  # Item
              # Play decision SE
              $game_system.se_play($data_system.decision_se)
              # Switch to Item screen
              $scene = Scene_Item.new
            when 1  # Skill
              # Play decision SE
              $game_system.se_play($data_system.decision_se)
              # Make status window active
              @command_window.active = false
              @status_window.active = true
              @status_window.index = 0
            when 2  # Equipment
              # Play decision SE
              $game_system.se_play($data_system.decision_se)
              # Make status window active
              @command_window.active = false
              @status_window.active = true
              @status_window.index = 0
            when 3  # Status
              # Play decision SE
              $game_system.se_play($data_system.decision_se)
              # Make status window active
              @command_window.active = false
              @status_window.active = true
              @status_window.index = 0
            when 4  # Hotkeys
              # Play decision SE
              $game_system.se_play($data_system.decision_se)
              # Switch to Hotkeys screen
              $scene = Scene_Hotkeys.new
            when 5  # Save
              # If saving is forbidden
              if $game_system.save_disabled
                # Play buzzer SE
                $game_system.se_play($data_system.buzzer_se)
                return
              end
              # Play decision SE
              $game_system.se_play($data_system.decision_se)
              # Switch to Save screen
              $scene = Scene_Save.new
            when 6  # Load
              # Play decision SE
              $game_system.se_play($data_system.decision_se)
              # Switch to Load screen
              $scene = Scene_Load_Menu.new
            when 7  # End Game
              # Play decision SE
              $game_system.se_play($data_system.decision_se)
              # Switch to End Game screen
              $scene = Scene_End.new
            end
            return
          end}
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 1  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end

#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  This class performs item screen processing.
#==============================================================================

class Scene_Item
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  alias main_FE_later main
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    main_FE_later
    @spriteset.dispose
  end
end
 
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
#  This class performs skill screen processing.
#==============================================================================

class Scene_Skill
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # Get actor
    @actor = $game_party.actors[@actor_index]
    # Make help window, status window, and skill window
    @help_window = Window_Help.new
    @status_window = Window_SkillStatus.new(@actor)
    @skill_window = Window_Skill.new(@actor)
    # Associate help window
    @skill_window.help_window = @help_window
    # Make target window (set to invisible / inactive)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    @status_window.visible = false
    @status_window.active = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @spriteset.dispose
    @help_window.dispose
    @status_window.dispose
    @skill_window.dispose
    @target_window.dispose
  end
end

#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  alias main_FE_later main
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    main_FE_later
    @spriteset.dispose
  end
end

#==============================================================================
# ** Scene_Status
#------------------------------------------------------------------------------
#  This class performs status screen processing.
#==============================================================================

class Scene_Status
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  alias main_FE_later main
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    main_FE_later
    @spriteset.dispose
  end
end
   
#==============================================================================
# Scene_Hotkeys
#------------------------------------------------------------------------------
#  This class handles the skill/item hotkey processing.
#==============================================================================

class Scene_Hotkeys
 
  def initialize
    super
  end
  #----------------------------------------------------------------------------
  # main
  #  The main processing method.
  #----------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # create HUD if HUD is turned on and HUD active
    @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
    # if ASSIGNMENT is turned
    if BlizzABS::Config::HOTKEYS
      # create assignment display
      @hotkeys = Hotkey_Assignment.new
      # set z position
      @hotkeys.z = 5000
    end
    # if MINIMAP is turned on and minimap active
    if BlizzABS::Config::MINIMAP && $game_system.minimap > 0
      # create HUD
      @minimap = Minimap.new
    end
    # create sprite
    @choice = Sprite.new
    # create bitmap
    @choice.bitmap = $BlizzABS.cache.image('menu_arrow')
    # set x, y and z positions
    @choice.x, @choice.y, @choice.z, @choice.opacity = 160, 40, 500, 128
    # set x position offset
    @choice.ox = -8
    # set active flag
    @active = true
    # set index
    @index = 0
    # set up mode flag
    @up_mode = true
    # create modified skill window
    @skill_window = Window_Skill_Hotkey.new($game_player.battler)
    # create modified item window
    @item_window = Window_Item_Hotkey.new
    # set last active
    @last_active = true
    # transtition
    Graphics.transition
    # loop
    loop do
      # update game screen
      Graphics.update
      # update input
      Input.update
      # frame update
      update
      # stop if chosen an option
      break if $scene != self
    end
    # freeze screen
    Graphics.freeze
    # delet spriteset
    @spriteset.dispose
    # delete HUD elements that exist
    [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
    # delete choice sprite
    @choice.dispose
    # delete skill window
    @skill_window.dispose
    # delete item window
    @item_window.dispose
    # delete viewport
    @view.dispose
  end
  #----------------------------------------------------------------------------
  # update
  #  The update processing method.
  #----------------------------------------------------------------------------
  def update
    # update choice sprite
    @choice.update
    # update skill window
    @skill_window.update
    # update item window
    @item_window.update
    # update hotkey assignment display if existing
    @hotkeys.update if @hotkeys != nil
    # move by 2 or 1 whether active in direction depending on @up_mode
    @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))
    # set new @up_mode if necesseray depending on @up_mode
    @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))
    # if select button pressed
    if $game_system.select_button && Input.trigger?(Input::Select)
      # switch to next actor
      @skill_window.switch_actor
    # if active
    elsif @active
      # set choice offset always to a number dividable with 2
      @choice.oy = @choice.oy / 2 * 2
      # update hotkey selection
      update_choice
    # if skill window is active
    elsif @skill_window.active
      # update skill selection
      update_skill
    # if item window is active
    elsif @item_window.active
      # update item selection
      update_item
    end
  end
  #----------------------------------------------------------------------------
  # update_choice
  #  Updates input during the hotkey selection.
  #----------------------------------------------------------------------------
  def update_choice
    # set x position
    @choice.x = 146 + @index * 28
    # if pressed B
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # go back to menu
      $scene = Scene_Menu.new(4)
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # not active
      @active = false
      # the one that was active the last time is now active
      @skill_window.active = @last_active
      @item_window.active = (!@last_active)
    # if RIGHT is being pressed
    elsif Input.repeat?(Input::RIGHT)
      # if RIGHT is pressed or index is less than 9
      if Input.trigger?(Input::RIGHT) || @index < 9
        # play sound
        $game_system.se_play($data_system.cursor_se)
        # set new index
        @index = (@index + 1) % 10
      end
    # if LEFT is being pressed
    elsif Input.repeat?(Input::LEFT)
      # if LEFT is pressed or index is equal or greater than 1
      if Input.trigger?(Input::LEFT) || @index >= 1
        # play sound
        $game_system.se_play($data_system.cursor_se)
        # set new index
        @index = (@index + 9) % 10
      end
    end
  end
  #----------------------------------------------------------------------------
  # update_skill
  #  Updates input during the skill selection.
  #----------------------------------------------------------------------------
  def update_skill
    # set last active
    @last_active = true
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # set active
      @active = true
      # skill window is not active
      @skill_window.active = false
      # delete cursor
      @skill_window.cursor_rect.empty
    # if C is pressd
    elsif Input.trigger?(Input::C)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # if last position
      if @skill_window.index == @skill_window.item_max - 1
        # remove hotkey assigmnent from skill
        $game_player.skill_hotkeys[(@index+1)%10] = 0
      else
        # set skill to hotkey
        $game_player.skill_hotkeys[(@index+1)%10] = @skill_window.skill.id
      end
      # remove hotkey assigmnent from item
      $game_player.item_hotkeys[(@index+1)%10] = 0
      # draw hotkey display if hotkey display exists
      @hotkeys.draw(@index+1) if @hotkeys != nil
      # set active
      @active = true
      # skill window is not active
      @skill_window.active = false
      # delete cursor
      @skill_window.cursor_rect.empty
    # if RIGHT or LEFT is pressed
    elsif Input.trigger?(Input::RIGHT) || Input.trigger?(Input::LEFT)
      # play sound
      $game_system.se_play($data_system.cursor_se)
      # item window is active
      @item_window.active = true
      # skill window is not active
      @skill_window.active = false
      # delete cursor
      @skill_window.cursor_rect.empty
    end
  end
  #----------------------------------------------------------------------------
  # update_item
  #  Updates input during the item selection.
  #----------------------------------------------------------------------------
  def update_item
    # set last active
    @last_active = false
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # set active
      @active = true
      # item window is not active
      @item_window.active = false
      # delete cursor
      @item_window.cursor_rect.empty
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # if last position
      if @item_window.index == @item_window.item_max - 1
        # remove hotkey assigmnent from item
        $game_player.item_hotkeys[(@index+1)%10] = 0
      else
        # set item to hotkey
        $game_player.item_hotkeys[(@index+1)%10] = @item_window.item.id
      end
      # remove hotkey assigmnent from skill
      $game_player.skill_hotkeys[(@index+1)%10] = 0
      # draw hotkey display if hotkey display exists
      @hotkeys.draw(@index+1) if @hotkeys != nil
      # set active
      @active = true
      # item window is not active
      @item_window.active = false
      # delete cursor
      @item_window.cursor_rect.empty
    # if RIGHT or LEFT is pressed
    elsif Input.trigger?(Input::RIGHT) || Input.trigger?(Input::LEFT)
      # play sound
      $game_system.se_play($data_system.cursor_se)
      # skill window is active
      @skill_window.active = true
      # item window is not active
      @item_window.active = false
      # delete cursor
      @item_window.cursor_rect.empty
    end
  end
 
end
#==============================================================================
# Scene_AI_Behavior
#------------------------------------------------------------------------------
#  This class processes handling of the scene where ally behavior can be set
#  up which is used by the Ally Combat AI.
#==============================================================================

class Scene_AI_Behavior
 
  #----------------------------------------------------------------------------
  # Initialization
  #  tone  - screen background tone
  #  index - actor party index
  #----------------------------------------------------------------------------
  def initialize(index = 0, command_window_index = 0)
    # base data
    @index = index
    # get battler
    @actor = $BlizzABS.battlers[index].battler
    # command window index
    @command_window_index = command_window_index
  end
  #----------------------------------------------------------------------------
  # main
  #  The main processing method.
  #----------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # create command window
    @command_window = Window_Command.new(160, BlizzABS::Cache::CommandsAIBehavior)
    # command window coordinates
    @command_window.x = 480
    # command window initial index
    @command_window.index = @command_window_index
    # get map actor
    map_actor = $BlizzABS.battlers[@index]
    # create behavior window
    @behavior_window = Window_Behavior.new(@actor, map_actor)
    # transition
    Graphics.transition
    # loop
    loop do
      # update game screen
      Graphics.update
      # update input
      Input.update
      # update the scene
      update
      # stop if frame update
      break if $scene != self
    end
    # freeze screen
    Graphics.freeze
    # delete command window
    @command_window.dispose
    # delete behavior window
    @behavior_window.dispose
    # delete spriteset
    @spriteset.dispose
    # delete viewport
    @view.dispose
  end
  #----------------------------------------------------------------------------
  # update_command
  #  The command window update processing method.
  #----------------------------------------------------------------------------
  def update_command
    # update command window
    @command_window.update
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # create map scene
      $scene = Scene_Menu.new(5)
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # which option
      case @command_window.index
      when 0
        # play sound
        $game_system.se_play($data_system.decision_se)
        # deactivate command window
        @command_window.active = false
        # activate behavior window
        @behavior_window.active = true
      when 1
        # play sound
        $game_system.se_play($data_system.decision_se)
        # get all AI actors
        battlers = $BlizzABS.battlers
        # set next index
        @index = (@index + 1) % battlers.size
        # if battler not valid
        while battlers[@index].battler == nil
          # try to find one that is
          @index = (@index + 1) % battlers.size
        end
        # create hotkey assignment scene with the current screen tint
        $scene = Scene_AI_Behavior.new(@index, @command_window.index)
      when 2
        # play sound
        $game_system.se_play($data_system.decision_se)
        # get all AI actors
        battlers = $BlizzABS.battlers
        # set previous index
        @index = (@index + battlers.size - 1) % battlers.size
        # if battler not valid
        while battlers[@index].battler == nil
          # try to find one that is
          @index = (@index + battlers.size - 1) % battlers.size
        end
        # create hotkey assignment scene with the current screen tint
        $scene = Scene_AI_Behavior.new(@index, @command_window.index)
      when 3
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create map scene
        $scene = Scene_Map.new
      end
    # if R is pressed
    elsif Input.trigger?(Input::R)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # get all AI actors
      battlers = $BlizzABS.battlers
      # set next index
      @index = (@index + 1) % battlers.size
      # if battler not valid
      while battlers[@index].battler == nil
        # try to find one that is
        @index = (@index + 1) % battlers.size
      end
      # create hotkey assignment scene with the current screen tint
      $scene = Scene_AI_Behavior.new(@index, @command_window.index)
    # if L is pressed
    elsif Input.trigger?(Input::L)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # get all AI actors
      battlers = $BlizzABS.battlers
      # set previous index
      @index = (@index + battlers.size - 1) % battlers.size
      # if battler not valid
      while battlers[@index].battler == nil
        # try to find one that is
        @index = (@index + battlers.size - 1) % battlers.size
      end
      # create hotkey assignment scene with the current screen tint
      $scene = Scene_AI_Behavior.new(@index, @command_window.index)
    end
  end
end
#==============================================================================
# Scene_AI_Triggers
#------------------------------------------------------------------------------
#  This class processes handling of the scene where ally action triggers can be
#  set up which is used by the Ally Trigger AI.
#==============================================================================

class Scene_AI_Triggers
 
  #----------------------------------------------------------------------------
  # Initialization
  #  tone  - screen background tone
  #  index - actor party index
  #----------------------------------------------------------------------------
  def initialize(index = 0, command_window_index = 0)
    # data
    @index, @actor = index, $BlizzABS.battlers[index].battler
    # command window index
    @command_window_index = command_window_index
    # status effect names
    @states = [BlizzABS::Cache::WORDNormalState]
    (1...$data_states.size).each {|id| @states.push($data_states[id].name)}
  end
  #----------------------------------------------------------------------------
  # main
  #  The main processing method.
  #----------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # create command window
    @command_window = Window_Command.new(160, BlizzABS::Cache::CommandsAITrigger)
    # command window coordinates
    @command_window.x = 480
    # command window initial index
    @command_window.index = @command_window_index
    # create trigger command window
    @tcommand_window = Window_Command.new(160, BlizzABS::Cache::CommandsTrigger)
    # trigger command window coordinates
    @tcommand_window.x = 480
    @tcommand_window.y = @command_window.height
    # trigger command window no cursor
    @tcommand_window.index = -1
    # trigger command window not active
    @tcommand_window.active = false
    # create name window
    @name_window = Window_Base.new(480, 416, 160, 64)
    # create bitmap
    @name_window.contents = Bitmap.new(@name_window.width - 32,
        @name_window.height - 32)
    # if using Dyna Edition scripts
    if $fontface != nil
      # set font name and size
      @name_window.contents.font.name = $fontface
      @name_window.contents.font.size = $fontsize
    # if using PK Edition 2
    elsif $defaultfonttype != nil
      # set font name and size
      @name_window.contents.font.name = $defaultfonttype
      @name_window.contents.font.size = $defaultfontsize
    end
    # draw actor name
    @name_window.draw_actor_name(@actor, 4, 0)
    # update trigger command display
    check_triggers
    # creat triggers window
    @triggers_window = Window_Triggers.new(@actor)
    # transition
    Graphics.transition
    # loop
    loop do
      # update game screen
      Graphics.update
      # update input
      Input.update
      # update the scene
      update
      # stop if frame update
      break if $scene != self
    end
    # freeze screen
    Graphics.freeze
    # delete command window
    @command_window.dispose
    # delete trigger command window
    @tcommand_window.dispose
    # delete triggers window
    @triggers_window.dispose
    # delete name window
    @name_window.dispose
    # delete spriteset
    @spriteset.dispose
    # delete viewport
    @view.dispose
  end
  #----------------------------------------------------------------------------
  # update_command
  #  The command window update processing method.
  #----------------------------------------------------------------------------
  def update_command
    # update command window
    @command_window.update
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # create map scene
      $scene = Scene_Menu.new(6)
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # which option
      case @command_window.index
      when 0
        # play sound
        $game_system.se_play($data_system.decision_se)
        # deactivate command window
        @command_window.active = false
        # activate trigger command window
        @tcommand_window.active = true
        # set cursor
        @tcommand_window.index = 0
      when 1
        # play sound
        $game_system.se_play($data_system.decision_se)
        # get all AI actors
        battlers = $BlizzABS.battlers
        # set next index
        @index = (@index + 1) % battlers.size
        # if battler not valid
        while battlers[@index].battler == nil
          # try to find one that is
          @index = (@index + 1) % battlers.size
        end
        # create hotkey assignment scene with the current screen tint
        $scene = Scene_AI_Triggers.new(@index, @command_window.index)
      when 2
        # play sound
        $game_system.se_play($data_system.decision_se)
        # get all AI actors
        battlers = $BlizzABS.battlers
        # set next index
        @index = (@index + battlers.size - 1) % battlers.size
        # if battler not valid
        while battlers[@index].battler == nil
          # try to find one that is
          @index = (@index + battlers.size - 1) % battlers.size
        end
        # create hotkey assignment scene with the current screen tint
        $scene = Scene_AI_Triggers.new(@index, @command_window.index)
      when 3
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create map scene
        $scene = Scene_Map.new
      end
    # if R is pressed
    elsif Input.trigger?(Input::R)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # get all AI actors
      battlers = $BlizzABS.battlers
      # set next index
      @index = (@index + 1) % battlers.size
      # if battler not valid
      while battlers[@index].battler == nil
        # try to find one that is
        @index = (@index + 1) % battlers.size
      end
      # create hotkey assignment scene with the current screen tint
      $scene = Scene_AI_Triggers.new(@index, @command_window.index)
    # if L is pressed
    elsif Input.trigger?(Input::L)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # get all AI actors
      battlers = $BlizzABS.battlers
      # set next index
      @index = (@index + battlers.size - 1) % battlers.size
      # if battler not valid
      while battlers[@index].battler == nil
        # try to find one that is
        @index = (@index + battlers.size - 1) % battlers.size
      end
      # create hotkey assignment scene with the current screen tint
      $scene = Scene_AI_Triggers.new(@index, @command_window.index)
    end
  end
end
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This is a superclass for the save screen and load screen.
#==============================================================================

class Scene_File
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     help_text : text string shown in the help window
  #--------------------------------------------------------------------------
  def initialize(help_text)
    @help_text = help_text
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # create spriteset
#    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # Make help window
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    # Make save file window
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    # Select last file to be operated
    @file_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
#    @spriteset.dispose
    for i in @savefile_windows
      i.dispose
    end
  end
end
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
#  This class performs save screen processing.
#==============================================================================

class Scene_Save < Scene_File
   
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # If called from event
    if $game_temp.save_calling
      # Clear save call flag
      $game_temp.save_calling = false
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # Switch to menu screen
    $scene = Scene_Menu.new(7)
  end
end
#==============================================================================
# ** Scene_End
#------------------------------------------------------------------------------
#  This class performs game end screen processing.
#==============================================================================

class Scene_End

  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # Make command window
    s1 = "Title"
    s2 = "Exite"
    s3 = "Cancel"
    @command_window = Window_Command.new(192, [s1, s2, s3])
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 240 - @command_window.height / 2
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame Update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    @spriteset.dispose
    # Dispose of window
    @command_window.dispose
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update command window
    @command_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(9)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # to title
        command_to_title
      when 1  # shutdown
        command_shutdown
      when 2  # quit
        command_cancel
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # *  Process When Choosing [Cancel] Command
  #--------------------------------------------------------------------------
  def command_cancel
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to menu screen
    $scene = Scene_Menu.new(9)
  end
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================

class Scene_Load_Menu < Scene_File

  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Remake temporary object
    $game_temp = Game_Temp.new
    # Timestamp selects new file
    $game_temp.last_file_index = 0
    latest_time = Time.at(0)
    for i in 0..3
      filename = make_filename(i)
      if FileTest.exist?(filename)
        file = File.open(filename, "r")
        if file.mtime > latest_time
          latest_time = file.mtime
          $game_temp.last_file_index = i
        end
        file.close
      end
    end
    super("Which file would you like to load?")
  end
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
    # If file doesn't exist
    unless FileTest.exist?(filename)
      # Play buzzer SE
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    # Play load SE
    $game_system.se_play($data_system.load_se)
    # Read save data
    file = File.open(filename, "rb")
    read_save_data(file)
    file.close
    # Restore BGM and BGS
    $game_system.bgm_play($game_system.playing_bgm)
    $game_system.bgs_play($game_system.playing_bgs)
    # Update map (run parallel process event)
    $game_map.update
    # Switch to map screen
    $scene = Scene_Map.new
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # Switch to title screen
    $scene = Scene_Menu.new(8)
  end
  #--------------------------------------------------------------------------
  # * Read Save Data
  #     file : file object for reading (opened)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    # Read character data for drawing save file
    characters = Marshal.load(file)
    # Read frame count for measuring play time
    Graphics.frame_count = Marshal.load(file)
    # Read each type of game object
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables     = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party         = Marshal.load(file)
    $game_troop         = Marshal.load(file)
    $game_map           = Marshal.load(file)
    $game_player        = Marshal.load(file)
    # If magic number is different from when saving
    # (if editing was added with editor)
    if $game_system.magic_number != $data_system.magic_number
      # Load map
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
    # Refresh party members
    $game_party.refresh
  end
end
Title: Re: [XP] Mouse Path Finder
Post by: nathmatt on May 31, 2010, 05:57:43 pm
are you sure my script is causing the problem all my script does is add to the mouse script by blizz by making it where you can click a spot on the map and move there
Title: Re: [XP] Mouse Path Finder
Post by: cyclope on June 01, 2010, 02:14:34 pm
You are wright, now i see the problem is with mouse controller, but do you know a way to make it work?
Title: Re: [XP] Mouse Path Finder
Post by: Blizzard on June 01, 2010, 03:33:23 pm
The Mouse Controller usually works with normal menus. If it's not working with the CMS you are using then somebody seriously screwed up when making that CMS. -_-
Title: Re: [XP] Mouse Path Finder
Post by: nathmatt on June 01, 2010, 04:03:53 pm
The problem is that mogs commands are fake commands done using pictures so usualy the actual command window isn't even in the same spot what you need is a picture command window that would fix it
Title: Re: [XP] Mouse Path Finder
Post by: Blizzard on June 01, 2010, 04:07:05 pm
Point still valid, lol!
Title: Re: [XP] Mouse Path Finder
Post by: nathmatt on June 05, 2010, 05:06:00 pm
update: 1.20 added activate events by clicking on them
Title: Re: [XP] Mouse Path Finder
Post by: legacyblade on June 06, 2010, 01:33:29 am
A good feature to add (since you have event activation already) would be changing of the icon when you mouse over an event. It'd be even cooler if you were able to set which icon in the event's name.
Title: Re: [XP] Mouse Path Finder
Post by: element on June 06, 2010, 05:24:38 am
Quote from: legacyblade on June 06, 2010, 01:33:29 am
A good feature to add (since you have event activation already) would be changing of the icon when you mouse over an event. It'd be even cooler if you were able to set which icon in the event's name.


Already saw this in another pathfinder
It worked with comments in the event like for example a enemy would have comment: (S) on the first line so that a sword icon appears.
Title: Re: [XP] Mouse Path Finder
Post by: nathmatt on June 06, 2010, 08:38:38 am
update: 1.21 added the ability to change the event icon while over a special named event

edit: i might have to come up with a new name for this script since the path finder is just 1 of the options of the script
Title: Re: [XP] Mouse Path Finder
Post by: Wizered67 on June 06, 2010, 12:18:23 pm
This looks really good, except for one thing. For some reason while I am facing down and try to click on a transfer event, I get a type error on line 275 saying no implicit conversion from nil to integer. The line is
Spoiler: ShowHide
Quotepix.times {result.unshift(tdirs[@closed[cx, cy]])}




I'd really appreciate if you could fix this.

edit: Now I'm getting another error. after I go to the menu and exit it, when I try to click to move, I get a disposed window error on line 135 which is
Spoiler: ShowHide
Quote@window_array.each {|s| return true if s != nil && s.active }

It could be that something I'm using is incompatible


edit: Is this compatible with RMX-OS?


edit(again): Heres the demo http://www.sendspace.com/file/o27vlw (http://www.sendspace.com/file/o27vlw). I couldn't reproduce the disposed window error.....
Title: Re: [XP] Mouse Path Finder
Post by: nathmatt on June 06, 2010, 01:02:40 pm
can u upload a demo because im not getting that error
Title: Re: [XP] Mouse Path Finder
Post by: legacyblade on June 06, 2010, 08:05:30 pm
You could name it to Mouse Event System, Mouse Map Integration, or something similar. Because, ya, this has gone beyond a path finding system.
Title: Re: [XP] Mouse Path Finder
Post by: nathmatt on June 06, 2010, 09:02:47 pm
update: 1.22 fixed bug
update: 1.23 fixed another bug and added a disabling script call
update: 1.24 added the ability to have a name pop up over a special named event
update: 1.25 fixed a few things
update: 1.26 small bug fix
update: 1.27 small bug fix ok now it should be fully working

edit: question does it look better with the back or without the name pop up
Title: Re: [XP] Mouse Controller enhancement Script
Post by: Wizered67 on June 10, 2010, 06:50:26 pm
I'm using Blizz-abs, and after I kill the monster that I set to have a name appear for, I get undefined method screen_y for nil:Nilclass.
The line is
Spoiler: ShowHide
Quote@sprite.y =  $game_map.events[id].screen_y - 64

Title: Re: [XP] Mouse Controller enhancement Script
Post by: nathmatt on June 10, 2010, 07:15:38 pm
update: 1.28 fixed bug where when an event was deleted it would still try to get information from it
Title: Re: [XP] Mouse Controller enhancement Script
Post by: Wizered67 on June 10, 2010, 07:39:17 pm
Thanks. Sorry I keep finding errors.....
By the way, is there any way to fix this script so that you don't have to edit EVERY non passable thing to have the terrain tag..... This is the only thing keeping me from using this....
Oh, and I don't think this is compatable with your character drop down for RMX-OS.
Title: Re: [XP] Mouse Controller enhancement Script
Post by: nathmatt on June 10, 2010, 07:41:52 pm
yea i have been meaning to fix that and i can make it where it wont go to impassible tiles but you will still have to fix the passable non reachable tiles

update: 1.29 fixed non passable bug
update: 1.30 fixed compatibility to my character drop down menu
Title: Re: [XP] Mouse Controller enhancement Script
Post by: legacyblade on June 11, 2010, 01:48:18 am
It seems to be working great! Only problem is no matter what I do, the events never seem to activate when I click on them. Also, it would be useful if we could set up, on an event-by-event basis, whether the event is triggered right when you click on it (for minigames and such) or if the character walks up to the event then activates it (npcs and items you pick up).
Title: Re: [XP] Mouse Controller enhancement Script
Post by: nathmatt on June 11, 2010, 03:03:54 am
I could set that up with the events name too shouldn't be that hard

update:1.31 added the ability to activate events instantly after clicking them fixed a few bugs
also removed the use of Game_Player update making it more compatible with other scripts 
Title: Re: [XP] Mouse Controller enhancement Script
Post by: legacyblade on June 11, 2010, 12:23:29 pm
Works perfectly now! Thanks! I love this script.
Title: Re: [XP] Mouse Controller enhancement Script
Post by: cyclope on June 11, 2010, 02:57:43 pm
For some reason I see the cursor like this (http://i915.photobucket.com/albums/ac351/cyclope_hud/Cursor.jpg) :P It shows only the custum cursor when the mause is not moving :'(
Title: Re: [XP] Mouse Controller enhancement Script
Post by: nathmatt on June 11, 2010, 03:01:10 pm
it only does that if your not in full screen that is how Blizzard made it in his Mouse Controller
Title: Re: [XP] Mouse Controller enhancement Script
Post by: Blizzard on June 11, 2010, 03:12:50 pm
That's Windows' fault and there's not much (I'm such a bad liar) you can do.
But seriously, if you're running the game in fullscreen, this shouldn't pose a problem.
Title: Re: [XP] Mouse Controller enhancement Script
Post by: nathmatt on June 11, 2010, 03:26:26 pm
i kinda figured that
Title: Re: [XP] Mouse Controller enhancement Script
Post by: legacyblade on June 12, 2010, 12:34:10 am
I'm sure there's a way to avoid that, as I've seen other RMXP games show their own cursor (hiding the default windows one) when in windowed mode. I guess if you just disable the alt+enter and make it auto fullscreen (most commercial games only run in fullscreen, so it shouldn't be that irritating), it would be fine. But it does get rather irritating.
Title: Re: [XP] Mouse Controller enhancement Script
Post by: Wizered67 on June 12, 2010, 12:41:23 am
If you want it to always go to full screen, heres the script for it. Its by Mr. Wiggles and I found it on rmrk.net. I just edited it a little so that it doesn't ask if you want to, but always does it.

Spoiler: ShowHide
=begin
==============================================================================
Writen by: Mr Wiggles
ver. 1.3
Date 12/3/09

This script is for those who want to make the option of haveing the player
decide if they would want to play in full screen with out having to press
Alt + Enter

Instructions:

This script is plug and play, just paste it ABOVE main, and BELLOW everything
else!
lable it Scene_FullPromt and thats it!

Hope you enjoy!  >.<

==============================================================================
=end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# Start Scene_FullPromp
#--------------------------------------------------------------------------
class Scene_FullPromp
#------------------------------------------------------------------------------ 
# Begin by loading DataBase
#------------------------------------------------------------------------------
    $data_system = load_data("Data/System.rxdata")
    $game_system = Game_System.new
def main
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    end
#--------------------------------------------------------------------------
#  Update
#--------------------------------------------------------------------------
def update
   
   
    showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
       showm.call(18,0,0,0)
       showm.call(13,0,0,0)
       showm.call(13,0,2,0)
       showm.call(18,0,2,0)
       $scene = nil
    end
#---------------------------------------------------------------------------
# Re-Write Main - It's Temperary for plug and play
#---------------------------------------------------------------------------
begin
  Graphics.freeze
   $scene = Scene_FullPromp.new
  while $scene != nil
    $scene.main
  end
  Graphics.transition(20)
rescue Errno::ENOENT
  filename = $!.message.sub("No such file or directory - ", "")
  print("Unable to find file #{filename}.")
end
end




Title: Re: [XP] Mouse Controller enhancement Script
Post by: legacyblade on June 12, 2010, 12:51:39 am
Thanks for that :D Now I can make mouse related games with no trouble!
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 13, 2010, 07:34:48 am
update: 1.32 fixed a bug & added the ability to disable movement
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Jragyn on June 13, 2010, 08:23:52 pm
you and valdred should get together and combine this script with his Event Drop-down System (http://forum.chaos-project.com/index.php/topic,6579.0.html).

I think the two combined could make for some serious l33tness.


--J
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 13, 2010, 08:45:23 pm
i have 1 for RMX-OS for players
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Jragyn on June 13, 2010, 09:54:30 pm
Well, that doesn't do us non-RMX-OS players any good, now does it? lol.


--J
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: cyclope on June 14, 2010, 05:57:48 pm
I am using this with blizzabs and I think this would be beter that whene you click an enemy it will follow and attack him instead of positioning infront and then attack with right click because its get very tricky to attack an enemy. :wacko:
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 15, 2010, 08:56:02 am
update: 1.33 added configurable font size and color for the displayed message over an event & fixed a few bugs
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: legacyblade on June 22, 2010, 01:03:06 am
I found a couple of bugs with the newest version.

When using blizzABS, you have to use the following script command to be able to use the features of your script.


$MCES.disabled = false
$MCES.movement_disabled = false


For some reason, blizzABS initializes them to true (at least the movement one, forgot to test which one was needed. I think it's just the movement, as you can still select things in the menu and see the cursor). Should be a simple fix.

Also, when using tons of addons for the required custom controls, there is a very odd bug. When you click on a non auto-event, nothing happens. But after you move to another location (after having clicked the non-responsive event), the event's code executes. This isn't the case with blizzABS. I don't use RMX-OS, so I can't test the bug in it.

Thanks again for making this script, it's really helping me out.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 22, 2010, 05:01:21 pm
Quote from: legacyblade on June 22, 2010, 01:03:06 am
I found a couple of bugs with the newest version.

When using blizzABS, you have to use the following script command to be able to use the features of your script.


$MCES.disabled = false
$MCES.movement_disabled = false


For some reason, blizzABS initializes them to true (at least the movement one, forgot to test which one was needed. I think it's just the movement, as you can still select things in the menu and see the cursor). Should be a simple fix.


first i just for got to set it to false in the initialization just set it to false there also all events must have a graphic i prpobably for got to mention that so that you won't trigger unwanted events
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: legacyblade on June 22, 2010, 05:11:54 pm
alright, I'll set it to false in the initialization. But the problem with the events shows up on an event with a graphic. And only when I'm using the ToA custom controls rather than using blizzABS. The event activates just fine, it just waits to activate until I've told my character to move. I click on the event and nothing happens. Then once I click elsewhere (and I'm sure I'm not clicking on any events), the character will move to wherever I click, but it'll activate the event I previously clicked (even if I'm on the other side of the map). The event isn't set to auto. And this bug only shows up when using the ToA custom controls.

-edit

I found an odd bug that (as far as I can see) doesn't have any effect on your script. (it might in future updates though) Your Mouse initialize method doesn't get called. Not quite sure why this is, but my best guess is that the only time an instance of the mouse class is created in the original mouse controller script. (not sure why that'd do it, but for whatever reason your initialize method isn't being called. I found this out by working on an addon)

Also, using $MCES.movement_disabled = false doesn't work if you're using the ToA custom controls instead of blizzABS (which explains why I was only running into the problem of having to manually enable movement when I was using blizzABS)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 22, 2010, 05:32:08 pm
im going to need some sort of demo because i cant reproduce that but it only activates when i click on it or after i reach the event
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: legacyblade on June 22, 2010, 05:48:31 pm
http://www.sendspace.com/file/c8ci2s

I included two demos. One that uses the entire ToA collection and just activates the custom controls. I also made a demo with the custom controls module extracted from ToA. (to show that it's a bug involving the ToA controls handling of your script, rather than a conflict with another addon). Neither of the bugs mentioned in this demo are present when you're using blizzABS instead of ToA.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 22, 2010, 06:44:40 pm
update: 1.34 fixed bud where the player would move even when movement was disabled
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: legacyblade on June 22, 2010, 06:48:56 pm
Fixing that bug seems to have fixed the other bug! Thanks nathmatt!
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 21, 2010, 08:01:18 pm
Future updates auto will have a width and height and a new event name for locked doors both of these gave been created just working out a few bugs that & I still need to get a virus scanner

update: 1.40 added width, height,doors,event commands,pickup and drop items

update: 1.41 fixed a trade window bug with RMXOS
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Arnon on August 21, 2010, 07:08:42 am
I'm using this script with BlizzABS and my char not able to move around map. It moves toward the events, but get stuck when I click on tiles.
I found the reason in that line:
return if @get_path || !$game_player.passable?(@x,@y,0) ||

If I delete !$game_player.passable?(@x,@y,0) || condition he moves perfectly.
Or without deleting if I hold CTRL key he also moves.
Can u check this, pls.
Demo is attached.
http://www.mediafire.com/?xa5jc3n4idmx49h
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on August 24, 2010, 01:04:15 pm
updated 1.42 fixed movement bug
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Magicks on August 25, 2010, 03:23:37 pm
hi =)
I gets an error with the message
"Scrip´t 'Mouse Controller Enhancement Script' line 727: NameError occurred.
undefined local variable or method `mces_cdispose_trade_window´for #<Scene_Map:0x15d88208>
if trade window is closed

im use this scripts:
Global Switches and Variables for RMX-OS by Blizzard
Mouse Controller by Blizzard
Character Drop Down Menu by Nathmatt
and RMX-OS by Blizzard

can u help pls =(
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on August 25, 2010, 04:18:36 pm
update: 1.43 fixed small typo

to fix yourself just change this

mces_cdispose_trade_window


to this

mces_dispose_trade_window


Title: Re: [XP] Mouse Controller Enhancement Script
Post by: ojp2010 on August 29, 2010, 01:30:15 am
I am having some problems with the Mouse controller system. It isn't letting player touch events work right, I have to click on the square the player touch event is. Like a map transfer event won't work unless I use the mouse to click the ground near it. Is there a way to fix this?

Scripts I am using and in current order
Spoiler: ShowHide

MapLinks
MAW 1.2
Mouse Menu
Skill Shop
Graveyard
MOG - Location_Name
MOG - Treasure_Name
MOG - Item Limit
Ton 0f Addons (1)
Ton 0f Addons (2)
Ton 0f Addons (3)
RMX-OS Options
RMX-OS Script
RMX-OS Global Switches & Variables
RMX-OS Versioning
Blizz ABS (1)
Blizz ABS (2)
Blizz ABS (3)
ABS HUD made by nathmatt
Blizz ABS Controller
Critical Sounds for ABS
Auto-Targeting for ABS
Advanced Time and Environment
Global Day-Night System
Mouse Controller
Mouse Controller Enhancement
Mouse Drop Down Menu
RMX-OS Main
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on August 29, 2010, 05:46:34 am
update 1:44 fixed bug that prevented player touch and auto run from working on events
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: ojp2010 on September 06, 2010, 05:12:05 pm
Everything is working very well with the script, however, I have run into a small problem. I have a quest in my game where players need to collect flowers for NPC. So I made an event, the following:

Page 1 > Action Touch
Change Item: +1 [Flower]
Control Switch: 0001 Flower ON

Page 2 > Parallel Process > Control Switch 0001 Flower
Wait: 20
Control Switch 0001 Flower OFF

The event works however when looking at the server log after a player clicks on the flower, I am using Mouse Controller, the flower is set to true. But the event doesn't go away in the Map Scene. When I click on it again it is set to true again then disappears for the 20 then reappears and it set to true again. So bacially a player has to click it twice before it will "despawn" giving the player a chance to collect two flowers from one "node". Can anyone help me with this? I don't want them to be able to do that just one click and one flower.

I tested it, I am using blizzard's mouse controller script, and the event works fine with just that script. I am assuming it is either the Enchance mouse controller and mouse controller drop down menu is causing the problem.

Here are both scripts, if anyone has any ideas.

Enhance mouse controller
(click to show/hide)

Mouse Controller Drop Down Menu

(click to show/hide)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 06, 2010, 06:15:33 pm
can you make a new project with just that event in it so i can look at it because i can not reproduce it
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: ojp2010 on September 06, 2010, 06:30:46 pm
Here you go sir, thanks for taking a look for me. I am using RMX-OS too, I don't know if you have a server set up or not, the will need the server to run.

http://www.mediafire.com/?rgo6a4mpoqvmche (http://www.mediafire.com/?rgo6a4mpoqvmche)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 06, 2010, 06:52:47 pm
do you have a message to display like in the 1 you sent me ? because the second click would be disposing the message

edit never mind on that as soon as i added the global switches it started doing it
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: ojp2010 on September 06, 2010, 07:04:39 pm
Alright, do you need anything from me then?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 06, 2010, 07:15:20 pm
it seems it was the global switch script replace it with this

Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Global Switches and Variables for RMX-OS by Blizzard
# Version: 1.01
# Type: RMX-OS Add-on
# Date: 7.1.2010
# Date: 22.2.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: RMX-OS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below RMX-OS and requires RMX-OS v1.09 or
#   higher to work properly. This script will allow to have global switches and
#   variables on your server.
#   
#   
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !defined?(RMXOS) || RMXOS::VERSION < 1.09
  raise 'ERROR: The "Global Switches and Variables" requires RMX-OS 1.09 or higher.'
end

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

GLOBAL_SWITCHES = [1, 2] # make sure this matches the extension configuration
GLOBAL_VARIABLES = [1, 2] # make sure this matches the extension configuration

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# Game_Temp
#==============================================================================

class Game_Temp
 
  attr_accessor :disable_global
 
end
 
#==============================================================================
# Game_Switches
#==============================================================================

class Game_Switches
 
  alias set_gswivar_later []=
  def []=(id, value)
    if !$game_temp.disable_global && GLOBAL_SWITCHES.include?(id)
      $network.send_switch(id, value)
    else
      set_gswivar_later(id, value)
    end
  end
 
end
 
#==============================================================================
# Game_Switches
#==============================================================================

class Game_Variables
 
  alias set_gswivar_later []=
  def []=(id, value)
    if !$game_temp.disable_global && GLOBAL_VARIABLES.include?(id)
      $network.send_variable(id, value)
    else
      set_gswivar_later(id, value)
    end
  end
 
end
 
#==============================================================================
# RMXOS::Network
#==============================================================================

class RMXOS::Network
 
  alias check_game_gswivar_later check_game
  def check_game(message)
    case message
    when /\AGSW(.+)\t(.+)/
      $game_temp.disable_global = true
      $game_switches[$1.to_i] = ($2 != '0')
      $game_temp.disable_global = false
      $game_map.need_refresh = true
      return true
    when /\AGVA(.+)\t(.+)/
      $game_temp.disable_global = true
      $game_variables[$1.to_i] = $2.to_i
      $game_temp.disable_global = false
      $game_map.need_refresh = true
      return true
    end
    return check_game_gswivar_later(message)
  end
 
  alias check_loading_gswivar_later check_loading
  def check_loading(message)
    result = check_loading_gswivar_later(message)
    if result
      if @messages.include?(RMXOS::LOADING_END)
        @messages.delete(RMXOS::LOADING_END)
        self.send('LGD')
      end
    else
      case message
      when /\ALGS(.+)/ # load global switches
        hash = eval($1)
        $game_temp.disable_global = true
        hash.each_key {|id| $game_switches[id] = hash[id]}
        $game_temp.disable_global = false
        return true
      when /\ALGV(.+)/ # load global variables
        hash = eval($1)
        $game_temp.disable_global = true
        hash.each_key {|id| $game_variables[id] = hash[id]}
        $game_temp.disable_global = false
        $game_map.need_refresh = true
        @messages.push(RMXOS::LOADING_END)
        return true
      end
    end
    return result
  end
 
  def send_switch(id, value)
    self.send("GSW#{id}\t#{value ? 1 : 0}")
  end
 
  def send_variable(id, value)
    self.send("GVA#{id}\t#{value}")
  end
 
end
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: ojp2010 on September 06, 2010, 07:32:56 pm
Works great thank you very much for your help.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Arnon on September 25, 2010, 04:14:26 am
Hi again. Can you suggest how to enable route change while movement and did not wait until hero will end his move from point A to point B?

Quoteforce_moving if !$game_player.moving?


I try to disable this condition but it didn't work :)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 25, 2010, 07:32:45 am
ill see what i can do you cant just turn it off it messes up the pathfinder if you click before you finish moving causes it to go to the wrong spot and eventually stop working all together
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Arnon on September 26, 2010, 03:37:54 am
Quote from: nathmatt on September 25, 2010, 07:32:45 am
ill see what i can do you cant just turn it off it messes up the pathfinder if you click before you finish moving causes it to go to the wrong spot and eventually stop working all together

Ok, thanks. Today I found a new bug: If you press F12 (to reset the game) you will get this error:
(http://i54.tinypic.com/23w5qhz.png)
(a little demo if you need: http://www.mediafire.com/?jsy5m8xf45rlnmj)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 26, 2010, 07:04:15 am
i actuall suggest not using F12 because you will get an error on all every thing that was aliased
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Arnon on September 27, 2010, 01:45:38 pm
Quote from: nathmatt on September 26, 2010, 07:04:15 am
i actuall suggest not using F12 because you will get an error on all every thing that was aliased

Hmm, if you rename a variable (for example, ColorCFG    = Color.new(0,0,160,255) and in line #271) you can avoid this error.
But then in the original Mouse Controller script appears Stack level too deep error after pressing F12.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 27, 2010, 02:06:11 pm
i know thats y i said that i was about to post the fix when i noticed that you will get the same error on all things aliased
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Arnon on September 27, 2010, 03:14:03 pm
Another bug: when using your script with Tons of Add-ons it disable Enter and Space action keys.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 27, 2010, 03:53:07 pm
only on events you have to click them its not a bug its a bug fix to prevent events from activating when you click to move
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Arnon on September 27, 2010, 04:07:25 pm
Quote from: nathmatt on September 27, 2010, 03:53:07 pm
only on events you have to click them its not a bug its a bug fix to prevent events from activating when you click to move

But with BlizzABS action keys works well...

Sorry if I bother :) And what about events under the player? Even if you click on invisible one (without any graphic) the hero comes near, not on the tile with such event, like it was impassable. Maybe you should add some check for this types of events and for "always on top" too, etc.

Also when you click at events that move, the script doesn't work well.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 27, 2010, 05:03:20 pm
yea i know i need to rework the move route to fix that and the allow you to click again before reaching the destination
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Karltheking4 on January 18, 2011, 03:31:41 am
(Sorry for necroposting!)

When movement is disabled, events activated by the action button won't activate anymore, is there anything you can do about that?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on January 18, 2011, 02:48:20 pm
are you making sure your disabling movement like this
$MCES.movement_disabled = true


edit: events will never activate using the action button while using this script they have been changed to activate by click when you finish moving or are next to the but you still have to click them
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Karltheking4 on January 18, 2011, 03:34:32 pm
Ahh, thankyou :)
But that wasn't the whole problem, I forgot to flick this
@event_start = false

to true, so that wasn't the smartest thing for me to do :P
Thanks for your help, and this awesome script :D
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on January 18, 2011, 03:38:56 pm
actually that is set to false to prevent the event from activating when you try to move with the mouse
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: karldaylo on April 25, 2011, 11:28:58 pm
im using this script.. and it worked awesomely remarkable

but when im about to click a location which is unable to go to (not a terain tag, but a location which is blocked... unable to go there) the movement isnt responding anymore... after a few while it move by it self randomly...

maybe my systems fault?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on April 26, 2011, 11:45:44 am
Quote from: nathmatt on March 24, 2010, 08:31:41 pm
Cant_go  = 7                      # The terrain tag for unreachable locations
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Shalaren on April 30, 2011, 10:24:43 pm
S: everything works except moving for me, IDK exactly what stops it from moving to where I click.
so just incase im missing smething, I need to turn on a switch or call a script or something?
everything else works, it just doesnt move with the mouse.

um one of the requirments is "TOA Custom Controls", I dont think i have that?  :wacko:
(IN case if its the reason it doesnt move by the mouse) Tried searching for it, Where can I get it?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 01, 2011, 07:59:50 am
You toa is tons of addons but you only need that if you do not have blizzabs or rmxos
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Shalaren on May 01, 2011, 10:37:20 am
oh then yeah, the moving by clicking doesnt work for me for some reason,
i tried making a new project without all the scripits I have, and it still doesnt work, IM missing something I just cant figure it out S:
do I need to apply something? or call a script in game?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 01, 2011, 10:50:26 am
send me a demo so i can look at it its been a while since i messed with it
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Shalaren on May 01, 2011, 01:20:33 pm
my internet is to slow to upload a demo, but its ok ill try to figure it out,
another question\suggestion,
a way to available to click an event, lets say ur on the bottom of the screen, and the event is on top, you can still click it and activate the event as its so far, so I was wondering for a way to like say, can only be clicked if the character is at least in the range of 5 squares. hope you get what i mean.

Edit: no chance ill figure it out, just put it on one of your projects that doesnt have it, none of em works for me, it must mean im ofrgetting something
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 01, 2011, 03:02:55 pm
ur using BLABS right so i can test with it
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Shalaren on May 01, 2011, 03:33:29 pm
yeah im using blizz abs
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 01, 2011, 09:20:45 pm
alright i will try to look at it 2marrow

edit go you have Mouse Controller by Blizzard ? Because i just tested and works fine
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Shalaren on May 02, 2011, 10:22:02 pm
WHAT THE... im starting to think its up with my computer, i just made a new project with only the 3 scripts, blizz abs, and the two mouse scripts... still doesnt walk to where I click, could you please upload a demo?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 03, 2011, 09:57:38 am
here (http://dl.dropbox.com/u/23790745/MCES%20Test.exe)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Shalaren on May 03, 2011, 04:15:33 pm
ok I figured it out! :) thanks!

and I found a bug, if you click on an unreachable place, the path finding stops working.. but onlys ometimes, and when you move with keys, its stops working also

if ur ever planning for a new version, I have suggestions? o:
that you can Include range when clicking on an event, like you can only click it if ur close by 5 squares. if ur farther nothing happens when clicking the event. if you get what i mean.
and another is a small one, to be able to put a graphic on the spot youve clicked,
example, you click somewhere on the map, and on that place an animation will appear as the character walks to it.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 03, 2011, 05:05:56 pm
both of those shouldn't be to hard i have been slowly try to rewrite this to improve it when i finish i will add that

right now i am trying to make true event clicking that goes off the sprite and not the event
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Shalaren on May 03, 2011, 05:12:51 pm
sounds good, also I noticed that you cant interrupt it if its pathfinding, which might kinda give alot of trouble and theres a chance thats why it stops working sometimes, by interrupt I mean you cant change your mind in the last second before its reaching its destination, it reaches its destination first before does anything else. so thid suggestion is to make it possible to interrupt.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 03, 2011, 06:23:07 pm
i will look into that the main reason i did that is it would break if you just clicked randomly fast
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Shalaren on May 03, 2011, 07:36:26 pm
yeah I kinda figured :P, I just think that it stops working randomly because it cant reach its destination but still tries, and so its just stuck at that. still tho great work :>
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 02, 2011, 01:33:38 pm
update 1.45
Rebuilt entire script, added true event clicking, and added graphic on spot where clicked.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: cyclope on June 02, 2011, 07:41:24 pm
I get an error in line 695, I just have Blizz ABS, Mouse controller, and this script.

Its this:

    @inner_bitmap = Bitmap.new(@cw,@ch) if @inner_bitmap == nil
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 04, 2011, 07:59:55 pm
update fixed above error

update fixed a few bugs

fixed set sprite
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: cyclope on June 11, 2011, 11:33:30 pm
I am having a bug with this lines(418-436). I am using Blizz-ABS and the Mouse Controller. This happens after I click any where.

Spoiler: ShowHide
    def modify(result)
      @x_off.times {result.unshift(TDirs[4])}
      @y_off.times {result.unshift(TDirs[8])}
      return if !$game_system._8_way
      result.each_index {|i|
      if result[i] != nil && result[i + 1] != nil
        case [result[i][0], result[i + 1][0]]
        when DirDownLeft, DirLeftDown
          result[i], result[i + 1] = TDirs[1], nil
        when DirDownRight, DirRightDown
          result[i], result[i + 1] = TDirs[3], nil
        when DirLeftUp, DirUpLeft
          result[i], result[i + 1] = TDirs[7], nil
        when DirRightUp, DirUpRight
          result[i], result[i + 1] = TDirs[9], nil
        end
      end}
      result.compact!
    end
   
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 12, 2011, 07:46:54 am
try it now
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: cyclope on June 15, 2011, 10:08:18 pm
I am still getting the same error. :(
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 16, 2011, 07:39:32 am
send me a demo
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: cyclope on June 16, 2011, 05:36:02 pm
Ok, I will.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 30, 2011, 01:13:52 pm
update 1.50 fixed the bug but pixel movement is automatically turned off and you can now choose a click a new location while moving

update 1.51 fixed a few bugs
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: RPGManiac3030 on July 07, 2011, 02:30:59 am
I'm getting a no method error when I start a new game on this line...

xs = get_sprite.x-(get_sprite.cw/2)


EDIT: I'm now getting this error...I have no idea why it's different

It says no implicit conversion from nil to integer...line 715

Quote@inner_bitmap = Bitmap.new(@cw,@ch) if @inner_bitmap == nil
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: LiTTleDRAgo on July 07, 2011, 06:39:05 am
I get an error

(http://img818.imageshack.us/img818/7003/glows.png) (http://imageshack.us/photo/my-images/818/glows.png/)

This appears after I clicked New Game in an empty project
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 07, 2011, 03:48:30 pm
try it now
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: RPGManiac3030 on July 07, 2011, 04:39:48 pm
I still get my error  :???:
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 07, 2011, 05:33:32 pm
@RPGManiac3030 sorry i missed your post i was seeing if i fixed LiTTleDRAgo's error i will look into ur's

edit try it now
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: RPGManiac3030 on July 07, 2011, 06:03:32 pm
Now I'm getting an undefined method ch on this line, line 726:

return if (@sprite && @sprite.cw || @sprite.ch) == nil


Sorry if I sound like a jerk  :^_^':
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 07, 2011, 06:07:32 pm
why would you ur just telling me about you error try changing that line to this and tell me if it fixes it

return if  @sprite == nil && (@sprite.cw == nil || @sprite.ch == nil)


edit if that dosen't work or you get another error send me a demo so i can look into it better
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: RPGManiac3030 on July 07, 2011, 08:16:05 pm
Ok, I'm getting the same error...here's a demo

http://dl.dropbox.com/u/15385392/JK%20Productions/Test.zip (http://dl.dropbox.com/u/15385392/JK%20Productions/Test.zip)

It's not my actual game, but I started a new game to see if the error still happened and it did.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 08, 2011, 12:55:40 pm
updated fixed you error let me know if you find any more
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: RPGManiac3030 on July 14, 2011, 01:37:47 am
Worked perfectly on a map without events, but when I went to a map with events, this happened:

(http://i499.photobucket.com/albums/rr358/kevin7571/Untitled.png)

I don't know if it's something on my map or a script clash that's causing all of these problems...
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 14, 2011, 09:12:30 am
ok should be fixed now and you getting error's because im fixing it while im using BlizzABS to prevent compatibility issues with it and your getting the errors that you get without BlizzABS which need to be fixed anyway
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: RPGManiac3030 on July 14, 2011, 01:35:29 pm
I'm still getting the same error
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 14, 2011, 05:49:26 pm
maybe its a compatibility issue with another script are you using

edit try it now i just made an edit that should fix the error you were getting

edit fixed bug where events wouldn't activate
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: LiTTleDRAgo on September 01, 2011, 02:49:16 am
could you make this compatible with pixel movement?
so, when using keyboard arrow the pixel movement still active
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 01, 2011, 06:09:42 am
let winko finish the update with the new pixel movement and i will look onto it
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Futendra on December 26, 2011, 11:03:22 am
First of all Sorry for necro-post...

I have some trouble with this script...

1) When I move without the mouse, I use pixel movement and when I use mouse it doesn't?
2) The player seems to ignore Player-touch activated events since I use the script?

Are there fixes for those? Anyways, great script!
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on December 26, 2011, 03:01:44 pm
Quote from: Futendra on December 26, 2011, 11:03:22 am
1) When I move without the mouse, I use pixel movement and when I use mouse it doesn't?


I am still waiting for winko's update before i fix this

Quote from: Futendra on December 26, 2011, 11:03:22 am
2) The player seems to ignore Player-touch activated events since I use the script?


by ignore do you mean you can't go up to them and press the (C) button ?

That is because the mouse click is considered the (C) button and if you were to click to move beside an event it would have activated.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Futendra on December 26, 2011, 05:57:02 pm
Quote from: nathmatt on December 26, 2011, 03:01:44 pm
Quote from: Futendra on December 26, 2011, 11:03:22 am
1) When I move without the mouse, I use pixel movement and when I use mouse it doesn't?


I am still waiting for winko's update before i fix this

Quote from: Futendra on December 26, 2011, 11:03:22 am
2) The player seems to ignore Player-touch activated events since I use the script?


by ignore do you mean you can't go up to them and press the (C) button ?

That is because the mouse click is considered the (C) button and if you were to click to move beside an event it would have activated.


It doesn't activate the event, I use player touch events to teleport and to use as doors and it doesn't work with this script
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on December 26, 2011, 06:12:05 pm
check it now i think i might have fixed it it's been a while since i messed with RGSS
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Futendra on December 26, 2011, 07:31:21 pm
Nope, only made more bugs... I cant use it really, guess I'll just stick to no mouse ;)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Starrodkirby86 on December 26, 2011, 10:11:18 pm
Quote from: Futendra on December 26, 2011, 07:31:21 pm
Nope, only made more bugs... I cant use it really, guess I'll just stick to no mouse ;)


May help to specify what bugs pop up, so we don't have some supposedly even buggier version released or something...
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on December 27, 2011, 12:06:06 pm
i fixed the the event thing the trigger was 0 not 1 like i thought
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Futendra on December 27, 2011, 12:15:16 pm
Quote from: Starrodkirby86 on December 26, 2011, 10:11:18 pm
Quote from: Futendra on December 26, 2011, 07:31:21 pm
Nope, only made more bugs... I cant use it really, guess I'll just stick to no mouse ;)


May help to specify what bugs pop up, so we don't have some supposedly even buggier version released or something...


It's probably a compatibility error...
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: mroedesigns on January 17, 2012, 05:00:21 am
Does this have any known issues with the custom windows? Ive been using that alright, but I add this and click anything on the map and I get a NoMethod error on line 619

    $network.send_player_data if $network != nil
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on January 17, 2012, 09:26:28 am
that is a RMXOS fix are you using RMXOS if so that method may have been renamed on me if not do a global search using (ctrl shift F) and search for $network to see if something else if using that variable
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: mroedesigns on January 17, 2012, 03:06:39 pm
Nope, $network is still being used. Here it is in line 42 of RMX-OS Main, for instance.

  # activate the network
  $network = RMXOS::Network.new

Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on January 18, 2012, 09:01:06 am
i was asking if RMX-OS was being used give me a few mins to download the newest version and see what the method was renamed to

edit: try it now looks like Blizzard removed the need for that method
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: mroedesigns on January 18, 2012, 01:53:06 pm
So just take out that line? Or is it more than a one line fix?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on January 18, 2012, 02:25:26 pm
yea as far as i can tell that should be it just remove that line
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: mroedesigns on January 18, 2012, 02:47:05 pm
That did it, thanks!
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: athreus on February 07, 2012, 04:27:29 pm
Sorry for necropost, but I have an Error. I'm using only this script with the necessary Mouse Controller by Blizzard...

Line 446:NoMethodError occured
Undefined method 'inner_bitmap' for nil:NilClass

This problem come out when i try to put Msg[] command in the event name.
I hope you can understand my bad english (I am Italian XD). Again sorry for necroposting.

Thanks very much for the help!!!
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: athreus on February 24, 2012, 07:00:43 am
Up
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on February 26, 2012, 10:16:50 am
try it now it should be fixed
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: athreus on March 02, 2012, 02:04:14 pm
Thanks for your help, this work, but i have noticed another error with  the \commands function. After i click on the event, the commands window
open, but when i click on map or on a command the game will crash and show a disposed window error in Blizzard Mouse Controller. I hope this can be fixed... Tanks again for your help!
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on March 03, 2012, 07:01:24 am
Quote from: nathmatt on February 26, 2012, 10:16:50 am
try it now it should be fixed
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: athreus on March 03, 2012, 05:25:18 pm
There is a NoMethodError on line 154 when I click on ground for moving.

undefined mehotd 'mouse_in_area?' for nil:NilClass.

Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Kiwa on May 06, 2012, 08:25:48 am
I'm getting that exact error if i DONT click on an NPC (event)
if I click the NPC event it will chase it until the enemy attacks me
if its a non threat NPC that speaks.. it will speak..and i can click to close the chat bubble.
if i click on a walkable path.. it bugs and gives me that same error. one block away or ten.. doesn't matter.. insta bug.
Mouse Control Ext is the title i gave my script...obviously lol.
-------------------------------------------------------------------
Script 'Mouse Control Ext' line 154: NoMethodError occored

undefined mehotd 'mouse_in_area?' for nil:NilClass
-------------------------------------------------------------------

I tried it with and without "Eight way Movement" and " Repair Movement" thinking it may help.
but to no avail.
any help would be appreciated :)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 06, 2012, 10:08:58 am
remove that line im not sure y i added that line it has no use i fixed and updated
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Kiwa on May 06, 2012, 10:59:43 am
Thanks!! out of curiosity i actually # the line and it worked fine lol.
I hopped on to post that it was working and wanted to know if it would leave me with bugs :)
guess it wont!
Thanks a bundle!
BTW.. its a great script and i like it a lot. I can see it being a great use to games :)

I'm interested in adding to it..is there a way to add to make it move in the direction of the mouse cursor at a constant rate if i say.. held down the right click or a hot key on the KB?

I'm not a good scriptwriter. So i greatly appreciate all this help from the forum. you guys are great! 
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 06, 2012, 12:09:42 pm
here tell me if this was what you where talking about requires Tons of Add_ons place it below this script

module MCES
 
  Buton_Held = 'Shift'
 
 
  class Processor
   
    alias update_movement update
    def update
      update_movement
      if Input.press?(Input::Key[Buton_Held]) &&
          !$game_temp.message_window_showing && !check_event && @lwait == 0
        @lwait = 5
        x,y = mouse_tile
        $game_player.set(x,y)
      end
    end
  end
         
end
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Vexus on May 06, 2012, 07:03:00 pm
Hi I'm trying your script on a new project and dunno why but I placed an event on the map with through on (It's some blood on the floor to be specific) but whenever I click on that spot the character doesn't want to move there. Anything I can do to solve it?

Also I'm putting some events set as action on doors or whatever but when I click with the mouse nothing happens so I tried pressing c but still nothing happens, am I doing something wrong?

Thanks

[Edit]

I sort of found a solution for the 2nd problem utilizing the /commands feature but with this new thing another 2 problems arise.

1 - You can right click even if your far away from the event and still get the text/items.
2 - After I do the right click and get the item/text pathfind no longer works to move but works when I press directly on some events.

Hope this can be solved.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Kiwa on May 06, 2012, 10:22:34 pm
Nath!! that's EXACTLY what im talking about!
Thanks a ton!

I just had to add an additional 'end' at the end of the script and it worked fine :P ( i kept getting an error at line 18..)

module MCES
 
  Buton_Held = 'Shift'
 
 
  class Processor
   
    alias update_movement update
    def update
      update_movement
      if Input.press?(Input::Key[Buton_Held]) &&
          !$game_temp.message_window_showing && !check_event && @lwait == 0
        @lwait = 5
        x,y = mouse_tile
        $game_player.set(x,y)
      end
    end
  end
  end


I'm Going to fiddle with it more.
im looking for 2 more things with this

1. I think there's a bug when i click a target to just talk to.. it always trys to go benieth them. so if i put a bush there or a tile marked 'X'.. my char can never reach that event to talk to it. unless i hit control. i'll play more with it later busy day lol.

2. i dont want it to disable 'Enter' as an event accessing key.

Thanks :D

I cant wait till i can make script and contribute more to the site. :D
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Kiwa on May 07, 2012, 06:18:32 am
So far..adding that 'End' is the extent of my capability lol.
I'm trying to edit this script to fit my vision...

Things I noticed When the character is facing Left or Down I will walk to their front side.. if they face Right or UP I'm at an angle to them.
I found the code at line 199 and 200..and tried to "fix" it.. and I fixed it real good.
Its now so powerful...that not even RGSS could handle it, and the Hero would always be angled off the NPC.
in other words.. I fixed the script so it was wrong lol.

But my biggest concern in this is understanding the Key mapping.
I tried modifying it.. but I think I just lack understanding

I want it so I can function the game normally without the mouse. if I need it for only menu systems that's fine. but game play i want functional thru only keyboard.
I'm 1 enter key short after installing these scripts (I also linked confirm to enter as well as H but neither work now). from it working out that way...
following that I'd like to set them as key binds that link with the Hot Keys of ABS.
such as LEFT is melee Right is cast your selected spell.

----------------------TLDR---------------------
I need help understanding Mouse key mapping.. left, right click AND adding BOTH perhaps.
------------------------------------------------
I know its not any of your responsibility. I'll continue to fiddle till I learn something either way lol.
Thanks ahead of time :D


Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 07, 2012, 03:05:20 pm
@Kiwa
1. i wrote the script to move to the players facing direction as i figured that would be the best place to end up when clicking on an event

2. i actually don't know the key mapping but if you check out Tons of Add_ons or Blizz-abs under the Input Module most if not all are there.

3 The Original Mouse Controller maps the mouse key to the C Button which is y i made it not work with events
if i didn't events would activate when standing next them and trying to move with the mouse

@Vexus
Give me a few min i will add a ignore name_tag to to events to allow the player to go to that specific spot

edit: use \ignore and it the player will go there now
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Vexus on May 07, 2012, 04:11:56 pm
\ignore works, thanks :)

Anything can be done about events with /commands make pathfind no longer work when clicking on the ground but only work when you click on events that are reachable?

And is there any other solution apart of /commands to make events set on impassable things clickable when near them? (Would also be great if clicking on an event the character would walk to it even if the event is set on an impassable rock or whatever.)

Thanks
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 07, 2012, 04:34:14 pm
fixed just had to move the event check before the passability check
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Vexus on May 07, 2012, 04:39:52 pm
Sweet!

Thanks a lot, it works :)

[Edit]

Um I think I've stumbled on a new weird problem :S

So now when I click on a door I can start their events which is great so I have an event on a door which turns a switch on making the door change graphic and you get new options on this page, till here it works. I choose from the new choices another option which triggers another switch and removes the previous switch and the door changes graphic again for the final page (Which has only some choices that all finish with some texts) BUT now the event when clicked no message/choices show nor the character moves near the door.

I'm sorry for giving you so many trouble but it's not like I'm doing it on purpose :P

Sorry again.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 07, 2012, 05:52:58 pm
upload a demo so i can see what ur talking about
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Vexus on May 07, 2012, 06:23:51 pm
Ok I just want to say on a new project at first it didn't work too then out of a sudden it started working then again didn't work.

The thing is apart of the mouse script I have nothing else yet so it should work the same on both projects :/ (Only thing different on the actual project is the tileset used.)

Anyway here's a link:

http://www.mediafire.com/?jbs0a36oi7sevi8

To trigger it in sequence click on the wood trunk near the house once (For now it's just testing) then go to the door and press on barricade, light reinforce and first choice, when it's done click again the door for hard reinforce for the final page then try clicking on the door again to see if the choices work or not.

On my actual project nothing happens when I click again but on the new one sometimes it worked sometimes it stopped earlier.. so confusing :S
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 07, 2012, 07:31:09 pm
ok it had to do with the direction when you changed the graphic the direction changed and could not be reached because of the wall so add \directionfix[2] 2 to say the area below it is free
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Vexus on May 07, 2012, 08:40:11 pm
Thanks it worked :)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Kiwa on May 09, 2012, 07:35:31 am
Hey nath,

I'm using your code and I like it a lot (looks like you made updates too..so ill update my code)
I've actually learned a lot about RGSS from your script. it seems pretty easy to understand once you stop to read and think more.

so the point of my post is I'm modifying the script here and there to learn about it. I made the right click move as well as its linked melee.
but what I can't figure out is how to Disable the attack. I cant seem to follow the script to locate how it runs to blizz ABS to attack.

Also I'm trying to make 'Enter' work as it does without you're script (still...lol)
so I made an NPC when I talk to him gives the option to disable your script with "$MCES.disabled = true"
However neither the 'Enter' key works again nor does the 'C' Key as defined at the bottom...but the right click still attacks.

So now I'm feeling confused after I felt I was understanding :P

maybe some line references or key words I can type in the search to understand where these come from.
for example...
How does the right click attack?
How does left click cancel 'Enter'?
Why does 'right click' attack work when script is disabled?
Why does 'C' not work..with or without your code activated?

Sorry I'm a difficult and stubborn at times.. :P

Sorry, it seems I forced you into being my teacher lol.. I hope you don't mind the questions :P
If you don't want to give guidance on this I understand and I'll stop asking and drop it...and maybe focus my efforts elsewhere.

I really appreciate the help tho.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Kiwa on May 09, 2012, 08:54:08 am
I now understand that your addition only controls "Mouse Left"

I removed your code and used only blizz mouse controller and I can use 'Enter' but still can not use C for some reason.
or I can click and talk to events.

:/ slowly but surely I'm learning :/

still any help is appreciated.. I'll update with each Epiphany...lol,

Thanks :P
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Vexus on May 09, 2012, 04:30:28 pm
While experimenting with new tileset I was testing to see if they matched the style and at first I didn't have problems but now for some unkown reason I'm getting an error when I press new game into this new map.

This new map has only 3 events which are only for decoration, I even tried naming them to change icon just incase but still getting same error.

Error is on line 749 TypeError occurred.

no implicit conversion from nil to integer.

 @inner_bitmap = Bitmap.new(@cw,@ch) if @inner_bitmap == nil

Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 09, 2012, 05:00:11 pm
are you using any custom scripts that may be effecting Sprite_Character
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Vexus on May 09, 2012, 05:04:12 pm
Nope only the mouse script.

It's very weird.

[Edit]

Nvm the error is happening every time I add a new event :S
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on May 09, 2012, 06:58:25 pm
i cant seem to replicate it send me another demo

update 1.78 fixed bug when using tileset graphic
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on June 30, 2012, 03:27:35 am
I'm getting this error using both scripts default settings

(http://img99.imageshack.us/img99/3539/mcesbug.jpg)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on June 30, 2012, 08:43:07 am
update fixed above error
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: TestScripts on June 30, 2012, 01:37:03 pm
Okay, I must be being a little slow here, but... well, two issues really.

First, using the (1.69 version, latest) pathfinding to events works perfectly but to blank squares it doesn't.

Second, how do I set an event to be on-click or walk-to or set its direction as specified in the code header? I'm new to this and I really can't work out what I'm supposed to do there.

Thanks for your time and the work.

Edit - okay, I was being a little slow on the latter. Sorry, newbie failure on my part. The first has got me stumped though...
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on June 30, 2012, 02:39:35 pm
1 - Still using both scripts default settings, when I call the \commands window and click any of the options, the char gets unable to move by mouse.

2 - And after "temporally deleting a event", I get this error if I click where that event was:

(http://img809.imageshack.us/img809/3390/imagemwl.jpg)

3 - And also, if I right click where that event was, the \commands window still shows.

4 - And btw, you forgot to add the explanation for the "\msg[]" function in the script.

5 - Found another bug, using both scripts default settings and TONS (custom game controls), after calling the \commands window, I have to 'double click REAL FAST' to activate a option.

6 - Oh and another thing, that previous error you fixed came back when I added TONS to the project (I was able to run the game by commenting the lines causing the error):

(http://img109.imageshack.us/img109/4116/imagemdfl.jpg)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 02, 2012, 04:55:40 pm
update 1.70 fixed icon_name error, command_window and, erased event error

also fixed instructions

@TestScripts  im going to need a demo because i have never had issues with move by clicking
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on July 02, 2012, 08:49:11 pm
*quoting my previous post*

1 - still occurs (the hero still walks by clicking on a event, but not by clicking on the ground)

2 - fixed

3 - still occurs

4 - fixed

5 - fixed

6 - fixed
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 03, 2012, 10:04:18 am
update 1.71 fixed bug where opening the command window would disable movement

@phcs666 let me know if the command still shows up if this is happening when the event is erased if so it should be fixed
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on July 03, 2012, 10:16:23 am
Everything is working like a charm now, I will report if I find anymore bugs, thanks for the support and for this awesome script nathmatt.

edit: found 2 bugs:

1 - The \msg text still shows when I highlight the spot where a erased event was.

2 - The \curser[graphic] is not changing the cursor (but still gives the error if the graphic was not found).
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 07, 2012, 01:59:32 pm
update 1.72 fixed above errors let me know if any you get any more
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on July 07, 2012, 07:21:17 pm
Both errors fixed.

New bugs:

1 - After I select a \commands window option, I can't trigger any other event in the map by using the \auto function or a "key press" condition event (its still possible by "as it touchs hero/event"), but it fixes if I teleport to another map.

2 - Also, after selecting a option in a \commands window, the path finder gets lost, when I click on a event setuped with \auto or "key press", the hero moves to it and just keeps trying to reach the tile where the event is (but it fixes if I click at any empty tile on the map).

That's it, i will keep on testing this awesome script and reporting anything, cheers nathmatt.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 14, 2012, 09:35:38 am
i finally got around to looking into your bugs and i can't reproduce them im going to need a demo 
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on July 21, 2012, 05:43:49 pm
Here sir: http://www.mediafire.com/?anpqk7k7hccdehy

It's a BR project, I hope it runs properly on your editor.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 23, 2012, 06:46:21 pm
updated 1.73 fixed above error
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on July 24, 2012, 05:53:20 pm
Everything fixed and looking perfect, except, I found one little problem, I don't think it's a bug:

If you click on a transparent edge of a event's sprite wich is still inside the same tile as the event, the hero keeps trying to reach that location and gets """stuck""" (it only blocks you from moving with arrow keys and can be easly unbuged by just clicking on a empty tile)

Since I'm thinking about disabling mouse movement in my project, this will not be a problem for me.

Otherwise, everything is smooth, I will report if I found anymore bugs, nathmatt FTW!

Edit: I was thinking here, that could be solved by stoping the pathfinder if the hero stops moving, couldn't it? (flyingkick me if I said crap :P)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on July 24, 2012, 06:10:02 pm
if the location behind the event is unreachable you just need that to have the No_Walk_Tag terrain tag and the the player will not try to reach it as for clicking on the transparent part of the event i did that to have true event clicking it allows you to be able to click on any size graphic or click behind them by clicking on transparent part.   
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on July 24, 2012, 06:44:07 pm
Quote from: nathmatt on July 24, 2012, 06:10:02 pm
if the location behind the event is unreachable you just need that to have the No_Walk_Tag terrain tag and the the player will not try to reach it as for clicking on the transparent part of the event i did that to have true event clicking it allows you to be able to click on any size graphic or click behind them by clicking on transparent part.   


(http://lh5.ggpht.com/_Tix265Td80k/ShGzT2FQnSI/AAAAAAAAIlU/MSUBvn3IMAQ/Kick_thumb.gif)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: reaper72004 on September 01, 2012, 04:06:09 pm
when i click on or next to a enemy "\e[1]" i get a error

(http://i101.photobucket.com/albums/m45/reaper72004/error.png)

scripts:
tons: 7.62
blizz-abs: 2.84
blizz-mouse controller: 2.0
mouse controller enhancement: 1.73
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on September 03, 2012, 11:06:36 am
updated 1.74 fixed above error.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: reaper72004 on September 03, 2012, 12:29:26 pm
thx, works great now :)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Emtec on November 15, 2012, 04:03:43 pm
Hello.

Thanks for such a great script.

I'm testing your script and I'm getting the following error when I use a command (\msg[My Message]) in an event which has a tileset graphic.

(http://dl.dropbox.com/u/4830314/mousescripterror.png)

If I use any of the other commands (\auto, \commands, etc.) I don't get this error, but events don't work when I click on them. This just happens when the graphic of the event is from the tileset, but if the graphic is a Character it works perfectly.

Could you help me please?

Thank you!
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on December 01, 2012, 09:42:58 am
How can i get the current tile on Scene_Map that mouse cursor is highlighting?

Spoiler: ShowHide
highlighting - freaking hard word


EDIT: just did it, ignore my question.


x = ($mouse.x + $game_map.display_x / 4) / 32
y = ($mouse.y + $game_map.display_y / 4) / 32


EDIT 2: found 2 bugs:

1. when calling another $scene from Scene_Map while the msg sprite is visible, it remains visible.

2. when trying to save the game, this error occurs:

(http://i50.tinypic.com/258ms5i.jpg)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: BigHa on December 08, 2012, 09:41:29 am
I got an error.It said.

Script 'Mouse Controller Enhancement Script' line 448: NoMethodError
occurred.

undefined method 'each' for nil:NilClass


When I look in Script Editor line 448 is

$scene.spriteset.character_sprites.each { |s|return s if s.character == self}
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: phcs666 on December 13, 2012, 11:25:23 pm
Found a bug:

When teleporting to a map that has a \msg[] event on it:

(http://i46.tinypic.com/2n1w35v.jpg)

And when being on a map that has a \msg[] event on it plus teleporting to a map that also has a \msg[] event on it:

(http://i46.tinypic.com/1tsq4o.jpg)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: nathmatt on December 16, 2012, 06:29:50 am
im sorry but i no longer have RMXP so i can't really script in it right now as soon as arc's released i should start scripting again but until then i can't really support any of my scripts
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: PhoenixFire on January 04, 2014, 10:38:06 am
Alright, so I hate to pull up a long dead topic, but I can't seem to figure this one out. I'm using this in conjunction with Blizzards Mouse script, and, his stat distro system. Works great, minus a few minor issues that I think are related, but I don't know what would fix it. When I level up, the stat system comes up, like expected, but when I click distribute points, it makes the noise, and doesn't open up the window  (or it does, but so fast you don't even see it), so you cannot place the points. The other issue I found, that I think might be related, is that when in-battle, you're able to click the attack button, and bring up the fight options, but when you click attack or skill, it doesn't allow you to choose the enemy you're attacking, nor the skill you use..

I'll upload a demo with all of it set up in just a few minutes..

EDIT: Alright, here's the demo (http://sdrv.ms/1kiGAmz).. The zombie looking thing on the left of the map is the enemy. You click to fight, and should level up after 2 fights.. Also, I know the demo looks like crap, I'm just using it to test out things haha.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: KK20 on January 04, 2014, 05:43:06 pm
The Input edit is buggy in this script.

#============================================================================
# Input
#----------------------------------------------------------------------------
#  Adds the mouse trigger commands if not using Blizzards input methods.
#============================================================================ 
module Input
 
  Key = {'Mouse Left' => 1, 'Mouse Right' => 2}
  C = Key['Mouse Left']
  #======================================
  # |->  Keyboard Input Module
  #======================================
  #   By: Near Fantastica
  #   Date: 06.07.05
  #   Version: 3 
  #
  #   Cut down by Zeriab
  #   Date: 16.08.06
  #======================================
  def self.trigger?(key)
    return false if key == nil
    if !Win32API.new("user32","GetKeyState",['i'],'i').call(key).between?(0, 1)
      return true
    else
      return mces_trigger?(key)
    end
  end
 
end

This basically says "As long as the Left Mouse button is held down, Input.trigger?(Input::C) will always return TRUE". But we know that should only apply for Input.repeat?--Input.trigger? should only return true the first time and false after that.

Solution is to put Tons in your game and turn on Custom Controls. That will overwrite the need to use this faulty implementation of Input.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: Blizzard on January 05, 2014, 04:17:26 am
Uhm, wait. Input#trigger? should return true when the button is held down, but only until Input#update is called the next time. Input#press? keeps returning true while it's held down all the time.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: KK20 on January 05, 2014, 05:51:05 pm
I kind of figured someone would comment on that. :P
It was what I was I going for in my explanation. Also didn't realize I put "repeat" when I meant "press".

But what I said still stands--Input#trigger? is faulty in this script.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: PhoenixFire on January 08, 2014, 09:39:00 am
Well damn, I really only just need the custom controls, right? In theory I could extract that script out of the Tons pack, and use it separately, yes? I had thought there might be something wrong with the script, but I'm not yet familiar enough with scripting to really have noticed what the error was. Thanks to both of you :)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: glad300 on May 25, 2014, 01:28:45 pm
Is there a way to change the cursor speed ? If there is not, it would be a good add in the future
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: glad300 on May 29, 2014, 11:44:46 am
Bug : "Stack level too deep" when pressing F12
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: KK20 on May 29, 2014, 11:55:58 am
That's not a problem with the script, that's a problem with RMXP in general. There are many ways to fix this--you can Google for the one you like. The script database has this one (http://forum.chaos-project.com/index.php/topic,13629.0.html).
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: glad300 on May 29, 2014, 12:04:28 pm
Well, thank you but now when I restart with F12, an error window tells me that the mouse sprite is disposed
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: KK20 on May 30, 2014, 01:17:10 am
Mind posting the exact error and the corresponding line of code it's pointing to?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: glad300 on May 31, 2014, 11:36:03 am
Actually, the problem is from the mouse controller script, not the enhancement :^_^':


When I press F12 :

"Script 'Mouse Controller' line 184: RGSSError occured. disposed sprite"
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: KK20 on May 31, 2014, 12:56:02 pm
Use this F12 fix instead:

if $game_exists
  Thread.new {system('Game')}
  exit
end
$game_exists = true

again, placed at the top of your scripts list.

The reason for your error is because the mouse is initialized when loading the game's scripts (before the title screen even appears). TDS's F12 fix refuses to load the scripts again, which prevents the mouse from being initialized, and thus telling you your sprite is disposed.
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: glad300 on June 01, 2014, 10:44:27 am
I will try it as soon as i have access to rm. Thank you for your help :)
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: goth1sniper on June 16, 2014, 06:43:38 pm
Im getting a error when I kill a Mob that drops a item like a potion.

The only scripts I have running are
with tons I have all settings Off
tons 1
tons 2
tons 3
(RMX-OS) Options
(RMX-OS) Script
ABS 1
ABS 2
ABS 3
ABS Controller
(*) Mouse Controller
Auto-Targeting " I have tryed it this this off and with it on Same error"
Mouse Controller Enhancement
Drop Down Menu
Mouse Chat
ENEMY HP METER
-<:::RMX-OS Main:::>-

The rest of the scripts are off with =begin/=end

(http://s29.postimg.org/mlbdees4n/error1.png) (http://postimage.org/)

(http://s28.postimg.org/4k1gvnznh/error_script.png) (http://postimage.org/)

Title: Re: [XP] Mouse Controller Enhancement Script
Post by: glad300 on July 27, 2014, 06:32:05 am
Hello,
When im using the /msg[...] command on an event and try to save, an error window tells me :

                "no marshall_dump is defined for class MCES::Msg_Sprite" (Scene_Save, l.81)

I modified a very little bit the script but i dont think this is the origin of the error. So im asking your help.

Title: Re: [XP] Mouse Controller Enhancement Script
Post by: whitespirits on July 29, 2014, 05:01:37 am
Hi guys, so i want to implement the mouse script but i want to remove the movement, so i can just use the dropdown aswell as click to talk etc just a few features, How can this be done?
Title: Re: [XP] Mouse Controller Enhancement Script
Post by: glad300 on July 29, 2014, 12:24:45 pm
You have to delete a couple of lines in your MCES script :

in the MCES::Processor :
delete line 148 (check_player)
delete methods : 'check_terrain_tag', 'check_target', 'check_player'

then, delete MCES::PathRequesting class (from 'class PathRequesting' to the 'end' of the class)
delete Game_Player class

finally, delete :
'def pixel
   return 1
end'
at the end of the script to set your custom pixel movement in the Blizz ABS config

It is quite primitive but thats what i did and it works, I hope it helps

Now, does someone have an answer to my question ? (2 posts ago)  :roll: