OPIS:
Minimapa jest bardzo dobra, w przeciwieństwie do tej na forum nie ma ograniczeń wielkości. No i oczywiście można dodać grafiki jakie się chce! Sama mapa składa się z kafelek odwzorowujących ich położenie na faktycznej mapie, można powiedzieć, ze działa na zasadzie stworzenia drugiego okna gry, w którym bohater ma swojego chara, mapa ma swoje kafelki, eventy mają swój wygląd, etc. Oczywiście w mniejszej skali :)
Skrzypt podrzucił radek02 w formie hiszpańskiego dema, ja przetłumaczyłem konfigurację i wrzucam tu całość poskładaną do kupy.
Autorem jest Bennamy
SKRYPT
Spoiler:
Spoiler:
Nazywamy VX_SP1
Ja tak nazwałem, tak było0 w demie i działa. Innej nazwy nie próbowałem bo po co :)
Nietłumaczony, bo konfiguracji w nim chyba nawet nie ma a ja nie znam hiszpańskiego.
Kod:
#==============================================================================
# VX_SP1
#------------------------------------------------------------------------------
# Correção do sistema de pré-configuração
#==============================================================================
#------------------------------------------------------------------------------
# Código de correção
#------------------------------------------------------------------------------
# * Em uma animação, quando um frame possui dimensões maiores ou menores
# que as dimensões de uma imagem utilizada, ocorre um erro de exibição
# * Problemas na exibição de animações com coordenada Y inválida (causada
# pelo problema acima)
# * Problemas relacionados ao caminho dos gráficos de uma animação, que, se
# indisponíveis, não reportavam problema
#------------------------------------------------------------------------------
class Sprite_Base < Sprite
#--------------------------------------------------------------------------
# Exibição da animação
#--------------------------------------------------------------------------
alias eb_sp1_dispose_animation dispose_animation
def dispose_animation
eb_sp1_dispose_animation
@animation_bitmap1 = nil
@animation_bitmap2 = nil
end
#--------------------------------------------------------------------------
# Configuração do gráfico de animação
# frame : informações do frame (RPG::Animation::Frame)
#--------------------------------------------------------------------------
alias eb_sp1_animation_set_sprites animation_set_sprites
def animation_set_sprites(frame)
eb_sp1_animation_set_sprites(frame)
cell_data = frame.cell_data
for i in 0..15
sprite = @animation_sprites[i]
next if sprite == nil
pattern = cell_data[i, 0]
next if pattern == nil or pattern == -1
if @animation_mirror
sprite.y = @animation_oy + cell_data[i, 2]
end
sprite.z = self.z + 300 + i
end
end
end
Spoiler:
Nazwałem "Mini Mapa" i działa. Przetłumaczona konfiguracja, choć bardziej na podstawie kodu, niż języka. Ważne, że działa :)
Kod:
#==============================================================================
# ReinoRPG Mini-Mapa (RPG Maker VX)
#------------------------------------------------------------------------------
# Bennamy (Amy Productions) & RTH (PRCoders)
# Version 1.0
# 09/10/2008
#------------------------------------------------------------------------------
# ~~POLSKI~~
#------------------------------------------------------------------------------
# Nie znam hiszpańskiego, ale mniej więcej objaśnię jak toto działa.
# Każdemu eventowi opisanemu określonym tagiem nadaje na mapie dany obrazek.
# Mapa składa się z kafelek - jak normalne, ale mniejsze. Typ jest tylko jeden.
# Praktycznie wszystko jest konfigurowalne.
# Nie ma ograniczeń wielkości mapy! To ważne jak dla mnie!
# Tagi dodajemy w komentarzach w zdarzeniu.
#------------------------------------------------------------------------------
# Descrição:
#
# Este script exibe um mini-mapa em um canto da tela onde nele são mostrados
# os tiles passáveis e os tiles não passáveis (onde o personagem pode caminhar
# e onde ele não pode caminhar). No mini-mapa podem ser mostradas posições de
# certos eventos, basta colocar comentários específicos para cada evento.
# Todos os gráficos exigidos neste mini-mapa podem ser totalmente alterados.
#------------------------------------------------------------------------------
# Instruções:
#
# Coloque este script entre "Scripts Adicionais" e "Principal".
#
# Copie todas as imagens necessárias para a pasta "Pictures" do seu projeto.
#
# Para exibir determinado evento no mini-mapa você precisa adicionar um
# comentário na página de comandos deste evento. Os comentários podem ser:
# - npc = Para NPCs
# - passagem = Para TELETRANSPORTES/PASSAGENS
# - pousada = Para POUSADAS/PONTOS PARA SALVAR O JOGO
# - bau = Para BAÚS/TESOUROS
# - inimigo = Para INIMIGOS
# - outro = Para SHOPS/COMPANHEIROS/ITENS INTERATIVOS DO MAPA
#
# OBS.: Os comentários nos eventos do mini-mapa podem ser alterados em:
# CONFIGURAÇÕES DE EXIBIÇÃO DOS EVENTOS NO MINI-MAPA.
#
#------------------------------------------------------------------------------
# Customização:
#
# Para modificar a Switch que ATIVA/DESATIVA o mini-mapa, basta procurar onde
# começa a CONFIGURAÇÃO do script e alterar o valor de MM_ACTIVATED_ID.
#
# Para alterar o local onde o mini-mapa será exibido, primeiro você deve
# escolher que variável definirá o local do mini-mapa, isso pode ser feito
# alterando o valor de MM_CORNER_VAR. Depois é necessário alterar também o
# valor da variável indicada logo acima, os valores podem ser:
# 1 = Para exibir o mini-mapa no Canto SUPERIOR ESQUERDO da tela
# 2 = Para exibir o mini-mapa no Canto SUPERIOR DIREITO da tela
# 3 = Para exibir o mini-mapa no Canto INFERIOR ESQUERDO da tela
# 4 = Para exibir o mini-mapa no Canto INFERIOR DIREITO da tela
#
# OBS.: Alterações podem ser efetuadas na parte de CONFIGURAÇÕES do script.
#
#------------------------------------------------------------------------------
# Créditos e Agradecimentos:
#
# Bennamy (Amy Productions) & RTH (PRCoders) - Pela criação deste script
# Selwyn (squall) - Por ter criado o script para RMXP que foi usado como base.
# Fanha Giang (aka fanha99) - Pelo método de exibir autotiles.
#
#------------------------------------------------------------------------------
# Termos de Uso e Disponibilização:
#
# Você deve inserir um link para este tópico na ReinoRPG.
# Você deve inserir um link para www.rmzine.reinorpg.com
# Você deve creditar os autores e demais envolvidos na produção do material
# Mesmo que editar este conteúdo, estas regras devem valer.
#
#==============================================================================
# Konfiguracja tagów eventów:
MM_EVENT_OTHER = "other" # Tag dla innych eventów
MM_EVENT_ENEMY = "enemy" # Dla wrogów
MM_EVENT_TELEPORT = "tp" # Dla przejścia
MM_EVENT_CHEST = "chest" # Dla skrzyni
MM_EVENT_NPC = "npc" # Dla NPCa
MM_EVENT_SAVEPOINT = "save" # Dla savepointu
end
#--------------------------------------------------------------------------
# FIM DAS CONFIGURAÇÕES
#--------------------------------------------------------------------------
#==============================================================================
# Scene_Map
#------------------------------------------------------------------------------
# Classe das operações nos mapas.
#==============================================================================
class Scene_Map
include CONFIG
#--------------------------------------------------------------------------
# Lista de métodos aliasados
#--------------------------------------------------------------------------
@@pre_terminate_aliased = false
unless method_defined?(:amy_mm_main)
alias amy_mm_main main
alias amy_mm_update update
alias amy_mm_perform_battle_transition perform_battle_transition
if method_defined?(:pre_terminate)
alias amy_mm_pre_terminate pre_terminate
@@pre_terminate_aliased = true
end
end
#--------------------------------------------------------------------------
# Inicialização do objeto
#--------------------------------------------------------------------------
def initialize
@corner = $game_variables[MM_CORNER_VAR]
end
#--------------------------------------------------------------------------
# Principal
#--------------------------------------------------------------------------
def main
@mini_map = Map_Event.new(@corner)
amy_mm_main
@mini_map.dispose
end
#--------------------------------------------------------------------------
# Atualização da tela
#--------------------------------------------------------------------------
def update
if $game_variables[MM_CORNER_VAR] != @corner
@corner = $game_variables[MM_CORNER_VAR]
@mini_map.corner = @corner
end
@mini_map.update
if $game_map.interpreter.running?
@mini_map.visible = false
elsif @mini_map.on?
@mini_map.visible = true
end
amy_mm_update
end
#--------------------------------------------------------------------------
# Transição
#--------------------------------------------------------------------------
def minimap_transfer
@mini_map.dispose
@mini_map = Map_Event.new(@corner)
end
#--------------------------------------------------------------------------
# Execução da transição de batalha
#--------------------------------------------------------------------------
def perform_battle_transition
@mini_map.visible = false
amy_mm_perform_battle_transition
end
#--------------------------------------------------------------------------
# Fim do processo
#--------------------------------------------------------------------------
def pre_terminate
@mini_map.visible = true
amy_mm_pre_terminate if @@pre_terminate_aliased
end
end
#==============================================================================
# Game_Player
#------------------------------------------------------------------------------
# Esta classe controla as informações do jogador. Entre elas: os veículos,
# os eventos (quando iniciá-los), o loop do mapa... etc.
# Pode ser acessada utilizando $game_player.
#==============================================================================
class Game_Player < Game_Character
unless method_defined?(:amy_mm_perform_transfer)
alias amy_mm_perform_transfer perform_transfer
end
#--------------------------------------------------------------------------
# Teletransportar
#--------------------------------------------------------------------------
def perform_transfer
amy_mm_perform_transfer
$scene.minimap_transfer
end
end
#==============================================================================
# Map_Base
#------------------------------------------------------------------------------
# Uma classe Base para mini mapas
#==============================================================================
class Map_Base < Sprite
include CONFIG
#--------------------------------------------------------------------------
# Constantes e Instâncias
#--------------------------------------------------------------------------
PMP_VERSION = 7
attr_reader :event
attr_reader :corner
#--------------------------------------------------------------------------
# Inicialização do objeto
#--------------------------------------------------------------------------
def initialize(corner)
super(Viewport.new(16, 16, width, height))
viewport.z = 8000
@border = Sprite.new
@border.x = viewport.rect.x - 6
@border.y = viewport.rect.y - 6
@border.z = viewport.z - 1
@border.bitmap = Cache.picture(MM_MAP_BACK)
self.visible = on?
self.opacity = MM_OPACITY
@corner = -1
self.corner = corner
self.visible = on?
end
#--------------------------------------------------------------------------
# Corner
#--------------------------------------------------------------------------
def corner=(valor)
return if @corner == valor
@corner = valor.to_i
case @corner
when 2
self.x = 544 - width - 16
self.y = 16
when 3
self.x = 16
self.y = 416 - height - 16
when 4
self.x = 544 - width - 16
self.y = 416 - height - 16
else
self.x = 16
self.y = 16
end
end
#--------------------------------------------------------------------------
# dispose
#--------------------------------------------------------------------------
def dispose
@border.dispose
super
end
#--------------------------------------------------------------------------
# x=
#--------------------------------------------------------------------------
def x=(x)
self.viewport.rect.x = x
@border.x = x - 6
end
#--------------------------------------------------------------------------
# y=
#--------------------------------------------------------------------------
def y=(y)
self.viewport.rect.y = y
@border.y = y - 6
end
#--------------------------------------------------------------------------
# visible=
#--------------------------------------------------------------------------
def visible=(bool)
super
self.viewport.visible = bool
@border.visible = bool
end
#--------------------------------------------------------------------------
# minimap_on?
#--------------------------------------------------------------------------
def on?
return $game_switches[MM_ACTIVATED_ID]
end
#--------------------------------------------------------------------------
# Atualização da tela
#--------------------------------------------------------------------------
def update
super
self.visible = on?
if viewport.ox < display_x
viewport.ox += 1
elsif viewport.ox > display_x
viewport.ox -= 1
end
if viewport.oy < display_y
viewport.oy += 1
elsif viewport.oy > display_y
viewport.oy -= 1
end
end
#--------------------------------------------------------------------------
# largura
#--------------------------------------------------------------------------
def width
return 102
end
#--------------------------------------------------------------------------
# altura
#--------------------------------------------------------------------------
def height
return 78
end
#--------------------------------------------------------------------------
# display_x
#--------------------------------------------------------------------------
def display_x
return $game_map.display_x * 3 / 128
end
#--------------------------------------------------------------------------
# display_y
#--------------------------------------------------------------------------
def display_y
return $game_map.display_y * 3 / 128
end
end
#==============================================================================
# Map_Passability
#------------------------------------------------------------------------------
# Exibe o Mini-mapa
# Agradecimentos para Fanha Giang (aka fanha99) pelo método de exibir autotiles
#==============================================================================
class Map_Passability < Map_Base
include CONFIG
#--------------------------------------------------------------------------
# Constantes
#--------------------------------------------------------------------------
INDEX =
[
26, 27, 32, 33, 4, 27, 32, 33, 26, 5, 32, 33, 4, 5, 32, 33,
26, 27, 32, 11, 4, 27, 32, 11, 26, 5, 32, 11, 4, 5, 32, 11,
26, 27, 10, 33, 4, 27, 10, 33, 26, 5, 10, 33, 4, 5, 10, 33,
26, 27, 10, 11, 4, 27, 10, 11, 26, 5, 10, 11, 4, 5, 10, 11,
24, 25, 30, 31, 24, 5, 30, 31, 24, 25, 30, 11, 24, 5, 30, 11,
14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
28, 29, 34, 35, 28, 29, 10, 35, 4, 29, 34, 35, 4, 29, 10, 35,
38, 39, 44, 45, 4, 39, 44, 45, 38, 5, 44, 45, 4, 5, 44, 45,
24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18, 19, 12, 13, 18, 11,
16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4, 41, 46, 47,
36, 37, 42, 43, 36, 5, 42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0, 1, 6, 7
]
X = [0, 1, 0, 1]
Y = [0, 0, 1, 1]
#--------------------------------------------------------------------------
# Inicialização do objeto
#--------------------------------------------------------------------------
def initialize(corner)
super(corner)
@autotile = Cache.picture(MM_TILES)
setup()
end
#--------------------------------------------------------------------------
# setup
#--------------------------------------------------------------------------
def setup()
@map = load_data(sprintf("Data/Map%03d.rvdata", $game_map.map_id))
@passages = $data_system.passages
redefine_tiles
refresh
end
#--------------------------------------------------------------------------
# pass
#--------------------------------------------------------------------------
def pass(tile_id)
return 0xf if tile_id == nil
return @passages[tile_id] != nil ? @passages[tile_id] & 0xf : 15
end
#--------------------------------------------------------------------------
# passable
#--------------------------------------------------------------------------
def passable(tile_id, flag = 0x01)
pass = pass(tile_id)
return true if pass & flag == 0x00
return false if pass & flag == flag
return false
end
#--------------------------------------------------------------------------
# redefine_tile
#--------------------------------------------------------------------------
def redefine_tiles
width = @map.width
height = @map.height
map = RPG::Map.new(width, height)
map.data = @map.data.dup
for x in 0...width
for y in 0...height
for level in [1, 2]
id = @map.data[x, y, level]
if id != 0
@map.data[x, y, 0] = id
@passages[@map.data[x, y, 0]] = @passages[id]
end
end
end
end
for x in 0...width
for y in 0...height
for level in [0]
tile = @map.data[x, y, level]
u = @map.data[x, y-1, level]
l = @map.data[x-1, y, level]
r = @map.data[x+1, y, level]
d = @map.data[x, y+1, level]
if !passable(tile)
map.data[x, y] = 0
else
if tile == 0
map.data[x, y, level] = 0
next
end
if pass(tile) > 0
if !passable(u) and !passable(l) and !passable(r) and !passable(d)
map.data[x, y, level] = 0
elsif !passable(u) and !passable(l) and !passable(r) and passable(d)
map.data[x, y, level] = 90
elsif !passable(u) and !passable(l) and !passable(d) and passable(r)
map.data[x, y, level] = 91
elsif !passable(u) and !passable(r) and !passable(d) and passable(l)
map.data[x, y, level] = 93
elsif !passable(l) and !passable(r) and !passable(d) and passable(u)
map.data[x, y, level] = 92
elsif !passable(u) and !passable(d) and passable(r) and passable(l)
map.data[x, y, level] = 81
elsif !passable(u) and !passable(r) and passable(d) and passable(l)
map.data[x, y, level] = 84
elsif !passable(u) and !passable(l) and passable(d) and passable(r)
map.data[x, y, level] = 82
elsif !passable(d) and !passable(r) and passable(l) and passable(u)
map.data[x, y, level] = 86
elsif !passable(d) and !passable(l) and passable(r) and passable(u)
map.data[x, y, level] = 88
elsif !passable(r) and !passable(l) and passable(d) and passable(u)
map.data[x, y, level] = 80
elsif !passable(u) and passable(d) and passable(r) and passable(l)
map.data[x, y, level] = 68
elsif !passable(d) and passable(u) and passable(r) and passable(l)
map.data[x, y, level] = 76
elsif !passable(r) and passable(d) and passable(u) and passable(l)
map.data[x, y, level] = 72
elsif !passable(l) and passable(d) and passable(u) and passable(r)
map.data[x, y, level] = 64
else
map.data[x, y, level] = 48
end
else
map.data[x, y, level] = 0
end
end
end
end
end
@map = map.dup
map = nil
end
#--------------------------------------------------------------------------
# Atualização
#--------------------------------------------------------------------------
def refresh
self.visible = false
self.bitmap = Bitmap.new(@map.width * 6, @map.height * 6)
bitmap = Bitmap.new(@map.width * 6, @map.height * 6)
rect1 = Rect.new(6, 0, 6, 6)
for y in 0...@map.height
for x in 0...@map.width
for level in [0]
tile_id = @map.data[x, y, level]
next if tile_id == 0
id = tile_id / 48 - 1
tile_id %= 48
for g in 0..3
h = 4 * tile_id + g
y1 = INDEX[h] / 6
x1 = INDEX[h] % 6
rect2 = Rect.new(x1 * 3, y1 * 3, 3, 3)
bitmap.blt(x * 6 + X[g] * 3, y * 6 + Y[g] * 3, @autotile, rect2)
end
end
end
end
d_rect = Rect.new(0, 0, @map.width * 6, @map.height * 6)
s_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.bitmap.stretch_blt(d_rect, bitmap, s_rect)
self.viewport.ox = display_x
self.viewport.oy = display_y
bitmap.clear
bitmap.dispose
end
end
#==============================================================================
# Map_Event
#------------------------------------------------------------------------------
# Exibe a posição do Héroi e dos Eventos no Mini-mapa
#==============================================================================
class Map_Event < Map_Passability
include CONFIG
#--------------------------------------------------------------------------
# Inicialização do objeto
#--------------------------------------------------------------------------
def initialize(corner = 4)
super(corner)
@dots = []
@player = Sprite.new(self.viewport)
@player.bitmap = Cache.picture(MM_CURSOR)
@player.src_rect = Rect.new(0, 0, 15, 15)
@player.z = self.z + 3
@events = {}
for key in $game_map.events.keys
event = $game_map.events[key]
next if event.list == nil
for i in 0...event.list.size
next if event.list[i].code != 108
@events[key] = Sprite.new(self.viewport)
@events[key].z = self.z + 2
param = event.list[i].parameters[0].downcase
if param.include?(MM_EVENT_OTHER)
@events[key].bitmap = Cache.picture(MM_OTHER)
elsif param.include?(MM_EVENT_ENEMY)
@events[key].bitmap = Cache.picture(MM_ENEMY)
elsif param.include?(MM_EVENT_TELEPORT)
@events[key].bitmap = Cache.picture(MM_TELEPORT)
elsif param.include?(MM_EVENT_CHEST)
@events[key].bitmap = Cache.picture(MM_CHEST)
elsif param.include?(MM_EVENT_NPC)
@events[key].bitmap = Cache.picture(MM_NPC)
elsif param.include?(MM_EVENT_SAVEPOINT)
@events[key].bitmap = Cache.picture(MM_SAVEPOINT)
end
end
end
end
#--------------------------------------------------------------------------
# dispose
#--------------------------------------------------------------------------
def dispose
@player.dispose
for event in @events.values
event.dispose
end
super
end
#--------------------------------------------------------------------------
# Atualização da tela
#--------------------------------------------------------------------------
def update
super
@player.x = $game_player.real_x * 3 / 128 - 5
@player.y = $game_player.real_y * 3 / 128 - 4
@player.src_rect.x = ($game_player.direction / 2 - 1) * 15
for key in @events.keys
event = @events[key]
mapevent = $game_map.events[key]
event.x = mapevent.real_x * 3 / 128
event.y = mapevent.real_y * 3 / 128
next if mapevent.list == nil
for list in mapevent.list
next if list.code != 108
param = list.parameters[0].downcase
if param.include?(MM_EVENT_OTHER)
event.bitmap = Cache.picture(MM_OTHER)
event.visible = true
break
elsif param.include?(MM_EVENT_ENEMY)
event.bitmap = Cache.picture(MM_ENEMY)
event.visible = true
break
elsif param.include?(MM_EVENT_TELEPORT)
event.bitmap = Cache.picture(MM_TELEPORT)
event.visible = true
break
elsif param.include?(MM_EVENT_CHEST)
event.bitmap = Cache.picture(MM_CHEST)
event.visible = true
break
elsif param.include?(MM_EVENT_NPC)
event.bitmap = Cache.picture(MM_NPC)
event.visible = true
break
elsif param.include?(MM_EVENT_SAVEPOINT)
event.bitmap = Cache.picture(MM_SAVEPOINT)
event.visible = true
break
else
event.visible = false
end
end
end
end
end
#==============================================================================
GRAFIKI
Spoiler:
Komplet jest w demie, nazewnictwo w skrypcie jakby ImageShack nazwy pozmieniał.
Komplet na ImageShack
Fajne, podoba mi się.
Jest łatwa w obsłudze i wogule git.
A jakby ktoś chciał z jeszcze troche większym tłumaczeniem to proszę bardzo:
Spoiler:
Kod:
#==============================================================================
# ReinoRPG Mini-Mapa (RPG Maker VX)
#------------------------------------------------------------------------------
# Bennamy (Amy Productions) & RTH (PRCoders)
# Version 1.0
# 09/10/2008
#------------------------------------------------------------------------------
# ~~POLSKI~~
#------------------------------------------------------------------------------
# Nie znam hiszpańskiego, ale mniej więcej objaśnię jak toto działa.
# Każdemu eventowi opisanemu określonym tagiem nadaje na mapie dany obrazek.
# Mapa składa się z kafelek - jak normalne, ale mniejsze. Typ jest tylko jeden.
# Praktycznie wszystko jest konfigurowalne.
# Nie ma ograniczeń wielkości mapy! To ważne jak dla mnie!
# Tagi dodajemy w komentarzach w zdarzeniu.
#------------------------------------------------------------------------------
# Descrição: - tu jest opis skryptu (coś na wzór zamieszczonego przez kolegę poprzednika wstępu)
#
# Este script exibe um mini-mapa em um canto da tela onde nele são mostrados
# os tiles passáveis e os tiles não passáveis (onde o personagem pode caminhar
# e onde ele não pode caminhar). No mini-mapa podem ser mostradas posições de
# certos eventos, basta colocar comentários específicos para cada evento.
# Todos os gráficos exigidos neste mini-mapa podem ser totalmente alterados.
#------------------------------------------------------------------------------
# INSTRUKCJA
# Obrazki trzeba dać do pictures (wiecie o co chodzi)
#
# Aby wywołać pokazywanie się na mapie należy włączyć przełącznik, który ustawiamy niżej, w konfiguracjii.
#
# Położenie minimapy ustawiamy za pomocą ustawionej zmiennej (jw.)
#
# 1 - lewy górny róg
# 2 - prawy górny
# 3 - lewy dolny*
# 4 - prawy dolny*
#
# *mogłem pomylić 3 z 4 i naodwrót, ale jestem prawie pewien
#
# Aby coś pojawiło się na mapie musimy podać mu w komentażu (ustawioną niżej w konfiguracjii) nazwę.
#------------------------------------------------------------------------------
# Créditos e Agradecimentos: - Nie wiem o co kaman tutaj w tej części, ale chyba są podanie twórcy
#
# Bennamy (Amy Productions) & RTH (PRCoders) - Pela criação deste script
# Selwyn (squall) - Por ter criado o script para RMXP que foi usado como base.
# Fanha Giang (aka fanha99) - Pelo método de exibir autotiles.
#
#------------------------------------------------------------------------------
# Termos de Uso e Disponibilização:
#
# Você deve inserir um link para este tópico na ReinoRPG.
# Você deve inserir um link para www.rmzine.reinorpg.com
# Você deve creditar os autores e demais envolvidos na produção do material
# Mesmo que editar este conteúdo, estas regras devem valer.
#
#==============================================================================
#--------------------------------------------------------------------------
# KONFIGURACJA tu wszystko zmieniacie
#--------------------------------------------------------------------------
module CONFIG
# Konfiguracja kontroli mapy:
MM_ACTIVATED_ID = 1 # Switch aktywujący minimapę
MM_CORNER_VAR = 1 # Zmienna przechowująca położenie
MM_OPACITY = 180 # przeźroczystość
# Konfiguracja tagów eventów: (to wpisujecie w komentarzach)
MM_EVENT_OTHER = "other" # Tag dla innych eventów
MM_EVENT_ENEMY = "enemy" # Dla wrogów
MM_EVENT_TELEPORT = "tp" # Dla przejścia
MM_EVENT_CHEST = "chest" # Dla skrzyni
MM_EVENT_NPC = "npc" # Dla NPCa
MM_EVENT_SAVEPOINT = "pousada" # Dla savepointu
end
#--------------------------------------------------------------------------
# FIM DAS CONFIGURAÇÕES
#--------------------------------------------------------------------------
#TEGO NIŻEJ NIE TYKAĆ!!!
#==============================================================================
# Scene_Map
#------------------------------------------------------------------------------
# Classe das operações nos mapas.
#==============================================================================
class Scene_Map
include CONFIG
#--------------------------------------------------------------------------
# Lista de métodos aliasados
#--------------------------------------------------------------------------
@@pre_terminate_aliased = false
unless method_defined?(:amy_mm_main)
alias amy_mm_main main
alias amy_mm_update update
alias amy_mm_perform_battle_transition perform_battle_transition
if method_defined?(:pre_terminate)
alias amy_mm_pre_terminate pre_terminate
@@pre_terminate_aliased = true
end
end
#--------------------------------------------------------------------------
# Inicialização do objeto
#--------------------------------------------------------------------------
def initialize
@corner = $game_variables[MM_CORNER_VAR]
end
#--------------------------------------------------------------------------
# Principal
#--------------------------------------------------------------------------
def main
@mini_map = Map_Event.new(@corner)
amy_mm_main
@mini_map.dispose
end
#--------------------------------------------------------------------------
# Atualização da tela
#--------------------------------------------------------------------------
def update
if $game_variables[MM_CORNER_VAR] != @corner
@corner = $game_variables[MM_CORNER_VAR]
@mini_map.corner = @corner
end
@mini_map.update
if $game_map.interpreter.running?
@mini_map.visible = false
elsif @mini_map.on?
@mini_map.visible = true
end
amy_mm_update
end
#--------------------------------------------------------------------------
# Transição
#--------------------------------------------------------------------------
def minimap_transfer
@mini_map.dispose
@mini_map = Map_Event.new(@corner)
end
#--------------------------------------------------------------------------
# Execução da transição de batalha
#--------------------------------------------------------------------------
def perform_battle_transition
@mini_map.visible = false
amy_mm_perform_battle_transition
end
#--------------------------------------------------------------------------
# Fim do processo
#--------------------------------------------------------------------------
def pre_terminate
@mini_map.visible = true
amy_mm_pre_terminate if @@pre_terminate_aliased
end
end
#==============================================================================
# Game_Player
#------------------------------------------------------------------------------
# Esta classe controla as informações do jogador. Entre elas: os veículos,
# os eventos (quando iniciá-los), o loop do mapa... etc.
# Pode ser acessada utilizando $game_player.
#==============================================================================
class Game_Player < Game_Character
unless method_defined?(:amy_mm_perform_transfer)
alias amy_mm_perform_transfer perform_transfer
end
#--------------------------------------------------------------------------
# Teletransportar
#--------------------------------------------------------------------------
def perform_transfer
amy_mm_perform_transfer
$scene.minimap_transfer
end
end
#==============================================================================
# Map_Base
#------------------------------------------------------------------------------
# Uma classe Base para mini mapas
#==============================================================================
class Map_Base < Sprite
include CONFIG
#--------------------------------------------------------------------------
# Constantes e Instâncias
#--------------------------------------------------------------------------
PMP_VERSION = 7
attr_reader :event
attr_reader :corner
#--------------------------------------------------------------------------
# Inicialização do objeto
#--------------------------------------------------------------------------
def initialize(corner)
super(Viewport.new(16, 16, width, height))
viewport.z = 8000
@border = Sprite.new
@border.x = viewport.rect.x - 6
@border.y = viewport.rect.y - 6
@border.z = viewport.z - 1
@border.bitmap = Cache.picture(MM_MAP_BACK)
self.visible = on?
self.opacity = MM_OPACITY
@corner = -1
self.corner = corner
self.visible = on?
end
#--------------------------------------------------------------------------
# Corner
#--------------------------------------------------------------------------
def corner=(valor)
return if @corner == valor
@corner = valor.to_i
case @corner
when 2
self.x = 544 - width - 16
self.y = 16
when 3
self.x = 16
self.y = 416 - height - 16
when 4
self.x = 544 - width - 16
self.y = 416 - height - 16
else
self.x = 16
self.y = 16
end
end
#--------------------------------------------------------------------------
# dispose
#--------------------------------------------------------------------------
def dispose
@border.dispose
super
end
#--------------------------------------------------------------------------
# x=
#--------------------------------------------------------------------------
def x=(x)
self.viewport.rect.x = x
@border.x = x - 6
end
#--------------------------------------------------------------------------
# y=
#--------------------------------------------------------------------------
def y=(y)
self.viewport.rect.y = y
@border.y = y - 6
end
#--------------------------------------------------------------------------
# visible=
#--------------------------------------------------------------------------
def visible=(bool)
super
self.viewport.visible = bool
@border.visible = bool
end
#--------------------------------------------------------------------------
# minimap_on?
#--------------------------------------------------------------------------
def on?
return $game_switches[MM_ACTIVATED_ID]
end
#--------------------------------------------------------------------------
# Atualização da tela
#--------------------------------------------------------------------------
def update
super
self.visible = on?
if viewport.ox < display_x
viewport.ox += 1
elsif viewport.ox > display_x
viewport.ox -= 1
end
if viewport.oy < display_y
viewport.oy += 1
elsif viewport.oy > display_y
viewport.oy -= 1
end
end
#--------------------------------------------------------------------------
# largura
#--------------------------------------------------------------------------
def width
return 102
end
#--------------------------------------------------------------------------
# altura
#--------------------------------------------------------------------------
def height
return 78
end
#--------------------------------------------------------------------------
# display_x
#--------------------------------------------------------------------------
def display_x
return $game_map.display_x * 3 / 128
end
#--------------------------------------------------------------------------
# display_y
#--------------------------------------------------------------------------
def display_y
return $game_map.display_y * 3 / 128
end
end
#==============================================================================
# Map_Passability
#------------------------------------------------------------------------------
# Exibe o Mini-mapa
# Agradecimentos para Fanha Giang (aka fanha99) pelo método de exibir autotiles
#==============================================================================
class Map_Passability < Map_Base
include CONFIG
#--------------------------------------------------------------------------
# Constantes
#--------------------------------------------------------------------------
INDEX =
[
26, 27, 32, 33, 4, 27, 32, 33, 26, 5, 32, 33, 4, 5, 32, 33,
26, 27, 32, 11, 4, 27, 32, 11, 26, 5, 32, 11, 4, 5, 32, 11,
26, 27, 10, 33, 4, 27, 10, 33, 26, 5, 10, 33, 4, 5, 10, 33,
26, 27, 10, 11, 4, 27, 10, 11, 26, 5, 10, 11, 4, 5, 10, 11,
24, 25, 30, 31, 24, 5, 30, 31, 24, 25, 30, 11, 24, 5, 30, 11,
14, 15, 20, 21, 14, 15, 20, 11, 14, 15, 10, 21, 14, 15, 10, 11,
28, 29, 34, 35, 28, 29, 10, 35, 4, 29, 34, 35, 4, 29, 10, 35,
38, 39, 44, 45, 4, 39, 44, 45, 38, 5, 44, 45, 4, 5, 44, 45,
24, 29, 30, 35, 14, 15, 44, 45, 12, 13, 18, 19, 12, 13, 18, 11,
16, 17, 22, 23, 16, 17, 10, 23, 40, 41, 46, 47, 4, 41, 46, 47,
36, 37, 42, 43, 36, 5, 42, 43, 12, 17, 18, 23, 12, 13, 42, 43,
36, 41, 42, 47, 16, 17, 46, 47, 12, 17, 42, 47, 0, 1, 6, 7
]
X = [0, 1, 0, 1]
Y = [0, 0, 1, 1]
#--------------------------------------------------------------------------
# Inicialização do objeto
#--------------------------------------------------------------------------
def initialize(corner)
super(corner)
@autotile = Cache.picture(MM_TILES)
setup()
end
#--------------------------------------------------------------------------
# setup
#--------------------------------------------------------------------------
def setup()
@map = load_data(sprintf("Data/Map%03d.rvdata", $game_map.map_id))
@passages = $data_system.passages
redefine_tiles
refresh
end
#--------------------------------------------------------------------------
# pass
#--------------------------------------------------------------------------
def pass(tile_id)
return 0xf if tile_id == nil
return @passages[tile_id] != nil ? @passages[tile_id] & 0xf : 15
end
#--------------------------------------------------------------------------
# passable
#--------------------------------------------------------------------------
def passable(tile_id, flag = 0x01)
pass = pass(tile_id)
return true if pass & flag == 0x00
return false if pass & flag == flag
return false
end
#--------------------------------------------------------------------------
# redefine_tile
#--------------------------------------------------------------------------
def redefine_tiles
width = @map.width
height = @map.height
map = RPG::Map.new(width, height)
map.data = @map.data.dup
for x in 0...width
for y in 0...height
for level in [1, 2]
id = @map.data[x, y, level]
if id != 0
@map.data[x, y, 0] = id
@passages[@map.data[x, y, 0]] = @passages[id]
end
end
end
end
for x in 0...width
for y in 0...height
for level in [0]
tile = @map.data[x, y, level]
u = @map.data[x, y-1, level]
l = @map.data[x-1, y, level]
r = @map.data[x+1, y, level]
d = @map.data[x, y+1, level]
if !passable(tile)
map.data[x, y] = 0
else
if tile == 0
map.data[x, y, level] = 0
next
end
if pass(tile) > 0
if !passable(u) and !passable(l) and !passable(r) and !passable(d)
map.data[x, y, level] = 0
elsif !passable(u) and !passable(l) and !passable(r) and passable(d)
map.data[x, y, level] = 90
elsif !passable(u) and !passable(l) and !passable(d) and passable(r)
map.data[x, y, level] = 91
elsif !passable(u) and !passable(r) and !passable(d) and passable(l)
map.data[x, y, level] = 93
elsif !passable(l) and !passable(r) and !passable(d) and passable(u)
map.data[x, y, level] = 92
elsif !passable(u) and !passable(d) and passable(r) and passable(l)
map.data[x, y, level] = 81
elsif !passable(u) and !passable(r) and passable(d) and passable(l)
map.data[x, y, level] = 84
elsif !passable(u) and !passable(l) and passable(d) and passable(r)
map.data[x, y, level] = 82
elsif !passable(d) and !passable(r) and passable(l) and passable(u)
map.data[x, y, level] = 86
elsif !passable(d) and !passable(l) and passable(r) and passable(u)
map.data[x, y, level] = 88
elsif !passable(r) and !passable(l) and passable(d) and passable(u)
map.data[x, y, level] = 80
elsif !passable(u) and passable(d) and passable(r) and passable(l)
map.data[x, y, level] = 68
elsif !passable(d) and passable(u) and passable(r) and passable(l)
map.data[x, y, level] = 76
elsif !passable(r) and passable(d) and passable(u) and passable(l)
map.data[x, y, level] = 72
elsif !passable(l) and passable(d) and passable(u) and passable(r)
map.data[x, y, level] = 64
else
map.data[x, y, level] = 48
end
else
map.data[x, y, level] = 0
end
end
end
end
end
@map = map.dup
map = nil
end
#--------------------------------------------------------------------------
# Atualização
#--------------------------------------------------------------------------
def refresh
self.visible = false
self.bitmap = Bitmap.new(@map.width * 6, @map.height * 6)
bitmap = Bitmap.new(@map.width * 6, @map.height * 6)
rect1 = Rect.new(6, 0, 6, 6)
for y in 0...@map.height
for x in 0...@map.width
for level in [0]
tile_id = @map.data[x, y, level]
next if tile_id == 0
id = tile_id / 48 - 1
tile_id %= 48
for g in 0..3
h = 4 * tile_id + g
y1 = INDEX[h] / 6
x1 = INDEX[h] % 6
rect2 = Rect.new(x1 * 3, y1 * 3, 3, 3)
bitmap.blt(x * 6 + X[g] * 3, y * 6 + Y[g] * 3, @autotile, rect2)
end
end
end
end
d_rect = Rect.new(0, 0, @map.width * 6, @map.height * 6)
s_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.bitmap.stretch_blt(d_rect, bitmap, s_rect)
self.viewport.ox = display_x
self.viewport.oy = display_y
bitmap.clear
bitmap.dispose
end
end
#==============================================================================
# Map_Event
#------------------------------------------------------------------------------
# Exibe a posição do Héroi e dos Eventos no Mini-mapa
#==============================================================================
class Map_Event < Map_Passability
include CONFIG
#--------------------------------------------------------------------------
# Inicialização do objeto
#--------------------------------------------------------------------------
def initialize(corner = 4)
super(corner)
@dots = []
@player = Sprite.new(self.viewport)
@player.bitmap = Cache.picture(MM_CURSOR)
@player.src_rect = Rect.new(0, 0, 15, 15)
@player.z = self.z + 3
@events = {}
for key in $game_map.events.keys
event = $game_map.events[key]
next if event.list == nil
for i in 0...event.list.size
next if event.list[i].code != 108
@events[key] = Sprite.new(self.viewport)
@events[key].z = self.z + 2
param = event.list[i].parameters[0].downcase
if param.include?(MM_EVENT_OTHER)
@events[key].bitmap = Cache.picture(MM_OTHER)
elsif param.include?(MM_EVENT_ENEMY)
@events[key].bitmap = Cache.picture(MM_ENEMY)
elsif param.include?(MM_EVENT_TELEPORT)
@events[key].bitmap = Cache.picture(MM_TELEPORT)
elsif param.include?(MM_EVENT_CHEST)
@events[key].bitmap = Cache.picture(MM_CHEST)
elsif param.include?(MM_EVENT_NPC)
@events[key].bitmap = Cache.picture(MM_NPC)
elsif param.include?(MM_EVENT_SAVEPOINT)
@events[key].bitmap = Cache.picture(MM_SAVEPOINT)
end
end
end
end
#--------------------------------------------------------------------------
# dispose
#--------------------------------------------------------------------------
def dispose
@player.dispose
for event in @events.values
event.dispose
end
super
end
#--------------------------------------------------------------------------
# Atualização da tela
#--------------------------------------------------------------------------
def update
super
@player.x = $game_player.real_x * 3 / 128 - 5
@player.y = $game_player.real_y * 3 / 128 - 4
@player.src_rect.x = ($game_player.direction / 2 - 1) * 15
for key in @events.keys
event = @events[key]
mapevent = $game_map.events[key]
event.x = mapevent.real_x * 3 / 128
event.y = mapevent.real_y * 3 / 128
next if mapevent.list == nil
for list in mapevent.list
next if list.code != 108
param = list.parameters[0].downcase
if param.include?(MM_EVENT_OTHER)
event.bitmap = Cache.picture(MM_OTHER)
event.visible = true
break
elsif param.include?(MM_EVENT_ENEMY)
event.bitmap = Cache.picture(MM_ENEMY)
event.visible = true
break
elsif param.include?(MM_EVENT_TELEPORT)
event.bitmap = Cache.picture(MM_TELEPORT)
event.visible = true
break
elsif param.include?(MM_EVENT_CHEST)
event.bitmap = Cache.picture(MM_CHEST)
event.visible = true
break
elsif param.include?(MM_EVENT_NPC)
event.bitmap = Cache.picture(MM_NPC)
event.visible = true
break
elsif param.include?(MM_EVENT_SAVEPOINT)
event.bitmap = Cache.picture(MM_SAVEPOINT)
event.visible = true
break
else
event.visible = false
end
end
end
end
end
#=============================================================================
Polecam ten skrypt, jest naprawdę fajny.
________________________ Obecny projekt - Chwilowo brak
Hmm... Ikonki są standardowo 8x8, jednak ja spróbowałem dać 12x12 i... Działa :)
Tylko jeden błąd - gdy przechodzi się obok, to z jednej strony można całkowicie najść na ową ikonę, mimo, że na mapie jest to event z ustawioną blokadą - obrazek taki jest centrowany do rogu, nie do środka. Byłbym wdzięczny za pomoc, co zmienić w skrypcie, by większe grafiki działały bezbłędnie.
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."
ciekawa mapka bardzo ciekawa, podobna do minimapki tyle że znacznie ciekawsza.
________________________ Pracuję nad 2 częścią gry Ostatnia Powieść
Fabuła : Niezła ( jeżeli lubicie Assassin's Creed )
Skrypty: Sporo przyznam się.
Walki: Dużo i to trudnych!
Misje: Wiele głównych i pobocznych
Muzyka: Ciekawa, wpadająca w ucho
Graficzki: Kilka własnych i kilka pożyczonych
Wzorowanie się: Assassin's Creed, Final Fantasy
# Konfiguracja tagów eventów:
MM_EVENT_OTHER = "other" # Tag dla innych eventów
MM_EVENT_ENEMY = "enemy" # Dla wrogów
MM_EVENT_TELEPORT = "tp" # Dla przejścia
MM_EVENT_CHEST = "chest" # Dla skrzyni
MM_EVENT_NPC = "npc" # Dla NPCa
MM_EVENT_SAVEPOINT = "save" # Dla savepointu
end
Kod:
MM_ACTIVATED_ID = 1 # Switch aktywujący minimapę
Ta linijka to numer switcha aktywującego. Włącz go w zdarzeniu po prostu :)
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."
# Konfiguracja tagów eventów:
MM_EVENT_OTHER = "other" # Tag dla innych eventów
MM_EVENT_ENEMY = "enemy" # Dla wrogów
MM_EVENT_TELEPORT = "tp" # Dla przejścia
MM_EVENT_CHEST = "chest" # Dla skrzyni
MM_EVENT_NPC = "npc" # Dla NPCa
MM_EVENT_SAVEPOINT = "save" # Dla savepointu
end
Kod:
MM_ACTIVATED_ID = 1 # Switch aktywujący minimapę
Ta linijka to numer switcha aktywującego. Włącz go w zdarzeniu po prostu :)
nie umiem !!!
Jestem zielony w tych sprawach
________________________ DSJ 4 - Najlepsza gra o skokach narciarskich!!!
Ekhh... Wiesz jak ustawić zdarzenie? Bo bez podstaw obsługi niewiele zdziałamy...
W zdarzeniu, w polu po prawej (duże, białe) klikasz dwa razy i wybierasz spośród komend "przełącznik" vel. "switch", zależnie od wersji językowej. Następnie wybierasz przełącznik nr. 1 na ON. Klikasz ok.
Dalej w oknie zdarzenia masz wybór uruchomienia go - na wciśnięcie przycisku, etc. Wybierasz równoległe/paralell. Klikasz ok. Gotowe!
Ach... Chcesz włączać ją przyciskiem!
Musisz zastosować skrypt rozszerzający klawiaturę, a potem ustawić w typowym zdarzeniu warunek, jeśli naciśnięte jest "m" włącz przełącznik minimapy, jeśli jest włączony i naciśnięte jest "m" wyłącz przełącznik minimapy.
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum