Skip to content

Yet another v3.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@SilverIce SilverIce released this 15 Mar 19:33
· 1 commit to feature/form-observing since this release

Form observing:

  • Remove extra strict test when loading forms' identifiers from JSON files. In previous alpha version the test marks a form's identifier as invalid if the form is not loaded in game. For now it assumes that the form exists, even if it's not possible to test that.
  • Retain and observe EVERY form that gets passed into JContainers which prevents a form from being unloaded. This also involves persistent forms. Still, the forms imported from JSON files, especially object-reference forms may not be retained if those forms belong to some unloaded cells and are unloaded.
  • Form observing code: make it really thread safe, almost lock free, use concurrent hashmap collections.

Cosmetic API changes, on hold:

  • JValue: string getTag(int object), setTag(int object, string tag) functions. Mostly for debugging purposes. Note that it the functions will share the same tag with JValue.retain function

  • JValue.toJSONString

  • JString: FormId|Form <-> "__formData|'pluginName'|'lowFormId'" conversion functions

  • Set of new JMap|JFormMap|JIntMap.allKeysPArray functions

  • JLua interface for convenient Papyrus -> Lua parameter transporting. Example:

    -- replace all non-letter, non-number characters with empty space
    string function normalizeString(string value) global
     return JLua.evalLuaStr("return string.gsub(args.str, ' ', '%W')", JLua.setStr("str",value))
    endfunction
  • JDB.autoremoveKeyIfPluginMissing(string rootKey, string pluginFileName). IMO it's best to replace rootKey with path

  • Feel free to suggest better function naming etc.

Other changes:

  • Improve nextKey functions. Note that the JFormMap.nextKey function is not much reliable (unlike allKeys & allKeysPArray). It is not very much reliable to use it on JFormMap containing object-reference form keys, because Skyrim may unload some of the forms and in the result iteration will be interrupted as nextKey will return None form. Note that v3.3 retains all forms including object-reference forms, thus it's likely impossible to unload such form anymore. Still, the forms imported from JSON files, especially object-reference forms may not be retained if those forms belong to some unloaded cells and are unloaded. For now JFormMap.nextKey will not return unloaded (None) forms, except if it's end of iteration.
  • Log attempts to access deleted JContainers' objects. Useful for debugging, troubleshooting, etc. Note that the logging feature is not disable-able (yet?)