SKYRIM
JContainers by silvericed
Skyrim » Modders Resources and Tutorials
Added: 10/01/2014 - 10:23PM
Updated: 24/11/2016 - 11:43PM

30,311 Endorsements

3.3.0.RC.3 Latest version

289,699 Unique D/Ls

610,783 Total D/Ls

1,236,455 Total Views

Uploaded by silvericed

Description

Last updated at 23:43, 24 Nov 2016 Uploaded at 22:23, 10 Jan 2014

JContainers

The main goal of the project is to extend Papyrus with JSON-based data structures (arrays and maps).

Dynamism

If you have some programming background, you'll notice that you can not simply instantiate a class (or a script) in Papyrus. Almost everything exists in a single exemplar, except aliases and magic scripts. Papyrus arrays aren't expandable, single array can hold a values of a single type only.
JContainers brings JMaps so that you can use them the same way FO4 structures are used. Considering the ability of JArray, JFormMap, JIntMap structures to reference/contain each other - and you can build large graphs of structures.

Embeded Lua

Ability to filter/search/modify data structures with Lua. Ability to write your own Lua scripts. Example:

    int obj = JValue.objectFromPrototype("[
        {\"magnitude\": -9},
        {\"magnitude\": 11},
        {\"magnitude\": 3}
    ]")

    int eleven = JValua.evalLuaFlt(obj, "return jc.accumulateValues(obj, math.max, '.magnitude')")
    int minusNine = JValua.evalLuaFlt(obj, "return jc.accumulateValues(obj, math.min, '.magnitude')")



[New] Domains

The Domain is isolated, standalone sandbox, non-global (per-save file), personal storage of JC's data, created by a modder for personal (or non-) use. The feature enables automatic removal of the data stored in a domain once a mod linked to the domain gets uninstalled.
Example of the mod that use domain - https://github.com/SilverIce/PosePicker/commit/38d09404bb8db6c8e07548650bb327a445c452fd

[New] Form Observing

Internal improvement. Mimics the way a script references a form - a form referenced by any of JContainers' containers won't be unloaded by the game (unless force unloaded). Once a form deleted, the FormObserver will receive a notification and form references to that form will be set to zero.

Links

Quick feature overview
Latest documentation
Watch project news and updates on GitHub

Special thanks

- to Saerileth and Gooser, without your interest that project would be abandoned on very early stages
- to Skwerlman and Alexdunn for documentation improvements
- to Verteiron for feedback, bugreports
- to RealAntithesis for feedback, object' identifier generation idea
- to Djarb, specifically for default-return-values idea

Credits

SKSE team - it would be impossible to imagine Skyrim modding without it
boost framework authors - real treasure for any C++ programmer
Akheron, who made jansson - nice JSON parsing library
Lua and LuaJIT creators

Mods that use JContainers (the ones, I was informed about)

Feel free to add more mods here

Nexus mods

Return To Sender
Legacy of the Dragonborn (Dragonborn Gallery)  version 15 “persistent museum ” patch
Skybox - transfer items across characters
Pose Picker - Idle Poser
Metachest - A Сross-Savegame Chest
VioLens - A Killmove Mod
Stat Control Panel
HT Casting Regeneration
Swift Potion Reborn
AH Hotkeys
Key Input Framework
Proper Potion Names
Hook Immerse
Familiar Faces
Druids Den - Collectors Edition

Loverslab mods (there should be some adult content warning):

Apropos
Radiantprostitution Tweaked
Slavetats
Creature Framework
Underpants
SexLab Animation Loader


Permissions

- You are free to shoot into your own foot bundle JContainers. But it's not advisable to do it, as this will inflict your users, as the plugin gets updated quite often and JContainers version downgrade, version conflicts due to mods bundling different versions WILL cause issues¹. This is time-proven fact.
- It's up to you to report to a user of incompatibility of installed JC API version and the version mod has been compiled for the best user's experience. Valid condition is `JC.APIVersion == hardcodedAPIVersion && JC.featureVersion >= hardcodedFeatureVersion`.
- The files in this plugin are not to be modified under any circumstance as that could cause problems when a load order includes multiple mods that use the plugin and one or more mods have modified the files in this plugin.