I want to imitate Chrono Trigger's message system, which normally when they show message the game does not pause and player is able to move away. When the player moves away too much the message autocloses.
I did a search about this topic and found out links to a VisuStella plugin called Galb message, I bought it, but that one doesn't work with the default show message, which means the player cannot skip them by pressing a key. I could I guess mod it via events but it is not what I'm looking for.
Therefore I ask, is there a plugin for RPG Maker MZ, either free or paid, that disables pause in Show Message?
Moved to: Plugin Requests
So I dove into this request a bit. To simply allow character movement during an event is pretty straight forward.
(function() {
inWalkableEvent = function(){
var id = $gameMap._interpreter._eventId;
if (id > 0 && $dataMap.events[id].meta.hasOwnProperty('type')){
if($dataMap.events[id].meta.type === 'walkable'){
return true;
}
}
return false;
};
var _Game_Player_canMove = Game_Player.prototype.canMove;
Game_Player.prototype.canMove = function() {
if (inWalkableEvent()){
return true;
}
return _Game_Player_canMove.call(this);
};
})();
Using this code, an event can be designated "walkable" by adding the following tag in the notes section of an event:
<type:walkable>
However, I'm having trouble "ending" a currently running event if you walk away. Just ending the event is no issue, but the problem occurs when trying to close a window message already displayed without having to hit the action key.
Adding this function to the above plugin will end the event if you walk away, but you still must close the current open window with the action key:
var _Game_Player_moveByInput = Game_Player.prototype.moveByInput;
Game_Player.prototype.moveByInput = function() {
if(!this.isMoving() && this.canMove() && inWalkableEvent() && this.getInputDirection() > 0){
// Exit Event Processing command
$gameMap._interpreter.command115();
}
_Game_Player_moveByInput.call(this);
};
I've tried various hacky methods to close the message window but none have worked without issues. Maybe someone else who knows the code base better would have a good method of doing so, otherwise I'll look into this more later.
I hope at least this much helps you in some way.
Thank you so much for your help. For the text window closing I had the idea of using the text command \^ that automatically closes the text window.
Using you code, I've tried adding
$gameMessage.clear();
$gameMessage.add("\\^");
right under
$gameMap._interpreter.command115();
It does close the window but only if the text hasn't been fully showed, and its a very short frame window. After the text has been fully added, it seems that adding \^ will not work anymore, it simply doesn't add any text.
I'll keep on investigating too. I hope we do find a way to achieve it!
Yes your observation is similar to one I had as well. Another "hack" I had was temporarily allowing the arrow keys to act as the action button, but it seemed a bit hacky with the work involved. If there's no simple way that could be an option though I guess.
OH I FOUND OUT!
SceneManager._scene._messageWindow.terminateMessage();
this is the code!
So, the complete script would look like this:
(function() {
inWalkableEvent = function(){
var id = $gameMap._interpreter._eventId;
if (id > 0 && $dataMap.events[id].meta.hasOwnProperty('type')){
if($dataMap.events[id].meta.type === 'walkable'){
return true;
}
}
return false;
};
var _Game_Player_canMove = Game_Player.prototype.canMove;
Game_Player.prototype.canMove = function() {
if (inWalkableEvent()){
return true;
}
return _Game_Player_canMove.call(this);
};
var _Game_Player_moveByInput = Game_Player.prototype.moveByInput;
Game_Player.prototype.moveByInput = function() {
if(!this.isMoving() && this.canMove() && inWalkableEvent() && this.getInputDirection() > 0){
// Exit Event Processing command
$gameMap._interpreter.command115();
// Close Message Window
SceneManager._scene._messageWindow.terminateMessage();
}
_Game_Player_moveByInput.call(this);
};
})();
Now, the text closes as soon as the player moves away! <3 The only part that is missing now is to do all of this when the players moves away too much. I'm thinking of checking coordinates of the event and comparing them with the player, but I don't know how to do it via script or if there's a fastest/cleanest way...
Awesome! Glad that works. Yeah you could just do the coordinate check within that if statement, since it will only execute once every move so it should be fine.