Mundo Maker
¡Bienvenid@ a Mundo Maker!

¿Quieres aprender todo sobre el RPG Maker?



Regístrate y forma parte de Mundo Maker.

[RMXP] [RMVX] ELSA (Event Layering Script Advance)

Ver el tema anterior Ver el tema siguiente Ir abajo

RPG Maker XP [RMXP] [RMVX] ELSA (Event Layering Script Advance)

Mensaje por AsFzKakarotto el 2018-05-12, 06:25

Este sistema nos permite usar los eventos del mapa como Tiles de 9 nuevas capas.
Con ello usted podrá añadir gráficos extras  a su mapa y si es que lo deseas se puede incluso usar el evento como tal...



(Puede haber alguna que otra diferencia con respecto a la tolerancia de los tiles).

Instrucciones:

Simplemente a un evento coloca como nombre:

-Debajo 1
-Debajo 2
-Debajo 3
-Medio 1
-Medio 2
-Medio 3
-Alto 1
-Alto 2
-Alto 3

Dependiendo en donde quieras que quede el gráfico del Charsets (Guíate según la Imagen)...
También el nombre lo puedes añadir en el comando de "Poner Anotación" si es que te acomoda más.

Aquí el Script:

Código:
#==============================================================================
# ** Event Layer Script Advanced (ELSA)
#------------------------------------------------------------------------------
# by DerVVulfman and Jay Ray
# version 1.3
# 02-24-2015
# RGSS & RGSS2 / RPGMaker XP & RPGMaker VX
#==============================================================================
#
# INTRODUCTION:
#
# More Event Layers. This script, originally titled 'Events Always Under' allowed
# for the ability to have events actually break through the floor, sitting above
# the panorama layer, but below the Tiles, still using the Tiles passability.
# As the new Event Layer Script Advanced (ELSA), we have increased the z-index to
# nine total flattened positions, allowing for more mapping options for RPG Maker
# XP and VX
#
# Three Events can go UNDEr the tiles. Now, you'll probably never need more
# than that, but this allows you to have large event floor tiles, smaller accents
# on top of them, and then maybe even smaller accents on the accents! Or use the
# layers for water effects, lava effects and more, as the events can be animated!
#
# Next, Use Mid-layer events to add embelishments on the floor, that stay under
# the player but above tiles with priority level 0. You get three so, you can add
# a nice rug or something, add some overlapping stool, and a pair of boots on that
# stool, all without having to render a parallax map
#
# Next for my own personal benefit, I created the Variations of Always Over Events
# because for me personally, if I'm creating rooftops for houses, I want to be able
# to customize them without locking myself into a specific tile layer and priority set.
# Make a Huge Windmill, and then use another event layer to add the moving arms. Put
# a tower that stands over the city, with a sperate layer for the flag or banners
# that drape from it, (animated or not). The possibilities!!! Now you can have the
# pre-rendered or hand-drawn map you want, without the massive parallax images needed
# for maps with any large size.
#
#
# With ELSA and this can increase your layers from the seven possible before
# (Panorama, Tile Layers (3), Event Layer, Above Event Layer, Fog)
# to a total of FIFTEEN layers
# (Panorama, Unders (3), Tile Layers (3), Mids (3), Aboves(4), and Fog)
#
#
# ------------------------------------------------------------------------------
#
# USAGE:
#
# Simply put, add one of the Event Words (Given below) to your event's name
# (EX: EV003 Under 1), or create a comment in your event's list of commands
# and have that comment be one of the words given below (again, without quotes). This
# will flag the event as an 'Always Under' or a 'Stacked Layers' or an 'Above All' event
# and place it in one of now ten layers.
#
# On personal preference, I would recommend using it within a comment as the
# event can have the 'Always Under' flag turned on/off if the event erased,
# gone from one event page to another, or the like.
#
# Event Comments and Effects
# Comment: Under 1 - Puts event below tiles (z-depth: -3)
# Comment: Under 2 - Puts event below tiles (z-depth: -2)
# Comment: Under 3 - Puts event below tiles (z-depth: -1)
# Comment: Mid 1 - Puts event above layer1 tiles (z-depth: 1)
# Comment: Mid 2 - Puts event above layer1 tiles (z-depth: 2)
# Comment: Mid 3 - Puts event above layer1 tiles (z-depth: 3)
# Comment: Over 1 - Puts event above all other events (z-depth: 985)
# Comment: Over 2 - Puts event above all other events (z-depth: 990)
# Comment: Over 3 - Puts event above all other events (z-depth: 995)
#
# Remember that the 'Always On Top' Flag can be clicked without a comment to
# make even another layer!
#==============================================================================
#
# NOTE:
#
# While one can apply a characterset graphic to an event, the 'through' flag
# in an event will not let the player step upon any such tile. So if it is
# the intention of the game/map designer for the player to walk upon such
# tiles, only use graphics from the tileset for these events. Additionally,
# setting the 'through' flag on may actively hamper movement and disable the
# passages flags. Remember that this is mainly meant as a cosmetic change.
#
#==============================================================================
#
# TERMS AND CONDITIONS:
#
# Free for use, even in commercial games. This script was originally created
# as 'Events Always Under' by DerVVulfman. I went through and buffed it up for
# more layers, other Event functions, so credit goes to DerVVulfman and JayRay
#
# (Doesn't HAVE to be in that order, just saying...)
#
# COMPATIBILITY ISSUES: THis script SHOULD work with other event changing scripts
# as long as those scripts do not change
#==============================================================================

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles the map. It includes scrolling and passable determining
# functions. Refer to "$game_map" for the instance of this class.
#==============================================================================
class Game_Map
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias eventadvanced_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  # map_id : map ID
  #--------------------------------------------------------------------------
  def setup(map_id)
    eventadvanced_setup(map_id)
    for e in @events.values
      next if e.nil?
      e.eventadvanced1 = true if e.name =~ "Debajo 1"
      e.eventadvanced2 = true if e.name =~ "Debajo 2"
      e.eventadvanced3 = true if e.name =~ "Debajo 3"
      e.eventadvanced4 = true if e.name =~ "Medio 1"
      e.eventadvanced5 = true if e.name =~ "Medio 2"
      e.eventadvanced6 = true if e.name =~ "Medio 3"
      e.eventadvanced7 = true if e.name =~ "Alto 1"
      e.eventadvanced8 = true if e.name =~ "Alto 2"
      e.eventadvanced9 = true if e.name =~ "Alto 3"
      image_flag = false
      if RUBY_VERSION.slice(0,3) == "1.6"
        image_flag = true if e.character_name != ""
      else
        image_flag = true if e.character_name != "" or e.tile_id != 0
      end
      unless image_flag == false or e.list.nil?
        for i in 0...e.list.size
          next if e.list[i].code != 108
          e.eventadvanced1 = true if e.list[i].parameters[0] =~ "Debajo 1"
          e.eventadvanced2 = true if e.list[i].parameters[0] =~ "Debajo 2"
          e.eventadvanced3 = true if e.list[i].parameters[0] =~ "Debajo 3"
          e.eventadvanced4 = true if e.list[i].parameters[0] =~ "Medio 1"
          e.eventadvanced5 = true if e.list[i].parameters[0] =~ "Medio 2"
          e.eventadvanced6 = true if e.list[i].parameters[0] =~ "Medio 3"
          e.eventadvanced7 = true if e.list[i].parameters[0] =~ "Alto 1"
          e.eventadvanced8 = true if e.list[i].parameters[0] =~ "Alto 2"
          e.eventadvanced9 = true if e.list[i].parameters[0] =~ "Alto 3"
        end
      end
    end
  end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :eventadvanced1 # Event Advanced UnderLayer 1
  attr_accessor :eventadvanced2 # Event Advanced UnderLayer 2
  attr_accessor :eventadvanced3 # Event Advanced UnderLayer 3
  attr_accessor :eventadvanced4 # Event Advanced MiddleLayer 1
  attr_accessor :eventadvanced5 # Event Advanced MiddleLayer 2
  attr_accessor :eventadvanced6 # Event Advanced MiddleLayer 3
  attr_accessor :eventadvanced7 # Event Advanced OverLayer 1
  attr_accessor :eventadvanced8 # Event Advanced OverLayer 2
  attr_accessor :eventadvanced9 # Event Advanced OverLayer 3
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias eventadvanced_initialize initialize
  alias eventadvanced_screen_z screen_z
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    eventadvanced_initialize
    @eventadvanced1 = false
    @eventadvanced2 = false
    @eventadvanced3 = false
    @eventadvanced4 = false
    @eventadvanced5 = false
    @eventadvanced6 = false
    @eventadvanced7 = false
    @eventadvanced8 = false
    @eventadvanced9 = false
  end
  #--------------------------------------------------------------------------
  # * Get Screen Z-Coordinates
  # height : character height
  #--------------------------------------------------------------------------
  def screen_z(height = 0)
    return -4 if @eventadvanced1
    return -3 if @eventadvanced2
    return -2 if @eventadvanced3
    return 1 if @eventadvanced4
    return 2 if @eventadvanced5
    return 3 if @eventadvanced6
    return 980 if @eventadvanced7
    return 985 if @eventadvanced8
    return 990 if @eventadvanced9
    if RUBY_VERSION.slice(0,3) == "1.6"
      return eventadvanced_screen_z(height)
    else
      return eventadvanced_screen_z
    end
  end
end
#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
# This class deals with events. It handles functions including event page
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================
class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # * Get Event Name
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
end

El único problema es que no se como cambiarle el nombre a un evento a través del juego ya que seria más accesible.

Autores: DerVVulfman y Jay Ray
avatar
AsFzKakarotto
Soñador
Soñador

0/3

Créditos 305

Gracias : 67

Volver arriba Ir abajo

RPG Maker XP Re: [RMXP] [RMVX] ELSA (Event Layering Script Advance)

Mensaje por xXIsrael0499Xx el 2018-05-12, 14:29

Interesante, se agradece el aporte.

Este tipo de script si que es interesante y util, porque tener libertad en capas es bastante relajante segun mi gusto. Siempre se agradece esto para tener diferentes opciones.

Saludos.
avatar
xXIsrael0499Xx
Veterano
Veterano

0/3

Créditos 2046

Gracias : 112

Volver arriba Ir abajo

RPG Maker XP Re: [RMXP] [RMVX] ELSA (Event Layering Script Advance)

Mensaje por Wecoc el 2018-05-27, 19:04

Este script tiene un problema; no se puede cambiar la propiedad de los eventos de ningún modo.
He hecho otro inspirado en ese, a ver qué tal va.

Código:
#==============================================================================
# ** [XP/VX] Wecoc's Event Layer Script Advanced (WELSA)
#------------------------------------------------------------------------------
# by Wecoc (no credits requiered)
# This script is inspired by the script ELSA by DerVVulfman and Jay Ray,
# but, allows to change the event layer with script calls.
# Version: 1.0 (27-05-2018)
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  attr_accessor :extended_layer
  #--------------------------------------------------------------------------
  alias ext_layer_ini initialize unless $@
  def initialize
    ext_layer_ini
    @extended_layer = 0
  end
  #--------------------------------------------------------------------------
  def set_extended_layer(name)
    @extended_layer = 0
    @extended_layer = case name
      when "Debajo 1" then 1
      when "Debajo 2" then 2
      when "Debajo 3" then 3
      when "Medio 1"  then 4
      when "Medio 2"  then 5
      when "Medio 3"  then 6
      when "Alto 1"   then 7
      when "Alto 2"   then 8
      when "Alto 3"   then 9
    end
    return @extended_layer
  end
  #--------------------------------------------------------------------------
  def remove_extended_layer
    @extended_layer = 0
    return @extended_layer
  end
  #--------------------------------------------------------------------------
  alias_method(:set_el, :set_extended_layer)
  alias_method(:remove_el, :remove_extended_layer)
  #--------------------------------------------------------------------------
  alias ext_layer_sz screen_z unless $@
  def screen_z(*args)
    if @extended_layer.nil? or @extended_layer == 0
      return ext_layer_sz(*args)
    end
    case @extended_layer
      when 1 then return -4
      when 2 then return -3
      when 3 then return -2
      when 4 then return 1
      when 5 then return 2
      when 6 then return 3
      when 7 then return 980
      when 8 then return 985
      when 9 then return 990
    end  
  end
end

Cómo usarlo:

Ya no va por nombre, si no que hay que cambiarle una variable al evento, normalmente mediante otro evento en proceso paralelo para que funcione al entrar al mapa.

Se puede aplicar al personaje con $game_player, a un evento concreto con $game_map.events[ID].

- Cambiar directamente la capa de 1 a 9 (o bien 0 para "no definido", por defecto)
$game_player.extended_layer = VALOR

- Cambiar la capa usando nombre de capa (o bien quitarla para "no definido")
$game_player.set_extended_layer(NOMBRE)
$game_player.remove_extended_layer

NOMBRE siguen siendo los del otro script, por ejemplo "Debajo 1". Las comillas deben incluírse.

Nota: Si los nombres de los métodos son demasiado largos para que os quepan bien set_extended_layer puede acortarse a set_el y remove_extended_layer a remove_el.
avatar
Wecoc
Administrador
Administrador



Créditos 12234

Gracias : 638

Volver arriba Ir abajo

RPG Maker XP Re: [RMXP] [RMVX] ELSA (Event Layering Script Advance)

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


Permisos de este foro:
No puedes responder a temas en este foro.