Announcement

Collapse
No announcement yet.

Are Bat. files obsolete?

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

  • #31
    Here's the SoG bat file.
    Code:
    @echo off
    cls
    echo.
    echo         Seeds of Greatness (v1.1) 
    echo.
    echo (Copies in the correct Events file for the chosen civilization)
    echo.
    echo Please select your civ from the list below:
    echo.
    echo 1. Hittites
    echo 2. Babylonians
    echo 3. Assyrians
    echo 4. Egyptians
    echo 5. Persians
    echo 6. Greeks
    echo 7. Minoans
    echo X. Exit without Loading
    echo.
    choice /c:1234567X Enter your selection
    
    if errorlevel 10 goto done
    if errorlevel 9 goto done
    if errorlevel 8 goto done
    if errorlevel 7 goto Crete
    if errorlevel 6 goto Greece
    if errorlevel 5 goto Persia
    if errorlevel 4 goto Egypt
    if errorlevel 3 goto Assyria
    if errorlevel 2 goto Babylon
    if errorlevel 1 goto Hatti
    
    :Hatti
    echo.
    echo Hittites
    copy Events-H.txt events.txt
    goto done
    
    :Babylon
    echo.
    echo Babylonians
    copy Events-B.txt events.txt
    goto done
    
    :Assyria
    echo.
    echo Assyrians
    copy Events-A.txt events.txt
    goto done
    
    :Egypt
    echo.
    echo Egyptians
    copy Events-E.txt events.txt
    goto done
    
    :Persia
    echo.
    echo Persians
    copy Events-P.txt events.txt
    goto done
    
    :Greece
    echo.
    echo Greeks
    copy Events-G.txt events.txt
    goto done
    
    :Crete
    echo.
    echo Minoans
    copy Events-M.txt events.txt
    goto done
    
    :done
    echo.
    exit
    quit
    From Tech and my past experience, the only possible crash point in the bat file is on the CHOICE line. I'm assuming that you saw no error message such as 'file not found' in the dos window.

    Since you crashed later, I strongly suspect the problem lies with a scenario file other than the bat file. First suspect is the title.gif. Try renaming it and starting the scenario. The scenario may start normally (without the opening graphic). My other suspects are corrupted rules and events files. Reunzipping from Kull's zips should solve that kind of problem. Otherwise, I'm stumped.
    El Aurens v2 Beta!

    Comment


    • #32
      Windows XP might not like some of what comes after the choice line. The errorlevel 10 and errorlevel 9 lines are unnecessary.

      Well, re-unzip the scenario and try starting the scenario without running the batch file. The batch file only controls events, so the scenario should start just fine (except you won't have events)... If the scenario still crashes, it's a text/graphics file problem. If the scenario doesn't crash, it's a batch file problem.
      Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

      Comment


      • #33
        Yeah, the game plays ok w/o the batch. I'll try unzipping but the scenario creator said the events file greatly improves the game. Thx guys.

        Comment


        • #34
          Berzerker, there's always the manual alternative. The important line for you is
          Code:
          copy Events-B.txt events.txt
          Kull stores the Babylonian events in Events-B.txt. With Windows Explorer or its ilk, you could try the following:[list=1][*]Delete Events.txt[*]Copy and paste Events-B.txt[*]Rename "Copy of Events-B.txt" to Events.txt[/list=1]

          Merc, does XP handle Errorlevels differently from earlier versions? Granted the first two "if errorlevel" lines are useless. AFAIK, XP still supports EL's up to 255. Choice doesn't seem to corrupt EL1 into EL10. That would be nasty.

          [JUNK]

          I did find XP (maybe NT, too) has some new toys.
          Code:
          @echo off
          setlocal
          echo Checking OS
          ver|find "XP"
          if not errorlevel 1 goto :Choice
          echo This OS is not Windows XP
          goto Done
          :Choice
          echo.
          set /p UserInput=Choose 1-3:
          set UserInput=%UserInput:~0,1%
          if "%UserInput%"=="1" goto Continue
          if "%UserInput%"=="2" goto Continue
          if "%UserInput%"=="3" goto Continue
          goto Choice
          :continue
          goto Ans%UserInput%
          :Ans1
          echo Ans%UserInput%
          goto Done
          :Ans2
          echo Ans%UserInput%
          goto Done
          :Ans3
          echo Ans%UserInput%
          goto Done
          :Done ' why are smileys interpreted between code markers?
          echo.
          echo Did it work?
          I know the "goto Continue" and "goto Ans%UserInput%" add an extra few lines unnecessarily, but I was exploring a little.

          So, XP can bypass CHOICE.COM with set /p. Unfortunately it stores only the first character entered by the user as a variable. That's probably not a fatal flaw.

          Haven't figured out how to trap the error that happens when choice.com isn't found in the path.

          [/JUNK]

          All of this junk is to say that you can write batch files that check OS versions and for newer ones, use an alternative to choice.com.
          El Aurens v2 Beta!

          Comment


          • #35
            I don't have XP, so I was just guessing (and being a perfectionist).

            Interesting and useful info about the /p switch too.
            Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

            Comment


            • #36
              Mercator, Angelo, anybody,

              Do you know of any websites that have tutorials for vbs scripting? I can search MS or Google, but thought I'd check first. It just seems a more elegant approach. I'm not asking you to write one—it just might be within my reach. It'd be nice just to have a simple OK/Cancel dialog with radio buttons to do this stuff. I'm actually after a vbs alternative combining Gothmog's ToT setup/restore batch files. His stuff is very well written, but it'd be nice to try something more windowsy.
              El Aurens v2 Beta!

              Comment


              • #37
                Here you go:


                That's the guides I use... um, well... I have them on my computer anyway.
                Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                Comment


                • #38
                  Thanks!

                  Okay it looks like the only input 'native' VBScripts can take are from MsgBox (Yes/No) or InputBox (a string). Tell me that I'm wrong.

                  Writing a Yes/No front end to Gothmog's Setup and Restore bats for ToT is within my capability, but a form on an HTML page isn't.

                  Still I can get rid of Choice.com.
                  El Aurens v2 Beta!

                  Comment


                  • #39
                    Yep, MsgBox and InputBox is all there is... I guess you could put the entire menu in the InputBox text and ask the user to enter the correct number. You can check that value for validity after that.
                    Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                    Comment


                    • #40
                      I have a old but legal copy of Visual Basic 6.0 Learning Edition. Is it worth installing on either a W98 or a WXP PC if I want to create a simple installation form with option buttons? I could probably write it in Excel VBA in 30 minutes (It used to be 5 minutes, but I'm rusty ), but then there'd be a requirement for Excel. What does VB6LE require on the user's PC?
                      El Aurens v2 Beta!

                      Comment


                      • #41
                        That's exactly what I've been using to make my utilities.

                        The user would require the VB run-time files, as you would have needed to install for MapEdit or any of my other utilities (and available on my website). It's slightly under 1MB in size... Of course everybody will already have those, thanks to me. And more seriously, I'm pretty sure everyone with WindowsXP actually does have them.

                        I also suggest you install the VB SP5, if you don't have it already:
                        Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


                        For some controls you would need to add extra files (e.g. for the Open/Save File dialog, as I used in MapEdit). Those are the files that may make an installation a bit tedious, because they can't really be installed by hand easily... But those controls have to be added separately in VB as well (from the Components list), so you'll know which ones they are.
                        Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                        Comment

                        Working...
                        X