MZ Change Face Image When Hit In Battle Plugin?

So, I've looked for a while as to how to make this. I've tried Waynee95's CustomFaceImageEval's along with several forum posts but they always end up the same or somewhere close to the same. When trying to replicate it, the effect is usually the face changing but it's not every time the actor gets hit, the actor's face stays when getting hit and doesn't change, or it doesn't change at all

I decided to try Hakuen Studio's Face Reaction, but all I get back is error messages. Even after uploading it to a completely new project it still messes up.

I've even tried Yanfly's Buffs and States Core to change the faces, but it didn't work. AND I've tried Yanfly's Base Troops Events combined with a event that changes the actor's face when the state is applied, but still, nothing.

I've nearly given up on trying to add this feature to the game, but I would like to know if there is some way I could do it.

Through states or straight up scripts, if it works, I'm fine. 😅
Hi there!
If you tried my plugin, why don't you tell me the errors so I could take a look? 🙂
You could have created a topic on the itch io page with your problem.

But now I'm here 🙂
What is going on? Replicate the error, then press F12 or F8 to open a browser window. Then go to the CONSOLE tab and send me a screenshot of what is in there so I could take a look.
Oh wow! Sorry about that. I was mainly trying to find a plugin. But now that you're here, it seems like it's the best time to do it.

This is the error message I recieved when playtesting.
part3.PNG


part2.PNG


I'm not sure if this is the cause of conflicting plugins or an error in the code. I think the plugins are set up properly...

part1.PNG


It may be because of the png size I'm using for the faces? but I'm not sure if that would be the reason.
Oh wow! Sorry about that. I was mainly trying to find a plugin. But now that you're here, it seems like it's the best time to do it.

This is the error message I recieved when playtesting.
View attachment 310851

View attachment 310848

I'm not sure if this is the cause of conflicting plugins or an error in the code. I think the plugins are set up properly...

View attachment 310849

It may be because of the png size I'm using for the faces? but I'm not sure if that would be the reason.
I don't know what is the configuration you have for Visustella, but since I fixed some compatibility issues with their plugins these days, I had a project already set up, so I did a little test with my Faces Reaction and it worked fine with Battle Core. I mean, no error. And that error you got must show up regardless the plugin parameter or the face images you set.

The error you are getting seems to be that the Game_Actor did not properly initiate the object _faceReactionData, so it is undefined. The only thing I can think that could happened is if the initMembers method has been overwriten.

Since Visustella plugins are obfuscated and plus some statements of their terms of use, I cannot guarantee for sure that I will manage to make a patch to fix that or even find the problem. But I already got lucky this week two times, so, upload this project you have somewhere and send me the link of it on PM here on the forums. That is the best way for me to take a look and find/fix the problem.
Just to mention it, be careful with your plugins. In your first post, you're throwing out stuff for MV when your project is MZ, and all the Yanfly stuff is only going to work correctly in MV.

Even if you're using Project FOSSIL with it, you shouldn't be using those Yanfly plugins and VisuStella plugins that do the same things in one project. That's just going to break your game.
Just to mention it, be careful with your plugins. In your first post, you're throwing out stuff for MV when your project is MZ, and all the Yanfly stuff is only going to work correctly in MV.

Even if you're using Project FOSSIL with it, you shouldn't be using those Yanfly plugins and VisuStella plugins that do the same things in one project. That's just going to break your game.

Noted. Thank you

I don't know what is the configuration you have for Visustella, but since I fixed some compatibility issues with their plugins these days, I had a project already set up, so I did a little test with my Faces Reaction and it worked fine with Battle Core. I mean, no error. And that error you got must show up regardless the plugin parameter or the face images you set.

The error you are getting seems to be that the Game_Actor did not properly initiate the object _faceReactionData, so it is undefined. The only thing I can think that could happened is if the initMembers method has been overwriten.

Since Visustella plugins are obfuscated and plus some statements of their terms of use, I cannot guarantee for sure that I will manage to make a patch to fix that or even find the problem. But I already got lucky this week two times, so, upload this project you have somewhere and send me the link of it on PM here on the forums. That is the best way for me to take a look and find/fix the problem.

So I tried doing it again on a new project and it worked. I now realize that when I first did it, I didn't add the ELI Book so the Face Reactions wouldn't work.

I've come to the conclusion that it's something I put in the templates file which is screwing things up. I'll go check it out and reply later when I've found the main issue.
I don't know what is the configuration you have for Visustella, but since I fixed some compatibility issues with their plugins these days, I had a project already set up, so I did a little test with my Faces Reaction and it worked fine with Battle Core. I mean, no error. And that error you got must show up regardless the plugin parameter or the face images you set.

The error you are getting seems to be that the Game_Actor did not properly initiate the object _faceReactionData, so it is undefined. The only thing I can think that could happened is if the initMembers method has been overwriten.

Since Visustella plugins are obfuscated and plus some statements of their terms of use, I cannot guarantee for sure that I will manage to make a patch to fix that or even find the problem. But I already got lucky this week two times, so, upload this project you have somewhere and send me the link of it on PM here on the forums. That is the best way for me to take a look and find/fix the problem.

Okay! So I found out what the problem was!

The normal face sheet that's provided by RPG Maker is 144x144. However, the face sheet I'm using contains faces of 192x164. Because of the sizes of the faces, it messes up how the plugin is supposed to perceive the png.

Because of this, I'd have to go into the plugin code to change the face size limit or something like that.
Eli can speak as to whether his plugin does anything unexpected in this regard.

Generally speaking, all you need to do is paste the below into a text editor, save as a *.js file, and include as a plugin at the top of your plugin manager list.
Code:
ImageManager.faceWidth = 192;
ImageManager.faceHeight = 164;

However, keep in mind that it may screw up the formatting of any windows where the faces are displayed.
Noted. Thank you



So I tried doing it again on a new project and it worked. I now realize that when I first did it, I didn't add the ELI Book so the Face Reactions wouldn't work.

I've come to the conclusion that it's something I put in the templates file which is screwing things up. I'll go check it out and reply later when I've found the main issue.
- The missing of Eli Book would not throw that error, but it will throw another one. So the problem must be other. Also, on the screenshot above, was showing Eli Book there.

Okay! So I found out what the problem was!

The normal face sheet that's provided by RPG Maker is 144x144. However, the face sheet I'm using contains faces of 192x164. Because of the sizes of the faces, it messes up how the plugin is supposed to perceive the png.

Because of this, I'd have to go into the plugin code to change the face size limit or something like that.
- Thta also has nothing to do with the error. There was something else happening. But if you manage to make it work now, fine. Just let me know if anything goes wrong.
Have fun!

Original thread: https://forums.rpgmakerweb.com/threads/change-face-image-when-hit-in-battle-plugin.170159/