- Joined
- Dec 21, 2016
- Messages
- 41
- Reaction score
- 8
- First Language
- English
- Primarily Uses
I seem to be having a little unexpected trouble here. I'm trying to create a system that requires new arrays and, ideally, functions. The problem is that no matter how I code the declaration of these things, the game returns "ReferenceError: x is not defined". Here's my current code for example:
The idea was to test if the "members" index function worked on normal arrays, in hopes of bypassing the need to code a function to index a specific array. At that time I thought only my functions weren't getting defined, but unfortunately, it appears to apply to variables as well. I've also tried it as...
Every time I'm met with the same result. My guess its that I'm unaware of a very specific way RMMV reads the code that runs a little different to what I picked up in basic Javascript tutorials.
If anyone knows what I'm doing wrong, I'd appreciate a bump in the right direction!
var testArray = newArray('apples', 'oranges', 'pears', 'strawberries');
$gameMessage.setBackground(0)
$gameMessage.setPositionType(3)
$gameMessage.add("Your index selection is " + testArray.members() [2] + ".")
$gameMessage.setBackground(0)
$gameMessage.setPositionType(3)
$gameMessage.add("Your index selection is " + testArray.members() [2] + ".")
The idea was to test if the "members" index function worked on normal arrays, in hopes of bypassing the need to code a function to index a specific array. At that time I thought only my functions weren't getting defined, but unfortunately, it appears to apply to variables as well. I've also tried it as...
var testArray = ['apples', 'oranges', 'pears', 'strawberries'];
var testArray = new Array('apples', 'oranges', 'pears', 'strawberries');
var testArray = new Array('apples', 'oranges', 'pears', 'strawberries');
Every time I'm met with the same result. My guess its that I'm unaware of a very specific way RMMV reads the code that runs a little different to what I picked up in basic Javascript tutorials.
If anyone knows what I'm doing wrong, I'd appreciate a bump in the right direction!

