.meta.notetag with mulitple tags ??

Hi everyone in the forums 🙂
I wanted to ask a quick question, I don't have rpg maker mv in this computer and I wanted to know something to get an idea going.. 😀

if I write this on the item notes:

​<Something:1,3>​<Something:3,3>​<Something:5,6>if I use the

$dataItems[x].meta.somethingwill it be an array?! like ['1,3' ,'3,3' ,'5,6'];
if not will it be only the first occurrence? if not will it be the last? if not.. how can I do to get it to be an array?

Thanks for your time 🙂
based on my experience, meta will always be replaced by latest value.

if you want to treat meta like an array, just write 

<something:1,2,3,4>

then on your script, separate it using split

var aVar = item.meta.something.split(/\s*,\s*/)

aVar value will be ["1","2","3","4"]

hope this could help you
based on my experience, meta will always be replaced by latest value.

if you want to treat meta like an array, just write 

<something:1,2,3,4>

then on your script, separate it using split

var aVar = item.meta.something.split(/\s*,\s*/)

aVar value will be ["1","2","3","4"]

hope this could help you
the problem is that I need to have this pairs

 ['1,3' ,'3,3' ,'5,6'];

1,3 and 3,3 and 5,6... I need this pairs... isn't it possible?

is there a better way?

PS: never mind 😛 I only wanted to know how .meta.notetag ...worked 😀

Thanks !!
if you want to use numeric as pairs, eval will do dirty trick for you. please note that many programmers out there consider eval as evil.


<something:[[1,2],[3,4]]>


var aVar = eval(item.meta.something);


aVar will become an array which member is [1,2] and [3,4]. all of them (1,2,3,4) are already numeric.


i prefer this way if i create something for myself. but for public use, i would try to find a more acceptable approach.
Yep, using meta only gives you one value for each tag - likely the last one.

If you want multiples, you can ignore the meta and go straight to the note, just like we did with Ace:

Code:
    $dataItems[id].note.split(/[\r\n]+/).forEach(function(line) {      cmd = /<something:\s*(.*)>/i.exec(line); // cmd will contain what's in (.*)      if (cmd) {        values = cmd.split(','); // will give you an array with your two values      }    }.bind(this));
you could use ; (semicolon) to split your pair instead of splitting using ,(coma)

"1,3;3,5;7,1"

spliited by ; will return

["1,3","3,5","7,1"]

then you can split it again when you grab the pair to get what you want.
Great, thank you guys 😉

Original thread: https://forums.rpgmakerweb.com/threads/meta-notetag-with-mulitple-tags.51613/