v3.3-domains-feature-testing
Pre-releaseNSFW version
Any mod author may have one or few JContainers domains, containing only the author's data. Which in return allows us to remove domain-specific data completely and automatically when a mod gets uninstalled. It's important, as it allows to remove the objects you forgot to release, i.e. absolutely everything.
Every domain is virtual, self-sufficient copy of JContainers. You can't transport your data across domains (unless use writeToFile/readFromFile).
Basically, every user-created domain is a copy of compiled JContainers_DomainsExample.psc file and just a new, empty folder inside SKSE/Plugins/JCData/Domains/
Q: How do I create my own domain?
A: Rename JContainers_DomainsExample.psc
into AnyFilename.psc
(change script name also), compile it and distribute with your mod. Put empty AnyFilename
folder into SKSE/Plugins/JCData/Domains/. Import AnyFilename script into your scripts. Find and replace JXXX.yyyy with JXXX_yyyy. Some of the functions do not belong to any domain, and JContainers_DomainsExample.psc
won't declare them.
Q: Any example of use?
A: SilverIce/PosePicker@38d0940
Q: Drawbacks?
A: You can't easily transport a data across domains. Lack of Sublime highlighting and having to invoke domain-specific functions via Class_method
instead of Class.method
. Though it's possible to develop a mod using default context, use normal scripts and etc and then perform mass find & replace on your scripts
Q: What happens when a folder in /JCData/Domains/ doesn't exist anymore?
A: Domain with similar name won't be loaded from a save file.