Firstly, I apologize if I am not explaining things well and if this entire post is long. I am new to learning JavaScript, and I have been using RPG Maker MV as my game engine. I will do my best to explain what issues I have run into, what kind of solutions I have tried, and what I am stuck on. I want to learn and understand what I am working with because too many people tell me to just use Gen AI for my code, when that is the last thing I want.
For my game, I am using a visual novel plugin made by Lulu's Church called Standing Pictures, where you can assign IDs to busts/sprites and use them in a text code with coordinates assigned to each one within the message window of RPG Maker MV, ex. \F[Antonio] (Displays the assigned bust image to the right) \FF[Susana] (Displays assigned image to the left)
You can also assign two blink images to a parent sprite, overlaying them on top of the sprite at random intervals to give the illusion that the character is blinking. You can assign a cut-up version of the face to the blink image ID to do so, and I thought it would be a good idea to do something similar, but without the random intervals and instead use text codes to call an expression onto a parent sprite.
I cracked open Visual Studio Code and got to work editing the plugin file as per the licensing of the plugin. I made my own variables(?) called spriteExpression and spriteExpression2, and allowed them to be affected by filters and color changes. I made my own tester function that only draws on the first variable to show up using a simple boolean, as with the blink images. It works when using a test expression on one of my character sprites, as it overlays onto the sprite and sticks onto it when animations and colors are being changed; however, I quickly ran into an issue.
//Neon Addition
Sprite_LL_SPicture.prototype.updateExpression = function() {
this._spriteExpression.visible = true;
};
How the heck do I connect this to a text/escape code in RPG Maker?
I tried to follow what the plugin does already by making this huge code block as with the other text codes, but I am not sure how to make this call my function to turn on the expression.
// Neon Addition
// Retrieve Expression for Specified Character
var sPictureExpression = null;
if (index === 0) processEscapeNumber = text.match(/\\E\[(\w+)\]/) || text.match(/\\E1\[(\w+)\]/);
if (index === 1) processEscapeNumber = text.match(/\\EE\[(\w+)\]/) || text.match(/\\E2\[(\w+)\]/);
if (index === 2) processEscapeNumber = text.match(/\\EEE\[(\w+)\]/) || text.match(/\\E3\[(\w+)\]/);
if (index === 3) processEscapeNumber = text.match(/\\EEEE\[(\w+)\]/) || text.match(/\\E4\[(\w+)\]/);
if (index === 4) processEscapeNumber = text.match(/\\E5\[(\w+)\]/);
if (index === 5) processEscapeNumber = text.match(/\\E6\[(\w+)\]/);
if (index === 6) processEscapeNumber = text.match(/\\E7\[(\w+)\]/);
if (index === 7) processEscapeNumber = text.match(/\\E8\[(\w+)\]/);
if (processEscapeNumber && processEscapeNumber[1]) {
sPictureExpression = processEscapeNumber[1];
}
//
Once again, I am super sorry that I may or may not sound like I am making sense. I am still learning and trying to figure out what to do, and any help would be appreciated.
I have linked the original plugin by Lulu's Church so people can take a look at the source code just in case.
Lulu Church's Standing Pictures Plugin