The Shorttamit is a command-line program intended to assist mappers when creating symmetrical maps.
:: IntroductionThe advantage to creating symmetrical maps over asymmetric ones is that your workload is somewhat reduced. The idea is that you only ever work on one half of the level geometry. Once you want to test a full map just duplicate your existing geometry, make some changes to textures and the like, then compile. This approach allows the mapper to not worry about inconsistencies between map halves.
However the process of converting the original half of a map into the second (we'll call it inversion) can be tedious - and it only gets worse as map complexity increases (doors, particle systems, etc). This where tamit comes in.
:: Descriptiontamit (Tremulous Arena Map Inversion Tool) is a command-line program (originally written for personal use) that aims to substitute manual map inversion (except explicit manipulation of geometry/entities). It works by executing a series of commands read from an IVT script file and performing them on a map file.
tamit was written in C and makes extensive use of the Better String Library.
:: Script FileThe script file is a plain text file (*.ivt) that consists of a series of commands that are performed on a map file. The script file must have the same base name (filename minus the extension) and directory as the map you want to invert.
:: Script ExampleThe script file (mercyb2.ivt) may look something like this:
entMod(func_door #?, angle@ ? + 180);
textMod(blue = red);
textMod(_human_inter = _alien_inter);
textMod(0.901961\\0.882353\\1 = 1\\0.882353\\0.882353);
mapAdd(greencam.map);
mapAdd(redbase.map); The above script performs the following on the map data (in order):
- Increases the numeric value of the angle key for all func_doors by 180 (effectively makes all func_doors reverse direction of operation; except ones that move vertically).
- Replaces all occurences of the text 'blue' with 'red' (this effectively swaps all blue textures with red ones).
- Replaces all occurences of the text '_human_inter' with '_alien_inter' (this effectively makes any info_human_intermissions into alien ones).
- Replaces all occurences of the text '0.901961 0.882353 1' with '1 0.882353 0.882353' (effectively changes all blue lights to red lights).
- Appends the map file 'greencam.map' to the current map data (effectively puts in a spectator camera from an external map file).
- Appends the map file 'redbase.map' to the current map data (effectively puts in alien buildable structures from an external map file).
Note:- In order to specify a space in text, you must use double backslashes '\\'. The reason for this is that tamit ignores all white space when interpreting the script file. This also means you can format script files with all the white space you want.
- Comments in tamit are effectively commands that aren't processed. This also means you can't stick comments inside of other commands.
The syntax is:
//your comment here;:: Command Syntax and DescriptiontextMod(oldtext = newtext); Replaces all occurences of oldtext with newtext.
textMod(oldtext + newtext); Concatenates newtext onto all occurences of oldtext.
textMod(oldtext - newtext); Removes all occurences of newtext from all occurences of oldtext.
entMod(classname #targetname, key@ oldvalue = newvalue, ...); Recognises entities with matching classname and targetname, and sets key values that match the old value to the new value. Multiple key-old-new modifications can be done in one entMod. To specify no targetname, use a '?' in place of the targetname.
To perform addition/subtraction of numeric values; specify an oldvalue of '?' (which specifies all values) or some specific value, and then a relative newvalue.
mapAdd(basename.map); Appends the contents of a map file onto the map data. The rough equivalent in Radiant is doing a map import.
:: OutputWhen tamit has successfully run, it will generate an inverted map file (basename.inverted.map) in the same directory as your original map.
You'll then probably want to mirror/rotate/move the inverted map geometry and import it into your final map.
:: Usage tamit <map location minus extension>
Example Usage: tamit mercyb2
tamit ~/builds/mercyb2
tamit "X:\Program Files\Tremulous\base\maps\mercyb2"
:: InstallationUnzip the file(s) to anywhere you wish (I recommend your base/maps directory for easy access to in-development maps).
:: Downloads[MediaFire] Windows (32 bit)[MediaFire] Linux (32 bit)