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:
- 'up'
- 'down'
- 'left'
- 'right'
- 'center'
- 'up-left'
- 'up-right'
- 'down-left'
- '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!
(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!
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
本贴来自国际rpgmaker官方论坛作者:SebyDevDev处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/player-vs-event-position-plugin.85046/