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
58
Reaction score
43
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
372
Reaction score
144
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
372
Reaction score
144
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 Posts

Latest Profile Posts

cdjensen94 wrote on Kaliya's profile.
Are you the one who develops Kaliya's Visual Map Enhancements. If so I desperately need some help. I bought the plugin back a few months. I've only started using it recently.
Cause MP Damage instead of HP, Localization Plugin for Translation | RPG Maker News #112

Here in Fla were are seeing crazy covid spikes and some vaccinated getting bad infections. I had a mild fever on Thurs but it went down fast. How is everyone else doing. Hopefully you are all well. :)
Wish I was better at art, specifically that I was faster at it, bc this one NPC took Several Days to complete! It's gonna take So Extremely Long to do all of the art for my game, never mind writing it... Anyways, here's my gorgon, Hopernica Sthyxis!

57b88732c7abbcd84981dacf624a98495af61fcc.gifv
Idk if this is my ADHD or if it's a common problem. But I cant stay motivated for anything. I want to work on so many different things at once. Game dev, skateboarding, ranking up in League, playing OSRS, fitness, nutrition, relationships. It's like, where do I even begin?

Forum statistics

Threads
113,822
Messages
1,077,715
Members
147,880
Latest member
VenUserOne
Top