checking if event facing player

wickednick

Veteran
Veteran
Joined
Feb 19, 2016
Messages
66
Reaction score
3
First Language
Nick
Primarily Uses
Hello, is there a script call to check if an event is facing the player? Im using some proximity event sensor scripts, but I have an issue because I only want the event to trigger if its facing the player. I know you can check to see if an event is facing up,down,left,right, but I need it to know if its actually facing the player.
 

King Gerar

White Wolf
Veteran
Joined
May 15, 2012
Messages
165
Reaction score
212
First Language
Portuguese
Primarily Uses
RMMV
See if this works for you. Read plugin help before.
 

dbchest

Beast Master
Veteran
Joined
Oct 1, 2013
Messages
434
Reaction score
306
First Language
English
Primarily Uses
RMMV
How to access the event's current direction via script call
Code:
$gameMap.event(this._eventId).direction()
How to access the opposite direction of the player's current direction
Code:
$gamePlayer.reverseDir($gamePlayer.direction())
Solution
Within a conditional branch, test these two for equality
Code:
$gameMap.event(this._eventId).direction() === $gamePlayer.reverseDir($gamePlayer.direction());
If the comparison returns true, it is implied that the two are facing one another.
 

wickednick

Veteran
Veteran
Joined
Feb 19, 2016
Messages
66
Reaction score
3
First Language
Nick
Primarily Uses
So .direction means the way its currently facing and .reverseDir is checking what exactly, the position of the events backside? What would be the call for checking the side, .sideDir?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top