Eventing -- need big brain help with tricky problem -- player touch and action button on same tile?

cuby

Veteran
Veteran
Joined
Jun 20, 2015
Messages
48
Reaction score
10
First Language
English
Primarily Uses
So I've basically pulled out all my hair and searched forum posts and banged my head against the desk enough times to induce multiple concussions, and I simply cannot figure out this eventing problem! I'm hoping some bigger brains out there can help.

What I need to do: an event where on player_touch, a picture shows. When pressing action button on that same tile, text shows. When you step off the tile, the picture goes away.

Here's what I've tried (among many other unsuccessful tangled webs of switches and variables):

A player_touch event page that shows the picture, then sets a self switch that activates page 2, which has the action button triggered text. So far so good, right?

In order to erase the picture when the player steps off of the tile, I had all adjacent tiles have a player_touch page that erases the picture. This works, however, as you might have guessed, when you return to the first tile, its self-switch is now on the action button page, and will not reshow the picture on player_touch.

I have tried every combination of switches and variables, having a separate parallel event that checks coordinates that are saved to variables, but from what I can tell, it is not possible to do this -- basically, I need to run two simultaneous events on the same tile: one that is player_touch that either shows the picture or else stores tile coordinates for another parallel event to process ... at the same time as the action button event that shows text when player clicks.

Surely there's a solution to this, right?

I got all excited when I saw that conditional branches allow "button press". So, I tried an event with the player_touch show picture event page, with a conditional branch that checked for the OK button. However as you might already know, that only works if the button is HELD DOWN prior to moving to the tile. If it checked for a button press AFTER you were on the tile, the problem would be solved. But I haven't found the wording to check to see if this functionality exists in a script.

I'm desperate for help since the mechanic is key to my game, and I'm quite literally at the limit of my brainpower. I haven't found any scripts that might help by checking automatically for coordinates, or any other functionality that might assist.

Until I figure this one out I'm at a standstill -- I'm hopeful an RPGM veteran can help me work out this eventing challenge.

Thank you!!!

EDIT: Another almost-promising solution I've tried: on player touch, show picture, and set a switch to on, and have a common event running parallel that has a conditional branch checking for OK button on, and if it's on, show the text. This actually WORKS initially, but I cannot find a way to stop the common event from repeating the text over and over. Neither "exit event processing", or jumping to a label outside the conditional branch stops the text from repeating over and over, since most players will hit OK (default space or enter) in order to CLEAR text away. Hitting enter or space to clear the text simply re-triggers the text! This method DOES work if I instruct the player to hit "Esc" in order to clear the text instead of enter or space, but that's obviously not really an acceptable solution. Maddening!

EDIT 2: I finally figured out a messy solution, and am posting it here in the event that someone else has a similar issue:

On the adjacent tiles, where I erase the picture, I also run a script to reset all self-switches on the map. This works, though if anyone has any better solution I'd love to hear it, as I'm certain this solution probably won't work in all cases! Thanks :LZScat::LZScat::LZScat:
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,234
Reaction score
6,780
First Language
German
Primarily Uses
RMMV
it would have helped if you showed us screenshots of the events you tried instead of describing them.

Fact is that only one event page can be active at any given time, and that means only one trigger per event is possible.
You'll need to split the two triggers between different events.

That could either be done by having the two events different priority (making one react to adjacent tiles instead of the same), or by having a parallel process event.

That parallel process should have worked if you had done it correctly - which is why a screenshot to look for the error you made would have been better than your incomplete description.
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
470
Reaction score
316
First Language
Polish
Primarily Uses
RMMV
If it has to be one or only a few events, you can use switch instead of selfswitch, then after leave the switch also turns off, so if you step again the picture will show again. If you have this as a basic mechanic of the game, you can save X,Y cords of player position into variables, and then check on that "selfswitch A" page if the cords are the same as before - if no, then the player moved, so erase pic and turn self switch A off. It should work. If you need help, PM me.
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
300
Reaction score
1,150
First Language
Bahasa
Primarily Uses
RMMV
I might not fully grasp what you are trying to do. I also don't understand the need of switch or even saving player X Y coordinate. Based on what you're saying :
- Event which show picture when player touch.
- While on it, text will be shown when you press the action button.
- Picture will be erased when player move on.
- Seems you are planning to lump this events next to each other, like making a gallery or something.

Here's my solution :
1579953299847.png

It just a single page of player touch event. Tried it and it works well. You don't need parallel process. You don't need switch or variable. You can pluck your hairs back. Unless I missed something.
 
Last edited:
  • Like
Reactions: Bex

cuby

Veteran
Veteran
Joined
Jun 20, 2015
Messages
48
Reaction score
10
First Language
English
Primarily Uses
It just a single page of player touch event. Tried it and it works well. You don't need parallel process. You don't need switch or variable. You can pluck your hairs back. Unless I missed something.
Thanks to all for the feedback, I'll post screencaps the next time I have an issue like this.

@Kuro DCupu I think I understand your solution -- I didn't understand what Loops could do, but now I think I get their usefulness.

Only thing though -- could you possibly explain the Waits in the event?

Thanks again to all! :LZScat: :LZScat: :LZScat:
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
300
Reaction score
1,150
First Language
Bahasa
Primarily Uses
RMMV
Events inside the loop repeated in real time process. Basically you're asking the game to execute those command without any break.

Wait 1 frame work as a breather and updating the process steadily per 1 frame. It's necessary to prevent the loop causing the game to freeze.

Wait 30 frame after show text is just a delay so that it won't keep showing up when you presses the button.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Blech. I hate coming up with stories. Making gameplay is fun but coming up with lore and reasons for these areas/mechanics just makes me sleepy.
40 card deck size, the plugin seems more sluggish.
Village theme I composed for a commission!
Stream will be live shortly with some Haunting Ground! Feel free to drop by!

Forum statistics

Threads
94,567
Messages
921,939
Members
124,430
Latest member
Venator123
Top