RPG Maker Forums

I am working on a plugin where some of the parameters may contain arrays with a combination of numbers and strings.


Something like this works fine:

Code:
  var audioName = (params['Audio Name'] || '["My Audio Track", 80, 100]'
    ).replace(/[\[\]]/gi,'').split(",").map(function(value) {
    return eval(value);
  });
It gives me an array with ["My Audio Track", 80, 100] which is what I want.


But I also need to cater for the possibility that some of the content could be a nested array, such as this example for a font:

Code:
[["Tahoma", "Verdana", "Calibri"], 24, true, [0, 255, 0, 200]]
["Tahoma", 24, true, 15]
The first parameter could be just a string or an array of strings.  The last could be just a number or an array of numbers.


Not really sure how to go about this one.  Any suggestions?  I'd like to keep it fairly short.

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top