¡Bienvenido a PlanetaRPG! Ha iniciado sesión como invitado, si no dispone de una cuenta puede obtenerla fácilmente haciendo click aquí. Si ya tiene una cuenta puede identificarse mediante este enlace.
Regístrate
Si ves algún post con links rotos o que debería ser borrado, utiliza el botón , cual aparece justo debajo de cada mensaje, para que algún moderador se encargue, ¡gracias! :D
Les presentamos el sistema de sugerencias ~ Un sistema que les permitirá enviar sugerencias y votar las sugerencias que más les gusten; cada tanto, tomaremos una de esas sugerencias y las pondremos en marcha ¡Vota las sugerencias que te gusten, envía las tuyas y corre la voz! ¡¡¡PlanetaRPG lo hacemos entre todos!!! :D

Encuesta: ¿Te sirve/gusta el script o crees que tiene alguna utilidad?
Esta encuesta esta cerrada.
Me gusta el script 0% 0 0%
Es útil. 0% 0 0%
Hace más atractivo un juego makero. 0% 0 0%
Faltaria completarlo con cambios de gráfico. 100.00% 3 100.00%
Morir en el intento de hacer algo como esto no vale la pena (?) 0% 0 0%
Total 3 votos 100%
* Tú votaste por esta opción. [Mostrar resultados]

Tema cerrado 
 
Calificación:
  • 17 votos - 3.24 Media
  • 1
  • 2
  • 3
  • 4
  • 5
[SCRIPT][RMXP] 8 direcciones
19-04-2011, 07:36 AM (Este mensaje fue modificado por última vez en: 07-11-2011 11:53 AM por Sidney.)
Mensaje: #1
RPG Maker XP [SCRIPT][RMXP] 8 direcciones
[RPGXP] 8 direcciones
VERSIÓN: 1.0 | RPG MAKER XP


INTRODUCCIÓN
Bueno, toqueteando toqueteando, hice este script, el cual en un principio no sabia como hacer y pregunté aquí en este foro, como nadie constestó, lo averigüé por mi mismo, en fin, fuera habladurias; mi primer script es un simple edit del game_player del RTP, que permite al jugador caminar en 8 direcciones con el uso de las flechitas ^^
para la V1.1, con la ayuda de Wecoc, quiero implementar el uso del teclado numérico para realizar esta acción 8aunque no sé si la sacaré algún dia xD)

CARACTERÍSTICAS
  • Puedes hacer caminar tu personaje en 8 direcciones, es decir, con diagonales, como muchos juegos comerciales ^^
SCREENSHOTS
Imposible, aunque seria mejor decir: innecesarias


DEMO
Innecesaria, aunque puede que ponga alguna ^^


SCRIPT
Código:
#==============================================================================
# ** Game_Player
# * Script: incluye 8 direcciones (eight directions)
# * Versión: 1.0
# * Créditos: Clark-CLK
# * Fecha: 18.04.2011 (dd.mm.yyyy)
# * Más scripts, tutoriales y RPG Maker en: http://ahoperpg-maker.ucoz.es
#--------------------------------------------------------------------------
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Invariables
  #--------------------------------------------------------------------------
  CENTER_X = (320 - 16) * 4  # Center screen x-coordinate * 4
  CENTER_Y = (240 - 16) * 4  # Center screen y-coordinate * 4
  #--------------------------------------------------------------------------
  # * Passable Determinants
  #    x : x-coordinate
  #    y : y-coordinate
  #    d : direction (0,2,4,6,8)
  #        * 0 = Determines if all directions are impassable (for jumping)
  #--------------------------------------------------------------------------
  def passable?(x, y, d)
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # If coordinates are outside of map
    unless $game_map.valid?(new_x, new_y)
      # Impassable
      return false
    end
    # If debug mode is ON and ctrl key was pressed
    if $DEBUG and Input.press?(Input::CTRL)
      # Passable
      return true
    end
    super
  end
  #--------------------------------------------------------------------------
  # * Set Map Display Position to Center of Screen
  #--------------------------------------------------------------------------
  def center(x, y)
    max_x = ($game_map.width - 20) * 128
    max_y = ($game_map.height - 15) * 128
    $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
    $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
  end
  #--------------------------------------------------------------------------
  # * Move to Designated Position
  #    x : x-coordinate
  #    y : y-coordinate
  #--------------------------------------------------------------------------
  def moveto(x, y)
    super
    # Centering
    center(x, y)
    # Make encounter count
    make_encounter_count
  end
  #--------------------------------------------------------------------------
  # * Increaase Steps
  #--------------------------------------------------------------------------
  def increase_steps
    super
    # If move route is not forcing
    unless @move_route_forcing
      # Increase steps
      $game_party.increase_steps
      # Number of steps are an even number
      if $game_party.steps % 2 == 0
        # Slip damage check
        $game_party.check_map_slip_damage
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Get Encounter Count
  #--------------------------------------------------------------------------
  def encounter_count
    return @encounter_count
  end
  #--------------------------------------------------------------------------
  # * Make Encounter Count
  #--------------------------------------------------------------------------
  def make_encounter_count
    # Image of two dice rolling
    if $game_map.map_id != 0
      n = $game_map.encounter_step
      @encounter_count = rand(n) + rand(n) + 1
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # If party members = 0
    if $game_party.actors.size == 0
      # Clear character file name and hue
      @character_name = ""
      @character_hue = 0
      # End method
      return
    end
    # Get lead actor
    actor = $game_party.actors[0]
    # Set character file name and hue
    @character_name = actor.character_name
    @character_hue = actor.character_hue
    # Initialize opacity level and blending method
    @opacity = 255
    @blend_type = 0
  end
  #--------------------------------------------------------------------------
  # * Same Position Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_here(triggers)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in $game_map.events.values
      # If event coordinates and triggers are consistent
      if event.x == @x and event.y == @y and triggers.include?(event.trigger)
        # If starting determinant is same position event (other than jumping)
        if not event.jumping? and event.over_trigger?
          event.start
          result = true
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Front Envent Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_there(triggers)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # Calculate front event coordinates
    new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
    new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
    # All event loops
    for event in $game_map.events.values
      # If event coordinates and triggers are consistent
      if event.x == new_x and event.y == new_y and
        triggers.include?(event.trigger)
        # If starting determinant is front event (other than jumping)
        if not event.jumping? and not event.over_trigger?
          event.start
          result = true
        end
      end
    end
    # If fitting event is not found
    if result == false
      # If front tile is a counter
      if $game_map.counter?(new_x, new_y)
        # Calculate 1 tile inside coordinates
        new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
        new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
        # All event loops
        for event in $game_map.events.values
          # If event coordinates and triggers are consistent
          if event.x == new_x and event.y == new_y and
            triggers.include?(event.trigger)
            # If starting determinant is front event (other than jumping)
            if not event.jumping? and not event.over_trigger?
              event.start
              result = true
            end
          end
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Touch Event Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in $game_map.events.values
      # If event coordinates and triggers are consistent
      if event.x == x and event.y == y and [1,2].include?(event.trigger)
        # If starting determinant is front event (other than jumping)
        if not event.jumping? and not event.over_trigger?
          event.start
          result = true
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  # * Script: 8 direcciones (eight directions)
  # * Versión: 1.0
  # * Créditos: Clark-CLK
  # * Fecha: 18.04.2011 (dd.mm.yyyy)
  # * Más scripts, tutoriales y RPG Maker en: http://ahoperpg-maker.ucoz.es
  #--------------------------------------------------------------------------
  def update
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    unless moving? or $game_system.map_interpreter.running? or
          @move_route_forcing or $game_temp.message_window_showing
      # Move player in the direction the directional button is being pressed
      case Input.dir8
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      when 1
        move_lower_left
      when 3
        move_lower_right
      when 7
        move_upper_left
      when 9
        move_upper_right
      end
    end
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # Scroll map down
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # Scroll map up
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # If not moving
    unless moving?
      # If player was moving last time
      if last_moving
        # Event determinant is via touch of same position event
        result = check_event_trigger_here([1,2])
        # If event which started does not exist
        if result == false
          # Disregard if debug mode is ON and ctrl key was pressed
          unless $DEBUG and Input.press?(Input::CTRL)
            # Encounter countdown
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
        # Same position and front event determinant
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end



INSTRUCCIONES
Copiar el script y pegar encima de main. Para mover el chara en las diagonales pulsar derecha y arriba, derecha y abajo, izquierda y arriba, izquierda y abajo.

CRÉDITOS
Clark-CLK

F.A.Q
-Nada por el momento ^^
MI PROYECTO!!
[Imagen: imagen.png?uid=Clark-CLK]
Visten A HOPE RPG
Visita su sitio web Encuentra todos sus mensajes
19-04-2011, 08:59 AM
Mensaje: #2
RE: [RPGXP] 8 direcciones [v.1.0] by Clark-CLK
Te felicito por tus primeros pasos en la programacion.
¿Cúales son exactamente los metodos que modificaste? No es necesario reemplazar la clase entera, podes incluir solo los metodos que modificaste para el sistema o usar alias en caso de ser posible.

¿Por qué querés usar el teclado numerico para el movimiento?

Como siguiente paso, te sugiero que agregues la opcion para que cambie el grafico del personaje cuando vaya en diagonales y agregues movimiento diagonal para la ruta de movimiento aleatoria para los eventos (con la misma opcion de usar un grafico adicional)
Visita su sitio web Encuentra todos sus mensajes
19-04-2011, 09:12 AM
Mensaje: #3
RE: [RPGXP] 8 direcciones [v.1.0] by Clark-CLK
(19-04-2011 08:59 AM)Silentwalker escribió:  Te felicito por tus primeros pasos en la programacion.
¿Cúales son exactamente los metodos que modificaste? No es necesario reemplazar la clase entera, podes incluir solo los metodos que modificaste para el sistema o usar alias en caso de ser posible.

Tepongo el procedimiento que hice para hacerlo, la verdad, no lo puse por la plantilla, creo que limita bastante.

bien, despues de leerme y releerme diferentes guias de RGSS sin saber que decia ni como hacer nada, decidí mirar en los scripts default del maker XP para ver si con lo que leí podia hacer algun simple edit y pude ^^
me fijé en las linias 203-224 donde decia:
Código:
#--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
      # Move player in the direction the directional button is being pressed
      case Input.dir4
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      end
    end
ahí me dije... Esto son las teclas de movimiento; si con las guias aprendí que if y when eran "condicionales" o más bien dicho "condiciones", era: al pulsar esas teclas se movia el personaje, pero claro, las flechitas, no tienen ningun caracter escrito en si, así pues eran substituidads por los numeros.
Teniendo en cuenta el orden del teclado numérico:
7 8 9
4 5 6
1 2 3
0

Bien, pues así si 2-4-6-8 eran abajo-izquierda-derecha-arriba, respectivamente, pues, añadiendo las linias:

Código:
when 7
move_up_left
when 9
move_up_right
when 1
move_down_left
when 3
move_down_right
debia ir en 8 direcciones...
pero saltaba error al intentar usar esas direcciones... T_T
miré posibles alternaciones:
Código:
up --> upper
down --> lower
efectivamente, la segunda me costó un poco más de encontrar, pero lo conseguí. Ahora tenia que funcionar
Tocaba aplicarlo ^^
En ese caso no me saltó ningun error, pero la aplicación no funcionaba T_T
miré que podía ser; y no era más que una de las primeras linias:
Código:
case Input.dir4
si tomaba eso en cuenta me estaba diciendo "4 direcciones" así que cambié el 4 por 8 y funcionó ^^ ::):: ::):: ::)::
Hice mi primer script, si es que se le puede llamar así xD
bueno, aquí lo dejo; substituian su game_player por este otro ^^:
Código:
#==============================================================================
# ** Game_Player
# * Script: incluye 8 direcciones (eight directions)
# * Versión: 1.0
# * Créditos: Clark-CLK
# * Fecha: 18.04.2011 (dd.mm.yyyy)
# * Más scripts, tutoriales y RPG Maker en: http://ahoperpg-maker.ucoz.es
#--------------------------------------------------------------------------
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Invariables
  #--------------------------------------------------------------------------
  CENTER_X = (320 - 16) * 4   # Center screen x-coordinate * 4
  CENTER_Y = (240 - 16) * 4   # Center screen y-coordinate * 4
  #--------------------------------------------------------------------------
  # * Passable Determinants
  #     x : x-coordinate
  #     y : y-coordinate
  #     d : direction (0,2,4,6,8)
  #         * 0 = Determines if all directions are impassable (for jumping)
  #--------------------------------------------------------------------------
  def passable?(x, y, d)
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # If coordinates are outside of map
    unless $game_map.valid?(new_x, new_y)
      # Impassable
      return false
    end
    # If debug mode is ON and ctrl key was pressed
    if $DEBUG and Input.press?(Input::CTRL)
      # Passable
      return true
    end
    super
  end
  #--------------------------------------------------------------------------
  # * Set Map Display Position to Center of Screen
  #--------------------------------------------------------------------------
  def center(x, y)
    max_x = ($game_map.width - 20) * 128
    max_y = ($game_map.height - 15) * 128
    $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
    $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
  end
  #--------------------------------------------------------------------------
  # * Move to Designated Position
  #     x : x-coordinate
  #     y : y-coordinate
  #--------------------------------------------------------------------------
  def moveto(x, y)
    super
    # Centering
    center(x, y)
    # Make encounter count
    make_encounter_count
  end
  #--------------------------------------------------------------------------
  # * Increaase Steps
  #--------------------------------------------------------------------------
  def increase_steps
    super
    # If move route is not forcing
    unless @move_route_forcing
      # Increase steps
      $game_party.increase_steps
      # Number of steps are an even number
      if $game_party.steps % 2 == 0
        # Slip damage check
        $game_party.check_map_slip_damage
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Get Encounter Count
  #--------------------------------------------------------------------------
  def encounter_count
    return @encounter_count
  end
  #--------------------------------------------------------------------------
  # * Make Encounter Count
  #--------------------------------------------------------------------------
  def make_encounter_count
    # Image of two dice rolling
    if $game_map.map_id != 0
      n = $game_map.encounter_step
      @encounter_count = rand(n) + rand(n) + 1
    end
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # If party members = 0
    if $game_party.actors.size == 0
      # Clear character file name and hue
      @character_name = ""
      @character_hue = 0
      # End method
      return
    end
    # Get lead actor
    actor = $game_party.actors[0]
    # Set character file name and hue
    @character_name = actor.character_name
    @character_hue = actor.character_hue
    # Initialize opacity level and blending method
    @opacity = 255
    @blend_type = 0
  end
  #--------------------------------------------------------------------------
  # * Same Position Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_here(triggers)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in $game_map.events.values
      # If event coordinates and triggers are consistent
      if event.x == @x and event.y == @y and triggers.include?(event.trigger)
        # If starting determinant is same position event (other than jumping)
        if not event.jumping? and event.over_trigger?
          event.start
          result = true
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Front Envent Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_there(triggers)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # Calculate front event coordinates
    new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
    new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
    # All event loops
    for event in $game_map.events.values
      # If event coordinates and triggers are consistent
      if event.x == new_x and event.y == new_y and
         triggers.include?(event.trigger)
        # If starting determinant is front event (other than jumping)
        if not event.jumping? and not event.over_trigger?
          event.start
          result = true
        end
      end
    end
    # If fitting event is not found
    if result == false
      # If front tile is a counter
      if $game_map.counter?(new_x, new_y)
        # Calculate 1 tile inside coordinates
        new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
        new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
        # All event loops
        for event in $game_map.events.values
          # If event coordinates and triggers are consistent
          if event.x == new_x and event.y == new_y and
             triggers.include?(event.trigger)
            # If starting determinant is front event (other than jumping)
            if not event.jumping? and not event.over_trigger?
              event.start
              result = true
            end
          end
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Touch Event Starting Determinant
  #--------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in $game_map.events.values
      # If event coordinates and triggers are consistent
      if event.x == x and event.y == y and [1,2].include?(event.trigger)
        # If starting determinant is front event (other than jumping)
        if not event.jumping? and not event.over_trigger?
          event.start
          result = true
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  # * Script: 8 direcciones (eight directions)
  # * Versión: 1.0
  # * Créditos: Clark-CLK
  # * Fecha: 18.04.2011 (dd.mm.yyyy)
  # * Más scripts, tutoriales y RPG Maker en: http://ahoperpg-maker.ucoz.es
  #--------------------------------------------------------------------------
  def update
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
      # Move player in the direction the directional button is being pressed
      case Input.dir8
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      when 1
        move_lower_left
      when 3
        move_lower_right
      when 7
        move_upper_left
      when 9
        move_upper_right
      end
    end
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # Scroll map down
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # Scroll map up
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # If not moving
    unless moving?
      # If player was moving last time
      if last_moving
        # Event determinant is via touch of same position event
        result = check_event_trigger_here([1,2])
        # If event which started does not exist
        if result == false
          # Disregard if debug mode is ON and ctrl key was pressed
          unless $DEBUG and Input.press?(Input::CTRL)
            # Encounter countdown
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
        # Same position and front event determinant
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end
añadí créditos a mi por la adición de las 8 direcciones al principio y en el frame update xP
bueno, espero que les sirva ^^

P.D: Se que hacerlo por engines es mucho más fácil, pero siempre quise hacer algo con el RGSS ^^ y tengan en cuenta que es el primer "script" que hago ^^

Para la versión 1.1, Wecoc me está ayudando a poner la opción de mover en 8 direcciones usando tambien los numeros, pues con esto, no sirve con los numeros y me hace ilusión xDD

Ahi tienes el procedimiento xD

Cita:¿Por qué querés usar el teclado numerico para el movimiento?

Por nada en especial, es simplemente, porque si lo hago, ya sabré programar algo más y para algo me ha de servir esa experiencia xP
Cita:Como siguiente paso, te sugiero que agregues la opcion para que cambie el grafico del personaje cuando vaya en diagonales y agregues movimiento diagonal para la ruta de movimiento aleatoria para los eventos (con la misma opcion de usar un grafico adicional)
Eso tambien lo quiero agregar, pero aun tengo que probar un poco, haber si lo consigo y en el caso de que lo haga, lo pondré claro ^^

luego, para el movimiento de los eventos, será más dificil, bueno, a no ser que alguien me diga alguna pista de que script editar...

Wong Wong!!

p[/quote].D: Gracias por la opinión ^^
MI PROYECTO!!
[Imagen: imagen.png?uid=Clark-CLK]
Visten A HOPE RPG
Visita su sitio web Encuentra todos sus mensajes
19-04-2011, 10:08 AM
Mensaje: #4
RE: [RPGXP] 8 direcciones [v.1.0] by Clark-CLK
Usando alias para el metodo que modificaste, menos lineas →

Con Alias:

Para movimiento aleatorio diagonal →

    Código RUBY
class Game_Character
  #--------------------------------------------------------------------------
  # * Move at Random
  #--------------------------------------------------------------------------
  def move_random
    case rand(8)
    when 0  # Move down
      move_down(false)
    when 1  # Move left
      move_left(false)
    when 2  # Move right
      move_right(false)
    when 3  # Move up
      move_up(false)
    when 4
      move_lower_left
    when 5 
      move_lower_right
    when 6 
      move_upper_left
    when 7 
      move_upper_right
    end
  end
end



Te dejo como tarea cambiar la velocidad de movimiento diagonal para que sea mas 'lenta' y el asunto de cambiar los graficos opcionalmente.


Estructura básica para usar alias:
Visita su sitio web Encuentra todos sus mensajes
Tema cerrado 

Reglas de los temas y mensajes
Se amable y agradecido, estamos para ayudarnos mutuamente y divertirnos juntos.
El equipo de PlanetaRPG borrará los mensajes e, incluso, sancionará a los usuarios que no cumplan la regla anterior.
El idioma oficial de PlanetaRPG es el Español, escribe correctamente.
No colocar enlaces a paginas comerciales, descargas piratas o con contenido inapropiado.

PlanetaRPG se reserva el derecho de mover/modificar/borrar los temas y los mensajes.

Si ves algún post con links rotos o que no cumple las reglas, utiliza el botón , este botón aparece justo debajo de cada mensaje y sirve para enviar un mensaje a los moderadores para que revisen el mensaje.



Usuario(s) navegando en este tema:

 Estilo Rápido:


Cargando...