Como configurar o script:
1) No script [ND] Sprite_Character, procure por:- Código:
#--------------------------------------------------------------------------
# * Inicialização dos objetos
#--------------------------------------------------------------------------
def init_basic
@equip_sprites = []
@equip_names = []
end
- Código:
#--------------------------------------------------------------------------
# * Inicialização dos objetos
#--------------------------------------------------------------------------
def init_basic
@equip_sprites = []
@equip_names = []
@blink_time = 0
@blink = false
end
- Código:
def update_bitmap
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# Caso o valor do ID do tile seja válido
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# Caso o valor do ID do tile seja inválido
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
self.visible = (not @character.transparent)
# Se o gráfico for de um herói
if @tile_id == 0
# Definir uma transferência regular
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
self.opacity = $game_party.actors[0].target == @character ? 150 : @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
- Código:
#--------------------------------------------------------------------------
# * Atualização do gráfico
#--------------------------------------------------------------------------
def update_bitmap
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
@blink = (@character_name.size > 5 and @character_name[@character_name.size - 6, @character_name.size] == '_BLINK')
# Impede que os personagens pisquem os olhos ao mesmo tempo
@blink_time = rand(110)
# Caso o valor do ID do tile seja válido
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# Caso o valor do ID do tile seja inválido
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
bw = @blink ? 8 : 4
@cw = bitmap.width / bw
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
self.visible = (not @character.transparent)
if @blink
@blink_time += 1
@blink_time = 0 if @blink_time >= 120
end
# Se o gráfico for de um herói
if @tile_id == 0
bx = @blink_time > 110 ? @cw * 4 : 0
# Definir uma transferência regular
sx = @character.pattern * @cw + bx
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
self.opacity = $game_party.actors[0].target == @character ? 150 : @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
Como usar:
1) Crie um personagem com 8 frames. As 4 primeiras frames devem representar o jogador com os olhos abertos e as 4 últimas devem representar o jogador com os olhos fechados.2) Escreva _BLINK no fim do nome do arquivo. Exemplo: 001-Fighter01_BLINK
Imagem de exemplo:
Créditos:
Valentine
Última edição por Valentine em Sáb Set 02, 2017 10:37 pm, editado 6 vez(es)