Announcement

Collapse
No announcement yet.

Practical applications for batchfiles?

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

  • Practical applications for batchfiles?

    I understand that batchfiles can "swap" files at specified time intervals within a scenario.

    Which types of files can it swap?

    For example;

    1.) Can it switch "day" to "night" terrains every six turns throughout a scenario? Or "winter" &" "summer" terrains every 30 turns? Will units on these terrains be affected?

    2.) Can it switch out the UNITS.gif & RULES.txt files simultaneously so that unit types are redefined? Units can become weaker/stonger/faster/etc. during the course of a scenario?

    3.) If I use a batchfile in this way, to create "eras," am I required to write a new EVENTS.txt for each era?

    4.) Can I change cosmic principles with this too?
    Lost in America.
    "a freaking mastermind." --Stefu
    "or a very good liar." --Stefu
    "Jesus" avatars created by Mercator and Laszlo.

  • #2
    Download Capt. Nemo's Red Front and use it as a guide. He changes just about everything twice a year for winter and summer.
    Excerpts from the Manual of the Civilization Fanatic :

    Money can buy happiness, just raise the luxury rate to 50%.
    Money is not the root of all evil, it is the root of great empires.

    Comment


    • #3
      1) Yep (the interval can be set by Civswap [non 1/4/04 version]), nope (it won't eliminate them like ChangeTerrain, but their df and mf will be governed by the new rules). Oops, wait a minute, you could eliminate units by reducing the shield ratings of the terrain in their home city.
      2) Yep, yep
      3) Most likely, yep. Units may have new names that must be referenced correctly in events. Many multiple event file scenarios use a core of events common to all 'eras' together with some era-specific events.
      4) Yep (I think). Some odd things might happen, though. You could cause instant rebellion and bankruptcy.

      Those are the quick and dirty answers. Agricola's got the right idea for more thorough ones.

      I'll bet we'll see some creative ideas in this thread.
      El Aurens v2 Beta!

      Comment


      • #4
        The basic jist:

        A batch file can copy and overwrite anything. In a Civ2 context, it can can take any normally editable file for Civ2 (events.txt, unit.gif, sounds, etc...) and overwrite the file with another. Just run the program and the file overwriting is done for one or many files.

        The problem before Mercator finished CivSwap was one where gameplay had to be stopped to switch files. Often times running a batch file includes very detailed instructions, something that the normal Civ2 player will not read. Now with CivSwap all this crap is done automatically.

        Rules for file swapping in general:

        1) Always cover your previous steps and replace the parts of the scenario that only need replacing.

        2) The more parts, the more complicated the machine.

        3) The more parts, the longer it takes to make a scenario.

        4) File swapping expands possibilities, but ultimately limits the avenues in which to expand.

        5) Re-occuring events and units have to remain a constant in EVERY new file, otherwise they are not re-occurring.

        6) To replace old units in a scenario it is usually wise to make sure the old units cannot possibly exist by the time the event occurs. Otherwise, your enemy may suddenly have a nice new Mig-15, rather than that cheap bi-plane they started out with.

        7) File swapping works wonders with special units. I implore you to check out the idea of "mission building".

        Check out my last scenario, Atomic Eagle, and see what I did with the units and events. After you look at the layout, try and discern why I did what I did.

        Batch files, and especially CivSwap, open up huge possibilities with Civ2MGE, rivaling any of the improved methods built into TOT. The only problem is that file swapping tends to multiply scenario building time.

        Comment


        • #5
          rivaling any of the improved methods built into TOT
          A slight bit of hyperbole , but Bats can accomplish miracles.

          Allard used them to simulate seasonal Nilotic ebbs and flows in River War. It was a great way to pace the player.
          El Aurens v2 Beta!

          Comment


          • #6
            Ok, we're closing in on it.

            So then . . . . .

            If I wanted to differentiate a scenario into 7 distinct "eras," each era having its own Events file, I could do that?

            I think that this effectively solves the problem that's been holding up my Imperial Centuries scenario.

            However . . . .

            I am NOT a programmer. Merc, some of your otherwise exemplary readme for CivSwap was just over my head. Not sure that I can sit down and create an actual batch file myself, but I sure do know exactly what I want done.

            Thanx for all the answers. It appears as though the combination of batchfiles & Merc's new gagdet will make something do-able now.
            Lost in America.
            "a freaking mastermind." --Stefu
            "or a very good liar." --Stefu
            "Jesus" avatars created by Mercator and Laszlo.

            Comment


            • #7
              Creating batch files isn't programming by any stretch of the imagination.

              But some things do seem to be going straight over your head, and I just don't know how to make it any clearer (and I hate that!).

              Batch files don't have anything to do with the actual contents of a file, or the file type, nor do they or can they in any way affect the contents. Batch files only care about the filename. Whether it ends in .gif or .txt, it's really all the same. All that does is distinguish one file from another. Other than that, file types have no bearing on batch fiels.

              Originally posted by Harry Tuttle
              Batch files, and especially CivSwap, open up huge possibilities with Civ2MGE, rivaling any of the improved methods built into TOT.
              Well, obviously not, because CivSwap will also work with ToT. Any of the advantages it might give to MGE apply equally to ToT.
              Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

              Comment


              • #8
                I'm sure as heck not a programmer either, Phenix, but maybe this will help a bit. Bat files are simply a way of stringing together a series of DOS commands. The most important command they use in the context of civ batches is 'copy' which does exactly what it says. Basically, it allows you to have multiple events, units, cities, terrain files in 1 directory and successively copy a new one over the existing one. In this way, taking your example of a Roman scenario, the default unit graphics for the starting era (50AD-99AD in my example below) file 'units.bmp' can be replaced by selecting the appropriate era option displayed when the batch file is run.

                If you look at the text edited from Nemo's Red Front bat below you can see that I have arbitrarily divided a hypothetical Rome scenario into 9 eras from 50AD to 450AD. The cities, units, rules and events files for the first era (AD50) are named cities1, units1, rules1 and events1, those for the second era are cities2 etc. When the bat is launched the text next to the echo command is displayed on the screen. The user selects an option from 1 to 9 in order to select the appropriate era and the bat file, via the choice command, uses the the appropriate set of copy commands to select the set of cities, units, rules and events file for that era.

                Obviously, the scenario folder must contain units files named units1, units2, units3 .... units9 (and the same applies in this example for cities, rules, events) which will be copied over the default units when the appropriate era is chosen by pressing the 1 - 9 keys when the bat file is run.

                Before civswap came along, all this selection had to be done manually. The usual way was to include a text prompt in the events files which popped up when the appropriate game turn was reached, telling the player to save the scenario to a given name (in this case 'Rome.sav'); the player then exited civ, ran the bat and selected the next era before reloading the Rome.sav. What civswap does is automate this, so that no interaction is needed by the player during the course of the game. In other words, civswap carries out the batch file selection when the appropriate game turn is reached without the player having to worry about it.

                BTW, there should obviously be sections for copying the 200AD - 450AD files which I left out to save space in this example:

                @echo off
                cls
                echo.
                echo ROME
                echo.
                echo Loading graphic and event files for next phase of the game
                echo Please choose from the options below:
                echo.
                echo 1. Load year 50AD
                echo 2. Load year 100AD
                echo 3. Load AD150
                echo 4. Load AD200
                echo 5. Load AD250
                echo 6. Load AD300
                echo 7. Load AD350
                echo 8. Load AD400
                echo 9. Load AD450
                echo X. Exit without Loading
                echo.
                choice /c:123456789X Enter your selection

                if errorlevel 10 goto done
                if errorlevel 9 goto AD450
                if errorlevel 8 goto AD400
                if errorlevel 7 goto AD350
                if errorlevel 6 goto AD300
                if errorlevel 5 goto AD250
                if errorlevel 4 goto AD200
                if errorlevel 3 goto AD150
                if errorlevel 2 goto AD100
                if errorlevel 1 goto AD50

                :AD50
                echo.
                echo year 50AD
                copy cities1.gif cities.gif
                copy rules1.txt rules.txt
                copy units1.gif units.gif
                copy events1.txt events.txt
                DELEVENT Rome.sav
                goto done

                :AD100
                echo.
                echo year 100AD
                @echo off
                copy cities2.gif cities2.gif
                copy rules2.txt rules.txt
                copy units2.gif units.gif
                copy events2.txt events.txt
                DELEVENT Rome.sav
                goto done

                :AD150
                echo.
                echo year 150AD
                @echo off
                copy cities3.gif cities.gif
                copy rules3.txt rules.txt
                copy units3.gif units.gif
                copy events3.txt events.txt
                DELEVENT Rome.sav
                goto done


                :done
                echo.
                exit
                quit
                http://sleague.apolyton.net/index.ph...ory:Civ2_Units

                Comment


                • #9
                  Those extra @echo off lines as well everything after the :done is entirely unnecessary.

                  And that looks exactly like what Imperium Romanum uses, and what I explain in my readme.
                  Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                  Comment

                  Working...
                  X