OpenLoco / ObjectEditor

A modern implementation of 'LocoTool' for dat file parsing
7 stars 3 forks source link

ObjectEditor crashes on open because of Data/plugin.dat #126

Closed AdvancedAssistiveTech closed 2 weeks ago

AdvancedAssistiveTech commented 2 weeks ago

When trying to launch ObjectEditor as downloaded from the releases page on Arch Linux, the application terminates with an unhandled System.ArgumentException, stating that Data/plugin.dat must have valid S5 and Object headers to call this method (Parameter 'file')

The full trace is available here. I notice in the trace that Windows paths are used to point to ObjectIndex.cs, but I'm not sure if that's a real problem or a known development abstraction. Please help me out, thank you!

LeftofZen commented 2 weeks ago

The editor doesn't support plugin.dat yet, the only things it supports from the Data directory are G1.dat and the music files. How did you try to open this file? In any case I can at least make it not crash right now.

The paths used in the editor should be platform-agnostic, and I'm surprised to see the paths in the stack-trace are leaking the actual folder structure of the machine I used to compile it on. This isn't a real problem (except for my privacy) and I'll see if I can change that, but it shouldn't cause any issues with the editor itself.

LeftofZen commented 2 weeks ago

Ah yes I see how you made it crash, you just gave it the Data folder instead of ObjData. I haven't added in a full dat-file-detection code yet so it can't differentiate the different dat filetypes automatically. I'll fix it crashing though

AdvancedAssistiveTech commented 2 weeks ago

Hey @LeftofZen, thanks for your insight. Actually, I didn't 'give' the executable anything. I don't mean that in a nitpicky or difficult way, I'm just confused about how to use the application. I'm invoking ObjectEditor on the command line, and then getting that error before any GUI window opens. Should I provide a path to the ObjData folder as a command line parameter? Otherwise, I don't get the opportunity to point to any folder, Data or otherwise, before the app crashes.

LeftofZen commented 2 weeks ago

No its all good, nitpicky is good! The readme tells you how to use the program: https://github.com/OpenLoco/ObjectEditor/blob/master/README.md

It is a GUI application, so I guess I should include a note about there being no command line support (except to start the program with no arguments). If you haven't given it an objects folder in step 1, its strange that it decided to pick one for you. It should be doing nothing when you start up the app, and until you click on something (eg Objects -> Add new folder)

AdvancedAssistiveTech commented 2 weeks ago

I saw the README, and I get that it's a GUI app, but I'm falling off at step 0 lol. "start the program with no arguments" is my problem - when I type ./ObjectEditor on the command line and then press enter, without doing anything else, the program crashes and produces the attached trace without opening any window that I can use to click on the Objects menu

LeftofZen commented 1 week ago

Sorry I took so long to respond. I unfortunately don't test the linux version frequently so it is quite likely it has gotten broken at some point. I believe I have fixed the crash as per that stacktrace though, so check out the new version and let me know if it works or not: https://github.com/OpenLoco/ObjectEditor/releases/tag/3.8.0