So, I'm working on a way to read the FaceName of the picture in a Show Text event and then add text to the existing text based on that.
So far, everything is working...but only the first time around.
This is my code that works in conjunction with the Irina Visual Novel Bust plugin.
To simplify it:
The plugin reads certain expressions such as \bust[1] and then changes the text message based on that.
But I want to save myself time, and instead of having to write all the escape strings like \bust[1] into the actual text window, I want them added to the text window based on certain parameters I extract from the name.
What happens right now is that everything works, the correct picture is picked for the bust and displayed and all escape strings are added to the message.
But when I play the message a second time, none of those are added again.
So the first time I read the message I get as
text text = Irina_Text + text;
while the second time the same text is displayed, I only get
text = text
I think the reason must be that Game_Message.prototype.addText = function(text) only plays the first time around when a message is created, but not the second time around?
Does anyone know how I can add a text to a textmessage permanently, even when the text is played again and the escapes are removed, so that something like:
"Hi, this is my face." will always instead be written as "\bust[1]Hi this is my face" even on repeat viewings?
So far, everything is working...but only the first time around.
JavaScript:
//This adds ActorBust commands automatically Bust|Bustmirror|LightSelf|DimOther|Expression
var Irina_IS_Game_Message_addText = Game_Message.prototype.addText;
Game_Message.prototype.addText = function(text) {
console.log("==============ADDTEXT GAME MESSAGE===============");
if (Irina_IS_ActorSwitched == true) {
if (Irina_IS_Direction == "RIGHT") {
console.log("WE'RE HEADING RIGHT")
var Irina_IS_Bust = "\\bust[1]" + "\\bustExpression[1," + Irina_IS_New_FaceIndex + "]" + "\\bustLight[1]" + "\\bustDim[2]";
var Irina_Text = Irina_IS_Bust + "\\" + Irina_IS_ActorName + "_RIGHT";
} else if (Irina_IS_Direction == "LEFT") {
console.log("WE'RE HEADING LEFT")
var Irina_IS_Bust = "\\bust[2]" + "\\bustMirror[2]" + "\\bustExpression[2," + Irina_IS_New_FaceIndex + "]" + "\\bustLight[2]" + "\\bustDim[1]";
var Irina_Text = Irina_IS_Bust + "\\" + Irina_IS_ActorName + "_LEFT";
}
text = Irina_Text + text;
}
Irina_IS_Game_Message_addText.call(this, text);
}
//injects into command101 and switches the original face with the redirected one
var _IS_Game_Message_Show_Text = Game_Interpreter.prototype.command101;
Game_Interpreter.prototype.command101 = function() {
Irina_IS_ActorFace = this._params[0];
Irina_IS_ActorIndex = this._params[1];
Game_Interpreter.IS_Clean_Setup();
Game_Interpreter.IS_Origin_Face_Extract();
if (Irina_IS_ActorSwitched == true) {
this._params[0] = Irina_IS_SourceFolder + Irina_IS_New_ActorFace;
this._params[1] = Irina_IS_New_FaceIndex;
}
_IS_Game_Message_Show_Text.call(this);
if (Irina_IS_DEBUG == true) {
console.log("==OUTPUT (Anyone/Irina)==");
console.log("FaceName: " + this._params[0] + ", FaceIndex: " + this._params[1]);
}
};
To simplify it:
The plugin reads certain expressions such as \bust[1] and then changes the text message based on that.
But I want to save myself time, and instead of having to write all the escape strings like \bust[1] into the actual text window, I want them added to the text window based on certain parameters I extract from the name.
What happens right now is that everything works, the correct picture is picked for the bust and displayed and all escape strings are added to the message.
But when I play the message a second time, none of those are added again.
So the first time I read the message I get as
text text = Irina_Text + text;
while the second time the same text is displayed, I only get
text = text
I think the reason must be that Game_Message.prototype.addText = function(text) only plays the first time around when a message is created, but not the second time around?
Does anyone know how I can add a text to a textmessage permanently, even when the text is played again and the escapes are removed, so that something like:
"Hi, this is my face." will always instead be written as "\bust[1]Hi this is my face" even on repeat viewings?