Look at this:
# 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.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * 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.