MV Plugin Order

I've been programming for quite a while and I've used RPG Maker for some time; however, I've never tried plugin development. I had looked through the documentation before on plugin order and didn't see anything particular. It doesn't seem to act like local/global. I know only to load plugins from core to derivative plugin without any firm understanding why. If the plugin load is first in, first out (FIFO) then why do plugins act unusual sometimes? If I did it using a JIT compiler or NodeJS, it is about the same. In TypeScript, I could add the files together and compile it without any issue.
  • How does order affect functions, objects, and variables?
  • Is there a way to do plugin dumps while the game is running like C++, C#, or JS?
    • Example: Load Awesome_Plugin1, Awesome_Plugin2, Awesome_Plugin3, and then drop Awesome_Plugin2
    • If I can then I can remove that unwanted variable behavior.
  • How many dependencies deep can plugins be made?
    • Example: Core plugin => Inventory plugin => Equipment plugin => Equipment customization plugin
  • Is there another tool that would help with this?
The plugins are read in order so if two plugins overwrite the same function whichever is last in your list is the one that takes effect.
I know only to load plugins from core to derivative plugin without any firm understanding why
You don't need to do that, excepting what @AquaEcho said above.

All the plugins are accumulated before their code is executed, so it's not like you'll get an error from plugin2 if it references a function from plugin3 beneath it.

If the plugin load is first in, first out (FIFO) then why do plugins act unusual sometimes?
Because of what was described above. Everything that isn't adding completely new content in a plugin is either aliasing or overwriting existing functions (the majority of what most people do).

If you have one or more plugins that alias Foo(), adding lines of code before or after calling the original saved function, then you have a plugin after that in the plugin manager that simply declares Foo() anew and overwrites it, none of those earlier plugins would do anything.

You would want the plugin that overwrites Foo() to go first, and then the plugins that alias it will be aliasing that altered version of the function.

And sometimes nothing is aliased because of how the changes need to be made, so you might have two plugins in your list that are trying to overwrite the same function - then you have plugin conflicts.

How does order affect functions, objects, and variables?
The way it affects functions was already described. It doesn't affect anything else. Unless you have some bad coding practice like two plugins that are declaring the same global variables, they could interfere with each other, but that's irrelevant to load order.

Is there a way to do plugin dumps while the game is running like C++, C#, or JS?
...this is JS? But I don't know of any way to somehow discard a portion of code during runtime.

How many dependencies deep can plugins be made?
There isn't strictly any such thing. It's not like C where you have to #include material from another header file in order for the code in this plugin to work. All code in all plugins is accessible by all others.

Those "dependencies" are just for your organizational convenience when naming them or saying what's a prerequisite for others (like Yanfly's Item Core contains the code for independent items which any of the item upgrading plugins require).

Is there another tool that would help with this?
Not that I can think of, but I think you're making this out to be much more complicated than it actually is.

Original thread: https://forums.rpgmakerweb.com/threads/plugin-order.173384/