RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] Composite Graphics / Visual Equipment

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
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


  • modern algebra

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.

Code: [Select]
#==============================================================================
#    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.
Code: [Select]
#==============================================================================
#    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.
« Last Edit: September 05, 2016, 10:05:02 PM by modern algebra »

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
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.

Don't be so hard on yourself MA, I took a quick look at the script and for the most part it looked fine. Trying to create a method to manually draw the characters from outside Sprite_Character was a bold feat (I certainly wouldn't have tried myself).

The script itself looks amazing. I really like the R-Codes; it's just bothersome keeping track of all of them :P

**
Rep: +0/-0Level 66
Artist
You always make the best script !! next time try  creating ABS! that will fit this EXTREMELY PERFECT script of yours.. :tpg: :tpg: :tpg: :tpg: :tpg: :tpg: :tpg:
My Profile Picture is made of RMVXACE

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Now, sorry for posting lately on this one, but I may have a possible bug report. (If not, it's just my stupidity). ;9

I've been getting the hang of this script (which I love so much, btw :)), but it seems I might be having trouble with the /ct stuff. My character is originally a bald lady, with these codes put as her initial bangs and hair style in the back (using the generator's graphics in Ace). That worked just fine like this in the notebox:

Code: [Select]
\cf["HairBack2", 3, h200, o255, z-1, r0]
\cf["Bangs1", 3, h200, o255, z2, r0]

Then, I tried adding this:

Code: [Select]
\cf9["HairBack2", 3, h200, o255, z-1, r0]
\cf9["Bangs1", 3, h200, o255, z2, r0]
\ct[1, 9]

And it leaves my gal bald, again. ;9 I even tried leaving the "9" as a "0" to see if that helped, but it left her bald, as well. Getting rid of the number after the "\cf" seemed to make it work again completely. :o

I'll attach an image of what my notebox looks like currently.
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Hmm, well it is unnecessary to put type down for the actor settings - you would only need to do that for equipment, since its purpose is to make equipment show differently on different actors or actresses. Where you are setting the actress herself, there is no danger of that, so it is intended that you just use:

Code: [Select]
\cf["HairBack2", 3, h200, o255, z-1, r0]
\cf["Bangs1", 3, h200, o255, z2, r0]
\ct[1, 9]

And tell me if that works. But it really shouldn't have been affected so greatly simply by putting the type down, so I will look into it sometime.

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
First of all, thanks for the time!

That does work. :)

I thought the ct worked for the faces, because my intention was to do a "hair cut" shop (using Yanfly's Event Shop - I think it's Yanfly's, at least) and I didn't want the guys and girls to share the same hairdos. :o

But I may be able to find a way to do this through eventing, so I've been looking around. 8)
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
\ct does work for faces, it's just that it doesn't mean anything to give types to the graphics you set in the actor. In other words, there wouldn't ever be any reason to put a \cf[] code in an Actor's notebox unless you wanted it to show up on the Actor. But certainly if you had the following in the actor's notebox:

Code: [Select]
\cf["HairBack2", 3, h200, o255, z-1, r0]
\cf["Bangs1", 3, h200, o255, z2, r1]
\ct[1, 9]

And if you made a Helmet which had this in its notebox:

Code: [Select]
\cf4["MaleHelm1", 1, z3, r1]
\cf9["FemaleHelm1", 1, z3, r1]

Then when she equips that helmet, only the "FemaleHelm1" graphic would show up, since she doesn't have 4 in her \ct[] array. So yes, \ct[] does work on face graphics as well as character graphics; you just don't need to identify those types on the graphics you set directly in the actor's own notebox.



On an unrelated note, you don't need to include in the code anything that you aren't changing from the default. In other words:

\cf["Bangs1", 3, h200, o255, z2, r0]

is the same as:

\cf["Bangs1", 3, h200, z2]

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Alrighty, thank you again. :)

I tried putting this in a weapon's notebox:

Code: [Select]
\cf9["HairBack2", 1, z-1]

And it worked perfectly, and the hair popped on as the weapon was equipped. :)

;9 However, I entered this as a comment in an event and it didn't work:

Code: [Select]
\add_a1_cf9["HairBack2", 1, z-1]

When I removed the "9" in the event "add" command, it worked perfectly. :o

I apologize once again for the issues. ;9
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Well, yeah; again, you're adding it to the actor herself, and so there is no need to put the type as 9. That's not a different issue, and it's not really a problem.

The purpose for composite types is so that the same equipment can show up differently on chosen actors. For instance, it permits you to change the graphic of "Body Armor" depending on whether you equip it to a male actor or a female actor. That feature is useless when you are adding a graphic directly to an actor, since you don't need to account for the possibility that you might want it to not to show up differently on different actors. In other words, if you were attaching a graphic of a type the actor doesn't possess (for instance, \cf8[]), then why would you ever try to put it on the actor since that graphic could never show up or be used for anything?

So don't set a type when you are adding the graphics directly to actors, and you should be fine. I suppose I should have accounted for the possibility that people would try to set types on actors, but I don't regard that as a particularly pressing issue.

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Oh... oh, wow. I'm totally sorry about that. :-[ I see what you mean about the visual being added directly to the actor, and I guess I was being a little ditzy today!
Spoiler for:
Which reminds me... I totally forgot "p1" existed and kept using "a1" for everything, too! ;9 I read the instructions a few times, but it's been one of those days... whew... :o

Anyways, thanks for clarifying all that! I'm going to read and think a bit more carefully with scripts from now on! :-[

*yuyubabe learns a life lesson!

MODERN ALGEBRA CAN WE GO DIDNEY WORL?! WE SHOULD GO DIDNEY WORL!!!
« Last Edit: April 05, 2012, 04:50:11 AM by Pacman »
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
haha, no worries. It's an understandable mistake and my instructions weren't very clear.

AND YES WE CAN GO DIDNEY WORL WOOO
« Last Edit: April 05, 2012, 04:50:40 AM by Pacman »

**
Rep: +0/-0Level 73
RMRK Junior
I'm using this script with yanfly equip engine and when i start the game the error,
"line 605 typeerror, cannot convert nil into array" is there a way to fix this?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Try switching the order of the scripts. Ie. if Yanfly Equip Engine is currently below the Composite Graphics script, try putting it above it instead. If that doesn't work, create a new project and recreate the error in it, then upload it and let me see the error.

**
Rep: +0/-0Level 73
RMRK Junior
I'm using this script with yanfly equip engine and when i start the game the error,
"line 605 typeerror, cannot convert nil into array" is there a way to fix this?
i've fixed it by using fomar's custom slot instead, but when i remove equipment the sprite doesn't change.
also, sprites don't show on custom slots.
« Last Edit: June 11, 2012, 05:48:30 AM by Watfordj »

**
Rep: +0/-0Level 55
RMRK Junior
Hellooo, made an account just to ask for support on this. Is there any way we can set a piece of equipment to have different priority depending on which direction the character is facing? Like if you had wings or even long hair you'd want it to be behind the character while they're facing the camera and in front of em when you see their back.
Sorry for reviving an old thread but I wasn't sure where else to ask.

A girl on each arm... the life of a cookie is never boring!
.:: TOTAL NEWBIE ::.
Divided between ideas for a norse mythology game and a sandbox romp through an original setting...
Gathering resources and learning in preparation!!
My deviantART account: bunni89.deviantart.com

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
It is acceptable and encouraged to post support requests in the thread itself, and it is perfectly acceptable to revive an old thread for that purpose.

As for your actual question: no, there is no way to do that in the script. You could, however, separate the wings into two separate graphics and set the back ones to a higher priority and the front ones to a lower priority.

Ie. if we had the following graphic (extracted from the character generator), named "Wings" in your Characters folder:


You could put the following in your equipment's notebox:

\cc["Wings", i0, z-2]
\cc["Wings", i4, z2]

The values I chose for z were sort of random, but that would make the front wings graphic show at -2 priority and the back wings graphic show at +2 priority.

**
Rep: +0/-0Level 55
RMRK Junior
Aha, thank you! I never would have thought of that and it seems so obvious now, sorry for the dumb question :)
By the way I adore this and I'm using it to make a character creation scene in my game, so thank you loads for being such an amazing scripter!  ;D

A girl on each arm... the life of a cookie is never boring!
.:: TOTAL NEWBIE ::.
Divided between ideas for a norse mythology game and a sandbox romp through an original setting...
Gathering resources and learning in preparation!!
My deviantART account: bunni89.deviantart.com

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
You're welcome, and thank you for the kind words.

**
Rep: +0/-0Level 55
RMRK Junior
Whoops I have a few more questions! Is there any way to make an equipment use two r-codes? Like I set one that means 'tall person' and one that means 'male' and then an actor having both codes means they get the equipment drawn to fit 'tall male'? Whereas only having 'male' uses the default sprite. Or would I have to make separate R-codes for every combination of bases? (1= short male human, 2= normal male human..)

Also is there any way to change an actor's CT-code ingame via script call? Or set it to change based on a variable? Since I'm doing character customization it kinda messes up the equipment side of things and I just get male-fitted equips floating on a tall girl or whatever. (cos the main character changes I can't give them the right code for whatever the player picked)
Basically I want the actor to for example have \ct[1, 4] for a female human and then I can change it to \ct[2, 6] via script call when they select male elf or whatever.

Also (last one I promise!) can you add/remove equips en masse in one code, or do you have to type the whole thing out each time? Just cos my character customization is currently setup with for example Eyes 1's comment calls going:
 \add_a1_cc["eyes", i0, h0, o255, z0, r0]
 \remove_a1_cc["eyes", i1, h0, o255, z0, r0]  \remove_a1_cc["eyes", i2, h0, o255, z0, r0]...
Which makes the events huge and laggy and will just get worse when I move on to stuff that needs to vary by skintone.. (add wings1white, remove wings2-7white, remove wings1-7black....)
It would be neat if it had functionality like ["filename", i0, i1, i3] would get rid of em all.

Sorry if I made any more dumb mistakes and thanks for all the help :3

EDIT: Ignore questions 1 and 3, in retrospect they do look real dumb XD Easily solved the lag problem just by making the 'remove all parts not in use' comment block into a common event. But I still really need help with the dynamic CT-code thing...
EDIT EDIT:Whoops I've been calling the CT code the R code for the entirety of this post! It must've been totally incomprehensible XD
« Last Edit: October 22, 2012, 01:57:14 PM by Bunni89 »

A girl on each arm... the life of a cookie is never boring!
.:: TOTAL NEWBIE ::.
Divided between ideas for a norse mythology game and a sandbox romp through an original setting...
Gathering resources and learning in preparation!!
My deviantART account: bunni89.deviantart.com

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Hi, sorry for the delayed response. I didn't have time to answer when I first saw it and then forgot about the question.

1. There isn't a way to use assign 2 r-codes or 2 types to the same equipment. Sorry.

2. You could do it by a script call:

Code: [Select]
a = $game_actors[x]
a.composite_equip_types = [y1, y2, ..., yn]

Where x is the ID of the actor, and y1, y2, ..., yn are the composite types.

3. I know you said you've resolved this, but just in case you weren't aware, the remove_cc thing will remove all graphics that correspond to the specified arguments. So, if you, for instance, had an "eyes" graphic that had eight different sets in it and wanted to remove any that might be applied, you wouldn't need to do:

Code: [Select]
\remove_a1_cc["eyes", i0, h0, o255, z0, r0] \remove_a1_cc["eyes", i1, h0, o255, z0, r0], etc...

eight times. You would just need to do:

Code: [Select]
\remove_a1_cc["eyes"]

and that removes any that are applied.

However, there is no other shortcut.


**
Rep: +0/-0Level 55
RMRK Junior
Great, thank you so much! SO that script call overwrites the current composite types, or just adds more to the list? It seems like what I wanted so woohoo! And also I'm embarrassed how dumb I am that I didn't realise you could delete the whole spritesheet like that XD That fixes all my problems and sorry for taking up your time :3

A girl on each arm... the life of a cookie is never boring!
.:: TOTAL NEWBIE ::.
Divided between ideas for a norse mythology game and a sandbox romp through an original setting...
Gathering resources and learning in preparation!!
My deviantART account: bunni89.deviantart.com

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
I'm happy I could help. That script call overwrites it. If you wanted to just add one new type, say 4, you would do something like:

Code: [Select]
a = $game_actors[x]
a.composite_equip_types << 4

**
Rep:
Level 73
Impossibre!
Participant - GIAW 11
Hey I think I found a compatibility issue! I'm a fan of your ATS series of scripts, so this is a rather important issue to me. When I put Composite Graphics in, the paragraph formatting stopped. The only way I could find to get formatting back was to delete Composite, which is lame, 'cause I like both scripts. Is there a fix?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Well, it will need to be fixed in the next version in any event, but for now just insert ATS: Formatting into a slot below Composite Characters in the Script Editor, but still above Main.

In other words, you have it like this (where ellipses are other scripts or else nothing):

Materials
...
ATS: Formatting
...
Composite Characters
...
Main

It has to be like this:

Materials
...
Composite Characters
...
ATS: Formatting
...
Main

**
Rep:
Level 73
Impossibre!
Participant - GIAW 11
Yay! It works now! Thanks a lot! Exclamation points!

*
Rep: +0/-0Level 48
RMRK Junior
Hello I wanted to know your policy for use of your scrips in commercial projects. I have not got very far in my project but I wanted to know what are the requirements for using your scripts in commercial projects in case I need them since your scripts seem very useful. Thanks.

**
Rep: +0/-0Level 46
Evented AI
Hey MA, there seems to be a small incompatibility with Yami's Battle Symphony. In the battle itself it works suprisingly well, but after every Aftermath when the game returns to the map there is a resource error, if one of the actors makes use of your script.

In my experience a possible fix is usually really obvious when it comes to incompatibility issues, but this one really gives me headaches.  :'(

I am currently using it together with Victors Visual Equipment, because for some strange reason the presence of his script prevents the error from occuring. But sadly this leads to other serious bugs. If I find a real solution by myself, I will let you know.

The error:
Unable to find file:
Graphics/Characters/$macgve_WGUQcxmHpkcilaRrDc5izjix_1

Anyways, thank you for being awesome.  :D

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
The problem is probably that the bitmap is disposed by the battle system after battle.

Sorry, give me a second.

EDIT::

Alright, I updated the script to 1.0.1. You can retrieve it from Pastebin. That error should be fixed, if my guess was right as to the problem. I wasn't able to quickly find the script you referred to, so I haven't looked at it. If it still doesn't work, then I'll need a link to the script you are talking about.
« Last Edit: January 14, 2013, 12:59:04 AM by modern algebra »

**
Rep: +0/-0Level 46
Evented AI
Wow, thanks. You are SERIOUSLY AWESOME.

It seems to work! Don't have so much time to test it currently since it's my brother's birthday today, but it hasn't crashed after the aftermath, so you did a great and fast job once again.  ;D

Btw I'm looking forward to contribute a few scripts in the near feature and rmrk will be my favorite place to do so.

Cya and thanks again.  ;8

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Glad to hear it!

Let me know if you encounter any further problems.

**
Rep: +0/-0Level 55
RMRK Junior
Hi, I've noticed a little problem that's keeping me from pulling off an event. Well, the ability to make an event duplicate the player works fine, but then if I add a composite graphic to the player then the copy events stay the same. Is there any way I could get them to update with the player?
Basically I'm trying to set up a preview screen for a character creator which contains a picture of the player standing in all directions so you can properly see how things look on them. But the code for event duplication has to be within the event, so when I'm calling the 'add [eyes/hair/whatever]' code via a separate autorun event there isn't a code I can stick in too to refresh the duplicate events. Aka I can't just stick the script call in to be activated and change them when you hit Z on the events, cos that wouldn't make all three of them plus the actual player sprite all update simulataneously.. plus it'd ruin immersion if you had to run around on a character creator instead of selecting choices XD
Gah, hope I explained it properly, I suck at this! XD

A girl on each arm... the life of a cookie is never boring!
.:: TOTAL NEWBIE ::.
Divided between ideas for a norse mythology game and a sandbox romp through an original setting...
Gathering resources and learning in preparation!!
My deviantART account: bunni89.deviantart.com

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Would it be possible just to make each of the player events have two pages, each identical except with the second requiring some switch. Then, after you change the graphic, you could toggle the switch (turn it off if it's on and turn it on when it's off). That should update the sprites of the events as well.

That's a pretty gamey solution, I admit, but the alternative is messy and I am not sure when I would have time to implement it.

**
Rep: +0/-0Level 55
RMRK Junior
Thank you! That should work fine and I don't mind if its awkward as long as you don't have to do more work XD
May I say once again that this is a super awesome script that's so darn handy!! :3
Strange hypothetical idea though.. maybe some way to save a composite graphic as its own spritesheet? That'd be a neat bonus feature, so you could save a sheet of your character in whichever outfit is your fave, and then use that in other games. (It'd be most useful for my character-creator, so people could take whatever guy they customized in my game and use them in their own projects.) I reckon that'd be really hard to do though, so don't worry about it, I just wanted to make the suggestion since it popped into my head XD

A girl on each arm... the life of a cookie is never boring!
.:: TOTAL NEWBIE ::.
Divided between ideas for a norse mythology game and a sandbox romp through an original setting...
Gathering resources and learning in preparation!!
My deviantART account: bunni89.deviantart.com

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
It wouldn't be too hard actually. I am sure there are some scripts out there that can save a bitmap as a png; I would just need to integrate that. I'll look into it when I can find the time.

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
You could use this one, or at least use it as a base to build upon.

http://cacaosoft.web.fc2.com/tkool/script/rgss3/save_bitmap.html

It's very easy to use and allows you save in many formats. I am not sure about cacaosoft terms about editing, but I think it should be okay to add the functions as an expansion to the script and require the save bitmap one for them.

**
Rep: +0/-0Level 40
RMRK Junior
Hi, this script works only for the character walk or works too for animations such as running, crouching, jumping, waving, etc?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
No, not really. It will normally work only for walking. If you want it to work for other animations, you'd (a) need to make the graphics fit those other sprites; and (b) modify this script so that all the graphics change when the main sprite does.

**
Rep: +0/-0Level 40
RMRK Junior
I figured that.  :P

If you don't mind, could you tell me which parts of the script I have to edit to add new types of animations?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
It would depend very much on however you're choosing to do the animations. If you're using a script which does it by adding, for instance, extensions to the name of the file, then you would need to do it in an entirely different way than if you're just using events.

**
Rep: +0/-0Level 40
RMRK Junior
I dont know how works the script, I haven't seen in depth (yet). I wanted to use it with this other script yours:

http://rmrk.net/index.php/topic,46822.0.html

Correct me if I'm wrong, but I think you create bitmaps (Bitmap.new) that show the images of the characters and objects they have equipped, right?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Yes, it basically draws charactersets with the equipment on to a base sprite.

It'll work fine with the Extra Movement Frames script as long as you have the graphics for it.

But that script doesn't do crouching, jumping, dashing, etc.

**
Rep: +0/-0Level 40
RMRK Junior
So, in the same way, I could change the sprite base by one crouching and the script change the items loads in a bitmap by ones that I have created for a crouching sprite, right?

It is easy to modify in your script?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Well, no, it would be tough to do that.

**
Rep: +0/-0Level 40
RMRK Junior
Mmm, I'll have to make one from 0 that suits what I need. As I did with the inventory grids. :P

Thanks for the help. :)

**
Rep: +0/-0Level 40
RMRK Junior
I get this error if I use Extra Movement Frames and this script:

http://rmrk.net/index.php/topic,46822.0.html



And I have a question.

I'm trying to make some sprites are used for different animations, ie some to walk and other sprites for crouch down, for example.

I have thought of a way that could be quickly and easily modified.

When you add weapons or armor notebox this:

\cc["filename", i0, h0, o255, z0, r0]

In "filename" could also include if you are crouching, walking, running, etc.. because "filename" would read character_name. Let me explain with an example:

You have "Actor1[walk]" and "Actor1[run]". And you also have "Armor[walk]" and "Armor[run]". The armor would have notebox:

\cc0["Armor[walk]"], 0]
\cc0["Armor[run]"], 0]

And when the player is equipped with the object or add \cc[ar1] to an event, it would read the player or event character_name and would check if you put walking, crouching or whatever. That way, the script would choose the sprite \cc0["Armor[walk]"], 0] or \cc0["Armor[run]"], 0].

It would have to add another thing, every time you change the sprite in "change player graphic", "graphic change" or whatever, the script should check again the objects you (or event) have equipped to see which it changes now. For example, if I was walking and then changes to run, armor sprites have equipped will have to change \cc0["Armor[walk]"] to \cc0["Armor[run]"], 0]

Do you think an easy way to implement? Or can you occur of a better way?

Sorry for my English, isn't my first language.
« Last Edit: June 23, 2013, 09:27:40 PM by Duende »

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Well, it can certainly be done. You would need to use Regular Expressions when composing the character to exclude all poses but the current one.

There might be some duplication though, since conceivably some parts would be the same for running and walking, and the way you suggest would require you to make two character sheets holding the same pieces.

Another way to do it might simply be to create a new group for each pose, and simply directly identify it that way. Something like:

run = {
\cc0["Armor[run]"], 0]
}
walk = {
\cc0["Armor[walk]"], 0]
}

If you did it that way though, it might be better just to use numbers for each pose instead, similar to the way types are used.

As for the compatibility error with Extra Movement Frames, I will have to look into that, but probably won't have time to do so for at least another month or two.

**
Rep: +0/-0Level 40
RMRK Junior
Hello modern algebra,

I have taken a long time to respond, sorry.

The 864 line error: undefined method `empty? 'for nil: NilClass, it's weird, because it happens sometimes.

I've been trying to do that I mentioned in the post above and I have questions about your code.

When the game is running, load all composite weapons and armors in cache? I guess this is where reading the notebox of weapons and armors:

Code: [Select]
    def self.interpret_composite_graphic_string(string, cg = MA_Composite_Graphic.new("", 0, 0, 255, 0, 0))
      if cg.is_a?(Hash)
        string.sub!(/["'](.+)["']/) { cg[:filename] = $1;    "" } # Filename: ""
        string.sub!(/[Zz](-?\d+)/) { cg[:z] = $1.to_i;       "" } # Z:         0
        string.sub!(/[Hh](\d+)/)   { cg[:hue] = $1.to_i;     "" } # Hue:       0
        string.sub!(/[Oo](\d+)/)   { cg[:opacity] = $1.to_i; "" } # Opacity: 255
        string.sub!(/[Rr](\d+)/)   { cg[:rcode] = $1.to_i;   "" } # R-Code:    0
        string.sub!(/[Ii]?(\d+)/)  { cg[:index] = $1.to_i;   "" } # Index:     0
      elsif cg.is_a?(MA_Composite_Graphic)
        string.sub!(/["'](.+)["']/) { cg.filename = $1;     "" }  # Filename: ""
        string.sub!(/[Zz](-?\d+)/)  { cg.z = $1.to_i;       "" }  # Z:         0
        string.sub!(/[Hh](\d+)/)    { cg.hue = $1.to_i;     "" }  # Hue:       0
        string.sub!(/[Oo](\d+)/)    { cg.opacity = $1.to_i; "" }  # Opacity: 255
        string.sub!(/[Rr](\d+)/)    { cg.rcode = $1.to_i;   "" }  # R-Code:    0
        string.sub!(/[Ii]?(\d+)/)   { cg.index = $1.to_i;   "" }  # Index:     0
      end
      cg
    end

If when running the game reads the notebox and is cached, it will be very difficult to modify the code to change equipped items when you change the sprite of the character or event.

Another question. I added several msgbox_p in the code to try understand how it works and also know where I could read the character_name the actor or event. (To do what I said in the post above).

I thought that could do it here:

Code: [Select]
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Composite Character/Face
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macgve_add_cg(type, arg = {})
    case arg
    when String then cg = RPG::MACGVE_Data_CompositeGraphic.interpret_composite_graphic_string(arg)
    when Hash
      cg = MA_Composite_Graphic.new("", 0, 0, 255, 0, 0)
      arg.each_pair(key, value) { cg.send(:"#{key}=", value) }
    when MA_Composite_Graphic then cg = arg
    else
      return
    end
    send(:"base_composite_#{type}") << cg
    $game_player.refresh
  end

Here you call the function that reads the notebox, and as you are in Game_Actor, you can pass as an argument the character_name the actor or event and then use it when you read the filename of weapon or armor notebox. To know what must load.

I do not know if I have explained well.

Thanks for your help. :)

****
Rep:
Level 43
Somewhat got a project? (\ô/)
GIAW 14: ParticipantParticipant - GIAW 11
Well this would be really cool to use, but how hard is it to use?
I'm not really the best scripter, so I can only do basic stuff. ;) But another great question I got 3 different character sizes and a sideview battle by Yanfly, did this script work anyway? :)

**
Rep: +0/-0Level 40
RMRK Junior
Well this would be really cool to use, but how hard is it to use?
It is not difficult to use, just read the instructions and you will see it is not hard.

I'm not really the best scripter, so I can only do basic stuff. ;) But another great question I got 3 different character sizes and a sideview battle by Yanfly, did this script work anyway? :)
The sideview battle by Yanfly, I do not know how it is, but that of the 3 sizes you can do the following way.

If you have 3 characters with different clothing sizes, and sprites of clothes of 3 sizes, you only must put in armor notebox, for example:

\cc1["sprite small cloth", i0, h0, o255, z0, r0] for the small size.
\cc2["sprite medium cloth", i0, h0, o255, z0, r0] for the medium size.
\cc3["sprite large cloth", i0, h0, o255, z0, r0] for the large size.

And then in the notebox of each character, add:

\ct[1] if you use small size sprite.
\ct[2] if you use medium size sprite.
\ct[3] if you use large size sprite.

(What is in cursive not added.)

But if your characters do some animation, in addition to walking, this will not work. Is what I'm trying to make with the help of modern algebra.

I hope I explained well.

****
Rep:
Level 43
Somewhat got a project? (\ô/)
GIAW 14: ParticipantParticipant - GIAW 11
(What is in cursive not added.)
But if your characters do some animation, in addition to walking, this will not work. Is what I'm trying to make with the help of modern algebra.
I hope I explained well.
That I don't have to use what's cursive I know. ;)
I can also resize menus and place them new too, but that is really basic I guess. ;)
I couldn't do such great work as Modern Algebra does. My characters has no extra animations and you explained it really well.
Thank you for the great help. (\s/)

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Hello modern algebra,

I have taken a long time to respond, sorry.

The 864 line error: undefined method `empty? 'for nil: NilClass, it's weird, because it happens sometimes.

I've been trying to do that I mentioned in the post above and I have questions about your code.

When the game is running, load all composite weapons and armors in cache? I guess this is where reading the notebox of weapons and armors:

Code: [Select]
    def self.interpret_composite_graphic_string(string, cg = MA_Composite_Graphic.new("", 0, 0, 255, 0, 0))
      if cg.is_a?(Hash)
        string.sub!(/["'](.+)["']/) { cg[:filename] = $1;    "" } # Filename: ""
        string.sub!(/[Zz](-?\d+)/) { cg[:z] = $1.to_i;       "" } # Z:         0
        string.sub!(/[Hh](\d+)/)   { cg[:hue] = $1.to_i;     "" } # Hue:       0
        string.sub!(/[Oo](\d+)/)   { cg[:opacity] = $1.to_i; "" } # Opacity: 255
        string.sub!(/[Rr](\d+)/)   { cg[:rcode] = $1.to_i;   "" } # R-Code:    0
        string.sub!(/[Ii]?(\d+)/)  { cg[:index] = $1.to_i;   "" } # Index:     0
      elsif cg.is_a?(MA_Composite_Graphic)
        string.sub!(/["'](.+)["']/) { cg.filename = $1;     "" }  # Filename: ""
        string.sub!(/[Zz](-?\d+)/)  { cg.z = $1.to_i;       "" }  # Z:         0
        string.sub!(/[Hh](\d+)/)    { cg.hue = $1.to_i;     "" }  # Hue:       0
        string.sub!(/[Oo](\d+)/)    { cg.opacity = $1.to_i; "" }  # Opacity: 255
        string.sub!(/[Rr](\d+)/)    { cg.rcode = $1.to_i;   "" }  # R-Code:    0
        string.sub!(/[Ii]?(\d+)/)   { cg.index = $1.to_i;   "" }  # Index:     0
      end
      cg
    end

If when running the game reads the notebox and is cached, it will be very difficult to modify the code to change equipped items when you change the sprite of the character or event.

Another question. I added several msgbox_p in the code to try understand how it works and also know where I could read the character_name the actor or event. (To do what I said in the post above).

I thought that could do it here:

Code: [Select]
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Composite Character/Face
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macgve_add_cg(type, arg = {})
    case arg
    when String then cg = RPG::MACGVE_Data_CompositeGraphic.interpret_composite_graphic_string(arg)
    when Hash
      cg = MA_Composite_Graphic.new("", 0, 0, 255, 0, 0)
      arg.each_pair(key, value) { cg.send(:"#{key}=", value) }
    when MA_Composite_Graphic then cg = arg
    else
      return
    end
    send(:"base_composite_#{type}") << cg
    $game_player.refresh
  end

Here you call the function that reads the notebox, and as you are in Game_Actor, you can pass as an argument the character_name the actor or event and then use it when you read the filename of weapon or armor notebox. To know what must load.

I do not know if I have explained well.

Thanks for your help. :)

Sorry that I've been gone for so long.

I'm not sure that I understand the question. You're right that the script just draws the actor and loads it into the cache. The cache looks (basically like this:

Code: [Select]
@macgve_name_cache = {
  :face => {
    ["filename1", i1, h1, o1, "filename2", i2, h2, o2, etc...] => "$macgve_blablabla",
  },
  :character => {
    ["filename1", i1, h1, o1, "filename2", i2, h2, o2, etc...] => "$macgve_blablabla",
  }
}

The key lists all the graphics used to create the character, and $macgve_blablabla is the name of the composed graphic. If you know the composite's name, you can retrieve that key with the code:

[code]
Cache.macgve_cgary_from_name("$macgve_blablabla")

You could then modify the filenames in that key and recache the graphic with the code:

Code: [Select]
Cache.recache_cg_from_key(:character, "$macgve_blablabla", key)

I don't understand your second question. Could you rephrase it?

Also, thanks for helping out Octavia in my absence.

**
Rep: +0/-0Level 40
RMRK Junior
Look at this:

Code: [Select]
#  Adding & Removing Composite Graphics:
#
#    Firstly, I will note that the regular event command of Change Actor
#   Graphic does work, but it will only change the basic sprite - it will not
#   remove any of the composite graphics you set up through the notebox.
#
#    To add or remove composite graphics from events, you use the following
#   code in a comment (NOT a script call!), wherever you want it to happen in
#   the sequence of events:
#
#     \add_e1_cc["filename", i0, h0, o255, z0, r0]
#     \remove_e1_cc["filename", i0, h0, o255, z0, r0]
#
#    As you can see, the arguments ("filename", etc.) are all identical to
#   those with which you should now be familiar. The biggest difference is that
#   you need to put remove_e1 or add_e1 before that stuff. Note, the 1 after e
#   is the ID of the event. So, it can be any integer and the graphic will be
#   added to or removed from the event with that ID. If you don't provide any
#   ID, then it will go to the event from which it is called.
#
#    It is important to note that when you use a remove code, you do not need
#   to specify every aspect of the code - what the script will do is simply get
#   rid of every graphic that shares the parameters you do set in. So all you
#   need to do is be specific enough with the arguments that you don't
#   accidentally delete more than you want to delete.
#     
#    The codes for actors are similar:
#
#     \add_a1_cc["filename", i0, h0, o255, z0, r0]
#     \remove_a1_cc["filename", i0, h0, o255, z0, r0]
#     \add_a1_cf["filename", i0, h0, o255, z0, r0]
#     \remove_a1_cf["filename", i0, h0, o255, z0, r0]
#
#   Again, replace the 1 after the a with the ID of the actor whose composite
#   graphic you want to change.
#
#    Finally, you can also use the commands:
#
#     \add_p1_cc["filename", i0, h0, o255, z0, r0]
#     \remove_p1_cc["filename", i0, h0, o255, z0, r0]
#     \add_p1_cf["filename", i0, h0, o255, z0, r0]
#     \remove_p1_cf["filename", i0, h0, o255, z0, r0]
#
#    That will change the composite graphic selected for the party member in
#   that order. So, p1 would be the leader of the party, p2 the second actor
#   in the party, etc...

Ok, now, is it possible to use \add_a1_cc["filename", i0, h0, o255, z0, r0] in a script and not in a comment box? I don't mean a script call of event.

Because I could make a script that works with this call, so that add and remove composite graphics when events or actors change their position.

You know what I mean? :/

EDIT:

I have it.

Code: [Select]
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Interpret Composite Graphic Comment
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macgve_interpret_cg_comment(comment)
    comment.scan(/\\(add|remove)_([eap])(-?\d*)_c([cf])\[(.+?)\]/i) { |oper, char, id, type, args|
      case char.upcase
      when 'A' then actor = $game_actors[id.empty? ? 1 : id.to_i]
      when 'P' then actor = $game_party.members[id.empty? ? 0 : id.to_i - 1]
      when 'E' then id.to_i < 0 ? actor = $game_player.actor : event = get_character(id.to_i)
      end
      type = type.upcase == 'C' ? :character : :face
      actor.send(:"macgve_#{oper.downcase}_cg", type, args) unless actor.nil?
      event.send(:"macgve_#{oper.downcase}_cc", args) unless event.nil?
    }
  end

I create another script that calls methods "macgve_add_cg", "macgve_remove_cg", "macgve_add_cc" and "macgve_remove_cc" manually when I need it. And thanks to this script I learned the method #send. :)

Thanks for your help and so magnificent script. I hope haven't more problems.
« Last Edit: October 10, 2013, 09:25:33 PM by Duende »

*
Rep: +0/-0Level 39
RMRK Junior
Hello! Thanks for the script! It's really useful!

I been a lurker in this forum for a while, but I'm writing this message because I found myself reaching a wall here.

The situation is this: I have different body types and I'd want to make use of the "\ct[X]" codes, that are usually set on the actors notebox. But making a different actor for each body type will make a mess in the long run. Having different clothes of the same type, for each body, is not the best solution, but it would be my last resort.

So I tried (and failed) two solutions:
-If I could read the "\ct[X]" code out of the Class notebox (instead of the Actor notebox), the whole thing could be solved (Since different body types have different classes). But making that change in the script was too much over my level.
-If I can "write" the notebox ingame so I can change the \ct codes through script calls, I can solve it without much problems. Did some research on that but it seems it doesn't work.

I really hope to get some help. I tried to work around it, but failed so far. Any pointer is wellcome!

Thanks for reading!

*
Rep: +0/-0Level 39
RMRK Junior
Sorry to double post, but I been testing on more things.

It seems like I can set a variable in the actor notebox (\ct[$game_variables[X]]) and it manages to read the number inside. The problem is that it doesn't refresh ingame, and it sticks with the first reading of that variable (meaning, zero). So, is it possible to call the notebox reading process again?

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Best RPG Maker User (Programming)2013 Most Promising Project2013 Project of the YearParticipant - GIAW 11Bronze - GIAW 10
MA, Is there any relatively simple way to get Face Options working with Composite Graphics? At the moment, I have each animated face graphic which is processed through Composite Graphics re-marked for animation. Face Options then kicks in, but I am having difficulty grabbing the graphic which has been altered by Composite Graphics. Is it as easy as finding a way to pass the processed bitmap, or is this going to require some heavy modification? The code is like a maze, and I feel a bit lost, so I thought I would ask. I think it would be really neat for the two scripts to co-exist and function correctly.

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 35
RMRK Junior
Thanks for the awesome script! I am sorry in advance if posting here is considered breaking the rules, but I just had one question.

Is it possible to have a message code that applies the composite components of an actor's face onto a face graphic that is set in the Show Text option?

I am just thinking it would be sort of neat to be able to apply any changes to a face yet still being able to retain the ability to choose between different emotions in the messages.

I've tried my best to look at and analyse the script but sadly it's beyond my ability to comprehend it.

If it's too much trouble or not doable then no worries at all. Having this script is already a huge boon to my project. Thanks a lot!

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
I think there is something like that built in to the script. Whether it works or not is another question. Anyway, here are the instructions:

Code: [Select]
#  Messages:
#
#    This script introduces two new codes which can be used in messages to show
#   actor faces, since otherwise you would be unable to show composite faces in
#   messages. The codes are:
#
#      \af[x] - this will show the face of the actor with ID x
#      \pf[x] - this will show the face of the party member in xth place. It
#              starts at 1, so \pf[1] would show the face of the party leader,
#              \pf[2] would show the second member's face, etc.

****
Rep:
Level 43
Somewhat got a project? (\ô/)
GIAW 14: ParticipantParticipant - GIAW 11
I tried to use it with my project, but I can't load save games, because it ignores the "enter" button.
And if I try to start a new game, I get a error message: "Stack level too deep."
The only 3 scripts that affects the character are:
Modern Algebra => Extra Movement Frame
GALV => Superman Ability
GALv => Character Animations

I hope it's a problem that can be fixed, thank you, would be nice. :) (\s/)

Here is my momentary project to be found:
http://steamcommunity.com/sharedfiles/filedetails/?id=289815558&searchtext=

If that would help. :) /)

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Ignores the enter button...? As if you aren't pressing it at all? Are you sure it was this script? o.o I know that sometimes you have to delete saved files (and start with a new one) to get certain scripts to work properly.

"Stack level too deep" usually only shows up when two scripts are occupying the same class or something along those lines, I think. Usually, I get that issue when I move them around and accidentally have two of the same script. But looking at the ones you're using, it may be likely that Galv's Character Animations and possibly even the extra movement frames script wouldn't be compatible with this. (I think?)

Note: I don't know how to script.
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


****
Rep:
Level 43
Somewhat got a project? (\ô/)
GIAW 14: ParticipantParticipant - GIAW 11
For the first question, if I place it as the first script I can't load my saved games and it makes a sound like you can't chose it.
So it accept the Enter button, but don't do the command. ;)

If I put it on the last place of my scripts, I get this error message in the spoiler. :) (\s/)

Spoiler for:

Thank you for your fast answer, I thought the same, that the Extra Movement and Character Animations are the problem, because the other don't affect the Actors. /)

It would be great, if there could anyone make a compatibility patch for it. Because I plan to add an character editor and with images you need around 2000 pics or more.

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Best RPG Maker User - StoryProject of the Year 20142014 Queen of RMRK2011 Best Newbie2014 Kindest Member2014 Best RPG Maker User - Creativity2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Creativity)2012 Best Yuyubabe Smiley;o
Ohh, I've had the issue where it makes the sound but won't load before, only with different scripts. Yeah, I think that usually does fix if you replace the save files. But in this case, you can't because of the error message.

I don't really know scripting, so that was all just a guess! Good luck, though. That's a lot of character graphics to handle. O.O
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


**
Rep: +0/-0Level 35
RMRK Junior
I've been doing a lot of testing on the scripts that I am currently using and I am finding there to be a rather peculiar compatibility issue between your Composite Graphics script and other scripts that uses Instance Items, such as the one found here http://himeworks.com/redirect.php?type=script&name=Instance_Items

This error seems to spread across various kind of instance scripts, as the same error also occurs when I use SES's instance script as well.

The error is quite simple and easily reproducible. Whenever I save and load a game, when I finish loading, all my equipments would be unequipped, and the equipped items would vanish from the inventory.

I can create a debug demo if you want, and if you're busy with other commitments then don't worry too much about this :P Thanks!

****
Rep:
Level 43
Somewhat got a project? (\ô/)
GIAW 14: ParticipantParticipant - GIAW 11
I will try, if this script will help with my problem. ;)
Thank you for your answer. If you want to make a debug demo, it would be really nice and help me a lot. :) (\s/)

*
Rep: +0/-0Level 34
RMRK Junior
hello,
thank you for the script!
but i have a question.. how do i choose the position to an added picture?
i change the face with a aprox full body pic and i need to place clothes in different positions.
PS: Sorry for my english!

*
Rep:
Level 33
RMRK Junior
Super script.
I've created a small demo.
« Last Edit: January 17, 2015, 12:05:47 PM by Leonsoft »

****
Rep:
Level 43
Somewhat got a project? (\ô/)
GIAW 14: ParticipantParticipant - GIAW 11
Nice demo, it will help a lot using this script, thank you so much. *hugs* :D (\s/)

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2010 Favourite Staff Member2010 Most Mature Member
Cool. Thanks Leonsoft

*
Rep: +0/-0Level 28
RMRK Junior
I'm having an issue where my body armor, \cc["armor1",0] isn't drawing over the Actor sprite Graphic at times. It happened when I decided to make a cape accessory, \cc["cape1",0,z1], \cc["cape1",4,z-1]. I have two different scenarios. In one, if I take off the helmet, \cc["helm",7,z2], the body armor is drawn under the Actor sprite Graphic - the character in her underwear. In another scenerio, the composite is drawn correctly, but I put ON the helmet, and the body armor disappears again leaving a half naked sprite wearing a cape and helmet. With the cape off completely, in both scenarios, everything equipped draws correctly.

I've checked all my (z) priorities multiple times, and everything looks great. I've tried changing the order of priorities in the notebox. I've even re-sorted all my (z) priorities so that the body armor is \cc["armor1",1,z1], \cc["armor1",1,z-1], so it displays before and after the Actor sprite Graphic which is z0 at default, and when I put the cape on again, the Actor Graphic STILL draws over the armor despite it being 1 layer above.

In the first scenario, with ALL armor equipped, everything draws correctly - until the helmet is taken off. Is this a bug with accessories, or am I doing something wrong?

I've created 45 character files so far, which makes over 4000 individual weapons and armors. I was really looking forward to adding capes to the mix.