JavaScript, good. Plugin Manager, restrictive!

I feel that while JavaScript is the best option for a new language, I feel that the plugin manager made it much more restrictive. Here's why:

  • Changes are made inside the plugin manager. Everything that the plugin writer puts there are the ones that can be modified.
  • Because of the plugin manager changing the values you want modified, you can't openly add something you want.
  • Plugins such as Achievements, Story Books, In Game changed values for the plugins isn't that widely free to do.
Of course, I am basing this upon what I know.

In my examples, I mentioned Achievements and Story Book plugins as an example. Let's say you want to make a plugin that hoards achievements, yes? Then, the plugin user decides that she wants to add another achievement. She can't, because everything is inside the plugin manager now.

Back in Ace, since we do use the script editor we can freely add variables to our liking very much easier.

My question is,

how would the plugin writers defeat this problem? What are the viable ways to make the plugin user create an extensive and non restrictive plugin to add variables that is changable in our out of the game?

Aside from opening the plugin in an IDE or Text Editor, that is.
What? Back in Ace, it's not like the end user didn't have to still go into a text editor and directly modify the code.

The difference now is that they have to click a QuickLaunch icon instead of pressing F11 to get to a text editor.

If you did want to somehow have the user not touch the code at all, though, you could just do gimmicky stuff with note tags or use particular items in the database to work as achievements.
What? Back in Ace, it's not like the end user didn't have to still go into a text editor and directly modify the code.

The difference now is that they have to click a QuickLaunch icon instead of pressing F11 to get to a text editor.
It seems you misunderstood. What I am explaining is, in Ace, code modification is easier, since it is open in the text editor. For RMMV, it all goes in the Plugin Manager. Therefore anything that is indicated there is the only things you can edit if you're the user of that plugin. If you're going to make a plugin that deals with something like adding stories, adding quests, etc, it feels a little bit harder to do that because you're considering how you'll put that up easier for the user to use and edit.
I think the plugin manager is a superb addition.


As a scripter, adding functionality to your own game, it's entirely up to you whether you use it or not.


But as a developer who wants to use other people's scripts and not have to struggle to figure out what needs to be customized and where, and to do it all without worrying about breaking the script, it's a godsend.


And as a scripter, providing scripts for others to use in their games, it's great to not have to try and walk a non-scripter through making changes and wondering if issues reported are because there really are issues with the script, or because they haven't added them or customized them correctly.


For your examples ...


There is no reason someone writing an achievement system cannot write it in a way that it can be added to by the users.


There is no reason why someone using a plugin can't extend it by modifying the script, assuming they have either the knowledge or assistance to do so.


Plugins are not more restrictive than Ace scripts at all. They are safer to use, because the remove the risk of people breaking them by changing things they should not. But the flexibility to modify the guts out of them is still right there, for those who want to - they just need to open the file in an appropriate text editor (which could NOT be done in Ace).
I think the plugin manager is a superb addition.

As a scripter, adding functionality to your own game, it's entirely up to you whether you use it or not.

But as a developer who wants to use other people's scripts and not have to struggle to figure out what needs to be customized and where, and to do it all without worrying about breaking the script, it's a godsend.

And as a scripter, providing scripts for others to use in their games, it's great to not have to try and walk a non-scripter through making changes and wondering if issues reported are because there really are issues with the script, or because they haven't added them or customized them correctly.

For your examples ...

There is no reason someone writing an achievement system cannot write it in a way that it can be added to by the users.

There is no reason why someone using a plugin can't extend it by modifying the script, assuming they have either the knowledge or assistance to do so.

Plugins are not more restrictive than Ace scripts at all. They are safer to use, because the remove the risk of people breaking them by changing things they should not. But the flexibility to modify the guts out of them is still right there, for those who want to - they just need to open the file in an appropriate text editor (which could NOT be done in Ace).
Hmm, but how would that be done for those people like me who doesn't know any way to do it? If I want to write a plugin that considers adding something, what ways do you propose to beat the problem of not having the way to add anything at all?
it's up to the coder creativity to make it right...

for example in my autocolor plugin.

http://forums.rpgmakerweb.com/index.php?/topic/49350-est-auto-text-color-plus/

i give 30 entry in plugin parameter which you could modify.

if you don't use 30. just left some of it blank to not using that entry...

i loop through that plugin parameter and save that entry to a variable.

if you want more entry? i give option adding it ingame (via plugin command / scriptcall)

which just add new entry to the variable we saved earlier...

it's not as practical as ACE script editor. but at least we secure the code that shouldn't be edited.

and less mistake from people that don't know how to modify script correctly.

edit: this method could be done too for achievement plugin, etc. as long as they save the plugin parameter to a variable. just add new /modify existing entry to that variable.
Hmm, but how would that be done for those people like me who doesn't know any way to do it? If I want to write a plugin that considers adding something, what ways do you propose to beat the problem of not having the way to add anything at all?
Check out my Linked Variables and Linked Switches plugins. In the Ace version, you had to modify the script to assign a script call to a variable or switch. In the MV version, I have made it flexible enough to link switches/variables to commands within the script, just like in Ace, for those who are game to do the mods, but it also allows you to add them via a plugin command.


For achievements, it depends on how you have it set up - if it's something that the game developer just says "give this achievement" and they do their own tracking of when it's earned, it's super easy. If you want them to be able to set the conditions but for the plugin to track when the conditions are met, that can also be done either via plugin commands or by letting them add it to the script - in just the same way as my two plugins mentioned above. The script calls might be a bit more complicated for the tricky achievements.
Check out my Linked Variables and Linked Switches plugins. In the Ace version, you had to modify the script to assign a script call to a variable or switch. In the MV version, I have made it flexible enough to link switches/variables to commands within the script, just like in Ace, for those who are game to do the mods, but it also allows you to add them via a plugin command.

For achievements, it depends on how you have it set up - if it's something that the game developer just says "give this achievement" and they do their own tracking of when it's earned, it's super easy. If you want them to be able to set the conditions but for the plugin to track when the conditions are met, that can also be done either via plugin commands or by letting them add it to the script - in just the same way as my two plugins mentioned above. The script calls might be a bit more complicated for the tricky achievements.
I am just guessing here but when you said plugin commands, let's say if its an achievement, do you mean like making an empty array... then in the plugin commands let the user add something in that array, read by the plugin's other classes and display it? I think that's a good solution.

I'll check your plugin and see if I may learn something from it as well 🙂

I am still open to more solutions as well 🙂
yes. That's pretty much what those plugins do. You can either edit the script itself to define them, or you can use a plugin command to define them. You can even use a combination of the two.


The only REAL difference between plugins in MV and scripts in Ace, is that Ace has its own editor, and you need to use an external editor for MV (which could be as simple as Notepad). Everything else can be done in just the same way.
I like to use json files for my plugins. But they would still have to use some text editor to set the values up, so not sure if you'll even consider it, but I'll still type up my reasoning for using them.

I had asked some of my users on how they would like these type of things to be handled. Most of the votes went towards using JSON files, with directly editing the js in 2nd and then using bunch of plugin parameters in last.

json files are pretty easy to setup and it would pretty much be like directly editing the js since you'll create the array / object in the json except if the js file ever gets updated they wouldn't have to copy over their array or object to the new js file. I think as long as you give them an example json file with some instructions most users will be able to set them up, since I've only gotten 1 pm for help on setting up the json.
Would you be able to share me how JSON files work exactly? Thanks 🙂
Well for json loading I just copied how MV loads the data files.
Example from my parameters plugin:

Spoiler
Params.custom = []; Params.useCustom = (Params.plugin['Use Custom Parameters'].toLowerCase() === 'true'); Params.loadCustomParams = function() { if (this.useCustom) { var xhr = new XMLHttpRequest(); var url = 'data/Parameters.json'; xhr.open('GET', url, true); xhr.overrideMimeType('application/json'); xhr.onload = function() { Params.custom = JSON.parse(xhr.responseText); }; xhr.onerror = function() { alert("File: data/Parameters.json not found."); }; xhr.send(); } }; Params.loadCustomParams();I was originally going to have it check if the file existed, but doing that would cause the game to have an error on web based. So instead I just use the "Use Custom Parameters" which I tell people to set to true only if they want to use the json file.
So what this pretty much does is opens the json file and stores the data into Params.custom which I can now use in my plugin.
 
And here's a link to the example json file I provide:
https://gist.github.com/quasixi/3b928832bf42d4471560

So if I used Params.custom[0] it would return

{"abr": "qpp", "name": "Quasi Parameters Plus", "default": 0} so I could do something like Params.custom[0].abr and it would return "qpp" or Params.custom[0].name and return "Quasi Parameters Plus"
The plugin manager makes it easier for a plugin developer to release updates to his or her plugin.


Developers can now safely assume that the original code was not touched, because options are managed in the plugin manager. So releasing an update is considerably safer than back when people without much scripting knowledge HAD to make changes in the source.
i haven't test it... but if i remember correctly... if we install a plugin. set plugin parameter.

then update the plugin as long as the update didn't modify the plugin parameter.

the parameter will stay the same... without the need for user to reenter the value of their config...

i might be wrong though. i cannot test it at the moment since i'm going out for a while. anyone can clarify it?
They will stay the same as long as you don't delete it from the manager and reload it from there.
Well, someone just said abou the arrays, but in my window with customizable variables system I'm just using arrays.

I create one parameter for each information a new variable would need, and the developper can just add new values organizing the conditions by this array, separating them by commas.... Like it

Param Variable Name: name1, name2... (Infinity, depends on how many the user adds)

Param variable id: 23, 4, 10... (23 for the name1, 4 for the name 2, etc)

And any other information my system needs.
Sorry for the double post... But I forgot to say. The only thing that I really dislike about the manager is that we can't change the plugins order freely. We are obligated to delete and readd a plugin, or to overwrite them on the editor, because we just can't change their order properly.
You can cut and paste them for easy ordering 🙂
I think it's obliquous and awkward yet.... And other thing, there is no import button in it, so you have to copy and paste manually the plugin in the game folder. In truth, there is no import button for any ressource on rmmv. Not that I used it in the older rms, but for plugins that would be nice to have one.

That's just my complains.... Not that my opinion will change anything.
I tried dragging the plugins to reorder them, but that didn't work. I must agree, it is a bit awkward.

Original thread: https://forums.rpgmakerweb.com/threads/javascript-good-plugin-manager-restrictive.52318/