A small test bed:
White Ties Shadows, Custom Character Cursor, View Range edit...
by Azrith001
Apr 2 2009
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given.
Hello,
I thought I should release something I have been holding for a while now a test bed of three scripts and growing.
give credit or you will die a most painful death.
please rate the topic, makes it easier for me to set up on my website XD
the scripts include:
White Ties Shadows
Arrow over head
View Range Enhanced
Bug Fixes: 'NOT IN DEMO'
Replace the script White Ties Shadows with the one below:
Shadow Script Fix by: GubiD
Code:
module WTSM
SHADOW_DIV = 3 # This is the (opacity / (SHADOW_DIV * 2))
end
class Game_Character
attr_accessor :jump_count # transparent flag
attr_accessor :jump_peak # transparent flag
end
class WTS < RPG::Sprite
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :character # character
attr_accessor :set # character
attr_accessor :ow # character
#--------------------------------------------------------------------------
# * Object Initialization
# viewport : viewport
# character : character (Game_Character)
#--------------------------------------------------------------------------
def initialize(viewport, character = nil, opa=255, cw=1)
super(viewport)
@character = character
@opa = opa
@ow = 1
@hide_shadow = false
@shadow_size = 1.0
if !@character.nil? and !@character.is_a?(Game_Player)
list = @character.list
for command in list
if command.code == 108 #comment
if command.parameters[0] == "no shadow"
@hide_shadow = true
elsif command.parameters[0].include?("shadow size=")
val = command.parameters[0].delete("shadow size=").to_f/100
@shadow_size = val
end
end
end
end
update
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# Remember tile ID, file name, and hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# If tile ID value is valid
if self.bitmap == nil
self.bitmap = RPG::Cache.character("shadow00", 0)
@cw = bitmap.width
@ch = bitmap.height
self.ox = @cw / 2
self.oy = @ch
# Set visible situation
self.visible = (not @character.transparent)
self.visible = false if @hide_shadow
# If graphic is character
sx = 0
sy = 0
self.src_rect.set(sx, sy, @cw, @ch)
end
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)-1
self.opacity = @opa
# Set opacity level, blend method, and bush depth
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
end
def cordinate
self.x = @character.screen_x
if @character.jumping? != true and @character != nil
self.y = @character.screen_y
elsif (@character.direction == 2 or @character.direction == 8)
set_jump
end
get_size
self.z = @character.screen_z(@ch)-1
end
def set_jump
if @character.jumping? and @character.moving?
self.y = @character.screen_y + @ch + @character.jump_count
end
end
def get_size
if @character.jumping? and @character.jump_count > @character.jump_peak
self.zoom_x -= 0.05
self.opacity -= 1
self.zoom_y -= 0.05
elsif @character.jumping? and @character.jump_count <= @character.jump_peak
self.zoom_x += 0.05
self.opacity += 1
self.zoom_y += 0.05
else
self.opacity = @opa
bit = RPG::Cache.character(@character_name, @character_hue)
wi = bit.width/4
zoom_value = wi/40.00
self.zoom_x = zoom_value < 0.5 ? 0.5 : zoom_value
self.zoom_y = zoom_value < 0.5 ? 0.5 : zoom_value
end
self.zoom_x *= @shadow_size
self.zoom_y *= @shadow_size
end
end