OXP Changes not respected by Oolite

General discussion for players of Oolite.

Moderators: another_commander, winston

Post Reply
User avatar
hiran
Theorethicist
Posts: 2027
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

OXP Changes not respected by Oolite

Post 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....
Sunshine - Moonlight - Good Times - Oolite
User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Re: OXP Changes not respected by Oolite

Post 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.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16055
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: OXP Changes not respected by Oolite

Post by Cody »

Ninja'd! Damn squirrels!
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
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: OXP Changes not respected by Oolite

Post 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.
User avatar
hiran
Theorethicist
Posts: 2027
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: OXP Changes not respected by Oolite

Post 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.
Last edited by hiran on Sat Dec 04, 2021 5:21 pm, edited 1 time in total.
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2027
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: OXP Changes not respected by Oolite

Post 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!
Sunshine - Moonlight - Good Times - Oolite
cag
Deadly
Deadly
Posts: 197
Joined: Fri Mar 17, 2017 1:49 am

Re: OXP Changes not respected by Oolite

Post 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.
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: OXP Changes not respected by Oolite

Post 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.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16055
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: OXP Changes not respected by Oolite

Post 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!
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!
cag
Deadly
Deadly
Posts: 197
Joined: Fri Mar 17, 2017 1:49 am

Re: OXP Changes not respected by Oolite

Post 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?
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: OXP Changes not respected by Oolite

Post 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.
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
User avatar
hiran
Theorethicist
Posts: 2027
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: OXP Changes not respected by Oolite

Post 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.
Sunshine - Moonlight - Good Times - Oolite
Post Reply