RPG Maker MV
This script powers most of the scripts I've written. In most cases, the use of this script is optional, as I'll always try to find a fallback, but it does make things a bit less complicated.
Download (10.07 kB, 5 times downloaded)
Just put this script as high as possible. You can also use this library for your own projects.
All functions are accessible through the CXJScripts.CXJCore namespace by default. You can always change this, either by altering the settings, or by essentially set it as the value of a variable in case you're writing your own plugin that's using this as a basis.
This allows you to set a custom namespace for the plugin to load from. This can be especially useful when running certain commands from event scripts and the likes, although they're a lot less useful for custom scripts.
This retrieves the parameters for the current plugin. It essentially is an extension to the existing PluginManager function. First, it calls PluginManager.parameters to retrieve the parameters in the old-fashioned way. If it can't find the parameters, it falls back to document.currentScript, which essentially gets the current script file name. This does not work on Internet Explorer, so as a final resort it checks all settings for each plugin and compares it to the object given in defaultParameters. If it finds a complete match, it'll return these parameters. Finally, if it still fails to find the plugin settings, it will use the defaultParameters object as the parameters.
|pluginName||The name of the plugin|
|defaultParameters||The default parameters|
Returns: An object containing every parameter, or defaultParameters if it can't find it.