Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Composite Characters/Visual Equipment, by modern algebra
Rory
post Sep 4 2008, 10:33 PM
Post #1


GFX Pro
Group Icon

Group: +Gold Member
Posts: 409
Type: Artist
RM Skill: Skilled




Composite Characters/Visual Equipment
Version: 1.0
Author: modern algebra
Date: July 5, 2008

Description:
This script allows you to create character sets from multiple character sheets, layering them on top of each other. It also allows you to set character graphics to armors and weapons, and these character sets will be layered on top of the character, thus making it a Visual Equipment script as well.

Features
Easy configuration
Hundreds of unique characters can be made from a limited set of resources.
Allows you to set hue for character sheets, meaning each resource can have hundreds of distinct colours.
Allows any weapon or armor to have any number of character sets stacked onto the character upon equip.
Events and Actors can also be set up so that they are composed of multiple character sets

Screenshots

All character sets seen composed of this one character sheet, with all resources taken from the character generator here: http://www.famitsu.com/freegame/tool/chibi/index1.html


CODE
#==============================================================================
#  Composite Characters / Visual Equipment
#  Version 1.0
#  Author: modern algebra (rmrk.net)
#  Date: July 5, 2008
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#
#    Place this script in between Materials and Main in the Script Editor
#
#    To set a graphic for an armor or weapon, all you need to do is place this
#  code in the Notes box of the item:
#
#    \CG[<Name of Character Set>, <index in character set>, <hue>]
#
#  If you leave out index, it defaults to 0 and if you leave out hue, it also
#  defaults to 0. You can put more than one graphic to an armor or weapon and
#  they will stack, first one on bottom last one on top.
#
#    Setting up an Event is similar - all you need to do is place a comment at
#  the very beginning of the event and put in the same code to generate a
#  composite character set for the event. Same rules apply, and remember, you
#  can stack character sets.
#
#  EXAMPLES:
#    \cg[Actor1, 2]     # Character Set = Actor1 : index = 2 : hue = 0
#    \CG[Evil]          # Character Set = Evil   : index = 0 : hue = 0
#    \cG[Actor2, 3, 50] # Character Set = Actor2 : index = 3 : hue = 50
#
#  Setting up your Actors is similar - see line 151 for details.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Compatibility:
#
#    Unfortunately, I did need to overwrite some methods for this script, and
#  as such there are likely to be compatibility problems. I know that my
#  Extra Movement Frames Script certainly will not work with this script, and
#  any script that tampers with the way a character set is drawn will also
#  likely encounter problems. Now, this is not to say that any script that
#  draws a character set will be incompatible - as long as that scripter uses
#  the draw_actor_graphic method of Window_Base it should work fine - it is
#  only scripts that change the way a character set is drawn that will cause
#  problems. Also, I tamper with the load_gamedata method of Window_SaveFile,
#  and so if another script overwrites that then there will again be
#  compatibility issues. If you find a script that seems to cause problems,
#  please post at the topic at rmrk.net and I will try my best to assist you.
#==============================================================================

#==============================================================================
# *** module Cache
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - composite_character
#==============================================================================

module Cache
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Composite Character
  #    char_array : An array holding the names of all parts of a graphic
  #--------------------------------------------------------------------------
  #  Composes a single character bitmap out of all the ones given.
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def self.composite_character (char_array)
    @cache = {} if @cache == nil
    # Blank bitmap if there is nothing in the array.
    @cache[char_array] = Bitmap.new (32, 32) if char_array.empty?
    # If not in the cache
    if !@cache.include? (char_array) || @cache[char_array].disposed?
      # Create a template bitmap
      bitmap = Bitmap.new (32, 32)
      # Add in all other graphics
      char_array.each { |i|
        name, index, hue = i[0], i[1], i[2]
        # Bypass self.character in order to allow for setting hue
        bmp = load_bitmap ("Graphics/Characters/", name, hue)
        sign = name[/^[\!\$]./]
        # Get the width and height of the single character
        if sign != nil && sign.include? ('$')
          wdth, hght = bmp.width, bmp.height
        else
          wdth = bmp.width / 4
          hght = bmp.height / 2
        end
        # Expand bitmap if necessary
        if bitmap.width < wdth || bitmap.height < hght
          # Recreate bitmap
          temp_bmp = bitmap.dup
          bitmap = Bitmap.new ([temp_bmp.width, wdth].max, [temp_bmp.height, hght].max)
          bitmap.blt (0, 0, temp_bmp, temp_bmp.rect)
          temp_bmp.dispose
        end
        # Draw new character graphic onto bitmap
        src_rect = Rect.new ((index%4)*wdth, (index/4)*hght, wdth, hght)
        bitmap.blt (0, 0, bmp, src_rect)
      }
      @cache[char_array] = bitmap
    end
    return @cache[char_array]
  end
end

#==============================================================================
# ** RPG::BaseItem
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - character_graphics
#==============================================================================

class RPG::BaseItem
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Character Graphics
  #--------------------------------------------------------------------------
  #  Retrieves Character Graphics from Note Field
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def character_graphics
    graphics = []
    # Retrieve Note Field
    text = self.note.dup
    while text.sub! (/\\cg\[([\w\s]+),*\s*(\d*),*\s*(\d*)\]/i) { '' } != nil
      graphics.push ([$1.to_s, $2.to_i, $3.to_i])
    end
    return graphics
  end
end


#==============================================================================
# ** Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - composite_character
#    aliased_method - initialize, change_equip
#==============================================================================

class Game_Actor
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_writer :composite_character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initalization
  #-------------------------------------------------------------------------
  #  Initializes stacked_character variable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_arclght_vsual_equip_init_4t6h initialize
  def initialize (id)
    # Run Original Method
    modalg_arclght_vsual_equip_init_4t6h (id)
    @composite_character = []
    case @actor_id
    #---------------------------------------------------------------------
    # EDITABLE REGION
    #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    #  An actor will automatically have whatever you set in the database
    #  as a bottom layer for him, but if you need to have other character
    #  sets piled on top, then put them in this format:
    #
    #  when <actor_id>
    #    @composite_character.push (['graphic_name', index, hue])
    #      *for as many graphics as you want - first ones drawn first. If you
    #       want to know what each is, see the Instructions in the header.
    #----------------------------------------------------------------------
    when 1 # 1st Actor
      # Create Hair Sprite
      @composite_character.push (['VisEquipSample', 1, 100])
    when 3 # 3rd Actor
      # Create skin sprite with different hue
      @composite_character.push (['VisEquipSample', 0, 20])
      # Create Hair Sprites
      @composite_character.push (['VisEquipSample', 2, 75])
      @composite_character.push (['VisEquipSample', 3, 75])
    #----------------------------------------------------------------------
    # END EDITABLE REGION
    #----------------------------------------------------------------------
    end
    @composite_character.each { |i|
      i[1] = 0 if i[1] == nil
      i[2] = 0 if i[2] == nil
    }
    @composite_character.unshift ([@character_name, @character_index, 0]) if @character_name != ''
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Composite Character
  #--------------------------------------------------------------------------
  #  Returns Graphic Array for the actor
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def composite_character
    armor_graphics = []
    weapon_graphics = []
    # Body Armor, then Helmet, then Shield, then all others
    dup_armors = armors.dup
    for i in 0...2
      j = 2 - i
      armor_graphics += dup_armors[j].character_graphics if dup_armors[j] != nil
      dup_armors.delete_at (j)
    end
    # If there is some multi-equip script, will get accessories and rest in order
    dup_armors.each { |armr| armor_graphics += armr.character_graphics if armr != nil }
    weapons.each { |wpn| weapon_graphics += wpn.character_graphics if wpn != nil }
    return @composite_character + armor_graphics + weapon_graphics
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Change Equipment (designate object)
  #--------------------------------------------------------------------------
  #  Refresh Player to demonstrate armor cg
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_rfrsh_plyer_eq_chnge_8mj2 change_equip
  def change_equip(equip_type, item, test = false)
    modalg_rfrsh_plyer_eq_chnge_8mj2 (equip_type, item, test)
    $game_player.refresh
  end
end

#==============================================================================
# ** Game_Party
#==============================================================================
class Game_Party
  attr_reader :actors
end

#==============================================================================
# ** Game_Character
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new instance variable - composite_character
#==============================================================================

class Game_Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader :composite_character
end

#==============================================================================
# ** Game_Event
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - setup
#==============================================================================

class Game_Event
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Event page setup
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malgbr_rclgh_req_comp_char_setup_5msk setup
  def setup(new_page)
    malgbr_rclgh_req_comp_char_setup_5msk (new_page)
    # Create Composite Character
    @composite_character = []
    @composite_character.push ([@character_name, @character_index, 0]) unless @character_name.nil?
    # If page == nil, return
    return if @page == nil
    # Retrieve  first line comments
    comments = []
    @page.list.each { |i| i.code == 108 || i.code == 408 ? comments.push (i) : break }
    # Evaluate comments for \CG codes
    comments.each { |i|
      text = i.parameters[0].dup
      while text.sub! (/\\cg\[([\w\s]+),*\s*(\d*),*\s*(\d*)\]/i) { '' } != nil
        @composite_character.push ([$1.to_s, $2.to_i, $3.to_i])
      end
    }
  end
end

#==============================================================================
# ** Game_Player
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - refresh
#==============================================================================

class Game_Player
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mdalg_arc_comp_character_find_rfrsh_8kwi refresh
  def refresh
    mdalg_arc_comp_character_find_rfrsh_8kwi
    return if $game_party.members.empty?
    @composite_character = $game_party.members[0].composite_character
  end
end

#==============================================================================
# ** Sprite_Character
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - update_bitmap
#==============================================================================

class Sprite_Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Transfer Origin Bitmap
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modern_alg_arclightrequest_visual_equip_bmp_update update_bitmap
  def update_bitmap
    if @tile_id != @character.tile_id or
       @character_name != @character.character_name or
       @character_index != @character.character_index ||
       @composite_character != @character.composite_character
      @tile_id = @character.tile_id
      @character_name = @character.character_name
      @character_index = 0
      @composite_character = @character.composite_character
      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
        if @composite_character == nil
          # Regular Character Picture
          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
        else
          self.bitmap = Cache.composite_character(@composite_character)
          @cw = self.bitmap.width / 3
          @ch = self.bitmap.height / 4
        end
          self.ox = @cw / 2
          self.oy = @ch
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Rectangle
  #--------------------------------------------------------------------------
  def update_src_rect
    if @tile_id == 0
      index = 0
      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)
    end
  end
end

#==============================================================================
# ** Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    overwritten method - draw_character_graphic
#==============================================================================

class Window_Base  
  #--------------------------------------------------------------------------
  # * Draw Actor Walking Graphic
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y)
    bitmap = Cache.composite_character (actor.composite_character)
    cw = bitmap.width / 3
    ch = bitmap.height / 4
    rect = Rect.new (cw, 0, cw, ch)
    self.contents.blt (x - (cw / 2), y - ch, bitmap, rect)
  end
end

#==============================================================================
# ** Window_SaveFile
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    overwritten_methods - load_gamedata,
#==============================================================================

class Window_SaveFile < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Load Partial Game Data
  #--------------------------------------------------------------------------
  #  The same as the original method with the exception that it gets all of
  #  that file's data up to @game_party - necessary for composite graphics
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def load_gamedata
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      begin
        @characters     = Marshal.load(file)
        @frame_count    = Marshal.load(file)
        @last_bgm       = Marshal.load(file)
        @last_bgs       = Marshal.load(file)
        @game_system    = Marshal.load(file)
        @game_message   = Marshal.load(file)
        @game_switches  = Marshal.load(file)
        @game_variables = Marshal.load(file)
        # Bypass self-switches
        @game_self_switches = Marshal.load(file)
        # Bypass Actors
        @game_actors = Marshal.load(file)
        # Get Party
        @game_party = Marshal.load (file)
        @total_sec = @frame_count / Graphics.frame_rate
      rescue
        @file_exist = false
      ensure
        file.close
      end
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Party Characters
  #     x : Draw spot X coordinate
  #     y : Draw spot Y coordinate
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_party_characters(x, y)
    for i in 0...@game_party.actors.size
      draw_actor_graphic (@game_actors[@game_party.actors[i]], x + i * 48, y)
    end
  end
end


Credit
modern algebra
-Writing the script

Known Compatibility Issues
Any scripts that play around with the way character sets are drawn will undoubtedly have some problems with this script. If you encounter any problems, please post the error and the script that is causing the problem and I will see if I can make them compatible.

Does not work with Dash Animation
Does not work with Extra Movement Frames

*NOTE* I did not make this script, I'm bringing this over from another forum *NOTE*

DEMO File included in Attachments
Attached File(s)
Attached File  Visual_Equipment.zip ( 266.55K ) Number of downloads: 498
 


__________________________

THE SAVAGE NYMPH
Note: this is Magdreamer, I'm using my real name for my forum name now.
Go to the top of the page
 
+Quote Post
   
post Sep 5 2008, 03:34 AM
Post #2





Group:
Posts: 0
Type: Writer
RM Skill: Undisclosed




I'm going to check it out in a second but would this script work with the caterpillar script?

It would be nice if it did.
Go to the top of the page
 
+Quote Post
   
Rory
post Sep 5 2008, 03:56 AM
Post #3


GFX Pro
Group Icon

Group: +Gold Member
Posts: 409
Type: Artist
RM Skill: Skilled




I'd guess, not properly. Probably only the first character will have the visual equipment. Try it though.


__________________________

THE SAVAGE NYMPH
Note: this is Magdreamer, I'm using my real name for my forum name now.
Go to the top of the page
 
+Quote Post
   
modern algebra
post Sep 9 2008, 06:28 AM
Post #4


Level 11
Group Icon

Group: Revolutionary
Posts: 191
Type: Scripter
RM Skill: Skilled




Well, assuming you are referring to Diedrupo's Caterpillar Script, then it will not by default. However, if you go into that script to line 88 and see:

CODE
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup
    if @actor != nil      
      @character_name = $game_actors[@actor].character_name
      @character_index = $game_actors[@actor].character_index
    else
      @character_name = ""
      @character_index = 0
    end
    @opacity = 255
    @blend_type = 0
    @priority_type = 0
  end


replace it with:

CODE
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup
    if @actor != nil      
      @composite_character = $game_actors[@actor].composite_character
    else
      @character_name = ""
      @character_index = 0
      @composite_character = nil
    end
    @opacity = 255
    @blend_type = 0
    @priority_type = 0
  end


It should work fine then.

This post has been edited by modern algebra: Sep 9 2008, 06:28 AM
Go to the top of the page
 
+Quote Post
   
ZFMaster
post Oct 10 2008, 11:37 AM
Post #5


ZFMaster; Master at Zelda Freaking.
Group Icon

Group: Revolutionary
Posts: 160
Type: Developer
RM Skill: Masterful




QUOTE (Magdreamer @ Sep 4 2008, 10:33 PM) *
Composite Characters/Visual Equipment
Version: 1.0
Author: modern algebra
Date: July 5, 2008

Description:
This script allows you to create character sets from multiple character sheets, layering them on top of each other. It also allows you to set character graphics to armors and weapons, and these character sets will be layered on top of the character, thus making it a Visual Equipment script as well.

Features
Easy configuration
Hundreds of unique characters can be made from a limited set of resources.
Allows you to set hue for character sheets, meaning each resource can have hundreds of distinct colours.
Allows any weapon or armor to have any number of character sets stacked onto the character upon equip.
Events and Actors can also be set up so that they are composed of multiple character sets

Screenshots

All character sets seen composed of this one character sheet, with all resources taken from the character generator here: http://www.famitsu.com/freegame/tool/chibi/index1.html


CODE
#==============================================================================
#  Composite Characters / Visual Equipment
#  Version 1.0
#  Author: modern algebra (rmrk.net)
#  Date: July 5, 2008
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#
#    Place this script in between Materials and Main in the Script Editor
#
#    To set a graphic for an armor or weapon, all you need to do is place this
#  code in the Notes box of the item:
#
#    \CG[<Name of Character Set>, <index in character set>, <hue>]
#
#  If you leave out index, it defaults to 0 and if you leave out hue, it also
#  defaults to 0. You can put more than one graphic to an armor or weapon and
#  they will stack, first one on bottom last one on top.
#
#    Setting up an Event is similar - all you need to do is place a comment at
#  the very beginning of the event and put in the same code to generate a
#  composite character set for the event. Same rules apply, and remember, you
#  can stack character sets.
#
#  EXAMPLES:
#    \cg[Actor1, 2]     # Character Set = Actor1 : index = 2 : hue = 0
#    \CG[Evil]          # Character Set = Evil   : index = 0 : hue = 0
#    \cG[Actor2, 3, 50] # Character Set = Actor2 : index = 3 : hue = 50
#
#  Setting up your Actors is similar - see line 151 for details.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Compatibility:
#
#    Unfortunately, I did need to overwrite some methods for this script, and
#  as such there are likely to be compatibility problems. I know that my
#  Extra Movement Frames Script certainly will not work with this script, and
#  any script that tampers with the way a character set is drawn will also
#  likely encounter problems. Now, this is not to say that any script that
#  draws a character set will be incompatible - as long as that scripter uses
#  the draw_actor_graphic method of Window_Base it should work fine - it is
#  only scripts that change the way a character set is drawn that will cause
#  problems. Also, I tamper with the load_gamedata method of Window_SaveFile,
#  and so if another script overwrites that then there will again be
#  compatibility issues. If you find a script that seems to cause problems,
#  please post at the topic at rmrk.net and I will try my best to assist you.
#==============================================================================

#==============================================================================
# *** module Cache
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - composite_character
#==============================================================================

module Cache
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Composite Character
  #    char_array : An array holding the names of all parts of a graphic
  #--------------------------------------------------------------------------
  #  Composes a single character bitmap out of all the ones given.
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def self.composite_character (char_array)
    @cache = {} if @cache == nil
    # Blank bitmap if there is nothing in the array.
    @cache[char_array] = Bitmap.new (32, 32) if char_array.empty?
    # If not in the cache
    if !@cache.include? (char_array) || @cache[char_array].disposed?
      # Create a template bitmap
      bitmap = Bitmap.new (32, 32)
      # Add in all other graphics
      char_array.each { |i|
        name, index, hue = i[0], i[1], i[2]
        # Bypass self.character in order to allow for setting hue
        bmp = load_bitmap ("Graphics/Characters/", name, hue)
        sign = name[/^[\!\$]./]
        # Get the width and height of the single character
        if sign != nil && sign.include? ('$')
          wdth, hght = bmp.width, bmp.height
        else
          wdth = bmp.width / 4
          hght = bmp.height / 2
        end
        # Expand bitmap if necessary
        if bitmap.width < wdth || bitmap.height < hght
          # Recreate bitmap
          temp_bmp = bitmap.dup
          bitmap = Bitmap.new ([temp_bmp.width, wdth].max, [temp_bmp.height, hght].max)
          bitmap.blt (0, 0, temp_bmp, temp_bmp.rect)
          temp_bmp.dispose
        end
        # Draw new character graphic onto bitmap
        src_rect = Rect.new ((index%4)*wdth, (index/4)*hght, wdth, hght)
        bitmap.blt (0, 0, bmp, src_rect)
      }
      @cache[char_array] = bitmap
    end
    return @cache[char_array]
  end
end

#==============================================================================
# ** RPG::BaseItem
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - character_graphics
#==============================================================================

class RPG::BaseItem
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Character Graphics
  #--------------------------------------------------------------------------
  #  Retrieves Character Graphics from Note Field
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def character_graphics
    graphics = []
    # Retrieve Note Field
    text = self.note.dup
    while text.sub! (/\\cg\[([\w\s]+),*\s*(\d*),*\s*(\d*)\]/i) { '' } != nil
      graphics.push ([$1.to_s, $2.to_i, $3.to_i])
    end
    return graphics
  end
end


#==============================================================================
# ** Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - composite_character
#    aliased_method - initialize, change_equip
#==============================================================================

class Game_Actor
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_writer :composite_character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initalization
  #-------------------------------------------------------------------------
  #  Initializes stacked_character variable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_arclght_vsual_equip_init_4t6h initialize
  def initialize (id)
    # Run Original Method
    modalg_arclght_vsual_equip_init_4t6h (id)
    @composite_character = []
    case @actor_id
    #---------------------------------------------------------------------
    # EDITABLE REGION
    #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    #  An actor will automatically have whatever you set in the database
    #  as a bottom layer for him, but if you need to have other character
    #  sets piled on top, then put them in this format:
    #
    #  when <actor_id>
    #    @composite_character.push (['graphic_name', index, hue])
    #      *for as many graphics as you want - first ones drawn first. If you
    #       want to know what each is, see the Instructions in the header.
    #----------------------------------------------------------------------
    when 1 # 1st Actor
      # Create Hair Sprite
      @composite_character.push (['VisEquipSample', 1, 100])
    when 3 # 3rd Actor
      # Create skin sprite with different hue
      @composite_character.push (['VisEquipSample', 0, 20])
      # Create Hair Sprites
      @composite_character.push (['VisEquipSample', 2, 75])
      @composite_character.push (['VisEquipSample', 3, 75])
    #----------------------------------------------------------------------
    # END EDITABLE REGION
    #----------------------------------------------------------------------
    end
    @composite_character.each { |i|
      i[1] = 0 if i[1] == nil
      i[2] = 0 if i[2] == nil
    }
    @composite_character.unshift ([@character_name, @character_index, 0]) if @character_name != ''
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Composite Character
  #--------------------------------------------------------------------------
  #  Returns Graphic Array for the actor
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def composite_character
    armor_graphics = []
    weapon_graphics = []
    # Body Armor, then Helmet, then Shield, then all others
    dup_armors = armors.dup
    for i in 0...2
      j = 2 - i
      armor_graphics += dup_armors[j].character_graphics if dup_armors[j] != nil
      dup_armors.delete_at (j)
    end
    # If there is some multi-equip script, will get accessories and rest in order
    dup_armors.each { |armr| armor_graphics += armr.character_graphics if armr != nil }
    weapons.each { |wpn| weapon_graphics += wpn.character_graphics if wpn != nil }
    return @composite_character + armor_graphics + weapon_graphics
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Change Equipment (designate object)
  #--------------------------------------------------------------------------
  #  Refresh Player to demonstrate armor cg
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_rfrsh_plyer_eq_chnge_8mj2 change_equip
  def change_equip(equip_type, item, test = false)
    modalg_rfrsh_plyer_eq_chnge_8mj2 (equip_type, item, test)
    $game_player.refresh
  end
end

#==============================================================================
# ** Game_Party
#==============================================================================
class Game_Party
  attr_reader :actors
end

#==============================================================================
# ** Game_Character
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new instance variable - composite_character
#==============================================================================

class Game_Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader :composite_character
end

#==============================================================================
# ** Game_Event
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - setup
#==============================================================================

class Game_Event
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Event page setup
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malgbr_rclgh_req_comp_char_setup_5msk setup
  def setup(new_page)
    malgbr_rclgh_req_comp_char_setup_5msk (new_page)
    # Create Composite Character
    @composite_character = []
    @composite_character.push ([@character_name, @character_index, 0]) unless @character_name.nil?
    # If page == nil, return
    return if @page == nil
    # Retrieve  first line comments
    comments = []
    @page.list.each { |i| i.code == 108 || i.code == 408 ? comments.push (i) : break }
    # Evaluate comments for \CG codes
    comments.each { |i|
      text = i.parameters[0].dup
      while text.sub! (/\\cg\[([\w\s]+),*\s*(\d*),*\s*(\d*)\]/i) { '' } != nil
        @composite_character.push ([$1.to_s, $2.to_i, $3.to_i])
      end
    }
  end
end

#==============================================================================
# ** Game_Player
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - refresh
#==============================================================================

class Game_Player
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mdalg_arc_comp_character_find_rfrsh_8kwi refresh
  def refresh
    mdalg_arc_comp_character_find_rfrsh_8kwi
    return if $game_party.members.empty?
    @composite_character = $game_party.members[0].composite_character
  end
end

#==============================================================================
# ** Sprite_Character
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - update_bitmap
#==============================================================================

class Sprite_Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Transfer Origin Bitmap
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modern_alg_arclightrequest_visual_equip_bmp_update update_bitmap
  def update_bitmap
    if @tile_id != @character.tile_id or
       @character_name != @character.character_name or
       @character_index != @character.character_index ||
       @composite_character != @character.composite_character
      @tile_id = @character.tile_id
      @character_name = @character.character_name
      @character_index = 0
      @composite_character = @character.composite_character
      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
        if @composite_character == nil
          # Regular Character Picture
          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
        else
          self.bitmap = Cache.composite_character(@composite_character)
          @cw = self.bitmap.width / 3
          @ch = self.bitmap.height / 4
        end
          self.ox = @cw / 2
          self.oy = @ch
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Rectangle
  #--------------------------------------------------------------------------
  def update_src_rect
    if @tile_id == 0
      index = 0
      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)
    end
  end
end

#==============================================================================
# ** Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    overwritten method - draw_character_graphic
#==============================================================================

class Window_Base  
  #--------------------------------------------------------------------------
  # * Draw Actor Walking Graphic
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y)
    bitmap = Cache.composite_character (actor.composite_character)
    cw = bitmap.width / 3
    ch = bitmap.height / 4
    rect = Rect.new (cw, 0, cw, ch)
    self.contents.blt (x - (cw / 2), y - ch, bitmap, rect)
  end
end

#==============================================================================
# ** Window_SaveFile
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    overwritten_methods - load_gamedata,
#==============================================================================

class Window_SaveFile < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Load Partial Game Data
  #--------------------------------------------------------------------------
  #  The same as the original method with the exception that it gets all of
  #  that file's data up to @game_party - necessary for composite graphics
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def load_gamedata
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      begin
        @characters     = Marshal.load(file)
        @frame_count    = Marshal.load(file)
        @last_bgm       = Marshal.load(file)
        @last_bgs       = Marshal.load(file)
        @game_system    = Marshal.load(file)
        @game_message   = Marshal.load(file)
        @game_switches  = Marshal.load(file)
        @game_variables = Marshal.load(file)
        # Bypass self-switches
        @game_self_switches = Marshal.load(file)
        # Bypass Actors
        @game_actors = Marshal.load(file)
        # Get Party
        @game_party = Marshal.load (file)
        @total_sec = @frame_count / Graphics.frame_rate
      rescue
        @file_exist = false
      ensure
        file.close
      end
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Party Characters
  #     x : Draw spot X coordinate
  #     y : Draw spot Y coordinate
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_party_characters(x, y)
    for i in 0...@game_party.actors.size
      draw_actor_graphic (@game_actors[@game_party.actors[i]], x + i * 48, y)
    end
  end
end


Credit
modern algebra
-Writing the script

Known Compatibility Issues
Any scripts that play around with the way character sets are drawn will undoubtedly have some problems with this script. If you encounter any problems, please post the error and the script that is causing the problem and I will see if I can make them compatible.

Does not work with Dash Animation
Does not work with Extra Movement Frames

*NOTE* I did not make this script, I'm bringing this over from another forum *NOTE*

DEMO File included in Attachments



CANT FIGURE IT OUT WELL I THINK THAT YOU SHOULD TAKE A LOOK AT THE SCRIPT AND LOOK AROUND IM SURE YOUL FIND SOMETHING

This post has been edited by Zelda Freak: Oct 10 2008, 11:40 AM


__________________________
<--- Click.

Want a signature like the one above? PM me and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
lucifer1101
post Oct 22 2008, 04:37 PM
Post #6


Level 11
Group Icon

Group: Revolutionary
Posts: 181
Type: None
RM Skill: Skilled




hey all was just wondering if this has anything like a little tutorial on how to use it.
Its very confusing and its the only peprdolling script around...


__________________________


[Show/Hide] My Demos
My Demo Page
-Transform Event
-Maze Event
-FF8 Draw Event
-Steal and Boss Transform Event
-Notorious Monster Event
Go to the top of the page
 
+Quote Post
   
killcon
post Jan 10 2009, 07:35 PM
Post #7


Level 2
Group Icon

Group: Member
Posts: 29
Type: Mapper
RM Skill: Intermediate




I get a error on

CODE
return @composite_character + armor_graphics + weapon_graphics


__________________________
~~~~~Warrior Of The Abyss~~~~~
Characters-50%
Mapping-.1%
Story-1%
Scripts-30%
items-1%
Overall-2%
Go to the top of the page
 
+Quote Post
   
BigEd781
post Jan 10 2009, 07:55 PM
Post #8


No method: 'stupid_title' found for `nil:NilClass'
Group Icon

Group: Revolutionary
Posts: 1,829
Type: Scripter
RM Skill: Undisclosed




Add this line above that one:

CODE
@composite_character = [] if @composite_character.nil?


__________________________
`
Give me teh codez!!!


I am the master debator!
Go to the top of the page
 
+Quote Post
   
killcon
post Jan 10 2009, 08:35 PM
Post #9


Level 2
Group Icon

Group: Member
Posts: 29
Type: Mapper
RM Skill: Intermediate




now when i put the armor or helm on my player wont show up?


__________________________
~~~~~Warrior Of The Abyss~~~~~
Characters-50%
Mapping-.1%
Story-1%
Scripts-30%
items-1%
Overall-2%
Go to the top of the page
 
+Quote Post
   
Ocsecnarf
post Jan 11 2009, 04:13 AM
Post #10



Group Icon

Group: Member
Posts: 1
Type: Artist
RM Skill: Undisclosed




Good Job!
Go to the top of the page
 
+Quote Post
   
nevious
post Jan 29 2009, 01:24 AM
Post #11


Hyperfunctional Drive Modulator?
Group Icon

Group: Revolutionary
Posts: 337
Type: Artist
RM Skill: Advanced




i get a lovely error tellin me stack level too deep.


__________________________
Artist: Advanced
Musician: None
Scripter: Undisclosed
Writer: Beginner
Developer: None
Event Designer: Intermediate







[Show/Hide] Signatures








necroking nevious


Check out my Gallery!! (please leave comments constructive critizism helps. but please dont be rude.
My Gallery!!

Omegazions rougelike battlesystem in action


Go to the top of the page
 
+Quote Post
   
Shiryo
post Dec 26 2009, 07:29 PM
Post #12



Group Icon

Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed




Works fine for me: you just have to spend some time in the Visual Equip Sample's set-up, but it's a really usefull script.

The only problem I found is what I can't understand how to make theese commands work:

remove_graphic_from_actor (actor_id, index)
remove_graphic_from_actor (actor_id, graphic_name, graphic_index, graphic_hue)
or
add_graphic_to_actor (actor_id, graphic_name, graphic_index, graphic_hue, index)

I make events with one of theese, but the game crashes telling me:

Name error while running script.
Uninitialized constant game_interpreter::VisEquipSample

But I'm sure that the grafic name is correct.. Can someone help me?

I just need to talk to an event, and after that my character must have a graphical difference on him, like a scare or other... anyway something I can't "equip" like I do with an armors etc.
Go to the top of the page
 
+Quote Post
   
Sparrowsmith
post Dec 26 2009, 07:57 PM
Post #13


ROROW was here, went for beer
Group Icon

Group: Global Mod
Posts: 4,600
Type: Writer
RM Skill: Intermediate
Rev Points: 5




hmmmmm

useful for my game me thinks... Thank you very kindly happy.gif


__________________________
Warning! this post may contain sarcasm, please re-read it in a funny voice
The old spoiler was out of control, it had to be stopped.
Go to the top of the page
 
+Quote Post
   
Shiryo
post Dec 29 2009, 04:14 PM
Post #14



Group Icon

Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed




I solved all my previews problems, ut I still have some trumbles with this command

remove_graphic_from_actor (actor_id, graphic_name, graphic_index, graphic_hue)


I thouth it could remove a graphic you added with add_graphic command, but if instead of erasing the graphic's name you write in, it erase everything exept the graphic... is there a way to make it cancel a specific graphic?

Exaple.. in a cutscene my character must be bloody, i use the add_graphic to add blood (and it works now), but how can I remove that blood? Using this command, the character disappear and the only remaining thing is the blood... where am I wrong?

This post has been edited by Shiryo: Dec 29 2009, 04:15 PM
Go to the top of the page
 
+Quote Post
   
chuckeddy
post May 3 2011, 01:57 PM
Post #15



Group Icon

Group: Member
Posts: 2
Type: Writer
RM Skill: Intermediate




im having a litle issue with integrating the catipilar script i have a clean project with only the 2 scripts running and i made the slight modification as said above bt i still get this message?? any ideas would be very appreciated biggrin.gif


????? 'Catapillar' ? 90 ??? NoMethodError ????????

undefined method `composite_character' for
#<Game_Actor:0x398b580>


QUOTE (modern algebra @ Sep 9 2008, 08:28 AM) *
Well, assuming you are referring to Diedrupo's Caterpillar Script, then it will not by default. However, if you go into that script to line 88 and see:

CODE
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup
    if @actor != nil      
      @character_name = $game_actors[@actor].character_name
      @character_index = $game_actors[@actor].character_index
    else
      @character_name = ""
      @character_index = 0
    end
    @opacity = 255
    @blend_type = 0
    @priority_type = 0
  end


replace it with:

CODE
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup
    if @actor != nil      
      @composite_character = $game_actors[@actor].composite_character
    else
      @character_name = ""
      @character_index = 0
      @composite_character = nil
    end
    @opacity = 255
    @blend_type = 0
    @priority_type = 0
  end


It should work fine then.




im having a litle issue with integrating the catipilar script i have a clean project with only the 2 scripts running and i made the slight modification as said above bt i still get this message?? any ideas would be very appreciated


????? 'Catapillar' ? 90 ??? NoMethodError ????????

undefined method `composite_character' for
#<Game_Actor:0x398b580>

Go to the top of the page
 
+Quote Post
   
Kread-EX
post May 4 2011, 01:30 AM
Post #16


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




Sorry, I'm going to close this because it's a very old thread and the OP isn't around anymore. Please use the RGSS2 Script Support section and provide a link of which caterpillar script you are using (there are several of them).


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 04:09 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker