A way for events to recognize they are close to each other?

TenebrisCrow

The Kelphy Corp
Veteran
Joined
Oct 19, 2015
Messages
98
Reaction score
6
First Language
English
Primarily Uses
RMMZ
I want a monster system where you can see them walking around as events. However if two monsters are pretty close to each other, when one initiates the battle(in-built battle system), the other one will be in the battle at the same time.

I can't think of any easy way to do this besides the whole finding coordinates for each event and doing a ridiculous amount of work for every single event.

If anyone can think of an easy way to do this, this would help my game so much!
Thank you!
 
Joined
Dec 7, 2016
Messages
11
Reaction score
0
First Language
English
Primarily Uses
All I can suggest is a mixture of a plugin and a variable checking common event set to parralel.
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
863
Reaction score
467
First Language
German
Primarily Uses
RMMV
This can calculate the distance betwen map events:
JavaScript:
$gameMap.distance($gamePlayer.x, $gamePlayer.y, $gameMap.event(1).x, $gameMap.event(1).y)
// calculates the distance betwen "Events" , or Event/Gampeplayer
// this example shows both Event(1) & Gampeplayer
// "$gamePlayer" can be replaced by "$gameMap.event(x)"

And you could use another Code to check/include all events on map:
JavaScript:
// this checks all GameMap Events
for (var i = 1; i <= $gameMap.events().length; i++) {
     var eventunit = $gameMap.event([i]);
     // add code here
};
 

Latest Threads

Latest Profile Posts

I THINK I have a slightly better grasp on drawing my maps now... sorta. I still need to figure out how to draw a city of sorts. I've only got the abstract going so far.
One day, I'll not have this lingering cough and we'll have another make a game stream.
A music I create while practicing E Major scale. :D
Too bad the Boss Battle Build Bout isn't also for VXAce.

Forum statistics

Threads
115,178
Messages
1,087,880
Members
149,745
Latest member
leilahbrekke
Top