질문과 답변

Extra Form

아래의 미니맵 스크립트를 넣으면 모든 맵의 미니맵이 표시되어 버리네요.

스크립트를 특정 맵에서 불러올때만 미니맵을 킬수있는 방법은 없을까요??

오프닝이나 엔딩 같은 곳에서는 미니맵을 쓰고 싶지않네요.

마을집 내부같이 좁은곳에서 미니맵을 쓰면좀 이상합니다.

미니맵를 스위치처럼 끄고 킬수있는 스크립트를 써주시면 감사하겠습니다.

C버튼 B버튼으로 껏다 킬수잇다는게 그게 무슨말인지요

플레이어가 b나 c누르면 껏다 켜진다는말인가요?

이런거말고 특정지역에서 미니맵을 꺼졋다 켜졋다하게하는 방법은 없을까요

#============================================================================== 
# 축소 맵의 표시(ver 0.999) 
# by 크로노스 clum-sea 
#==============================================================================


#============================================================================== 
# 캐스터 마이즈포인트 
#============================================================================== 
module PLAN_Map_Window 
WIN_X = 8 # 윈도우의 X 좌표 
WIN_Y = 8 # 윈도우의 Y 좌표 
WIN_WIDTH = 6*20 # 윈도우의 폭 
WIN_HEIGHT = 5*20 # 윈도우의 높이 
ZOOM = 16.0 # 프의 축소율(32 * 32 의 타일을 몇분의 1으로 할까) 
WINDOWSKIN = "" # 스킨(하늘에서 디폴트)

ON_OFF_KEY = Input::C # 윈도우의 온 오프를 바꾸는 버튼

SWITCH = 40 # 맵 윈도우 표시 금지용의 스윗치 번호 
# (ON로 표시 금지, OFF로 표시 가능)

WINDOW_MOVE = true # 윈도우와 플레이어가 겹쳤을 시 자동적으로 이동할까 
# (true:하는, false:하지 않는다) 
OVER_X = 632 - WIN_WIDTH # 이동 후의 X 좌표(초기 위치와 왕복합니다) 
OVER_Y = 8 # 이동 후의 Y 좌표(초기 위치와 왕복합니다)

OPACITY = 196 # 맵의 투명도 
C_OPACITY = 252 # 윈도우의 투명도 
VISIBLE = true # 최초, 표시할까 하지 않는가(true:하는, false:하지 않는다) 
end

#============================================================================== 
# ?? Game_Temp 
#============================================================================== 
class Game_Temp 
#-------------------------------------------------------------------------- 
# ● 공개 인스턴스 변수 
#-------------------------------------------------------------------------- 
attr_accessor :map_visible # ?맵 윈도우의 표시 상태 
#-------------------------------------------------------------------------- 
# ● 오브젝트 초기화 
#-------------------------------------------------------------------------- 
alias plan_map_window_initialize initialize 
def initialize 
# 되돌린다 
plan_map_window_initialize

@map_visible = true 
end 
end 
#============================================================================== 
# ■ Scene_Map 
#==============================================================================

class Scene_Map 
#-------------------------------------------------------------------------- 
# ● 메인 처리 
#-------------------------------------------------------------------------- 
alias plan_map_window_main main 
def main 
# 윈도우를 작성 
@map_window = Window_Map.new 
@map_window.visible = $game_temp.map_visible 
# 되돌린다 
plan_map_window_main 
# 메세지 윈도우를 해방 
@map_window.dispose 
end 
#-------------------------------------------------------------------------- 
# ● 프레임 갱신 
#-------------------------------------------------------------------------- 
alias plan_map_window_update update 
def update 
# visible 를 기억 
$game_temp.map_visible = @map_window.visible 
# 되돌린다 
plan_map_window_update

# 금지가 아니면, 변환 처리 
unless $game_switches[PLAN_Map_Window::SWITCH] 
# 표시되고 있는 경우, 비표시로 한다 
if Input.trigger?(PLAN_Map_Window::ON_OFF_KEY) 
# 표시되어 있지 않은 경우, 표시한다 
if @map_window.visible 
@map_window.visible = true 
# 표시되어 있지 않은 경우, 표시한다 
else 
@map_window.visible = true 
end 
end 
# 금지의 경우는 강제적으로 비표시 
else 
if @map_window.visible 
@map_window.visible = true 
end 
end 
# 표시되고 있을 때만 갱신 
if @map_window.visible 
@map_window.update 
end 
end 
#-------------------------------------------------------------------------- 
# ● 플레이어의 장소 이동 
#-------------------------------------------------------------------------- 
alias plan_map_window_transfer_player transfer_player 
def transfer_player 
# visible 를 기억 
visible = @map_window.visible 
@map_window.visible = true 
# 되돌린다 
plan_map_window_transfer_player 
# 맵 윈도우를 해방 
@map_window.dispose 
# 맵 윈도우를 작성 
@map_window = Window_Map.new 
# 표시 설정을 전맵 상태에 되돌린다 
@map_window.visible = visible 
end 
end


#============================================================================== 
# ■ Window_Map 
#==============================================================================

class Window_Map < Window_Base 
#-------------------------------------------------------------------------- 
# 타일 맵의 경우 
#-------------------------------------------------------------------------- 
def initialize 
x = PLAN_Map_Window::WIN_X 
y = PLAN_Map_Window::WIN_Y 
w = PLAN_Map_Window::WIN_WIDTH 
h = PLAN_Map_Window::WIN_HEIGHT 
super(x, y, w, h) 
unless PLAN_Map_Window::WINDOWSKIN.empty? 
self.windowskin = RPG::Cache.windowskin(PLAN_Map_Window::WINDOWSKIN) 
end 
self.contents = Bitmap.new(width - 32, height - 32) 
self.opacity = PLAN_Map_Window::OPACITY 
self.contents_opacity = PLAN_Map_Window::C_OPACITY 
@map_data = $game_map.data 
# ??C????b?v?????? 
@tileset = RPG::Cache.tileset($game_map.tileset_name) 
@autotiles = [] 
for i in 0..6 
autotile_name = $game_map.autotile_names[i] 
@autotiles[i] = RPG::Cache.autotile(autotile_name) 
end 
# ???????v???C??????u???m?? 
@old_real_x = $game_player.real_x 
@old_real_y = $game_player.real_y 
# ??b?v???S????????? 
@all_map = make_all_map 
# ????E??????????? 
self.visible = PLAN_Map_Window::VISIBLE 
# ??? 
refresh 
end 
#-------------------------------------------------------------------------- 
# ?? ??b?v???S??????????i?k???????t???j 
#-------------------------------------------------------------------------- 
def make_all_map 
all_map = Bitmap.new($game_map.width * 32, $game_map.height * 32) 
for y in 0...$game_map.height 
for x in 0...$game_map.width 
for z in 0...3 
tile_num = @map_data[x, y, z] 
next if tile_num == nil 
# ?I??g??C???????? 
if tile_num < 384 
# ????C???????????????? 
if tile_num >= 48 
tile_num -= 48 
src_rect = Rect.new(32, 2 * 32, 32, 32) 
all_map.blt(x * 32, y * 32, @autotiles[tile_num / 48], src_rect) 
end 
# 타일 맵의 경우 
else 
tile_num -= 384 
src_rect = Rect.new(tile_num % 8 * 32, tile_num / 8 * 32, 32, 32) 
all_map.blt(x * 32, y * 32, @tileset, src_rect) 
end 
end 
end 
end 
# 전체 맵으로부터 축소 맵에 
w = ($game_map.width / PLAN_Map_Window::ZOOM) * 32 
h = ($game_map.height / PLAN_Map_Window::ZOOM) * 32 
ret_bitmap = Bitmap.new(w, h) 
src_rect = Rect.new(0, 0, all_map.width, all_map.height) 
dest_rect = Rect.new(0, 0, ret_bitmap.width, ret_bitmap.height) 
ret_bitmap.stretch_blt(dest_rect, all_map, src_rect) 
all_map.dispose 
return ret_bitmap 
end 
#-------------------------------------------------------------------------- 
# ● 리프레쉬 
#-------------------------------------------------------------------------- 
def refresh 
self.contents.clear 
# 축소 맵 표시 
one_tile_size = 32 / PLAN_Map_Window::ZOOM 
x = $game_player.real_x - 128 * (self.contents.width / one_tile_size) / 2 
y = $game_player.real_y - 128 * (self.contents.height / one_tile_size) / 2 
x = x * one_tile_size / 128 
y = y * one_tile_size / 128

# 스크롤 스톱 처리(옆) 
# 캐릭터의 위치(contents 의 중앙) 
half_width = self.contents.width * 128 / 2 
# 캐릭터의 위치(실위치)~맵의 구석까지의 나머지폭 
rest_width = ($game_map.width * 128 - $game_player.real_x) * one_tile_size 
# 윈도우보다 맵의 폭이 작으면 
rev_x = 0 
# 맵이 윈도우보다 작은 경우는 중앙 표시 
if @all_map.width < self.contents.width 
rev_x = (half_width - $game_player.real_x * one_tile_size) / 128 
rev_x -= (self.contents.width - @all_map.width) / 2 
x += rev_x 
# ??????b?v????????????? 
elsif half_width > $game_player.real_x * one_tile_size 
rev_x = (half_width - $game_player.real_x * one_tile_size) / 128 
x += rev_x 
# 오른쪽이 맵의 구석을 넘으면 
elsif half_width > rest_width 
rev_x = -((half_width - rest_width) / 128) 
x += rev_x 
end

# 스크롤 스톱 처리(세로) 
# 캐릭터의 정도 치(contents 의 중앙) 
half_height = self.contents.height * 128 / 2 
# 캐릭터의 위치(실위치)~맵의 구석까지의 나머지 높이 
rest_height = ($game_map.height * 128 - $game_player.real_y) * one_tile_size 
# 윈도우보다 맵의 폭이 작으면 
rev_y = 0 
# 맵이 윈도우보다 작은 경우는 중앙 표시 
if @all_map.height < self.contents.height 
rev_y = (half_height - $game_player.real_y * one_tile_size) / 128 
rev_y -= (self.contents.height - @all_map.height) / 2 
y += rev_y 
# 오른쪽이 맵의 구석을 넘으면 
elsif half_height > $game_player.real_y * one_tile_size 
rev_y = (half_height - $game_player.real_y * one_tile_size) / 128 
y += rev_y 
# ?E????b?v????????????? 
elsif half_height > rest_height 
rev_y = -((half_height - rest_height) / 128) 
y += rev_y 
end

src_rect = Rect.new(x, y, self.contents.width, self.contents.height) 
self.contents.blt(0, 0, @all_map, src_rect) 
# 윈도우의 이동 처리 
if PLAN_Map_Window::WINDOW_MOVE == true 
# 윈도우의 범위를 취득(범위 오브젝트) 
w = self.x..self.x + self.width 
h = self.y..self.y + self.height 
# 플레이어가 윈도우의 범위내에 들어갔을 경우 
if w === $game_player.screen_x and h === $game_player.screen_y 
# 이동 장소 판정 
# 초기 위치라면 
if self.x == PLAN_Map_Window::WIN_X and self.y == PLAN_Map_Window::WIN_Y 
# 이동 후의 좌표에 이동 
self.x = PLAN_Map_Window::OVER_X 
self.y = PLAN_Map_Window::OVER_Y 
# 초기 위치가 아닌 경우 
else 
# 초기 위치에 이동 
self.x = PLAN_Map_Window::WIN_X 
self.y = PLAN_Map_Window::WIN_Y 
end 
end 
end 
# 액터가 있는 경우는 최초의 액터를 맵에 표시 
if $game_party.actors.size > 0 
# priority 체크 숨는다면 액터비표시 
for i in [2, 1, 0] 
tile = @map_data[$game_player.x, $game_player.y, i] 
next if tile == 0 
return if $game_map.priorities[tile] > 0 
end 
actor = $game_party.actors[0] 
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue) 
width = bitmap.width / 4 
height = bitmap.height / 4 
src_rect = Rect.new(0, 0, width, height) 
# 액터를 중앙에 표시 
w = width / PLAN_Map_Window::ZOOM 
h = height / PLAN_Map_Window::ZOOM 
# 타일의 폭만 짝수이므로 반타일분 늦춘다 
x = self.contents.width / 2 - w / 2 + one_tile_size / 2 - rev_x 
y = self.contents.height / 2 - h / 2 - rev_y 
dest_rect = Rect.new(x, y, w, h) 
self.contents.stretch_blt(dest_rect, bitmap, src_rect) 
end 
end 
#-------------------------------------------------------------------------- 
# ● 프레임 갱신 
#-------------------------------------------------------------------------- 
def update 
super 
if @old_real_x != $game_player.real_x or @old_real_y != $game_player.real_y 
@old_real_x = $game_player.real_x 
@old_real_y = $game_player.real_y 
refresh 
end 
end 
#-------------------------------------------------------------------------- 
# ● 해방 
#-------------------------------------------------------------------------- 
def dispose 
super 
@all_map.dispose 
end 
end 

Comment '4'
  • ?
    코아 코스튬 2010.10.09 01:30

    특정 맵에서 안되게 하고싶으면,,

    그 스크립트 맨 윗 부분에 unless $game_map.map_id == 맵 아이디

    (맵 아이디를 알고 싶으시면 제가올린 http://avangs.info/zbxe/1678511 스크립트를 사용해 보세요)

    그리고 맨 아랫 부분에 end 를 써주시면 됩니다.

    여러 군데를 정하고 싶으시면

    unless( $game_map.map_id == 맵 아이디1 or  $game_map.map_id == 맵 아이디2)

    처럼 맨 윗부분을 바꾸시면 됩니다.

  • ?
    황제님 2010.10.09 05:51

    unless $game_map.map_id 6 이거 맨위에 쓰고 맨 밑에 end 썻더니 에러떠요 ㅠㅠ 

  • ?
    황제님 2010.10.10 03:37

    네 제가 위에 붙여넣은 스크랩 젤위에 unless $game_map.map_id == 6 하고 젤밑에 end 했는데 error 뜨네요 

    이를 어찌하죠 ㅠ

  • ?
    Alkaid 2010.10.09 07:58

    unless $game_map.map_id == 6
    ......
    end
    로 하신 것 맞습니까?


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12387
RMVX RPGVX 게임은돌아가는데 글씨가 안보여요 ㅠ 5 힙간 2011.10.22 2165
RMVX RPG VX<<< BGM이랑 ME 이거 사운드가 안나와요.ㅜㅜ 1 토모야키 2011.10.22 3432
RMXP rpgxp응답없음..헬프미~~ 2 용자건담 2011.10.21 2140
RMXP 공격력 증가방법 2 캉쿤 2011.10.21 2318
RMVX xp툴의 BGM을 vx툴로 옮기고 싶은데요 3 동담 2011.10.21 1903
RMXP 캐릭터가 가만히 서있을 때 움직이게 하는 방법을 알려주세요.ㅜ 2 나는청춘 2011.10.20 2476
RMVX (rpgvx)기차스크립트 사용법(스크립트 사용법) 5 ba람이 2011.10.19 2027
RMVX VX 윈도우7에서 테스트플레이시... 3 Luciel 2011.10.19 1959
GM 반복 1 Jhon 2011.10.18 1742
RMXP [스크립트] 주인공 이름 표시 일시적으로 안되게 하기 2 뮤리온。 2011.10.17 1168
기타 우스이의 회 홈페이지 주소... 1 허브한잎 2011.10.17 2299
RMXP RPG XP에서 RPG2k, RPG2k3 BGM 사용하기 (mid파일) 2 뮤리온。 2011.10.17 2639
RMXP 아오오니같은 게임만들때.... 3 이지눙 2011.10.17 2801
RMXP XP버전에서 얼굴그래픽 넣는 방법 2 m양 2011.10.16 2334
RMVX rpg vx 벽만들기 1 판다냐옹 2011.10.15 2050
RMVX 스크립트 쓸때 alias 1 EuclidE 2011.10.15 1561
GM rpg만들기 제일쉬운거 4 cerod 2011.10.14 1911
RMXP 스크립트폍집기에서 1 곱등이틀러 2011.10.12 2182
RMVX vampyr SBABS-Requiem ABS 9버전 오류.. 다시올립니다. 3 이런게상세 2011.10.12 2291
기타 아방스에서 완성작게임자료실,일반게임자료실의 차이점은 무엇인가요? 1 라유 2011.10.12 1185
Board Pagination Prev 1 ... 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 ... 516 Next
/ 516