じ☆ve冰风 发表于 2026-7-29 16:00:23

Ryu's Meta Data Handler

MetaData Handler - v1.04b
Ryuuji

Introduction
A plugin meant to handle metadata from game objectd.
All metadata are supported. (See list below)
Metakeys are known as notetags

Features
Spoiler: versions logV1.0
Reading, writing and deleting metadata from map events.
Allow a user to set multiple notetags (meta keys) and have values attached to them.
V1.01
Allow a user to use the meta keys in the conditionnal branch part.
This enables the user to make the event act differently based on its notetag.
V1.02
Allow a user to apply actions on an eventId based on a variable value.
Can be usefull if you spawn new events and want to edit their metadata before proceeding.
V1.03
Enables the user to use an array of words for metaKey and metaValue, defaults them at true and parses both true and false as such instead of strings.
V1.04
Huge update
Enables the user to use this tool across all game objects
Fixed some parsing issues
Increased the global scope possibilities
V1.04b
Fixed the missing map data, thanks to AquaEcho for pointing it out.



Screenshots
Spoiler: Conditionnal branch add-on
https://forums.rpgmakerweb.com/attachments/1-png.310290/


How to Use
- Copy the "Ryu_metaDataHandler.js" file into your project's /js/plugins/ folder
- Activate plugin using the 'Plugin Manager'
- Read the 'HELP' documentation (also found in plugin manager).

Spoiler: Info                JavaScript:       
/* v1.04b
*   Fixed the missing map metadata. Thanks to AquaEcho for pointing that out.
*
* v1.04
* This new version enables the user to edit meta data from any game object.
* This is a major update and renders errors with v1.0
* Make sure to upgdate the syntaxes in your game
*
* How to use:
*   Open the command module and use following settings
*   - MDataId or MDataVar (case sensitive)
*   MDataId should be used it you know the exact ID you are trying to affect.
*   MDataVar will use a the value of the variable ID provided.
*
*   - read, write, delete and readall
*   read will read the value of the provided key from the provided object id.
*   write will write both the key and the value to the provided object id.
*   delete will delete both the key and the value to the provided object id.
*   readall will read all keys and their values from the provided object it.
*
*   - Gameobject (Weapon, armor, item, enemy, state, skill, class, actor, event, map)
*   Each of those object have their own notetag which can be edited in the
*   game builder and edited through this plugin.
*
*   - ID (either raw ID or the variable ID containing the id)
*   This will allow the plugin to know what you want to edit
*   Each object has their own id, make sure to use to appropriate id.
*
*   - MetaKey
*   This is the key attached to a notetag.
*   It should be put between <> to take effect.
*   There is no limit to the amount of keys a user can attach to an object,
*   but try and be reasonnable. :D
*
*   - MetaValue
*   This is the value attached to a metaKey
*   By default it will be read as a boolean and set to true. (If no values
*   are applied)
*   Meaning : <berrybush> will be turned into <berrybush:true>
*   Rpgmaker MV handles any value as a string, but this plugin will overwrite
*   that and parse both "true" and "false" as a bool.
*   Meaning : <berrybush:true> is handled as <berrybush:"true"> by the software
*   but this plugin overwrites that as a bool upon being used.
*   NOTE : if the plugin is not called, it should not affect anything
*
*   Examples of use :
*   - MDataId read event 1 berrybush
*   - MDataId write actor 1 surname Ryuuji
*   - MDataVar readall class 99 type
*   - MDataVar delete ennemy 100 healing
*
*   NOTE :
*   MetaKey strings are supported and are to be put between ""
*   MetaValue strings are supported and are to be put between "" (But only possible
*   if the metaKey is a string of words)
*   Needs to be fixed asap ^.^
*
*   Updated checkMeta function allows for even more custimisation
*   You can now use this tool in conditionnal branch and check for values as well
*   This can be done through eventing or scripting
*
*   - Eventing:
*   Select conditionnal branch => Scripting
*   Add the script line :
*   checkMeta('actor', 1, 'surname') === "Ryuuji"
*   - checkMeta is the method
*   - 'actor' is the type of object
*   - 1 is the ID
*   - 'surname' is the key
*   - "Ryuuji" is the value
*   Make sure the watch for spaces :
*   <surname:Ryuuji> is not the same as <surname: Ryuuji>
*   - Scripting
*   Select script...
*   You can script as you usually would here
*   An example would be :
*/   // Example conditional branch to check for a specific string value
      if (checkMeta('event', 1, 'berrybush') === 'active') {
            // Actions to perform if the meta key 'type' is 'active'
            $gameMessage.add('This berrybush is active.');
      } else if (checkMeta('event', 1, 'berrybush') === 'inactive') {
            // Actions to perform if the meta key 'type' is 'inactive'
            $gameMessage.add('This berrybush is inactive...');
      } else {
            // Actions to perform if the meta key 'type' has a different value or does not exist
            $gameMessage.add('This berrybush is neither active or inactive...');
      }






Plugin Commands / Script Calls
Everything you need to know is in the help section of the plugin


Download plugin
Right click and save as(current version 1.04b)
Download

Terms and Credits
Free to use
Feel free to credit Ryuuji, or not. ^^

Feedback
I have a few ideas to increase the scale of this tool, but unless someone specifically needs it, I think I'll pass for now.
Let me know if you have any ideas or suggestion.
Bug detected? Let me know!
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7


Added new versions to widen the scale of the tool.
V1.01 adds a global scope to use data for conditionnal branching
V1.02 adds a variable handler (second command option) to act on eventId based on variable value
V1.03 adds the possibility to use an array of words as metaKey and metaValue and is more optimised.
V1.04 adds a objectType to be able to use any game object as a reference and increased the global scope to all data, not just bools


本贴来自国际rpgmaker官方论坛作者:Artille处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/ryus-meta-data-handler.169745/
页: [1]
查看完整版本: Ryu&#039;s Meta Data Handler