start-5 / TiTS.JS-Save-Editor

Trials in Tainted Space Save Editor
https://start-5.github.io/TiTS.JS-Save-Editor/
MIT License
30 stars 6 forks source link

An unhandled exception occurred when loading certain save files #104

Closed kevinfutagi closed 9 months ago

kevinfutagi commented 9 months ago

I tried loading my current save file and this message pops up:

Message: Unable to process binding "textInput: function(){return long }" Message: long is not defined Stacktrace: ReferenceError: Unable to process binding "textInput: function(){return long }" Message: long is not defined at textInput (eval at parseBindingsString (https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:74:172), :3:108) at m (https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:112:352) at Function.yd (https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:55:359) at Function.zd (https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:55:45) at Function.ha (https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:54:384) at a.o.a.$ (https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:52:147) at init (https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:114:18) at https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:79:94 at Object.G (https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:41:458) at https://start-5.github.io/TiTS.JS-Save-Editor/scripts/ko.js:79:75

I did a bit of testing and it only occurs on save files that have stolen the sidewinder. Not super sure why. It might also be a coincidence. Also, the no Perks, Status effects, Flags, or Key Items show up for any of the save files regardless of if the message is shown. I am willing to provide saves if needed.

start-5 commented 9 months ago

Yes, please upload the file(s) and I’ll take a look.

kevinfutagi commented 9 months ago

Pre Sidewinder Stealing (No errors).json Post Sidewinder Stealing (Errors).json

TrojanMan77 commented 9 months ago

It seems to be a problem with the sidewinder ship being specifically used. I tried it with a few other ships and the save editor worked perfectly fine for me after the changes.

kevinfutagi commented 9 months ago

It's fine for every other save other than the post-sidewinder ones now.

start-5 commented 9 months ago

I had some time to look at this today and found the issue. Apparently this Sidewinder ship is the only ship in the game that doesn't have a statically defined long (description) property and is instead a computed value to allow for situations like this:

image

Where it adjusts to whether the player renamed it or not.

Anyway, I made it so that if you have the Sidewinder in your save it won't consider the long property at all for that ship.