Versione: N/D
Autore/i: Nechigawara Sanzenin
Informazioni:
Script che con dei commenti cambia il colore RGB e Alpha degli eventi =)
Istruzioni:
Inserite lo script sopra Main.
Per cambiare colore a un evento, inserite un commento con i seguenti comandi:
Citazione
[g....] per il verde ( -255 to 255 )
[b....] per il blu ( -255 to 255 )
[al...] per il canale alpha ( 0 to 255 )
Script:
#========================================
# Edit Character Channel
# By Nechigawara Sanzenin
#========================================
=begin
Edit Charater Color in Map
How to Use : Add these text to comment in the event page
[r.....] For Red Channal ( -255 to 255 )
[g....] For Green Channal ( -255 to 255 )
[b....] For Blue Channal ( -255 to 255 )
[al...] For Alpha Channal ( 0 to 255 )
=end
class Game_Character
attr_accessor :tone
#--------------------------------------------------------------------------
# - Object initialization
#--------------------------------------------------------------------------
alias inc_initialize initialize
def initialize
inc_initialize
@tone = [0,0,0,0]
end
end
#==============================================================================
class Game_Event < Game_Character
alias inc_update update
def update
# check Code
for i in 0...@list.size
next if @list[i].code != 108
# For Red Channel
if @list[i].parameters[0].include?("[r")
text = @list[i].parameters[0].scan(/[r([-,0-9]+)]/)
red = $1.to_i
if red > 255
red = 255
elsif red < -255
red = -255
end
@tone[0] = red
end
# For Green Channel
if @list[i].parameters[0].include?("[g")
text = @list[i].parameters[0].scan(/[g([-,0-9]+)]/)
green = $1.to_i
if green > 255
green = 255
elsif green < -255
green = -255
end
@tone[1] = green
end
# For Blue Channel
if @list[i].parameters[0].include?("[b")
text = @list[i].parameters[0].scan(/[b([-,0-9]+)]/)
blue = $1.to_i
if blue > 255
blue = 255
elsif blue < -255
blue = -255
end
@tone[2] = blue
end
# For Alpha Channel
if @list[i].parameters[0].include?("[al")
text = @list[i].parameters[0].scan(/[al([0-9]+)]/)
alpha = $1.to_i
if alpha > 255
alpha = 255
elsif alpha < 0
alpha = 0
end
@tone[3] = alpha
end
end
#Load Orginal Update
inc_update
end
end
#==============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# - Frame renewal
#--------------------------------------------------------------------------
def update
super
@character.update
self.tone.set(@character.tone[0],@character.tone[1],@character.tone[2],@character.tone[3])
# When tile ID and file name, either one of hue differs from present ones
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# Tile ID and file name, remembering hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# When it is the value whose tile ID is effective
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# When it is the value whose tile ID is invalid
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
end
# Setting visible state
self.visible = (not @character.transparent)
# When graphics is the character
if @tile_id == 0
# Setting transfer original rectangle
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
# Setting the coordinate of sprite
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# Opacity, synthetic method, setting thicket depth
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animation
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
end













