RPG Maker Forums

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:

var testArray = newArray('apples', 'oranges', 'pears', 'strawberries');


$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');



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!

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top