Thread Tools
Old March 27, 2002, 19:35   #1
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
Batch Files
How do you may batch files like .bat for civ2, coz i wanna have muiltaplayer events in my scenario?
Soundwave is offline  
Old March 28, 2002, 15:08   #2
our_man
Civilization II Democracy Game: Red FrontScenario League / Civ2-Creation
Prince
 
our_man's Avatar
 
Local Time: 23:15
Local Date: October 31, 2010
Join Date: Oct 2000
Location: Glasgow, Scotland
Posts: 522
My advice is to use an existing batch file for a template - for example the one I used in my United Irishman scenario originally came from Redfront; I simply deleted what I did not need, renamed what was required and that was that. Open it up in notepad and take a look. I'm afraid I don't know how to make one up from scratch though.
our_man is offline  
Old March 28, 2002, 15:17   #3
Paul Hanson
King
 
Paul Hanson's Avatar
 
Local Time: 23:15
Local Date: October 31, 2010
Join Date: Aug 1999
Location: Dilbert
Posts: 1,839
Take this as an example. This is from Red Front, BTW. I've numbered the lines to make it easier to refer to them.

1.@echo off
2.copy wterrain1.gif terrain1.gif
3.copy wterrain2.gif terrain2.gif
4.copy wcities.gif cities.gif
5.copy rules2.txt rules.txt
6.copy units2.gif units.gif
7.copy events2.txt events.txt
8.DELEVENT RF.sav
9.exit

Line 1 will ensure that the bat file does not report back everything it is doing whilst it is working.

Lines 2 through 7 are copying files, and renaming them in the process. For instance, line 2 is taking the file wterrain1.gif and making a copy, which is named terrain1.gif. When doing your own, simply insert the name of the file you wish to copy and tell it to rename it to whatever you want. Line 7 is probably the one you are interested in; it is taking a file called events2.txt, which Civ2 will not recognise, and renaming it to events.txt, so Civ2 will use it as the events file.

Line 8 is important; it is using the Microprose program DELEVENT, which removes the events data from a saved game file, in this case RF.sav. When playing your scenario, you must instruct people to give the save file a particular name, or this will not work.

Line 9 is quitting the bat file and shutting the window it creates when it runs.
__________________
"Paul Hanson, you should give Gibraltar back to the Spanish" - Paiktis, dramatically over-estimating my influence in diplomatic circles.

Eyewerks - you know you want to visit. No really, you do. Go on, click me.
Paul Hanson is offline  
Old March 28, 2002, 15:17   #4
klesh
King
 
klesh's Avatar
 
Local Time: 18:15
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
Yes, our_man is right. If you can figure out CivII events language, you can get the batch language. Just right click an existing batch file and select 'edit'.

-FMK.

Edit: yes, very nice description Paul, you posted in mid post for me
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 28, 2002, 15:53   #5
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
but i dont get it


do i have to write heaps of lines to say change units1 to units

then units2 to units??
Soundwave is offline  
Old March 28, 2002, 15:59   #6
our_man
Civilization II Democracy Game: Red FrontScenario League / Civ2-Creation
Prince
 
our_man's Avatar
 
Local Time: 23:15
Local Date: October 31, 2010
Join Date: Oct 2000
Location: Glasgow, Scotland
Posts: 522
It depends on the complexity of the scenario - e.g. no. of event files. Just use RF for a template and most of the work you'll be doing will be deleting.
our_man is offline  
Old March 28, 2002, 16:13   #7
Paul Hanson
King
 
Paul Hanson's Avatar
 
Local Time: 23:15
Local Date: October 31, 2010
Join Date: Aug 1999
Location: Dilbert
Posts: 1,839
Soundwave; do you know the basic names for all the files that make up a Civ2 scenario? I'll assume that you do, but if you don't just say so and I'll explain it.

Lets assume that you have a five part scenario, and that each part of the scenario has a different events file. You would probably name the files like so: events1, events2, events3, events4 and events5 (these will, of course, all have the .txt extension. Before beginning the scenario, the player would have to run the batch file for the first part, which would contain a line like:

copy events1.txt events.txt

This will copy the events1.txt file, creating a copy called events.txt. Civ2 will now detect this file and use it as the one for the first part of your scenario. When the time comes to change events files, you would indicate this in game via an event that reads something like "Change to the next set of events", or something similar. At this point, you would instruct the player to run the next bat file, which would contain the lines:

DELEVENT savegame.sav
copy events2.txt events.txt

Or something similar. This would wipe the events data in the samegame file and replace the current events file with the next one. The savegame would then be reloaded and all the units and such would remain the same, but the events would be different.

This is tricky to explain. My advice would be to follow our_man's advice and check out some existing bat files.
__________________
"Paul Hanson, you should give Gibraltar back to the Spanish" - Paiktis, dramatically over-estimating my influence in diplomatic circles.

Eyewerks - you know you want to visit. No really, you do. Go on, click me.
Paul Hanson is offline  
Old March 28, 2002, 16:36   #8
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
I have 8 different events files, muilt, british, french, russia, austria, ottoman, italian, german.. HELP!@
Soundwave is offline  
Old March 28, 2002, 17:11   #9
our_man
Civilization II Democracy Game: Red FrontScenario League / Civ2-Creation
Prince
 
our_man's Avatar
 
Local Time: 23:15
Local Date: October 31, 2010
Join Date: Oct 2000
Location: Glasgow, Scotland
Posts: 522
Then instead of using numbers, use eventsF for the French, eventsE for the English etc. and get the bat file to rename these to events. It doesn't require a particularly complicated bat file Soundwave, you don't even have to make use of the delevent.exe!

I take it that these files are only meant to be run at the beginning of a scenario of course when you're deciding what player you want to play as. If you still can't do it, I advise leaving it. It really isn't too hard for players to change one letter in an events file to decide what events they want to use!
our_man is offline  
Old March 28, 2002, 18:16   #10
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 18:15
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
oh my god man, learn to use DOS for crying out loud! It's simple text macros!
DarthVeda is offline  
Old March 28, 2002, 20:54   #11
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 16:15
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
I have a question. I want to use a bat file to make it possible to easily copy and replace files for my Red October scenario. 3 files (city.bmp, dialog.bmp and Civwin_back.bmp) go in the Original directory. 3 more (intro.dll, mk.dll and tiles.dll) go in the ToT main directory.

What I would like to do is have these files plus the bat file go in the Red October folder along with all the other files. Then by operating the bat file from there, have the 3 bmp files copied into the Original directory and the 3 dll files copied into the ToT directory, and the appropriate backups made. Then I'd like the bat file to be able to reverse the process.

Is it possible to do this? And, if so, how do I specify the correct path? I've been able to modify the bat files of others to copy and backup files within a single scenario folder, so I know how to do that much at least.
techumseh is offline  
Old March 29, 2002, 00:05   #12
The ANZAC
Civilization II PBEMCivilization II Democracy Game: Red FrontScenario League / Civ2-Creation
King
 
The ANZAC's Avatar
 
Local Time: 17:15
Local Date: October 31, 2010
Join Date: Jan 2000
Location: The Rodina!
Posts: 2,334
Techumseh: Look at Andrew Living's Crises of the New World Order. It has stuff like what you just said in a batch file.
__________________
Georgi Nikolai Anzyakov, Commander Grand Northern Front, Red Front Democracy Game
The ANZAC is offline  
Old March 29, 2002, 00:37   #13
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
Right i cut it down all i want is a .bat file to make muiltplayer events and singel player.... ummmm how do i make a .bat file?

Sorry i have no idea about MS Dos, looked at it got more, played Civ2
Soundwave is offline  
Old March 29, 2002, 01:36   #14
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 16:15
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Soundwave: Copy someone's bat file and move it into your scenario's folder. Right click on it with your mouse; select edit. Read what's there. Figure out how it works. Make whatever changes you need for your own purposes. It's not that hard.

the ANZAC: Thanks, I will.
techumseh is offline  
Old March 29, 2002, 11:34   #15
klesh
King
 
klesh's Avatar
 
Local Time: 18:15
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
Quote:
Originally posted by Soundwave
Right i cut it down all i want is a .bat file to make muiltplayer events and singel player.... ummmm how do i make a .bat file?
Quote:
Originally posted by Field Marshal Klesh
Just right click an existing batch file and select 'edit'.

-FMK.

-----------------------------------------------------------------------------
Here is the incomplete batch file for Stalingrad:

@echo off
cls
echo.
echo Stalingrad Playtest File Manager Version 1.0
echo.
echo Choose the phase which you want to play.
echo You have the following options:
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 units1.gif units.gif
copy events1.txt events.txt
copy Sterrain1.gif terrain1.gif
copy Sterrain2.gif terrain2.gif
copy cities1.gif cities.gif
copy Game1.txt Game.txt
copy sound\Missile1.wav sound\Missile.wav
echo.
echo Welcome to Stalingrad, Herr Paulus!
goto done

:Opt2
echo.
echo Phase 2 "City in Flames" loading...
copy rules2.txt rules.txt
copy units2.gif units.gif
copy events2.txt events.txt
copy Sterrain1.gif terrain1.gif
copy Sterrain2.gif terrain2.gif
copy cities1.gif cities.gif
copy Game2.txt Game.txt
copy sound\Missile2.wav sound\Missile.wav
DELEVENT SG.sav
echo.
echo We must take the banks of the Volga, Herr Paulus!
goto done

:Opt3
echo.
echo Phase 3 "General Winter" loading...
copy rules3.txt rules.txt
copy units3.gif units.gif
copy events3.txt events.txt
copy Wterrain1.gif terrain1.gif
copy Wterrain2.gif terrain2.gif
copy cities2.gif cities.gif
copy Game2.txt Game.txt
copy sound\Missile2.wav sound\Missile.wav
DELEVENT SG.sav
echo.
echo Another winter campaigning in Russia...
goto done

:Opt4
echo.
echo Phase 4 "Operation Uranus" loading...
copy rules4.txt rules.txt
copy units3.gif units.gif
copy events4.txt events.txt
copy Wterrain1.gif terrain1.gif
copy Wterrain2.gif terrain2.gif
copy cities2.gif cities.gif
copy Game2.txt Game.txt
copy sound\Missile2.wav sound\Missile.wav
DELEVENT SG.sav
echo.
echo There's been word of a Soviet breakthrough!
goto done

:Opt5
echo.
echo Phase 5
copy rules5.txt rules.txt
copy units3.gif units.gif
copy events5.txt events.txt
copy Wterrain1.gif terrain1.gif
copy Wterrain2.gif terrain2.gif
copy cities2.gif cities.gif
copy Game2.txt Game.txt
copy sound\Missile2.wav sound\Missile.wav
DELEVENT SG.sav
goto done

:Opt6
echo.
echo Phase 6
copy rules6.txt rules.txt
copy units3.gif units.gif
copy events6.txt events.txt
copy Wterrain1.gif terrain1.gif
copy Wterrain2.gif terrain2.gif
copy cities2.gif cities.gif
copy Game2.txt Game.txt
copy sound\Missile2.wav sound\Missile.wav
DELEVENT SG.sav
goto done

:done
echo.
exit
quit

--------------------------------------------------------------------------------


It is all self explanitory.

Events files are numbered.
Graphics are based on winter/summer looks.
There is a wav file that gets changed as well.
DELEVENT- deletes the events within the save file. I am making people name it 'SG.sav'

Each 'Opt' is what is going to happen when the person selects that phase of the game.

If you have seperate set ups for each country, just write it out so all the proper files are used.

The game only actually reads the generic file names: 'events', 'game', 'rules', 'cities' etc ect. So you have to have the batch file rename all your sepeate civ files to these generic file names (which are to be read by Civ when the player plays).

It really is pretty simple.

-FMK.
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 29, 2002, 15:03   #16
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
Whats echo?
Soundwave is offline  
Old March 29, 2002, 15:43   #17
klesh
King
 
klesh's Avatar
 
Local Time: 18:15
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
'echo' is for what will be displayed for the person. I have chosen to use a little flare in displaying a message to the user when he completes an operation.

'echo.' is what is used when you just want a space in the display... the line is skipped.

-FMK.
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 29, 2002, 15:46   #18
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 00:15
Local Date: November 1, 2010
Join Date: Dec 1969
Posts: 3,079
EDIT... crosspost
Mercator is offline  
Old March 29, 2002, 23:05   #19
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 16:15
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Using Andrew Livings batch file as a template, I can now copy a dialog file from the Red October scenario file into the Original directory and back up the original dialog bmp. Thanks Anzac.

The problem is reversing it. I'm trying to make a bat file which copies the backup dialog file over the new one, thus restoring the files to their original state. But it doesn't work. Here's the command line from the bat file:

if exist ..\Original\dialogorg.bmp ren ..\Original\dialogorg.bmp dialog.bmp

Dialogorg.bmp is the backed up file. When I run the bat file, I get this message: "duplicate file name or file in use." I don't understand why it won't overwrite the dialog file; this seems common enough in multi-events type games. Can anyone help?
techumseh is offline  
Old March 30, 2002, 00:18   #20
The ANZAC
Civilization II PBEMCivilization II Democracy Game: Red FrontScenario League / Civ2-Creation
King
 
The ANZAC's Avatar
 
Local Time: 17:15
Local Date: October 31, 2010
Join Date: Jan 2000
Location: The Rodina!
Posts: 2,334
Well, with Andrew's, you have to leave it running and when you shut off Civ2 everything gets restored. I haven't investigated how this happens though.
__________________
Georgi Nikolai Anzyakov, Commander Grand Northern Front, Red Front Democracy Game
The ANZAC is offline  
Old March 30, 2002, 00:36   #21
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 16:15
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Quote:
Originally posted by The ANZAC
Well, with Andrew's, you have to leave it running and when you shut off Civ2 everything gets restored. I haven't investigated how this happens though.
No, the new files exist until you run the bat. file again. In the one case where the file is copied to another directory, city.gif, it's a one time only thing, which can't be reversed unless you rename things manually.
techumseh is offline  
Old March 30, 2002, 00:37   #22
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
Ummm, guys i have another problem, i kinda dropped the idea of muiltable events, and now i can use one! YAY!, ok now the problem... they dont work!! AHH! It keeps coming up with events cant be used, debug them, and i looked all thourgh them and they look fine!! some one help i'm so pissed!!
Soundwave is offline  
Old March 30, 2002, 01:06   #23
Case
Civilization II PBEMCivilization II Democracy Game: Red FrontScenario League / Civ2-Creation
Emperor
 
Case's Avatar
 
Local Time: 08:15
Local Date: November 1, 2010
Join Date: Feb 2000
Posts: 3,057
If you've got FW, then load the events in that, and you can then run debug

Failing that, check for spelling mistakes - all it takes is one missplaced letter and the entire thing won't work
Case is offline  
Old March 30, 2002, 01:20   #24
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
I've got MGE! is that bad?

Umm i've checked every letter...
Soundwave is offline  
Old March 30, 2002, 20:35   #25
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
So what should i do now??
Soundwave is offline  
Old March 30, 2002, 23:59   #26
klesh
King
 
klesh's Avatar
 
Local Time: 18:15
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
You have to check it again. All it takes is one character to be out of place...

-FMK.
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 31, 2002, 00:06   #27
Soundwave
Prince
 
Soundwave's Avatar
 
Local Time: 10:15
Local Date: November 1, 2010
Join Date: Aug 2001
Posts: 777
Thanks, i spent about 30mins checkin gthe things and i misplaced the ENDTEXT after the txt on everysingle one excpet the start one.. so yay!
Soundwave is offline  
Old April 6, 2002, 09:34   #28
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 00:15
Local Date: November 1, 2010
Join Date: Dec 1969
Posts: 3,079
Quote:
Originally posted by techumseh
[...]
Dialogorg.bmp is the backed up file. When I run the bat file, I get this message: "duplicate file name or file in use." I don't understand why it won't overwrite the dialog file; this seems common enough in multi-events type games. Can anyone help?
Use the MOVE command instead. You can have a look at my FW version of Shay's Age of Piracy scenario... I didn't use MOVE myself.

Well, here it is:

@ECHO OFF
if not EXIST Piracy.scn goto NOTE
if not EXIST Backup\Game.txt goto INIT
goto UNDO

:INIT
md Backup
copy ...\Labels.txt Backup
copy ...\Game.txt Backup
copy ...\Scredits.gif Backup
copy ...\Scredits.txt Backup
copy Labels.txt ...
copy Game.txt ...
copy Scredits.gif ...
copy Scredits.txt ...
cls
echo AGE OF PIRACY is ready to play!
echo.
goto END

:NOTE
echo This file must be run from your Piracy directory.
echo That directory must be a subdirectory of the CivilizationII
echo 'Scenario' folder.
echo.
goto END

:UNDO
copy Backup\*.* ...
deltree /Y Backup
cls
echo AGE OF PIRACY has been temporarily disabled.
echo.

:END


A short explanation:
- If the piracy.scn file isn't in the same directory as the batch file it displays a note.
- Else if it can't find a backup of the game.txt, I assume the "special" files haven't been installed. It will do so now by copying the originals to the backup folder and copying the piracy files to the main Civ2 directory. After that it will display a message to show the user AoP has been "enabled"
- Else (it can find a backup), the backups are copied back (overwriting the Piracy ones) and the backup directory is deleted. Again, a message is displayed to show the user AoP has been "disabled".
Mercator is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 18:15.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team