Composite Graphics / Visual Equipment Version: 1.0.1 Author: modern algebra Date: 13 January 2013
Version History
<Version 1.0.1> 2013.01.13 - Fixed an incompatibility with various battle systems <Version 1.0> 2012.01.13 - Original Release Description
This script allows you to "compose" face and character graphics out of multiple graphics. This permits you to make it so that equipment worn by a character can change the appearance of that actor's sprite and/or face.
Unlike my VX version, this script has a lot of new and improved features, including, but not limited to: support for faces and not just character sprites; a more flexible configuration scheme; the ability to set one equipment to draw different graphics onto different actors (useful, for instance, if you want an equipment to show a different graphic on males than it would on females).
Features
Can compose characters and faces from multiple charactersets or facesets Complete control over the order in which the character is composed from the other graphics - ie. which graphics show under which Can control the hue and opacity of each character graphic as it is added to the composed graphix. Allows you to have equipped items show up on the actor's on-map character, as well as their face Composite types allow you to make it so that an equipped item can show different graphics on different characters - want an armor graphic to change depending on which gender is wearing it? That can be done Can compose event sprites in the same way Can set an event sprite to be identical to an actor, with all equipment - useful for cutscenes R-codes allow you to make it so that some graphics, when equipped, will hide all others with the same r-code. This is useful, for instance, if when you equip a helmet, you don't want the character's hair to show since it is wider than the helmet and would not look right. Can add and remove graphics from actors and events in-game with very simple codes in a comment - no more call scripts! Can use new message codes, \af[n] and \pf[n], to show actor faces in message windows Screenshots Instructions
Paste this script into its own slot in the Script Editor, above Main but below Materials.
For instructions on use, please refer to the header. While it is very long, I am sure you will find the instructions there helpful.
Script
The script is too long. Please retrieve it from the
attached text document or from
Pastebin .
Leonsoft has also created a
demo which formatted a lot of the basic generator graphics.
Credit
Support
Please post in this topic at RMRK to report any bug, request any compatibility patches, or to ask any questions as to how to use this script.
Known Compatibility Issues
This script will not work properly with any scripts which change how graphics are drawn by interpreting characters in the filename; ie, if a script will show some sprites or faces differently depending on whether there is some character or series of characters in the name of the graphic resource itself, then this script will not allow you to compose graphics with that graphic. Of course, it should still draw the graphic in the way the other script wants it drawn if there is only that graphic and other graphics are not meant to be pasted onto it.
Luckily, however, it is generally very easy to make scripts like that compatible, so if you find one like that, then just post in this topic with a link and I will write a compatibility patch for it.
Spoiler for FenixFyrex's MultiFrame Sprites :
By default, special sprites configured out of FenixFyrex's MultiFrame Sprites script will only work if the graphic isn't composed (ie. there is only one graphic, and none are stacked). To fix this so that you can use composite graphics with the special multi-framed sprites set up with that script, all you need to do is paste the following patch into its own slot, above Main but below the Composite Graphics script.
#============================================================================== # Composite Graphics / Visual Equipment + FenixFyrex's MultiFrame Sprites # Compatibility Patch # Version: 1.0 # Author: modern algebra (rmrk.net) # Date: January 15, 2012 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # This script should be inserted into its own slot in the Script Editor, # above Main but below the Composite Graphics script. # # Note that in order for a multiframe sprite to show properly if composing # graphics, then every graphic in the composite must have the special code. #============================================================================== if $imported[:MA_CompositeGraphics] module Cache # alias macgve_make_unique_name class << self alias macgve_gencomp_mkuniqname_4df2 macgve_make_unique_name end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Make Unique Name #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def self.macgve_make_unique_name(cg_array = [], *args) result = macgve_gencomp_mkuniqname_4df2(cg_array, *args) # Call Original Method # If using FenixFyrex's Custom Sprites script if defined?(FyxA::CustomSprites::Patterns) FyxA::CustomSprites::Patterns.keys.each {|pattern| result += pattern if cg_array.all?{|cg| cg.filename.include?(pattern)} } end result end end else p "Error: Composite Graphics + FenixFyrex's MultiFrame Sprites;\n the Compatibility Patch must be inserted below the Composite Graphics\n in the Script Editor. It must still be above Main though." end
Spoiler for MSX XP Characters in VX/VX Ace :
By default, MSX XP Characters in VX/VX Ace would only work on graphics that are not composed - in other words, you could only show an XP graphic with the $xp code properly if nothing else was added on to it. This compatibility patch makes it so that if every graphic in a composed graphic has the $xp code, then it will show up as an XP character.
#============================================================================== # Composite Graphics / Visual Equipment + MSX XP Characters on VX/Ace # Compatibility Patch # Version: 1.0 # Author: modern algebra (rmrk.net) # Date: January 17, 2012 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # This script should be inserted into its own slot in the Script Editor, # above Main but below the Composite Graphics script. # # Note that in order for an XP sprite to show properly if composing # graphics, then every graphic in the composite must have the $xp code. #============================================================================== if $imported[:MA_CompositeGraphics] module Cache # alias macgve_make_unique_name class << self alias macgve_msxxponacecomp_uniqname_5fr1 macgve_make_unique_name end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Make Unique Name #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def self.macgve_make_unique_name(cg_array = [], *args) # Call Original Method result = macgve_msxxponacecomp_uniqname_5fr1(cg_array, *args) # Set If all graphics in composite have special $xp code result += "$xp" if cg_array.all?{|cg| cg.filename.include?("$xp") } result end end else p "Error: Composite Graphics + MSX XP Characters on VX/VX Ace;\n the Compatibility Patch must be inserted below the Composite Graphics\n in the Script Editor. It must still be above Main though." end
Demo
A demo would be useful, but I am still operating from the trial version of VXA, so it is not currently possible. Please refer to the voluminous instructions for the time being. Should I ever get a copy of VXA, I will make a demo.
Author's Notes
I was doing a bit of experimenting with this script; in particular, my objective was to devise a way to make this script so that I did not have to directly modify the way characters are drawn normally - ie. I wanted a way for this script to be automatically compatible with other scripts which modify characters or faces, such as one which allows characters to have extra frames.
In the end, this led to a lot of convolutions, and this script is poorly designed as a result, but I got sick of writing it and I didn't want to rewrite it, so I published it anyway. I just wanted to say sorry to any hapless person who should choose to examine the script.