Bomb Positions is Not Defined

Hey there, I was in the middle of developing a Minesweeper minigame, and all of a sudden, I got this:
Code:
SyntaxError
Missing ) after argument list
I press f8 for more information, and I get this:
Code:
SyntaxError: missing ) after argument list
    at Game_Interpreter.command122 (rpg_objects.js:9444)
    at Game_Interpreter.executeCommand (rpg_objects.js:8930)
    at Game_Interpreter.update (rpg_objects.js:8838)
    at Game_Event.updateParallel (rpg_objects.js:8748)
    at Game_Event.update (rpg_objects.js:8740)
    at rpg_objects.js:6066
    at Array.forEach (<anonymous>)
    at Game_Map.updateEvents (rpg_objects.js:6065)
    at Game_Map.update (rpg_objects.js:6025)
    at Scene_Map.updateMain (rpg_scenes.js:608)
Anyone know what's causing this? Thanks in advance for your help!
Actually, that problem is fixed, but now I have another one. Now it's spitting out a "BombPositions is not defined" error when I try and activate the event.
command122 is Control Variables, for your first error, but looks like you already found that.
Please give a screenshot of the console, as well as any commands you have that use BombPositions. I'm assuming you're doing this through events with script calls, and aren't making a plugin.

Next time, make your thread subject more specific. Everyone who posts here has a problem.

Alador, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.

Double-post notice: Alador
Sorry, @slimmmeiske2, I wasn't thinking that clearly last night...
command122 is Control Variables, for your first error, but looks like you already found that.
Please give a screenshot of the console, as well as any commands you have that use BombPositions. I'm assuming you're doing this through events with script calls, and aren't making a plugin.

Next time, make your thread subject more specific. Everyone who posts here has a problem.
@Shaz, sorry for the title, and I'll provide screenshots as soon as I can get on the computer that has RPG Maker.
costume8.png
Here's a screenshot of the error codes I get when trying to use my event.
costume8.png

Here's event page 1
costume8.png

And here's event page 2. Hope you'll be able to help!
Le Bump!
Bump number 2!
Bump number three!
This should explain what is causing your problem.
The 'BombPositions' variable is interpreted internally through an eval function, in Game_Interpreter, because of its nature, it ceases to exist as soon as the function block ends.
This should explain what is causing your problem.
The 'BombPositions' variable is interpreted internally through an eval function, in Game_Interpreter, because of its nature, it ceases to exist as soon as the function block ends.
Hmm, interesting. What is the solution, then?
JavaScript:
$gameVariables.setValue(varID, ['1 1']);
$gameVariables.value(varID).includes('1 1');

I really don't like it, but if you really want to do things by events and not scripts/plugins, I think it's the easiest way to do that.
JavaScript:
$gameVariables.setValue(varID, ['1 1']);
$gameVariables.value(varID).includes('1 1');

I really don't like it, but if you really want to do things by events and not scripts/plugins, I think it's the easiest way to do that.
Yes, but BombPositions has to be an array, and you can't compare game variables values with game variables arrays.
Dude, but it's an Array within a Game Variable, and you can usually compare it with any other array. I also don't know why you would compare numbers (I think you meant that when you said 'game variables values') to Arrays.
😅
Dude, but it's an Array within a Game Variable, and you can usually compare it with any other array. I also don't know why you would compare numbers (I think you meant that when you said 'game variables values') with Arrays.
😅
So, basically, what I'm trying to do is compare one event's x and y position with another event's x and y position. If there is a better way to do this, I'd like to know, but I need a way to check if the array includes the x and y position of the event. I tried using the "
$gameVariables.value(varID).includes('1 1');" method, but that didn't work, so if there is a better way to go about doing this, please tell me because I am a noob at scripting!
JavaScript:
if (event1.pos(event2.x, event2.y)) {
    //event1 and event2 are in the same position.
}
JavaScript:
if (event1.pos(event2.x, event2.y) {
    //event1 and event2 are in the same position.
}
That's kind of close to what I need, would something like this work?
JavaScript:
let BombPositions = [];
BombPositions.push(event1.pos);
let result = BombPositions.includes(event2.x, event2.y);
No, this code does not make sense. haha '
If you explain to me exactly what you are wanting to do, I can help.
No, this code does not make sense. haha '
If you explain to me exactly what you are wanting to do, I can help.
Sorry for my nonsensical code! What I want is for multiple event positions to be stored in an array, then an event will compare it's x and y to the event's x and y to see if any of the events that have coordinates in the array are around the checking event. Does that make sense? I hope that makes sense!
5i4EEgK.png

Original thread: https://forums.rpgmakerweb.com/threads/bomb-positions-is-not-defined.126649/