Title. I have an item that allows you to open the equip screen in battle via a common event, but every time I use the item the message "there was no effect on x" pops up before opening the equip screen. Is there any way to hide this via scripting or plugins that can let me hide it?
MZ How to hide "there was no effect" message from an item that only calls a common event
RPG Maker MZ Supportgiving the item an effect to give and remove some dummy state should suppress the message
This is what I ended up trying and it worked. I am also having another issue now though where I get a message saying the enemy emerged every time the item is used.
did that only start happening after adding the state effects? Just using a call to open up the equip scene on top of the battle scene without any specific preparations or a plugin to facilitate it would reset and mess with a bunch of things related to battle when the player comes back to my knowledge.
The best way to go about it would require a plugin imo, but id have to see whats available for MZ in that regard
The best way to go about it would require a plugin imo, but id have to see whats available for MZ in that regard
It was happening before as well I believe. After looking at plugins it looks like VisuStella might be the only one with a plugin for it for MZ.
Edit:The plugin by VisuStella wasn't quite what I was looking for
Edit:The plugin by VisuStella wasn't quite what I was looking for
I made a quick plugin that might do what you're after? Give it a try and let me know!
LINK
LINK
Alternatively something like this might work (briefly tested without plugins, seems OK):
To support other mid-battle scenes you can edit this line:
E.g.
[Edit: added post URL to plugin code header.]
(Also, just to mention it: since the item apparently doesn't target anyone, I'd have considered setting it to Scope: None. No targets means no "failed on target" messages!)
JavaScript:
/*:
* @target MZ
* @plugindesc Don't initialise battle data if previous scene was a menu.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/posts/1529996/
* @help Free to use and/or modify for any project, no credit required.
*/
;void (() => {
"use strict";
/** Scenes to/from which battle should *NOT* initialise. @type {Scene_Base[]} */
const NO_INIT_SCENES = [Scene_Equip];
/** @returns {boolean} `true` iff should init battle data on scene start. */
const shouldInit = function() {
for (const s of NO_INIT_SCENES)
if (SceneManager.isPreviousScene(s))
return false;
return true;
};
/** @returns {boolean} `true` iff should clear temporary battler data on scene end. */
const shouldClear = function() {
for (const s of NO_INIT_SCENES)
if (SceneManager.isNextScene(s))
return false;
return true;
};
// Patch - only initialise battle data if appropriate.
void (alias => {
BattleManager.startBattle = function() {
if (shouldInit())
alias.apply(this, arguments);
};
})(BattleManager.startBattle);
// Patch - only process battle end effects when appropriate.
for (const C of [Game_Party, Game_Troop])
void (alias => {
C.prototype.onBattleEnd = function() {
if (shouldClear())
alias.apply(this, arguments);
};
})(C.prototype.onBattleEnd);
})();
JavaScript:
const NO_INIT_SCENES = [Scene_Equip];
JavaScript:
const NO_INIT_SCENES = [Scene_Equip, Scene_Menu, Scene_Skill];
(Also, just to mention it: since the item apparently doesn't target anyone, I'd have considered setting it to Scope: None. No targets means no "failed on target" messages!)
This worked perfectly. Thank you so much! I was planning on scrapping the battle system I had in mind for my game and restarting, but this worked! Thank you again.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-hide-there-was-no-effect-message-from-an-item-that-only-calls-a-common-event.180065/