XP 스크립트

#=================================================
#  ★ Event Move Toward
#-------------------------------------------------
#    제작:kcss
#    사용법:이벤트가 이벤트에게 다가가는것
#              이동루트 > 스크립트 > move_toward_event(id)
#             
#              이벤트가 이벤트를 향하는것
#              이동루트 > 스크립트 > turn_toward_event(id)
#=================================================

class Game_Character
  #--------------------------------------------------------------------------
  # ● 이벤트가 이벤트에게 다가간다
  #--------------------------------------------------------------------------
  def move_toward_event(id)
    ex = @x - $game_map.events[id].x
    ey = @y - $game_map.events[id].y
    if ex == 0 and ey == 0
      return
    end
    abs_ex = ex.abs
    abs_ey = ey.abs
    if abs_ex == abs_ey
      rand(2) == 0 ?  abs_ex += 1 : abs_ey += 1
    end
    if abs_ex > abs_ey
      ex > 0 ?  move_left : move_right
      if not moving?  and ey != 0
        ey > 0 ?  move_up : move_down
      end
    else
      ey > 0 ?  move_up : move_down
      if not moving?  and ex != 0
        ex > 0 ?  move_left : move_right
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 이벤트가 이벤트를 향한다
  #--------------------------------------------------------------------------
  def turn_toward_event(id)
    ex = @x - $game_map.events[id].x
    ey = @y - $game_map.events[id].y
    if ex == 0 and ey == 0
      return
    end
    if ex.abs > ey.abs
      ex > 0 ?  turn_left : turn_right
    else
      ey > 0 ?  turn_up : turn_down
    end
  end 
end


사용법은 주석을 참조하세요

그리고 메인위에 찔러넣으면 됩니다

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '8'
  • ?
    은둔자 2010.03.07 12:19

    음 제게 필요한 스크립트란 생각이 드네요 감사합니다^^

  • ?
    은둔자 2010.03.07 12:45

    그런데.. 오류만 생기는건 왜일까요;;

  • ?
    롤러K코스터 2010.07.25 15:21

    저한테 필요한건데.......

    왜이리 복잡해?

  • ?
    롤러K코스터 2010.07.25 15:21

    님들 이거 어떻게 사용하는지 방법좀 가르쳐주세요~

  • ?
    castalia 2010.12.24 11:41

    이벤트 편집에 들어가서

    이동 경로 설정 - 스크립트 순으로 들어간 다음, 사용법에 있는 스크립트를 넣으니까 되네요...

    (id) 안에 이벤트 id 숫자 넣어서...

     

    하여튼 잘 가져갑니다~~

  • profile
    초아™ 2011.03.08 16:53

    호오 잘쓰것습니다^^

  • ?
    석진이 2011.07.07 09:46

    와 멋있는 스크립트다정말 2003이런거 없는거 정말 화가나도록 싫었지

    백호님 감사합니다``~

  • profile
    다크블래커 2014.01.04 15:46
    잘쓰겠습니다

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6202
701 전투 SG_Batte Retry ver.4 by sandgolem 2 백호 2009.02.22 1460
700 저장 SG_Broken Save File Fix by sandgolem (SDK호환) 1 백호 2009.02.22 1068
699 기타 SG_Call Script Fix by sandgolem (SDK호환) 백호 2009.02.22 804
698 아이템 SG_Escape Only Items by sandgolem (SDK호환) 백호 2009.02.22 850
697 스킬 SG_Escape Only Skills by sandgolem (SDK호환) 백호 2009.02.22 753
696 변수/스위치 SG_Gold Window Variables v2 by sandgolem (SDK호환) 백호 2009.02.22 899
695 아이템 SG_Hide free item cose by sandgolem (SDK호환) 백호 2009.02.22 935
694 메뉴 SG_Hide zero SP cost by sandgolem (SDK호환) 백호 2009.02.22 1066
693 아이템 SG_Item Break by sandgolem (SDK호환) 백호 2009.02.22 898
692 맵/타일 SG_Map Pause ver.1 by sandgolem 2 백호 2009.02.22 1290
691 기타 SG_Multiple Currencies v3 by sandgolem (SDK호환) 백호 2009.02.22 803
690 변수/스위치 SG_Self Variables by sandgolem 백호 2009.02.22 1275
689 기타 SG_Settings Control by sandgolem 백호 2009.02.22 884
688 스킬 SG_Skill Break by sandgolem (SDK호환) 백호 2009.02.22 772
687 스킬 SG_Skill Invoking Battle Items by sandgolem (SDK호환) 백호 2009.02.22 894
686 상태/속성 SG_State Immunity Message by sandgolem (SDK 호환) 백호 2009.02.22 1057
685 기타 SG_Transfer Player Music Fix v2 by sandgolem (SDK호환) 1 백호 2009.02.22 824
684 이동 및 탈것 SG_Wait for Move Completion Fix by sandgolem (SDK호환) 백호 2009.02.22 860
683 기타 SG_Window Control v2 by sandgolem 백호 2009.02.22 823
682 기타 Shift Puzzles by SephirothSpawn (SDK호환) 1 file 백호 2009.02.22 1390
Board Pagination Prev 1 ... 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ... 52 Next
/ 52