Hey there! So I'm just experimenting and going over different options for my game right now. The game I'm working on is an exploration and text-heavy game and I want it to have a bit of a more classic text-based rpg sort of feel to it and I'm curious if there is a way to do tactics-like grid-based movement and exploration without being in a battle? I tried fiddling with the free SRPG plugins that came with MZ but I'm not figuring out a way to use it for that sort of thing without actually being in combat and taking turns. I just want the player to move a few squares at a time, and have a limited movement range as they go. Somewhat pace out the movement. I'd like it to feel like moving around in a fire emblem or final fantasy tactics game, just it's always your turn and you're exploring instead of fighting. I tried just slowing down the player movement using the speed control but it just feels slow and awful instead of what I'm going for because of the full fluid movement animations so I'd rather use a proper grid-based movement. Is such a thing reasonably possible?
Tactics game style movement... without the battle?
RPG Maker MZ SupportYou could try turning the player's frequency property down, which would result in a delay between tile movements.
Edit: nvm, that doesn't seem to work for player movement.
Edit: nvm, that doesn't seem to work for player movement.
I mean the tilebased movement is by default already a grid. Can't you just have a common event running that counts the steps with a variable and then do whatever you're gonna do when the player reaches whatever movement limit you set?
Tho I am curious what the point of this is when it's always gonna be the players turn regardless. Wouldn't that just automatically refresh the movement limit upon reaching it?
Tho I am curious what the point of this is when it's always gonna be the players turn regardless. Wouldn't that just automatically refresh the movement limit upon reaching it?
You would have to design beyond this since this is more of a base design for movement than anything. Just thinking out loud here so there may be things I missed or errors:
For testing, I would have an event that you interact with first (action button trigger, maybe an NPC) on page 1 that will run the code below as page 2 that uses a box/select cursor as an image which wraps around the player at the start of the autorun.
Pseudo-code (test and change as needed:
I'll update with js/commands after some tests.
For testing, I would have an event that you interact with first (action button trigger, maybe an NPC) on page 1 that will run the code below as page 2 that uses a box/select cursor as an image which wraps around the player at the start of the autorun.
Pseudo-code (test and change as needed:
Code:
Page 1: (action button, same as character, npc image)
- dialogue and choices to see if player wants to do strategy/tactic movement
- when yes:
- set event transparent ON
- set event image to cursor
- set event location to player
- selfswitch A ON
- set event transparent OFF
- when no: nothing
Page 2: (autorun, cursor/select image, below character, selfswitch A condition checked)
- wait 6 frames
- check if distance between player and event is less than 4
- true: (move routes for event, wait for completion, skip)
- if player presses 'up'
- move route: up
- if player presses 'down
- move route: down
- if player presses 'left'
- move route: left
- if player presses 'right'
- move route: right
- else: (move event toward player)
- if player presses 'ok'
- move route: event image set to None
- move route: player (repeat, skip, wait for completion)
- set player speed to 6
- move player toward event
- event set location to player
- move route: wait a few frames, event image set to Cursor
- if player presses 'escape'
- dialogue and choices whether player wants to stop strategy movements
- when yes:
- event set location to original event's x and y
- wait a few frames
- Selfswitch A OFF
- when no: (nothing)
Ahh this seems quite interesting and promising! We wouldn't need to worry too much about the options to turn it on and off, it wouldn't really be an optional control scheme, just part of the game's built-in control scheme but it makes sense for testing. let me try this out and see. How would this affect the player interacting with other events? Like an event next to them? if pressing up causes the move route to go up, and ok causes the move to initiate, would that prevent the player from rotating and interacting?
Ah, yes, you are right. I was thinking of moving the cursor and pressing OK to move the player only which is why I prefaced this as being only something like a base design. You wouldn't be able to interact normally with events though as you stated.
Thar being said, I'll check a few things out and see what else I can find and build on it from there with some prelim-tests. I know I can work around getting events to interact but I think there should be an easier/more efficient way.
Thanks for the food for thought!
No worries, I really appreciate the help and you've given me a good start to work with! I've run into a couple of other issues that I'm trying to suss out too that maybe you can help me with in the meantime while you're working on it too. One is that there doesn't seem to be a "Move player to event" command, so I can't figure out how to do that last step. Two, I realize that this would also prevent the game from working on mobile since it specifically requires the keys to be used wouldn't it? I don't know if there's gonna be a fix for that is there? The other is that I got it so that the cursor event moves but after moving it a couple of spaces it just stops working and I don't know why. It doesn't move back to the player it either just freezes or disappears. What I have right now on page 2 based off what you gave me is:
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Wait:6 frames
◆Control Variables:#0001 = Map X of Player
◆Control Variables:#0002 = Map Y of Player
◆Control Variables:#0003 = Map X of This Event
◆Control Variables:#0004 = Map Y of This Event
◆Control Variables:#0001 -= #0003
◆Control Variables:#0002 -= #0004
◆If:#0001 ≤ 4
◆If:Button [Up] is being pressed
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move Up
◆
:End
◆If:Button [Down] is being pressed
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move Down
◆
:End
◆If:Button
is being pressed
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move Left
◆
:End
◆If:Button
is being pressed
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move Right
◆
:End
◆
:Else
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move toward Player
◆
:End
◆If:#0002 ≤ 4
◆If:Button [Up] is being pressed
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move Up
◆
:End
◆If:Button [Down] is being pressed
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move Down
◆
:End
◆If:Button
is being pressed
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move Left
◆
:End
◆If:Button
is being pressed
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move Right
◆
:End
◆
:Else
◆Set Movement Route:This Event (Wait)
:Set Movement Route:◇Move toward Player
◆
:End
◆If:Button [OK] is being pressed
◆
:End
Okay, so I cannot guarantee anything here - this is definitely a work in progress so I can only do a few things.
I've worked it down to a few lines of code that will still allow for interaction with the events, but make it to where you are still moving tile to tile like in strategy games (except on map rather than in battle).
What you are looking for is not in the engine so we'll have to "fake" a few things as well. I'm sure other people have better ideas but this was the quickest way for me to approach this. It looks promising at the moment but I am not sure so this is definitely just prototype stuff that will need a lot of work.
First, you'll need to make it so that the player cannot move on the map, but still allow for it to interact with it. Save the code below as a plugin (we will be overwriting the player update in the corescript so it is best to just use a plugin).
Edit: I gave you MV Code - just edited to reflect MZ code:
Then, in an event on a map (set to parallel trigger), you will need this code for one script call:
And right below it, another script call to change the speed back:
In some of my prelim-tests, it appears to be working fine. Please be sure to test thoroughly and save/backup before testing.
The issue here of course is that when the scene is active, it will not allow for regular player movement. I am currently unaware of any issues so please proceed with caution. My assumption is that you are willing and ready to accept/resolve issues that may arise.
Hope this is somewhat of what you were looking for! Best of luck!
I've worked it down to a few lines of code that will still allow for interaction with the events, but make it to where you are still moving tile to tile like in strategy games (except on map rather than in battle).
What you are looking for is not in the engine so we'll have to "fake" a few things as well. I'm sure other people have better ideas but this was the quickest way for me to approach this. It looks promising at the moment but I am not sure so this is definitely just prototype stuff that will need a lot of work.
First, you'll need to make it so that the player cannot move on the map, but still allow for it to interact with it. Save the code below as a plugin (we will be overwriting the player update in the corescript so it is best to just use a plugin).
Edit: I gave you MV Code - just edited to reflect MZ code:
JavaScript:
Game_Player.prototype.update = function(sceneActive) {
const lastScrolledX = this.scrolledX();
const lastScrolledY = this.scrolledY();
const wasMoving = this.isMoving();
this.updateDashing();
// if (sceneActive) {
// this.moveByInput();
// }
Game_Character.prototype.update.call(this);
this.updateScroll(lastScrolledX, lastScrolledY);
this.updateVehicle();
if (!this.isMoving()) {
this.updateNonmoving(wasMoving, sceneActive);
}
this._followers.update();
};
Then, in an event on a map (set to parallel trigger), you will need this code for one script call:
JavaScript:
if (['up','down','left','right'].includes(Input._latestButton)) {
$gamePlayer.setMoveSpeed(6);
$gamePlayer.moveStraight(Input.dir4);
this.wait(15);
}
JavaScript:
if ($gamePlayer.moveSpeed() === 6) $gamePlayer.setMoveSpeed(4);
The issue here of course is that when the scene is active, it will not allow for regular player movement. I am currently unaware of any issues so please proceed with caution. My assumption is that you are willing and ready to accept/resolve issues that may arise.
Hope this is somewhat of what you were looking for! Best of luck!
Oh amazing, thank you! Will I still be using the event that you had me create before or will this be in place of that?
And as to my other question, will this still allow for use on mobile or would this only allow for keyboard movement?
You won't need the event from before since that doesn't allow you to interact normally with other events.
This currently will only allow for keyboard movement - you will have to find a way to incorporate touch input in order to use for mobile and I am not sure how big of a job that would be - could be as simple as throwing in a few touch input commands, but could also be more since I haven't looked too deep into this.
I see okay, I will need to ponder that. It's very important for me to make sure my game is accessible to players on mobile as well so I will need to see what I can find. Thank you so very much in the meantime, I really appreciate your help. 😀
Original thread: https://forums.rpgmakerweb.com/threads/tactics-game-style-movement-without-the-battle.167819/