Hey, everyone!
I was wondering if it's possible to set a conditional based on temporary variables added in a script. Cuz I tried something like this:
I keep getting an 'unexpected number' error. I assume it's the (rx) (ry) that can't be in there, I tried many different options, but I'm not familiar with js enough to fix this one.
This is being set as a 'var x' this cuz the event is spawnable and I need it to set an independant variable for each instance of the event.
I was wondering if it's possible to set a conditional based on temporary variables added in a script. Cuz I tried something like this:
Code:
var ev = $gameMap._interpreter._eventId
var rx = $gameVariables.value(27) - $gameMap.event(this._eventId).x;
var ry = $gameVariables.value(28) - $gameMap.event(this._eventId).y;
if ([-1, 0, 1].contains(rx) && [-1, 0, 1].contains(ry)) {
$gameSelfSwitches.setValue([$gameMap.(this._mapId), ev, 'A'], true)
};
I keep getting an 'unexpected number' error. I assume it's the (rx) (ry) that can't be in there, I tried many different options, but I'm not familiar with js enough to fix this one.
This is being set as a 'var x' this cuz the event is spawnable and I need it to set an independant variable for each instance of the event.