Player Movement Restricted to 1 tile

Hi all,

I am making a turn based tile game where I want player movement restricted to 1 tile per mouse click. i.e. you have to click in an adjacent tile and the player will move there for their turn. If you click more than 1 tile away it won't try to move the player to that location (if that makes sense)....it just won't register as a move.

Any ideas how to implement this?

Thanks
This isn't possible with eventing as far as I know. You should look into plugins that modify the mouse input, but not completely disable it. I haven't come across such a plugin so I can't say with certainty if one exists.
If you'd rather avoid messing with the input, you can try to implement a system that tracks the number of steps taken and stop the player's movement after 1 step by running an event, etc.
So, you could cover the map with events on every single tile. And they all have pages that switch themselves between being passable (beneath player) or not (same as player) depending on whether the player is adjacent to them.

That should do what you're asking, but I think it's a really inefficient way to do it - especially if you're going to have more than one map (an entire game) that plays this way. You'd be better off requesting a plugin like @AmVa suggests...but it is doable, if it comes down to it.
So, you could cover the map with events on every single tile. And they all have pages that switch themselves between being passable (beneath player) or not (same as player) depending on whether the player is adjacent to them.

That should do what you're asking, but I think it's a really inefficient way to do it - especially if you're going to have more than one map (an entire game) that plays this way. You'd be better off requesting a plugin like @AmVa suggests...but it is doable, if it comes down to it.
Thanks, that's how I was doing it originally. The issue I had was the that I wanted player to click adjacent tile, player moves onto tile, then displays random image in the event to indicate discovery of a different type of terrain. The problem I had was if I make it passable and then impassable when the player tries to move to the next tile it prevents movement from the existing one. Not sure if that makes sense without seeing it! In essence I developed my game with a map underneath the tiles that you reveal as you go a long. 1 move = loss of 1 health and 1 hydration, which works well as a mock up and have been building on it with achievements graphics upgrades etc. Depending on the type of terrain you reveal you receive cactus fruit, water etc which you can use to replenish. There are also hidden nasties like spiders, scorpions etc that drain your health. You also get a survival card for each new terrain discovered. I have got a playable version but wanted to see if I could randomise the tile that you click rather than making multiple maps with events on them. i.e. keep every game different but minimise load through events (per your comment on doing it this way). Screenshot provided as I am not great at articulating but you may get the gist of what I am attempting. Probably better with a plugin but I am trying to learn what I can without relying on them if possible. But if that's the only way then it is what it is.
Screenshot 2023-10-25 210358.png
Sorry...I'm not going to try hard to decipher that brick of words, half of which seem to be thematic stuff that doesn't actually matter for what we're talking about 😛

But, in brief:
The problem I had was if I make it passable and then impassable when the player tries to move to the next tile it prevents movement from the existing one.
I don't see why that should be true. It sounds like both an order of operations error as well as a logical one.

In their passable state, you give the events a Below Player priority with a Player Touch activation - that means they shouldn't do anything until the player has moved onto the tile.

That manipulates the variable or whatever that all the events are referencing, so the state of event passability changes when the player has already moved onto one.

But second to that, you said that adjacent tiles are always passable. So the tile the player is leaving should never be becoming impassable because it has to be adjacent to the spot they're moving into. So it sounds like you set something up incorrectly.
Lol sorry! got a bit carried away. Might be a case of me overthinking it having spent the last few nights trying to work a solution when sometimes it's right in front of you. I'll give it a go and come back
Ok feel like an idiot. Such a simple solution took me between last post and this to do! thanks very much! I'll now go and stick my head in a bucket.

I was setting the passability for the player not the tile.

Original thread: https://forums.rpgmakerweb.com/threads/player-movement-restricted-to-1-tile.162318/