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" />

Vai al contenuto


Toggle Chat RM - Chat Apri la Chat in un popup

E' severamente vietato richiedere supporto su RPG Maker in chat!
@  MihaChan : (23 May 2012 - 09:19 PM) a parte i denti -che stanno decidendo di darmi noia in questi giorni-, tutto okay~
@  Melosx : (23 May 2012 - 09:18 PM) bene ^.^ ... Tu??
@  MihaChan : (23 May 2012 - 09:17 PM) come va? xD
@  MihaChan : (23 May 2012 - 09:16 PM) okay
@  MihaChan : (23 May 2012 - 09:16 PM) ah
@  Melosx : (23 May 2012 - 09:14 PM) ciao miha... ai dont spic inglisc
@  MihaChan : (23 May 2012 - 09:12 PM) how'sa goin'?
@  MihaChan : (23 May 2012 - 09:12 PM) ciao Mel!
@  Melosx : (23 May 2012 - 09:07 PM) ciao
@  MihaChan : (23 May 2012 - 09:06 PM) salve D:
@  Pech93 : (23 May 2012 - 08:05 PM) MIk?
@  Melosx : (23 May 2012 - 07:51 PM) VIENI SU MSN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:51 PM) MIIIIIIIIIIIIIIIIIIIKKKKKKKKKKKK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:46 PM) *iù
@  Melosx : (23 May 2012 - 07:38 PM) iu spin mi rai rau bebi rai rau laic a record bebi rau rau rau rau
@  Melosx : (23 May 2012 - 07:37 PM) lalalallalallalallallllllllllalalalallaaaaaaaaaaaaaaaaaaaaaa!!!!!!!!!!!!!!!!!!
@  Melosx : (23 May 2012 - 07:37 PM) lalalalala
@  Melosx : (23 May 2012 - 07:37 PM) naoinvaoèvpodlnvvrovnovnondpppppppppmvdgdvjomvmvpe
@  Melosx : (23 May 2012 - 07:36 PM) che coa che robaé
@  Abadon : (23 May 2012 - 07:34 PM) dopo che il forum è andato fuori servizio si è persa un po' la chat D:

Modifica RGB ai chara


  • Per cortesia connettiti per rispondere
Nessuna risposta a questa discussione

#1 OFFLINE   Ally

Ally

    Fondatori

  • Amministratori
  • 5558 Messaggi:
  • Localitàrpgmkr
  • Ruolo:
    Scripter
  • Progetto VX:
    Essence
  • Tool:
    RM2k/2k3

Inviato 12 September 2011 - 12:41 AM

Nome Script: Modifica RGB ai chara
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

[r.....] per il rosso ( -255 to 255 )
[g....] per il verde ( -255 to 255 )
[b....] per il blu ( -255 to 255 )
[al...] per il canale alpha ( 0 to 255 )
Praticamente funziona come il cambio di tonalità all'interno del tool per quanto riguarda le picture, mentre questa da la possibilità di cambiarlo ai chara durante il gioco.

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

Immagine inserita
Spoiler




1 utente(i) stanno leggendo questa discussione

0 utenti, 1 ospiti, 0 utenti anonimi