Fetch and check map distances between events/player/followers

Kronicide

Veteran
Veteran
Joined
Jul 7, 2020
Messages
39
Reaction score
23
First Language
Swedish
Primarily Uses
RMMV
A small plugin that lets you retrieve the map distance between events/player/followers, or check whether they are within a given range of each other. (This functionality may already be provided by some other plugin, I'm not sure.)


DESCRIPTION

Provides two JavaScript functions:

JavaScript:
this.eventDistance(EVENT1, EVENT2)

Returns the distance in map squares between EVENT1 and EVENT2.
Use in the script box to set a variable, for example.

JavaScript:
this.eventInRange(EVENT1, EVENT2, RANGE)

Returns true if EVENT1 is within RANGE of EVENT2.
Use as a test in the script box of an event's conditional branch
condition.

Example:
Skärmklipp 2020-07-09 18.33.58.png

Event IDs can be -1 for player, -2, -3, ... for followers,
or regular event IDs.

TERMS OF USE
Do whatever you like with it.

COMPATIBILITY
Doesn't override anything so should be compatible with everything.
No dependencies.
 

Attachments

  • Krons_EventDistance.js
    2.5 KB · Views: 14
Last edited:

RyanYe

RPG Game Lover
Veteran
Joined
Dec 31, 2020
Messages
105
Reaction score
37
First Language
English
Primarily Uses
RMMV
wow this is so sweet! I am looking for this plugin for DECADES!!
thank you ! thank you !!
 

Latest Threads

Latest Profile Posts

Make a Game in RMMZ Streams are going to remain in hiatus this week. Too much to do! 4 things will be announced on Monday though! Look forward to that.
Typed a long-ish reply to a post... forgot to actually HIT the post button, and moved to a different page.... finally noticed, don't remember what all I had typed and don't feel like trying to re-type it all.... smh....
Their tactics are evolving. They've learned to call for help when cornered. Never trust a mammal!
Good morning all. I still have a post up on video editing for cinematic trailers. Please make sure to check that out and give me a message as its still active in offers.
Hey everyone! I'm back :D

Snow White? More like Snowhere to be seen amiright? Hahaha I'm so sorry!! :kaocry:

Forum statistics

Threads
112,366
Messages
1,067,814
Members
146,016
Latest member
LioTheLion
Top