Status
Not open for further replies.

MuteDay

Mutation Engine
Veteran
Joined
Oct 19, 2015
Messages
253
Reaction score
39
First Language
English
so i wanted to ask yanfly, are you planning a skill equip system, reason i ask is alot of your plugins seam to have close ties with FFT, and it would really help out alot if you where planning on some sort of passive skill equip system (i dont use moggle_x's because it adds new learning system and it wont work with learning with jp and wouldnt apply all your notetags, like jpboost 

anyways hope to hear back from ya
 

dayhjawk

Veteran
Veteran
Joined
Jul 5, 2015
Messages
107
Reaction score
12
First Language
English
Primarily Uses
Found a bug with your equip core. 

When using it, it shows Max MP, on the right side when you go to equip something. However, I have renamed MP to something else. So it's not using the default name for MP? Just a heads up!
 

jet_black

Hopeless & Hardboiled
Veteran
Joined
Jun 28, 2015
Messages
47
Reaction score
5
First Language
German
I love the Stat Upgrades.

Didn´t had the time to try it out yet, but I have a few questions.

Will you be able to upgrade custom created stats? I´d like to have the stats "Strength", "Agility", etc. and would like to upgrade these with your system.

And will that plugin disable the default way of automatically upgrade your stats after level up?

Would you consider creating a custom stats plugin? I really don´t like the default stats and how they work, as I have a long history of Pen & Paper RPG (Pathfinder, D&D, Shadowrun, etc.) and love these systems and how attributes, stats, etc. work.
 

Riff

Eorzean
Veteran
Joined
Oct 25, 2015
Messages
266
Reaction score
84
First Language
English
Primarily Uses
RMMV
Found a bug with your equip core.

When using it, it shows Max MP, on the right side when you go to equip something. However, I have renamed MP to something else. So it's not using the default name for MP? Just a heads up!
Second this one. Encountered same minor bug.
 

Yanfly

Veteran
Joined
Mar 15, 2012
Messages
1,743
Reaction score
2,638
so i wanted to ask yanfly, are you planning a skill equip system, reason i ask is alot of your plugins seam to have close ties with FFT, and it would really help out alot if you where planning on some sort of passive skill equip system (i dont use moggle_x's because it adds new learning system and it wont work with learning with jp and wouldnt apply all your notetags, like jpboost 

anyways hope to hear back from ya
Definitely as it's one of the staples in my previous script libraries. :) I guess it's just a matter of time as to when to get it released. And yeah, FFT is probably my favorite FF. XD

Found a bug with your equip core. 

When using it, it shows Max MP, on the right side when you go to equip something. However, I have renamed MP to something else. So it's not using the default name for MP? Just a heads up!
It uses whatever you call it in the default editor. You probably renamed MP, but did you rename Max MP, too?



I love the Stat Upgrades.

Didn´t had the time to try it out yet, but I have a few questions.

Will you be able to upgrade custom created stats? I´d like to have the stats "Strength", "Agility", etc. and would like to upgrade these with your system.

And will that plugin disable the default way of automatically upgrade your stats after level up?

Would you consider creating a custom stats plugin? I really don´t like the default stats and how they work, as I have a long history of Pen & Paper RPG (Pathfinder, D&D, Shadowrun, etc.) and love these systems and how attributes, stats, etc. work.
Hi jet_black

If you're able to upgrade those custom stats with JavaScript (most likely you'd be able to), then yes, you can.

Disabling the default way of auto updating your stats after a level up is entirely up to you. If you want to do that, you'll have to set the parameter curves for each class in your database to show no changes.

I considered creating a custom stats plugin, but the problem with that is, there's no global way of making it work for all the possible plugins out there, thus causing incompatibilities so I'd like to avoid this. However, I may make custom attributes, which will be different from stats.

Second this one. Encountered same minor bug.
 

Yuudai

Burritoman!
Veteran
Joined
Dec 16, 2014
Messages
42
Reaction score
18
First Language
German, English
Primarily Uses
Yuudai, on 25 Nov 2015 - 11:03 PM, said:

mhh...I see

is it possible to create a shop scene charging JP instead of gold?

thats what I want *_*

Hmmm, that might actually be something worthy of a Plugin idea.  :o
Super long awwwwwwwwwwwwwwwww (^౪)/ that would be awesome! *excited*

hope you can squeeze this in to your busy schedule! :p  
 
Last edited by a moderator:

dayhjawk

Veteran
Veteran
Joined
Jul 5, 2015
Messages
107
Reaction score
12
First Language
English
Primarily Uses
TY! How I overlooked that I will never know.

also, in the stats upgrade, how do you use custom parameters, ex and sp-parameters?
 

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,158
First Language
English
Primarily Uses
N/A
Hi Yanfly. I was wondering if you could move the processing of notetags to a separate function from DataManager.isDatabaseLoaded() in YEP_CoreEngine, as this function should only be used to check if the database files are all available, and not perform any actions in and of itself. In my PreloadManager plugin, for instance, I need to check if the database is done loading until it is, at which point I start reading it and preloading data on boot. This can sometimes cause a problem because if the database is done loading, running this will cause it to load the notetags multiple times.

Below is the relevant code:

Code:
# Starts on line 577 of YEP_CoreEngine.jsYanfly.Core.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() {    if (!Yanfly.Core.DataManager_isDatabaseLoaded.call(this)) return false;        this.processCORENotetags1($dataItems);        this.processCORENotetags1($dataWeapons);        this.processCORENotetags1($dataArmors);        this.processCORENotetags2($dataEnemies);        this.processCORENotetags3($dataActors);        this.processCORENotetags4($dataClasses);        return true;};
 
Last edited by a moderator:

Yanfly

Veteran
Joined
Mar 15, 2012
Messages
1,743
Reaction score
2,638
Hi Yanfly. I was wondering if you could move the processing of notetags to a separate function from DataManager.isDatabaseLoaded() in YEP_CoreEngine, as this function should only be used to check if the database files are all available, and not perform any actions in and of itself. In my PreloadManager plugin, for instance, I need to check if the database is done loading until it is, at which point I start reading it and preloading data on boot. This can sometimes cause a problem because if the database is done loading, running this will cause it to load the notetags multiple times.

Below is the relevant code:

# Starts on line 2173 of YEP_CoreEngine.jsYanfly.Core.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { if (!Yanfly.Core.DataManager_isDatabaseLoaded.call(this)) return false; this.processCORENotetags1($dataItems); this.processCORENotetags1($dataWeapons); this.processCORENotetags1($dataArmors); this.processCORENotetags2($dataEnemies); this.processCORENotetags3($dataActors); this.processCORENotetags4($dataClasses); return true;};
It's the same for me. The notetag loading doesn't occur unless the database is fully loaded. Also, the methods to load the notetags won't load multiple instances of the data. Nothing gets added multiple times over.
 

Lear

Veteran
Veteran
Joined
Aug 12, 2012
Messages
59
Reaction score
11
Primarily Uses
Will you be able to upgrade custom created stats? I´d like to have the stats "Strength", "Agility", etc. and would like to upgrade these with your system.
And will that plugin disable the default way of automatically upgrade your stats after level up?

Would you consider creating a custom stats plugin? I really don´t like the default stats and how they work, as I have a long history of Pen & Paper RPG (Pathfinder, D&D, Shadowrun, etc.) and love these systems and how attributes, stats, etc. work.
This is doable with Quasi's Params Plus plugin. As long as you put the following in the skills note tag:

<Learn Cost Eval>

user._cParamPlus[0] += 1;  // <- the cParamPlus[0] = the first custom parameter in the data/Parameters.json file.

user.forgetSkill(21);

user.refresh();

</Learn Cost Eval>

The only issue I have yet to resolve is when using Quasi's Params Plus plugin, some of yanflys lovely menus (equip/item core, party system) dont display the custom stats. ;_;
 
Last edited by a moderator:

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,158
First Language
English
Primarily Uses
N/A
It's the same for me. The notetag loading doesn't occur unless the database is fully loaded. Also, the methods to load the notetags won't load multiple instances of the data. Nothing gets added multiple times over.
I don't see anything stopping it from going through looking for notetags on every database item again every time the original aliased isDatabaseLoaded() function returns true, however. Everytime isDatabaseLoaded() gets called with the quoted code, your functions will look through the $data* objects for notetags as there's no internal check to see if notetags have already been loaded.

I must also insist that there shouldn't be functions that read/alter data within a function like isDatabaseLoaded(), as its function name implies it returns true or false depending on the database status. Having data altering code in it isn't a good idea in general.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,791
Reaction score
943
First Language
Chinese
Primarily Uses
N/A
I don't see anything stopping it from going through looking for notetags on every database item again every time the original aliased isDatabaseLoaded() function returns true, however. Everytime isDatabaseLoaded() gets called with the quoted code, your functions will look through the $data* objects for notetags as there's no internal check to see if notetags have already been loaded.

I must also insist that there shouldn't be functions that read/alter data within a function like isDatabaseLoaded(), as its function name implies it returns true or false depending on the database status. Having data altering code in it isn't a good idea in general.
So maybe DataManager.onLoad can be a better choice? As DataManager.extractMetadata is called there(or maybe even just touch DataManager.extractMetadata directly instead):

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

Yanfly

Veteran
Joined
Mar 15, 2012
Messages
1,743
Reaction score
2,638
I don't see anything stopping it from going through looking for notetags on every database item again every time the original aliased isDatabaseLoaded() function returns true, however. Everytime isDatabaseLoaded() gets called with the quoted code, your functions will look through the $data* objects for notetags as there's no internal check to see if notetags have already been loaded.

I must also insist that there shouldn't be functions that read/alter data within a function like isDatabaseLoaded(), as its function name implies it returns true or false depending on the database status. Having data altering code in it isn't a good idea in general.
Yes, each time DataManager.isDatabaseLoaded() is called, it will preload those notetags and overwrite the existing notetag data. This is intended on my part. This is done twice because at times, $data_ arrays are sometimes rewritten over and added data isn't retained.

So maybe DataManager.onLoad can be a better choice? As DataManager.extractMetadata is called there(or maybe even just touch DataManager.extractMetadata directly instead):

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; if (data && data.note !== undefined) { this.extractMetadata(data); } } }};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; } }};



I'm assuming this message is directed at me? If it is, my response is the same as here: http://forums.rpgmakerweb.com/index.php?/topic/45412-community-core-script/?p=462359

In particular this response:

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

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,158
First Language
English
Primarily Uses
N/A
I see no reason to put the notetag reads in the function isDatabaseLoaded(), however. Why not in, say, Scene_Boot.terminate? isDatabaseLoaded() is for running checks to see whether the db objects have loaded; it should not contain transactional logic like this. It's not a huge compatibility issue for me, but it will be for others. It's the wrong place to put it.
 

Yanfly

Veteran
Joined
Mar 15, 2012
Messages
1,743
Reaction score
2,638
I see no reason to put the notetag reads in the function isDatabaseLoaded(), however. Why not in, say, Scene_Boot.terminate? isDatabaseLoaded() is for running checks to see whether the db objects have loaded; it should not contain transactional logic like this. It's not a huge compatibility issue for me, but it will be for others. It's the wrong place to put it.
I've used Scene_Boot.terminate() before. However, this is the main problem.

Scene_Boot.prototype.start = function() { Scene_Base.prototype.start.call(this); SoundManager.preloadImportantSounds(); if (DataManager.isBattleTest()) { DataManager.setupBattleTest(); SceneManager.goto(Scene_Battle); } else if (DataManager.isEventTest()) { DataManager.setupEventTest(); SceneManager.goto(Scene_Map); } else { this.checkPlayerLocation(); DataManager.setupNewGame(); SceneManager.goto(Scene_Title); Window_TitleCommand.initCommandPosition(); } this.updateDocumentTitle();};In setting up the battle test, new games, etc. there are instances where notetags aren't loaded yet, thus, inconsistencies and errors occur.

And as far as compatibility issues go, I fail to see where the compatibility issues will arise unless someone intends to completely rewrite the isDatabaseLoaded function. If that was the case, there'd be more problems than just compatibility issues alone.

When notedata is preloaded, it doesn't add upon itself, but rather, overwrites itself and does not affect anything else but its own intended changes. Though, if this is what's causing incompatibilities, please enlighten me as to how it's causing them and what it's making your plugin(s) doing differently than intended.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,791
Reaction score
943
First Language
Chinese
Primarily Uses
N/A
Yes, each time DataManager.isDatabaseLoaded() is called, it will preload those notetags and overwrite the existing notetag data. This is intended on my part. This is done twice because at times, $data_ arrays are sometimes rewritten over and added data isn't retained.

I'm assuming this message is directed at me? If it is, my response is the same as here: http://forums.rpgmakerweb.com/index.php?/topic/45412-community-core-script/?p=462359

In particular this response:

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.
Yeah, and I'm also thinking about these issues too, as I'm comparing between DataManager.isDatabaseLoaded and DataManager.extractMetadata.

Right now, what I can see is this(I'm trying to figure out the full picture):

Extreme case 1 - Only 1 datatype has notetags

Example:

Using DataManager.extractMetadata -

AuthorName.PluginName.DataManager_loadDataFile = DataManager.loadDataFile;DataManager.loadDataFile = function(name, src) { this._pluginNameSrc = src; // Added to mark the current source file name AuthorName.PluginName.DataManager_loadDataFile.call(this, name, src);}; // DataManager.loadDataFileAuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { this._pluginNameSrc = undefined; // Added return AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this);}; // DataManager.isDatabaseLoadedAuthorName.PluginName.DataManager_extractMetadata = DataManager.extractMetadata;DataManager.extractMetadata = function(data) { AuthorName.PluginName.DataManager_extractMetadata.call(this, data); // Added to load all skill notetags if the current source file is Skills if (this._pluginNameSrc.match(/Skills/)) { this.loadPluginNameSkillNotes(data); } //}; // DataManager.extractMetadataUsing DataManager.isDatabaseLoaded -

AuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { // Rewritten if (!AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this)) { return false; } this.loadAllPluginNameNotes(); return true; //}; // DataManager.isDatabaseLoadedDataManager.loadAllPluginNameNotes = function() { // New $dataSkills.forEach(function(skill) { if (skill) { this.loadPluginNameSkillNotes(skill); } }, this);} // DataManager.loadAllPluginNameNotes
Extreme case 2 - All datatype has different notetags needing different notetag reading functions

Example:

Using DataManager.extractMetadata -

AuthorName.PluginName.DataManager_loadDataFile = DataManager.loadDataFile;DataManager.loadDataFile = function(name, src) { this._pluginNameSrc = src; // Added to mark the current source file name AuthorName.PluginName.DataManager_loadDataFile.call(this, name, src);}; // DataManager.loadDataFileAuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { this._pluginNameSrc = undefined; // Added return AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this);}; // DataManager.isDatabaseLoadedAuthorName.PluginName.DataManager_extractMetadata = DataManager.extractMetadata;DataManager.extractMetadata = function(data) { AuthorName.PluginName.DataManager_extractMetadata.call(this, data); // Added to load each data type notetag via its own notetag reading function this.loadAllPluginNameNotes(data); //}; // DataManager.extractMetadataDataManager.loadAllPluginNameNotes = function(data) { // New if (this._pluginNameSrc.match(/Actors/)) { this.loadPluginNameActorNotes(data); } else if (this._pluginNameSrc.match(/Classes/)) { this.loadPluginNameClassNotes(data); } else if (this._pluginNameSrc.match(/Skills/)) { this.loadPluginNameSkillNotes(data); } else if (this._pluginNameSrc.match(/Items/)) { this.loadPluginNameItemNotes(data); } else if (this._pluginNameSrc.match(/Weapons/)) { this.loadPluginNameWeaponNotes(data); } else if (this._pluginNameSrc.match(/Armors/)) { this.loadPluginNameArmorNotes(data); } else if (this._pluginNameSrc.match(/Enemies/)) { this.loadPluginNameEnemyNotes(data); } else if (this._pluginNameSrc.match(/Troops/)) { this.loadPluginNameTroopNotes(data); } else if (this._pluginNameSrc.match(/States/)) { this.loadPluginNameStateNotes(data); } else if (this._pluginNameSrc.match(/Animations/)) { this.loadPluginNameAnimationNotes(data); } else if (this._pluginNameSrc.match(/Tilesets/)) { this.loadPluginNameTilesetNotes(data); } else if (this._pluginNameSrc.match(/CommonEvents/)) { this.loadPluginNameCommonEventNotes(data); } else if (this._pluginNameSrc.match(/System/)) { this.loadPluginNameSystemNotes(data); } else if (this._pluginNameSrc.match(/MapInfos/)) { this.loadPluginNameMapInfoNotes(data); }}; // DataManager.loadAllPluginNameNotesUsing DataManager.isDatabaseLoaded -

AuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { // Rewritten if (!AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this)) { return false; } this.loadAllPluginNameNotes(); return true; //}; // DataManager.isDatabaseLoadedDataManager.loadAllPluginNameNotes = function() { // New $dataActors.forEach(function(actor) { if (actor) { this.loadPluginNameSkillNotes(actor); } }, this); $dataClasses.forEach(function(class) { if (class) { this.loadPluginNameClassNotes(class); } }, this); $dataSkills.forEach(function(skill) { if (skill) { this.loadPluginNameSkillNotes(skill); } }, this); $dataItems.forEach(function(item) { if (item) { this.loadPluginNameItemNotes(item); } }, this); $dataWeapons.forEach(function(weapon) { if (weapon) { this.loadPluginNameWeaponNotes(weapon); } }, this); $dataArmors.forEach(function(armor) { if (armor) { this.loadPluginNameArmorNotes(armor); } }, this); $dataEnemies.forEach(function(enemy) { if (enemy) { this.loadPluginNameEnemyNotes(enemy); } }, this); $dataTroops.forEach(function(troop) { if (troop) { this.loadPluginNameTroopNotes(troop); } }, this); $dataStates.forEach(function(state) { if (state) { this.loadPluginNameStateNotes(state); } }, this); $dataAnimations.forEach(function(animation) { if (animation) { this.loadPluginNameAnimationNotes(animation); } }, this); $dataTilesets.forEach(function(tileset) { if (tileset) { this.loadPluginNameTilesetNotes(tileset); } }, this); $dataCommonEvents.forEach(function(commonEvent) { if (commonEvent) { this.loadPluginNameCommonEventNotes(commonEvent); } }, this); $dataSystem.forEach(function(system) { if (system) { this.loadPluginNameSystemNotes(system); } }, this); $dataMapInfos.forEach(function(mapInfo) { if (mapInfo) { this.loadPluginNameMapInfoNotes(mapInfo); } }, this);} // DataManager.loadAllPluginNameNotes
While I personally prefer to use DataManager.isDatabaseLoaded, if that's really proven to be absolutely 100% evil under any possible circumstance, I'll switch to use DataManager.extractMetadata instead :)

P.S.: I somehow suspect that DataManager.isDatabaseLoaded is the only timing that can be used to load custom plugin notetags conveniently, even though it's supposed to be referentially transparent(no side effects). If that's the case, then the issue might lie in the very default RMMV codebase itself, as violating the referential transparency in DataManager.isDatabaseLoaded would be the best balance for we plugin developers in this case. Of course, that's just my wild guess :D
 
Last edited by a moderator:

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,158
First Language
English
Primarily Uses
N/A
I received this report of an error occurring, which is what got me onto this topic: http://forums.rpgmakerweb.com/index.php?/topic/46515-preload-manager/?p=510196

Based on your code the error shouldn't really happen (it seems like one of the $data* arrays are nil in this example), so I'm not saying that the notetag reading being placed in the isDatabaseLoaded() function necessarily is the culprit, but it made me aware of it and I just see it as bad practice to put data altering code into a function meant to simply read the status of file loading. As you've seen I call this function repeatedly until I can ensure that the database is fully loaded, and I figure it's likely that many other plugins will do this too (it's why it's there), which means your notetags will be read over and over perhaps dozens of time on startup.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,791
Reaction score
943
First Language
Chinese
Primarily Uses
N/A
I received this report of an error occurring, which is what got me onto this topic: http://forums.rpgmakerweb.com/index.php?/topic/46515-preload-manager/?p=510196

Based on your code the error shouldn't really happen (it seems like one of the $data* arrays are nil in this example), so I'm not saying that the notetag reading being placed in the isDatabaseLoaded() function necessarily is the culprit, but it made me aware of it and I just see it as bad practice to put data altering code into a function meant to simply read the status of file loading. As you've seen I call this function repeatedly until I can ensure that the database is fully loaded, and I figure it's likely that many other plugins will do this too (it's why it's there), which means your notetags will be read over and over perhaps dozens of time on startup.
Then Yanfly might do something like this to stick with his/her way:

AuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { // Rewritten if (!AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this)) { return false; } if (!this._isPluginNameNotesLoaded) { this.loadAllPluginNameNotes(); } return this._isPluginNameNotesLoaded; //}; // DataManager.isDatabaseLoadedDataManager.loadAllPluginNameNotes = function() { // New // The notetag reading codes go here // this._isPluginNameNotesLoaded = true;} // DataManager.isDatabaseLoaded
Of course he/she will have to be 100% sure that his/her notetag reading codes will always work as intended :)
 
Last edited by a moderator:

Yanfly

Veteran
Joined
Mar 15, 2012
Messages
1,743
Reaction score
2,638
Yeah, and I'm also thinking about these issues too, as I'm comparing between DataManager.isDatabaseLoaded and DataManager.extractMetadata.

Right now, what I can see is this(I'm trying to figure out the full picture):

Extreme case 1 - Only 1 datatype has notetags

Example:

Using DataManager.extractMetadata -

AuthorName.PluginName.DataManager_loadDataFile = DataManager.loadDataFile;DataManager.loadDataFile = function(name, src) { this._pluginNameSrc = src; // Added to mark the current source file name AuthorName.PluginName.DataManager_loadDataFile.call(this, name, src);}; // DataManager.loadDataFileAuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { this._pluginNameSrc = undefined; // Added return AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this);}; // DataManager.isDatabaseLoadedAuthorName.PluginName.DataManager_extractMetadata = DataManager.extractMetadata;DataManager.extractMetadata = function(data) { AuthorName.PluginName.DataManager_extractMetadata.call(this, data); // Added to load all skill notetags if the current source file is Skills if (this._pluginNameSrc.match(/Skills/)) { this.loadPluginNameSkillNotes(data); } //}; // DataManager.extractMetadataUsing DataManager.isDatabaseLoaded -

AuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { // Rewritten if (AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this)) { return false; } this.loadAllPluginNameNotes(); return true; //}; // DataManager.isDatabaseLoadedDataManager.loadAllPluginNameNotes = function() { // New $dataSkills.forEach(function(skill) { if (skill) { this.loadPluginNameSkillNotes(skill); } }, this);} // DataManager.loadAllPluginNameNotes
Extreme case 2 - All datatype has different notetags needing different notetag reading functions

Example:

Using DataManager.extractMetadata -

AuthorName.PluginName.DataManager_loadDataFile = DataManager.loadDataFile;DataManager.loadDataFile = function(name, src) { this._pluginNameSrc = src; // Added to mark the current source file name AuthorName.PluginName.DataManager_loadDataFile.call(this, name, src);}; // DataManager.loadDataFileAuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { this._pluginNameSrc = undefined; // Added return AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this);}; // DataManager.isDatabaseLoadedAuthorName.PluginName.DataManager_extractMetadata = DataManager.extractMetadata;DataManager.extractMetadata = function(data) { AuthorName.PluginName.DataManager_extractMetadata.call(this, data); // Added to load each data type notetag via its own notetag reading function this.loadAllPluginNameNotes(data); //}; // DataManager.extractMetadataDataManager.loadAllPluginNameNotes = function(data) { // New if (this._pluginNameSrc.match(/Actors/)) { this.loadPluginNameActorNotes(data); } else if (this._pluginNameSrc.match(/Classes/)) { this.loadPluginNameClassNotes(data); } else if (this._pluginNameSrc.match(/Skills/)) { this.loadPluginNameSkillNotes(data); } else if (this._pluginNameSrc.match(/Items/)) { this.loadPluginNameItemNotes(data); } else if (this._pluginNameSrc.match(/Weapons/)) { this.loadPluginNameWeaponNotes(data); } else if (this._pluginNameSrc.match(/Armors/)) { this.loadPluginNameArmorNotes(data); } else if (this._pluginNameSrc.match(/Enemies/)) { this.loadPluginNameEnemyNotes(data); } else if (this._pluginNameSrc.match(/Troops/)) { this.loadPluginNameTroopNotes(data); } else if (this._pluginNameSrc.match(/States/)) { this.loadPluginNameStateNotes(data); } else if (this._pluginNameSrc.match(/Animations/)) { this.loadPluginNameAnimationNotes(data); } else if (this._pluginNameSrc.match(/Tilesets/)) { this.loadPluginNameTilesetNotes(data); } else if (this._pluginNameSrc.match(/CommonEvents/)) { this.loadPluginNameCommonEventNotes(data); } else if (this._pluginNameSrc.match(/System/)) { this.loadPluginNameSystemNotes(data); } else if (this._pluginNameSrc.match(/MapInfos/)) { this.loadPluginNameMapInfoNotes(data); }}; // DataManager.loadAllPluginNameNotesUsing DataManager.isDatabaseLoaded -

AuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { // Rewritten if (AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this)) { return false; } this.loadAllPluginNameNotes(); return true; //}; // DataManager.isDatabaseLoadedDataManager.loadAllPluginNameNotes = function() { // New $dataActors.forEach(function(actor) { if (actor) { this.loadPluginNameSkillNotes(actor); } }, this); $dataClasses.forEach(function(class) { if (class) { this.loadPluginNameClassNotes(class); } }, this); $dataSkills.forEach(function(skill) { if (skill) { this.loadPluginNameSkillNotes(skill); } }, this); $dataItems.forEach(function(item) { if (item) { this.loadPluginNameItemNotes(item); } }, this); $dataWeapons.forEach(function(weapon) { if (weapon) { this.loadPluginNameWeaponNotes(weapon); } }, this); $dataArmors.forEach(function(armor) { if (armor) { this.loadPluginNameArmorNotes(armor); } }, this); $dataEnemies.forEach(function(enemy) { if (enemy) { this.loadPluginNameEnemyNotes(enemy); } }, this); $dataTroops.forEach(function(troop) { if (troop) { this.loadPluginNameTroopNotes(troop); } }, this); $dataStates.forEach(function(state) { if (state) { this.loadPluginNameStateNotes(state); } }, this); $dataAnimations.forEach(function(animation) { if (animation) { this.loadPluginNameAnimationNotes(animation); } }, this); $dataTilesets.forEach(function(tileset) { if (tileset) { this.loadPluginNameTilesetNotes(tileset); } }, this); $dataCommonEvents.forEach(function(commonEvent) { if (commonEvent) { this.loadPluginNameCommonEventNotes(commonEvent); } }, this); $dataSystem.forEach(function(system) { if (system) { this.loadPluginNameSystemNotes(system); } }, this); $dataMapInfos.forEach(function(mapInfo) { if (mapInfo) { this.loadPluginNameMapInfoNotes(mapInfo); } }, this);} // DataManager.loadAllPluginNameNotes
While I personally prefer to use DataManager.isDatabaseLoaded, if that's really proven to be absolutely 100% evil under any possible circumstance, I'll switch to use DataManager.extractMetadata instead :)

P.S.: I somehow suspect that DataManager.isDatabaseLoaded is the only timing that can be used to load custom plugin notetags conveniently, even though it's supposed to be referentially transparent(no side effects). If that's the case, then the issue might lie in the very default RMMV codebase itself, as violating the referential transparency in DataManager.isDatabaseLoaded would be the best balance for we plugin developers in this case. Of course, that's just my wild guess :D

In the times I've made the shifts regarding notetag loading, this is what I've came up with:

  • DataManager.extractMetaData fails to distinguish types of data.
  • DataManager.onLoad loads strictly in the order of actors, classes, skills, items, weapons, armors, enemies, troops, states, animations, tilesets, common events, system, and types. This becomes a problem when you need an actor notetag to reference something in say, an enemy notetag.
  • Scene_Boot.start is a no go for me because some plugins completely overwrite it.
  • Scene_Boot.create also gets overwritten in some plugins.
  • Scene_Boot.terminate occurs too late, in some instances where functions that fun in Scene_Boot.start already occur and require the note data.
So yes, you're right in that RPG Maker MV doesn't have a reliable location to safely load up custom notetag data. DataManager.postDatabaseLoaded would have been lovely if it existed. For that reason, I figured the earliest and safest place to load notetag data is within DataManager.isDatabaseLoaded where it will most likely not be overwritten.

I received this report of an error occurring, which is what got me onto this topic: http://forums.rpgmakerweb.com/index.php?/topic/46515-preload-manager/?p=510196

Based on your code the error shouldn't really happen (it seems like one of the $data* arrays are nil in this example), so I'm not saying that the notetag reading being placed in the isDatabaseLoaded() function necessarily is the culprit, but it made me aware of it and I just see it as bad practice to put data altering code into a function meant to simply read the status of file loading. As you've seen I call this function repeatedly until I can ensure that the database is fully loaded, and I figure it's likely that many other plugins will do this too (it's why it's there), which means your notetags will be read over and over perhaps dozens of time on startup.
The error most likely came from the person tampering with the JSON file as there should be a notedata entry for each database entry.

And what you consider to be bad practice, I consider to be perfectly fine. isDatabaseLoaded() should return true or false depending on if the entirity of the database is completely loaded, is it not? To me, I deem that the database is not completely loaded unless the notetag data within it is loaded and parsed. So unless my notetags, which I deem to be part of each and every database entry's data, are loaded, isDatabaseLoaded() returning true/false without my notetags loaded in there is delivering false information. If you are able to suggest a better timing for me to load notetags without encountering any of the above listed problems, I'll see to your suggestion.

And no, not really. I estimate that a good 99.99% of the plugins created now and within the future will not run DataManager.isDatabaseLoaded() any time past the initial opening steps. It's a one-to-two time run at best. This is because once the database is loaded, there is no further reason to check it again mid-game to see if it has been loaded.

 

Then Yanfly might do something like this to stick with his/her way:

AuthorName.PluginName.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() {

// Rewritten

if (!AuthorName.PluginName.DataManager_isDatabaseLoaded.call(this)) {

return false;

}

if (!this._isPluginNameNotesLoaded) {

this.loadAllPluginNameNotes();

}

return this._isPluginNameNotesLoaded;

//

}; // DataManager.isDatabaseLoaded

DataManager.loadAllPluginNameNotes = function() { // New

// The notetag reading codes go here

//

this._isPluginNameNotesLoaded = true;

} // DataManager.isDatabaseLoaded
Of course he/she will have to be 100% sure that his/her notetag reading codes will always work as intended  :)


Not quite, I've tried that before and sometimes, $data_ arrays reset themselves to their default editor state until isDatabaseLoaded is set true indefinitely.
 
Last edited by a moderator:

LuLight

Veteran
Veteran
Joined
Oct 20, 2015
Messages
30
Reaction score
4
First Language
Thai
I remember old visual enemy have a selection window on their name

but now it only show name. please do it have window again if you think it better :)

thank you very much 
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

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.

Forum statistics

Threads
106,033
Messages
1,018,441
Members
137,820
Latest member
georg09byron
Top