Hi!~ I'm new to the forum as I've just gotten a copy of RPGM MV. I skimmed the rules a bit so please tell me if this violates the rules, but I've got some JS trouble.
I have a variable storing a list of possible skills you can learn in the game, and if I use, for instance:
To search for the index of Fire in that list, then it returns 1 like normal.
However, directly above it you can see that it's telling me that .indexOf is not a function when executed as a script by one of my game events. This equivalent happens whether I use .contains, .includes, or .indexOf
The script below is the one in question, which sets up [0057] to be an array containing moves that the player knows from the database [0055].
Any idea what this could be? :oswt2:
I have a variable storing a list of possible skills you can learn in the game, and if I use, for instance:
Code:
$gameVariables.value(55).indexOf("Fire")
To search for the index of Fire in that list, then it returns 1 like normal.
However, directly above it you can see that it's telling me that .indexOf is not a function when executed as a script by one of my game events. This equivalent happens whether I use .contains, .includes, or .indexOf
The script below is the one in question, which sets up [0057] to be an array containing moves that the player knows from the database [0055].
Code:
var skillArray = new Array();
$gameVariables.setValue(57,skillArray);
$dataSkills.forEach (
function (skill) {
if (skill) {
if ($gameVariables.value(55).indexOf($dataSkills[skill.id].name))
skillArray.push($dataSkills[skill.id].name);
$gameVariables.setValue(57, skillArray);
}})
Any idea what this could be? :oswt2: