Menu

#2551 Addon FGData path ignores AI, Nasal, Aircraft subdirectories

2020.3
New
nobody
None
Medium
2021-02-16
2021-02-16
peridotite
No

When porting Bombable to the new addon API/format I was advised that moving a directory tree that matched FGDATA into an FGData directory would add that to the fgdata path & all data should be picked up as if it was copied into FGDATA (except of course if it tried to overwrite something in FGDATA).

I attempted this with Bombable but found the following issues:

  1. AI Scenarios are only picked up if they are in a Scenarios directory in the addon root, but when picked up they are able to reference items in FGData/AI/
  2. Nasal items are not picked up unless loaded in addon-main.nas
  3. The Aircraft dir in FGData is ignored (not sure if this is a problem as can be added manually but other developers may want to include special aircraft with their addons)

Bombable test setup is here:

https://github.com/alexeijd/Bombable/tree/addon-test-case

AI Scenarios won't load unless FGData/AI is linked to Scenarios in addon root
Nasal/bombable.nas won't load unless loaded from addon-main.nas (code is commented out)

the scenario SanFranCessnaInvasion loads into KSFO when enabled - can be seen on traffic map

Discussion

  • James Turner

    James Turner - 2021-02-16

    For the Nasal part: I think this is by design, that you have to load all add-on Nasal from addon-main.nas. Is there a reason that's a problem , in the case of bombable?

     
  • peridotite

    peridotite - 2021-02-16

    The Nasal directory not really a problem as it can be loaded with a minor change (already done) from addon-main.nas - I just wanted clarity on which directories should work as it's not documented.

     
  • James Turner

    James Turner - 2021-02-16

    Right, we should update the document in Docs/ with a list of what works.

    For scenarios, the intention is to load them from Nasal explicitly via 'load-scenario' command. I.e do this from addon-main.nas. The automatic loading of all scenarios inside Scenarios/ is slightly old-fashioned, I would say.

    Unless there is some reason that having them detected automatically is better / different - I don't know of any reason it would matter.

    Searching FGData/AI should work though.

    For aircraft, I'm not sure how it should work: can you explain more what you mean by 'can be added manually'? We don't want a situation where the user has to do extra config steps to make an add-on work; once they've added it + enabled it, we want everything to be 100% automatic.

     
  • peridotite

    peridotite - 2021-02-16

    What I'm reading is that you mean that each addon should then create it's own menu to detect & load it's own scenarios as the Scenarios / AI method is possibly deprecated - if so can this be documented?

    I'm guessing that in the case of per addon scenario menu the ai scenario property tree would be specific to the addon as well (/sim/ai/scenarios -> /addons/by-id/a.bhugh.Bombable/ai/scenarios ?)

    The Aircraft dir can be added with the test setup by adding Bombable/FGData/Aircraft as an aircraft path manually - you mentioned in email that you weren't sure whether we should auto add Aircaft included in addons - it does seem like a valid use case though

    What I see at the moment from the logs is that the Addon root directory is added to the aircraft path - possibly in order to allow nasal to be loaded, but the launcher itself doesn't see the aircraft if they are in the addon root.

    It may be useful to get the launcher to detect the presence of root/FGData/Aircraft & add it to the Aircraft path (I can't see anything in the addon-api or metadata)

     
  • James Turner

    James Turner - 2021-02-16

    I've confused you about scenarios. The property tree and GUI dialog are fine. But, if you use the command, they shoiuld be added to the exting GUI dialog. And then the user can select/deselet them as normal. This should already work, no need for the add-on to do anything like a custom menu.

     
  • James Turner

    James Turner - 2021-02-16

    For aircraft, I think we need to take a step back: it's qutie easy to allow add-ons to add an aircraft path; there's many ways it could work. But first I want to understand why this is a thing an add-on needs to do; it feels a bit backwards.

     

Log in to post a comment.

MongoDB Logo MongoDB