PDA

View Full Version : Script join on layered rulesets



Ken L
January 26th, 2018, 21:13
Is it possible to 'join' scripts polymorphically?

I say this in the vein of say a 5E extension's TokenManager2 perhaps being joined with an extension's TokenManager2. This way, global variables are added or replaced with the same for function definitions to allow precise additions.

All I know is that you can replace the script entirely, but I haven't experimented with testing this layering.


My use-case is to separate out some of my personal scripts into discrete extensions. Currently I have a tangle of scripts with specific value-adds but alter the same set of files. My resolution is a dependency hierarchy with some load order detection where for extension A to work, it requires B to work, and B has logic to detect if A is loaded to add additional logic essential for A to function as B overrides the same script A would have.

I would rather have or implement some kind of 'join' feature or merge rule use akin to the XML.

Moon Wizard
January 26th, 2018, 21:33
The scripts for window classes merges and templates already do something like this, and you can use the "super" variable to go in a level, or "self" variable to reference the outermost version. However, there is not something like this for global scripts.

Regards,
JPG

Ken L
January 27th, 2018, 08:08
Seems the solution here is to perform as much as possible in a personal global script without touching a global ruleset script which I've done. I can segregate a bit more perhaps by setting up database handlers but I still need to override to prevent certain behaviors acting on those same handlers in the ruleset.