Nested OXPs in AddOns folder

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Nested OXPs in AddOns folder

Post by Wildeblood »

On a windows computer, we can place OXPs inside another folder named x.oxp and Oolite will discover and use them normally. Is this a windows-specific behaviour, or is it so on other operating systems, too? Do the developers consider this a feature or bug, and are there any thoughts of "fixing" it?
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Nested OXPs in AddOns folder

Post by Cody »

Whether 'feature' or 'bug', it's very handy for keeping a tidy AddOns folder!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Nested OXPs in AddOns folder

Post by Disembodied »

On the Mac, if you give a folder any sort of extension it turns it into a package. So if you place an OXP package inside another OXP package, a Mac won't see the "nested" OXP. This is also why ReadMe files should be placed outside the OXP folder: although it's easy enough to see inside a package (right-click and choose "Show Package Contents" - no sniggering up the back there!), it's not normal user behaviour to do this and any file placed inside a package will probably go unseen.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Nested OXPs in AddOns folder

Post by Eric Walch »

Disembodied wrote:
On the Mac, if you give a folder any sort of extension it turns it into a package.
This does not work for any extension, only for known extensions. And an application can add custom extensions like Oolite does. It is code inside the info.plist inside mac-Oolite that tells that folders ending on ".oxp" must be turned into a package and get their oolite Icon on it. When you would download an oxp on a mac were you never had installed Oolite on, it would stay a normal folder. :lol:

The mac does not support nested oxp's. It is even the way I disable an oxp: Inside my AddOns folder, I have a folder named "Disabled". Oxp's put inside that folder don't load. As far as I understood, Oolite is not explicit searching through nested folders, but the windows OS is doing that.
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Nested OXPs in AddOns folder

Post by Disembodied »

Eric Walch wrote:
This does not work for any extension, only for known extensions. And an application can add custom extensions like Oolite does. It is code inside the info.plist inside mac-Oolite that tells that folders ending on ".oxp" must be turned into a package and get their oolite Icon on it. When you would download an oxp on a mac were you never had installed Oolite on, it would stay a normal folder. :lol:
My work Mac doesn't have Oolite on it, and never has (shameful, I know, but we must make some concessions to The Man ;)). When I give a folder a ".oxp" extension on it, the folder turns into a package. And if I download an OXP onto the work machine, it appears as a blank file, not as a folder ...

Edit: and I can look inside the OXP using "Show Package Contents": it's all there.

Edit again: you're right, this doesn't work for other random extensions. Of course, maybe I have downloaded Oolite onto this thing at some point: it's always possible! I'm just amazed I managed to delete it again ... :shock:
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Nested OXPs in AddOns folder

Post by Eric Walch »

Disembodied wrote:
maybe I have downloaded Oolite onto this thing at some point: it's always possible! I'm just amazed I managed to delete it again ... :shock:
It must have happened. This info goes into the hidden desktop file (Although I think it's called different since OS 10.x). This info stays present when deleting the application. In the pre-osx time you could rebuild the desktop to get rid of this kind of info. Im sure you still can do this, but I stopped trying to understand the OS since Apple switched to Unix 12 years ago. :wink:
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Nested OXPs in AddOns folder

Post by Wildeblood »

Eric Walch wrote:
The mac does not support nested oxp's. It is even the way I disable an oxp: Inside my AddOns folder, I have a folder named "Disabled". Oxp's put inside that folder don't load. As far as I understood, Oolite is not explicit searching through nested folders, but the windows OS is doing that.
That's not actually the same though, Eric. I have done that, too. What happens to the OXPs inside if you rename "Disabled" to "Disabled.oxp"?
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Nested OXPs in AddOns folder

Post by Commander McLane »

Wildeblood wrote:
Eric Walch wrote:
The mac does not support nested oxp's. It is even the way I disable an oxp: Inside my AddOns folder, I have a folder named "Disabled". Oxp's put inside that folder don't load. As far as I understood, Oolite is not explicit searching through nested folders, but the windows OS is doing that.
That's not actually the same though, Eric. I have done that, too. What happens to the OXPs inside if you rename "Disabled" to "Disabled.oxp"?
Good question. Here's the answer:

Code: Select all

14:22:06.447 [searchPaths.dumpAll]: Unrestricted mode - resource paths:
    /Applications/Spiele/Oolite 1.76.1/Oolite.app/Contents/Resources
    /Applications/Spiele/Oolite 1.76.1/AddOns
    /Applications/Spiele/Oolite 1.76.1/AddOns/aegidian-special.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Amen Bricks Megaships.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Anarchies2.9.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Aquatics 1.04.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Assassins.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Asteroids3D1.2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/AsteroidStorm 4.01.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/att1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/auto_eject.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/behemoth 2.6.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/BGS-I1.5.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/bigtrader.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/bioSphere.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/BlOomberg Markets v2.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/BountyScannerv2.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/buoyRepair1.3.2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Cabal_Common_Library1.6.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/captKev_dodo.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Cargo Shepherd 1.01.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Cargo_wrecks_teaser 1.6.5.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Cataclysm.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/cobra_courier.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Commies.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/contractorMkII.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Cougar_ST.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/CustomShieldsv083.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Debug.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/deutschesOolite.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/dev_Goliath_v0.9.2.3.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Dictators v1.3.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/banks.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/black_baron.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/BlackMonks.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/DeepSpacePirates 0.16.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/disasters.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/Diso.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/display_reputation.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/dragon.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/eagle2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/Equilibrium.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/Galactic_Navy.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/glow_alloy.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/gwxstations.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/impcourier.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/ixianfreighter.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/ixianships.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/longway.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/lovecats 1.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/MilHUD-new.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/Orb.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/Planetfall 1.00.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/ringpod.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/robberfly.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/RoC.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/Saleza v2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/SpecialEvents.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/spyhunter.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/taranis.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/tgy_dev.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/thargoid_wars 4.5.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/tori.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/TrekHud.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Disabled.oxp/tugs.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Dock_Assist_System1.2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/dwcobra3.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Energy Equipment 1.11.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Escort_Formations_1.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/ettBeaconLauncher.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Executive Spaceways v2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Famous_Planets_v1.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/fireworks.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/floating_mine.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/flying_Dutchman.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Fuel Station 1.32.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Fuel Tank v2.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/FuelCollectorV0.07.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Generation Ships.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/ghostsfromthepast.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/globestation2.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Green Gecko XL.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/griff_rock_hermit_fullsize_textures.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Griff_Shipset_Replace_v1.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Griff_Shipset_Resources_v1.2.22.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Hud.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/impcourier2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/interstellar_help.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/jabberwocky.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Killit2.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/liberator.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/liners_v1.4.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/military Fiasco 2.5.2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/milmissile.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Missile Analyser 1.2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Missiles and Bombs v2.3.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Missionaries.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/mycobra35.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/neocaduceus.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/nukes0.97.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/offender_traders.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/oldships.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Ore_processor 1.58.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/outrider.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/PAGroove_Stations_v1.2.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Personalities.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Personalities_set_A.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Personalities_set_Z.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Pirate_coves 1.3.3.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Pods 1.22.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/PTI.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/railgun.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/RandomHits1.4.12oxp.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/randomshipnames1.3.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/renegades.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/RunnerG5-1.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/s-ships1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/SecondWave 1.32.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/sell_equipment.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/ShieldCycler 0.20.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/ships_cat_alpha_1.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Snoopers2.3.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Snoopers2.x_gal2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Status_Quo_Q-bomb.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Stellar Serpents 1.11.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/sunskimmers.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/supercobra 1.4.2.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Superhubv1.0.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/System_Redux.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/TAF_reset.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/TCA_v1.03.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/thargoid_carrier2.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Thargorn_Threat 1.5.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/The Feudal States v1.4.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Tianve1.3.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/tiger.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/TOGY_Main 1.1.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Tori2.01.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/total_patrol1.5.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/transhab.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Transports 2.52.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/Vector1.7.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/WildShips 1.04.oxp
    /Applications/Spiele/Oolite 1.76.1/AddOns/wormhole_restoration.oxp
14:22:07.146 [shipData.load.begin]: Loading ship data.
14:22:12.522 [script.unpermittedMethod]: ***** SCRIPT ERROR: in equilibrium.1.do.1.do.1 ("commsScreen: Oh no, Commander! Your Fuel Scoops Enhancer just broke down!"), method "commsScreen:" not allowed.
So indeed, the nested OXPs are not only loaded, but also correctly parsed, as evidenced by the detection of a syntax error in a very old Work-no-longer-in-Progress of mine.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Nested OXPs in AddOns folder

Post by Eric Walch »

Wildeblood wrote:
That's not actually the same though,
You are right. Oolite only tries to look into folders ending at ".oxp" I dropped the asteroidStorm oxp into another one and I get:

Code: Select all

[searchPaths.dumpAll]: Unrestricted mode - resource paths:
    /Applications/Oolites/Oolite-latest buid/Oolite.app/Contents/Resources
    ~/Library/Application Support/Oolite/AddOns
    /Applications/Oolites/Oolite-latest buid/AddOns
    ~/Library/Application Support/Oolite/AddOns/accessoriesV2.1.oxp
    ~/Library/Application Support/Oolite/AddOns/aegidian-special.oxp
    ~/Library/Application Support/Oolite/AddOns/aegidian-special.oxp/AsteroidStorm 4.03.oxp
.....
[script.load.world.listAll]: Loaded 97 world scripts:
......
    AsteroidStorm 4.03
The scrips seems to be active and the asteroids are textured correctly.

EDIT: ninjaed by McLane
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Nested OXPs in AddOns folder

Post by Svengali »

But doesn't it raise the time to access files by adding more folders to the search path?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Nested OXPs in AddOns folder

Post by cim »

Svengali wrote:
But doesn't it raise the time to access files by adding more folders to the search path?
I suspect you'd have to create a ridiculously nested structure before that became noticeable, though, unless you had some unsuitable filesystem where directory operations took a millisecond each. Even then, it'd probably mostly only slow things down at startup when the cache was being built.

In answer to the original question: I'm pretty sure it's a feature - the code in ResourceManager.m does not look like this is an accidental consequence of something else. At any rate, I don't know of any plans to change it (and I use it myself to organise my OXP folder, so I'd notice if it got accidentally broken somehow)
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Nested OXPs in AddOns folder

Post by Cody »

I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Amah
---- E L I T E ----
---- E L I T E ----
Posts: 486
Joined: Tue Aug 28, 2012 8:05 pm
Location: aboard the Laenina Crowne - Yasen-N class space freighter
Contact:

Re: Nested OXPs in AddOns folder

Post by Amah »

Wildeblood wrote:
On a windows computer, we can place OXPs inside another folder named x.oxp and Oolite will discover and use them normally. Is this a windows-specific behaviour, or is it so on other operating systems, too?
same behaviour on Debian GNU/Linux. just for the record.
Amah
Post Reply