- Joined
- Aug 6, 2016
- Messages
- 11
- Reaction score
- 0
- Primarily Uses
I'm making a functon to highlight nearby events around the player, but for some reason $gameMap.eventIdXy doesn't work when I use it inside my function.
Game_System.prototype.searchNearbyEvents = function (range){
var MinX = $gamePlayer._x -= range;
var MinY = $gamePlayer._y -= range;
var MaxX = $gamePlayer._x += range;
var MaxY = $gamePlayer._y += range;
var BlType = 1;
var EvId;
for (x = MinX; x < MaxX; x++){
for (y = MinY; y < MaxY; y++){
EvId = $gameMap.eventIdXy(x, y); // <<<<< This one here never works.
if (EvId > 0) {
$gameMap.event(EvId).requestBalloon(BlType);
}
}
}
}
Edit: I'm using this inside my custom plugin. It works fine when I use inside script command, though.
Game_System.prototype.searchNearbyEvents = function (range){
var MinX = $gamePlayer._x -= range;
var MinY = $gamePlayer._y -= range;
var MaxX = $gamePlayer._x += range;
var MaxY = $gamePlayer._y += range;
var BlType = 1;
var EvId;
for (x = MinX; x < MaxX; x++){
for (y = MinY; y < MaxY; y++){
EvId = $gameMap.eventIdXy(x, y); // <<<<< This one here never works.
if (EvId > 0) {
$gameMap.event(EvId).requestBalloon(BlType);
}
}
}
}
Edit: I'm using this inside my custom plugin. It works fine when I use inside script command, though.
Last edited by a moderator:



