###################################### # mapedit.pl version 1.05 # 27/9/03 # ###################################### # System requirements: # # - Star Trek Armada II # # - Star Trek Armada II Map Editor # # - temp-directory in STA2 folder # # - ActivePerl (5.6.x will run fine) # ###################################### print "Star Trek Armada II Map Editor Launcher - (c) 2003 oVRoM\n\n\n"; print "The following maps are currently available:\n\n"; # Getting list of contents of bzn directory... @maplist = `dir /b/w bzn`; # Opening temporary file to write this to open (FILE, ">temp/maplist.txt"); for $maplist (@maplist) { # It's only a map if it ends with .bzn. I don't want to see the default STA2 maps so don't show anything starting with a2_. if (($maplist =~ /\.bzn$/) && ($maplist !~ /^a2_/)) { print FILE "$maplist"; } } close (FILE); # Call the mapeditc.pl script which will sort the list of bzn files and print them out nicely in columns. system ("mapeditc.pl temp/maplist.txt"); system ("del temp\\maplist.txt"); # Ask for name: print "\n\nPlease enter mapname: "; chop ($name=); print "\n"; if ($name eq "exit") { print "Aborting mission...\n\n"; system ('pause'); exit; } if ($name eq "!") { &latestmap; } unless ($name) { print "No input given...\n"; system ('pause'); exit; } print "\nYes sir, $name it is... \nPlease hold while launching Star Trek Armada II..."; &writetemp; &launchsta; sub writetemp { # Because starting STA2 directly from this script causes STA2 to crash, # we'll have to write a little batch-file containing the launch command. open (FILE, ">temp/load.bat"); if ($name =~ /\.bzn$/) { $name =~ s/\.bzn//ig; } print FILE "\@echo off\nArmada2.exe /edit $name.bzn"; close (FILE); } sub latestmap { if (-f "temp/load.bat") { print "Using previously chosen map...\n\n"; &launchsta; } else { print "No previous map known...\n\n"; } system ('pause'); exit; } sub launchsta { system("temp\\load.bat"); print "\nDone!\n\n"; exit; } ######################################## # Written by oVRoM on a way to sunny # # saturday afternoon... Feel free to # # distribute and modify but don't # # remove this notice. Also be sure to # # include the mapeditc.pl script! # ######################################## # Copyright 2003 - oVRoM # ######################################## # http://home.introweb.nl/~dodger/misc # ########################################