View Single Post
Old 2nd Jan 2008, 03:43 PM   #6
lightfoot
Member
 
lightfoot's Avatar
 
Registered: Oct 2005
Location: *teleports up front*
Posts: 576
I made another small map with a camera slide. It mainly shows the APC mesh I got from X-Newbie. Thanks again for that.
3d-apc.jpg
With the original one, the Sigma/Telic lobby maps, and my two small attempts there were 5 working menu maps now.


So I read some things about batch scripting, and tried some things out. Then I read and googled some more.


- To make a long story short, I finally devised a small batch script that randomly chooses one of these five maps as a menu background when I start AlienSwarm.

Here it is. A very basic version, but it works.
Code:
@echo off
setLocal EnableDelayedExpansion
set number=5
set /a target=!random!%%number+1
del AlienSwarmStartup.ut2
copy MenuMaps\%target%.ut2
ren %target%.ut2 AlienSwarmStartUp.ut2
set number=
set target=
cd..
AlienSwarm.exe
Then I tried to make it look better, added a loading screen (tchatzi's idea -thanks!) and some comments.
Code:
@echo off

: IMPORTANT This launcher will only work when it is 
: in your UT2004\AlienSwarm\maps\ folder.
: It further assumes that there is a folder called
: 'AlienSwarm\Maps\MenuMaps',
: which contains 5 (yes, the 'number' variable)
: actual menu maps, named '1', '2', '3', '4' and '5'.


: give our window a name and make sure it's got the right size
title Hit a key to proceed to Alien Swarm.
mode con: cols=80 lines=29

: the following seems to be needed for randomness
setLocal EnableDelayedExpansion

: we have 'number' menu maps to choose from
: (TODO: the script should rather make a head count of the files
:             in the MenuMaps folder, instead of primitively setting it here!)
set number=5

: so randomly find a target between 1 and number
:
set /a target=!random!%%number+1

: get the respective map description from a 'subroutine'. brr, clumsy.
:
if %target%==1 goto Original 
if %target%==2 goto Sigma 
if %target%==3 goto Telic 
if %target%==4 goto Conrad 
if %target%==5 goto APC

:hell
: display my awesome ASCII-art, now feat. the targetted Map's descrip.
:
echo.
echo  (NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNNN"NN4NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNNN  ` 4NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNF      ´NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN                        NN)
echo  (NNNNNNNNNNF`         NNNNNNNNNNNNNNNNNNNNNNNNNNNNN      ALIEN SWARM       NN)
echo  (NNNNNNNNN_           ´NNNNNNNNNNNNNNNNNNNNNNNNNNNN Just another bug hunt. NN)
echo  (NNNNNNNNNL            NNNNNNNNNNNNNNNNNNNNNNNNNNNN   by Black Cat Games   NN)
echo  (NNNNNNNNNNNN. .        4NNNNNNNNNNNNNNNNNNNNNNNNNN                        NN)
echo  (NNNNNNNNNNNNNJ"  ,      ´NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNF`,´          4NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNN\´,´           ´4NNNNNNNNNNNNNNN                              NN)
echo  (NNNNNNNNNNNNF                ´NNNNNNNNNNNNNN This launcher was batched by NN)
echo  (NNNNNNNNNNNL_´       .,        "NNNNNNNNNNNN the Lightfoot, SpaceEngineer NN)
echo  (NNNNNNNNNNNN)       _´`          4NNNNNNNNNN                              NN)
echo  (NNNNNNNNNNNNL.       _            ´NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNNL´                    "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNNN)                     (NNNNNNNNN                            NN)
echo  (NNNNNNNNNNNNNNLJ      _."            4NNNNNNNN Today's menu map is nr.%Target%:  NN)
echo  (NNNNNNNNNNNNNNN`      L              (NNNNNNNN %descrip% NN)
echo  (NNNNNNNNNNNNNNL                       NNNNNNNN                            NN)
echo  (NNNNNNNNNNNNNNL                       NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNNN)`   ,                  NNNNNNNNNNNNNNNNNN 4NNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNNN/`,. (L                ´F"4NNNNNNNNNNNNNNN",NNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNF`  ´  (F`                  ` ""N4FNNNFF"" ` JNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNL   ,___L_ __.,_      ,.                    JN"LNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLN_JNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)
echo  (NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN_LF_NOV_07)

: (silently) wait for keypress, before actually doing stuff.
pause >nul

: now do stuff.  ONE: delete old menu map.
del alienswarmstartup.ut2

: do stuff          TWO: copy target into this directory.
copy menumaps\%target%.ut2

: do stuff          THREE: rename target into what the game expects.
ren %target%.ut2 AlienSwarmStartUp.ut2

: clear variables
set number=
set target=
set descrip=

: ...and now, gear up! For just another bug hunt...
cd..
AlienSwarm.exe
: (this would be the place to set ?mutator=... or other options)

: ...but first, quit this. See you, and watch your reload!
exit


: the following are subroutines for setting the map description
:
: in case there is more menu maps to include: they could be added
: here, provided that you also add another if-condition up there.
: also, increment 'number' then, and see that the descripts have proper
: string length. has to be exactly 26 digits for the ASCII-art to work... 
:
:Original
set descrip=The original menu map.    
goto hell
:Sigma
set descrip=The Sigma campaign lobby. 
goto hell
:Telic
set descrip=The Telic campaign lobby. 
goto hell
:Conrad
set descrip=The mothership USS Conrad.
goto hell
:APC
set descrip=The APC at a close view.  
goto hell
Here is a screenshot:launcher_screensh.jpg

Due to the comments this version contains, I hope it to be pretty self-explanatory.

You can download this two scripts, the maps, and a more detailed Readme here. It is all insinde a zip package called 'Maps.zip', to be found there. You have three guesses where to extract it to...
lightfoot is offline   Reply With Quote