forked from SilverIce/JContainers
-
Notifications
You must be signed in to change notification settings - Fork 24
Domains
Denys edited this page Sep 3, 2019
·
1 revision
The Domain is isolated, standalone sandbox, modder's personal storage of JContainers' data. The feature enables automatic removal of the data stored in a domain once a mod linked to the domain gets uninstalled. Every domain is virtual, self-sufficient copy of JContainers. You can't transport your data across domains (unless you share the data with JSON files).
- Automatic removal of JContainers' data on per-mod basis if the mod is not installed anymore. The mod stores its data in its own domain. Next time a save file loaded the domain and its data which belongs to the mod won't be loaded.
- Since modder works with his own domain this feature reduces the chances that an author will erroneously mess someone else's data. Atually there are lot of ways to make a mistake: remove some random entry from JDB, use JValue.release on a range of integer values..
- Pick an unique domain name. For example
PSM_JCDomain
. - Rename the
JContainers_DomainsExample.psc
(the file is distributed with JContainers) intoPSM_JCDomain.psc
(edit the file to change the script name also), compile the script and distribute this PSM_JCDomain.pex file with your mod. - Put an empty
PSM_JCDomain
folder intoData/SKSE/Plugins/JCData/Domains/
. Distribute the folder with your mod as well. - Import
PSM_JCDomain
script into your Papyrus scripts.
- Find and replace
JXXX.yyyy
withJXXX_yyyy
. For instance,JArray.object()
should be replaced withJArray_object()
. Note that the functions fromJContainers.psc
do not belong to any domain, and their usage should not be changed (andJContainers_DomainsExample.psc
simply doesn't declare them).
An example of Papyrus source code that enables use of domain feature - https://github.com/SilverIce/PosePicker/commit/38d09404bb8db6c8e07548650bb327a445c452fd