Opening a savefile in Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zero
    Apprentice
    • Jan 2008
    • 83

    Opening a savefile in Windows

    On my old Macintosh computer, I could open a savefile, and the metadata in the Mac filesystem would launch Angband, which then used the savefile I opened without me having to select it explicitly.

    On Windows, I haven't found a way to do this. I tried giving the savefile a .angband extension, and then setting Windows to always launch files of type .angband with Angband, but that didn't work for some reason.

    Is there a way to play the game without having to specify the same savefile every time I launch the application?
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by Zero
    On my old Macintosh computer, I could open a savefile, and the metadata in the Mac filesystem would launch Angband, which then used the savefile I opened without me having to select it explicitly.

    On Windows, I haven't found a way to do this. I tried giving the savefile a .angband extension, and then setting Windows to always launch files of type .angband with Angband, but that didn't work for some reason.

    Is there a way to play the game without having to specify the same savefile every time I launch the application?
    Nope, sorry.
    takkaria whispers something about options. -more-

    Comment

    • ekolis
      Knight
      • Apr 2007
      • 921

      #3
      Wouldn't be too hard to add a new command-line option (for all ports) to load a savefile, though, would it?

      e.g.
      angband -s Ed.angband
      or
      angband --savefile Ed.angband

      to load the Ed.angband savefile in the current directory?

      A user could then create a batch file, shell script, shortcut, or whatever to call "angband --savefile" with whatever savefile is passed in to the script, and associate *.angband files with that script, allowing them to be loaded by double-clicking them...

      Hmm, that actually sounds like something I might be capable of programming into the game, even with my limited knowledge of C...

      I'll see if I can come up with a patch against the latest svn to do that, since while takkaria could clearly do it, he surely has more pressing issues
      You read the scroll labeled NOBIMUS UPSCOTI...
      You are surrounded by a stasis field!
      The tengu tries to teleport, but fails!

      Comment

      • roustk
        Adept
        • Dec 2007
        • 167

        #4
        Originally posted by ekolis
        Wouldn't be too hard to add a new command-line option (for all ports) to load a savefile, though, would it?

        e.g.
        angband -s Ed.angband
        or
        angband --savefile Ed.angband

        to load the Ed.angband savefile in the current directory?
        For unix, they already have angband -u <who> which opens your character named <who>.

        I think that the 3.1.0 Mac port is able to open savefiles in the way the original poster wanted -- in 3.0.9 it launched Angband but you still needed to select the file.

        Comment

        • ekolis
          Knight
          • Apr 2007
          • 921

          #5
          Wonder why that option only works in UNIX? Wouldn't it be trivial to make it work on all platforms? Or are the savefiles for some reason encoded in a platform-specific format (e.g. you can't load a Windows Angband savefile on a Mac)? Seems like an odd design decision to me, but I suppose there must have been some reason for doing it that way if it was done that way... :P
          You read the scroll labeled NOBIMUS UPSCOTI...
          You are surrounded by a stasis field!
          The tengu tries to teleport, but fails!

          Comment

          • takkaria
            Veteran
            • Apr 2007
            • 1951

            #6
            Originally posted by ekolis
            Wonder why that option only works in UNIX? Wouldn't it be trivial to make it work on all platforms?
            Trivial if you know what you're doing, yeah. Also, that's the only way for Unix versions to switch between savefiles until recently-- there was no GUI to do that.

            The reason there's not much point in implementing this for the vast majority of Windows users is that setting up savefiles to load up the game requires an installer or lots of manual tweaking.
            takkaria whispers something about options. -more-

            Comment

            • ekolis
              Knight
              • Apr 2007
              • 921

              #7
              Well, we have one Windows user (Zero) here who is willing to do the "manual tweaking" (renaming the savefile to have some extension like .angband, and setting up the file association, which is pretty trivial itself), so why not add the -u command-line option to the non-Unix ports, and worry about installers and the like later?

              I guess my point is, Windows users are not necessarily unwilling to do a little extra work to get their programs working the way they want, so if Zero wants to set up the *.angband file association on his machine, why lock him out just because of some stereotype of Windows users being lazy?

              Or am I reading too much into your reply?
              You read the scroll labeled NOBIMUS UPSCOTI...
              You are surrounded by a stasis field!
              The tengu tries to teleport, but fails!

              Comment

              • Zero
                Apprentice
                • Jan 2008
                • 83

                #8
                I think the best thing to do is simply keep track of what savefile was used last, and automatically use it when launching Angband.

                Then we can talk about having more than one living character in a savefile.

                These are both very basic features that I'm surprised haven't been implemented yet. Not that I'm criticizing any of the maintainers--I'm happy with any improvements they can make with their limited time.

                Comment

                • Rizwan
                  Swordsman
                  • Jun 2007
                  • 292

                  #9
                  Originally posted by ekolis
                  Well, we have one Windows user (Zero) here who is willing to do the "manual tweaking" (renaming the savefile to have some extension like .angband, and setting up the file association, which is pretty trivial itself), so why not add the -u command-line option to the non-Unix ports, and worry about installers and the like later?
                  And one more. I have often tried to do just the same and failed. I would not mind manually changing the extension and associating the file with angband.
                  Originally posted by ekolis
                  I guess my point is, Windows users are not necessarily unwilling to do a little extra work to get their programs working the way they want, so if Zero wants to set up the *.angband file association on his machine, why lock him out just because of some stereotype of Windows users being lazy?
                  Just because I am stuck with a windows machine (for several reasons) does not mean I cant or dont or wont move my lazy butt

                  Comment

                  • takkaria
                    Veteran
                    • Apr 2007
                    • 1951

                    #10
                    Originally posted by Zero
                    I think the best thing to do is simply keep track of what savefile was used last, and automatically use it when launching Angband.

                    Then we can talk about having more than one living character in a savefile.

                    These are both very basic features that I'm surprised haven't been implemented yet. Not that I'm criticizing any of the maintainers--I'm happy with any improvements they can make with their limited time.
                    When you say "basic", I'm not sure whether you mean conceptually or in code. Certainly, I don't see the need to have more than one character in a savefile-- a savefile *is* a character, and its history. If you want more than one character, have more than one savefile.

                    Keeping track of the last savefile seems worthwhile, though, and a bunch of variants have done it. I think there are more important things for me to focus on at the moment (like game balance), but I always welcome patches!
                    takkaria whispers something about options. -more-

                    Comment

                    • takkaria
                      Veteran
                      • Apr 2007
                      • 1951

                      #11
                      Originally posted by ekolis
                      Well, we have one Windows user (Zero) here who is willing to do the "manual tweaking" (renaming the savefile to have some extension like .angband, and setting up the file association, which is pretty trivial itself), so why not add the -u command-line option to the non-Unix ports, and worry about installers and the like later?

                      I guess my point is, Windows users are not necessarily unwilling to do a little extra work to get their programs working the way they want, so if Zero wants to set up the *.angband file association on his machine, why lock him out just because of some stereotype of Windows users being lazy?

                      Or am I reading too much into your reply?
                      Reading a little more than I meant, I'm afraid. Or at least, differently to what was meant.

                      I simply meant to say-- most people won't use this, so it isn't high on my list of things to do. I think that this discussion exposes a division between conceptions of how the game should work w.r.t. savefiles, though: should they be stored like text files or music files, such that you click on them and they get played, or do you do what most games do and never even expose savefiles to the player, just let them choose between active characters? Really the Windows port has to be designed to do one or the other. (I lean towards the latter, which perhaps explains my slightly hedgy tone. )

                      Still, there's no harm in including it as an option, so if anyone comes up with a working patch, I'll happily include it.
                      takkaria whispers something about options. -more-

                      Comment

                      • ekolis
                        Knight
                        • Apr 2007
                        • 921

                        #12
                        Yeah, I personally use only one savefile for all my characters (that way they can share monster memory and preferences!), so in my use case I'd actually find the "autoload last savefile used" ala Unangband useful - it's just that doing that would aggravate the people who want to use multiple savefiles, one for each character or class or race or whatever! If there were a way to set options so that everything automatically went into 1 savefile in the user's home directory, but that savefile could be partitioned based on various criteria set by the user - e.g. preferences by class, so that warriors can squelch spellbooks but mages autopickup spellbooks - that would probably be ideal for everyone, though...
                        You read the scroll labeled NOBIMUS UPSCOTI...
                        You are surrounded by a stasis field!
                        The tengu tries to teleport, but fails!

                        Comment

                        • roustk
                          Adept
                          • Dec 2007
                          • 167

                          #13
                          Originally posted by ekolis
                          e.g. preferences by class, so that warriors can squelch spellbooks but mages autopickup spellbooks - that would probably be ideal for everyone, though...
                          That already is done. The "Mage.prf" file will only be loaded for mages, "Half-Troll.prf" only for Half-Trolls, and so on. The 'if' statements are already in user.prf, and the race and class specific preference files can go into lib/pref (or where your standard preference file goes).

                          You need to be a bit careful in constructing these -- user.prf is loaded first, then <Race>.prf, then <Class>.prf, and finally <PLAYER>.prf. Later options will override earlier ones.

                          Kevin

                          Comment

                          • Garrie
                            Adept
                            • Feb 2008
                            • 147

                            #14
                            I have a different savefile for each class. And my wife has her savefiles, all in the same folder.
                            In older versions on previous PC's I'm sure I had an icon with something like
                            "c:\roguelikes\angband297\angband.exe c:\roguelikes\angband297\save\aaron.sav" on the command line and it would automatically load a savefile.
                            Best /favorite character

                            Comment

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