- Joined
- Aug 15, 2015
- Messages
- 254
- Reaction score
- 124
- First Language
- Spanish
- Primarily Uses
- RMMV
Description of the Feature:
Adding a new way of creating custom commands throught plugins. These custom commands can have their own parameters and prevent plugin commands to be bad written. The other plugin command version can still be for back compatibility.
Code for Implementation:
Inside core scripts should be:
To add a command througth a plugin you use tags like these inside main block:
commandKey: A name given to a group of commands. If more than one plugin uses the same all fields will be merged.
commandText: A name to show in a tab for it's key. If there are too much commands inside a tab a it will being divided into various and a number will be placed for %1 for every one.
commandGroup: A name to show for a group of commands. Commands must be inside groups.
command: A name for a function that is called when command is executed.
commandName: A name to show for a command.
commandParams: A struct where parameters are taken from. Unlike normal plugin parameters these should be stored as the right data types instead of a text that needs to be parsed.
And to register inside code you'll use something like this:
Mockups:
Why is this feature good?
This feature is great because of the following:
Possible issues with this feature?
Issues that might arise from this feature:
Adding a new way of creating custom commands throught plugins. These custom commands can have their own parameters and prevent plugin commands to be bad written. The other plugin command version can still be for back compatibility.
Code for Implementation:
Inside core scripts should be:
Code:
/**
* Tells that this version allows adding custom commands througth plugins.
*
* @static
* @property allowCustomCommands
* @type Boolean
* @final
*/
Utils.allowCustomCommands = true;
$dataCommands = {};
Code:
// Custom Plugin Command
Game_Interpreter.prototype.command357 = function() {
if ($dataCommands[this._params[0]] && $dataCommands[this._params[0]][this._params[1]]) {
$dataCommands[this._params[0]][this._params[1]](this._params[2]);
}
return true;
};
Code:
* commandKey ICF
* commandText ICF%1
*
* commandGroup Group 1
*
* command command1
* commandName Process Selfvariables
* commandParams struct<something>
*
* commandGroup Group 2
*
* command command2
* commandName Process Traits
* commandParams struct<something>
commandText: A name to show in a tab for it's key. If there are too much commands inside a tab a it will being divided into various and a number will be placed for %1 for every one.
commandGroup: A name to show for a group of commands. Commands must be inside groups.
command: A name for a function that is called when command is executed.
commandName: A name to show for a command.
commandParams: A struct where parameters are taken from. Unlike normal plugin parameters these should be stored as the right data types instead of a text that needs to be parsed.
And to register inside code you'll use something like this:
Code:
if (Utils.allowCustomCommands) {
$dataCommands.ICF = $dataCommands.ICF || {};
$dataCommands.ICF.command1 = function(obj) {
//Some code here
};
$dataCommands.ICF.command2 = function(obj) {
//Some code here
};
}
Why is this feature good?
This feature is great because of the following:
- Avoids normal plugin command interferences
- More friendlyness for users
- Less typing and errors
- More profesional look
Possible issues with this feature?
Issues that might arise from this feature:
- Maybe it could make too many tags


