MZ Make an event display a sprite graphic based on an actor's sprite.

So I've run into a tiny problem...

I've added a function to my game to change your party members' appearance when they're equipped with certain armor. This is working as intended, but my problem is that when I start making cutscenes, I'm going to run into an issue where the actor sprites in cutscenes won't match the sprites that you have your characters set to, unless I make a whole bunch of different event pages for every possible sprite for a given actor.

So... I figured I'd ask for a plugin to get around that problem. I think it should be pretty simple - just let me place a note tag in the notebox of an event that draws the event graphic based on the current sprite of the specified actor. For example, if I wanted Page 1 and 2 of an event to display Actor 2's current sprite graphic, the notetag could be something like "<ActorGraphic: 2;1,2>" or whatever (I don't know if that's correct syntax or not, but you get the idea 😛) or if I wanted every single page to display Actor 2's graphic, I could just put "<ActorGraphic: 2>". Of course, I need the ability for it to NOT display that specific graphic on certain pages, such as when the event needs to be invisible, so that's why there needs to be the option to specify what page(s) the graphic appears on.

Could anyone help me out with this? I would really appreciate it! Also, for the record, it needs to be allowed for commercial projects, since I plan to use a pay what you want model (including free) which counts as commercial. Oh also, if it matters, I have the VisuStella EventsMoveCore plugin, so you need to make sure it doesn't conflict with that. Thanks! 🙂
You shouldn't need a whole plugin for this. You should be able to just use the script calls:
Code:
$gameMap.event(eventId)._characterName=$gameActors.actor(actorId)._characterName;
$gameMap.event(eventId)._characterIndex=$gameActors.actor(actorId)._characterIndex;
$gameMap.event(eventId).refresh();

where eventId is the ID of the event and actorId is the ID of the actor you want it based on.

You can put them as the first lines of an event if it's autorun or parallel, or in an external event.
You shouldn't need a whole plugin for this. You should be able to just use the script calls:
Code:
$gameMap.event(eventId)._characterName=$gameActors.actor(actorId)._characterName;
$gameMap.event(eventId)._characterIndex=$gameActors.actor(actorId)._characterIndex;
$gameMap.event(eventId).refresh();

where eventId is the ID of the event and actorId is the ID of the actor you want it based on.

You can put them as the first lines of an event if it's autorun or parallel, or in an external event.

Hmm... They wouldn't typically be autorun or parallels though. What do you mean by having it be in an external event?
You plop an event on the map, make it autorun, and it sets the sprite of whatever other event(s) you want. Therefore it's done as soon as the player enters the map.
You can also put that script call in the event's custom move route. So it doesn't necessarily have to be autorun or parallel process.
1661743979457.png


This is what I did, and... it works! 😀 Thanks guys!

Original thread: https://forums.rpgmakerweb.com/threads/make-an-event-display-a-sprite-graphic-based-on-an-actors-sprite.150890/