Background for Skyrim SE

The JValue Script

    The JValue script is a part of Skyrim SE’s Papyrus scripting ecosystem. This script is not present in the vanilla game, but can be found in modded sources like JContainers (JContainers).

    For this script, the Papyrus index knows about:

    • 39 functions


    Inheritance Tree

    No indexed scripts extend this script.

    Properties

    No properties found.

      Events

        No events found.

      Functions

      • voidfunctionenableAPILog(boolarg0)NativeGlobal

        Most call entries made to JC will be logged. Heavy traffic, by default is disabled.
        Not thread safe for multiple users (though harmless).

      • intfunctionretain(intobject, stringtag="")NativeGlobal

        --- Lifetime management functionality.
        Read this https://github.com/ryobg/JContainers/wiki/Lifetime-Management before using any of lifetime management functions

        Retains and returns the object.

      • intfunctionrelease(intobject)NativeGlobal

        Releases the object and returns zero, so you can release and nullify with one line of code: object = JValue.release(object)

      • intfunctionreleaseAndRetain(intpreviousObject, intnewObject, stringtag="")NativeGlobal

        Just a union of retain-release calls. Releases @previousObject, retains and returns @newObject.

      • voidfunctionreleaseObjectsWithTag(stringtag)NativeGlobal

        Releases all objects tagged with @tag.
        Internally invokes JValue.release on each object same amount of times it has been retained.

      • intfunctionzeroLifetime(intobject)NativeGlobal

        Minimizes the time JC temporarily owns the object, returns the object.
        By using this function you help JC to delete unused objects as soon as possible.
        Has zero effect if the object is being retained or if another object contains/references it.

      • intfunctionaddToPool(intobject, stringpoolName)NativeGlobal

        Handly for temporary objects (objects with no owners) - the pool 'locationName' owns any amount of objects, preventing their destuction, extends lifetime.
        Do not forget to clean the pool later! Typical use:
        int jTempMap = JValue.addToPool(JMap.object(), "uniquePoolName")
        int jKeys = JValue.addToPool(JMap.allKeys(someJMap), "uniquePoolName")
        and anywhere later:
        JValue.cleanPool("uniquePoolName")

      • voidfunctioncleanPool(stringpoolName)NativeGlobal
      • intfunctionshallowCopy(intobject)NativeGlobal

        --- Mics. functionality

        Returns shallow copy (won't copy child objects)

      • intfunctiondeepCopy(intobject)NativeGlobal

        Returns deep copy

      • boolfunctionisExists(intobject)NativeGlobal

        Tests whether given object identifier is not the null object.
        Note that many other API functions already check that too.

      • boolfunctionisArray(intobject)NativeGlobal

        Returns true if the object is map, array or formmap container

      • boolfunctionisMap(intobject)NativeGlobal
      • boolfunctionisFormMap(intobject)NativeGlobal
      • boolfunctionisIntegerMap(intobject)NativeGlobal
      • boolfunctionempty(intobject)NativeGlobal

        Returns true, if the container is empty

      • intfunctioncount(intobject)NativeGlobal

        Returns amount of items in the container

      • voidfunctionclear(intobject)NativeGlobal

        Removes all items from the container

      • intfunctionreadFromFile(stringfilePath)NativeGlobal

        JSON serialization/deserialization:

        Creates and returns a new container object containing contents of JSON file

      • intfunctionreadFromDirectory(stringdirectoryPath, stringextension="")NativeGlobal

        Parses JSON files in a directory (non recursive) and returns JMap containing {filename, container-object} pairs.
        Note: by default it does not filter files by extension and will try to parse everything

      • intfunctionobjectFromPrototype(stringprototype)NativeGlobal

        Creates a new container object using given JSON string-prototype

      • voidfunctionwriteToFile(intobject, stringfilePath)NativeGlobal

        Writes the object into JSON file

      • intfunctionsolvedValueType(intobject, stringpath)NativeGlobal

        Returns type of resolved value. 0 - no value, 1 - none, 2 - int, 3 - float, 4 - form, 5 - object, 6 - string

      • boolfunctionhasPath(intobject, stringpath)NativeGlobal

        Path resolving:

        Returns true, if it's possible to resolve given path, i.e. if it's possible to retrieve the value at the path.
        For ex. JValue.hasPath(container, ".player.health") will test whether @container structure close to this one - {'player': {'health': health_value}}

      • floatfunctionsolveFlt(intobject, stringpath, floatdefault=0.0)NativeGlobal

        Attempts to retrieve value at given path. If fails, returns @default value

      • intfunctionsolveInt(intobject, stringpath, intdefault=0)NativeGlobal
      • stringfunctionsolveStr(intobject, stringpath, stringdefault="")NativeGlobal
      • intfunctionsolveObj(intobject, stringpath, intdefault=0)NativeGlobal
      • FormfunctionsolveForm(intobject, stringpath, Formdefault=NONE)NativeGlobal
      • boolfunctionsolveFltSetter(intobject, stringpath, floatvalue, boolcreateMissingKeys=false)NativeGlobal

        Attempts to assign the value. If @createMissingKeys is False it may fail to assign - if no such path exist.
        With 'createMissingKeys=true' it creates any missing path element: solveIntSetter(map, ".keyA.keyB", 10, true) on empty JMap creates {keyA: {keyB: 10}} structure

      • boolfunctionsolveIntSetter(intobject, stringpath, intvalue, boolcreateMissingKeys=false)NativeGlobal
      • boolfunctionsolveStrSetter(intobject, stringpath, stringvalue, boolcreateMissingKeys=false)NativeGlobal
      • boolfunctionsolveObjSetter(intobject, stringpath, intvalue, boolcreateMissingKeys=false)NativeGlobal
      • boolfunctionsolveFormSetter(intobject, stringpath, Formvalue, boolcreateMissingKeys=false)NativeGlobal
      • floatfunctionevalLuaFlt(intobject, stringluaCode, floatdefault=0.0)NativeGlobal

        Evaluates piece of lua code. Lua support is experimental

      • intfunctionevalLuaInt(intobject, stringluaCode, intdefault=0)NativeGlobal
      • stringfunctionevalLuaStr(intobject, stringluaCode, stringdefault="")NativeGlobal
      • intfunctionevalLuaObj(intobject, stringluaCode, intdefault=0)NativeGlobal
      • FormfunctionevalLuaForm(intobject, stringluaCode, Formdefault=NONE)NativeGlobal
      Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.