DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
Player VS Event position plugin

This plugin compares the position of the player and an event. Although it's very simple, it's also extremely useful!
Imagine you want to check if the player is on the left of an event. How would you do that in RMMV? Unless you use
an extremely complicated process, this might make the development of your game stop completely, or maybe you'll
have to abandon on an awesome idea! Well, this plugin is here to help you with that!

Script calls (to use with a conditional branch):
  • this.eventVsEventDistance(distance, event1, event2) === true/false; checks if an event is within range of another event (range is determined by the 'distance' parameter).
  • this.playerVsThisEventDistance(distance) === true/false; checks if the player is within range of the event (range is determined by the 'distance' parameter).
  • this.playerVsThisEventPosition() === 'string';
  • this.playerVsEventPosition(eventId) === 'string';
Possible strings:
  1. 'up'
  2. 'down'
  3. 'left'
  4. 'right'
  5. 'center'
  6. 'up-left'
  7. 'up-right'
  8. 'down-left'
  9. 'down-right'
example:
this.playerVsThisEventPosition() === 'left'; ---> checks if the player is on the left of this player.
this.playerVsThisEventDistance(7) === true -> checks if the player is withing 7 tiles of the event.


This plugin can be used in association with a lot of different plugins to make tons of original content, so have fun with it!

Terms of use: Can be used for non-commercial as well as commercial games. Be sure to mention me, though! :D
(Having a copy of your game would also be nice ;) )

Thanks to Eis | Kino, GaryCXJk and Pivoo for helping me make this first plugin of mine! :p

24/10/17: v. 1.03 : the distance checker now checks in a circle (it was a square in v. 1.02)
24/10/17: v. 1.04 : fixed the bug of the plugin description not appearing in the plugin editor.

Download: github
 
Last edited:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,634
Reaction score
1,450
First Language
French
Primarily Uses
RMMV
hi you arrow key direction are not correct !
in rmmv it use numPad key direction
 

Warped_Tales

Veteran
Veteran
Joined
Sep 17, 2016
Messages
47
Reaction score
64
First Language
English
Primarily Uses
N/A
Hi, amazing plugin! Is there any possible way to check if the player is occupying the same space as an?
 

DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
Hi, amazing plugin! Is there any possible way to check if the player is occupying the same space as an?
@Warped_Tales Sure, just type 'center' in the conditional branch, it should work normally :D
(also, thx for the remark, gonna update the description :p )
 

DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
hi you arrow key direction are not correct !
in rmmv it use numPad key direction
:kaoback:@Jonforum I don't really understand what you mean, do you want me to return 2, 4, 6 and 8 instead of 'down', 'left', 'right' and 'up' ?
 

dahlys

Meatbun
Veteran
Joined
Aug 28, 2017
Messages
95
Reaction score
99
First Language
English
Primarily Uses
RMMV
Interesting! I can already imagine combining this with a player-event distance checker to pull off some smooth stealth mechanics.
 

DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
@dahlys Actually, you can do the distance checker by checking the distance between the y and x positions of the player and event without using any plugins!
 

dahlys

Meatbun
Veteran
Joined
Aug 28, 2017
Messages
95
Reaction score
99
First Language
English
Primarily Uses
RMMV
@DaedraTalos Yeah but it's easier with a plugin when I want to include a formula for distance (circle) and check line of sight (135 deg). And do this over and over again.
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,634
Reaction score
1,450
First Language
French
Primarily Uses
RMMV
:kaoback:@Jonforum I don't really understand what you mean, do you want me to return 2, 4, 6 and 8 instead of 'down', 'left', 'right' and 'up' ?
no sorry!. I had just misunderstood lol!
but yes you can also add number, these more powerful and fast than to compare 'string', but more hard for people who do not know the directions.
 

DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
Plugin updated, new function this.playerVsThisEventDistance(distance) :D
 

DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
Plugin fixed + updated! Please give me feedback! :D Also, if you have any ideas for a plugin, or for more futures for this plugin, please tell me! :p
 

DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
@dahlys I added a function to check the distance in a circle :p Although it may not be enough for what you wanted ^-^
 

DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
Plugin updated! New: bug fixes:
  • a distance of 0 will indicate the event's location (it was 1 before)
  • indicating 0 as an event will select the player instead
 

DaedraTalos

Evil Plugin Overlord in the making
Veteran
Joined
Jul 8, 2016
Messages
72
Reaction score
59
First Language
English
Primarily Uses
RMMV
Update: added simplicity of access to variables data:
-when inputing the distance, you can put in any code just as before, but if you want to easily access variables, just add strings around the distance value, and use v[x] just like for usual rpg maker mv stuff.

Examples:
- this.eventVsEventDistance(5, 15, 20)
- this.eventVsEventDistance($gameVariables.value(15) - 2, 15, 20)
but now you can also use instead:
- this.eventVsEventDistance("v[15] - 2", 15, 20)
 

Latest Threads

Latest Posts

Latest Profile Posts

Holy cow... work is demanding and I'm back in college. I'm kind of scared of my dad right now after the incident, but at least I don't live with him all the time. Anyway, working on Fandom Scouts and my FNAF character set. The FNAF sprites are actually going to be used in the game... unfortunately the enemy sprites are FNAF World traces, so no sharing those.
The honeymoon period is over with Cyberpunk 2077, It sadly doesnt live up to the hype, pretty graphics arent everything (especially when I cant even do something as simple as changing the radio station over!). Replaying Breath of the wild has reminded me what a good game really looks like, plus that one has good glitches!....
Ami


Maybe...a Drinkable Water Plant or something?
Who would have thought making interesting birds would be so difficult/fun?

Randomly spawning anywhere on map (sometimes even flying), having a chance of landing on a different spot on map when flying. Also chance of flying off screen if spooked/sees the player

I think I got it!

Forum statistics

Threads
107,681
Messages
1,031,397
Members
139,801
Latest member
IsaacRPG
Top