RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] Movement in RPG

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 88
ahhh...
i was wondering if anyone could tell me how to have my character move like Link in those Zelda RPGs.. :)
« Last Edit: October 20, 2006, 09:02:06 AM by Blizzard »
ARGH!!!!!

********
Rep:
Level 96
2011 Most Missed Member2010 Zero To Hero
Like what, the way he moves from screen to screen? Cuz I have a script for that.

**
Rep:
Level 88
ahhh...
that and the way he could move diagonally and not just like the four primary directions. (Up ,down, right, left)
ARGH!!!!!

********
Rep:
Level 96
2011 Most Missed Member2010 Zero To Hero
There's a good diagonals script in the script section. It was made by a guy from Japan, I think. If you have the right topic there should be a post that says bump. Just do what it says there. HERE is the scroll script. Just make a really big map, and every couple of steps it scrolss for you, LTTP style.Remember, inser all scripts above main.

Code: [Select]
#==============================================================================
# ¡ Zelda-Style Map Scrolling
#------------------------------------------------------------------------------
# Script by Minkoff
#==============================================================================
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # œ Update
  #--------------------------------------------------------------------------
  def update
    last_moving = moving?
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing or @disable_input
      case Input.dir4
      when 2
        move_down
      when 4
        move_left
     when 6
        move_right
      when 8
        move_up
      end
    end
    super
    #------------------------------------------------------------------------
    if @direction == 6 and # Player Facing Right
    @real_x % 2560 == 0 and
    @real_x > $game_map.display_x and
    $game_map.display_x != @last_display_x
      @last_display_x = $game_map.display_x
      $game_map.scroll_right(128)
      @disable_input = true
    elsif @direction == 4 and # Player Facing Left
    @real_x % (2560 - 128) == 0 and
    ($game_map.display_x - @real_x).abs < (2560 - 128) and
    $game_map.display_x != @last_display_x
      @last_display_x = $game_map.display_x
      $game_map.scroll_left(128)
      @disable_input = true
    elsif @direction == 2 and # Player Facing Down
    @real_y % 1920 == 0 and
    @real_y > $game_map.display_y and
    $game_map.display_y != @last_display_y
      @last_display_y = $game_map.display_y
      $game_map.scroll_down(128)
      @disable_input = true
    elsif @direction == 8 and # Player Facing Up
    @real_y % (1920 - 128) == 0 and
    ($game_map.display_y - @real_y).abs < (1920 - 128) and
    $game_map.display_y != @last_display_y
      @last_display_y = $game_map.display_y
      $game_map.scroll_up(128)
      @disable_input = true
    else
      @disable_input = false
      @last_display_x = nil
      @last_display_y = nil
    end
    #------------------------------------------------------------------------
    unless moving?
      if last_moving
        result = check_event_trigger_here([1,2])
        if result == false
          unless $DEBUG and Input.press?(Input::CTRL)
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      if Input.trigger?(Input::C)
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end