RMMZ Plugin Parameters: Any way to accept a Renamed File?

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
797
Reaction score
642
First Language
English
Primarily Uses
RMMV
Fossil_Pre currently scans active plugins using
Code:
Fossil.pluginNameList =  $plugins.map(a => a.status && a.name );
Unfortunately I don't really see any way around identifying which plugins are active other than filename, since there isn't a real universal way of labeling, and I have to create the list before any supported plugin executes code. If someone has a better solution I'd love to hear it, relying on filename is a bit brittle.
 
Last edited:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,052
Reaction score
5,708
First Language
English
Primarily Uses
RMVXA
In another thread someone pointed out that the Internet Explorer does not support document.currentScript (although I'm not sure how many people would still consider using that one to play Maker games).

I'd probably still consider using that code in places that are quick to find and substitute when necessary though.
Very interesting to know - so what will happen if someone tried using my plugin (code to get and use script name below), and ran the game in the latest IE? It would crash outright in the first line? It would not set the parameter correctly, causing the code to crash in the second line when it tries to access a property "max_lev" of Undefined?

Code:
wave_slates.script_name = document.currentScript.src.split('/').slice(-1)[0].slice(0,-3).replace(/\%20/g," ");
wave_slates.max_level = Number(PluginManager.parameters(wave_slates.script_name)["max_lev"]);

I assume I could do a try/catch (or an Undefined check) on the Script Name line in order to set it back to the default name as a fallback, meaning it would only cause problems when run in something like IE and the plugin is renamed.

But do you feel that Caethyril's post above offers a better solution that doesn't have this drawback or any other potential major problems?
 

casper667

Casper Gaming
Veteran
Joined
Mar 15, 2012
Messages
301
Reaction score
410
First Language
English
Primarily Uses
RMMZ
I wouldn't worry about support for IE, the default codebase doesn't support IE since IE doesn't support web assembly (effekseer) or ES6 (class syntax, arrow functions, etc).
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,052
Reaction score
5,708
First Language
English
Primarily Uses
RMVXA
I wouldn't worry about support for IE, the default codebase doesn't support IE since IE doesn't support web assembly (effekseer) or ES6 (class syntax, arrow functions, etc).
Wow, didn't realize IE was that crappy these days!! Thanks for that tip; makes me feel a lot better about the way I'm handling the possibility of people renaming the plugins. :)
 

Latest Threads

Latest Posts

Latest Profile Posts

For a long time I always consider XP soundtracks as the best one.
Just listened to some of MZ tracks from the free version.
It's... Quite mindblowing. xD
Only listened to the battles, towns, and fields.
But I'm sure the rest are equally good. :D
What do you guys want to see for the new Jump into Javascript? A continuation of the rpg_objects, or would you prefer a "lesson 0" where I go back to the absolute basics of Javascript and cover the fundamentals of the language and its construction?
Hey RPG members!!

How do you finish projects? Some new game developers start off strong but end up losing momentum. What keeps you motivated while working on new projects?
Feeling wee sleepy.. ZzzZ
So many threads to move to the right place. My post count is awesome, but 95% of it is due to moving things.

Forum statistics

Threads
112,452
Messages
1,068,383
Members
146,107
Latest member
kenjum
Top