Random Game Over v1.1
IntroductionThis plugin allows the developer to randomise the defeat ME, Game Over image, and Game Over ME.
Hue and pitch variances may also be set.
How to use
Save it as APHO_RandomGameOver.js and put it in your plugin folder.
You will also need to create a 'gameover' folder in your 'img' folder for the Game Over images.
Specify the list of images/MEs that will be used via the plugin parameters.
You may also specify a minimum and maximum hue adjustment range for the Game Over image, as well as a minimum and maximum pitch for the MEs, which will be applied at random. If you do not wish to use this feature, you can set the min and max to the same value.
You may also specify another optional image to be overlayed over the Game Over image. Useful for if you want to randomise the Game Over message independently from the background, or apply different hue adjustments to different parts.
Script
Spoiler: CODE JavaScript:
//==========================================
// APHO_RandomGameOver.js
//==========================================
/*:
* @title Random Game Over
* @author Apho
* @plugindesc v1.1 Allows for randomising the defeat ME, Game Over image, and Game Over ME, and having hue and pitch variances for them.
*
* @param DefeatMEList
* @text Defeat ME list
* @type file[]
* @dir audio/me
* @require 1
* @desc Pool of MEs for when the player falls in battle.
* @default ["Defeat1", "Defeat2"]
*
* @param DefeatVolume
* @text Defeat volume
* @type number
* @desc Volume of the Defeat ME.
* @default 90
*
* @param DefeatPitchMin
* @text Defeat minimum pitch
* @type number
* @desc Minimum pitch of the Defeat ME.
* @default 100
*
* @param DefeatPitchMax
* @text Defeat maximum pitch
* @type number
* @desc Maximum pitch of the Defeat ME.
* @default 120
*
* @param ImageList
* @text Game Over image list
* @type file[]
* @dir img/gameover
* @require 1
* @desc Pool of images for the Game Over screen.
*
* @param HueMin
* @text Minimum hue
* @type number
* @desc Minimum hue adjustment for the gameover image.
* @min -360
* @default -180
*
* @param HueMax
* @text Maximum hue
* @type number
* @desc Maximum hue adjustment for the gameover image.
* @min -360
* @default 180
*
* @param OverlayList
* @text Game Over overlay list
* @type file[]
* @dir img/gameover
* @desc (Optional)Pool of images to be overlayed over the Game Over screen
*
* @param OverlayHueMin
* @text Minimum hue (Overlay)
* @type number
* @desc Minimum hue adjustment for the gameover overlay.
* @min -360
* @default 0
*
* @param OverlayHueMax
* @text Maximum hue (Overlay)
* @type number
* @desc Maximum hue adjustment for the gameover overlay.
* @min -360
* @default 0
*
* @param GameOverMEList
* @text Game Over ME list
* @type file[]
* @dir audio/me
* @require 1
* @desc Pool of MEs for the Game Over screen.
* @default ["GameOver1", "GameOver2"]
*
* @param GameOverVolume
* @text Game Over volume
* @type number
* @desc Volume of the Game Over ME.
* @default 90
*
* @param GameOverPitchMin
* @text Game Over minimum pitch
* @type number
* @desc Minimum pitch of the Game Over ME.
* @default 100
*
* @param GameOverPitchMax
* @text Game Over maximum pitch
* @type number
* @desc Maximum pitch of the Game Over ME.
* @default 120
*
* @help
* This plugin allows the developer to randomise the defeat ME, Game Over image,
* and Game Over ME.
* Hue and pitch variances may also be set.
* You will need to create a 'gameover' folder in your img directory for the
* gameover images.
* You may also add an optional overlay over the Game Over image.
*
* TERMS OF USE
* - Free for commercial and non-commercial use, as long as I get a free copy
* of the game.
* - Edits allowed for personal use.
* - Do not repost or claim as your own, even if edited.
*
* VERSION HISTORY
* v1.1 - 2023/6/30 - Added optional overlay for the Game Over image.
* v1.0 - 2023/6/28 - Initial release.
*/
(function(){
var parameters = PluginManager.parameters('APHO_RandomGameOver');
var ImageList = JSON.parse(parameters['ImageList']);
var HueRange = Math.max(parseInt(parameters['HueMax']) - parseInt(parameters['HueMin']), 0);
if(parameters['OverlayList'] != '' && parameters['OverlayList'] != '[]')
{
var OverlayList = JSON.parse(parameters['OverlayList']);
var OverlayHueRange = Math.max(parseInt(parameters['OverlayHueMax']) - parseInt(parameters['OverlayHueMin']), 0);
}
var DefeatMEList = JSON.parse(parameters['DefeatMEList']);
var DefeatPitchRange = Math.max(parseInt(parameters['DefeatPitchMax']) - parseInt(parameters['DefeatPitchMin']), 0);
var DefeatVolume = parseInt(parameters['DefeatVolume']);
var GameOverMEList = JSON.parse(parameters['GameOverMEList']);
var GameOverPitchRange = Math.max(parseInt(parameters['GameOverPitchMax']) - parseInt(parameters['GameOverPitchMin']), 0);
var GameOverVolume = parseInt(parameters['GameOverVolume']);
BattleManager.playDefeatMe = function()
{
let Pitch = parseInt(parameters['DefeatPitchMin']) + Math.randomInt(DefeatPitchRange + 1);
let ME =
{
name: DefeatMEList,
volume: DefeatVolume,
pitch: Pitch,
pan: 0
}
AudioManager.playMe(ME);
};
Scene_Gameover.prototype.createBackground = function()
{
let Hue = parseInt(parameters['HueMin']) + Math.randomInt(HueRange + 1);
let Image = ImageList;
this._backSprite = new Sprite(ImageManager.loadBitmap('img/gameover/', Image, Hue, false));
this.addChild(this._backSprite);
if(parameters['OverlayList'] != '' && parameters['OverlayList'] != '[]')
{
let OverlayHue = parseInt(parameters['OverlayHueMin']) + Math.randomInt(OverlayHueRange + 1);
let Overlay = OverlayList;
this._overlay = new Sprite(ImageManager.loadBitmap('img/gameover/', Overlay, OverlayHue, false));
this.addChild(this._overlay);
}
};
Scene_Gameover.prototype.playGameoverMusic = function()
{
AudioManager.stopBgm();
AudioManager.stopBgs();
let Pitch = parseInt(parameters['GameOverPitchMin']) + Math.randomInt(GameOverPitchRange + 1);
let ME =
{
name: GameOverMEList,
volume: GameOverVolume,
pitch: Pitch,
pan: 0
}
AudioManager.playMe(ME);
};
})();
Terms of use
[*]Free for commercial and non-commercial use, as long as I get a free copy of the game.
[*]Edits allowed for personal use.
[*]Do not repost or claim as your own, even if edited.
[*]Do not use for training AI models. This includes, but is not limited to, inputting the plugin contents or part thereof into AI models that train on user input.
Version history
v1.1 - 2023/6/30 - Added optional overlay for the Game Over image.
v1.0 - 2023/6/28 - Initial release.
Download link
Github
本贴来自国际rpgmaker官方论坛作者:AphoticAmaranth处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/random-game-over-v1-1.158774/
页:
[1]