JContainers icon indicating copy to clipboard operation
JContainers copied to clipboard

Stored form reference loaded from file invalid

Open KHismoom opened this issue 2 years ago • 0 comments

The most recent VR version of JContainers, 4.1.13, has a different behavior than the SE version in regards to resolving form references stored in an Array/Map loaded from a file. Try the following code on SE and VR:

                Form f = Game.GetFormFromFile(0x12fcc,"Skyrim.esm")
                Int iTest = JArray.object()
                JArray.addForm(iTest,f)
                JValue.writeToFile(iTest,"FormTest.json")
                iTest = JValue.readFromFile("FormTest.json")
                f = JArray.getForm(iTest,0)
                ConsoleUtil.PrintMessage("TestForm: "+f+", "+f.GetName())

On SE you'll have a correct form reference in f after the file is loaded, console output is TestForm: [SPELL < (00012FCC)>], Healing whereas on VR it is None, console output is TestForm: None,

Retrieving the form directly from the array after adding it works fine on both SE and VR. It seems that when actually loading a form reference from a file, it does not get resolved correctly on VR.

KHismoom avatar Dec 04 '21 13:12 KHismoom