Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
8-Directional PixelMovement v1.0(beta)
Autor Wiadomość
MrDawnok 




Preferowany:
RPG Maker VX

Pomógł: 1 raz
Dołączył: 22 Maj 2010
Posty: 217
Wysłany: Nie 19 Cze, 2011 13:50
8-Directional PixelMovement v1.0(beta)
Pixel movement


Skrypt, który pozwala na poruszanie się co 1 pixel a nie co 36 pixeli.


Spoiler:

Kod:
#==============================================================================
#  ** 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 = 1
  #
  # 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 = false
  #
  # 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(-16)
  end
  #--------------------------------------------------------------------------
  # * Move Right
  #     turn_ok : Allows change of direction on the spot
  #--------------------------------------------------------------------------
  def move_right(turn_ok = true)
    turn_right
    move_x(16)
  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(-8)
    else
      move_y(-16)
    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(8)
    else
      move_y(16)
    end
  end
  #--------------------------------------------------------------------------
  # * Move Lower Left
  #--------------------------------------------------------------------------
  def move_lower_left
    turn_left
    move_x(-12)
    move_y(6)
  end
  #--------------------------------------------------------------------------
  # * Move Lower Right
  #--------------------------------------------------------------------------
  def move_lower_right
    turn_right
    move_x(12)
    move_y(6)
  end
  #--------------------------------------------------------------------------
  # * Move Upper Left
  #--------------------------------------------------------------------------
  def move_upper_left
    turn_left
    move_x(-12)
    move_y(-6)
  end
  #--------------------------------------------------------------------------
  # * Move Upper Right
  #--------------------------------------------------------------------------
  def move_upper_right
    turn_right
    move_x(12)
    move_y(-6)
  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



Demo:
Mediafire



Screeny:Nieptrzebne
Autor:Jet10985

Jeśli pomogłem kliknij pomógł
________________________



http://www.forumgalonum.pun.pl/viewtopic.php?id=5

"Bliski przyjaciel, czy to nie właściwe określenie dla kogoś, kto już przestał być bliski?"
Ostatnio zmieniony przez Ayene Pią 28 Paź, 2011 11:25, w całości zmieniany 1 raz  
 
 
 
Credo 



Preferowany:
RPG Maker XP

Dołączył: 05 Lis 2011
Posty: 4
Wysłany: Nie 13 Lis, 2011 21:24
Niestety skrypt jest niedopracowany. Gdy umieszczę zdarzenie na mapie to nie mogę na te miejsce wejść ;/
 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Pon 14 Lis, 2011 14:47
Nie podoba mi się... Jakoś dziwnie jest :-/ Nie ocenie go, bo sam nie wiem jak to zrobić...
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
Tjef 




Preferowany:
RPG Maker VX

Pomógł: 12 razy
Dołączył: 21 Wrz 2010
Posty: 163
Skąd: Wolsztyn
Wysłany: Pon 14 Lis, 2011 14:52
Ściągnij demo i zobacz jak to jest :aww:
Skrypt dobry, ale miałem jeden błąd (już go naprawiłem)
Powinieneś dać lepszy opis, bo (nie wiem, może tylko ja) nie wiedziałem o co z tym chodzi przed ściągnięciem demka.
________________________
SAGA TS ( ThiefStory )
Rozdział I: Same Game http://www.ultimateam.pl/viewtopic.php?t=4978
Rozdział II: Terror http://www.ultimateam.pl/...p?p=64366#64366
Pozostałe rozdziały mogą nawet nie wyjść :P
Lista elity: http://i.imgur.com/Li9fU.jpg
 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Pon 14 Lis, 2011 15:07
Ściągnąłem, ale jakoś dziwnie się tak chodzi...
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
MrDawnok 




Preferowany:
RPG Maker VX

Pomógł: 1 raz
Dołączył: 22 Maj 2010
Posty: 217
Wysłany: Nie 04 Gru, 2011 19:26
tracersgta napisał/a:
Ściągnąłem, ale jakoś dziwnie się tak chodzi...
Facepalm oto chodzi w skrypcie o takie dziwne poruszanie...trudno to opisać.
________________________



http://www.forumgalonum.pun.pl/viewtopic.php?id=5

"Bliski przyjaciel, czy to nie właściwe określenie dla kogoś, kto już przestał być bliski?"
 
 
 
Aruka21 




Preferowany:
RPG Maker VX

Pomógł: 2 razy
Dołączył: 23 Paź 2010
Posty: 129
Skąd: Samo dno piekieł.
Wysłany: Sob 10 Gru, 2011 14:06
Skrypt bardzo by mi się przydał lecz gdy go wrzuciłem do projektu to nie mogę poruszyć postacią :-| . proszę o pomoc.


Pozdrawiam
________________________
Mój aktualny projekt: Edeon
Oto link:http://www.ultimateam.pl/viewtopic.php?p=73129#73129

Zyska Sławę Królem Będzie,
Kto Się Uświadomi We Śnie,
Kto Zdobędzie Szczyt W Błękicie,
Będzie Tym Co Jest Na Szczycie.
 
 
 
Ness0 



Dołączył: 23 Paź 2011
Posty: 18
Wysłany: Sob 10 Gru, 2011 23:36
Chodzi o takie chodzenie jak w Earthboundzie?
http://www.youtube.com/wa...feature=related
 
 
 
MrDawnok 




Preferowany:
RPG Maker VX

Pomógł: 1 raz
Dołączył: 22 Maj 2010
Posty: 217
Wysłany: Nie 11 Gru, 2011 09:09
Tak trudno pobrać demo i zobaczyć?
________________________



http://www.forumgalonum.pun.pl/viewtopic.php?id=5

"Bliski przyjaciel, czy to nie właściwe określenie dla kogoś, kto już przestał być bliski?"
 
 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Nie 11 Gru, 2011 09:13
Chodzenie jest fajne, ale trzeba postać idealnie wpasować w kratkę, bo będzie ryła w ścianę ^^
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
Aruka21 




Preferowany:
RPG Maker VX

Pomógł: 2 razy
Dołączył: 23 Paź 2010
Posty: 129
Skąd: Samo dno piekieł.
Wysłany: Nie 11 Gru, 2011 10:21
Proszę o pomoc z tym skryptem :-( .
________________________
Mój aktualny projekt: Edeon
Oto link:http://www.ultimateam.pl/viewtopic.php?p=73129#73129

Zyska Sławę Królem Będzie,
Kto Się Uświadomi We Śnie,
Kto Zdobędzie Szczyt W Błękicie,
Będzie Tym Co Jest Na Szczycie.
 
 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Nie 11 Gru, 2011 10:29
Spróbuj na podstawie demka wstawić skrypt ;-)
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
Aruka21 




Preferowany:
RPG Maker VX

Pomógł: 2 razy
Dołączył: 23 Paź 2010
Posty: 129
Skąd: Samo dno piekieł.
Wysłany: Nie 11 Gru, 2011 12:18
Skopiowałem z demka skrypt i nie działa :-(
Używam skryptu na walkę w czasie rzeczywistym, może to jest problemem ?
________________________
Mój aktualny projekt: Edeon
Oto link:http://www.ultimateam.pl/viewtopic.php?p=73129#73129

Zyska Sławę Królem Będzie,
Kto Się Uświadomi We Śnie,
Kto Zdobędzie Szczyt W Błękicie,
Będzie Tym Co Jest Na Szczycie.
 
 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Nie 11 Gru, 2011 12:24
W konfiguracji ABS'a usuń ruch w ośmiu kierunkach... Jeżeli nie pomoże usuń cały ABS na chwilkę i zobacz wtedy ;-)
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
Aruka21 




Preferowany:
RPG Maker VX

Pomógł: 2 razy
Dołączył: 23 Paź 2010
Posty: 129
Skąd: Samo dno piekieł.
Wysłany: Nie 11 Gru, 2011 13:02
Usunąłem ruch w ośmiu kierunkach w ABS'ie i nie pomogło.
A nie usunę tego systemu walki ponieważ jest on mi nie zbędny.
________________________
Mój aktualny projekt: Edeon
Oto link:http://www.ultimateam.pl/viewtopic.php?p=73129#73129

Zyska Sławę Królem Będzie,
Kto Się Uświadomi We Śnie,
Kto Zdobędzie Szczyt W Błękicie,
Będzie Tym Co Jest Na Szczycie.
 
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene