Joined
Apr 19, 2021
Messages
4
Reaction score
3
First Language
english
Primarily Uses
RMMZ
hi everyone! this is my first post here.

question: i'm in the process of writing a notetag parser, and i'm wondering if there are any conventions for handling nested data. currently, i'm thinking something like:

Code:
<MyNotetag>
  string: my string
  number: 123
  array of numbers: [1, 2, 3]
  object: { key: value of key, other key: value of other key }
  array of objects: [{ foo: bar, goo: gaa }, { num: 66 }]
</MyNotetag>

basically, just wrap objects in `{}` and arrays in `[]`. alternatively, maybe ppl are using more of a yaml-esque approach and relying on indention?

Code:
<MyNotetag>
  string: my string
  number: 123
  array of numbers: 1, 2, 3
  object:
    key: value of key
    other key: value of other key
  array of objects:
    - foo: bar
      goo: gaa
    - num: 66
</MyNotetag>

or maybe even nested notetags?


Code:
<MyNotetag>
  string: my string
  number: 123
  array of numbers: 1, 2, 3
  object: <NestedTag>key: value of key, other key: value of other key</NestedTag>
  array of objects: <NestedTag>foo: bar, goo: gaa</NestedTag>, <NestedTag>num: 66</NestedTag>
</MyNotetag>

PS: i'm new here, and for the life of me, i cannot figure out how to change my avatar. is that ability locked on new accounts?
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
911
Reaction score
480
First Language
English
Primarily Uses
RMMV
If you're going that complex, why not straight out evaluate the contents as JavaScript? To me that would be more intuitive than having to also learn your scripting language.

And I believe yes, you have to have some number of posts before you can click on your profile picture and see an Edit button.
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,834
Reaction score
2,335
First Language
English
Primarily Uses
RMMZ
My advice is to not use note tags at all. They're completely unnecessary at this point. Everything you can do with note tags, you can do better with plugin parameters. It's a much better user experience for both you as the plugin dev and game devs that use your plugin.

 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
911
Reaction score
480
First Language
English
Primarily Uses
RMMV
My advice is to not use note tags at all. They're completely unnecessary at this point. Everything you can do with note tags, you can do better with plugin parameters. It's a much better user experience for both you as the plugin dev and game devs that use your plugin.
I have to, as a game dev that uses plugins, disagree :wink:

It makes incredible sense to me that anything affecting an actor/item/state/whatever is there on that entity in my database. For example, an arbitrary skill in my game might have a cost to learn it in Job Points, a targeting restriction, and an action sequence. If notetags weren't used, I would A: have all of that information in three different plugins, and B: I wouldn't have any clue that anything had even been modified about that skill unless I searched every single plugin that might potentially affect it. That seems terrible.

Plus, the Plugin Manager is not exactly convenient to use. When I first started using Yanfly's Quest Journal and I was trying to manage it from inside the plugin parameters, it was extremely annoying to have to repeatedly scroll through pages of plugins in the list to read the small text of the plugin I wanted to scroll through layers of nested parameters...definitely not a good user experience. I think parameters are much better for options that are set once when you install and configure the plugin, not for any information that requires frequent reference or change (and certainly not for information directly associated with a database object).

(Don't get me wrong, in my example of the Quest Journal, that definitely makes more sense to be in parameters than in a notetag somewhere. But it's not a good user experience, so I prefer an external editor)

Maybe you meant something else, and I don't want it to seem like I'm jumping down your throat :smile: but the advice "to not use note tags at all" sounded unambiguous.
 
Joined
Apr 19, 2021
Messages
4
Reaction score
3
First Language
english
Primarily Uses
RMMZ
oh, that's interesting. so if i were to just expose js, it'd look something like:

Code:
<MyNotetag_JS>
  string = 'my string';
  number = 123;
  array = [1, 2, 3];
  object = { key: 'value of key', otherKey: 'value of other key' };
  arrayOfObjects: [{ foo: 'bar', goo: 'gaa' }, { num: 66 }];
</MyNotetag_JS>

and then in my plugin i'd do something like:

JavaScript:
let string, number, array, object, arrayOfObjects;

eval(tag);

doSomething(string, number, array, object, arrayOfObjects);
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
911
Reaction score
480
First Language
English
Primarily Uses
RMMV
Now keep in mind what Frogboy mentioned - if you're sticking that all in one place and the only things the user is going to modify are the "value of key/other key," that definitely should be a plugin parameter. You have access to a nice little UI in there, with drop-down menus and text boxes to only modify the values that you want exposed to the user.

But if it's legitimately something that is associated with multiple database objects and will be modified differently for each...or doesn't have those same variables every time...sure.
 
Joined
Apr 19, 2021
Messages
4
Reaction score
3
First Language
english
Primarily Uses
RMMZ
thanks for the help, you two! i'll share the parser when it's ready.
 

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
132
Reaction score
95
First Language
English
Primarily Uses
RMMZ
If that's going to be the only format for the notetag block, you can use JSON.stringify on each line, then JSON.parse it to a variable. Each line would end up being its own object, which could be assigned to a "master" object for the object the notetag block is on. Without testing, I'm not sure if it would handle nested arrays or objects in a line properly without additional code. I've never used stringify, I just know it exists and more or less what it does.

I actually just released a plugin last night that can parse a notetag block, but it doesn't natively do anything with the data other than attach it to the object the notetags came from. It relies on the dev to process the resulting data however they like. (not necessarily plugging, I just found the timing between my release and this similar-ish topic to be a little ironic :p)
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,834
Reaction score
2,335
First Language
English
Primarily Uses
RMMZ
Maybe you meant something else...
Nope, that's precisely what I meant. I disagree with you but I get where you're coming from. I personally don't see much difference between figuring out which plugin to open and scrolling through a gigantic note tag full of every plugin's stuff but you have your opinion and I have mine. It's all good.

To be fair, I do recognize the issue that you bring up here and it's not ideal. My old MV plugins got annoying having Actor Config, Class Config etc in almost every plugin I made. I have a plan to remedy this in my work for MZ.
 

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
132
Reaction score
95
First Language
English
Primarily Uses
RMMZ
Nope, that's precisely what I meant. I disagree with you but I get where you're coming from. I personally don't see much difference between figuring out which plugin to open and scrolling through a gigantic note tag full of every plugin's stuff but you have your opinion and I have mine. It's all good.

To be fair, I do recognize the issue that you bring up here and it's not ideal. My old MV plugins got annoying having Actor Config, Class Config etc in almost every plugin I made. I have a plan to remedy this in my work for MZ.
I've always preferred putting object specific data into notetags on the object in question, and global stuff into plugin parameters. That way the parameters act like a "system setting", and the notetags can function as an extension of that database object. I feel it's more organized that way, that everything is only where it NEEDS to be. Now if an actor config managed stuff that would affect ALL actors, I'd stick it in plugin parameters. But if it was going to be information specific to an actor, I'd have that as a notetag.

Good example I can point to: my TP Control plugin, the one that allows you to make different resource mechanics. The parameters allow you to set up the styles as you like, but you have to assign one to a class or battler via notetags to make it do anything. This way I don't have to mess around with forcing a dev to assign a list of battlers or classes to each style in the parameters and then having to try to write code to go through each list to find the battler in question every time I need to make sure the style operates as intended for each battler, or force the dev to put all the style information in EACH battler's notes. That, to me, would be either a LOT of code cycling in a LOT of places, or a LOT of extra code that I honestly don't need when the hybrid approach is the most efficient. ESPECIALLY since the style list is user-expandable. This way the style is global information for all battlers who have it, but the information is ONLY accessed when a battler is actually using it.

TL;DR - I feel that each method has its place, but excluding one in favor of the other could lead to inefficiencies either on the plugin writer's end, or the game dev's. I feel parameters are suited for global information, and notetags are better for object-specific information.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
911
Reaction score
480
First Language
English
Primarily Uses
RMMV
I personally don't see much difference between figuring out which plugin to open and scrolling through a gigantic note tag full of every plugin's stuff
To me, the main difference is knowing to look. For example, let's say you have states that have functionality per the regular database, but some of them also have additional functionality added by plugins. If all plugin information is kept in parameters, and I just look at a state, I have no idea if I'm seeing everything.

Similarly, if I do look up that state in a plugin, I can't see all of the information on the state at one time. And then it's compounded if that functionality is split between different plugins! (for example, using the MV Yanfly library, Custom Apply/Remove Effects and Passive Conditions are in two different plugins). And I have to do Finds in the plugin manager to go between them. I'd never choose to have my information set up like that.

Like Drakkonis said, I see it as very similar to the basic coding concept of when to use global variables that have larger significance versus when to have local things encapsulated within your function. Obviously it's not a question of scope, but of being able to see what's relevant in one place.
but you have your opinion and I have mine. It's all good.
It absolutely is! The beautiful thing about doing all of this independently and for fun means you can set up everything in whatever way pleases your soul :smile:
 

Latest Profile Posts

I wish I can work faster on my game. But I don't want to get burned out. :(
I've been working on something on and off for a few years now, and I've been reluctant to share any details on the project before I had anything playable because I did not want to generate hype only for the project to go back on hiatus. That being said I believe what I'm working on is very unique and pushes the boundaries of what RPG Maker projects can be. Bold claims, I know but just wait.
Happy Mother's Day to all the moms :)
Create Anime Art w/ AI, Tall Sprites with Aurora, Customize Variable Display | RPG Maker News #34

[My favorite slow moving track I've made so far]

Forum statistics

Threads
111,195
Messages
1,059,188
Members
144,442
Latest member
CubeLeopard5
Top