Editing js files directly vs cluttering the noteboxes

The situation is that, sometimes you want some notetags to store javascript codes directly, or at least the names of some javascript functions that will be bound to the appropriate contexts upon being called.

The constraint is that, all notetag values should be read upon game start.

Storing javascript codes directly

Spoiler
For example, these notetags in the lunatic mode of Yanfly Engine Plugins - Battle System - Active Turn Battle needs users to write javascript codes to be used via eval():

Yanfly's lunatic mode's supposed to be for advanced users that can write codes themselves:

Skill and Item Notetags:<Target ATB Eval>speed = x;charge = x;</Target ATB Eval>You can omit speed and/or charge. Whatever you set ‘speed’ to will change the ATB speed of the target. If the target is charging, ‘charge’ will cause the target’s charge to change to that value. To make things more simple, ‘max’ will be the full gauge value.Here is an example:<Target ATB Eval>speed = target.hp / target.mhp * max;charge = target.hp / target.mhp * max;</Target ATB Eval>The above code will set the user’s current ATB gauge to position equal to the target’s HP ratio. If the target has 25% HP, the ATB gauge will go to 25% full for the target.— — — — —<After ATB Eval>speed = x;</After ATB Eval>This is the ATB set after the user has used the skill/item and the custom ATB amount you want the user to be at after. ‘max’ be the value of the full gauge value. Whatever you set ‘speed’, the user’s ATB speed value will change to that much:Here is an example:<After ATB Eval>speed = user.mp / user.mmp * max;</After ATB Eval>The above code will set the user’s ATB gauge after using the skill/item to equal the user’s MP ratio. If the user has 25% MP, the ATB gauge will go to 25% full for the user.— — — — —<ATB Interrupt Eval>interrupt = true;</ATB Interrupt Eval>This will allow you to set custom conditions for interrupting a target. Keep in mind that even though it is a custom condition, it still requires the target to be in the charging phase for the interrupt to work. By setting ‘interrupt = true’, the target will be interrupted.Here is an example:<ATB Interrupt Eval>if (user.hp > target.hp) { interrupt = true;}</ATB Interrupt Eval>The above code will state that if the user has more HP than the target, the target will be interrupted.
While users don't have to edit any js file directly, it should be crystal clear and obvious that, if some users uses all those notetags for the same skill/item, and all those notetags store exceptionally long javascript codes, the notebox can be cluttered by them badly.

Also, there can be some cases where many skills/items are using the exact same javascript codes, or at least the major parts of them are exactly the same javascript codes. When users want to change those commonly shared parts, they'll have to change them in all those skills/items.


Storing the names of some javascript functions

Spoiler
For example, the setup of DoubleX RMMV State Triggers(Its purpose's to let users sets some states to trigger some additional effects under some timings when some conditions are met) is this:

Each state can have as many <timing state trigger: STCX, STAX> notetags as users want, and all those notetags will be effective:

* # State Notetags: * 1. <timing state trigger: STCX, STAX> * - Sets a state to trigger STAX when timing and STCX are met * - timing can be add, turn, remove or custom timings set by you * - add means the state's just added * - turn means the state's remaining turn's just reduced by 1 * - remove means the state's just removed * - timing must only consist of alphanumeric characters * - STCX can be set in State Trigger Condition Functions * - STAX can be set in State Trigger Action Functions The below part can only be accessed by opening the plugin js file directly:

/*------------------------------------------------------------------------ * State Trigger Condition Functions * - Setups STCX used by this script's notetags *------------------------------------------------------------------------*/ /* STCX are used at: 1. Game_BattlerBase - if (st[trigger[0]].call(this)) { in exec_state_triggers STCX are Javascript functions which will be bound to the battler upon use STCX names can only use alphanumeric characters The below STCX are examples added to help you set your STCX You can freely use, rewrite and/or delete these examples */ // Sets the state trigger condition as always true STC1: function() { return true; }, // Sets the state trigger condition as needing switch with id x to be on STC2: function() { return $gameSwitches.value(x); }, // Adds new STCX here /*------------------------------------------------------------------------ * State Trigger Action Values * - Setups STAX used by this script's notetags *------------------------------------------------------------------------*/ /* STAX are used at: 1. Game_BattlerBase - st[trigger[1]].call(this); in exec_state_triggers STAX are Javascript functions which will be bound to the battler upon use STAX names can only use alphanumeric characters The below STAX are examples added to help you set your STAX You can freely use, rewrite and/or delete these examples */ // Sets the state trigger action as what Special Effect Escape does STA1: function() { this.hide(); }, // Sets the state trigger action as setting the battler's hp to full STA2: function() { this._hp = this.mhp; }, // Adds new STAX here
Note that decent Javascript coding proficiency(experienced Javascript plugin developers having written dozens of decent plugins and a solid understanding to the default RMMV codebase) is needed to fully utilize this plugin.

Off topic:

Spoiler
Fully comprehending this plugin actually just need some Javascript coding proficiency(inexperienced Javascript plugin developers having written few easy, simple and small plugins and a basic knowledge to the default RMMV codebase). It's one of those rare plugins where fully comprehending them is in fact easier than fully utilizing them.

In this case, this plugin still has its values, because:

- For those who can write such state triggers themselves from scratch(by writing some snippets of course), if they end up writing lots of those state triggers, they'll want to write a plugin that can manage all such state triggers systematically, which will likely lead to one that's similar to this plugin. So this plugin can save them from having to write such plugins themselves.

- For those having just little(beginning Javascript coders having written and read the most rudimentary codes) to no Javascript coding proficiency at all, they can still ask for help to get their desired state triggers.
Users can use some STCX and STAX as building blocks to form complete STCX and STAX that will be actually used by notetags to(with the cost of added function calls) ensure all STCX and STAX are written in a modular fashion(that's also the reason to separate conditions from actions) and promote reusing codes(thus conforming to Don't Repat Yourself). Also, when many notetags use the same STCX/STAX and users want to change those STCX/STAX, they can just change those STCX/STAX directly instead of changing every of those notetags(The same applies to many complete STCX/STAX using the same STCX/STAX building blocks).

However, they'll have to edit the plugin js file directly(unless users can add new params in the plugin manager directly), because the number of params in the plugin manager can't be edited from there directly, meaning that:

- If I provide hundreds of STCX and STAX in the plugin manger directly to ensure all users will always have enough STCX and STAX to use(1 user I know is indeed using hundreds of STAX and none of them are modular nor reusable at all), it'll effectively kill user-friendliness by bloating the plugin manager.

- If I provide just dozens of STCX and STAX in the plugin manager directly to ensure they won't bloat the plugin manager and hence effectively kill user-friendliness, the plugin will fail to serve its purposes for those who do need lots of STCX and/or STAX(even if they totally abandon code modularity to reduce the number of STCX and/or STAX needed).

On a side note: If users have to add more params in the plugin js file directly in order to use more STCX/STAX, it'll just defeat the purpose for using params in the plugin manager in the first place. In this case, I think the current setup is actually easier, simpler and more user-friendly.

Note that the point here is that users now have to edit js files. It still applies even if that files isn't the plugin itself as that's the point of using plugin manager in RMMV in the first place.


Exchanging the above setups

Spoiler
If Yanfly Engine Plugins - Battle System - Active Turn Battle used the DoubleX RMMV State Triggers setup, the lunatic part would be something like this:

Skill and Item Notetags:<Target ATB Function: TATBX>You can omit speed and/or charge. Whatever you set ‘speed’ to will change the ATB speed of the target. If the target is charging, ‘charge’ will cause the target’s charge to change to that value. To make things more simple, ‘max’ will be the full gauge value.TATBX is the name of a javascript function under Target ATB Notetag Function, which can only be accessed by opening the plugin js file directly— — — — —<After ATB Function: AATBX>This is the ATB set after the user has used the skill/item and the custom ATB amount you want the user to be at after. ‘max’ be the value of the full gauge value. Whatever you set ‘speed’, the user’s ATB speed value will change to that much:AATBX is the name of a javascript function under After ATB Notetag Function, which can only be accessed by opening the plugin js file directly<ATB Interrupt Function: ATBIX>This will allow you to set custom conditions for interrupting a target. Keep in mind that even though it is a custom condition, it still requires the target to be in the charging phase for the interrupt to work. By setting ‘interrupt = true’, the target will be interrupted.ATBIX is the name of a javascript function under ATB Interrupt Notetag Function, which can only be accessed by opening the plugin js file directlyThe below part can only be accessed by opening the plugin js file directly:

/*------------------------------------------------------------------------ * Target ATB Notetag Functions * - Setups TATBX used by <Target ATB Function: TATBX> *------------------------------------------------------------------------*/ // Adds new TATBX here /*------------------------------------------------------------------------ * After ATB Notetag Functions * - Setups AATBX used by <After ATB Function: AATBX> *------------------------------------------------------------------------*/ // Adds new AATBX here /*------------------------------------------------------------------------ * ATB Interrupt Notetag Functions * - Setups ATBIX used by <ATB Interrupt Function: ATBIX> *------------------------------------------------------------------------*/ // Adds new ATBIX here
Users would have to edit the plugin js file directly to use those notetags, but they could write modular notetag values that can be effortlessly reused, thus avoiding repetitive typing and preventing them from cluttering the noteboxes.

If DoubleX RMMV State Triggers used the Yanfly Engine Plugins - Battle System - Active Turn Battle setup, it would be something like this:

Spoiler
* # State Notetags: * 1. <timing state trigger> * Javascript codes * </timing state trigger> * - Sets a state to run Javascript codes when timing's met * - timing can be add, turn, remove or custom timings set by you * - add means the state's just added * - turn means the state's remaining turn's just reduced by 1 * - remove means the state's just removed * - timing must only consist of alphanumeric characters * - Javascript codes will be evaluated using eval()
Users wouldn't have to edit any js file directly to use that notetag, but they couldn't write modular nor reusable codes in that notetag(especially if they need to write some long Javascript codes), thus being likely prone to cluttering the noteboxes and changing the same Javascript codes repetitively.


The above examples showed what this topic's about: Editing js files directly vs cluttering the noteboxes.

If it's indeed a false dilemma, like it might turn out that users do have ways to add params in the plugin manager directly, I'd like to know some setups that can let users write modular and reusable javascript codes(to avoid cluttering the noteboxes and changing the same things repetitively) as notetag values without forcing them to edit any js file directly.

If it's indeed a true dilemma, which of the aforementioned setups will you choose if you had to? I want you to answer this as both plugin developers and users.
Instead of having to directly edit the plugin file, i would prefer those functions to be created in a different plugin (listed ABOVE your plugin) and made public, so you can execute them via eval. A different solution would be to create a function container that can be filled in a different plugin (listed UNDER your plugin), like this:

Plugin:

var stateTriggers = {};    // Public available, should be wrapped in your public namespace/class, but i'll keep the demo simple. Configuration:

statetrigger.STC1 = function() {    // ...}; This has the added benefit, that line numbers in thrown errors won't get messed up by user edits and cleanly separates logic and configuration. The drawback is, that you can't directly use the functions, since they aren't available at startup time and need to outsource some part of your initialization into Scene_Boot or the DataManager.
Instead of having to directly edit the plugin file, i would prefer those functions to be created in a different plugin (listed ABOVE your plugin) and made public, so you can execute them via eval. A different solution would be to create a function container that can be filled in a different plugin (listed UNDER your plugin), like this:

Plugin:

var stateTriggers = {};    // Public available, should be wrapped in your public namespace/class, but i'll keep the demo simple. Configuration:

statetrigger.STC1 = function() {    // ...}; This has the added benefit, that line numbers in thrown errors won't get messed up by user edits and cleanly separates logic and configuration. The drawback is, that you can't directly use the functions, since they aren't available at startup time and need to outsource some part of your initialization into Scene_Boot or the DataManager.
I think I've to clarify that a main point of this topic is not to edit any js files, not just the plugin itself(That's the point of using plugin manager in RMMV in the first place right?). Anyway, that's 100% my fault for not making this explicit enough XD

While I don't think I get how your setup works yet(Any ideal solution here should let users write modular and reusable Javascript codes as notetag values without forcing them to editing any js file directly), it inspired me to think of this insane one:

Spoiler
* @param all_stcx * @desc Setups all stcx functions under DoubleX_RMMV.State_Triggers * @default * var st = DoubleX_RMMV.State_Triggers; * st.STC1 = function() { * // Write the function contents here * }; * st.STC2 = function() { * // Write the function contents here * }; * st.STC3 = function() { * // Write the function contents here * }; * st.STCN = function() { * // Write the function contents here * }; * * @param all_stax * @desc Setups all stax functions under DoubleX_RMMV.State_Triggers * @default * var st = DoubleX_RMMV.State_Triggers; * st.STA1 = function() { * // Write the function contents here * }; * st.STA2 = function() { * // Write the function contents here * }; * st.STA3 = function() { * // Write the function contents here * }; * st.STAN = function() { * // Write the function contents here * };
While users can write modular and reusable Javascript codes as notetag values and won't have to edit any plugin js files directly, all_stcx and all_stax will be ridiculously long lol
In this case, you should probably receive the file path to a js file as plugin parameter and load that, instead ^^
In this case, you should probably receive the file path to a js file as plugin parameter and load that, instead ^^
Or maybe just read a separate txt file storing the configurations(but then I'll have to think where that txt should be placed). I just feel that editing txt is easier than editing js for many plugin users in RMMV communities(even though such difference doesn't exist for myself) 🙂
DO NOT edit the js files. people like me write there code in ES6 and thus tell people not to touch the js file as its compile code. Use the note box.
DO NOT edit the js files. people like me write there code in ES6 and thus tell people not to touch the js file as its compile code. Use the note box.
Right now the best compromise I can think of, after reading larva's suggestions, is to ask users to edit a separate configuration txt file.

I'll also add a new param in the plugin manager to let users specify the configuration file name(with or without extension) and path to let them decide where to place that configuration txt file, if it's indeed technically feasible.

This way, users can write modular and reusable Javascript codes as notetag values without having to edit any js file directly. The only cost is to edit a separate configuration txt file instead.

This setup also has a benefit of letting users changing the entire configuration file effortlessly and freely, thus further promoting user-friendliness.

While I'd glad that the so-called dilemma I've come up with is indeed false, I'd be even more glad to know if there's any even more ideal solutions 🙂
A text file would require you to eval() all tags or create new functions. Wouldn't it be better to directly have a js file as configuration and require() that?
A text file would require you to eval() all tags or create new functions. Wouldn't it be better to directly have a js file as configuration and require() that?
Because it seems to me that many users just don't want to edit any js file directly for whatever reasons(I think that's the main point of using plugin manger in RMMV, as separating configurations from implementations alone can already be nicely done in RMVXA via user-friendly designs), even when it can be as simple as changing the file extension as txt, editing the configurations in that txt file, and changing the file extension as js again 🙂
A text file would require you to eval() all tags or create new functions. Wouldn't it be better to directly have a js file as configuration and require() that?
Right now the best compromise I can think of, after reading larva's suggestions, is to ask users to edit a separate configuration txt file.

I'll also add a new param in the plugin manager to let users specify the configuration file name(with or without extension) and path to let them decide where to place that configuration txt file, if it's indeed technically feasible.

This way, users can write modular and reusable Javascript codes as notetag values without having to edit any js file directly. The only cost is to edit a separate configuration txt file instead.

This setup also has a benefit of letting users changing the entire configuration file effortlessly and freely, thus further promoting user-friendliness.

While I'd glad that the so-called dilemma I've come up with is indeed false, I'd be even more glad to know if there's any even more ideal solutions 🙂
this is a horrible idea. I as a user do not want to have edit some other file or the source code just to get this work. People should stop using every plugin they think is cool and awesome and instead start using only plugins there game is ACTUALLY going to use. 

Eval is hard enough to debug we don't need more of this crap.
If a plugin is useful for their games and works, people will use it. Editing a configuration file is also way more readable than a plugin parameter once the data gets complicated enough. You may argue, that the level of freedom DoubleX offers to the user is too much, but some people may like this. I personally loved the ATB for Ace, although i never got to make a real game with it.
I guess if thats what the community wants, but I wont be one who gets behind it. I will still require you to use note tags because I don't want to parse some file
Notetags are preferable when they work, but there is no "system" note field, that i know of, so general configuration will still have to be provided via plugin parameters or configuration files.
plugin paramters are what were suppose to take away the concept of editing the script or making "system" files.
If you guys wait for another week, I'll have a solution for this 🙂
can you tell us what it is?
If you guys wait for another week, I'll have a solution for this 🙂
If I've to guess, it'd be a major overhaul to the noteboxes(use common events as namespaces wrapping up functions that can be accessed by all noteboxes) and/or the plugin manager(let users add new params there directly) 🙂
That's an interesting point. I haven't thought about using a common event for global configuration stuff. Would actually be pretty easy. The only drawback is that you need to wait for the DataManager to finish loading. I've found Scene_Boot.prototype.terminate to be a good point for this, because it only executes once per game, after everything has been loaded.

/edit: This is pretty rough and could be written better, but it does the job:

Code:
(function() {        var _loadCommonEventComments = function(eventId) {        var command, event = $dataCommonEvents[eventId], notes = [];        if(!event) { return ''; }        for(var i = 0, max = event.list.length; i < max; ++i) {            if((command = event.list[i]).code === 108) {                notes.push(command.parameters[0]);                for(; (command = event.list[i+1]) && command.code === 408; ++i) {                    notes.push(command.parameters[0]);                }            }        };        return notes.join('\n');    };        Scene_Boot.prototype._iavra_alias_terminate = Scene_Boot.prototype.terminate;    Scene_Boot.prototype.terminate = function() {        this._iavra_alias_terminate();        console.log(_loadCommonEventComments(1));    };    })();
/edit: Don't know if it's faster, but this is a whole lot shorter and prettier:
Code:
var _loadCommonEventComments = function(eventId) {    var event = $dataCommonEvents[eventId];    return event === undefined ? '' : event.list        .filter(function(cmd) { return cmd.code === 108 || cmd.code === 408; })        .map(function(cmd) { return cmd.parameters[0]; }).join('\n');};
If I've to guess, it'd be a major overhaul to the noteboxes(use common events as namespaces wrapping up functions that can be accessed by all noteboxes) and/or the plugin manager(let users add new params there directly) 🙂
this is too much work for the average game developer.
this is too much work for the average game developer.
It depends on the specific implementations of using common events as plugin notetag namespaces/plugin configuration values(the same applies to letting users add new params in the plugin manager directly).

If such setups are indeed technically feasible, I'll establish those setups for the users and teach them how to use them.

In the case of using common events, maybe I'll teach them how to write js functions via comments in the common event reserved for my plugin(and teach them how to reserve that common event for my plugin) and call them in the notetags in the noteboxes to use them as notetag values. It can be something like this:

Spoiler
<plugin_name common event common_event_id><plugin name notetag name><plugin name notetag name><plugin name notetag name>...<plugin name notetag name></plugin_name common event common_event_id>
And the rest will be done by the plugins themselves.

Of course, I'll have to actually implement such setups in real plugins in order to test whether they'll be too demanding to their users 🙂

About why I'm trying to avoid forcing users to writing everything in the noteboxes and wanting to give them alternatives:

Spoiler
In RMVXA, many users complained about the noteboxes being cluttered by notetags, especially in some animated sideview battle systems, where 1 single notetag can take 100+ lines in noteboxes.

While RMMV noteboxes can be scrolled, I still won't be surprised if some users still don't want anything too long to be written in noteboxes.

Also, if many notetags use the same javascript codes as values(or share lots of common parts), when users want to change those codes, they'll have to change every notetag using those codes.

Let me quote an interesting portion of a real use case in DoubleX RMMV State Triggers:

STA4: function() { if (this._hp > 0 || this.isStateResist(this.deathStateId())) { if (this.isStateAffected(116)) { this.removeState(116); this.addState(117); } else { this.addState(116); } if (this.isStateAffected(118)) { this.removeState(118); } if (this.isStateAffected(117)) { this.addState(117); } if (this.isStateAffected(119)) { this.removeState(119); this.addState(118); } }},STA5: function() { if (this._hp > 0 || this.isStateResist(this.deathStateId())) { if (this.isStateAffected(119)) { this.removeState(120); this.addState(121); } else { this.addState(120); } if (this.isStateAffected(122)) { this.removeState(122); } if (this.isStateAffected(121)) { this.addState(121); } if (this.isStateAffected(123)) { this.removeState(123); this.addState(122); } }},STA6: function() { if (this._hp > 0 || this.isStateResist(this.deathStateId())) { if (this.isStateAffected(124)) { this.removeState(124); this.addState(125); } else { this.addState(124); } if (this.isStateAffected(126)) { this.removeState(126); } if (this.isStateAffected(125)) { this.addState(125); } if (this.isStateAffected(127)) { this.removeState(127); this.addState(126); } }},STA7: function() { if (this._hp > 0 || this.isStateResist(this.deathStateId())) { if (this.isStateAffected(128)) { this.removeState(128); this.addState(129); } else { this.addState(128); } if (this.isStateAffected(130)) { this.removeState(130); } if (this.isStateAffected(129)) { this.addState(129); } if (this.isStateAffected(131)) { this.removeState(131); this.addState(130); } }},STA8: function() { if (this._hp > 0 || this.isStateResist(this.deathStateId())) { if (this.isStateAffected(132)) { this.removeState(132); this.addState(133); } else { this.addState(132); } if (this.isStateAffected(134)) { this.removeState(134); } if (this.isStateAffected(133)) { this.addState(133); } if (this.isStateAffected(135)) { this.removeState(135); this.addState(134); } }},STA9: function() { if (this._hp > 0 || this.isStateResist(this.deathStateId())) { if (this.isStateAffected(136)) { this.removeState(136); this.addState(137); } else { this.addState(136); } if (this.isStateAffected(138)) { this.removeState(138); } if (this.isStateAffected(137)) { this.addState(137); } if (this.isStateAffected(139)) { this.removeState(139); this.addState(138); } }},STA10: function() { if (this._hp > 0 || this.isStateResist(this.deathStateId())) { if (this.isStateAffected(140)) { this.removeState(140); this.addState(141); } else { this.addState(140); } if (this.isStateAffected(142)) { this.removeState(142); } if (this.isStateAffected(141)) { this.addState(141); } if (this.isStateAffected(143)) { this.removeState(143); this.addState(142); } }},STA11: function() { if (this._hp > 0 || this.isStateResist(this.deathStateId())) { if (this.isStateAffected(144)) { this.removeState(144); this.addState(145); } else { this.addState(144); } if (this.isStateAffected(146)) { this.removeState(146); } if (this.isStateAffected(145)) { this.addState(145); } if (this.isStateAffected(147)) { this.removeState(147); this.addState(146); } }},
That's ridiculously extreme right? But it's indeed a real use case after all. Given that that use case also has 500+ states, think of what those state noteboxes will be if all those STAX have to be written there directly instead.

If, however, that user can use my setup well, the codes will be much, much cleaner, as they're all using the same pattern:

Spoiler
STC3: function() { return this._hp > 0 || this.isStateResist(this.deathStateId();},STA4_11: function(stateId) { if (this.isStateAffected(stateId)) { this.removeState(stateId); this.addState(stateId + 1); } else { this.addState(stateId); } if (this.isStateAffected(stateId + 2)) { this.removeState(stateId + 2); } if (this.isStateAffected(stateId + 1)) { this.addState(stateId + 1); } if (this.isStateAffected(stateId + 3)) { this.removeState(stateId + 3); this.addState(stateId + 2); }},STA4: function() { DoubleX_RMMV.State_Triggers.STA4_11.call(this, 116); },STA5: function() { DoubleX_RMMV.State_Triggers.STA4_11.call(this, 119); },STA6: function() { DoubleX_RMMV.State_Triggers.STA4_11.call(this, 124); },STA7: function() { DoubleX_RMMV.State_Triggers.STA4_11.call(this, 128); },STA8: function() { DoubleX_RMMV.State_Triggers.STA4_11.call(this, 132); },STA9: function() { DoubleX_RMMV.State_Triggers.STA4_11.call(this, 136); },STA10: function() { DoubleX_RMMV.State_Triggers.STA4_11.call(this, 140); },STA11: function() { DoubleX_RMMV.State_Triggers.STA4_11.call(this, 144); },
On a side note: That use case actually also has STA12 to STA19, with are all using a common pattern, albeit slightly different from STA4_11.

That user will just have to add STC3 into the mix in the condition values for all those notetags. The only trade-off here is the added function call.

If that user somewhow needs to change the STA4_11 pattern, he/she will just need to change that, instead of changing all STA4 to STA11, let alone changing all notetags using STA4 to STA11.

If some STA4 to STA11 need to use something out of the STA4_11 pattern, those STAX simply have to be rewritten, or even use some other patterns if available.

Unless some major overhaul to the noteboxes are done, the above modular and reusable Javascript codes as notetag values simply can't be written in the noteboxes directly.


P.S.: I've decided to let users use both : Writing Javascript codes as notetag values in the noteboxes directly, and/or writing them in somewhere else to be more modular and reusable.

Original thread: https://forums.rpgmakerweb.com/threads/editing-js-files-directly-vs-cluttering-the-noteboxes.50943/