[XP] Event Graphic Changer

Started by nathmatt, August 07, 2010, 10:18:07 am

Previous topic - Next topic

nathmatt

August 07, 2010, 10:18:07 am Last Edit: August 08, 2010, 08:55:47 am by nathmatt
Event Graphic Changer
Authors: Nathmatt
Version: 1.05
Type: Graphic changer for events
Key Term: Misc Add-on



Introduction

This will make it easier to change all your main events if you decide to change what they look like.



Features


  • Can have the event always match any actor in the database
  • Can have the event always match any actor in the party
  • Can have the event always match a defined graphic
  • can now change the pose



Screenshots

no screenshot needed



Demo
no demo


Script

Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Event Graphic Changer by (EGC) Nathmatt
# Version: 1.05
# Type: Graphic changer for events
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  
#  This work is protected by the following license:
# #----------------------------------------------------------------------------
# #  
# #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# #  
# #  You are free:
# #  
# #  to Share - to copy, distribute and transmit the work
# #  to Remix - to adapt the work
# #  
# #  Under the following conditions:
# #  
# #  Attribution. You must attribute the work in the manner specified by the
# #  author or licensor (but not in any way that suggests that they endorse you
# #  or your use of the work).
# #  
# #  Noncommercial. You may not use this work for commercial purposes.
# #  
# #  Share alike. If you alter, transform, or build upon this work, you may
# #  distribute the resulting work only under the same or similar license to
# #  this one.
# #  
# #  - For any reuse or distribution, you must make clear to others the license
# #    terms of this work. The best way to do this is with a link to this web
# #    page.
# #  
# #  - Any of the above conditions can be waived if you get permission from the
# #    copyright holder.
# #  
# #  - Nothing in this license impairs or restricts the author's moral rights.
# #  
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Instrutions:
#
#  To use the event effects in this script you will need to name the following.
#
#  \p[id]                 Will make the events graphic always be the same as  
#                         the actor in the specified parties position
#
#  \a[id]                 Will make the events graphic always be the same as  
#                         the actor in the specified position
#
#  \c[id]                 Will make the events graphic always be the same as  
#                         the graphic specified in the script
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Script Calls:
#
#   defenition:
#
#     id = events id
#     d  = the direction of the pose
#     p  = the pattern of the pose
#
#     $game_map.events[id].change_pose(d,p)
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
$egc = 1.05
class Game_Map
 
 Auto_Update = true
 
 # custom graphics
 def graphic(id)
   case id
   when 1 then return 'LOS-Ethnic05'
   end
 end
 
 
 alias setup_graphic setup
 def setup(map_id)
   setup_graphic(map_id)
   $game_map.events.each_key {|i|
   graphic_check(i) if $game_map.events[i] != nil}
 end
 
 def graphic_check(event_id)
   event = @map.events[event_id]
   if event.name.clone.gsub!(/\\[Pp]\[(\d+)\]/) {"#[$1]"}
     $game_map.events[event_id].character_name =
     $game_party.actors[$1.to_i].character_name
     $game_map.events[event_id].refresh
   end
   if event.name.clone.gsub!(/\\[Aa]\[(\d+)\]/) {"#[$1]"}
     $game_map.events[event_id].character_name =
     $game_actors[$1.to_i].character_name
     $game_map.events[event_id].refresh
   end
   if event.name.clone.gsub!(/\\[Cc]\[(\d+)\]/) {"#[$1]"}
     $game_map.events[event_id].character_name = graphic($1.to_i)
     $game_map.events[event_id].refresh
   end
   
 end
 
 alias update_graphic update
 def update
   update_graphic
   if @party != $game_party.actors && Auto_Update
     @party = $game_party.actors.clone
     $game_map.events.each_key {|i|
     graphic_check(i) if $game_map.events[i] != nil}
   end
 end
 

end

class Game_Event
 attr_accessor :character_name
 
 def change_pose(d,p)
   @direction = d
   @pattern = p
   @original_pattern = p
 end
 
end



Instructions

In the script



Compatibility

no compatibility issues known



Credits and Thanks


  • Nathmatt



Author's Notes

if you have any issues / suggestions post here
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


G_G

To be honest, I don't see the usefulness in this. You can already change their graphic, its an event command on Page 3. And I don't understand how to even use it.

WhiteRose

So, this could, for example, set events that look just like your current party members or something like that? I suppose there could be times where it would be useful.

legacyblade

This is useful, but not one I'd use myself (as it's easy to event). If you're playing a game that the player will choose which characters are with you and what you look like in the beginning, this would be an awesome script. If you add support for Blizz's visual equipment, everyone would love you for this.

nathmatt

August 07, 2010, 04:17:15 pm #4 Last Edit: August 08, 2010, 08:56:56 am by nathmatt
i mainly made it for say about halfway through your game you decide to change your main char instead of going through all ur events just change the graphic of the main char
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


WhiteRose

Quote from: nathmatt on August 07, 2010, 04:17:15 pm
i mainly made it for say about halfway through your game you decide to          change your main char instead of going through all ur events just change the graphic of the main char


There's already an event command for that. Of course, if this is compatible with BABS, then it's definitely a useful script, as the event method doesn't work.

legacyblade

He means if you've made several events that use the main character's graphics (if you want to have the character use poses, you have to do it this way, at least when blizz was still making blizzABS), you'd need to manually go through and change tons of event commands. It'll speed things up for a lot of people. One thing that'd REALLY help though is if you could give us a script call to change the event's graphics to currentGraphic_pose (then the frame via a 2D array). That way every pose could be based on the graphic in the database, rather than doing it manually. Trust me, Rose, it's a useful script.

WhiteRose

Quote from: legacyblade on August 07, 2010, 04:43:50 pm
He means if you've made several events that use the main character's graphics (if you want to have the character use poses, you have to do it this way, at least when blizz was still making blizzABS), you'd need to manually go through and change tons of event commands. It'll speed things up for a lot of people. One thing that'd REALLY help though is if you could give us a script call to change the event's graphics to currentGraphic_pose (then the frame via a 2D array). That way every pose could be based on the graphic in the database, rather than doing it manually. Trust me, Rose, it's a useful script.

Oooh, alright; I get it now. That is indeed useful. Your explanation helped considerably; he was a little vague in his description.

legacyblade

Ya, it was a bit vague, but I knew what he meant when he said decide to change the main character's graphic halfway through the game, as I already had to do that. It took HOURS.

nathmatt

ill look into that but its easier to use a dummy graphic all directions stay the same only thing that changes is the graphic
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


legacyblade

If you did it that way, it'd still work. I just use LOTS of poses, and most have transition frames from any given pose in my games, so to save on file-space, I group them into charsets with different poses in each frame. But it'd still be really useful if you just made it so I could change the graphic based on the event's current graphic (which was based on the character's graphic)

nathmatt

update: 1.05 added the ability to change the pose

@legacyblade i believe thats what you wanted
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


legacyblade

That's exactly it, nath, thanks. This is going it be a really useful script. WHy isn't it databased though?