Array as Parameters

In the plugin manager, we can create a function via script via Numbers and Parameters so we can change the value of a var inside the plugin manager. But that somehow only works for single number. What code should I put so I can change array values of one variable from the plugin manager?
You'll have to do it manually there is no way to do that automatically:

Things you must considerer: you'll have to "reserve" a character as "a separator of values", in this examples we'll use ',' because it looks simple:

var params = PluginManager.params("MyPlugin");var myArray = params["My Array Param"].split(','); // change , for your separatorThen myArray will have well, an array.

In your plugin manager you'll use a comman separated list:

Looking like this:

----------------------------------------

| My Array Param | 1, 2, 3, 4, 5 |

----------------------------------------

You may put on the parameter's help as something like "a comma separated list of numbers representing something"
If i understand correctly, you want array parameters for your plugin? Parameters are always String objects, so if you want to get an array, define a separator (a comma, for example) and parse them like this:

Code:
var params = PluginManager.parameters('My Plugin'); // Or different solution (see my signature)var myArray = params['My Array'].split(/\s*,\s*/).filter(function(value) { return !!value; });
The "filter" part is to discard empty elements.
Yes, thank you Ramiro and Iavra, problem solved! This really helps. <3
you can do something like: functionName(array) where array is something like var array = [ ... ]
Not really, since this has 2 drawbacks:


1) You only pass 1 parameter, which is an array.


2) "this" inside the called function is set to the object it belongs to. When using call() or apply() you can specify "this".
2) "this" inside the called function is set to the object it belongs to.

consider the following:

Code:
var self = this;something.map(function(some){ self.fucntionName() })

Original thread: https://forums.rpgmakerweb.com/threads/array-as-parameters.48487/