Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Vanilla (http://angband.oook.cz/forum/forumdisplay.php?f=3)
-   -   Noob Question About User Pref Files (http://angband.oook.cz/forum/showthread.php?t=9351)

Shalinar April 4, 2019 11:37

Noob Question About User Pref Files
 
Hi All! First post here.

Just getting back into Angband after playing it as a kid. Exciting stuff!

Anyways, there are several changes that I always want to make to the birth options (the "=" menu during character creation), so I wanted to set those to always be what I want by default.

I couldn't find the default settings for those anywhere in the /lib/gamedata or /lib/customize files. In customize.txt, it says we can create our own user pref files to be sourced into the game. However, it's not terribly clear exactly how to accomplish this (or maybe I'm just being dense).

It says that "all of the files are kept in the /lib/user directory", but that directory does not exist. It's also not clear how the user pref files should be named. From reading some of the other forum posts here, it seems that naming the file "MyName.prf" should allow that file to be loaded every time I start a new character named "MyName". Is there a better system than that? I like all of my characters having different names for the flavor :)

I'd also like clarity on how to get Angband to read these files, as I've had zero luck getting this to work so far. What directory should they go in? What should the files be called? What's the format for the birth option (for example, "birth_randarts:1")?

I've tried everything I can think of and have not gotten my custom settings to be read correctly by the game. This includes:
- Creating /lib/user directory
- Creating "MyName.prf" file with desired settings in /lib/user
- Creating "MyName.prf" file with desired settings in /lib/customize
- Adding my custom settings to "pref.prf"
- Adding my custom settings to "user.prf"
...and more!

Some clarity on user pref files would be much appreciated. Thanks!

Derakon April 4, 2019 15:29

If you only play one character at a time, then when that character dies, you can load their savefile to create a new character whose options and birth settings are all the same as the previous character. That's the easiest way to get those settings set, in my opinion.

Shalinar April 4, 2019 15:36

Quote:

Originally Posted by Derakon (Post 137396)
If you only play one character at a time, then when that character dies, you can load their savefile to create a new character whose options and birth settings are all the same as the previous character. That's the easiest way to get those settings set, in my opinion.

But I don't usually want to play the same character. I just want the birth options set the same every game, no matter what character I'm in the mood to roll.

Shalinar April 4, 2019 15:41

Starting a new game with Terminal #1 open, I discovered a parsing error is occurring when it reads MyName.prf file. So, this tells me two important things! First, it is actually reading my custom file when I play character named MyName (woohoo!), and second, that the format for my pref file is incorrect.

Currently it reads like the following:

Code:

# Birth options
birth_randarts:0
birth_connect_stairs:1
birth_force_descend:0
birth_no_recall:0
etc...

What's wrong with this syntax?

Side note, currently MyName.prf is living in /lib/customize, NOT /lib/user where customize.txt says it should.

Derakon April 4, 2019 15:49

Quote:

Originally Posted by Shalinar (Post 137397)
But I don't usually want to play the same character. I just want the birth options set the same every game, no matter what character I'm in the mood to roll.

You don't have to play the exact same character type. When you load a dead character you can choose to either play with the same settings or start chargen over -- but in either case your birth settings and other options stay the same.

takkaria April 4, 2019 17:29

You can save your settings to a file on the options menu. Then you can examine the syntax.

Shalinar April 4, 2019 17:29

Quote:

Originally Posted by Derakon (Post 137399)
You don't have to play the exact same character type. When you load a dead character you can choose to either play with the same settings or start chargen over -- but in either case your birth settings and other options stay the same.

Ah, I see! That's great, that's probably what I'll end up doing.

I'd still like to know what's wrong with my pref file, for future reference.

Shalinar April 4, 2019 17:42

Quote:

Originally Posted by takkaria (Post 137401)
You can save your settings to a file on the options menu. Then you can examine the syntax.

Ok, I tried this. When I opened the file, the relevant part at the top of the file reads like so (copy-pasted here):
Code:

SaveVNLAdescription# Shalinar, L1 Human Warrior, at DL0xrng≠J†*
*p‰∂£;ï#Œà
⁄ T6ÃÊ`…òøÈ9!.N‰ŒLœ√∞Ω∫ìå'êΩ ÑueATʉey*'}L±€,»¬†zn‘∏ˆyø¶/t¡eÒÆ◊†·ò ÒjÌ¢[~ZΩÑ√W‚£E$Òèn≈Ñ˚‰5bŒMÑc¡1Ò‡zNŒMoptions≠•ˆ(nonerogue_like_commandsuse_soundshow_damageuse_old_targetpickup_alwayspickup_invenshow_flavorsshow_targethighlight_playerdisturb_nearsolid_wallshybrid_wallsview_yellow_lightanimate_flickercenter_playerpurple_uniquesauto_morehp_changes_colormouse_movementnotify_rechargeeffective_speedcheat_hearscore_hearcheat_roomscore_roomcheat_xtrascore_xtracheat_livescore_livebirth_randartsbirth_connect_stairsbirth_force_descendbirth_no_recallbirth_no_artifactsbirth_stackingbirth_lose_artsbirth_feelingsbirth_no_sellingbirth_start_kitbirth_ai_learnbirth_know_runesbirth_know_flavorsbirth_levels_persistxxxmessagesAΩj  ====================  Parse error in /Applications/Angband.app/Contents/Resources/lib/customize/Shalinar.prf line 3 column 1: birth_connect_stairs: uParse error in /Applications/Angband.app/Contents/Resources/lib/customize/Shalinar.prf line 3 column 1: birth_connect_stairs: undefined directivexxxmonster memory-No more monstersxxobject memoryÕå

Seeing the giant string of options there, I noticed there were no "1" or "0" values, so I thought perhaps they should be "yes" and "no" values, since that is literally what the birth options menu sets them to, but that didn't work either. I also tried not setting values and instead just including the options that I desired to be "on". Still no dice.

Looking at the parser error, it says column 1 is where it's running into an error, which means the very first non-comment character. So this tells me that the syntax is different from what I thought. However, I can't find any documentation on this.

Does anyone know what the correct syntax is for birth options user preferences?

Sky April 4, 2019 17:46

Quote:

Originally Posted by Derakon (Post 137399)
You don't have to play the exact same character type. When you load a dead character you can choose to either play with the same settings or start chargen over -- but in either case your birth settings and other options stay the same.

that is ... great, but totally counterintuitive. I genuinely had no idea this was a thing.

takkaria April 4, 2019 21:19

I had a look through the code and there is no way to load options from a savefile anymore. If I recall it was taken out because it made managing pref files too complex. You will need to just use the savefile technique.

PS What you pasted was the beginning of your savefile, not a pref file - that's why it's got all that weird-looking stuff in it.


All times are GMT +1. The time now is 09:00.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.