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
68
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 Posts

Latest Profile Posts

Making his first game
This scene was suppose to be a test... but now, it's going in the game as official side/optional content. :kaosalute:


functionality(This is function demo not game demo)
1 The door of ABS map can open upon clearing all the monsters
2 Secret room/road arrow/lighting/whatever others can be shown upon clearing too
3 Boss HP bar and loot effect, loot jump and item name color as well as the pick-up animation effect
4 Back to town and "victory aftermath" screen for ABS maps/rooms
Playing one of the two RM2k3 games I was best known for back in the day, one I made in the Spring semester of my Freshmen year in college like 15 years ago, feeling all kinds of ways about it. I have not played this game in WELL over 10 years. I feel a million years old RN.
One of these days, I need to find/figure out how to replicate the Brave/Default system. Heheh...

Forum statistics

Threads
115,327
Messages
1,089,002
Members
149,984
Latest member
bagil
Top