Ú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 2 usuarios en línea: 0 Registrados, 0 Ocultos y 2 Invitados Ninguno
El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm
Scripts para editar terreno y reflejo en el agua
RPG maker VX :: Scripts ::
Página 1 de 1.
Scripts para editar terreno y reflejo en el agua
Se que el reflejo en el agua ya estaba, pero es la version 1, aqui traigo la version 2.4 xD
El único problema de la versión 2.4 es que requiere otro script, y a la vez este script requiere de un archivo que es generado por un programa hecho con RPGmaker VX, pero dejaré aquí el pack para que no tengan que buscarlos :P (Explicación al final del post)
Para empezar este es el programa que requieren, es el editor de tiles:Tileset Editor
Con ello pueden diferenciar sus tiles a través de números, y darle distintas características, con el siguiente script:
Cualquier duda sobre ello, lamento decir que no me he tomado el tiempo para ver como funciona, ya que el post lo hago por un problema que tuvo un usuario con el siguiente script, que es para ver el reflejo en el agua.
Cómo funciona para que se refleje el pj en el agua?, sencillo, con el programa sólo tagean los tiles que quieren que reflejen con el número 1, y guardan (en la parte izquierda del programa estan las indicaciones, pero para guardar se usa la tecla "ctrl" por si andan perdidos). Este programa generará un archivo llamado "Tilesets.rvdata", este archivo deben dejarlo en la carpeta Data de su proyecto. Con eso, ya podrán ver el reflejo de su personaje en donde hayan tageado que se vea XD.
Nota: No olviden que algunos scripts inicializan algunas características del juego por lo que sólo funcionan en nuevas partidas, partidas guardadas anteriormente no contienen los datos nuevos inicializados, por ende, fallaran al cargar el archivo guardado o cuando el juego intente carga la caracteristica que se no ha sido inicializada en la partida guardad.
En general las explicaciones de como utilizar vienen en los scripts, así que aprendan inglés XD
El único problema de la versión 2.4 es que requiere otro script, y a la vez este script requiere de un archivo que es generado por un programa hecho con RPGmaker VX, pero dejaré aquí el pack para que no tengan que buscarlos :P (Explicación al final del post)
Para empezar este es el programa que requieren, es el editor de tiles:Tileset Editor
Con ello pueden diferenciar sus tiles a través de números, y darle distintas características, con el siguiente script:
- Código:
#==============================================================================
# ** Tileset Reader VX
#------------------------------------------------------------------------------
# by DerVVulfman
# version 2.1
# 08-23-2010
# RGSS2
#------------------------------------------------------------------------------
#
# INTRODUCTION:
#
# This system re-introduces terrain tags and four-directional passage flags
# back into your RPGMaker VX system. This script mimics many of the lost
# features, giving you more control over your project.
#
#------------------------------------------------------------------------------
#
# INSTRUCTIONS:
#
# This script is not for use by itself, but is used to read data from the
# .vxdata file created by the 'Tileset Feature Editor.'
#
#
# 4-Way Direction:
# ================
# The four-direction passage feature is an enhancement for mappers who may
# desire individual tiles where movement on these tiles may be one-way,
# two-way or the like. It restricts the character's movement where normal
# 'X' and 'O' passage switches cannot suffice.
#
# To retrieve a 4-way directional value from the map,
# use the following call: $game_map.passage_tag(x, y, d)
#
# The passage system holds 4 flags per tile, so it is required to specify
# a direction into the call, not just the x and y coordinates. The value
# of 'd' can be 1 (for down), 2 (for left), 3 (for right) or 4 (for up).
# If you do retrieve a value other than 0x00 or '0', then that tile is a
# four-way passable tile.
#
#
# Terrain Tags:
# =============
# The reintroduction of Terrain Tags is an enhancement for mappers and
# scripters alike. This feature does nothing on its own, but the terrain
# values stored can be called for reasons of the end user's design.
#
# To retrieve the terrain tag of a select tile from the map,
# just use the following call: $game_map.terrain_tag(x, y)
#
# Please note that the 'Tileset Feature Editor' supports terrain tag values
# up to '201' rather than the paltry '8' of the older RPGMaker systems.
#
#
# Terrain Tags:
# =============
# Vehicle systems (boat, ship, airship) ignore the 4-way passable flags and
# are still controlled only by the default X O tags used by the game editor.
# As such, using the 4 directional arrows in a water autotile to restrict a
# boat's direction will not be possible.
#
#
# Debug Pop-Up:
# =============
# You can also bring up a 'pop-up' debug window by pressing a predefined
# key (that can be changed) in the script's only configurable line.
#
#------------------------------------------------------------------------------
#
# EDITS AND MODIFICATIONS:
#
# This system Aliases the following methods:
# * move_down (Game_Character)
# * move_left (Game_Character)
# * move_right (Game_Character)
# * move_up (Game_Character)
# * map_passable? (Game_Player)
# * update (Game_Player)
# * load_database (Scene_Title)
#
# This system redefines the following methods:
# * passable? (Game_Character)
# * move_lower_left (Game_Character)
# * move_lower_right (Game_Character)
# * move_upper_left (Game_Character)
# * move_upper_right (Game_Character)
#
# This system adds the following methods:
# * terrain_tag (Game_Map)
# * passage_tag (Game_Map)
# * tile_index (Game_Map)
# * passable_dir? (Game_Map)
# * bh_read (Game_Map)
# * map_pass? (Game_Character) - Replaces map_passable?
# * new_x (Game_Character)
# * new_y (Game_Character)
# * tile_debug_popup (Game_Player)
#
# This system adds the following module:
# * RPG::Tileset
#
#
#------------------------------------------------------------------------------
#
# CREDITS & THANKS:
# First, I like to give thanks to enterbrain (or enterbrainless) for remo-
# ving an obviously desirable feature. Without them, I wouldn't have this
# fix to offer. ^_^ Like sarcasm?
#
# Also, I would like to thank the RMXP/VX community, including Syvkal and
# KGC who's been dilligant on their own separate tileset systems. Also to
# MG4M3R of Creation Asylum who noticed that the system had previously
# blocked any movement with vehicles.
#
#------------------------------------------------------------------------------
#
# TERMS AND CONDITIONS:
#
# Free to use, even in commercial projects. Just note that I need some form
# of due credit... even a mere mention in some end titles.
#
#==============================================================================
#==========================================================================
# **** YOUR ONE CONFIGURABLE **** #
#==========================================================================
#
# Identify/set the button used in test mode
TILESET_DEBUG_KEY = Input::F8
#==============================================================================
# ** RPG::Tileset
#------------------------------------------------------------------------------
# Data class for imported tileset information.
#==============================================================================
class RPG::Tileset
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :passages # 4-Directional Passage Flags
attr_accessor :terrain_tags # Terrain Tags
#--------------------------------------------------------------------------
# * Object initialization
#--------------------------------------------------------------------------
def initialize
@passages = Table.new(8192)
@terrain_tags = Table.new(8192)
end
end
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Obtain Terrain Tag
# x : X Coordinate
# y : Y Coordinate
#--------------------------------------------------------------------------
def terrain_tag(x, y)
for i in [2, 1, 0]
tile_id = @map.data[x, y, i]
return 0 if tile_id == nil
t_tag = $data_tileset.terrain_tags[tile_index(tile_id)]
return t_tag if t_tag > 0
end
return 0
end
#--------------------------------------------------------------------------
# * Obtain 4-Directional Passage flag
# x : x coordinate
# y : y coordinate
# d : direction
#--------------------------------------------------------------------------
def passage_tag(x, y, d)
for i in [2, 1, 0]
tile_id = @map.data[x, y, i]
return 0 if tile_id == nil
passtag = $data_tileset.passages[tile_index(tile_id)]
passtag = bh_read(passtag, d)
return 0x00 if passtag == nil
return passtag if passtag > 0x00
end
return 0x00
end
#--------------------------------------------------------------------------
# * Obtain Tile ID Index
# tile_id : Tile ID
#--------------------------------------------------------------------------
def tile_index(tile_id)
# Branch on Tile
case tile_id
# Multi-tiled ids in Tileset 'A'
when 2048..8191 ; return ((tile_id - 2000) / 48) - 1
# Individual tile ids in Tileset 'A'
when 1536..1663 ; return(tile_id - 1408)
# Tilesets 'B' to 'E'
when 0..1023 ; return (tile_id + 256)
end
return 0
end
#--------------------------------------------------------------------------
# * Determine if 4-way Passable
# x : x coordinate
# y : y coordinate
# d : direction
#--------------------------------------------------------------------------
def passable_dir?(x, y, d)
for i in [2, 1, 0]
tile_id = @map.data[x, y, i]
return false if tile_id == nil
pass = $data_tileset.passages[tile_index(tile_id)]
case d
when 2 ; return false if pass != 0x00 && bh_read(pass, 1) != 0x01
when 4 ; return false if pass != 0x00 && bh_read(pass, 2) != 0x02
when 6 ; return false if pass != 0x00 && bh_read(pass, 3) != 0x04
when 8 ; return false if pass != 0x00 && bh_read(pass, 4) != 0x08
end
end
return true
end
#--------------------------------------------------------------------------
# * Binary Hexcode Reader
# original value : hexcode flag being read
# direction : direction
#--------------------------------------------------------------------------
def bh_read(original_value, direction)
case original_value
when 0x00
case direction
when 1 ; result = 0x00
when 2 ; result = 0x00
when 3 ; result = 0x00
when 4 ; result = 0x00
end
when 0x01
case direction
when 1 ; result = 0x01
when 2 ; result = 0x00
when 3 ; result = 0x00
when 4 ; result = 0x00
end
when 0x02
case direction
when 1 ; result = 0x00
when 2 ; result = 0x02
when 3 ; result = 0x00
when 4 ; result = 0x00
end
when 0x03 ;
case direction
when 1 ; result = 0x01
when 2 ; result = 0x02
when 3 ; result = 0x00
when 4 ; result = 0x00
end
when 0x04 ;
case direction
when 1 ; result = 0x00
when 2 ; result = 0x00
when 3 ; result = 0x04
when 4 ; result = 0x00
end
when 0x05 ;
case direction
when 1 ; result = 0x01
when 2 ; result = 0x00
when 3 ; result = 0x04
when 4 ; result = 0x00
end
when 0x06 ;
case direction
when 1 ; result = 0x00
when 2 ; result = 0x02
when 3 ; result = 0x04
when 4 ; result = 0x00
end
when 0x07 ;
case direction
when 1 ; result = 0x01
when 2 ; result = 0x02
when 3 ; result = 0x04
when 4 ; result = 0x00
end
when 0x08 ;
case direction
when 1 ; result = 0x00
when 2 ; result = 0x00
when 3 ; result = 0x00
when 4 ; result = 0x08
end
when 0x09 ;
case direction
when 1 ; result = 0x01
when 2 ; result = 0x00
when 3 ; result = 0x00
when 4 ; result = 0x08
end
when 0x0A ;
case direction
when 1 ; result = 0x00
when 2 ; result = 0x02
when 3 ; result = 0x00
when 4 ; result = 0x08
end
when 0x0B ;
case direction
when 1 ; result = 0x01
when 2 ; result = 0x02
when 3 ; result = 0x00
when 4 ; result = 0x08
end
when 0x0C ;
case direction
when 1 ; result = 0x00
when 2 ; result = 0x00
when 3 ; result = 0x04
when 4 ; result = 0x08
end
when 0x0D ;
case direction
when 1 ; result = 0x01
when 2 ; result = 0x00
when 3 ; result = 0x04
when 4 ; result = 0x08
end
when 0x0E ;
case direction
when 1 ; result = 0x00
when 2 ; result = 0x02
when 3 ; result = 0x04
when 4 ; result = 0x08
end
when 0x0F ;
case direction
when 1 ; result = 0x01
when 2 ; result = 0x02
when 3 ; result = 0x04
when 4 ; result = 0x08
end
end
return result
end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass of the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias ts_move_down move_down
alias ts_move_left move_left
alias ts_move_right move_right
alias ts_move_up move_up
#--------------------------------------------------------------------------
# * Determine if Passable
# x : x-coordinate
# y : y-coordinate
# d : direction
#--------------------------------------------------------------------------
def passable?(x, y, d = 10)
nx = new_x(x, d)
ny = new_y(y, d)
nx = $game_map.round_x(nx)
ny = $game_map.round_y(ny)
return false unless $game_map.valid?(nx, ny)
return true if @through or debug_through?
if $game_player.vehicle_type == -1
return false unless map_pass?(x, y, d)
return false unless map_pass?(nx, ny, d)
else
return false unless map_passable?(x, y)
end
return false if collide_with_characters?(nx, ny)
return true
end
#--------------------------------------------------------------------------
# * Determine if Map is Passable
# x : x-coordinate
# y : y-coordinate
# Gets whether the tile at the designated coordinates is passable.
#--------------------------------------------------------------------------
def map_pass?(x, y, d)
return $game_map.passable?(x, y) && $game_map.passable_dir?(x, y, d)
end
#--------------------------------------------------------------------------
# * Obtain the X coordinate after the move
# x : X Coordinate.
# d : Portable direction
#--------------------------------------------------------------------------
def new_x(x, d)
return x + (d == 6 ? 1 : d == 4 ? -1 : 0)
end
#--------------------------------------------------------------------------
# * Obtain the Y coordinate after the move
# y : Y Coordinate.
# d : Portable direction
#--------------------------------------------------------------------------
def new_y(y, d)
return y + (d == 2 ? 1 : d == 8 ? -1 : 0)
end
#--------------------------------------------------------------------------
# * Move Down
# turn_ok : Allows change of direction on the spot
#--------------------------------------------------------------------------
def move_down(turn_ok = true)
if passable?(@x, @y, 2)
ts_move_down(turn_ok)
else
turn_down if turn_ok
check_event_trigger_touch(@x, @y+1)
@move_failed = true
end
end
#--------------------------------------------------------------------------
# * Move Left
# turn_ok : Allows change of direction on the spot
#--------------------------------------------------------------------------
def move_left(turn_ok = true)
if passable?(@x, @y, 4)
ts_move_left(turn_ok)
else
turn_left if turn_ok
check_event_trigger_touch(@x-1, @y)
@move_failed = true
end
end
#--------------------------------------------------------------------------
# * Move Right
# turn_ok : Allows change of direction on the spot
#--------------------------------------------------------------------------
def move_right(turn_ok = true)
if passable?(@x, @y, 6)
ts_move_right(turn_ok)
else
turn_right if turn_ok
check_event_trigger_touch(@x+1, @y)
@move_failed = true
end
end
#--------------------------------------------------------------------------
# * Move Up
# turn_ok : Allows change of direction on the spot
#--------------------------------------------------------------------------
def move_up(turn_ok = true)
if passable?(@x, @y, 8)
ts_move_up(turn_ok)
else
turn_up if turn_ok
check_event_trigger_touch(@x, @y-1)
@move_failed = true
end
end
#--------------------------------------------------------------------------
# * Move Lower Left
#--------------------------------------------------------------------------
def move_lower_left
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
end
if (passable?(@x, @y, 2) && passable?(@x, @y+1, 4)) ||
(passable?(@x, @y, 4) && passable?(@x-1, @y, 2))
@x -= 1
@y += 1
increase_steps
@move_failed = false
else
@move_failed = true
end
end
#--------------------------------------------------------------------------
# * Move Lower Right
#--------------------------------------------------------------------------
def move_lower_right
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
end
if (passable?(@x, @y, 2) && passable?(@x, @y+1, 6)) ||
(passable?(@x, @y, 6) && passable?(@x+1, @y, 2))
@x += 1
@y += 1
increase_steps
@move_failed = false
else
@move_failed = true
end
end
#--------------------------------------------------------------------------
# * Move Upper Left
#--------------------------------------------------------------------------
def move_upper_left
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
if (passable?(@x, @y, 8) && passable?(@x, @y-1, 4)) ||
(passable?(@x, @y, 4) && passable?(@x-1, @y, 8))
@x -= 1
@y -= 1
increase_steps
@move_failed = false
else
@move_failed = true
end
end
#--------------------------------------------------------------------------
# * Move Upper Left
#--------------------------------------------------------------------------
def move_upper_right
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
if (passable?(@x, @y, 8) && passable?(@x, @y-1, 6)) ||
(passable?(@x, @y, 6) && passable?(@x+1, @y, 8))
@x += 1
@y -= 1
increase_steps
@move_failed = false
else
@move_failed = true
end
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles maps. It includes event starting determinants and map
# scrolling functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias ts_map_passable? map_passable?
alias ts_update update
#--------------------------------------------------------------------------
# * Determine if Map is Passable
# x : x-coordinate
# y : y-coordinate
#--------------------------------------------------------------------------
def map_passable?(x, y)
return false unless ts_map_passable?(x, y)
return $game_map.passable_dir?(x, y, @direction)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Perform the original call
ts_update
# If in debug mode and Info Button pressed
if $TEST && TILESET_DEBUG_KEY != nil
if Input.trigger?(TILESET_DEBUG_KEY)
# Show information on tile
tile_debug_popup
end
end
end
#--------------------------------------------------------------------------
# * Show Information on Tile
#--------------------------------------------------------------------------
def tile_debug_popup
t_tag = $game_map.terrain_tag(x, y)
message = "Terrain Tag: #{t_tag}"
message2 = ""
for d in 1..4
pass = $game_map.passage_tag(x,y,d)
message2 += "V" if pass == 0x01
message2 += "<" if pass == 0x02
message2 += ">" if pass == 0x04
message2 += "Λ" if pass == 0x08
end
message2 = "(none set)" if message2 == ""
message += "\n"
message += "4-Dir. Passage: "
message += message2
print message
end
end
#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
# This class performs the title screen processing.
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias ts_load load_database
#--------------------------------------------------------------------------
# * Load Database
#--------------------------------------------------------------------------
def load_database
# Perform the original call
ts_load
# Add the tileset data
$data_tileset = load_data("Data/Tilesets.rvdata")
end
end
Cualquier duda sobre ello, lamento decir que no me he tomado el tiempo para ver como funciona, ya que el post lo hago por un problema que tuvo un usuario con el siguiente script, que es para ver el reflejo en el agua.
- Código:
#==============================================================================
# ** TDS Sprite Reflect
# Version: 2.4
# Special Thanks: DerVVulfman for his Tileset Read and Tile Drawer.
#------------------------------------------------------------------------------
# This script will give a reflection effect to map sprites when they step in
# front of water or special places with a certain terrain.
#==============================================================================
# WARNING:
#
# Do not release, distribute or change my work without my expressed written
# consent, doing so violates the terms of use of this work.
#
# * Not Knowing English or understanding these terms will not excuse you in any
# way from the consequenses.
#
# Contact Email: [Tienes que estar registrado y conectado para ver este vínculo]
#==============================================================================
# Instructions:
#
# For terrain editing please reffer to DerVVulfman Tileset Reader and
# Tile Drawer.
#
# For events you can use these two commands in part of their name.
#
# Reflect
#
# Any event with "Reflect" as part of it's name will have the reflect effect on
# the special areas of the map.
#
#
# /OFFSET[#]
#
# [#] = Numerical value of the offset.
#
# Example:
# /OFFSET[10]
#
# Offset changes the Y offset of the sprite in the water.(How far is the
# Reflection from the characters original standing point)
#
#
# $game_player.reflect_offset = #
#
# # = Value of the character offset.
#
# Just the same as the event offset except this one handles the characters
# offset reflection.
#==============================================================================
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
# Activate the wave effect on the water
WATER_WAVE_EFFECT = true
# Number of the reflect terrain tag
REFLECT_TERRAIN_TAG = 1
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
# This sprite is used to display characters. It observes a instance of the
# Game_Character class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Reflect < Sprite_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :character
#--------------------------------------------------------------------------
# * Object Initialization
# viewport : viewport
# character : character (Game_Character)
# offset : offset value from the characters starting point.
#--------------------------------------------------------------------------
def initialize(viewport = nil, character = nil, offset = nil)
super(viewport)
self.visible = false
@character = character
@player_offset = $game_player.reflect_offset
@offset = (@character.is_a?(Game_Player) ? @player_offset : offset)
sprite_setup
update
graphical_update
end
#--------------------------------------------------------------------------
# * Sprite Setup
#--------------------------------------------------------------------------
def sprite_setup
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_index != @character.character_index
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_index = @character.character_index
self.angle = 180
self.mirror = true
self.opacity = 120
if @tile_id > 0
sx = (@tile_id / 128 % 2 * 8 + @tile_id % 8) * 32;
sy = @tile_id % 256 / 8 % 16 * 32;
self.bitmap = tileset_bitmap(@tile_id)
self.src_rect.set(sx, sy, 32, 32)
self.ox = 16
self.oy = 32
else
self.bitmap = Cache.character(@character_name)
sign = @character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
@cw = bitmap.width / 3
@ch = bitmap.height / 4
else
@cw = bitmap.width / 12
@ch = bitmap.height / 8
end
self.ox = @cw / 2
self.oy = @ch
end
end
end
#--------------------------------------------------------------------------
# * Get tile set image that includes the designated tile
# tile_id : Tile ID
#--------------------------------------------------------------------------
def tileset_bitmap(tile_id)
set_number = tile_id / 256
return Cache.system("TileB") if set_number == 0
return Cache.system("TileC") if set_number == 1
return Cache.system("TileD") if set_number == 2
return Cache.system("TileE") if set_number == 3
return nil
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If visible update Graphics
if self.visible
graphical_update
end
self.x = @character.screen_x
self.y = @character.screen_y
if @tile_id == 0
self.z = @character.screen_z-90
else
self.z = @character.screen_z-25
end
if WATER_WAVE_EFFECT == true
self.wave_amp = 1
self.wave_length = 1
self.wave_speed = 3
end
end
#--------------------------------------------------------------------------
# * Graphical Update
#--------------------------------------------------------------------------
def graphical_update
if @tile_id == 0
index = @character.character_index
pattern = @character.pattern < 3 ? @character.pattern : 1
sx = (index % 4 * 3 + pattern) * @cw
sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
self.src_rect.set(sx, sy, @cw, @ch)
if @character.is_a?(Game_Player)
self.ox = @cw / 2
self.oy = 8 + @ch + $game_player.reflect_offset
else
self.ox = @cw / 2
self.oy = 8 + @ch + @offset
end
end
end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias tds_sprite_reflection_initialize initialize
def initialize
create_reflection_sprites
tds_sprite_reflection_initialize
end
#--------------------------------------------------------------------------
# * Create Reflection Sprites
#--------------------------------------------------------------------------
def create_reflection_sprites
@event_reflection_sprite = []
@reflecting_events = []
for i in $game_map.events.keys.sort
@event_name_offset = $game_map.events[i].name
@event_name_offset[ /\/OFFSET\[(.*?)\]/ ]
sprite = Sprite_Reflect.new(@viewport1, $game_map.events[i], $1 != nil ? $1.to_i : 0)
if $game_map.events[i].name.include?("Reflect")
@event_reflection_sprite.push(sprite)
@reflecting_events.push($game_map.events[i])
end
end
@reflection_sprite = Sprite_Reflect.new(@viewport1, $game_player, 0)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias tds_sprite_reflection_update update
def update
tds_sprite_reflection_update
if $game_player.reflect_terrain_tag == REFLECT_TERRAIN_TAG
if $game_player.moving? == false
@reflection_sprite.visible = true
end
else
@reflection_sprite.visible = false
end
for i in [Tienes que estar registrado y conectado para ver este vínculo]
@event_reflection_sprite[i].update
if @reflecting_events[i].visible_on_screen?(@reflecting_events[i].x, @reflecting_events[i].y) == false
next @event_reflection_sprite[i].visible = false
end
if @reflecting_events[i].visible_on_screen?(@reflecting_events[i].x, @reflecting_events[i].y) and
@reflecting_events[i].reflect_terrain_tag == REFLECT_TERRAIN_TAG
if @reflecting_events[i].moving? == false
@event_reflection_sprite[i].visible = true
end
else
@event_reflection_sprite[i].visible = false
end
end
if @reflection_sprite.visible == true
@reflection_sprite.update
end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias tds_sprite_reflection_dispose dispose
def dispose
for i in [Tienes que estar registrado y conectado para ver este vínculo]
@event_reflection_sprite[i].dispose
end
@reflection_sprite.dispose
tds_sprite_reflection_dispose
end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass of the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :reflect_offset # Character Reflection Offset
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias tds_sprite_reflection_initialize initialize
def initialize
@reflect_offset = 0
tds_sprite_reflection_initialize
end
#--------------------------------------------------------------------------
# * Visible on Screen?
#--------------------------------------------------------------------------
def visible_on_screen?(x,y)
visible_screen_x = $game_map.display_x / 256
visible_screen_y = $game_map.display_y / 256
if x >= visible_screen_x - 2 && visible_screen_x <= visible_screen_x + 17 &&
y >= visible_screen_y - 2 && visible_screen_y + 2 <= visible_screen_y + 13
return true
end
return false
end
#--------------------------------------------------------------------------
# * Return Reflect Terrain Tag
#--------------------------------------------------------------------------
def reflect_terrain_tag
return $game_map.terrain_tag(@x, @y + 1)
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
#--------------------------------------------------------------------------
# * Return Even Name
#--------------------------------------------------------------------------
def name
return @event.name
end
end
Cómo funciona para que se refleje el pj en el agua?, sencillo, con el programa sólo tagean los tiles que quieren que reflejen con el número 1, y guardan (en la parte izquierda del programa estan las indicaciones, pero para guardar se usa la tecla "ctrl" por si andan perdidos). Este programa generará un archivo llamado "Tilesets.rvdata", este archivo deben dejarlo en la carpeta Data de su proyecto. Con eso, ya podrán ver el reflejo de su personaje en donde hayan tageado que se vea XD.
Nota: No olviden que algunos scripts inicializan algunas características del juego por lo que sólo funcionan en nuevas partidas, partidas guardadas anteriormente no contienen los datos nuevos inicializados, por ende, fallaran al cargar el archivo guardado o cuando el juego intente carga la caracteristica que se no ha sido inicializada en la partida guardad.
En general las explicaciones de como utilizar vienen en los scripts, así que aprendan inglés XD
JKLmaster- 220
-
36
232
1232
82
Extras
Sobre mí::
Temas similares
» Reflejo en el agua (o donde kieran)
» Scripts para RPG Maker VX[capas que para el vx ace tmb funcione]
» Paquete de scripts para VX
» Reglas del Foro de Scripts
» Scripts: varios nombres para el mapa...
» Scripts para RPG Maker VX[capas que para el vx ace tmb funcione]
» Paquete de scripts para VX
» Reglas del Foro de Scripts
» Scripts: varios nombres para el mapa...
RPG maker VX :: Scripts ::
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.