Events Player Touch Switch

Hello,


I have a problem with my actual game. My Charakter must watch out not to be seen by Guards. The Guards change their direction.


I have three kinds of events: The guards, with 2 Pages one looking up, one looking done. Some Events in front of the guards, wich are player touch on one page, and empty on the other. The third event is a parallel process wich changes one switch every 100 frames. When the switch is activated the guard looks up, and the events in front of the guard are on the player touch page. The only problem is, when the player walks behind the guard, doesn't move and the guard turns around, nothing happens, because the player doesn't touch the event, because he is already on it. 


How could i fix this? 


If my english is a little bit bad, I'm sorry for this, but english is not my native language.
you can try to use event touch instead of player touch - for player touch, the player has to move - event touch (ing player) works when the event moves on the player as well as the player moving on the event.


In case you confused the name: there is no trigger for event touching event, all triggers require player interaction or automatic processes.
You could perhaps have a Parallel Process Common Event checking the coordinates X-Y to see if the Hero is on a square, then check the other conditions of being 'visible'..? Just a thought...
you can try to use event touch instead of player touch - for player touch, the player has to move - event touch (ing player) works when the event moves on the player as well as the player moving on the event.


In case you confused the name: there is no trigger for event touching event, all triggers require player interaction or automatic processes.

No this doesn't work, same problem.

You could perhaps have a Parallel Process Common Event checking the coordinates X-Y to see if the Hero is on a square, then check the other conditions of being 'visible'..? Just a thought...

Yes i think i could do this, but it is to much work, because those are round about 100 squares that are seen. But i think I have to do this if no one knows a better solution.
I would use regions and not events.


On the tiles where the player would be "caught" if the guard turned that way, draw with a region id.  Then in the parallel process that makes the guards turn, use Get Location Info (tab 3) to put the player's region id into a variable.  Then use that variable in a conditional branch.  If the variable is equal to the region id you used, it means the player is standing on one of those tiles when the guard turns around.


You could also put that into a parallel process if you want to check for the player walking onto the tile AFTER the guard has turned to face that direction.
Instead of checking for the player's coordinates directly you could also use Regions - paint the area where your touch events are now with a Region (the R tab below the tileset) and check in the Parallel Process if the player is on that Region.
lol 😀
I would use regions and not events.


On the tiles where the player would be "caught" if the guard turned that way, draw with a region id.  Then in the parallel process that makes the guards turn, use Get Location Info (tab 3) to put the player's region id into a variable.  Then use that variable in a conditional branch.  If the variable is equal to the region id you used, it means the player is standing on one of those tiles when the guard turns around.


You could also put that into a parallel process if you want to check for the player walking onto the tile AFTER the guard has turned to face that direction.

Thanks, that worked!
Just add a Wait 5 Frames or something like that to the parallel process event, right at the top, to prevent lagging issues.  It only needs to check a couple of times per second, not 60.

Original thread: https://forums.rpgmakerweb.com/threads/events-player-touch-switch.69914/