Hello, I need a bit of help here, In RPG Maker MV I'm trying to create a part where a turret of sorts is shooting projectiles in 4 directions and if the player touches it the event plays (player takes damage). I've set it so that the players x & y location are saved in Variables 21 and 22 respectively. And a single parallel process with a script is checking if the player comes in contact with any of the projectiles.
Now I can get it to work with a single projectile like so:
$gameMap.event(3)._x == $gameVariables.value(21) && $gameMap.event(3)._y == $gameVariables.value(22)
But I get confused when I try to add more events in that, I checked javascript tutorials and it says that the code for OR command is "||" so I figured in this case for two projectiles I would set it up like this:
$gameMap.event(3)._x || $gameMap.event(4)._x == $gameVariables.value(21) && $gameMap.event(3)._y || $gameMap.event(4)._y == $gameVariables.value(22)
IIt doesn't seem to work though, the player keeps starts taking damage as soon the game starts whether or not he's touching the event or not.
My knowledge at scripting is near non existant, so I really can't figure out what I'm doing wrong.
E: I realized what I was doing wrong.
Now I can get it to work with a single projectile like so:
$gameMap.event(3)._x == $gameVariables.value(21) && $gameMap.event(3)._y == $gameVariables.value(22)
But I get confused when I try to add more events in that, I checked javascript tutorials and it says that the code for OR command is "||" so I figured in this case for two projectiles I would set it up like this:
$gameMap.event(3)._x || $gameMap.event(4)._x == $gameVariables.value(21) && $gameMap.event(3)._y || $gameMap.event(4)._y == $gameVariables.value(22)
IIt doesn't seem to work though, the player keeps starts taking damage as soon the game starts whether or not he's touching the event or not.
My knowledge at scripting is near non existant, so I really can't figure out what I'm doing wrong.
E: I realized what I was doing wrong.