Add Controls explanation to the options menu

Candacis

Pixel Pusher
Restaff
Joined
May 2, 2012
Messages
1,446
Reaction score
1,936
First Language
German
Primarily Uses
So, I searched a lot for this specific feature and I found a few plugins that add aditional stuff to the options menu, but not one has worked for me.

What I'm looking for is a plugin that lets you add options to the options menu. Said options wouldn't change anything (guess I shouldn't call them options..), anyway, they would basically be explanations how the controls work.
Like this:

OK -> Enter, Space
Cancel -> X, Esc
Move -> Arrow Keys
I -> Inventory

etc.

A handy reminder for the player, especially after playing the game after a long break.
 

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,254
Reaction score
1,558
First Language
PT - EN
Primarily Uses
RMMV
Can't you do the control reminder thing using a background plugin for the option's scene only?
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,627
Reaction score
1,066
First Language
English
Primarily Uses
RMMV
I first started on the idea of adding more options to the options menu like you originally mentioned, but stopped halfway through because I think that actually would be confusing to the player. They might think that they can actually change the controls by clicking on the "option", but the text isn't actually an option for them to modify.

Code:
// =========================================
// Extended_Options_Command
// =========================================

/*:
* @plugindesc This plugin will extend the options command window to
* add new rows.
*
* @param NewOptionsPosition
* @desc 0 = top, 1 = middle (between general options and volume options)
* 2 = bottom
*
* @param NewOption1
* @desc First new option to add
* @default OK -> Enter, Space
*
* @param NewOption2
* @desc Second new option to add
* @default Cancel -> X, Esc
*
* @param NewOption3
* @desc Third new option to add
* @default Move -> Arrow Keys
*
* @param NewOption4
* @desc Fourth new option to add
* @default I -> Inventory
*
* @param NewOption5
* @desc Fifth new option to add
*
*/

(function() {

var params = PluginManager.parameters("ExtendedOptionsCommand");
var newOptions = [];
for (var i=0; i < Object.keys(params).length; i++) {
if (String(params["NewOption" + (i+1)]) !== "") {
newOptions.push(String(params["NewOption"+(i+1)]));
}
}

var positionOptions = String(params["NewOptionsPosition"]);
// makeCommandList OVERWRITE
Window_Options.prototype.makeCommandList = function() {
switch(positionOptions) {
case 0:
this.addCustomOptions();
this.addGeneralOptions();
this.addVolumeOptions();
break;

case 1:
this.addGeneralOptions();
this.addCustomOptions();
this.addVolumeOptions();
break;

case 2:
this.addGeneralOptions();
this.addVolumeOptions();
this.addCustomOptions();
break;

default:
this.addGeneralOptions();
this.addCustomOptions();
this.addVolumeOptions();
break;
}
};

Window_Options.prototype.addCustomOptions = function() {
for (var i=0; i < newOptions.length; i++) {
this.addCommand(newOptions, "newOption"+(i+1), false, false);
}
}


})();
AddingOptionCommands.png

The next thing I tried (which is probably what you want), is just adding a new window to the options scene to show this information.
Save this in your plugins folder as "SceneOptionsHelpWindow.js".

NewOptionsHelpWindow.png

Code:
// =========================================
// Scene_Options_Help_Window
// =========================================

/*:
* @plugindesc This plugin will add a new window to the Options Scene
* @author Aloe Guvner
*
* @param HelpWindowX
* @desc X-position to start the help window (in pixels)
* Default 0
* @default 0
*
* @param HelpWindowY
* @desc Y-position to start the help window (in pixels)
* Default 0
* @default 0
*
* @param HelpWindowWidth
* @desc Width of the help window (in pixels)
* Default 300 (does not size dynamically based on text content)
* @default 300
*
* @param HelpWindowHeight
* @desc Height of the help window (in pixels)
* Leave blank to size the window dynamically based on text content
*
* @param TextLine1
* @desc First line of text to show in the new window
*
* @param TextLine2
* @desc Second line of text to show in the new window
*
* @param TextLine3
* @desc Third line of text to show in the new window
*
* @param TextLine4
* @desc Fourth line of text to show in the new window
*
* @param TextLine5
* @desc Fifth line of text to show in the new window
*
* @param OptionsCommandX
* @desc X position of the Options Command window
* Formulas or values accepted, leave blank for default
*
* @param OptionsCommandY
* @desc Y position of the Options Command window
* Formulas or values accepted, leave blank for default
*/

(function() {

var params = PluginManager.parameters("SceneOptionsHelpWindow");

var helpText = [];
for (var i=0; i < Object.keys(params).length; i++) {
if (params["TextLine" + (i+1)]) {
helpText.push(String(params["TextLine"+(i+1)]));
}
}

var optionsHelpX = String(params["HelpWindowX"]) || 0;
var optionsHelpY = String(params["HelpWindowY"]) || 0;
var optionsHelpWidth = String(params["HelpWindowWidth"]);
var optionsHelpHeight = String(params["HelpWindowHeight"]);
var optionsCommandX = String(params["OptionsCommandX"]);
var optionsCommandY = String(params["OptionsCommandY"]);


// =========================================
// Scene_Options
// =========================================

// Alias the create method of Scene_Options to also create the help window
var _Scene_Options_create = Scene_Options.prototype.create;
Scene_Options.prototype.create = function() {
_Scene_Options_create.call(this);
this.createOptionsHelpWindow();
};

Scene_Options.prototype.createOptionsHelpWindow = function() {
this._optionsHelpWindow = new Window_OptionsHelp(optionsHelpX, optionsHelpY);
this.addWindow(this._optionsHelpWindow);
}

// =========================================
// Window_OptionsHelp
// =========================================

function Window_OptionsHelp() {
this.initialize.apply(this, arguments);
}

Window_OptionsHelp.prototype = Object.create(Window_Base.prototype);
Window_OptionsHelp.prototype.constructor = Window_OptionsHelp;

Window_OptionsHelp.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};

Window_OptionsHelp.prototype.windowWidth = function() {
//var width = this.maxWidth() + this.padding * 2;
//return optionsHelpWidth || Math.min(width, Graphics.boxWidth);
return optionsHelpWidth || 240;
};

Window_OptionsHelp.prototype.windowHeight = function() {
return optionsHelpHeight || this.fittingHeight(helpText.length);
};

Window_OptionsHelp.prototype.refresh = function() {
var x = this.textPadding();
var y = 0;
var width = this.contents.width - this.textPadding() * 2;
this.contents.clear();
for (var i = 0; i < helpText.length; i++) {
this.drawText(this.value(i), x, y + this.lineHeight() * i, width);
}
};

Window_OptionsHelp.prototype.value = function(i) {
return helpText[i];
};

Window_OptionsHelp.prototype.open = function() {
this.refresh();
Window_Base.prototype.open.call(this);
};

// =========================================
// Window_Options
// =========================================

var _Window_Options_updatePlacement = Window_Options.prototype.updatePlacement;
Window_Options.prototype.updatePlacement = function() {
_Window_Options_updatePlacement.call(this);
this.x = eval(optionsCommandX) || (Graphics.boxWidth - this.width) / 2;
this.y = eval(optionsCommandY) || (Graphics.boxHeight - this.height) / 2;
};

})();
NewOptionsHelpWindowParameters.png

I'm fairly new to plugin creation / programming in general so let me know if anything is confusing or not well documented. Figuring this out was a good learning experience for me and hopefully it can help you as well.
 

Candacis

Pixel Pusher
Restaff
Joined
May 2, 2012
Messages
1,446
Reaction score
1,936
First Language
German
Primarily Uses
@Aloe Guvner Oh, thats fantastic, thank you! Yeah, something like the 2nd solution will work. Really useful. I will probably adjust the location of the window, so that it is right next to the options.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,627
Reaction score
1,066
First Language
English
Primarily Uses
RMMV
Great, glad to hear it is useful.

You can add as many lines as you'd like to the new window and it will still work.
In a text editor, you can add something like below to the parameters section.
Code:
* @param TextLine6
* @desc Sixth line of text to show in the new window
*
* @param TextLine7
* @desc Seventh line of text to show in the new window
And on and on for TextLine8, TextLine9, etc. if required.
 

Candacis

Pixel Pusher
Restaff
Joined
May 2, 2012
Messages
1,446
Reaction score
1,936
First Language
German
Primarily Uses
Hey, I just tried it out, but I can't get the window to show up. Neither in an empty project nor in my own.
What am I doing wrong?
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,627
Reaction score
1,066
First Language
English
Primarily Uses
RMMV
Can you post a screenshot of your plugin list as well as a screenshot of the parameters you've set on the plugin?
Also, when you access the options screen can you press F8 (opens the developer console) and let me know if any errors are displayed?
 
Last edited:

Candacis

Pixel Pusher
Restaff
Joined
May 2, 2012
Messages
1,446
Reaction score
1,936
First Language
German
Primarily Uses
As I said, I tried it out in an empty project with no other plugins. Didn't display anything.
I used the same parameters you used.

No errors were displayed. I attached a screenshot.
 

Attachments

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,627
Reaction score
1,066
First Language
English
Primarily Uses
RMMV
Save this in your plugins folder as "SceneOptionsHelpWindow.js".
Can you check to make sure the filename is exactly "SceneOptionsHelpWindow.js" ? I believe the underscores are messing it up. When the plugin is trying to read the parameters that you set from the RMMV editor, it needs to be an exact match.

(I really should set up a public dropbox to do this the right way, but just haven't gotten around to it yet, my apologies).
 

Candacis

Pixel Pusher
Restaff
Joined
May 2, 2012
Messages
1,446
Reaction score
1,936
First Language
German
Primarily Uses
Ah, now it works. I didn't see the sentence you quoted there. My bad. Thanks for the clarification!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

This forum is a great source of procrastination for me.
Today I read "The mouth speaks what the heart is full of." Simple, and reminds me I have a ton of work to do.
Why are cats so darn cute when their tongues are sticking out? If I did that, it wouldn't have the same effect.
The joy when you see a notification, the down when it's just a unnecessary quote of one of your posts again.

Forum statistics

Threads
94,399
Messages
920,616
Members
124,179
Latest member
mybriguy
Top