The new TouchInput in rmmz_core.js is highly similar with the old one inRMMV rpg_core.js.
The difference that in the TouchInput.clear function now there are _newState and _currentState properties, and TouchInput.update function is rewritten radically thanks to the new _createNewState() function.
Compared to RMMV, well, this is nice.
However, problems start appearing when you create plugin with anything related to TouchInput: Whether you use isClicked, isTriggered, isPressed, or isReleased function, all of them will produce "event activation loop effect"
To demonstrate what I mean, make and activate this plugin:
That small plugin make you able to activate event by clicking anywhere, just by standing adjacent to the event without directly clicking them (just like in Stardew Valley game).
To test the plugin, try making a talking NPC with an event, and try to talk to them by creating Text Message command. You will see the "event activation loop effect", in which the NPC will never stop talking after you try to end the message by clicking, by skipping the message or not.
The plugin, if used in RMMV will not produce the same problem.
Anyone care to explain about this? is this a supposed new touch input behavior? And does anyone know workaround for this?
EDITED: small edit on how to clarify how you should test the plugin
The difference that in the TouchInput.clear function now there are _newState and _currentState properties, and TouchInput.update function is rewritten radically thanks to the new _createNewState() function.
Compared to RMMV, well, this is nice.
However, problems start appearing when you create plugin with anything related to TouchInput: Whether you use isClicked, isTriggered, isPressed, or isReleased function, all of them will produce "event activation loop effect"
To demonstrate what I mean, make and activate this plugin:
JavaScript:
(function() {
Game_Player.prototype.triggerButtonAction = function() {
if (Input.isTriggered('ok') || TouchInput.isTriggered()) {
if (this.getOnOffVehicle()) {
return true;
}
this.checkEventTriggerHere([0]);
if ($gameMap.setupStartingEvent()) {
return true;
}
this.checkEventTriggerThere([0,1,2]);
if ($gameMap.setupStartingEvent()) {
return true;
}
}
return false
};
})();
That small plugin make you able to activate event by clicking anywhere, just by standing adjacent to the event without directly clicking them (just like in Stardew Valley game).
To test the plugin, try making a talking NPC with an event, and try to talk to them by creating Text Message command. You will see the "event activation loop effect", in which the NPC will never stop talking after you try to end the message by clicking, by skipping the message or not.
The plugin, if used in RMMV will not produce the same problem.
Anyone care to explain about this? is this a supposed new touch input behavior? And does anyone know workaround for this?
EDITED: small edit on how to clarify how you should test the plugin