Is there a way to make items trigger sprite animations in battle?

Hello everyone! I hope you are doing well!

So, as my title states, I am looking for a way to make an item used in battle call a specific animation from the sprite of the target. For example, if I have Character A use a potion on Character B, I want Character A to play the "use item" animation, and character B to play the "consume item" animation.

If I remember it right, Super Mario RPG on the SNES did something like that where if you use an item on a teammate, the teammate plays a little animation as they say "Thank you." So something like that.

I guess if it helps, what I'm actually trying to accomplish is this: My game will have all healing items be food. so I want to have one character play the item use animation and the target character play the eating animation.

Is there a way to do that in the game with eventing or scripting? Or is that something that will require a plug-in? And if so does anyone know of a plugin that can accomplish it?

I've done a bit of looking around and can't find anything that might even point me in the right direction here, so I would appreciate any assistance on this.

Thanks in advance! Be cool and smile everyone!
So you're both right and wrong 😉

The things you're asking about are actually called motions, and they're defined on the spritesheet - you have your idle motion, casting motion, etc. The spritesheet has a defined format, so you can't just add another couple of motions that you use at certain times.

Now I don't know of every plugin in the world, so there may be something out there that allows for extended spritesheets with extra motions, but I figure Googling with the correct terminology will help you determine that.

That said, you could actually implement this with animations. You would make an animation sheet of your giving and receiving motions, and use something like Yanfly's action sequences to display the appropriate animations on top of the actors.
The things you're asking about are actually called motions, and they're defined on the spritesheet - you have your idle motion, casting motion, etc. The spritesheet has a defined format, so you can't just add another couple of motions that you use at certain times.
Could you perhaps use a quick swap of the spritesheets for special motions? You'd have to do it through script and account for graphic loading, but unless I miss my guess there may be a way to do that. Horribly complicated and the timing would need to be controlled pretty tightly.

But for the most part, there's not much in the way of forcing a target to use a specific motion at a specific time, or FOR a certain length of time. Not natively. I'd say a plugin of some sort would be REQUIRED.
Could you perhaps use a quick swap of the spritesheets for special motions?
You could, but again the method that comes to mind is action sequences - you'd use commands inside of one to reassign the actor's sheet, call a motion, and assign it back.

With all that, I think it would be slightly less effort and overall fewer commands to use animations than swapping the spritesheet, but I imagine both methods would be possible.
I'd say a plugin of some sort would be REQUIRED.
Definitely.
@Drakkonis and @ATT_Turan

Thank you both for the quick responses. I do actually have Yanfly's Battle Sequence packs. I have no experience with them, and they look complicated! But that's just a step I will have to figure out. I was not sure if they could accomplish it, but it sounds like it can.

And thanks for the correction on the words. I tried looking for a way to call motions instead of animations and found some additional resources right away. Thanks for the help there.

You say I can make custom animations to play over the characters. Could you explain a little more on that to give me a jumping off point? Not looking for a full tutorial, just some basics.

Wouldn't playing the animation directly on top of the sprite still have the other sprite be visible beneath it as it moves? Or can yanfly temporarily make the base sprite invisible temporarily while the animation plays? And yanfly's plugin can choose the animation to use based on the target of the item? (Just making sure that is all possible before I start going down the wrong path on it.)

Thanks again!
Ahh, so in other words, you want to play battler's motion sequence when item is used on him, heh, nothing more simple:


List of available motions to use:
guard
spell
skill
item
thrust
swing
missle
damage
evade
victory
escape
abnormal

and probably I missed something.
@Soulrender Oh wow! That would be exactly what I need! Thank you! Though, my project will use custom SV battlers as well, so I don't know if that will function correctly with whatever plugins I will use.

Even still, it's good to know that a command like that exists and will certainly help me figure out further how to make my plugins and such do what I want. Thank you very much for the information!
Just remember to put after command b.requestMotion('motionName'); some number, because it's damage formula, a field that engine evaluate javascript calls and it expect numeric result, when you forget to put number at the end of it, your game might crash or item\skill won't work (however other script calls will execute).
You say I can make custom animations to play over the characters. Could you explain a little more on that to give me a jumping off point? Not looking for a full tutorial, just some basics.

Wouldn't playing the animation directly on top of the sprite still have the other sprite be visible beneath it as it moves? Or can yanfly temporarily make the base sprite invisible temporarily while the animation plays?
Action Sequences 2 has an opacity command.
And yanfly's plugin can choose the animation to use based on the target of the item?
You'd have to do some coding. You'd either use if statements to check the actor ID and play the corresponding animation, or you could create a notetag you put on the actors (e.g. <ItemAnimation: 39>) that you then read in the sequence.

Soulrender's solution can work (and it didn't occur to me) if one of the existing motions fits your idea of what giving or receiving an item looks like. I'm not sure any does to me, but that's personal taste.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-make-items-trigger-sprite-animations-in-battle.146906/