Sorry if I'm posting this in the wrong place--this is my first thread on the site--but I'm working on a game with quite a few plugins, and I've set the escape chance to 100% using Yanfly's battle core plugin mostly because I don't want to force players to fight battles they're tired of fighting. The only thing is, I want to add a bit of flair to the escape messages when they leave the battle, and while I've edited the one message in the Database > Terms > Messages menu, I was wondering if there was a way to add multiple escape messages that are chosen randomly every time the player escapes from a battle rather than having only one ever show up over and over again. Just the little things in life, y'know? I've tried googling various different terms to get a plugin I'm looking for, but all I'm getting are text box message plugins instead of system message plugins. Is this goal an achievable one, or no?
More Battle Escape Messages?
JS Plugin RequestsThis will require a plugin since the default engine does not allow that. It would be a very simple plugin, but it's still a plugin nonetheless.
Moved to JS Plugin Requests.
Stick this in a .js file (Save As > File Type: All Files, Filename: whateverYouLike.js) then import it as a plugin:
This will let you write an Escape Start line like this, with multiple options separated by the | character:
If you happen to like using the | character in your messages, you can change the "split" character to something else by editing this line:
Lastly: remember to save your project after making Plugin Manager changes, otherwise those changes won't be seen during play. 😮💨
JavaScript:
(function(alias) {
'use strict';
const SPLIT = '|';
TextManager.message = function(messageId) {
let msg = alias.apply(this, arguments) || '';
let arr = msg.split(SPLIT);
return arr[Math.randomInt(arr.length)] || '';
};
})(TextManager.message);
%1 has started to escape!|%1 flees!|%1 decides to run away.
If you happen to like using the | character in your messages, you can change the "split" character to something else by editing this line:
JavaScript:
const SPLIT = '|';
Lastly: remember to save your project after making Plugin Manager changes, otherwise those changes won't be seen during play. 😮💨
Thank you, this works wonderfully. I've got a list of credits to give for my project, so even though this is a simple script and I have no idea how much effort it actually took to make, I still want to make sure everyone that wrote something gets some recognition when I finally finish this game in twenty years. It's much appreciated!
Original thread: https://forums.rpgmakerweb.com/threads/more-battle-escape-messages.123044/