Q3Map2 Linux Batch File


(flower.Hercules) #1
#!/bin/bash

# Set locations here
q3map_path=/usr/local/bin/q3map2		      # q3map2 file location
et_path=/home/dir/.etwolf/etmain/			# Enemy Territory installation location
map_location=/home/dir/.etwolf/etmain/maps/	#base directory, see comment below

# The map location is the base directory for your maps, you will use a parameter
# on the command line to tell the compiler what map you are currently wanting to
# compile -- the .map extension will be added automagically.

$q3map_path -v -meta -fs_basepath $et_path -game et $map_location$1.map
$q3map_path -vis -saveprt -fs_basepath $et_path -game et $map_location$1.map
$q3map_path -light -fast -samples 2 -patchshadows -fs_basepath $et_path -game et $map_location$1.map

$q3map_path -meta -patchmeta -fs_basepath $et_path -game et $map_location$1.map
$q3map_path -convert ase -fs_basepath $et_path -game et $map_location$1.map

I just figured I’d throw together a quick Bash script for q3map. A couple of notes on the variables up top that you have to declare, some people will want to use /usr/local/games/enemy-territory/ instead of the home directory, I’m not sure if it matters, just as long as you have the correct permissions set – if that fails, try the home dir.

If you don’t want to specify the map when calling this script, just go ahead and change the script to something like this:

#!/bin/bash

# Set locations here
q3map_path=/usr/local/bin/q3map2				     # q3map2 file location
et_path=/home/dir/.etwolf/etmain/					# Enemy Territory installation location
map_location=/home/dir/.etwolf/etmain/maps/mapfile.map	  # Path to map file

# The map_location variable is now the static path to your map file

$q3map_path -v -meta -fs_basepath $et_path -game et $map_location
$q3map_path -vis -saveprt -fs_basepath $et_path -game et $map_location
$q3map_path -light -fast -samples 2 -patchshadows -fs_basepath $et_path -game et $map_location

$q3map_path -meta -patchmeta -fs_basepath $et_path -game et $map_location
$q3map_path -convert ase -fs_basepath $et_path -game et $map_location

Put either of the above scripts in the directory of your choosing, we will assume the home directory with the filename q3map_batch.sh and run it with something similar to below:

Script #1
sh ~/q3map_batch.sh MyMap

Script #2
sh ~/q3map_batch.sh

The first script in this thread is #1 and the second is #2.

HTH somebody :slight_smile: