So... Meta and Note tags

Hello 🙂

So...

I have been trying to learn JS, to understand things better, I have tried to practice modifying my menus ...

Recently, I have tried to learn how to use meta, to get information from note tags ... I even tried looking into a plugin which uses it (MrTS Limited Inventory), and watched Soulpour777 video about meta, and still don't understand how to use it haha 😅

Can someone explain it to me, if its not much trouble? 😩

(or at least tell me what else to watch/read about it?)
the META is simply the result of the string you write in rmmv software, it is in no way related to javascript.
Rmmv core will apply a regex to extract some information from the string you add in the software.
Meta is simply a property invented and added by the rmmv developer.
however, they remain rather limited.

If your goal is to study javascript, the Meta can disturb you because they have no connection with the javascript in general.
Basically, any object that has a note box attached to it (Actor, Class, Skills, Item, Weapon, Armor, States etc.) will automatically look for tags that resemble HTML tags. These are in a particular format <tagName: value>. Anything the engine finds in this format will dump into the meta property with the tagName as a property and the value as the value. All you should need to do is make sure the meta property exists and then look for the tagName property that your plugin uses. If you find it then you can do something with the value that was provided. If you don't find it and you put a note tag in the note box then it is either formatted wrong or you are looking in the wrong object for it.

For instance, enter <race: Elf> into the first actor's note box. Now load your project, open up the console and type in $dataActors[1]. You'll find a meta property that, if expanded, will have a property called race with a value of " elf". These meta tags often times don't transfer over to their in-game objects so you may have to specifically look at the $data object as opposed to the $game object.
the META is simply the result of the string you write in rmmv software, it is in no way related to javascript.
Rmmv core will apply a regex to extract some information from the string you add in the software.
Meta is simply a property invented and added by the rmmv developer.
however, they remain rather limited.

If your goal is to study javascript, the Meta can disturb you because they have no connection with the javascript in general.

Oh, I get it, sorry lol
So, if I wish to understand and use it someday, should be better to let it for LAST? 😅 Thanks for answering 🙂


Basically, any object that has a note box attached to it (Actor, Class, Skills, Item, Weapon, Armor, States etc.) will automatically look for tags that resemble HTML tags. These are in a particular format <tagName: value>. Anything the engine finds in this format will dump into the meta property with the tagName as a property and the value as the value. All you should need to do is make sure the meta property exists and then look for the tagName property that your plugin uses. If you find it then you can do something with the value that was provided. If you don't find it and you put a note tag in the note box then it is either formatted wrong or you are looking in the wrong object for it.

For instance, enter <race: Elf> into the first actor's note box. Now load your project, open up the console and type in $dataActors[1]. You'll find a meta property that, if expanded, will have a property called race with a value of " elf". These meta tags often times don't transfer over to their in-game objects so you may have to specifically look at the $data object as opposed to the $game object.

Oh, thanks for the explanation 🙂 but I still don't understand how to use it in a plugin... I'll try to use your exemple later to see if I can learn something, thanks 😂
add some console.log in this file rpg_manager.js
Has will will can see, its use re.exec (regex to assign data to a OBJ)
so if you have string in data.note
rmmv will add the note specified format to meta obj .
var re = /<([^<>:]+)🙂?)([^>]*)>/g; its the regex but you can customise how you want

PHP:
DataManager.onLoad = function(object) {
    var array;
    if (object === $dataMap) {
        this.extractMetadata(object);
        array = object.events;
    } else {
        array = object;
    }
    if (Array.isArray(array)) {
        for (var i = 0; i < array.length; i++) {
            var data = array[i];
            if (data && data.note !== undefined) {
                this.extractMetadata(data);
            }
        }
    }
    if (object === $dataSystem) {
        Decrypter.hasEncryptedImages = !!object.hasEncryptedImages;
        Decrypter.hasEncryptedAudio = !!object.hasEncryptedAudio;
        Scene_Boot.loadSystemImages();
    }
};

DataManager.extractMetadata = function(data) {
    var re = /<([^<>:]+)(:?)([^>]*)>/g;
    data.meta = {};
    for (;;) {
        var match = re.exec(data.note);
        if (match) {
            if (match[2] === ':') {
                data.meta[match[1]] = match[3];
            } else {
                data.meta[match[1]] = true;
            }
        } else {
            break;
        }
    }
};
Using it in a plugin will depend largely on what your plugin does. In all actuality, it's just data that the dev is providing for your plugin. The plugin itself will read the data and do something based on what data was entered. You'll definitely want to get a good grasp on JavaScript first before worrying too much about this. Ever since RPG Maker MV 1.5 came out, the meta information isn't nearly as important as it once was. The new format for plugin parameters has opened the door to have most, if not all, information entered into the parameters themselves as opposed to note tags.
add som😂e console.log in this file rpg_manager.js
Has will will can see, its use re.exec (regex to assign data to a OBJ)
so if you have string in data.note
rmmv will add the note specified format to meta obj .
var re = /<([^<>:]+)🙂?)([^>]*)>/g; its the regex but you can customise how you want
Thank you both for the help, I really appreciate /o/
Using it in a plugin will depend largely on what your plugin does. In all actuality, it's just data that the dev is providing for your plugin. The plugin itself will read the data and do something based on what data was entered. You'll definitely want to get a good grasp on JavaScript first before worrying too much about this. Ever since RPG Maker MV 1.5 came out, the meta information isn't nearly as important as it once was. The new format for plugin parameters has opened the door to have most, if not all, information entered into the parameters themselves as opposed to note tags.


I'll save it for future reference and focus on JS only for now, as you both say that it will be better this way 😂
But I hope to understand it better in the future, only for the sake of knowing it u_u

Thanks again~ 😍
try https://www.video2brain.com or https://www.lynda.com/search?q=javascript essential
Personally, there is nothing better than to learn by professional with video.
Especially in your native language.
try https://www.video2brain.com or https://www.lynda.com/search?q=javascript essential
Personally, there is nothing better than to learn by professional with video.
Especially in your native language.

I'll check out the links and be sure to find good videos in portuguese

Thanks one more time~ 😂
Using it in a plugin will depend largely on what your plugin does. In all actuality, it's just data that the dev is providing for your plugin. The plugin itself will read the data and do something based on what data was entered. You'll definitely want to get a good grasp on JavaScript first before worrying too much about this. Ever since RPG Maker MV 1.5 came out, the meta information isn't nearly as important as it once was. The new format for plugin parameters has opened the door to have most, if not all, information entered into the parameters themselves as opposed to note tags.

I am trying to have Yanflys Passive active if they are wielding a weapon tagged with <Precise>... could you help a tadpole become a great frog, like yourself?
I am trying to have Yanflys Passive active if they are wielding a weapon tagged with <Precise>... could you help a tadpole become a great frog, like yourself?

You kinda broke at least two forums rules with this post: necro-posting and thread-jacking. Lol! I might be able to help you but I'd highly recommend that you create a new thread in the Plugin/JavaScript support forum so that the whole community has the opportunity to assist you. There are many talented devs here who may already have a solution for you or be able to dig into it before have an opportunity to do so.

Original thread: https://forums.rpgmakerweb.com/threads/so-meta-and-note-tags.91940/