Announcement

Collapse
No announcement yet.

File switching

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    And you didn't actually play the scenario, did you? You just looked at the text files...
    Mea culpa. I wanted to take a quick look to get an idea of your logic. Take it as a compliment - I like the combination of effectiveness and simplicity of your utilities. That makes me nosey. The comparison of CivSwap start time with sav file creation time is kinda slick.

    If I loaded your scenario would I learn whether CivSwap reads the turn byte of xx_Auto.sav and compares it to the ini file entries or whether you use a different scheme? Looking at your weird stealth bomber frightens me from loading the scn.
    El Aurens v2 Beta!

    Comment


    • #17
      No problem, but trying it out will give you a better idea of how it works. I's really only 12 short turns anyway.

      Well, "my scenario", It's the CiC Alexander scenario. On turn 4 it swaps to the CiC Apocalypse graphics (and new "events"), on turn 8 it switches back.


      And that's what it does indeed... But you wouldn't learn it by starting the scenario. CivSwap only gives 3 clues about how it functions:
      - When it is searching for the file the title bar says "Searching..."
      - When it has found the file ithe title bar gives the name of the autosave.
      - When it is executing the batch file, the title bar says "Executing..."

      After it has found the file, CivSwap goes into an infinite loop. It keeps checking whether the filedate has changed. When it has (i.e. it is your next turn), it will read the turn byte (It will work on all Civ2 versions, by the way, incuding ToT).

      If the turn matches one of the turns mentioned in the INI, it will launch the "command line" you specified for it.

      That command line doesn't actually have to be a batch file, by the way. You could launch any program...

      Now I think of it, you could perhaps automatically launch MapCopy (to do some major terrain changing) or some custom program that hex-edits the savegame.

      Of course, since you still have to reload, you'll lose most of the surprise, but it has some potential there... Kind of a poor-man's CSPL.


      I think I'll post a new thread for CivSwap soon, I fixed a few things, so I think it's "done"... Not to mention this is technically a threadjack, although it is related to and a possible solution to Stefan's dilemma.
      Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

      Comment


      • #18
        I personally HATE having to switch files in the middle of the game. On my computer, batch files often don't run. I don't know why, because even though my computer offers support for them they don't seem to work. This means that I have to manually change all the files. In some cases (i.e. Red Front, and Second Front) this is worth it. However, the added frustration is something I don't need.
        Vote Democrat
        Support Democracy

        Comment


        • #19
          A-HEM!

          Merc, if this thing works, the utility of this utility program will make some things I've been considering, but not doing, do-able.

          Stefan, can you forgive the threadjack? lol.

          Good lord, this thing could literally put my fears to rest. Being able to utilize batch files--and have them run automatically (!!!) would be such a boon!

          Like fairline said; when is it going to be ready?
          Lost in America.
          "a freaking mastermind." --Stefu
          "or a very good liar." --Stefu
          "Jesus" avatars created by Mercator and Laszlo.

          Comment


          • #20
            Fileswapping owns j00.

            Comment


            • #21
              Damn, this boy's good! How does this work with XP, as I see you don't have Choice.com and there's a batch file?

              Oh, and being a numpty, I didn't get it to work - I had a 'Monitor error 53 - 4' when the scenario started and the units file was never changed; the 'surprise.sav' was not created.
              http://sleague.apolyton.net/index.ph...ory:Civ2_Units

              Comment


              • #22
                Originally posted by fairline
                Damn, this boy's good!
                Thank you.

                How does this work with XP, as I see you don't have Choice.com and there's a batch file?
                The choice is only necessary if you have a menu. But using CivSwap you don't need a menu anymore, since it is all automated... However, it is possible, and might be advisable to also add a menu for people who can't or won't use CivSwap.

                Oh, and being a numpty, I didn't get it to work - I had a 'Monitor error 53 - 4' when the scenario started and the units file was never changed; the 'surprise.sav' was not created.
                I must've attached the wrong version. That was a "debug" version I made to track that bug down. I fixed that now.

                Here's the latest version. There's only one noticeable difference: the autosave filename is not attached automatically anymore. Instead, you should use the $AUTOSAVE "variable". It will be replaced with the autosave filename (not the full path by the way, just the filename).

                I think I'll post the new thread as soon as other people have confirmed it works, and when I've written a readme/user's guide for it.

                EDIT: fixed another bug.
                Attached Files
                Last edited by Mercator; October 15, 2003, 12:22.
                Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                Comment


                • #23
                  That's got it! it works so long as you run CivSwap before starting the scenario, but not if you start the scenario first. Good work Mercator!

                  Note to Exile: I guess you still have to edit the 'batch file of death' to carry out the file swap necessary for your particular scenario. Unless of course Mercator can make a nice front end program to do this for you......when will it be ready Merc? (only joking!)
                  http://sleague.apolyton.net/index.ph...ory:Civ2_Units

                  Comment


                  • #24
                    Originally posted by fairline
                    That's got it! it works so long as you run CivSwap before starting the scenario, but not if you start the scenario first.
                    It should. Whenever CivSwap is started it starts looking for an autosave. But since the autosave must be more recent than CivSwap, it'll only find it at the beginning of the next turn.

                    Unless of course Mercator can make a nice front end program to do this for you......when will it be ready Merc? (only joking!)
                    Don't count on it.
                    I don't think I can make it any easier than batch files already are.
                    Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                    Comment


                    • #25
                      Great stuff

                      It works the first time. The second time, it won't change the events file. It's a bit complicated I think. I was in turn 9 (after having loaded surprise.sav in the concerning turn) and nothing happened; but when I loaded original.sav, the gif files were correct, whereas they weren't before.
                      Also, is there some way of making this compatible with the German version? I mean, is it enough to add a further line to the batchfile saying that it should create the German files as well?
                      Follow the masses!
                      30,000 lemmings can't be wrong!

                      Comment


                      • #26
                        Originally posted by Stefan Härtel
                        It works the first time. The second time, it won't change the events file. It's a bit complicated I think. I was in turn 9 (after having loaded surprise.sav in the concerning turn) and nothing happened; but when I loaded original.sav, the gif files were correct, whereas they weren't before.
                        So it had made the changes, but didn't add the events correctly?
                        Or did this happen the second time you "played" the scenario, and did you only do the first swap the first time you played?

                        Anyway, this scenario already swaps back the old files. But in most cases that obviously won't be the case.

                        Maybe I should add a "reset" button. That reset option would then launch the part of the batch file that resets all files back to ther original locations.


                        By the way, do any of you see the MS-DOS windows still open (minimised), or are they all automatically closed?
                        They stay open for me. Not intentionally, but because of that they kind of work as a debugger. You can see if anything failed.


                        Also, is there some way of making this compatible with the German version? I mean, is it enough to add a further line to the batchfile saying that it should create the German files as well?
                        Yes, I think it is.

                        CivSwap launches batch files at set turns, everything else needs to be specified (as usual) in the batch file.

                        The easiest is probably to always copy the German files along as well.

                        Another possibility would be to create separate batch files for English and German (e.g. swap.eng and swap.ger), and a separate "install" batch file that then renames one of those to swap.bat.
                        Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                        Comment


                        • #27
                          Stephan's problem could it be similar to one I identified with BAT files and XP. Boco did some work in an earlier thread which showed that a particular syntax ( ) was needed to get it to run on XP.
                          Tecumseh's Village, Home of Fine Civilization Scenarios

                          www.tecumseh.150m.com

                          Comment


                          • #28
                            Well, the units.gif file is swapped (also swapped back again after turn 8 or whatever the turn is), but the events file remains the same all the time.

                            By the way, do any of you see the MS-DOS windows still open (minimised), or are they all automatically closed?
                            They stay open for me. Not intentionally, but because of that they kind of work as a debugger. You can see if anything failed.


                            I do. It says something about "active files", I believe it refers to the events file.
                            Follow the masses!
                            30,000 lemmings can't be wrong!

                            Comment


                            • #29
                              Just wanted to say this is amazing. Civ2 should by all rights be dead but here is a brand new application in the works.

                              Would moving .sav files between two folders ("Night" and "Day") at specified intervals work, or is that the same as working the batch file to you?
                              "You give a guy a crown and it goes straight to his head."
                              -OOTS

                              Comment


                              • #30
                                Well . . . .

                                Michael, what else is there besides Civ2?

                                If one wants to be creative and design an entirely new "game" what other program out there is so flexible? And the places where it's not flexible are the reasons that these utilities continue to be produced. I've said it before; if there was a better program out there, I'd use it.

                                There isn't.

                                And it may be awhile before one comes along. Frankly, I look at the mere existence of Civ2 as something of a minor miracle.

                                Look at civ3.

                                [/threadjack ]
                                Lost in America.
                                "a freaking mastermind." --Stefu
                                "or a very good liar." --Stefu
                                "Jesus" avatars created by Mercator and Laszlo.

                                Comment

                                Working...
                                X