I'm working with the plugin right now. How would I go about checking if a given actor is adjacent to any other actor? I am willing to use scripts, and in fact that would be ideal as I plan to loop through this for each actor.
Create your own SRPG · By
All map battlers are Game_Character objects. This means that you can pull their tile X and Y coordinates directly.
For finding out if an actor is next to another actor, the $gameMap.distance(cx1, cy1, cx2, cy2) value must be <= 1.
You must also check through all actors on the map.
Script (assuming the current battler is an actor);
----------
const map_battler = $gameMap.selectedBattler();
const actors = $gameMap._actors.filter((actor_map)=>{
return actor_map != map_battler;
})
if(!map_battler._battler.isActor())return
const cx1 = map_battler.x;
const cy1 = map_battler.y;
return (
actors.some((actor_map)=>{
const cx2 = actor_map.x;
const cy2 = actor_map.y;
const distance = $gameMap.distance(cx1, cy1, cx2, cy2);
return distance <= 1;
)
----------
Haven't tested this but this should tell you if any actor is near the current map selected actor