VX 스크립트

이동 및 탈것
2009.08.23 20:53

느리게 걷기

조회 수 2430 추천 수 0 댓글 5

설정해준 키를 누르면 대쉬와 반대로 속도가 반감되어 이동합니다.

설정은 스크립트 위쪽 HG_Dwadle  부분을 수정해 주시면 됩니다.   기본은 Alt 키를 누를경우 느리게 걷기...

참고로 $game_player.dash?  하면 달리는지 판단, $game_player.dwadle?  이면 느리게 걷는지 판단합니다.  참일경우 true를 반환.

두키를 동시에 누르면 둘다 무효입니다.

아래 스크립트를 복사해서 사용하시면 됩니다.

 

 

module HG_Dwadle
  DwadleKEY = "Input::ALT"  # 느리게 걷기 키
 
  DashKEY = "Input::A"   #  달리기 키
 
  DISABLEMAP = [2]  # 느리게 걷기를 적용시키지 않을 맵
end

class Game_Character
  #--------------------------------------------------------------------------
  # ● 이동시의 갱신
  #--------------------------------------------------------------------------
  def update_move
    distance = 2 ** @move_speed   # 이동 속도로부터 이동거리에 변환
    if dash?               # 대시 상태라면 한층 더 배
      distance *= 2
    elsif dwadle?               # 대시 상태라면 한층 더 배
      distance /= 2
    end
    @real_x = [@real_x - distance, @x * 256].max if @x * 256 < @real_x
    @real_x = [@real_x + distance, @x * 256].min if @x * 256 > @real_x
    @real_y = [@real_y - distance, @y * 256].max if @y * 256 < @real_y
    @real_y = [@real_y + distance, @y * 256].min if @y * 256 > @real_y
    update_bush_depth unless moving?
    if @walk_anime
      @anime_count += 1.5
    elsif @step_anime
      @anime_count += 1
    end
  end
  #--------------------------------------------------------------------------
  # ● 애니메이션 카운트의 갱신
  #--------------------------------------------------------------------------
  def update_animation
    speed = @move_speed + (dash? ? 1 : dwadle? ? -1 : 0)
    if @anime_count > 18 - speed * 2
      if not @step_anime and @stop_count > 0
        @pattern = @original_pattern
      else
        @pattern = (@pattern + 1) % 4
      end
      @anime_count = 0
    end
  end
  def dwadle?
    return false
  end
end

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # ● 데쉬 상태 판정
  #--------------------------------------------------------------------------
  def dash?
    return false if @move_route_forcing
    return false if $game_map.disable_dash?
    return false if in_vehicle?
    return (Input.press?(eval(HG_Dwadle::DashKEY)) and not Input.press?(eval(HG_Dwadle::DwadleKEY)))
  end
  #--------------------------------------------------------------------------
  # ● 데쉬 상태 판정
  #--------------------------------------------------------------------------
  def dwadle?
    return false if @move_route_forcing
    return false if $game_map.disable_dwadle?
    return false if in_vehicle?
    return (Input.press?(eval(HG_Dwadle::DwadleKEY)) and not Input.press?(eval(HG_Dwadle::DashKEY)))
  end
end

class Game_Map
  def disable_dwadle?
    return HG_Dwadle::DISABLEMAP.include?(@map_id)
  end
end

 

#

Who's 허걱

?

공개된 사이트에서 퍼온 자료를 제외한(이 경우는 글에 출처를 남깁니다.)

제가 올린 모든 글과 자작 자료에대해 무단으로 퍼가는것을 금지합니다.

Comment '5'
  • ?
    mymy 2009.11.14 19:42

    근데 느리게 걸으면 뭐가좋나요?....

     

    ps.타로카드님 뭔?ㅋ

  • ?
    오리엔탈 2009.12.02 21:31

    이런거 만들 수 있죠. 몰래 들어가는 이벤트 만들때 일반 속도로 걷거나 순보쓰면 겜 오밬ㅋㅋ

  • ?
    카미 2010.01.21 04:56

    왜 안될까;; input을 바꿔서 해야되려나..

  • ?
    붕붕이 2010.02.23 01:44

    필요한 거엿는대 감사합니다

  • ?
    공중분열 2011.07.24 14:35

    감사합니다~~~~


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5408
637 기타 Gamepad Extender VX 습작 2015.01.02 672
636 버그픽스 DerVVulfman's Tileset Reader VX Bug Fix 습작 2014.11.16 701
635 아이템 현재있는 파티원 선택 레벨업 아이템 만들기 1 file 싸패 2016.06.06 713
634 메뉴 Etude87_Ace_Style_Formation_Change ver.1.01 습작 2014.10.05 758
633 저장 세이브 파일 개수 16개로 늘리기 (기본 세이브 엔진용) 1 file Bunny_Boy 2015.09.07 817
632 ??? 1 Man... 2008.10.27 1020
631 버그픽스 Graphical Object Global Reference VX by Mithran Alkaid 2014.03.03 1027
630 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 습작 2013.04.19 1046
629 메시지 Etude87 Dialogue History Scene file 습작 2014.07.07 1069
628 ??(다 영어)여기서 부터 드레그만 빼고 Man... 2008.10.27 1078
627 메뉴 KGC - 커스텀 메뉴 커멘드 (번역) 1 듀란테 2015.07.27 1079
626 Scene_Credit script Plug & Play 1 Man... 2008.10.27 1085
625 Multi-threader snippet by Omegazion Man... 2008.10.28 1107
624 메뉴 MOG - Scroll Bar for VX file 습작 2014.07.06 1115
623 Screen Shortcut Script Man... 2008.10.27 1142
622 LevelMe v1.2 3 Man... 2008.10.27 1154
621 Screen Resolution 3 Man... 2008.10.28 1171
620 키입력 Key Simulator by Fantasist 습작 2013.05.01 1176
619 MAX Level Limitation System 3 Man... 2008.10.28 1198
618 Simple Fon Chage 3 Man... 2008.10.28 1212
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32