Your code screenshot doesn't provide line numbers, so we can't see where the error is based on your error trace.
However:
The game variables don't exist before the game starts, so if this is in a portion of the plugin that's loading the plugin parameters, this won't work.
Also, a variable is not going to be null unless you intentionally set it to that.
Sorry I forgot to provide the line error, this 240
This 528
About null, I grab a default value that I set on plugin manager just in case if I don't put any value on that variable
Thirdly, there's no reason to do String($gameVariables.value(3)) - if the contents of that variable are set to be a string, it's a string.
I was try without and with that, but you've got a point. I think that's redundant
It might help if you explained what you're trying to accomplish and why.
So I want to make a puzzle game like Spotlight: Room Escape (Android game). Some of items are locked on treasure and need to unlocked using password. The password input using this plugin and adding some condition, which is work well like this
But, there's a problem. I want on start of the game that a player input their name first. Which the description text are shown same as I want to put a password
And then came up with idea that grabbing variable value into that plugin. So I just use that variable to change description text
if you want to change display message through variable
you can also try to change line 445 to something like this:
JavaScript:
Window_NameExplanation.prototype.refresh = function() {
this.contents.clear();
let text = eval(_displayMessage);
let text2 = eval(_displayMessage);
this.drawText(text, -10, 0, this.windowWidth(), 'center');
this.drawText(text2, -10, this.lineHeight(), this.windowWidth(), 'center');
};
}
than on the display message and disaply message 2, you can set
$gameVariables.value(3)
than control that inside the game anywhere you like.
I would suggest to use 2 different variables for line 1 and line 2.
otherwise, more code need to change a bit to allow "enter" for a new string
like "\n" for the splitting the text.
I tried to add like this with console.log
But it gives me an error and show about $gameVariables
I think this problem just like
@ATT_Turan mention
The game variables don't exist before the game starts, so if this is in a portion of the plugin that's loading the plugin parameters, this won't work.
Is there anything on plugin to change into load variable throughout game play?