Closed SKmaric closed 7 years ago
Oh you found out how to fix the crash? I will give it a try. EDIT: btw line 298 of SOBJ.cs is in ReadObject, Is it meant to be reader.FixPadding(4);
?
EDIT 2: writing writer.FixPadding(4);
to line 422 of SOBJ.cs seems to fix the crash.
Wow it is at 0, 0, 0
It seems it needs padding when moving the transforms.
Please test this for me its 12:30AM here.
085f45182b683071163d0cf12f3ead6d0e49e2f1
Ah yes, that fixed it. Thanks!
cool.
I'll update the set editor.
Ah I see what was happening with the transforms. Tbh I'm surprised when I programmed the SOBJ class that I made it write the transform data right after the parameters. Thanks for fixing that!
Have no idea what's going on with the game crashing when there's no padding for string parameters, though. I didn't even know there were any objects with string parameters in colors lol. I had that check there just for LW objects.
The best part about this fix is that i found it by mistake. Spent the last 30 mins on constant freezes, I was adding junk into random areas in the SOBJ until it stopped crashing, then i removed some of the junk until it stared crashing, And by doing that I found out that FixPadding seems to stop it from crashing.
When an original .orc file is loaded and then saved to a new file, the game fails to load the position and rotation data for any objects exported, putting them all at 0,0,0 with no rotation, as pictured:
It's possible this may be related to the exporter putting each object's individual transform data immediately after the parameter data, instead of all closer to the end of the file like the original ones. This seems to be fine for creating files from scratch, this issue only seems to occur with loading and saving the official files, regardless of any edits made.
Also worth noting, for the current version of HedgeLib the game would crash once any of the objects came in range, I fixed this by adding
writer.FixPadding(4);
at line 298 of SOBJ.cs.