Legendary Maker's
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Script de 8 Direções , Com Sprites do Char na Diagonal !

Ir para baixo

Scripts Script de 8 Direções , Com Sprites do Char na Diagonal !

Mensagem por KamauX Sáb maio 15, 2010 11:59 am

Eaew Galera ! Este é o Melhor Script de 8 Movimentos que eu já vi ! e Ainda tem as Sprites do Char quando fica reto ou na diagonal !
Versão Traduzida ( Por Mim ) :
Código:
#======================================================================
# 8-Direções Characterset versão. 1.01
# Traduzido por Lucas ( KamauX )
#Script Feito por ParaDog
#http://2d6.parasite.jp/
#------------------------------------------------------------------------------
# Adcional movimento "Diagonal" que agora é possivel , empurrando as combinhações do
# controle vertical e horizontal (acima , à esquerda ,etc) simultaneamente.
#
# Charsets Adcionais para o movimento em 8 Direções devem ser armazenados dentro
# da pasta "Graphics/Characters" , assim como o characterset regular.
#
# Nome do novo movimento diagonal charactersets o mesmo que os regulares,
# mas como um novo '_quarter' extensão. Como tal , você teria o nome Primeiro
# characterset: 001-Fighter01_quarter.
#------------------------------------------------------------------------------
# Notas adicionais:
# Este sistema pode ser utilizado com o sistema "Dash Characterset Editor", mas por favor
# Coloque este script "abaixo" o primeiro plano mencionado Dash script para que ele funcione.
#
# Como você pode combinar os dois scripts (e Dash 8-direcional), você também pode usar
# charactersets que mostram ação correndo na diagonal, também são armazenados no mesmo
# "Graphics / Characters" a pasta.
#
# Nomeação dos novos elementos gráficos que exigem a inclusão de ambos "_dash e os
#extensões # '_quarter "como mostrado aqui: 001 Fighter01_dash_quarter.
#==============================================================================

#==============================================================================
# [img]/users/1513/11/20/52/smiles/466602.gif[/img] Game_Player
#------------------------------------------------- -----------------------------
# Esta classe lida com o jogador. Suas funções incluem evento a partir
# determinantes e deslocação no mapa. Consulte "$ game_player" para o
# Instância dessa classe.
#================================================= =============================

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Atualização Frame
#--------------------------------------------------------------------------
alias update_para_quarter update
def update
update_para_quarter
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# If the direction button is pushed, move the player in that direction
case Input.dir8
when 1 # Move Lower Left
move_lower_left
when 3 # Move Lower Right
move_lower_right
when 7 # Move Upper Left
move_upper_left
when 9 # Move Upper Right
move_upper_right
end
end
end
end

#==============================================================================
# [img]/users/1513/11/20/52/smiles/466602.gif[/img] Sprite_Character
#------------------------------------------------------------------------------
# Este sprite é usado para exibir o character.It observa os Game_Character
# muda de classe e automaticamente sprite condições.
#==============================================================================

class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_para_quarter update
def update
update_para_quarter
if @tile_id == 0
if (@character.direction - 2) % 2 == 1
# Checking the presence of the diagonal charset
if quarter_graphic_exist?(@character)
# Set the diagonal charset
if character.dash_on and dash_quarter_graphic_exist?(@character)
@character_name = @character.character_name + "_dash_quarter"
else
@character_name = @character.character_name + "_quarter"
end
self.bitmap = RPG::Cache.character(@character_name,
@character.character_hue)
# Acquire direction
case @character.direction
when 1
n = 0
when 3
n = 2
when 7
n = 1
when 9
n = 3
end
else
@character.direction = @character.sub_direction
# When the diagonal charset does not exist, direction
n = (@character.direction - 2) / 2
end
# Set original transfer rectangle
sx = @character.pattern * @cw
sy = n * @ch
self.src_rect.set(sx, sy, @cw, @ch)
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
# Set original transfer rectangle
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
end
end
#--------------------------------------------------------------------------
# *Charset Diagonal?
#--------------------------------------------------------------------------
def quarter_graphic_exist?(character)
# Reading check
begin
RPG::Cache.character(character.character_name.to_s + "_quarter", character.character_hue)
rescue
return false
end
return true
end
#--------------------------------------------------------------------------
# * Dashing Charset Diagonal?
#--------------------------------------------------------------------------
def dash_quarter_graphic_exist?(character)
# Reading check
begin
RPG::Cache.character(character.character_name.to_s + "_dash_quarter", character.character_hue)
rescue
return false
end
return true
end
end

#==============================================================================
# [img]/users/1513/11/20/52/smiles/466602.gif[/img] Game_Character
#------------------------------------------------------------------------------
# Esta classe lida com os personagens. É utilizado como uma superclasse para a
# Game_Player e classes Game_Event.
#==============================================================================

class Game_Character
#--------------------------------------------------------------------------
# * Instância Variáveis Públicas
#--------------------------------------------------------------------------
attr_accessor :direction # direction
attr_accessor :sub_direction # sub_direction
#--------------------------------------------------------------------------
# * Move Inferior Esquerdo
#--------------------------------------------------------------------------
def move_lower_left
# If no direction fix
unless @direction_fix
@sub_direction = @direction
@direction = 1
# Face left if facing right, and face down if facing up
@sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 8 ? 2 : @sub_direction)
end
# When a down to left or a left to down course is passable
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
(passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
# Update coordinates
@x -= 1
@y += 1
# Increase steps
increase_steps
end
end
#--------------------------------------------------------------------------
# * Move Inferior Direito
#--------------------------------------------------------------------------
def move_lower_right
# If no direction fix
unless @direction_fix
@sub_direction = @direction
@direction = 3
# Face right if facing left, and face down if facing up
@sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 8 ? 2 : @sub_direction)
end
# When a down to right or a right to down course is passable
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
# Update coordinates
@x += 1
@y += 1
# Increase steps
increase_steps
end
end
#--------------------------------------------------------------------------
# * Move Superior Esquerdo
#--------------------------------------------------------------------------
def move_upper_left
# If no direction fix
unless @direction_fix
@sub_direction = @direction
@direction = 7
# Face left if facing right, and face up if facing down
@sub_direction = (@sub_direction == 6 ? 4 : @sub_direction == 2 ? 8 : @sub_direction)
end
# When an up to left or a left to up course is passable
if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
(passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
# Update coordinates
@x -= 1
@y -= 1
# Increase steps
increase_steps
end
end
#--------------------------------------------------------------------------
# * Mover para a Direita superior
#--------------------------------------------------------------------------
def move_upper_right
# If no direction fix
unless @direction_fix
@sub_direction = @direction
@direction = 9
# Face right if facing left, and face up if facing down
@sub_direction = (@sub_direction == 4 ? 6 : @sub_direction == 2 ? 8 : @sub_direction)
end
# When an up to right or a right to up course is passable
if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))
# Update coordinates
@x += 1
@y -= 1
# Increase steps
increase_steps
end
end
#--------------------------------------------------------------------------
# * Dash
#--------------------------------------------------------------------------
def dash_on
if @dash_on != nil
return @dash_on
else
return false
end
end
end
P: Necessita da IMG do char na Diagonal ?
R: Sim , veja Abaixo .
IMG :
Script de 8 Direções , Com Sprites do Char na Diagonal ! 001fighter01quarter
Screens
Script de 8 Direções , Com Sprites do Char na Diagonal ! Screen5h

Script de 8 Direções , Com Sprites do Char na Diagonal ! Screen4bc

Script de 8 Direções , Com Sprites do Char na Diagonal ! Screen3u

Script de 8 Direções , Com Sprites do Char na Diagonal ! Screen2qx

Script de 8 Direções , Com Sprites do Char na Diagonal ! Screen1hp
As Instruções estão no Script , mais ensinarei como Usar o SCRIPT .
1° - Vá em Graphics / Characters e importe o char em ANEXO ( SEM MUDAR O NOME DELE ! ) Depois vá no EDITOR DE SCRIPTS , clique com o Botão direito do Mouse em Main ( ÚLTIMO SCRIPT DA LISTA ) e clique em INSERIR , depois irá criar um novo script , ponha um nome nele ( NÃO É OBRIGATÓRIO ) depois Cole o Script , se quiser pôr outros chars com este movimento , veja nas Instruções do SCRIPT , Teste seu Projeto e Seja Feliz Script de 8 Direções , Com Sprites do Char na Diagonal ! 27863 .
WP's : A mim Por Traduzir e a ParaDog por Criar o SCRIPT .
Link do Tópico do Script Original.
KamauX
KamauX
Novato
Novato

Mensagens : 14
LM Pontos : 94
Up's : 15
Data de inscrição : 09/04/2010
Idade : 25

Ficha Maker
Premios:

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos