PDA

View Full Version : Pref files


relic
August 7, 2011, 19:31
I started a new character in 3.3.0, changed options as I want them, and saved them. In order to get these options for all characters, I figured that I would name the file something that would be loaded by Angband at startup, you know like it used to do. So I named it pref-mac.prf which has worked before. But starting another new character these prefs were not loaded. Am I doing something wrong? The pref file is saved in /user/library/preferences/Angband in OSX. Are pref files there read and loaded by Angband?


I could manually copy from one file to another but I refuse to believe that such a clumsy method should be necessary.

dos350
August 7, 2011, 20:28
id like 2 say that b4 this version pref files were bad

relic
August 8, 2011, 13:56
I also notice that saving options don't include birth options! Why not? I think that those are the options that one first of all would want to have the same for all characters. At least I do.

Am I the only one that thinks it is tedious to change birth options for every new character?

Thanks for any thoughts on this matter.

Magnate
August 8, 2011, 14:38
I also notice that saving options don't include birth options! Why not? I think that those are the options that one first of all would want to have the same for all characters. At least I do.

Am I the only one that thinks it is tedious to change birth options for every new character?You shouldn't need to do this. A new character should start with the birth options of the previous character. Did you mean for every new savefile? If so, we kind of assume that people stick with the one savefile (to build up monster memory etc.).

relic
August 8, 2011, 15:38
You shouldn't need to do this. A new character should start with the birth options of the previous character. Did you mean for every new savefile? If so, we kind of assume that people stick with the one savefile (to build up monster memory etc.).

I see. Unfortunately I usually start with a new save-file every time, but I may have to change my habits here.:)

Nomad
August 8, 2011, 16:20
Yeah, I tend to use different save files for each class/race combination, and I'm forever forgetting to switch randarts on at the birth options when I start a new one. I'm not that bothered by lacking the monster memory when I start out; it makes encounters with uniques more exciting!

Max Stats
August 8, 2011, 23:42
I started a new character in 3.3.0, changed options as I want them, and saved them. In order to get these options for all characters, I figured that I would name the file something that would be loaded by Angband at startup, you know like it used to do.There are two pref files that are loaded by default for all players: user.prf and pref.prf. However, the pref file loading code looks for pref files first in the lib/pref directory before trying the user pref directory. Since both of these files ship with the distribution, they will be found in lib/pref and even if you save your prefs to one of these names, they won't load. AFAIK, there are no other global pref filenames. Unless this has changed in 3.3, you can use a class name as a pref filename (Warrior.prf, Mage.prf, etc.) and it will be loaded every time you play a character of that class, but that is about the best you can do.

If you want global pref settings, I can think of three options:

Modify process_some_user_pref_files in dungeon.c and add a call to process_pref_file with a static filename of your choosing (like global.prf).
Save your options to a new file and copy the relevant lines into user.prf in your lib/pref directory.
Bug the maintainers to add a new global user pref filename (or open a ticket (http://trac.rephial.org/)requesting it).

Zikke
August 9, 2011, 00:35
Yeah, I tend to use different save files for each class/race combination, and I'm forever forgetting to switch randarts on at the birth options when I start a new one. I'm not that bothered by lacking the monster memory when I start out; it makes encounters with uniques more exciting!

I use different save files every time I make a new character also. At this point I usually remember all of the pertinent info about monsters (usually from dying to them in the past) so I don't worry about monster memory. I wish the monster memory did save locally so that any character on that computer would add to the same memory.

Magnate
August 9, 2011, 07:13
I use different save files every time I make a new character also. At this point I usually remember all of the pertinent info about monsters (usually from dying to them in the past) so I don't worry about monster memory. I wish the monster memory did save locally so that any character on that computer would add to the same memory.That's been planned for a while, and is closer now we have the new savefile format. Any year now ...

Magnate
August 9, 2011, 07:20
There are two pref files that are loaded by default for all players: user.prf and pref.prf. However, the pref file loading code looks for pref files first in the lib/pref directory before trying the user pref directory. Since both of these files ship with the distribution, they will be found in lib/pref and even if you save your prefs to one of these names, they won't load.Thank you - I didn't know that was the problem! It seems to me that the obvious short term fix is to ship only pref.prf in lib/pref, and allow the user to save user.prf in their private dir as their private global pref file (let's not forget that on multi-user systems, pref.prf would be loaded for all players). I can't imagine there's a need for both of them to be in lib/pref.

In the longer term we want to rationalise this whole issue with a single player-specific "settings" file, with window positions, colours, keymaps, autoinscriptions etc. etc. When you save any of these things, the game should ask you whether you want them applied for all chars, or for this class only, or this char only - etc.

Max Stats
August 9, 2011, 19:13
Thank you - I didn't know that was the problem! It seems to me that the obvious short term fix is to ship only pref.prf in lib/pref, and allow the user to save user.prf in their private dir as their private global pref file (let's not forget that on multi-user systems, pref.prf would be loaded for all players). I can't imagine there's a need for both of them to be in lib/pref
If you wanted to keep the user.prf in lib/pref, you could just bypass the test for whether a file was found there and always load from both locations if found. You could then have a system default user.prf in lib/pref and an "all characters for this account" user.prf in the user's directory. I guess it depends on whether there is a reason to want both files shipped with the distribution.

In the longer term we want to rationalise this whole issue with a single player-specific "settings" file, with window positions, colours, keymaps, autoinscriptions etc. etc. When you save any of these things, the game should ask you whether you want them applied for all chars, or for this class only, or this char only - etc.Can we add starting squelch settings to this list as described here (http://angband.oook.cz/forum/showthread.php?p=53047#post53047)?

relic
August 9, 2011, 20:40
Well, what I did was to copy option preferences from my pref file to pref.prf manually, so that is fixed. And I will remember to set birth options for new characters during birth.

Another thing, I remember that in some variants (or maybe even Vanilla), one had the choice to append option-preferences to a file, (so as to not overwrite the file of course). Maybe something to consider?