.meta.notetag with mulitple tags ??

xDGameStudios

Veteran
Veteran
Joined
Sep 15, 2012
Messages
102
Reaction score
60
First Language
Portuguese
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.. :D

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 :)
 
Last edited by a moderator:

Heartbreak61

Wandering Noob
Veteran
Joined
Sep 5, 2012
Messages
187
Reaction score
90
First Language
Indonesian
Primarily Uses
RMMV
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
 

xDGameStudios

Veteran
Veteran
Joined
Sep 15, 2012
Messages
102
Reaction score
60
First Language
Portuguese
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 :p I only wanted to know how .meta.notetag ...worked :D

Thanks !!
 
Last edited by a moderator:

Heartbreak61

Wandering Noob
Veteran
Joined
Sep 5, 2012
Messages
187
Reaction score
90
First Language
Indonesian
Primarily Uses
RMMV
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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));
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,316
Reaction score
537
First Language
indonesian
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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top