Need help with "use item on specific spot" event

Hello everyone. I reached a dead end with one of my event, and I'd like to ask for help. It is not easy to explain, so bear with me. 🙂

My goal is to make a puzzle about using a spade on a specific map coordinate to dig a hole on the ground. If the player stands on the 11,8 coordinate, the character digs a whole, but if the item is used on a wrong spot, nothing happens.

It was very important to not use the "use key item" event, I want the player to open the inventory manually and use the item from there. For this, I made a common event (called Show Talk) with a switch, which is called by the Spade item, if it is used.

This starts the even, as you can see here:

Spoiler
1_www.kepfeltoltes.hu_.jpg
This is page one of the event. It is a paralell process, so it starts running after the used item calls is. First it checks the player coordinates, if the character stands on 11,8. If yes, a self switch switches to even page 2, which is like this:

Spoiler
2_www.kepfeltoltes.hu_.jpg
After the hole is dug, and the text is shown, it switches to page 3 to finish the event:
Spoiler
3_www.kepfeltoltes.hu_.jpg
At this point, everything is OK. But what if the player uses the spade at the wrong position. Nothing should happen of course, so if you check the first event page, you see that with a C self switch, I switched over to page 4, to finish the event:

Spoiler
4_www.kepfeltoltes.hu_.jpg
And here comes the problem. Assume that the player used the spade at the wrong place, ok, nothing happens. But let's say the player figures out where should s/he use the spade after some time, goes there and tries to use it again. But nothing will happen, because at this point, the event already ran its course, flipped to event page 4 and stopped.

I was thinking that maybe on the first page, I should just put a stop event type if the player uses the item on the wrong spot. But if I did that, after that point if player just steps on the right coordinates, the even will start, since it was running all the time in parallel process, and checking the coordinates all the time.

The solution should be something like this: if the item is used on the wrong spot, the parallel processing event should stop, and if the item is used again, it should start from page one again. But I have no idea how to make this.
Because your event sets its own self switch even if the player is not on the correct spot. If the player is not in the correct spot, it should not do anything to the event's self switches.

I don't like all those parallel processes, and at no point do you turn the switch off.

I would put ALL the processing in the common event. Make it like this:

Control Variables: [002: Player's X] = Player's Map XControl Variables: [003: Player's Y] = Player's Map YConditional Branch: [002: Player's X] == 11 Conditional Branch: [003: Player's Y] == 8 Control Switches [001: Dug Hole] = ON Show Text: Nice, work's done Change Items: Spade - 1 Branch EndBranch EndIn your map event, have just ONE page, with the hole sprite, conditioned by the Dug Hole switch.Now, is there any chance they can use the spade on a different map? If so, you'll need to have another level in your conditional branch to make sure they're on the correct map - otherwise the common event will run and the hole will be visible when they come to this map, even though they haven't actually dug it in the right place.
Thank you, it worked perfectly!

And it is so clean compared to my bloated event, with its 4 pages and self switches everywhere. 😀

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-use-item-on-specific-spot-event.51668/