VX 스크립트

스크립터: BigEd781

보통 게임을 만들 때, 이벤트의 위치가 이동을 할 때가 있죠.

하지만 그 위치가 다른 맵에 갔다가 다시 돌아오면 처음에 지정되어 있던 위치로

다시 바껴있는 경우가 허다해, 스위치를 이용해 새 이벤트를 만들어야만 했던

귀찮았던 때가 있었죠.

이제 이 스크립트로 그 문제를 해결하세요!! (무슨 홈쇼핑 광고 같다...)

그렇다고 이 스크립트는 무작정 이벤트의 위치가 전에 있던 것으로 옮겨주는 건 아니고...

이 스크립트에 해당되는 스위치를 켜야 활성화가 됩니다.

한마디로 필요하지 않을 땐 그냥 스위치를 끄면 간단하게 OK!!

또 이벤트에다 주석으로 'no mem'이라고 적으면 그 이벤트 역시 그 장소를 저장하지 않습니다!!!!!! (놀랍네요!)

스위치 지정은

alias :eds_old_pre_mem_setup :setup
  def setup(map_id)    
    save_positions if $game_switches[1]
    eds_old_pre_mem_setup(map_id)    
    restore_positions  if $game_switches[1]
  end

이 부분을 찾으셔서

$game_switches[1] 라고 적혀 있는 곳에 있는 [ ]  안에

원하는 스위치 id를 지정하세요. (참고로 두부분이 있고, 두부분 모두 바꿔줘야 합니다..)

설명 끝 -0-;


#-----------------------------------------------------------------------
#                       Memorize Event Positions
#                               BigEd781
#-----------------------------------------------------------------------
class Game_System
  
  alias :eds_old_pre_mem_intialize :initialize
  def initialize
    eds_old_pre_mem_intialize
    @event_pos_data = {}    
  end
  
  def save_event_position_data(map_id, data)
    @event_pos_data[map_id] = data
  end
  
  def get_event_position_data(map_id)
    return @event_pos_data[map_id].nil? ? [] : @event_pos_data[map_id]
  end
  
end

class Game_Event < Game_Character

  def comment?(comment)
    unless @list.nil?
      @list.each { |line|
        next if line.code != 108                              
        return true if line.parameters[0].upcase == comment.upcase }      
    end    
    return false
  end  
  
end

class Game_Map
  #스위치 지정하는 곳
  alias :eds_old_pre_mem_setup :setup
  def setup(map_id)    
    save_positions if $game_switches[1]
    eds_old_pre_mem_setup(map_id)    
    restore_positions  if $game_switches[1]
  end
  
  def save_positions
    return if @events.nil? || @events == { }        
    data = []
    @events.values.each { |event| data += [[ event.id, event.x, event.y, event.direction ]] }      
    $game_system.save_event_position_data(@map_id, data)    
  end
  
  def restore_positions    
    return if @events.nil? || @events == { }        
    $game_system.get_event_position_data(@map_id).each { |data|  
    event = @events[data[0]]  
      unless event.nil? || event.comment?('no mem')
        x, y, direction = data[1], data[2], data[3]
        event.moveto(x, y) unless event.pos?(x, y)
        event.set_direction(direction)
      end
    }    
  end
  
end


출처: rpgrevolution.com

Who's Tofuman

?
WE ARE!? PENN STATE!!!!!
Comment '10'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5408
110 기타 개인판타지메뉴+업그래이드 배틀 23 file 콩밥 2010.08.02 4211
109 기타 Kylock 밤낮 스크립트 부분 한글화 + 달력 모드 (모드는 자작) 31 file RMdude 2009.02.15 4100
108 기타 액터선택지제작 간편화 스크립트 7 Evangelista 2009.02.26 4082
107 기타 시야범위 스크립트 18 file 좀비사냥꾼 2009.03.19 4047
106 기타 시야범위 스크립트 22 file 카르와푸딩의아틀리에 2009.06.30 4025
105 기타 화면 해상도(640 X 480) 스크립트 6 file 쿠쿠밥솥 2012.01.10 3972
104 기타 vx 보안 시스템 19 file 허걱 2009.07.29 3966
103 기타 VX에서 포그 그래픽을 사용하자 16 아방스 2008.01.31 3895
102 기타 통합 스크립트(좋은 마우스 스크립트 좋은거),KGC좋은거 새로운 거 스크립트 세이브 스크립트 좋은거!~~~~~ 14 알피지GM 2010.03.07 3829
101 기타 설명하기 힘든 스크립트 (스크린샷 확인) 10 file 사람이라면? 2010.08.16 3818
100 기타 레벨업 이펙트... 20 비극ㆍ 2010.04.19 3768
99 기타 미니게임테트리스 스크립트 ㅋㅋㅋ 27 file 카르와푸딩의아틀리에 2009.06.30 3689
98 기타 화폐단위 구분해 주는 스크립트 38 file 허걱 2010.04.13 3652
97 기타 낚시 스크립트~(낚시대로 하는 낚시가 아니라 사람을 낚는 낚시 스크립트) 14 file ~AYARSB~ 2010.03.18 3630
96 기타 멥 이름 띄우기 10 신규회원 2012.02.24 3626
95 기타 Crissaegrim 농장시스템 한글화 28 file 도심 2009.12.22 3606
94 기타 [KGC]한계돌파 9 방콕족의생활 2008.06.13 3599
93 기타 말풍선 그림 바꾸기 6 file 허걱 2009.08.15 3565
92 기타 데이터베이스 자체 제한 해체 스크립트 [Database Limit Breaker] 13 file 할렘 2009.02.07 3562
91 기타 KGC패시브 스크립트 30 카르와푸딩의아틀리에 2009.10.07 3551
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7