@Shaz - ok, that seems fair.. My own scripts can be pretty complex to go through, no denying that. But complexity was not what I was highlighting, and I am certainly not trying to belittle yanflys work or anything of that nature..
My main point, was that - after seeing Yanflys Core script (Mv Core) - the methods for reading notetags are EXTREMELY poorly written. (like, there is 4 insanely long methods - basically a js iteration of how he read notetags in ace - never mind the fact all notetags are already loaded at runtime via extractMetaData, and thus, rendered all 4 methods almost pointless...) And if something so simple as reading notetags is inefficient, I dread to think about the harder, more complicated stuff and how many lines that would take...
To me, when something as simple as reading the notetags from a database object cannot be done within a few lines, that raises the question of WHY. Why was that scripter not able to do that - was it cause they are too used to older methods (ie - hanging onto ace like coding styles), or was it the more worrying lack of knowledge of the new systems...
I mean, yes, Yanfly has been writing code longer than I (both in general, and for mv), and thus, should* be more experienced / better than I. But length !== skill. And in this case (reading notetags) My way is much much more efficient. (at least imo.. I am sure there is others who would have issue with the way I do it, and that would make them avoid my work 😀 )
Anyway, \rantover. ^_^
I'll go ahead and shed some insight on why I choose to use my "poorly" written methods for notetagging over the inherent extractMetaData function.
Frankly speaking, the extractMetaData function, while useful for the inexperienced scripter, is extremely un-userfriendly for the RPG Maker user (not the scripter). The meta data function requires the notetag to be case sensitive and the data stored later will also need to be extracted later. That's why using the method I use, I personally don't have to deal with that, plus I can give users the flexibility they need with non-case sensitive notetags. The work I've done for the notetags may look messy, but the extra work I put it is all for userfriendliness.
As for this:
(function(dm){var extractMetadata = dm.extractMetadata;dm.extractMetadata = function(data) {extractMetadata.apply(this, arguments);data.myCustomNotetagValue = DMV.extractMetaData(data, 'notetag')};})(DataManager);I've attempted to do that already. However, I've stumbled upon a couple problems:
- It's just raw data. It doesn't detect if it's from $dataItems, $dataWeapons, etc.
- It's doing it as it loads, which means, if I were to make a notetag that would copy or reference the properties of another object that would be loaded later, it wouldn't be able to do so.
A brief history of my plugin creation process: I originally went with the extractMetaData function. However, because it wasn't doing what I wanted it to, I switched over to Scene_Boot, and realized that wasn't too effective a few weeks down the line. I eventually came to the conclusion that the best time to load and extract all the notetag data is during the time the entirity of the game's database is finished loading, which is where I got to for my plugin library today. Overall, I've made two major switches for the entirity of my notetags.
That said, I'm open to criticism. There comes a problem in when doing something for a long time, programming styles can become stiff and uninnovative. That's why if you are to shed some light on where you can see my plugins can make an improvement, do share. Making a third switch for notetags isn't something I'm unwilling to do if I feel it's more beneficial.