Introduction to the new Plugin Manager in RPG Maker MV 1.5.0+

orzfly

Developer
Developer
Joined
Jan 11, 2016
Messages
18
Reaction score
75
First Language
Chinese
Primarily Uses
RMMV
RPG Maker MV just get updated with the new Plugin Manager. You can create powerful plugins like the following one now!

cover.png

An example plugin is available in the attachment and also on GitHub. This plugin is intended to demonstrate the new Plugin Manager in RPG Maker MV v1.5.0 only so it doesn't have any real functionalities.

(This post is also available on GitHub which may have a better formatting.)

Group Parameters (@parent)
You can use @parent to set the parent parameter. Just append the name of parent parameter after @parent.

Code:
/*:
 * @param C:\
 *
 * @param Windows
 * @parent C:\
 *
 * @param System32
 * @parent Windows
 *
 * @param notepad.exe
 * @parent System32
 *
 * @param shell32.dll
 * @parent System32
 *
 * @param explorer.exe
 * @parent Windows
 *
 * @param D:\
 *
 * @param Documents
 * @parent D:\
 */
tree.png

This won't change the syntax when reading the values in game.

Code:
PluginManager.parameters('TreeDemo')['notepad.exe']
Localization Labels (@text)
The name of the parameter can be different from the name shown in editor now. You can use @text to specify the name shown in editor.

Code:
/*:
 * @param enable
 * @text Enable the Quest System
 * @default true
 *
 * @param mainmenu
 * @text Show in Main Menu
 * @parent enable
 */
text.png

To retrieve the value in game, use the name specified by @param instead @text:

Code:
PluginManager.parameters('TextDemo')['enable']
# => "true"

PluginManager.parameters('TextDemo')['Enable the Quest System']
# => undefined
Typings (@type)
Text
Code:
@type text
This directive will create the edtior for single-line string. Just like all the previous version, this is the very basic one.

If you specify an invalid type or just omit the @type directive, this will be used.

type-text.png

Note
Code:
@type note
This directive will create the editor for multi-line string.

type-note.png

Note: the result of this directive is a JSON-escaped string. This means if you are reading the value in game, you need to JSON.parse it to get the real value.

Code:
var value = PluginManager.parameters('PluginEditorDemo')['Note']

console.log(value)
# => "Aluxes: Eventually...\nAluxes: I can say something longer than one line!\nAluxes: This is super powerful!\norzFly: Oh well..."

console.log(JSON.parse(value))
# => Aluxes: Eventually...
# => Aluxes: I can say something longer than one line!
# => Aluxes: This is super powerful!
# => orzFly: Oh well...
Number
Code:
@type number
This directive will create the editor for a number with the up/down spin button.

type-number.png

Code:
@max 100
@min -100
These two directives can be used to set the range for the parameter.

Code:
@decimals 2
This directive will allow the number to have some decimal places. If this is omitted, the number can only be an integer.

File

Code:
@type file
This directive will create the editor for specifying an image resource or an audio resource.

type-file.png

Code:
@dir audio/bgm/
This directive will set the base directory for the file so the file picker will be scoped to this directory. This path will not be included in the result.

Code:
@require 1
If this directive is present, the file specified by this parameter will be included in the deployment if "Exclude unused files" is chosen.

Object Selector

Code:
@type animation
@type actor
@type class
@type skill
@type item
@type weapon
@type armor
@type enemy
@type troop
@type state
@type tileset
@type common_event
@type switch
@type variable
These directives will create the editor allowing the use to pick an item of the object. The object ID will be the result. If None is chosen, the result will be 0.

type-animation.png

type-variable.png

Code:
@require 1
(@type animation only) If this directive is present, the animation specified by this parameter will be included in the deployment if "Exclude unused files" is chosen.

Boolean

Code:
@type boolean
This directive will create the editor with two radio options returning a true/false value. The default labels are "ON" and "OFF".

type-boolean.png

Code:
@on Enable
@off Disable
You can override the label with @on and @off directives.

type-boolean-custom.png

Select
Code:
@type select
@option XP
@option VX
@option VX Ace
@option MV
This directive will create a drop-down box allowing the user to pick one from predefined options. The value will be the label of the option.

type-select.png

Code:
@type select
@option XP
@value 1.0
@option VX
@value 2.0
@option VX Ace
@value 2.1
@option MV
@value 3.0
You can also override the value by providing the @value directive for each @option.

Combo
Code:
@type combo
@option XP
@option VX
@option VX Ace
@option MV
This directive will create a text box with a drop-down menu allowing the user to type the text on his own. The user also can pick one from predefined options.

@value directives are not supported in Combo mode.

type-combo.png

List
By append [] to any valid type, the editor will be upgraded to a list type. For example, these directives are all valid.

Code:
@type text[]
@type note[]
@type number[]
@type variable[]
@type item[]
@type combo[]
@type file[]
@type struct<Anything>[]
type-list.png

Note: the result of this type is a JSON-escaped array of strings. This means if you are reading the value in game, you need to JSON.parse it to get the real value.

Code:
var value = PluginManager.parameters('PluginEditorDemo')['Text List']

console.log(value)
# => ["orzFly","orzDive","orzSwim"]

console.log(value[2])
# => o

var realValue = JSON.parse(value)
console.log(realValue[2])
# => orzSwim
Structure
You can define a structure by starting a new comment block in the file. You can put it after the main comment block. The first line defines the name of this struct ("ItemAward" in the example). You can define parameters like normal inside this structure block.
Code:
/*~struct~ItemAward:
 * @param Item
 * @type item
 *
 * @param Count
 * @type number
 * @min 1
 * @max 99
 * @default 1
 */
You can later use this structure by using a special type:
Code:
@type struct<ItemAward>
type-struct.png

Note: the result of this type is a JSON-escaped object. This means if you are reading the value in game, you need to JSON.parse it to get the real value.
Code:
var value = PluginManager.parameters('PluginEditorDemo')['Structure']

console.log(value)
# => {"Text":"orzFly","Note":"\"The quick brown fox jumps over the lazy dog.\\nThe lazy dog jumps over the quick brown fox.\\nThe quick brown fox jumps over the quick brown fox.\\nThe lazy dog jumps over the lazy dog.\"","Number":"233","Item":"1","Animation":"1","File (img/)":"system/GameOver"}

console.log(value["Text"])
# => undefined

var realValue = JSON.parse(value)
console.log(realValue["Text"])
# => orzFly
 

Attachments

Last edited:

djDarkX

Retro & Remastered Music Guru
Veteran
Joined
Jan 17, 2013
Messages
2,699
Reaction score
1,889
First Language
Music
Primarily Uses
RMMV
Wow, that's really amazing. I can't wait to see how new and existing plugins will utilize this. Great job to all the people that worked on getting this done.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,359
First Language
French
Primarily Uses
@orzfly I LIKE IT! now this a must for a plugin Manager! no need for a JSON likes system! You even introduced Nested system wich is really nice! no need to separate our parameters with "empty" params lol!

Now I was going to publish a new type who could be used for parameters I am unsure if it's the same than LIST Though!
Does the List works the same than an array or is different from them?
(Just asking)

Also does the type are autoconverted?
or you still have to convert them yourself?

Also does the File System support Custom Dir?

Also peoples make me noticed that we can't seem to use Union Type...
will it be something implemented in the futur?
 
Last edited:

LTN Games

Veteran
Veteran
Joined
Jun 25, 2015
Messages
645
Reaction score
503
First Language
English
Primarily Uses
RMMV
So we can't set default values for the @type note ?
Edit: Nevermind, I figured it out. It's just a string with line breaks \n
Code:
 @param Re-scale Backgrounds
 @parent Resolution Options
 @type note
 @desc This will scale backgrounds to new resolution.
 Default: title:false gameover:false battle:false
 @default "title: false\ngameover: false\nbattle: false"
Thanks for the awesome update! Now I don't have to make my own external plugin manager. Great work!
 
Last edited:

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
102
Reaction score
92
First Language
Russian
Primarily Uses
RMMV
Can I use values from string[] to form a combo box ?

For example, I want to create a plugin for localize the game. I add "Languages" parameter of string[] type, where the player writes all the languages of the game and from this list the combo box is formed the user selects the main language of the game.
 

orzfly

Developer
Developer
Joined
Jan 11, 2016
Messages
18
Reaction score
75
First Language
Chinese
Primarily Uses
RMMV
Can I use values from string[] to form a combo box ?

For example, I want to create a plugin for localize the game. I add "Languages" parameter of string[] type, where the player writes all the languages of the game and from this list the combo box is formed the user selects the main language of the game.
Very interesting question. Sadly, it's not possible in 1.5.0.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
102
Reaction score
92
First Language
Russian
Primarily Uses
RMMV
Thank you! I hope this opportunity will appear in the future
 

waynee95

Lunatic Coder
Veteran
Joined
Jul 2, 2016
Messages
643
Reaction score
536
First Language
German
Primarily Uses
RMMV
Okay, I though the new Plugin-Manager Layout and the Find function were awesome, but this here
is so much more amazing!!! :kaothx:

Wow, thank you guys!! :kaoluv:
 

waynee95

Lunatic Coder
Veteran
Joined
Jul 2, 2016
Messages
643
Reaction score
536
First Language
German
Primarily Uses
RMMV
@DK Yeah a color picker would be cool! :D

So I got my folder all setup, but how can I set them to be closed per default? All my folders start open.

EDIT:
@orzfly
If you nest parameters the JSON parsing get's really weird.
The strings appear to be escaped and not in JSON format which is due to multiple use of JSON.stringify, I guess. That requires the string to be parsed recursively.
Was that on purpose or will that be fixed, because when that will be changed in the future all current plugins will break because then the recursive parsing won't work anymore.

Also folders do not save their open/close state, what makes them not that great actually. It would be cool, if they were closed by default.
 
Last edited:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,642
Reaction score
2,972
First Language
Tagalog
Primarily Uses
Woah these are awesome and it seems like we can now have array parameters that are easily accessible in the manager. Really awesome update to the plugin manager and plugin making. :)
 

orzfly

Developer
Developer
Joined
Jan 11, 2016
Messages
18
Reaction score
75
First Language
Chinese
Primarily Uses
RMMV
@orzfly
If you nest parameters the JSON parsing get's really weird.
The strings appear to be escaped and not in JSON format which is due to multiple use of JSON.stringify, I guess. That requires the string to be parsed recursively.
Was that on purpose or will that be fixed, because when that will be changed in the future all current plugins will break because then the recursive parsing won't work anymore.
I think I have already said very clearly: Only notes (multi-line string), lists and structs would require JSON.parse. This is intended as the value of everything must be single-line strings due to backwards compatibility.
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
102
Reaction score
92
First Language
Russian
Primarily Uses
RMMV
@DK Yeah a color picker would be cool! :D

So I got my folder all setup, but how can I set them to be closed per default? All my folders start open.

EDIT:
@orzfly
If you nest parameters the JSON parsing get's really weird.
The strings appear to be escaped and not in JSON format which is due to multiple use of JSON.stringify, I guess. That requires the string to be parsed recursively.
Was that on purpose or will that be fixed, because when that will be changed in the future all current plugins will break because then the recursive parsing won't work anymore.

Also folders do not save their open/close state, what makes them not that great actually. It would be cool, if they were closed by default.
Now I use that function for deep parse:
Code:
DKCore.parseDeep = function(string) {
    try {
        return JSON.parse(string, function(key, value) {
            try {
                return this.parseDeep(value);
            } catch (e) {
                return value;
            }
        }.bind(this));
    } catch (e) {
        return string;
    }
};

It should not breaks if the developers remove the shielding
 

SumRndmDde

Follower of RNGesus
Veteran
Joined
Jul 30, 2013
Messages
224
Reaction score
410
First Language
English
Primarily Uses
RMMV
Is there any way to make "plugin folders" closed by default?
It kind of ruins the whole structure they create when they all appear opened by default every time the Plugin Manager is opened. :rswt
 
Last edited:

Clock Out

Veteran
Veteran
Joined
Jun 14, 2016
Messages
92
Reaction score
44
First Language
English
Primarily Uses
RMMV
Maybe structs are the answer to those who want their "folders" closed.
 

LTN Games

Veteran
Veteran
Joined
Jun 25, 2015
Messages
645
Reaction score
503
First Language
English
Primarily Uses
RMMV
I agree with @SumRndmDde the parent child tags create a collapsable parameter, but no way to set it to closed be default. Yes structs are great but most definitely no an alternative to setting default collapsed option. As one parent can contain a variety of parameters and creating structs for all them, kind of makes the child parent tag pointless.

This brings me to another thing that I never tested but can we create structs in a core file and use those structs thrghout all plugins in the game? I find it very inconvenient to have half of my plugin be structs and parmeters, it's really large and can be avoided, at least for those with a core plugin like me.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,323
Reaction score
11,927
First Language
English
Primarily Uses
RMMV
Holy cow, this is NICE!!!
 

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

Latest Threads

Latest Profile Posts

Oh, stop with the Melodrama...

...Listen to it instead!

anybody else like getting baked whilst coding?

When you go to the beach watch out for coconuts. Coconuts are more dangerous than sharks. Fact.
Try to get into pixelart again, so far its a sucess.
Also finally found a useful pixeltutorial which helps a lot.
♫ Anyone knows an ant can't move a rubber tree plant, but he's got high hopes, he's got high hopes, he's got high apple pie in the sky hopes ♫

Forum statistics

Threads
93,613
Messages
913,948
Members
123,172
Latest member
Gundu
Top