Split Plugin into multiple Files

Is it possible to split the Code from my Plugin into multiple files?
Or maybe create multiple Plugins that work together.

Maybe something like a utility Plugin where other Plugins get their code from.

Also i wonder if its not possible how do i gain access to the Plugin Manager or the GameVariables because they are not defined in my Plugin
yes to all of this - you can check yanfly's plugins for examples how to do that.

However that is not as easy as you might think - after all there is a reason why everyone tells that the plugin order is important for yanfly's plugins.

You can access the game variables by script in the regular way in a plugin - but you need to make sure that that access only happens after the game variables are defined, not before.
And the variables (and switches and so on) are defined on a new game, they don't exist on the title screen or outside the game.
Is it possible to split the Code from my Plugin into multiple files?
Or maybe create multiple Plugins that work together.

Maybe something like a utility Plugin where other Plugins get their code from.
Yes, it's common for devs that make a lot of plugins to have a core plugin file that their other plugins require instead of copy and pasting the code in the core file into all their plugins.
Yes with regards to "splitting in multiple files".

A common way to do so, is to create a global object with your nickname and add your custom functions to it.

Code:
var IG = IG || { }; // IreaGuys

IG.shuffleArray = function(array) {
...
}

Another Plugin can now use this function like this:

Code:
var IG = IG || { };

if (!IG.shuffleArray) {
  alert("You need to import the Core Plugin ABOVE this Plugin!");
  SceneManager.exit();
}

IG.shuffleArray(...)

This way, even when a different Plugin Creator uses the name "shuffleArray" it will not interfere with your function.
Yes with regards to "splitting in multiple files".

A common way to do so, is to create a global object with your nickname and add your custom functions to it.

Code:
var IG = IG || { }; // IreaGuys

IG.shuffleArray = function(array) {
...
}

Another Plugin can now use this function like this:

Code:
var IG = IG || { };

if (!IG.shuffleArray) {
  alert("You need to import the Core Plugin ABOVE this Plugin!");
  SceneManager.exit();
}

IG.shuffleArray(...)

This way, even when a different Plugin Creator uses the name "shuffleArray" it will not interfere with your function.
Thanks i managed to get it working

Original thread: https://forums.rpgmakerweb.com/threads/split-plugin-into-multiple-files.158895/