Últimos temas
» Script de menupor maxi Jue 04 Dic 2014, 1:44 pm
» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm
» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am
» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am
» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm
» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm
» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am
» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am
» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am
» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am
» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am
» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm
» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am
» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am
» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm
¿Quién está en línea?
En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado Ninguno
El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm
Sistema de Movimiento Mejorado
4 participantes
RPG maker VX :: Scripts ::
Página 1 de 1.
Sistema de Movimiento Mejorado
Hola A todos les traigo un Sistema de Mov. Mejorado: ¿Que quiere decir? que ahora si uds apretan un poquito alguna flechita de direccion se movera menos que de costumbre: Bue Aqui el Script:
- Código:
#==============================================================================
# ■ Creado Por Maxinm. -------SISTEMA MEJORADO DE MOVIMIENTO-----------
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
attr_accessor :hp # HP
attr_accessor :def # 防御力
attr_accessor :undead # 無敵
attr_accessor :real_x # マップ X 座標 (実座標 * 256)
attr_accessor :real_y # マップ Y 座標 (実座標 * 256)
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
alias bulletActionCharacter_initialize initialize
def initialize
bulletActionCharacter_initialize
@hp = 1
@def = 0
@undead = false
@xv = 0
@yv = 0
@touch_flag = -1
@move_count = 0
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def moving?
return @move_count > 0
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_left(turn_ok = true)
turn_left
d = 2 ** @move_speed
@xv = 0 - d
@move_count = 256 / d
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_right(turn_ok = true)
turn_right
d = 2 ** @move_speed
@xv = d
@move_count = 256 / d
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_up(turn_ok = true)
turn_up
d = 2 ** @move_speed
@yv = 0 - d
@move_count = 256 / d
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_down(turn_ok = true)
turn_down
d = 2 ** @move_speed
@yv = d
@move_count = 256 / d
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_lower_left
turn_left
d = 2 ** @move_speed
@xv = 0 - d
@yv = d
@move_count = 256 / d
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_lower_right
turn_right
d = 2 ** @move_speed
@xv = d
@yv = d
@move_count = 256 / d
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_upper_left
turn_left
d = 2 ** @move_speed
@xv = 0 - d
@yv = 0 - d
@move_count = 256 / d
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_upper_right
turn_right
d = 2 ** @move_speed
@xv = d
@yv = 0 - d
@move_count = 256 / d
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def map_passable?(mode)
left_x = @real_x + 32 >> 8 # 4 <<3
right_x = @real_x + 224 >> 8 # 28 << 3
up_y = @real_y + 16 >> 8 # 2 << 3
down_y = @real_y + 224 >> 8 # 28 << 3
if mode == 0
if @xv > 0
return false unless $game_map.passable?(right_x, up_y)
return false unless $game_map.passable?(right_x, down_y)
else
return false unless $game_map.passable?(left_x, up_y)
return false unless $game_map.passable?(left_x, down_y)
end
else
if @yv > 0
return false unless $game_map.passable?(left_x, down_y)
return false unless $game_map.passable?(right_x, down_y)
else
return false unless $game_map.passable?(left_x, up_y)
return false unless $game_map.passable?(right_x, up_y)
end
end
return true
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def passable?(mode = 0)
return false unless map_passable?(mode)
return true if @through or debug_through?
return false if collide_with_characters?(x, y, mode)
return true
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def hit_pos?(real_x, real_y)
if @real_x + 32 < real_x + 224 && real_x + 32 < @real_x + 224 # 4 << 3, 28 << 3
if @real_y < real_y + 224 && real_y < @real_y + 224
return true
end
end
return false
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def collide_with_characters?(x, y, mode)
for event in $game_map.events.values
next if event.through
next if event.id == self.id
if hit_pos?(event.real_x, event.real_y)
@touch_flag = event.id
return true
end
end
if @priority_type == 1
unless self.is_a?(Game_Player)
if hit_pos?($game_player.real_x, $game_player.real_y)
@touch_flag = 0
return true
end
end
end
return false
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update
update_x
update_y
if moving? # 移動中
update_move_count
if @walk_anime
@anime_count += 1.5
elsif @step_anime
@anime_count += 1
end
else # 停止中
if @step_anime
@anime_count += 1
elsif @pattern != @original_pattern
@anime_count += 1.5
end
@stop_count += 1 unless @locked
end
if @wait_count > 0
@wait_count -= 1
elsif @move_route_forcing
move_type_custom
elsif not @locked
update_self_movement
end
update_animation
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_move_count
@move_count -= 1
if @move_count == 0
@xv = 0
@yv = 0
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_x
return if @xv == 0
last_x = @real_x
@real_x += @xv
@x = @real_x >> 8
@touch_flag = -1
unless passable?(0)
@real_x = last_x
@x = @real_x >> 8
@xv = 0
check_event_trigger_touch()
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_y
return if @yv == 0
last_y = @real_y
@real_y += @yv
@y = @real_y >> 8
@touch_flag = -1
unless passable?(1)
@real_y = last_y
@y = @real_y >> 8
@yv = 0
check_event_trigger_touch()
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def check_event_trigger_touch()
end
end
#==============================================================================
# ■ Game_Player
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
alias bulletActionPlayer_initialize initialize
def initialize
bulletActionPlayer_initialize
@shot_angle = Math::PI / 2
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def map_passable?(mode)
super(mode)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def check_event_trigger_there(triggers)
return false if $game_map.interpreter.running?
result = false
if @direction == 4 or @direction == 6
front_x = @real_x
front_x -= 64 if @direction == 4 # 8 << 3
front_x += 320 if @direction == 6 # 40 << 3
front_y = @real_y + 128
else
front_y = @real_y
front_y -= 64 if @direction == 8 # 8 << 3
front_y += 320 if @direction == 2 # 40 << 3
front_x = @real_x + 128
end
for event in $game_map.events.values
if event.real_x < front_x && event.real_x + 256 > front_x # 32 << 3
if event.real_y < front_y && event.real_y + 256 > front_y # 32 << 3
if triggers.include?(event.trigger)
event.start
result = true
end
end
end
end
return result
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def check_touch_event
return false
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def check_action_event
return false if in_airship?
return check_event_trigger_there([0,1,2])
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def movable?
return false if @move_route_forcing
return false if @vehicle_getting_on
return false if @vehicle_getting_off
return false if $game_message.visible
return false if in_airship? and not $game_map.airship.movable?
return true
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_x(max_speed)
max_speed *= 2 if dash?
@xv = [@xv + 2, max_speed].min if @xv < max_speed
@xv = [@xv - 2, max_speed].max if @xv > max_speed
@move_count = 1
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_y(max_speed)
max_speed *= 2 if dash?
@yv = [@yv + 2, max_speed].min if @yv < max_speed
@yv = [@yv - 2, max_speed].max if @yv > max_speed
@move_count = 1
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_left(turn_ok = true)
turn_left
@shot_angle = Math::PI
move_x(-16)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_right(turn_ok = true)
turn_right
@shot_angle = 0.0
move_x(16)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_up(turn_ok = true)
turn_up
@shot_angle = Math::PI * 3 / 2
move_y(-16)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_down(turn_ok = true)
turn_down
@shot_angle = Math::PI / 2
move_y(16)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_lower_left
turn_left
@shot_angle = Math::PI * 3 / 4
move_x(-12)
move_y(12)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_lower_right
turn_right
@shot_angle = Math::PI / 4
move_x(12)
move_y(12)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_upper_left
turn_left
@shot_angle = Math::PI * 5 / 4
move_x(-12)
move_y(-12)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_upper_right
turn_right
@shot_angle = Math::PI * 7 / 4
move_x(12)
move_y(-12)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_move_count
@move_count -= 1
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_x
for event in $game_map.events.values
next if event.trigger != 1
next if (@real_x - event.real_x).abs + (@real_y - event.real_y).abs > 64
event.start
break
end
unless (Input.press?(Input::LEFT) or Input.press?(Input::RIGHT))
@xv = [@xv + 1, 0].min if @xv < 0
@xv = [@xv - 1, 0].max if @xv > 0
end
last_x = @real_x
@real_x += @xv
@x = @real_x >> 8
@touch_flag = -1
unless passable?(0)
@real_x = last_x
@x = @real_x >> 8
@xv = 0
check_event_trigger_touch()
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def update_y
unless (Input.press?(Input::UP) or Input.press?(Input::DOWN))
@yv = [@yv + 1, 0].min if @yv < 0
@yv = [@yv - 1, 0].max if @yv > 0
end
last_y = @real_y
@real_y += @yv
@y = @real_y >> 8
@touch_flag = -1
unless passable?(1)
@real_y = last_y
@y = @real_y >> 8
@yv = 0
check_event_trigger_touch()
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def shot
$game_map.screen.shot_bullet(@real_x + 128, @real_y + 128,
@shot_angle, 64, 1, 30, 0)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def move_by_input
return unless movable?
return if $game_map.interpreter.running?
if Input.press?(Input::LEFT)
if Input.press?(Input::UP)
move_upper_left
elsif Input.press?(Input::DOWN)
move_lower_left
else
move_left
end
elsif Input.press?(Input::RIGHT)
if Input.press?(Input::UP)
move_upper_right
elsif Input.press?(Input::DOWN)
move_lower_right
else
move_right
end
elsif Input.press?(Input::UP)
move_up
elsif Input.press?(Input::DOWN)
move_down
end
shot if Input.trigger?(Input::X)
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def check_event_trigger_touch
return if $game_map.interpreter.running?
for event in $game_map.events.values
next if event.id != @touch_flag
if event.trigger == 2
event.start
break
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def get_angle(x, y)
angle = Math.atan2( $game_player.real_y + 128 - y, $game_player.real_x + 128 - x )
return angle
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def damage(atk)
for actor in $game_party.members
d = atk - (TACT::Option::PLAYER_DEF_MODE ? actor.def : 0)
d = 1 if d < 1
if TACT::Option::UNDEAD_MODE and actor.hp <= d
d = actor.hp - 1
end
actor.hp -= d
end
@damaged = true
@animation_id = TACT::Option::HIT_ANIME_ID
if $game_party.all_dead?
if TACT::Option::DEAD_EVENT_ID > 0
$game_temp.common_event_id = TACT::Option::DEAD_EVENT_ID
end
end
end
end
maxi- Moderador
-
28
908
1673
156
Extras
Sobre mí:: ¿Necesitas Una Mano en el Maker VX o VX ACE? ¡Ponte en Contacto Conmigo! :)
Re: Sistema de Movimiento Mejorado
ya lo probe esta bueno lo que no me gusta esque si vas rapido y de repente frenas como que patina el personaje
cleofas2- 50
-
38
52
51
0
Re: Sistema de Movimiento Mejorado
cleofas2 escribió:ya lo probe esta bueno lo que no me gusta esque si vas rapido y de repente frenas como que patina el personaje
sip concuerdo contigo eso no me gusta
me daba error probe con todo y nada borre la linea que me daba error y ya esta bien
TigreX- 500
-
26
1214
1679
105
Extras
Sobre mí::
Re: Sistema de Movimiento Mejorado
Tiene un gran problema esta script: no te deja usar los eventos que pones (como un cofre o una puerta)
ProyectoRPG- 30
-
34
45
50
5
Re: Sistema de Movimiento Mejorado
¿A no? No me di cuenta sorry :(, Aunque lo de patinar... HAHA es verdad, A mi me encanta. XD
maxi- Moderador
-
28
908
1673
156
Extras
Sobre mí:: ¿Necesitas Una Mano en el Maker VX o VX ACE? ¡Ponte en Contacto Conmigo! :)
Temas similares
» VideoShoot 1.1 Mejorado ^^
» movimiento en moustro
» inventario de objetos mejorado
» Un Menu mejorado 1ra parte
» movimiento en moustro
» inventario de objetos mejorado
» Un Menu mejorado 1ra parte
RPG maker VX :: Scripts ::
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.