RPG Maker Forums

I'm using arrays to create a random chest generation system. The idea is that the base array looks like this:

Code:
// Create Array
tmpArr = [false, 6, false, 6, false, 6, false, 6, false, 6, false, 6, false, 6];
// chest 1, loc, 2, loc, 3, loc, 4, loc, 5, loc, Ext1, loc, Ext2, loc

// Save Array to Game Variables
$gameVariables.setValue(46, tmpArr);
$gameVariables.setValue(47, tmpArr);
$gameVariables.setValue(48, tmpArr);
$gameVariables.setValue(49, tmpArr);
$gameVariables.setValue(50, tmpArr);
// what in the hell is this wizardry
So, this is called first, and sets whether or not they've been opened, and their location. Each chest has 5 possible spawn points. Then, each zone is assigned a copy of this array, so that each one has its own.. treasure map, so to speak. This is the blank map. After this, we generate the map further:

upload_2018-5-18_21-35-29.png

Here, we set a trash variable to 0, and 5 important variables to a random number 1-5. Then, we check what number the trash variable is at. For 0, we do this:

Code:
array = $gameVariables.value(46);

array[0] = $gameSwitches.value(56);
array[2] = $gameSwitches.value(57);
array[4] = $gameSwitches.value(58);
array[6] = $gameSwitches.value(59);
array[8] = $gameSwitches.value(60);
array[10] = $gameSwitches.value(61);
array[12] = $gameSwitches.value(62);
// this is black magic
// this is called to save to array
array = $gameVariables.value(46);

array[1] = $gameVariables.value(51);
array[3] = $gameVariables.value(52);
array[5] = $gameVariables.value(53);
array[7] = $gameVariables.value(54);
array[9] = $gameVariables.value(55);
array[11] = $gameVariables.value(56);
array[13] = $gameVariables.value(57);

// saves loc, split because limited

// length allowed in this window
So, this assigns the zone attached to variable 46 a set of locations for its chests, and ensures that the switches are off for it. Then, we add 1 to the trash var, and repeat this loop for the other zones. But, there's an issue.

For whatever reason, the above snippet is completely and utterly assigning itself overtime duty and attaching itself to everything in sight.

upload_2018-5-18_21-40-3.png

The first image is a check done right after the first bit, zeroing-out the arrays, making them blank.
The second image is after the code snippet above. I've tried removing any references to other variables in that event, but regardless it just.. does this. I can't for the life of me fathom why it's assigning itself to these variables.

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