Changing a Note Tag with a script call?

Hi there,


I am trying to cut down on the number of maps our game has in order to avoid the memory leak issue with some plugins and wondered if there is a way to change / overwrite a note tag with a script call? 
There is, but it's a bad idea.


The notetags are accessed by looking at the meta property of a data object.


You can change them simply by calling them. For example, accessing the <karma:> notetag of skill 1 and modifying it.


$dataSkills[1].meta.karma = 10; //this will set the notetag to 10, regardless of what it was previously or in editor


The problems are:


Data objects are not used per game file but rather for the game as a whole. Therefore, any modifications would impact all savefiles, not only the active one (and they wouldn't revert by loading an anterior save too).


Furthermore, data objects are not saved when the game closes, so upon restarting your game (closing and reopening the program itself) all changes would be lost.


You could theoretically deal with all those problems using a paralell common event that sets the notetags to what you want...


It's probably not worth the huge amount of problems you'll most likely create though.
@Astfgl66, thank you so much for the super detailed explanation. I appreciate it!
additionally, with a lot of plugins changing the notetag dynamically will NOT change the plugin behaviour.


Notetags are used to transfer data from the database to the plugin - and a lot of plugins only load that data on new game, store it in their variable and then never look at the notetag again.


Changing the notetag will only change the plugin that needs the notetag when the plugin checks the notetag the next time - if it never does, no change to the notetag will ever be reflected in your game, even if it successfully changed the notetag.


It is a much better approach to check the plugins for the place where they store the data they read from the notetag and change those variables directly by script commands - but that requires someone who is able to read the code of plugins to specifically check each plugin that you want to change that way.


It's still the better solution for a lot of reasons, including the problems mentioned above.

Original thread: https://forums.rpgmakerweb.com/threads/changing-a-note-tag-with-a-script-call.70855/