So I'm using a parallel event in which I'm running various bits of script to essentially make a system where my events can detect the distance between them and the player to determine what actions they do. The script I'm running is:
this._playerX = $gamePlayer.x;
this._playerY = $gamePlayer.y;
this._eventX = $gameMap.event(1001).x;
this._eventY = $gameMap.event(1001).y;
from there a conditional branch is ran with a script condition of:
$gameMap.distance(this._playerX,this._playerY,this._eventX,this._eventY) <= 1
to determine what happens with the event in question. My question is because my script understanding is still quite shallow how could I replace the this._eventX & Y instead with a variable so that this process could be run for multiple events at a time.
this._playerX = $gamePlayer.x;
this._playerY = $gamePlayer.y;
this._eventX = $gameMap.event(1001).x;
this._eventY = $gameMap.event(1001).y;
from there a conditional branch is ran with a script condition of:
$gameMap.distance(this._playerX,this._playerY,this._eventX,this._eventY) <= 1
to determine what happens with the event in question. My question is because my script understanding is still quite shallow how could I replace the this._eventX & Y instead with a variable so that this process could be run for multiple events at a time.