- Nov 1, 2019
- Reaction score
- First Language
- Primarily Uses
Okay I noticed one problem. When the enemy unit comes in contact with 1 of my idle parties a battle engages, but the party that is engaged in battle is the party under my control and not the idle party.Ah as I suspected $gameMap.idlePartyEvent(#) doesn't give the event ID but the entire object.
View attachment 146529
$gameMap.idlePartyEvent(#)._eventId is how you get the event ID for the other parties.
So for party 2 it would be....
Math.round($gameMap.distance($gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y, $gameMap.event($gameMap.idlePartyEvent(2)._eventId).x, $gameMap.event($gameMap.idlePartyEvent(2)._eventId).y) <= 1)
View attachment 146530
Finally, because the player object is a potential thing the enemy can encounter, you'll need a conditional statement just for that....
Math.round($gameMap.distance($gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y, $gamePlayer.x, $gamePlayer.y) <= 1)