Noob Question About User Pref Files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shalinar
    Rookie
    • Apr 2019
    • 15

    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
    Prophet
    • Dec 2009
    • 9022

    #2
    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.

    Comment

    • Shalinar
      Rookie
      • Apr 2019
      • 15

      #3
      Originally posted by Derakon
      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.

      Comment

      • Shalinar
        Rookie
        • Apr 2019
        • 15

        #4
        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.

        Comment

        • Derakon
          Prophet
          • Dec 2009
          • 9022

          #5
          Originally posted by Shalinar
          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.

          Comment

          • takkaria
            Veteran
            • Apr 2007
            • 1951

            #6
            You can save your settings to a file on the options menu. Then you can examine the syntax.
            takkaria whispers something about options. -more-

            Comment

            • Shalinar
              Rookie
              • Apr 2019
              • 15

              #7
              Originally posted by Derakon
              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.

              Comment

              • Shalinar
                Rookie
                • Apr 2019
                • 15

                #8
                Originally posted by takkaria
                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?

                Comment

                • Sky
                  Veteran
                  • Oct 2016
                  • 2321

                  #9
                  Originally posted by Derakon
                  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.
                  "i can take this dracolich"

                  Comment

                  • takkaria
                    Veteran
                    • Apr 2007
                    • 1951

                    #10
                    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.
                    takkaria whispers something about options. -more-

                    Comment

                    • Nick
                      Vanilla maintainer
                      • Apr 2007
                      • 9634

                      #11
                      OK, first the bad news - you can't save options to a pref file. This possibility was removed "to avoid confusion" about 6 years ago - I don't recall what the confusion was at the time, but there you go. (EDIT: As takkaria just said...)

                      The best way to achieve what you want is Derakon's suggestion of re-using savefiles.

                      The thing that bothers me, though, is that you didn't have a lib/user directory. What operating system are you using, and where did you download the game from?
                      Last edited by Nick; April 4, 2019, 21:25. Reason: Too slow
                      One for the Dark Lord on his dark throne
                      In the Land of Mordor where the Shadows lie.

                      Comment

                      • takkaria
                        Veteran
                        • Apr 2007
                        • 1951

                        #12
                        Originally posted by Nick
                        OK, first the bad news - you can't save options to a pref file. This possibility was removed "to avoid confusion" about 6 years ago - I don't recall what the confusion was at the time, but there you go.
                        I think it was that the interaction between savefile options and pref file options was causing issues. It would probably be fine to reintroduce it on the basis that the pref file just provides defaults for new characters and doesn't affect games loaded from savefiles.
                        takkaria whispers something about options. -more-

                        Comment

                        • Shalinar
                          Rookie
                          • Apr 2019
                          • 15

                          #13
                          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.
                          Ah, okay. I looked through the menus but couldn't find anything that looked like saving my preferences to file from an options menu. I don't see a menu called "Options". Here's the menus I have:
                          File
                          Settings
                          Command
                          (the other menus I didn't screenshot don't have anything related to saving options, I promise )

                          Comment

                          • Shalinar
                            Rookie
                            • Apr 2019
                            • 15

                            #14
                            Originally posted by Nick
                            OK, first the bad news - you can't save options to a pref file. This possibility was removed "to avoid confusion" about 6 years ago - I don't recall what the confusion was at the time, but there you go. (EDIT: As takkaria just said...)

                            The best way to achieve what you want is Derakon's suggestion of re-using savefiles.

                            The thing that bothers me, though, is that you didn't have a lib/user directory. What operating system are you using, and where did you download the game from?
                            Thanks Nick, I've been using that method lately. It's a decent workaround.

                            I downloaded from rephial.org, and I'm on Mac OSX 10.13.6

                            Comment

                            • takkaria
                              Veteran
                              • Apr 2007
                              • 1951

                              #15
                              Ah! The UI is counter-intuitive, I agree... you get options if you press the '=' key.
                              takkaria whispers something about options. -more-

                              Comment

                              Working...
                              😀
                              😂
                              🥰
                              😘
                              🤢
                              😎
                              😞
                              😡
                              👍
                              👎