How to check if player is Currently Standing On Event

Hyperly

i like rocks
Veteran
Joined
Jun 25, 2016
Messages
72
Reaction score
11
First Language
English
Primarily Uses
RMXP
Is there a way to check if the player is currently standing on an event, and if they aren't currently standing on it then revert to the original state?
Or is there a way to check if the player leaves an event/stops touching it? I'm trying to make a path that stops lighting up where the player is standing and can't seem to figure it out.
 

Cootadude

Noob with exp
Veteran
Joined
May 3, 2019
Messages
67
Reaction score
65
First Language
English
Primarily Uses
RMMV
Here is a simple way to do it with events only.
Just be aware that a large amount of parallel Process events can lag the game.
Untitled.jpg
Now I know a plugin for MV that does what you need but I couldn't find it, but here's something similar to the plugin.
 

Jennavieve

Veteran
Veteran
Joined
Oct 21, 2020
Messages
90
Reaction score
87
First Language
English
Primarily Uses
RMMZ
I've used a similar method to the one above for something else on a map I made and it worked out pretty well. It's a little simpler too. All you have to do is put your desired region ID at the tile where the event is.

Example.png

(ignore the self switch conditional, that was leftover from the page I copied it from)
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
374
Reaction score
146
First Language
English
Primarily Uses
RMXP
To condense Cootadude's solution more, you can make page one of your event trigger by Player Touch and have page two be set to Parallel Process with Self Switch A ON as the condition.

Page one simply turns Self Switch A ON and turns on your light effect.
Page two has a Conditional Branch, set to check the script call:
Code:
!(get_character(0).x == $game_player.x && get_character(0).y == $game_player.y)
If this condition is satisfied, then Self Switch A turns OFF and the light effect is removed.
 

Hyperly

i like rocks
Veteran
Joined
Jun 25, 2016
Messages
72
Reaction score
11
First Language
English
Primarily Uses
RMXP
To condense Cootadude's solution more, you can make page one of your event trigger by Player Touch and have page two be set to Parallel Process with Self Switch A ON as the condition.

Page one simply turns Self Switch A ON and turns on your light effect.
Page two has a Conditional Branch, set to check the script call:
Code:
!(get_character(0).x == $game_player.x && get_character(0).y == $game_player.y)
If this condition is satisfied, then Self Switch A turns OFF and the light effect is removed.
Your solution worked, and the other ones do too but I like that yours is compressed. Is it alright if I ask for an understanding of how each of those variables work in that script? Like what exactly is it comparing it to? Also the only problem I have now is that I can't use my random wait timer. I asked in another thread how to call a wait timer in a script and have a variable inside it like this wait(variableTime), but there's only tutorials for how to do it in VXAce and MV. I found where the commands should be called in Interpreter 2 but I'm confused as to how to call them in XP.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
374
Reaction score
146
First Language
English
Primarily Uses
RMXP
get_character is a method in the Interpreter class. If you study its structure (I think its under Interpreter 2) passing a 0 to it gets the event that is currently running.

$game_player is a global variable (hence the $ in front) that holds the player character object.

Map events and the player both fall under the Game_Character class. This class holds the map coordinates of the characters, represented by x and y. The script call I shared simply checks that the event and player share the same coordinates. If not (hence the ! at the start) then the conditional branch is executed.

I've also replied to your other thread. You can carry that conversation over there.
 

Latest Threads

Latest Profile Posts

BCj
Finished another GUI! Turn indicator wasn't made by me.

ff981f8dc50b03cf58038c644334b454.jpg


3cb092fdc00087acfa0a190fd891f0ed.jpg
Added a small refining scene to my game.

It makes sense that you try to focus on the squishy mages at the back of the party first, right? If the mage can out-DPS the enemy DPS before the latter can kill the tank in front, the fight becomes boring.
finally got footage of my main character running around the main hub world. I've fixed a few things tho even since this video unsurprisingly lol.

Forum statistics

Threads
115,234
Messages
1,088,281
Members
149,830
Latest member
ristopaasivirta
Top