Managing multiple events files

Bob

Life means more
Joined
Nov 8, 2001
Messages
69
Location
Versailles, France
In many scenarios with multiple events, units, rules etc files, a bat programme manages all the changes, so you don't have to rename the files manually. You just enter the right combination, and it's done.
It is a very useful thing when the scenario has dozens of versions of the events.txt or the units.gif to simulate the evolution of the situation.
I would like to know how to create such a programme.
Any help would be appreciated!:crazyeyes
 
Use the Notepad! :)

Write all commands and save it as .bat file.

For example:
Here is a fragment from Axis.bat file written for TSFE. It loads Winter 1940/41 settings.


@echo off
cls
echo.
echo THE STRUGGLE FOR EUROPE Version 1.2
echo Axis Medium level
echo.
echo.
echo What do you want to do:
echo.
echo 1. Start new scenario
echo 2. Load season files or reload your saved game
echo X. Exit
echo.
choice /c:12X Enter your selection

if errorlevel 3 goto donec
if errorlevel 2 goto seasonse
if errorlevel 1 goto scenarie

:seasonse
echo.
echo You game must be saved under name EU.sav
echo.
DELEVENT EU.sav
echo Please choose from the options below:
echo.
echo 1. Summer 1940
echo 2. Winter 1940-41
echo 3. Summer 1941
echo 4. Winter 1941-42
echo 5. Summer 1942
echo 6. Winter 1942-43
echo 7. Summer 1943
echo 8. Winter 1943-44
echo 9. Summer 1944
echo a. Winter 1944-45
echo b. Summer 1945
echo c. Winter 1945-46
echo d. Summer 1946
echo e. Winter 1946-47
echo f. Summer 1947
echo g. Winter 1947-48+
echo h. Summer 1948+
echo X. Exit
echo.
choice /c:123456789abcdefghX Enter your selection

if errorlevel 18 goto donec
if errorlevel 17 goto s48e
if errorlevel 16 goto w4748e
if errorlevel 15 goto s47e
if errorlevel 14 goto w4647e
if errorlevel 13 goto s46e
if errorlevel 12 goto w4546e
if errorlevel 11 goto s45e
if errorlevel 10 goto w4445e
if errorlevel 9 goto s44e
if errorlevel 8 goto w4344e
if errorlevel 7 goto s43e
if errorlevel 6 goto w4243e
if errorlevel 5 goto s42e
if errorlevel 4 goto w4142e
if errorlevel 3 goto s41je
if errorlevel 2 goto w4041e
if errorlevel 1 goto s40e

:w4041e
echo.
echo Winter 1940-41
echo.
copy rules2.txt rules.txt
copy wterrain1.bmp terrain1.bmp
copy wterrain2.bmp terrain2.bmp
copy units2.bmp units.bmp
copy Sound\Sound1.wav Sound\Medgun.wav
copy Sound\Sound2.wav Sound\Custom2.wav
copy Sound\Sound4.wav Sound\Extra6.wav
copy Sound\Sound2.wav Sound\Extra3.wav
copy Sound\Sound2.wav Sound\Extra7.wav
copy Events36e.txt events.txt
goto doneb

:doneb
echo.
echo Now close the program and reload your saved game.
echo.
exit
quit
 
You don't specify the dir in that batch file!
How can the computer find those files?

b02(to friends(like you))
 
Originally posted by bixjj02
You don't specify the dir in that batch file!
How can the computer find those files?

If the bat file is in the same directory as the files you're swaping it will automatically use those files. Specifing a directory in the bat would be a very bad idea as different people tend to give scenario directories different names when they install scenarios.
 
Originally posted by Case


If the bat file is in the same directory as the files you're swaping it will automatically use those files.

Thanx man! I was thinking on makin' my Portuguese History Scenario (that has a thread in this forum) with multiple units and events file.

b02(to friends)
 
Thanks for your help! :)
Marko, I think I will take the fragment of your bat file and modify it.
 
Marko's batch program is HUGE, and confusing for an idiot like me. ;) There are so many combinations in his TSFE game that it dumbfounded me. Try right-clicking and 'editing' an existing batch file if you are having trouble.

Having never written a program in DOS before, I found the languare to be easy to understand. Especially having written events in the Civ language.

here is my batch for the Stalingrad scenario:

@echo off
cls
echo.
echo Stalingrad Playtest File Manager Version 1.0
echo.
echo Choose the phase which you want to play.
echo Please choose from the options below:
echo.
echo 1. Load Phase 1 "Outskirts"
echo 2. Load Phase 2 "City in Flames"
echo 3. Load Phase 3 "General Winter"
echo 4. Load Phase 4 "Operation Uranus"
echo 5. Load Phase 5 "Operation Winterstorm"
echo 5. Load Phase 6 "Liquidation"
echo X. Exit without Loading
echo.
choice /c:123456X Enter your selection please

if errorlevel 7 goto done
if errorlevel 6 goto Opt6
if errorlevel 5 goto Opt5
if errorlevel 4 goto Opt4
if errorlevel 3 goto Opt3
if errorlevel 2 goto Opt2
if errorlevel 1 goto Opt1

:Opt1
echo.
echo Phase 1 "Outskirts" loading...
copy rules1.txt rules.txt
copy Sunits.gif units.gif
copy events1.txt events.txt
copy Sterrain1.gif terrain1.gif
copy Sterrain2.gif terrain2.gif
DELEVENT SG.sav
goto done

:Opt2
echo.
echo Phase 2 "City in Flames" loading...
copy rules2.txt rules.txt
copy Sunits.gif units.gif
copy events2.txt events.txt
copy Sterrain1.gif terrain1.gif
copy Sterrain2.gif terrain2.gif
DELEVENT SG.sav
goto done

:Opt3
echo.
echo Phase 3 "General Winter" loading...
copy rules3.txt rules.txt
copy Wunits.gif units.gif
copy events3.txt events.txt
copy Wterrain1.gif terrain1.gif
copy Wterrain2.gif terrain2.gif
DELEVENT SG.sav
goto done

:Opt4
echo.
echo Phase 4 "Operation Uranus" loading...
copy rules4.txt rules.txt
copy Wunits.gif units.gif
copy events4.txt events.txt
copy Wterrain1.gif terrain1.gif
copy Wterrain2.gif terrain2.gif
DELEVENT SG.sav
goto done

:Opt5
echo.
echo Phase 5
copy rules5.txt rules.txt
copy Wunits.gif units.gif
copy events5.txt events.txt
copy Wterrain1.gif terrain1.gif
copy Wterrain2.gif terrain2.gif
DELEVENT SG.sav
goto done

:Opt5
echo.
echo Phase 5
copy rules6.txt rules.txt
copy Wunits.gif units.gif
copy events6.txt events.txt
copy Wterrain1.gif terrain1.gif
copy Wterrain2.gif terrain2.gif
DELEVENT SG.sav
goto done

:done
echo.
exit
quit

Mine is not terribly complicated. Try looking at batch files from smaller scenarios which dont have so many options like Marko's. No offense Marko, but yours is so large it may be overwhelming to a begginer. I'll attatch mine here in a zip, if you want to check it out.

-FMK.
 
Many thanks to both of you!
One more question: the DELEVENT file.
OK, it seems self-explanatory, but in your two batch files, you include an extra line mentioning it. I thought the events were simply overwritten, like the units and others. And it seems that it only works for one saved game: the famous SG or EU.sav . Is there a rational reason for it that could be explained to a "first-year wizard" like me?
 
By the way, FMK, did a Gen von Klesh really exist or is it the result of hours of intense reflexion? It's a question I'm already asking myself for weeks!
:lol:
 
When you save a game then events are saved inside the savefile. And when you later load the game then Civ2 reads events from .sav file and not from events.txt. It reads events.txt only if .sav file contains no events.
So, simply changing events.txt gives nothing, you must delete events from saved game first.

The program Delevent.exe does just that - it deletes old events from specified savefile. The name of saved file must not be EU or SG, you can write to .BAT program whatever name you wish. The command line in bat is:

DELEVENT filenime.sav

Only remember to save the file always as you wrote in .bat!
And remind it to players too - best via events message popping up in right date.

Delevent works not only with .sav files. In TSFE Multiplayer version I had DELEVENT EU.hot and DELEVENT EU.net commands too and they worked fine!

The Delevent.exe came with the main game, so you must have it in Civ2 folder. Copy it to your scenario folder, write the neccessary lines to the BAT and it will work! :)
 
OK, Marko, I appreciate your help very much!

For the moment I'm still playing your TSFE scenario. As I don't have much time to play and I need half an hour per turn (I always think very deeply where to place every single unit, and since there are dozens of them...), I'm sorry I can't send you my saved games quicker...:(
 
Originally posted by Bob
By the way, FMK, did a Gen von Klesh really exist or is it the result of hours of intense reflexion? It's a question I'm already asking myself for weeks!
:lol:


Nah man, I totaly made it up dude. I have looked on Google to see if there really were any Klesh's around. But I gave myself this name as a result of playing the old board game Stratego™. The highest ranking piece in that game is the Marshal, and since I beat all my friends in that game every time.... The Field Marshal Klesh was born. ;) Charming story is'nt it?

About the delevent.... I actually had no idea what it was. It was in the zip for RedFront (which was the batch that I looked at to understand how to do it) so I just copied the line and included the file... :lol: Imitation is the greatest form of flatery

-FMK.
 
:lol:
Excellent! That's exactly the way I feel! It's always a good thing to benefit from the elders's experience. It makes the world move forward!
I've taken at look at your batch file, it's indeed fairly simple. Marko's was bigger because it had to include more options, but I see the whole process is not difficult.

Oh, I have another question to all: do you write your events.txt using the Editor tool of Civ2 or the Notepad? I've tried with Civ2 but it can handle only one text at a time, as far as I know.
Thank you :)
 
I use notepad as well. I have heard strange things about th editors in CivII messing up other aspects of your scen when you use it. As far as size goes, I just would load the scen up to make sure I had no errors in my script... once that was established I looked at the events editor and there is a bar along the right side that tells you how full your file is...

As far as size limitations regarding what type of event and such... I dont know anything about that. For my scen I am getting between 17-18kb per file. Way too small for my likings. :(

-FMK.
 
Yes, it's really a pity the events space is so small. Sometimes you have to give up some interesting aspect of a scenario because you don't have enough space to realize it.
The multiple event files thing is really a very good idea! I wonder who was the first to use it in a scenario.
 
Oh, yes, I played it, too! Really good, I must say.
I remember you had to change the files manually, but it was already a significant break-through
 
Top Bottom