todirbg / kln90b

kln90b gps for x-plane 11
6 stars 2 forks source link

XP12: kln_installer.exe does not find panel.obj #1

Open JDeeth opened 6 months ago

JDeeth commented 6 months ago

Hi, thanks for the phenomenal work on this!

I'm trying to install in the TOGASim MU-2 for XP12. All is going well so far, but when I run kln_installer.exe, it finds no panel choices:

image

I suspect this is an XP11>XP12 change and I just need to copy one of the cockpit objects to somewhere the installer will find it.

JDeeth commented 6 months ago

The MU-2 has (a selection of) panel objects in {aircraft folder}/objects/Cockpit_3D. Copying the .obj into the aircraft folder puts it where the installer expects to find it.

However there's another problem: when the installer parses the aircraft file, it expects to find the cockpit object listed before the KLN90 and MD41 objects: https://github.com/todirbg/kln90b/blob/7a5e3bcee890d64c200472ca5b2336298fd40d53/CPP_src/kln_installer.cpp#L370-L472

When I added the KLN90 and MD41 to the aircraft in Planemaker, they happened to be inserted earlier than the cockpit object in the .acf file. The objects are sorted alphabetically...! So they were ordered obja/27 (KLN90B), obja/28 (MD41), obja/3 (something), obja/4 (cockpit). I believe reordering the objects by editing the .acf file with a text editor can fix this though.

todirbg commented 6 months ago

Hi, It is just bad coding not a change in xp12. The installer looks for cockpit.obj only in the main folder and it relies on the folder structure. The installer and kln objects must be in objects/kln90b folder and cockpit obj should be in main acf folder. The installer needs a major rewrite when the time permits. If it does not work try offset_calculator. It is harder to use, but will work on anything.

todirbg commented 6 months ago

The MU-2 has (a selection of) panel objects in {aircraft folder}/objects/Cockpit_3D. Copying the .obj into the aircraft folder puts it where the installer expects to find it.

However there's another problem: when the installer parses the aircraft file, it expects to find the cockpit object listed before the KLN90 and MD41 objects:

https://github.com/todirbg/kln90b/blob/7a5e3bcee890d64c200472ca5b2336298fd40d53/CPP_src/kln_installer.cpp#L370-L472

When I added the KLN90 and MD41 to the aircraft in Planemaker, they happened to be inserted earlier than the cockpit object in the .acf file. The objects are sorted alphabetically...! So they were ordered obja/27 (KLN90B), obja/28 (MD41), obja/3 (something), obja/4 (cockpit). I believe reordering the objects by editing the .acf file with a text editor can fix this though.

As far as I remember you can change the order of objs in plane maker with no ill effects. Xp does not care about the order.

JDeeth commented 6 months ago

Thanks - I've got the install mostly working now! There's a mapping issue I'll raise separately.