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
#============================================================================== # 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
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
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*
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:
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
#============================================================================== # 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
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
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.
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...
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.
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
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
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:
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
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.