RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu

Path finder and Pixel movement [Bugged] and incompatibility?

Started by Darkyyy, November 17, 2010, 03:37:51 AM

0 Members and 1 Guest are viewing this topic.

Darkyyy

Ok, so... in my project i'm using those scripts:

Algebra's path finder http://rmrk.net/index.php?topic=25952.0

And the pixel movement script:

#==============================================================================
#  ** 8-Directional PixelMovement
#------------------------------------------------------------------------------
# By Jet10985
# Developed by piejamas
# v1.0 (beta)
#------------------------------------------------------------------------------
# www.rpgmakervx.net
# Special thanks to: Bulletxt
#                    KGC
#                    Q
#==============================================================================
module JetPie
 
#============================================================================#
#                             *** Config ***                                   #
#============================================================================#
 
  #--------------------------------------------------------------------------
  # * Diagonal Movement [4dir movement not implemented yet]
  #--------------------------------------------------------------------------
  # true  : player can move diagonnaly
  # false : player can't move diagonally
  ENABLE_DIAGONAL_MOVEMENT = true
  #
  #--------------------------------------------------------------------------
  # * Slant Suffix
  #--------------------------------------------------------------------------
  # Diagonal walking sprites must be called <sprite name>SLANT_SUFFIX
  # So a sprite called $example with the SLANT_SUFFIX "_1" would be
  #
  # $example_1
  #
  SLANT_SUFFIX = "_4"
  #
  #--------------------------------------------------------------------------
  # * Grip
  #--------------------------------------------------------------------------
  # How well the player grips the ground - a higher number means the player
  # will slide around less
  #
  #      1 = slippy | 2 = average | 3 = grippy | 4 = instant stop
  DEFAULT_GRIP = 2
  #
  # A hash containing how well the player grips on different tiles
  # NOT IMPLEMENTED #
  GRIP_TILES = {} # <-- Don't touch this
  GRIP_TILES = {
  1635 => 0
  }
  #
  #--------------------------------------------------------------------------
  # * Isometric Movement
  #--------------------------------------------------------------------------
  # If this switch is turned on, movement is isometric
  ISOMETRIC_SWITCH = 0
  #
  # You can make an event isometric by including "ISOMETRIC" in a comment
  #
  #--------------------------------------------------------------------------
  # * Event PixelMovement [Fails a bit]
  #--------------------------------------------------------------------------
  # Enables events to move by the pixel as well by default
  EVENT_DEFAULT_PIXELMOVEMENT = true
  #
  # You can have a specific event have pixelmovement or no pixelmovement
  # by including "PIXELMOVEMENT" or "NO PIXELMOVEMENT" in a comment
  #
  #--------------------------------------------------------------------------
 
################################################################################
##                           *** END CONFIG ***                               ##
################################################################################

end

#----------------------------------------------------------------------------
$imported = {} if $imported == nil
$imported["JetPie PixelMovement"] = true
#----------------------------------------------------------------------------

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

class Game_Player < Game_Character
 
  include JetPie
  #--------------------------------------------------------------------------
  # * Determine if Map is Passable
  #     x : x-coordinate
  #     y : y-coordinate
  #    Gets whether the tile at the designated coordinates is passable.
  #--------------------------------------------------------------------------
  def map_passable?(mode)
    super(mode)
  end
  #--------------------------------------------------------------------------
  # * Determine if Front Event is Triggered
  #     triggers : Trigger array
  #--------------------------------------------------------------------------
  def check_event_trigger_there(triggers)
    return false if $game_map.interpreter.running?
    result = false
    if @direction == 4 or @direction == 6
      front_x = @real_x
      front_x -= 64 if @direction == 4 # 8 << 3
      front_x += 320 if @direction == 6 # 40 << 3
      front_y = @real_y + 128
    else
      front_y = @real_y
      front_y -= 64 if @direction == 8 # 8 << 3
      front_y += 320 if @direction == 2 # 40 << 3
      front_x = @real_x + 128
    end
    for event in $game_map.events.values
      if event.real_x < front_x && event.real_x + 256 > front_x # 32 << 3
        if event.real_y < front_y && event.real_y + 256 > front_y # 32 << 3
          if triggers.include?(event.trigger)
            event.start
            result = true
          end
        end
      end
    end
    return result
  end

  #--------------------------------------------------------------------------
  # * Determine Event Start Caused by [OK] Button
  #--------------------------------------------------------------------------
  def check_action_event
    return false if in_airship?
    return check_event_trigger_there([0,1,2])
  end
  #--------------------------------------------------------------------------
  # * Determine if Movement is Possible
  #--------------------------------------------------------------------------
  def movable?
    return false if @move_route_forcing
    return false if @vehicle_getting_on
    return false if @vehicle_getting_off
    return false if $game_message.visible
    return false if in_airship? and not $game_map.airship.movable?
    return true
  end
  #--------------------------------------------------------------------------
  # * Move x
  #--------------------------------------------------------------------------
  def move_x(max_speed)
    max_speed *= 2 if dash?
    @xv = [@xv + DEFAULT_GRIP, max_speed].min if @xv < max_speed
    @xv = [@xv - DEFAULT_GRIP, max_speed].max if @xv > max_speed
    @move_count = 1
  end
  #--------------------------------------------------------------------------
  # * Move y
  #--------------------------------------------------------------------------
  def move_y(max_speed)
    max_speed *= 2 if dash?
    @yv = [@yv + DEFAULT_GRIP, max_speed].min if @yv < max_speed
    @yv = [@yv - DEFAULT_GRIP, max_speed].max if @yv > max_speed
    @move_count = 1
  end
  #--------------------------------------------------------------------------
  # * Move Left
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_left(turn_ok = true)
    turn_left
    move_x(-4)
  end
  #--------------------------------------------------------------------------
  # * Move Right
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_right(turn_ok = true)
    turn_right
    move_x(4)
  end
  #--------------------------------------------------------------------------
  # * Move Up
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_up(turn_ok = true)
    turn_up
    if $game_switches[ISOMETRIC_SWITCH]
      move_y(-2)
    else
      move_y(-4)
    end
  end
  #--------------------------------------------------------------------------
  # * Move Down
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_down(turn_ok = true)
    turn_down
   if $game_switches[ISOMETRIC_SWITCH]
      move_y(2)
    else
      move_y(4)
    end
  end
  #--------------------------------------------------------------------------
  # * Move Lower Left
  #--------------------------------------------------------------------------
  def move_lower_left
    turn_left
    move_x(-3)
    move_y(2)
  end
  #--------------------------------------------------------------------------
  # * Move Lower Right
  #--------------------------------------------------------------------------
  def move_lower_right
    turn_right
    move_x(3)
    move_y(2)
  end
  #--------------------------------------------------------------------------
  # * Move Upper Left
  #--------------------------------------------------------------------------
  def move_upper_left
    turn_left
    move_x(-3)
    move_y(-2)
  end
  #--------------------------------------------------------------------------
  # * Move Upper Right
  #--------------------------------------------------------------------------
  def move_upper_right
    turn_right
    move_x(3)
    move_y(-2)
  end
  #--------------------------------------------------------------------------
  # * Update Move Count
  #--------------------------------------------------------------------------
  def update_move_count
    @move_count = 0
  end
  #--------------------------------------------------------------------------
  # Work Out Grip
  #--------------------------------------------------------------------------
  def work_out_grip
    grip = DEFAULT_GRIP
    unless GRIP_TILES[$game_map.data[$game_player.x, $game_player.y, 1]] == nil
      grip = GRIP_TILES[$game_map.data[$game_player.x, $game_player.y, 1]]
    end
    return grip
  end
  #--------------------------------------------------------------------------
  # * Update x
  #--------------------------------------------------------------------------
  def update_x
    unless (Input.press?(Input::LEFT) and Input.press?(Input::RIGHT))
      grip = work_out_grip
      unless (Input.press?(Input::LEFT) or Input.press?(Input::RIGHT))
        @xv = [@xv + grip, 0].min if @xv < 0
        @xv = [@xv - grip, 0].max if @xv > 0
      end
      last_x = @real_x
      @real_x += @xv
      @x = @real_x >> 8
      @touch_flag = -1
      unless passable?(0)
        @real_x = last_x
        @x = @real_x >> 8
        @xv = 0
        check_event_trigger_touch()
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update y
  #--------------------------------------------------------------------------
  def update_y
    unless (Input.press?(Input::UP) and Input.press?(Input::DOWN))
      grip = work_out_grip
      unless (Input.press?(Input::UP) or Input.press?(Input::DOWN))
        @yv = [@yv + grip, 0].min if @yv < 0
        @yv = [@yv - grip, 0].max if @yv > 0
      end
      last_y = @real_y
      @real_y += @yv
      @y = @real_y >> 8
      @touch_flag = -1
      unless passable?(1)
        @real_y = last_y
        @y = @real_y >> 8
        @yv = 0
        check_event_trigger_touch()
      end
    end
  end
  #--------------------------------------------------------------------------
  # Move by Input
  # Borrowed from KGC
  #--------------------------------------------------------------------------
   def move_by_input
    return unless movable?
    return if $game_map.interpreter.running?
    if @reserved_move != nil
      case @reserved_move
      when :down
        move_down if passable_l?(2)
      when :left
        move_left if passable_l?(4)
      when :right
        move_right if passable_l?(6)
      when :up
        move_up if passable_l?(8)
      end
      @reserved_move = nil
      return
    end

    last_steps = $game_party.steps

    case Input.dir8
    when 1
      if !passable_l?(2) && passable_l?(4)
        move_left
        @reserved_move = :down
      elsif passable_l?(2) && !passable_l?(4)
        move_down
        @reserved_move = :left
      elsif passable_l?(2)
        move_down
        move_left
      end
      @direction = 2
    when 2
      move_down
    when 3
      if !passable_l?(2) && passable_l?(6)
        move_right
        @reserved_move = :down
      elsif passable_l?(2) && !passable_l?(6)
        move_down
        @reserved_move = :right
      elsif passable_l?(2)
        move_down
        move_right
      end
      @direction = 6
    when 4
      move_left
    when 6
      move_right
    when 7
      if !passable_l?(8) && passable_l?(4)
        move_left
        @reserved_move = :up
      elsif passable_l?(8) && !passable_l?(4)
        move_up
        @reserved_move = :left
      elsif passable_l?(8)
        move_up
        move_left
      end
      @direction = 4
    when 8
      move_up
    when 9
      if !passable_l?(8) && passable_l?(6)
        move_right
        @reserved_move = :up
      elsif passable_l?(8) && !passable_l?(6)
        move_up
        @reserved_move = :right
      elsif passable_l?(8)
        move_up
        move_right
      end
      @direction = 8
    else
      return
    end
    @direction_8dir = Input.dir8

    if $game_party.steps - last_steps == 2
      $game_party.decrease_steps
    end
  end
  #--------------------------------------------------------------------------
  # * Determine if Touch Event is Triggered
  #--------------------------------------------------------------------------
  def check_event_trigger_touch
    return if $game_map.interpreter.running?
    for event in $game_map.events.values
      next if event.id != @touch_flag
      if event.trigger == 2
        event.start
        break
      end
    end
  end
end

#==============================================================================
# ** Game_Character
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :real_x
  attr_accessor :real_y
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias jetActionCharacter_initialize initialize
  def initialize
    jetActionCharacter_initialize
    @xv = 0
    @yv = 0
    @touch_flag = -1
    @move_count = 0
  end
  #--------------------------------------------------------------------------
  # * Determine if Moving
  #    Compare with logical coordinates.
  #--------------------------------------------------------------------------
  def moving?
    return @move_count > 0
  end
  #--------------------------------------------------------------------------
  # * Move Left
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_left(turn_ok = true)
    turn_left
    d = 2 ** @move_speed
    @xv = 0 - d
    @move_count = 256 / d
  end
  #--------------------------------------------------------------------------
  # * Move Right
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_right(turn_ok = true)
    turn_right
    d = 2 ** @move_speed
    @xv = d
    @move_count = 256 / d
  end
  #--------------------------------------------------------------------------
  # * Move Up
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_up(turn_ok = true)
    turn_up
    d = 2 ** @move_speed
    @yv = 0 - d
    @yv /= 2 if @isometric
    @move_count = 256 / d
end
  #--------------------------------------------------------------------------
  # * Move Down
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_down(turn_ok = true)
    turn_down
    d = 2 ** @move_speed
    @yv = d
    @yv /= 2 if @isometric
    @move_count = 256 / d
  end
  #--------------------------------------------------------------------------
  # * Move Lower Left
  #--------------------------------------------------------------------------
  def move_lower_left
    turn_left
    d = 2 ** @move_speed
    @xv = 0 - d
    @yv = d
    @move_count = 256 / d
  end
  #--------------------------------------------------------------------------
  # * Move Lower Right
  #--------------------------------------------------------------------------
  def move_lower_right
    turn_right
    d = 2 ** @move_speed
    @xv = d
    @yv = d
    @move_count = 256 / d
  end
  #--------------------------------------------------------------------------
  # * Move Upper Left
  #--------------------------------------------------------------------------
  def move_upper_left
    turn_left
    d = 2 ** @move_speed
    @xv = 0 - d
    @yv = 0 - d
    @move_count = 256 / d
  end
  #--------------------------------------------------------------------------
  # * Move Upper Right
  #--------------------------------------------------------------------------
  def move_upper_right
    turn_right
    d = 2 ** @move_speed
    @xv = d
    @yv = 0 - d
    @move_count = 256 / d
  end
  #--------------------------------------------------------------------------
  # * Determine if Map is Passable
  #--------------------------------------------------------------------------
  def map_passable?(mode)
    left_x = @real_x + 32 >> 8 # 4 <<3
    right_x = @real_x + 224 >> 8 # 28 << 3
    up_y = @real_y + 32 >> 8# 2 << 3
    down_y = @real_y + 224 >> 8 # 28 << 3
    if mode == 0
      if @xv > 0
        return false unless $game_map.passable?(right_x, up_y)
        return false unless $game_map.passable?(right_x, down_y)
      else
        return false unless $game_map.passable?(left_x, up_y)
        return false unless $game_map.passable?(left_x, down_y)
      end
    else
      if @yv > 0
        return false unless $game_map.passable?(left_x, down_y)
        return false unless $game_map.passable?(right_x, down_y)
      else
        return false unless $game_map.passable?(left_x, up_y)
        return false unless $game_map.passable?(right_x, up_y)
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  # * Determine if Passable
  #--------------------------------------------------------------------------
  def passable?(mode = 0)
    return false unless map_passable?(mode)
    return true if @through or debug_through?
    return false if collide_with_characters?(x, y, mode)
    return true
  end
  #--------------------------------------------------------------------------
  # * Determine if Position is Hit
  #--------------------------------------------------------------------------
  def hit_pos?(real_x, real_y)
    if @real_x + 32 < real_x + 224 && real_x + 32 < @real_x + 224 # 4 << 3, 28 << 3
      if @real_y < real_y + 224 && real_y < @real_y + 224
        return true
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Determine Character Collision
  #     x : x-coordinate
  #     y : y-coordinate
  #    Detects normal character collision, including the player and vehicles.
  #--------------------------------------------------------------------------
  def collide_with_characters?(x, y, mode)
    for event in $game_map.events.values
      next if event.through
      next if event.id == self.id
      if hit_pos?(event.real_x, event.real_y)
        @touch_flag = event.id
        return true
      end
    end
    if @priority_type == 1
      unless self.is_a?(Game_Player)
        if hit_pos?($game_player.real_x, $game_player.real_y)
          @touch_flag = 0
          return true
          return true if self.is_a?(Game_Event) # Self is an event
          return true if event.priority_type == 1
        end
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    update_x
    update_y
    if moving?
      update_move_count
      if @walk_anime
        @anime_count += 1.5
      elsif @step_anime
        @anime_count += 1
      end
    else
      if @step_anime
        @anime_count += 1
      elsif @pattern != @original_pattern
        @anime_count += 1.5
      end
      @stop_count += 1 unless @locked
    end
    if @wait_count > 0
      @wait_count -= 1
    elsif @move_route_forcing
      move_type_custom
    elsif not @locked
      update_self_movement
    end
    update_animation
  end
  #--------------------------------------------------------------------------
  # * Update Move Count
  #--------------------------------------------------------------------------
  def update_move_count
    @move_count -= 1
    if @move_count == 0
      @xv = 0
      @yv = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Update x
  #--------------------------------------------------------------------------
  def update_x
    return if @xv == 0
    last_x = @real_x
    @real_x += @xv
    @x = @real_x >> 8
    @touch_flag = -1
    unless passable?(0)
      @real_x = last_x
      @x = @real_x >> 8
      @xv = 0
      check_event_trigger_touch(@x+1, @y)
    end
  end
  #--------------------------------------------------------------------------
  # Update y
  #--------------------------------------------------------------------------
  def update_y
    return if @yv == 0
    last_y = @real_y
    @real_y += @yv
    @y = @real_y >> 8
    @touch_flag = -1
    unless passable?(1)
      @real_y = last_y
      @y = @real_y >> 8
      @yv = 0
      check_event_trigger_touch(@x, @y + 1)
    end
  end
 
  def passable_l?(d)
      return passable?(d)
    return false
  end
 
  def direction_8dir
    @direction_8dir = @direction if @direction_8dir == nil
    return @direction_8dir
  end
end
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
# 8dir animations borrowed from KGC
#==============================================================================

class Sprite_Character < Sprite_Base
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------
  SLANT_ANIME_TABLE = { 1=>2, 3=>6, 7=>4, 9=>8 }
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Bitmap
  #--------------------------------------------------------------------------
  alias :pixel_base_update_bitmap :update_bitmap unless $@
  def update_bitmap
    name_changed = (@character_name != @character.character_name)

    pixel_base_update_bitmap

    if @tile_id > 0
      @enable_slant = false
      return
    end
    return unless name_changed

    @enable_slant = true
    begin
      @character_name_slant = @character_name + JetPie::SLANT_SUFFIX
      Cache.character(@character_name_slant)
    rescue
      @enable_slant = false
    end
  end
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Rectangle
  #--------------------------------------------------------------------------
  alias :pixel_base_update_src_rect :update_src_rect unless $@
  def update_src_rect
    return if @tile_id > 0

    if @enable_slant
      update_src_rect_for_slant
    else
      pixel_base_update_src_rect
    end
  end
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Rectangle for Slant
  #--------------------------------------------------------------------------
  def update_src_rect_for_slant
    index = @character.character_index
    pattern = @character.pattern < 3 ? @character.pattern : 1
    sx = (index % 4 * 3 + pattern) * @cw

    dir = @character.direction_8dir
    case dir % 2
    when 0
      if @last_slant
        self.bitmap = Cache.character(@character_name)
        @last_slant = false
      end
    else
      unless @last_slant
        self.bitmap = Cache.character(@character_name_slant)
        @last_slant = true
      end
      dir = SLANT_ANIME_TABLE[dir]
    end

    sy = (index / 4 * 4 + (dir - 2) / 2) * @ch
    self.src_rect.set(sx, sy, @cw, @ch)
  end
end

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

class Game_Event < Game_Character
 
  include JetPie
 
  #--------------------------------------------------------------------------
  # Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :pixelmovement
  attr_reader :isometric
 
  #--------------------------------------------------------------------------
  # * Aliases
  #--------------------------------------------------------------------------
  alias :jetpie_base_initialize :initialize unless $@
 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(*args)
    jetpie_base_initialize(*args) # aliased initialize
    @pixelmovement = check_for_pm
    @isometric = check_for_iso
    @dir = 4
  end
 
  #--------------------------------------------------------------------------
  # * Check Comments for PixelMovement
  #--------------------------------------------------------------------------
  def check_for_pm
    dpm = EVENT_DEFAULT_PIXELMOVEMENT
    return dpm if @list.nil? or @list.size <= 0
    for item in @list
      if item.code == 108 or item.code == 408
        pm = ((dpm == true and not item.parameters[0].include?("NO PIXELMOVEMENT")) or (dpm == false and item.parameters[0].include?("PIXELMOVEMENT")))
        if pm
          return !dpm
        end
      end
    end
    return false
  end
 
  #--------------------------------------------------------------------------
  # Check if Event is Isometric
  #--------------------------------------------------------------------------
  def check_for_iso
    return false if @list.nil? or @list.size <= 0
    for item in @list
      if item.code == 108 or item.code == 408
        if item.parameters[0].include?("ISOMETRIC")
          return true
        end
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Determine if Map is Passable
  #     x : x-coordinate
  #     y : y-coordinate
  #    Gets whether the tile at the designated coordinates is passable.
  #--------------------------------------------------------------------------
  def map_passable?(mode)
    left_x = @real_x + 32 >> 8 # 4 <<3
    right_x = @real_x + 224 >> 8 # 28 << 3
    up_y = @real_y + 16 >> 8 - 10# 2 << 3
    down_y = @real_y + 224 >> 8 # 28 << 3
    if mode == 0
      if @xv > 0
        return false unless $game_map.passable?(right_x, up_y)
        return false unless $game_map.passable?(right_x, down_y)
      else
        return false unless $game_map.passable?(left_x, up_y)
        return false unless $game_map.passable?(left_x, down_y)
      end
    else
      if @yv > 0
        return false unless $game_map.passable?(left_x, down_y)
        return false unless $game_map.passable?(right_x, down_y)
      else
        return false unless $game_map.passable?(left_x, up_y)
        return false unless $game_map.passable?(right_x, up_y)
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  # * Determine if Passable
  #--------------------------------------------------------------------------
  def passable?(mode = 0)
    return false unless map_passable?(mode)
    return true if @through or debug_through?
    return false if collide_with_characters?(x, y, mode)
    return true
  end
  #--------------------------------------------------------------------------
  # * Determine if Position is Hit
  #--------------------------------------------------------------------------
  def hit_pos?(real_x, real_y)
    if @real_x + 32 < real_x + 224 && real_x + 32 < @real_x + 224 # 4 << 3, 28 << 3
      if @real_y < real_y + 224 && real_y < @real_y + 224
        return true
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Determine Character Collision
  #     x : x-coordinate
  #     y : y-coordinate
  #    Detects normal character collision, including the player and vehicles.
  #--------------------------------------------------------------------------
  def collide_with_characters?(x, y, mode)
    for event in $game_map.events.values
      next if event.through
      next if event.id == self.id
      if hit_pos?(event.real_x, event.real_y)
        @touch_flag = event.id
        return true
      end
    end
    if @priority_type == 1
      unless self.is_a?(Game_Player)
        if hit_pos?($game_player.real_x, $game_player.real_y)
          @touch_flag = 0
          return true
          return true if self.is_a?(Game_Event) # Self is an event
          return true if event.priority_type == 1
        end
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    update_x
    update_y
    if moving?
      update_move_count
      if @walk_anime
        @anime_count += 1.5
      elsif @step_anime
        @anime_count += 1
      end
    else
      if @step_anime
        @anime_count += 1
      elsif @pattern != @original_pattern
        @anime_count += 1.5
      end
      @stop_count += 1 unless @locked
    end
    if @wait_count > 0
      @wait_count -= 1
    elsif @move_route_forcing
      move_type_custom
    elsif not @locked
      update_self_movement
    end
    update_animation
  end
  #--------------------------------------------------------------------------
  # * Update Move Count
  #--------------------------------------------------------------------------
  def update_move_count
    @move_count -= 1
    if @move_count == 0
      @xv = 0
      @yv = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Update x
  #--------------------------------------------------------------------------
  def update_x
    return if @xv == 0
    last_x = @real_x
    @real_x += @xv
    @x = @real_x >> 8
    @touch_flag = -1
    unless passable?(0)
      @real_x = last_x
      @x = @real_x >> 8
      @xv = 0
      check_event_trigger_touch(@x+1, @y)
    end
  end
  #--------------------------------------------------------------------------
  # * Update y
  #--------------------------------------------------------------------------
  def update_y
    return if @yv == 0
    last_y = @real_y
    @real_y += @yv
    @y = @real_y >> 8
    @touch_flag = -1
    unless passable?(1)
      @real_y = last_y
      @y = @real_y >> 8
      @yv = 0
      check_event_trigger_touch(@x, @y + 1)
    end
  end
  #--------------------------------------------------------------------------
  # * Move x
  #--------------------------------------------------------------------------
  def move_x(max_speed)
    max_speed *= 2 if dash?
    @xv = [@xv + DEFAULT_GRIP, max_speed].min if @xv < max_speed
    @xv = [@xv - DEFAULT_GRIP, max_speed].max if @xv > max_speed
    @move_count = 1
  end
  #--------------------------------------------------------------------------
  # Move y
  #--------------------------------------------------------------------------
  def move_y(max_speed)
    max_speed *= 2 if dash?
    @yv = [@yv + 2, max_speed].min if @yv < max_speed
    @yv = [@yv - 2, max_speed].max if @yv > max_speed
    @move_count = 1
  end
  #--------------------------------------------------------------------------
  # * Move Left
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_left(turn_ok = true)
    if @pixelmovement
      turn_left
      move_x(-16)
    else
      super
    end
  end
  #--------------------------------------------------------------------------
  # * Move Right
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_right(turn_ok = true)
    if @pixelmovement
      turn_right
      move_x(16)
    else
      super
    end
  end
  #--------------------------------------------------------------------------
  # * Move Up
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_up(turn_ok = true)
    if @pixelmovement
      turn_up
      if @isometric
        move_y(-16)
      else
        move_y(-8)
      end
    else
      super
    end
  end
  #--------------------------------------------------------------------------
  # * Move Down
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_down(turn_ok = true)
    if @pixelmovement
      turn_down
      if @isometric
        move_y(16)
      else
        move_y(8)
      end
    else
      super
    end
  end
 
end # Game_Event





I tried to not let the event (which was supposed to use the path finder) use the pixel movement script (By putting: EVENT_DEFAULT_PIXELMOVEMENT = false) or by using "NO PIXELMOVEMENT" comment... But somehow, The event still called the pixel movement script and because of incompatibility with the path finder, it crashes...

So i was wondering... If it's easy, Or someone is willing to do it, can you make some sort of compatibility between those two scripts? or maybe suggest me a better pixel movement script? Thanks in advance :)

-EDIT-
Also.. The pixel movment script is bugged, an event can only move down, but it can't move up, left or right... Could a skilled scripter fix those things? =) if it's easy... Thanks! [Or maybe update it somehow so that everyone can use it]