furrycat's guide to SWAT3 console commands

Sections
Actions
Key mapping
Macros
Example macros
Leaning
Crouching
Camera cycling
Scripts
Reference

Just like Quake, Half-Life and virtually every other game out there, SWAT3 has a console that you can pull down and use to enter commands to the game. I don't know of any official list of all the commands that are available to you, so looked for human-readable strings in swat.exe and tried out various things to come up with this, the semi-definitive console command guide.

The guide is split into two main parts: a detailed guide to keymapping and macros and then a brief reference of all the console commands I know about.

Before that though, the obligatory introduction.

Entering console mode

If you want to use the console in-game you must launch SWAT3 with the -console option. See the command line arguments guide for details on how to do that. Once you've got the game started, play a mission and press ˜ to pull down the console. To return to the game, press escape.

Game actions and key mapping

Game actions

All of the actions your character can perform in the game have a corresponding command that can be entered from the console. When you configure your keyboard controls from the game menu you are mapping keys to these actions, in the same way as you bind keys to actions in Half-Life.

Many of these actions have two states, which I'll call the "plus state" and "minus state." They might more accurately be called the "active state" and "inactive state" but using plus and minus makes sense because of the way the SWAT3 console works.

Bring up your console and type

btn +up

You will start to move forward. Now type

btn -up

You stop. Hopefully you can now see why I called the two states the plus and minus states. When in the plus state, the action is "in progress" and will continue until it becomes impossible. So, for example, if you did btn +fire you would fire and fire and keep on firing until you ran out of ammo.

Notice how the btn command is needed. I presume that btn just means "button." In any event, it is needed to change the state of a command.

Stateless commands

Some commands happen once and stop. They have a plus state but no minus state, so might be thought of as stateless. An example is btn +usegeneric which is the "use" command that picks up guns, presses buttons, opens doors and so on.

Mapping keys

The command for mapping these actions to keys is cunningly called mapkey. Like the actual commands that will be mapped, the keys themselves have a plus and minus state. To map the right mouse button to moving forward, use the command

mapkey +RMOUSE "btn +up"
mapkey -RMOUSE "btn -up"

If you only mapped +RMOUSE then you would not stop moving forward after you released the mouse button.

If you want, you can remap all of the commands in the game like this and put them in a script (I will describe scripts later) but with Elite Edition this is unnecessary as you can simply edit swat.cfg.

swat.cfg

We're starting to drift offtopic here so I'll just briefly swat.cfg. This file, which lives in your SWAT directory, lists all the commands and the keys they're mapped to. For example,

83=reload

is the same as saying mapkey +S "btn +reload" in the console. How you find out that S is keycode 83 is up to you...

Again, I want to skip over this because there already exists one key remapping program on 10-David and Spac3rat is working on another. I only mention swat.cfg to draw attention to the command names that are listed in it.

Don't worry too much about trying to remap all your keys from the console or even understanding swat.cfg. All of the above is mostly obsolete with Elite Edition but is prerequisite for understanding the real meaty stuff: macros.

Macros

SWAT3 macros are just like Half-Life macros or even Microsoft Word macros: a list of commands that are performed in order and can be mapped en masse to one key. Making a macro is simple. First you figure out the sequence of commands you want to execute. Secondly you define the macro using defmacro and finally you map the macro to a key with mapkey.

Consider the following:

defmacro charge "btn +up; btn +movefast; btn +fire"

This creates a macro called charge that starts you moving, starts firing and sets you in running mode. You can assign it to a key with

mapkey +SPACE charge

Now when you press space you will charge towards your enemy, all guns blazing. Well, whichever gun you had selected blazing anyway.

Notice how the macro is enclosed in quotes and how individual commands are delimited by semicolons.

That's really all there is to it. The hard part is deciding what commands you want to put in your macro.

Example macros

Alien Abducter suggested this macro for replacing the broken Clear command in SWAT3 version 2.

defmacro clr "dialog player cleared dynamic YOURNAME"
mapkey +5 clr

You MUST set YOURNAME to your exact WON callsign or your name will not show up. For example, I set it to [furrycat].

Back before Elite Edition was released, the original SWAT3:CQB didn't have temporary leaning or crouching. Having to map three keys (left lean, right lean and no lean) was unacceptable. I used to use the following macros to implement temporary leaning.

defmacro lean_left "btn +llean; mapkey +CTRL lean_straight; mapkey +SHIFT lean_right"
defmacro lean_right "btn +rlean; mapkey +CTRL lean_left; mapkey +SHIFT lean_straight"
defmacro lean_straight "btn +nolean; mapkey +CTRL lean_left; mapkey +SHIFT lean_right"
lean_straight

With this set of macros you press control to lean left or shift to lean right. If you lean left, control gets mapped to standing up straight again. If you lean right, shift gets mapped to standing up straight again. Another one I used to use because of the lack of temporary crouch was

defmacro crouch_down "btn +crouch; mapkey +SPACE crouch_up"
defmacro crouch_up "btn +stand; mapkey +SPACE crouch_down"
mapkey +SPACE crouch_down

Here we assign space to toggle crouching. As these two examples show, you can put any console command in your macros, even mapkey and defmacro.

A more complicated macro to cycle remote viewports which is still useful with Elite Edition is

defmacro camera_el "btn +remote1; mapkey +F camera_r1"
defmacro camera_r1 "btn +remote2; mapkey +F camera_r2"
defmacro camera_r2 "btn +remote3; mapkey +F camera_r2"
defmacro camera_b1 "btn +remote4; mapkey +F camera_b1"
defmacro camera_b2 "btn +remote5; mapkey +F camera_b2"
mapkey +F camera_el

Now F starts off mapped to the element leader's viewport. Once you bring up the viewport, F gets remapped to Red One's viewport and so on. Because trying to show your own viewport has the effect of turning off the remote camera, we end up with a nice way of cycling the views and can deactivate the camera altogether by cycling far enough.

Unfortunately, I haven't managed to insert pauses into my macros, which has scuppered my plans for a one-key "taking fire" macro that would work something like

defmacro help "btn +collapsecommandmenu; pause; btn +uicommand2; pause; btn +uicommand1"

I've tried various things in place of pause but none of them worked. Oh well...

Console scripts

Instead of typing in your macros every time you start the game, put them in a file in your SWAT directory called macro.con (or whatever you like) and run it either by typing run macro.con from the console or, preferably, starting SWAT with swat.exe -script macro.con.

Command list

Here's the list of commands you can enter in the console.

Not (fully) understood

I don't yet fully understand the following commands. Maybe they don't even work.

Cheats

These cheats are documented on 10-David and elsewhere.

Feedback

Send any comments to swat3@furrycat.net.