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.
btn <action>
Performs the action command.mapkey <key> <action>
Maps action to key. action may be a macro name or a quoted list of commands.screenshot
Takes a screenshot.stop
Stops the game and takes you to debrief.quit
Quits back to the Windows desktop. The Boss Key reborn!stats
Shows framerate, polygon count and other technical information.handsup
Shows your weapon in front of you, like in every other FPS game out there.pan <filename> [<fov> [<deg>]]
Does a panorama starting from where you are currently looking and writes out a bunch of files named filename_1.bmp, filename_2.bmp etc in your SWAT directory. The optional parameter fov defines the field of view. It must be between 30 and 120. The optional parameter deg defines the degree increment between scenese in the panorama (I think) and must be between 5 and 90.single <map>
Starts a new single player game on the named map. The name of the map comes from the actual zip file name. For example:single missiona
starts a game at Martin Brenner's house.flat
Turns off lightmapping for the scene. Good for cheating at DMs.lmaps
Renders the scene with lightmaps.blmaps
Build lightmaps for the scene.run <filename>
Loads the file called filename and runs the commands listed in it.savecon <filename>
Saves the current output on the console to filename.clearcon
Clears the console.UDPReliable <on|off>
Toggles the udpreliable flag. For example:UDPReliable On
.listents
Shows all the entities in a scene.disable
Disable the sound manager.sound
Shows the sounds currently playing. Pay particular attention to the sound's instance name.sound start <filename> [loop]
Plays the sound filename. If you specify loop, the sound will be looped. The console reports the sound's instance name asStartCmdSoundN
where N is an integer.sound stop <instance>
Stops the sound with the given instance name. Which you got by looking at the output ofsound
, right?sound stop all
Stops all sounds.paintball
Makes the current game into a paintball game.showconsole
Don't laugh, you can map this to a key!ent ai paths
Shows AI entity waypoints in a map.ent ai printccm
AI Guy says this prints a representation of the current map to the file AIDebug.txt. Key to the command's output: 1, 2, 3 are multiples of 1.5 feet above ground level and * means the cell is not occupiable by AIs.ShellExecute <program>
Launch program. For example:ShellExecute explorer.exe
dialog <noun> <verb> <case> [<talker>]
Thanks to Alien Abducter for showing me the way. This does work! You need to check dialog.dat to find which dialogue to display. Example: "dialog YURI_B RESTRAIN RANDOM_1 MARTIN_B" causes Yuri Bodonevich to say his "being arrested" piece but the dialogue shows up as being said by Martin Brenner!entity <entity> <command>
The mighty Alien Abducter strikes again with a description of this command. entity sends a command to an entity. You can get a list of valid entities with thelistents
command. Known commands (discovered by Alien Abducter) are: set visible 0/1, set health 0-100, gassed, killed (hehe) and unhide. Stay tuned for more on this command. Example: "entity MARTIN_B killed"
Not (fully) understood
I don't yet fully understand the following commands. Maybe they don't even work.
spawn <entity> targetname<targetname>
Spawns an entity. Only works in multiplayer if you are the host. I'm not sure about all the entities you can spawn but I've triedspawn Chemlite targetname=Chemlite
andspawn Flashbang targetname=Flashbang
. These will make a chemlight or flashbang appear on the floor where you are standing. Taking my cue fromentities.dat
, I played about with stuff like(dropped=1)
as additional parameters. These worked. Invalid parameters will crash the game! I imagine that it should be possible to "throw" things using this command, maybe in conjunction with others... Please note that while throwing chemlights around like some latter day Hansel may be fun, it will soon slow the game down.whichsound <index>
What is index?whereami
Doesn't work?texstats
Doesn't appear to do anything other than make the screen spin round.logger <on|off>
Turns logging to C:\swat.log on and off?logmsg <message>
Logs message to C:\swat.log?clearlog
Clears the log file I guess. Since I can't write the log file this doesn't serve much purpose.genconscript <filename>
When I tried this it opened filename and then crashed. Nice.build
Build what?help
There's a help command described in the executable but it doesn't do anything.observerview
Doesn't work...playerview
...if we had a debug build...3rdpersonview
...maybe we could use these.debugon, debugoff
I suppose we would need a debugging build to use these.prompt <promptname>
Is this even a game engine command?promptctrl
Is this even a game engine command?testtrace
Test ray tracing performance, apparently. Doesn't display its results though.memstats
Display memory stats.ptfile <filename>
Load a point file.testinterface
Test which interface?
Cheats
These cheats are documented on 10-David and elsewhere.
- biggerpockets
- casual
- doubleshot
- hotstuff
- iamleet
- johnwoo
- justin
- nc17
- noshades
- rabies
- swatlord
- woolpull
Feedback
Send any comments to swat3@furrycat.net.