Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Civilization II > Scenario League / Civ2-Creation > Practical applications for batchfiles?
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
29.Jul: MOVING UP ON REVISED `TOP 100` INDEX
29.May: GAME MECHANICS REFERENCE BOOKLET
06.Mar: DROPPING FROM SECOND TO THIRD
CivGroups
Scenario League / Civ2-Creation (66): Not a Member - Join

bottom of page
  - CIVILIZATION 2 from $6.95 - CIVILIZATION 2 from $4.25 - CIV2: TEST OF TIME from $2.50 - CIV2: MULTIPLAYER GOLD EDITION from $4.99
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Exile is offline Exile
King
of the Benighted Realms
Sep 2000
time: 23:17
Question  Old Post 08-04-2004 06:18
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Practical applications for batchfiles? Support Apolyton, buy Call to Power 2

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?

AGRICOLA is offline AGRICOLA
Prince
Canadian bush & Florida
Feb 2003
time: 00:17
  Old Post 08-04-2004 06:43
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Remove this text

Download Capt. Nemo's Red Front and use it as a guide. He changes just about everything twice a year for winter and summer.

Boco is offline Boco
Prince
who was once King for a week.
Jan 2001
time: 00:17
  Old Post 08-04-2004 07:05 Visit Boco's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Full PM-box? Change here!

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.

Harry Tuttle is offline Harry Tuttle

Prince
of the Hoople Heads
Mar 2003
time: 00:17
  Old Post 08-04-2004 07:59
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

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.

Boco is offline Boco
Prince
who was once King for a week.
Jan 2001
time: 00:17
  Old Post 08-04-2004 21:36 Visit Boco's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

quote:
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.

Exile is offline Exile
King
of the Benighted Realms
Sep 2000
time: 23:17
  Old Post 08-04-2004 22:53
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Ok, we're closing in on it. Put an end to popups!

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.

Mercator is offline Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:17
  Old Post 08-04-2004 23:25 Visit Mercator's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Put an end to popups!

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.

quote:
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.

fairline is offline fairline
Prince
of the wing
Sep 2002
time: 05:17
  Old Post 09-04-2004 00:28 Visit fairline's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Remove this text

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

Mercator is offline Mercator
King
Sorekara no Nanimo
Jan 1970
time: 06:17
  Old Post 09-04-2004 01:30 Visit Mercator's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Inflate your Upload Space

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.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:17.
Apolyton Time is 00:17.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0405 seconds (87.27% PHP - 12.73% MySQL) with 36 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net