Code:
var TH_WindowChoiceList_numVisibleRows = Window_ChoiceList.prototype.numVisibleRows;
Window_ChoiceList.prototype.numVisibleRows = function() {
// need to calculate how much space is left
if (this._choiceMode === 1) {
var textState = this._messageWindow._textState;
var y = textState.y; ##<<<<<<< that should be the problem
var textHeight = textState.height;
var messageHeight = this._messageWindow.height - this.padding * 2
if (textState.text !== '') {
y += textHeight;
}
return Math.floor((messageHeight - y) / textHeight);
}
else {
return TH_WindowChoiceList_numVisibleRows.call(this);
}
};
I'm eyeballing it because I don't have mv in this computer, but that's what "can't read .y of 'null'" means.
textState is null, which means this._messageWindow._textState is also null.
the only instance where I remembre _textState being null, is when the window is created, and when the text finishes processing.
it is the equivalent of pos[] within the message window in Ace (but it is an internal variable? 0o what is it doing across plugins? )
Code:
at Window_ChoiceList.updatePlacement (YEP_MessageCore.js:908)
at Window_ChoiceList.updatePlacement (HIME_HMSChoiceDisplayMode.js:155)
make sure those two plugins are not conflicting, because it first goes to Hime, and then to Yanfly, so Yanfly might be redefining something that Hime needs.
The fact that you think it can be related to looping a dialogue might be that without the loop the code ends as expected, clearing all it's objects (displays the window, you take your option, and the window closes) and then it resumes the program from the message window point that called the choice window (which will create the choice window again when it needs it)
Looping the code around could cause the dialogue window to not close properly, and not give time to the message window to redefine the choice window, which both Hime and YF are dealing with.
I encountered a similar problem a while ago, while trying to create a new choice window.
I ended up just duplicating the window and working on a copy rather than referencing it as a required object because I couldn't isolate it from other processes.