Page 1 of 1

OXP Changes not respected by Oolite

Posted: Fri Dec 03, 2021 10:20 pm
by hiran
Once more I am trying to tweak an OXP's worldscript, and once more I get annoyed by Oolite not acting on my changes to the script. Yes, I read something about a cache. And so far I am never sure whether that one really prevents my changes from going live or the fact that my script might be simply wrong.

For the sake of my nerves, how can I reliably ensure Oolite reads the file from disk every time? I do not want to press keys during startup or else, and I am willing to spend more startup time if I then reliably see my changes getting active.

So where is that cache? I'm willing to delete these files on every startup....

Re: OXP Changes not respected by Oolite

Posted: Fri Dec 03, 2021 10:32 pm
by Mauiby de Fug
Hopefully this should help: [EliteWiki] Hidden_Settings_in_Oolite

Here's the How:
How to Change Settings
Mac OS X

For Oolite under Mac OS X, there are several ways to modify these settings.

Most of them can be set with the Secrets preference pane for Mac OS X 10.5. (download the tool by selecting the "prefPane" option on the top right, click the downloaded prefPane to install it, choose Oolite in the list on the left)
If you have Xcode tools installed, they can be edited with Property List Editor. The preferences file can be found at ~/Library/Preferences/org.aegidian.oolite.plist. (This is human-readable in Mac OS X 10.3.9 and earlier, but binary in 10.4 and later.)
On all systems, the defaults command line tool can be used. To set a boolean value, use: defaults write org.aegidian.oolite key -bool YES (or NO). For numerical values, use defaults write org.aegidian.oolite key 42.

Windows, Linux and other platforms

For platforms other than Mac OS X, you must edit a text file called .GNUstepDefaults. This file is created when you change a preference in Oolite, then quit.

Under Windows, this file is found at <Oolite installation directory>\oolite.app\GNUstep\Defaults\.GNUstepDefaults.

Under Linux and other platforms, the file is at ~/GNUstep/Defaults/.GNUstepDefaults. Since its name starts with a full stop, it is hidden by default. If you’re using Gnome/Nautilus or KDE/Konqueror, you can show it by selecting Show Hidden Files from the View menu. In any event, it should be accessible from the command line.

The .GNUstepDefaults file is a kind of property list, but uses a slightly different syntax than usual; you may see values like <*I300>. However, when you edit it by hand it’s safe to write numbers in plain form, and booleans are written as YES or NO. All Oolite settings are in the dictionary named “oolite”.
And here's the What:
Miscellaneous

Key: always-flush-cache
Type: boolean
Default: NO
Introduced: 1.73
If set to YES, the data cache will be rebuilt each time Oolite runs. This is roughly equivalent to placing a brick on your shift key.

Re: OXP Changes not respected by Oolite

Posted: Fri Dec 03, 2021 10:35 pm
by Cody
Ninja'd! Damn squirrels!

Re: OXP Changes not respected by Oolite

Posted: Fri Dec 03, 2021 11:38 pm
by tsoj
The GNUstepDefaults doesn't always seem to work for me. What I usually do if I want to make 100% sure that my script is reloaded, I delete the folder "~/GNUstep/Library/Caches/org.aegidian.oolite". On Windows or Mac, this might be somewhere else, though I imagine that it also exists on these platforms.

If you're on Linux, you could make a simple script that deletes that folder automatically, each time you start Oolite. Not sure if that be done easily on the other platforms.

Re: OXP Changes not respected by Oolite

Posted: Sat Dec 04, 2021 11:07 am
by hiran
Mauiby de Fug wrote: Fri Dec 03, 2021 10:32 pm
Hopefully this should help: [EliteWiki] Hidden_Settings_in_Oolite

Here's the How:
[...]

And here's the What:
[...]
Thank you for the suggestion. Does it work for you?

I had tried that already - to the best of my knowledge. I have not seen any effect on Oolite handling my script. And even more, when coming back to the file I noticed that it had been overwritten with my additions missing. That is why I no longer trust in modifying that file.

Re: OXP Changes not respected by Oolite

Posted: Sat Dec 04, 2021 11:08 am
by hiran
tsoj wrote: Fri Dec 03, 2021 11:38 pm
The GNUstepDefaults doesn't always seem to work for me. What I usually do if I want to make 100% sure that my script is reloaded, I delete the folder "~/GNUstep/Library/Caches/org.aegidian.oolite". On Windows or Mac, this might be somewhere else, though I imagine that it also exists on these platforms.

If you're on Linux, you could make a simple script that deletes that folder automatically, each time you start Oolite. Not sure if that be done easily on the other platforms.
I found the folder and added a removal line to my startup script.
And I can now see that latest when restarting Oolite my changes are effective.

Thank you!

Re: OXP Changes not respected by Oolite

Posted: Tue Dec 14, 2021 8:04 pm
by cag
hiran wrote: Fri Dec 03, 2021 10:20 pm
Once more I am trying to tweak an OXP's worldscript, and once more I get annoyed by Oolite not acting on my changes to the script. Yes, I read something about a cache. And so far I am never sure whether that one really prevents my changes from going live or the fact that my script might be simply wrong.

For the sake of my nerves, how can I reliably ensure Oolite reads the file from disk every time? I do not want to press keys during startup or else, and I am willing to spend more startup time if I then reliably see my changes getting active.

So where is that cache? I'm willing to delete these files on every startup....
Add

Code: Select all

"always-flush-cache" = YES;
to your .GNUstepDefaults. This way all your settings are preserved.

Re: OXP Changes not respected by Oolite

Posted: Sun Jan 02, 2022 12:36 pm
by SandJ
What's the syntax for that? My .GNUstepDefaults looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//GNUstep//DTD plist 0.9//EN" "http://www.gnustep.org/plist-0_9.xml">
<plist version="0.9">
<dict>
    <key>NSGlobalDomain</key>
    <dict>
    </dict>
    <key>oolite</key>
    <dict>
	<key>SandJ 245 (autosave)-humbletrash</key>
	<integer>-26248</integer>
	<key>gamma-value</key>
	<real>1</real>
	<key>save-directory</key>
	<string>/home/simon/Dropbox/Games/Oolite/oolite-saves</string>
	<key>volume_control</key>
	<real>0.5</real>
	<key>window_height</key>
	<integer>1021</integer>
	<key>window_width</key>
	<integer>1920</integer>
    </dict>
</dict>
</plist>
I tried adding:

Code: Select all

	<key>always-flush-cache</key>
	<boolean>YES</boolean>
after the <integer>1920</integer> but it just recreated the .GNUstepDefaults file.

Re: OXP Changes not respected by Oolite

Posted: Sun Jan 02, 2022 3:09 pm
by Cody
Mine looks like this:

Code: Select all

  "always-flush-cache" = YES;
  fullscreen = YES;
  "gamma-value" = 1;
  "save-directory" = "E:\\Oolite-Trunk/oolite.app/oolite-saves";
  "show-ship-model-in-status-screen" = YES;
That's a snippet on Windows, btw. Always back-up your .GNUstepDefaults file before tinkering!

Re: OXP Changes not respected by Oolite

Posted: Sun Jan 02, 2022 9:57 pm
by cag
SandJ wrote: Sun Jan 02, 2022 12:36 pm
What's the syntax for that?
Try

Code: Select all

<key>always-flush-cache</key>
<true/>
or

Code: Select all

<key>always-flush-cache</key>
<string>YES</string>
Let us know which works. Bet you're on a Mac, right?

Re: OXP Changes not respected by Oolite

Posted: Sun Jan 02, 2022 10:19 pm
by SandJ
cag wrote: Sun Jan 02, 2022 9:57 pm

Code: Select all

<key>always-flush-cache</key>
<string>YES</string>
Let us know which works. Bet you're on a Mac, right?
That was the one that worked for me, thank you.

I am on Linux.

The page http://wiki.alioth.net/index.php/Hidden ... _in_Oolite gave me the impression I needed to use <boolean>. I've tried it both ways; using <boolean> makes it recreate the .GNUstepDefaults file.

Re: OXP Changes not respected by Oolite

Posted: Mon Jan 03, 2022 6:48 am
by hiran
SandJ wrote: Sun Jan 02, 2022 10:19 pm
cag wrote: Sun Jan 02, 2022 9:57 pm

Code: Select all

<key>always-flush-cache</key>
<string>YES</string>
Let us know which works. Bet you're on a Mac, right?
That was the one that worked for me, thank you.

I am on Linux.

The page http://wiki.alioth.net/index.php/Hidden ... _in_Oolite gave me the impression I needed to use <boolean>. I've tried it both ways; using <boolean> makes it recreate the .GNUstepDefaults file.
Thank you for that information. I was fiddling around with the boolean stuff and failed miserably.
Now the wiki page is updated as well.