Conectarse
Buscar
Últimos temas
Los posteadores más activos del mes
No hay usuarios |
Estadísticas
Tenemos 98 miembros registradosEl último usuario registrado es Lawdesifi
Nuestros miembros han publicado un total de 6208 mensajes en 777 argumentos.
[RMXP] Push events
Drupogame :: RPG Maker :: RPG maker XP :: Scripts
Página 1 de 1.
[RMXP] Push events
INTRODUCCIÓN
¿¡Cansado de tus sosos puzles de siempre!? ¿¡Te gustaría que los eventos pudiesen ser empujados por el jugador!?... Teletienda aparte, os traigo este magnífico script de vgvgf.
CARACTERÍSTICAS
Añade a los eventos que quieras la capacidad de ser empujados
Puedes cambiar el sonido de empuje, la distancia, las direcciones, etc
SCREENSHOTS
No hay =(
DEMO
dale un clic aqui para descargar
SCRIPT
CRÉDITOS
A vgvgf, autor del script
¿¡Cansado de tus sosos puzles de siempre!? ¿¡Te gustaría que los eventos pudiesen ser empujados por el jugador!?... Teletienda aparte, os traigo este magnífico script de vgvgf.
CARACTERÍSTICAS
Añade a los eventos que quieras la capacidad de ser empujados
Puedes cambiar el sonido de empuje, la distancia, las direcciones, etc
SCREENSHOTS
No hay =(
DEMO
dale un clic aqui para descargar
SCRIPT
- Spoiler:
- Código:
=begin =======================================================================
▓ Aleworks Push Events (APE)
==============================================================================
Created by Aleworks
Version: 1.00
Last Update: 10/02/2007 (dd/mm/yyyy)
==============================================================================
*** Instructions ***
For setup an event for being pushable, you need to add a comment with one or
more of the commands in the comment commands list. The PUSH SPEED #,
PUSH DISTANCE #, PUSH SOUND # and PUSH TRIGGER commands, need that the
PUSHABLE command be added.
==============================================================================
*** Comment Commands List ***
PUSHABLE
If the player move in the direction of the event, it will move in the same
direction the player moves, if the event can't move in that direction, it
will try to move in other directions.
PUSHABLE IN DIRECTION
If the player move in the direction of the event, it will move in the same
direction the player moves.
PUSHABLE #
PUSHABLE IN DIRECTION #
Change the # with the posible directions that the event can be pushed.
PUSH SPEED #
Change the # with the speed that the event will move when pushed.
PUSH DISTANCE #
Change the # with the tiles that the event will be pushed.
PUSH SOUND #
Change the # with the file name of the sound effect that will be played when
the event is pushed.
PUSH TRIGGER
The event will be pushed, only if the button C is pressed.
TRASPASABLE
Make that the player can pass through the event.
==============================================================================
*** APE RGSS Classes edits ***
*** Game_Character ***
alias: update; alias name: aleworks_pushevents_gamecharacter_update
replace: passable?(x, y, d)
replace: screen_z
*** Game_Event ***
alias: refresh; alias name: aleworks_pushevents_gameevent_refresh
*** Game_Player ***
replace: update
==============================================================================
=end
#=============================================================================
# ▒ Game_Character
#=============================================================================
class Game_Character
attr_accessor :move_speed
alias aleworks_pushevents_gamecharacter_update update
#==========================================================================
=
# ░ update
#==========================================================================
=
def update
if moving? == false and self.is_a?(Game_Event)
if @left_push == 0
@pushing = false
@pushing_direction = 0
else
case @pushing_direction
when 2
move_down
Audio.se_play("Audio/SE/" + @push_sound) if @push_sound != nil
when 4
move_left
Audio.se_play("Audio/SE/" + @push_sound) if @push_sound != nil
when 6
move_right
Audio.se_play("Audio/SE/" + @push_sound) if @push_sound != nil
when 8
move_up
Audio.se_play("Audio/SE/" + @push_sound) if @push_sound != nil
end
@left_push -= 1
end
end
if @old_speed != nil and @pushing == false
@move_speed = @old_speed if @move_speed == @push_speed
@old_speed = nil
end
aleworks_pushevents_gamecharacter_update
end
#==========================================================================
=
# ░ passable?
#==========================================================================
=
def passable?(x, y, d)
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
return false unless $game_map.valid?(new_x, new_y)
return true if @through
return false unless $game_map.passable?(x, y, d, self)
return false unless $game_map.passable?(new_x, new_y, 10 - d)
for event in $game_map.events.values
if event.x == new_x and event.y == new_y
next if self == $game_player and event.traspasable
unless event.through
return false if event.character_name != ""
end
end
end
if $game_player.x == new_x and $game_player.y == new_y
unless $game_player.through
return false if @character_name != ""
end
end
return true
end
#==========================================================================
=
# ░ screen_z
#==========================================================================
=
def screen_z(height = 0)
return 999 if @always_on_top
z = (@real_y - $game_map.display_y + 3) / 4 + 32
if @tile_id > 0
return z + $game_map.priorities[@tile_id] * 32
else
if self.is_a?(Game_Event)
if @traspasable == true
return z + ((height > 32) ? 31 : 0) + 16
else
return z + ((height > 32) ? 31 : 0)
end
else
return z + ((height > 32) ? 31 : 0)
end
end
end
end
#=============================================================================
# ▒ Game_Event
#=============================================================================
class Game_Event
attr_reader :pushable
attr_reader :push_speed
attr_reader :push_distance
attr_reader :traspasable
attr_reader :push_in_diretion
attr_reader :push_direction
attr_reader :push_sound
attr_reader :push_trigger
attr_accessor :pushing
attr_accessor :old_speed
attr_accessor :left_push
attr_accessor :pushing_direction
alias aleworks_pushevents_gameevent_refresh refresh
#==========================================================================
=
# ░ refresh
#==========================================================================
=
def refresh
@pushable = false
@push_speed = nil
@push_distance = 1
@pushing = false
@old_speed = nil
@left_push = 0
@push_direction = []
@pushing_direction = 0
@traspasable = false
@push_in_diretion = false
@push_sound = nil
@push_trigger = false
aleworks_pushevents_gameevent_refresh
for i in @page.list
if i.code == 108 or i.code == 408
if i.parameters[0].upcase[/PUSHABLE/] != nil
@pushable = true
@push_in_diretion = true if i.parameters[0].upcase[/IN DIRECTION/] != nil
@push_direction.push(2) if i.parameters[0][/2/] != nil
@push_direction.push(4) if i.parameters[0][/4/] != nil
@push_direction.push(6) if i.parameters[0][/6/] != nil
@push_direction.push(8) if i.parameters[0][/8/] != nil
end
if i.parameters[0].upcase[/PUSH SPEED/] != nil
@push_speed = i.parameters[0].split[2].to_i
end
if i.parameters[0].upcase[/PUSH DISTANCE/] != nil
@push_distance = i.parameters[0].split[2].to_i
end
if i.parameters[0].upcase[/PUSH SOUND/] != nil
@push_sound = i.parameters[0].split[2]
end
if i.parameters[0].upcase[/PUSH TRIGGER/] != nil
@push_trigger = true
end
if i.parameters[0].upcase[/TRASPASABLE/] != nil
@traspasable = true
end
end
end
end
end
#=============================================================================
# ▒ Game_Player
#=============================================================================
class Game_Player
#==========================================================================
=
# ░ update
#==========================================================================
=
def update
last_moving = moving?
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
case Input.dir4
when 2
dir = 2
alt_dir = [4,6,8]
push_x = 0
push_y = 1
when 4
dir = 4
alt_dir = [2,6,8]
push_x = -1
push_y = 0
when 6
dir = 6
alt_dir = [2,4,8]
push_x = 1
push_y = 0
when 8
dir = 8
alt_dir = [2,4,6]
push_x = 0
push_y = -1
else
dir = 0
push_x = 0
push_y = 0
end
if passable?(@x, @y, dir) and dir != 0
case dir
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
elsif dir != 0
case dir
when 2
turn_down
when 4
turn_left
when 6
turn_right
when 8
turn_up
end
if $game_map.passable?(@x, @y, dir)
for event in $game_map.events.values
if event.x == @x + push_x and event.y == @y + push_y
next if event.through == true
next if event.pushable == false
next if event.moving? == true
next if event.push_trigger == true
next if event.push_direction.size >= 1 and
!event.push_direction.include?(dir)
if event.passable?(event.x, event.y, dir)
event.pushing = true
else
if !event.push_in_diretion
if event.passable?(event.x, event.y, alt_dir[0])
dir = alt_dir[0]
event.pushing = true
elsif event.passable?(event.x, event.y, alt_dir[1])
dir = alt_dir[1]
event.pushing = true
elsif event.passable?(event.x, event.y, alt_dir[2])
dir = alt_dir[2]
event.pushing = true
end
end
end
if event.pushing == true
case dir
when 2
event.move_down
when 4
event.move_left
when 6
event.move_right
when 8
event.move_up
end
if event.push_speed != nil
event.old_speed = event.move_speed
event.move_speed = event.push_speed
end
if event.push_distance > 1
event.left_push = event.push_distance
event.pushing_direction = dir
end
if event.push_sound != nil
Audio.se_play("Audio/SE/" + event.push_sound)
end
end
end
end
end
end
end
last_real_x = @real_x
last_real_y = @real_y
super
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
$game_map.scroll_down(@real_y - last_real_y)
end
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
$game_map.scroll_left(last_real_x - @real_x)
end
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
$game_map.scroll_right(@real_x - last_real_x)
end
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
$game_map.scroll_up(last_real_y - @real_y)
end
unless moving?
if last_moving
result = check_event_trigger_here([1,2])
if result == false
unless $DEBUG and Input.press?(Input::CTRL)
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
if Input.trigger?(Input::C)
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
case @direction
when 2
dir = 2
alt_dir = [4,6,8]
push_x = 0
push_y = 1
when 4
dir = 4
alt_dir = [2,6,8]
push_x = -1
push_y = 0
when 6
dir = 6
alt_dir = [2,4,8]
push_x = 1
push_y = 0
when 8
dir = 8
alt_dir = [2,4,6]
push_x = 0
push_y = -1
else
dir = 0
push_x = 0
push_y = 0
end
for event in $game_map.events.values
if event.x == @x + push_x and event.y == @y + push_y
next if event.through == true
next if event.pushable == false
next if event.push_trigger == false
next if event.moving? == true
next if event.push_direction.size >= 1 and
!event.push_direction.include?(dir)
if event.passable?(event.x, event.y, dir)
event.pushing = true
else
if !event.push_in_diretion
if event.passable?(event.x, event.y, alt_dir[0])
dir = alt_dir[0]
event.pushing = true
elsif event.passable?(event.x, event.y, alt_dir[1])
dir = alt_dir[1]
event.pushing = true
elsif event.passable?(event.x, event.y, alt_dir[2])
dir = alt_dir[2]
event.pushing = true
end
end
end
if event.pushing == true
case dir
when 2
event.move_down
when 4
event.move_left
when 6
event.move_right
when 8
event.move_up
end
if event.push_speed != nil
event.old_speed = event.move_speed
event.move_speed = event.push_speed
end
if event.push_distance > 1
event.left_push = event.push_distance
event.pushing_direction = dir
end
if event.push_sound != nil
Audio.se_play("Audio/SE/" + event.push_sound)
end
end
end
end
end
end
end
end
CRÉDITOS
A vgvgf, autor del script
Drupogame :: RPG Maker :: RPG maker XP :: Scripts
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.
Lun Ene 23, 2012 11:32 pm por edux
» edux returns
Lun Ene 23, 2012 11:30 pm por edux
» The Elder Scrolls IV: Oblivion
Vie Ene 20, 2012 11:28 pm por Aljevalsar
» Kojima promete que habrá un Metal Gear Solid de auténtico sigilo
Jue Dic 22, 2011 7:33 pm por Anime_Maker
» Este fin de semana habrá nuevos modos para Modern Warfare 3
Jue Dic 15, 2011 12:03 pm por Akeo
» Kojima quiso crear un Metal Gear Solid 5 ambientado en la Segunda Guerra Mundial
Jue Dic 15, 2011 11:01 am por Akeo
» Darksiders II se dejará ver en los Spike VGA
Miér Dic 14, 2011 11:50 am por Akeo
» El creador de Bayonetta desmiente estar implicado en el desarrollo de Metal Gear Rising
Miér Dic 14, 2011 1:54 am por Akeo
» Los creadores de Bayonetta se encargan del desarrollo de Metal Gear Rising
Miér Dic 14, 2011 1:52 am por Akeo
» En Construccion: Mundo Abismal
Lun Oct 24, 2011 4:03 am por SagahonArturo
» Visceral Games busca nuevo personal para la franquicia Dead Space
Mar Oct 11, 2011 3:22 am por The_King_Jaas
» buenas
Mar Oct 11, 2011 3:21 am por The_King_Jaas
» Batman: Arkham City llegará "sin ninguna limitación"
Sáb Oct 08, 2011 1:44 am por Akeo
» Los creadores de Bulletstorm admiten divertidos que el juego tenía demasiadas palabras malsonantes
Sáb Oct 08, 2011 1:41 am por Akeo
» PES 2012: El primer DLC estará disponible el 11 de octubre
Sáb Oct 08, 2011 1:39 am por Akeo