Enhanced dynamic, non-persistent form handling

39 views
Skip to first unread message

slifeleaf

unread,
Aug 19, 2015, 6:28:11 PM8/19/15
to jcontain...@googlegroups.com
 Dynamic, non-persistent forms are funny. Even when you close or open the console, Skyrim destroys and creates few of them.
 JContainers stores form identifiers. We don't watch form's delete event, so there is some 'fun' involved as Skyrim reuses identifiers. Thus there is some non-zero chance that some randomly spawned actor's identifier will be re-used by another actor or soulgem or anything. Also, there is relatively big chance you noticed the issue already.. or not yet

The new functionality intended to
  • zero-out form identifiers in arrays and dictionary values
  • erase {key, value} pair in JFormMap if the key is not valid

. Going to ship incoming enhancement in v3.2.5




slifeleaf

unread,
Aug 24, 2015, 2:28:14 PM8/24/15
to jcontain...@googlegroups.com
It seems the 'journey' turned into something more interesting, rather than modifying or adding more lines of code. It turns out that there is easy way to retain object-references, aliases and etc in the same way a script's property retains, prevents an object from being unloaded or deleted.

My test spawns and retains (via JDB.solveFormSetter(".my.junk", ref, True) a soulgem and the soulgem, unlike another one, is accessible (JDB.solveForm(".my.junk") even when its map is not active, i.e. unloaded (?). Going to enable 'retaining' everywhere by default, i.e. every setForm, addForm and etc will create a 'strong' form reference. Not sure whether anyone will ever need to use 'weak' references

slifeleaf

unread,
Sep 18, 2015, 3:34:12 PM9/18/15
to jcontainers-users
 As I said, it some kind of Pandora Box and it's not because of form retaining. The vein of 'lets preserve everything' is not that easily achievable.

Lot of ambiguity. First of all, it is ghost-form equality. Say there is 0xff000014 form in JArray container, the form gets deleted, Skyrim creates new form, reuses 0xff000014 identifier, a user inserts the form in the array, (and optionally - the form gets deleted). Should JArray.unique left only one form? Are these forms are equal or not? Probably not, though from outer point of view both forms are 'None'.

Repeat the same as above for JFormMap and its keys. Now some important information associated with deleted form-key and in v3.3 I'm trying to not lost that information, make it accessible. JFormMap is {deleted-form-version1: data, deleted-form-version2: data}, Skyrim creates @newForm, reuses 0xff000014 identifier. Should JFormMap.hasKey(newForm) return true? No. Thus this time the forms aren't equal.

Reply all
Reply to author
Forward
0 new messages