I left a post at the end of another of my threads asking for help in the creation and usage of batch files (maybe a text manual or previous thread). I guess most folks just thought that thread was through. Oh well. Anyway, does anyone have a guide to creating and using batch files in a scenario? I've heard they can make miracles happen (well maybe not quite), and I would like to get acquainted with using them in my scenarios, especially since I downloaded CivSwap. Some please help me.
Announcement
Collapse
No announcement yet.
Batch Files
Collapse
X
-
Have you read the CivSwap readme?
In addition to that, see these links. They're far more general, though. You probably won't need to use much of it, but it'll give an idea of what batch files can do at least:
Batch files help and information including a full list of questions and answers that help answer how to make, run, and edit batch files.
Then have a look at some of the existing scenarios with batch files. If you still have questions, fire away!
-
From MU's 2nd link.
Debugging
Testing a batch-file for correctness, and removing 'bugs' if necessary.
Several approaches -:- Print statements. putting echo statements in the file will allow you to see at which point the program took a nose-dive.
- Stepping through the code. COMMAND.COM /Y /C batch_file_name.BAT
Have you read the CivSwap readme?
Comment
-
Usually, you use the copy command (e.g. COPY EVENTS1.TXT EVENTS.TXT, then later on COPY EVENTS2.TXT EVENTS.TXT). That way you avoid any chance of overwriting the original.
Then have a look at some of the existing scenarios with batch files.
Comment
-
I wrote this SETUPSND prototype for a Scenario Creation Handbook that never was released. You may find it useful (The sentences between * are comments, you have to delete them):
---------------------------------------------------------------------
@echo off *This hides the messages; user will only see the ECHOS*
REM This is a prototype batch file to copy sound files *REM indicates a comment*
REM of any Civ2 Scenario (v2.60 or higher).
REM Created by Javier Arriaga, 11-IV-2003.
if exist SCENARIO.scn goto YES *If the file is in the correct folder, jump to YES point*
echo ERROR: I can't find file "SCENARIO.scn". Make sure
echo you are running from the correct directory. *Error message*
goto END *Jumps to END*
:YES *This is YES point*
md sound *Creates SOUND folder*
move NAME1.wav sound *moves the original file to the SOUND folder; copy this line if you have more files*
cd sound
copy NAME1.wav NAME2.wav
copy NAME1.wav NAME3.wav
copy NAME1.wav NAME4.wav
copy NAME1.wav NAME5.wav
copy NAME1.wav NAME6.wav *Creates the copies; copy this lines if you need more*
cd..
cls *Clear Screen*
echo Sound files installed. Pleased verify a "sound" sub-directory
echo has been created in your "SCENARIO" directory. *Success message*
:END *END point*
rem End of program
----------------------------------------------------------------
To rename a file, the order is:
rename NAME1.EXT NAME2.EXTLast edited by jasev; May 15, 2004, 10:15."Son españoles... los que no pueden ser otra cosa" (Cánovas del Castillo)
"España es un problema, Europa su solución" (Ortega y Gasset)
The Spanish Civilization Site
"Déjate llevar por la complejidad y cabalga sobre ella" - Niessuh, sabio cívico
Comment
Comment