Hello, I have been starting to learn JS for RPG MAKER MV so I do not know much about this...
First, let me show you the code:
Now here is the error:
rpg_managers.js:1949 TypeError: text.match is not a function
at Window_ChoiceList.Window_Base.setWordWrap (YEP_MessageCore.js:715)
at Window_ChoiceList.Window_Base.convertEscapeCharacters (YEP_MessageCore.js:707)
at Window_ChoiceList.Window_Base.drawTextEx (rpg_windows.js:266)
at Window_ChoiceList.textWidthEx (rpg_windows.js:3908)
at Window_ChoiceList.maxChoiceWidth (rpg_windows.js:3899)
at Window_ChoiceList.windowWidth (rpg_windows.js:3875)
at Window_ChoiceList.updatePlacement (rpg_windows.js:3849)
at Window_ChoiceList.updatePlacement (YEP_MessageCore.js:987)
at Window_ChoiceList.start (rpg_windows.js:3834)
at Window_Message.startInput (rpg_windows.js:4441)
SceneManager.catchException @ rpg_managers.js:1949
SceneManager.update @ rpg_managers.js:1910
What is the problem and how do I solve it? Thank you for reading and sorry for bothering.
First, let me show you the code:
JavaScript:
var nombre = [];
for (let i = 0; i < $gameParty.members().length; i++) {
var actualActor = $gameParty.members().actorId();
if ($gameActors.actor(actualActor).isDead()) {
nombre.push($gameActors.actor(actualActor).name);
}
}
nombre.push("Nobody");
$gameMessage.setChoices(nombre, 0, nombre.length - 1);
var opcion;
$gameMessage.setChoiceCallback(function(opcion) {
console.log((typeof opcion)+" "+opcion);
switch (opcion) {
case $gameActors.actor(1).name:
$gameMessage.add("Your hunting services are still required!");
break;
case $gameActors.actor(2).name:
$gameMessage.add("Rise, my fellow " + gameActors.actor(2).currentClass().name + "!");
break;
case $gameActors.actor(3).name:
$gameMessage.add("Scholarly aberration, your job is not done yet!");
break;
case $gameActors.actor(4).name:
$gameMessage.add("Ugh! This pestilence! You are not one of us!");
break;
default:
$gameMessage.add("Then, please, leave so others can be attended.");
break;
}
});
Now here is the error:
rpg_managers.js:1949 TypeError: text.match is not a function
at Window_ChoiceList.Window_Base.setWordWrap (YEP_MessageCore.js:715)
at Window_ChoiceList.Window_Base.convertEscapeCharacters (YEP_MessageCore.js:707)
at Window_ChoiceList.Window_Base.drawTextEx (rpg_windows.js:266)
at Window_ChoiceList.textWidthEx (rpg_windows.js:3908)
at Window_ChoiceList.maxChoiceWidth (rpg_windows.js:3899)
at Window_ChoiceList.windowWidth (rpg_windows.js:3875)
at Window_ChoiceList.updatePlacement (rpg_windows.js:3849)
at Window_ChoiceList.updatePlacement (YEP_MessageCore.js:987)
at Window_ChoiceList.start (rpg_windows.js:3834)
at Window_Message.startInput (rpg_windows.js:4441)
SceneManager.catchException @ rpg_managers.js:1949
SceneManager.update @ rpg_managers.js:1910
What is the problem and how do I solve it? Thank you for reading and sorry for bothering.