Console commands

From SWAT 4 wiki
Jump to navigationJump to search


Regular commands

You can open the console simply by pressing a special key which is usually the key to the left of "1" on US keyboards. All console commands are case-insensitive.

  • abortgame - Ends the current round.
  • flush - Flush all caches. Regenerates all lighting, 3D hardware textures, etc. Can be useful to reduce lag or to clear texture corruption due to 3D hardware driver bugs.
  • get <classname> <variable> - Gets the default value for a variable in a class. Eg. get serversettings maxplayers
  • kick <playername> - Kick a player.
  • kickban <playername> - Kick a player and ban his/her IP. You'll need to edit your Swat4(X)(Dedicated).ini file to unban their IP.
  • open <mapname> - Opens a local map. Can be useful to open custom maps in single player. Eg. open sp-u273
  • reconnect - Reconnect to the previous server. Also reloads the current SP map.
  • sad <password> - Login as admin with specified password.
  • say <message string> - Broadcast a message to other players in the game.
  • set <class> <variable> <value> - Sets the specified property of the specified class with the specified value. Eg. set serversettings maxplayers 5
  • set input <key> <command> - Set up keybinds in-game. It automatically writes to the User.ini file. Eg. set input u say hello
  • setres WxHxD - Set the resolution and color depth. Eg. setres 1024x768x32
  • shot - Take a screenshot and save it in the System directory with a consecutive name like Shot0001.bmp.
  • startgame - Makes all players ready.
  • stat all - Shows all stats.
  • stat fps - Shows frame time in milliseconds.
  • stat game - Shows game stats.
  • stat hardware - Shows interesting hardware stats.
  • stat render - Shows stats about rendering. Note especially the Staticmesh/Triangles count.
  • stat net - Shows network performance statistics including ping, packet loss, bytes/second.
  • stat anim - Show details on what animations are playing.
  • stat none - Turns off the display of any stats.
  • switch <mapname> - Switches the server to a new map.
  • teamsay <message string> - Broadcast a message to your teammates.
  • quit/exit - Exit the game.


Single player developer tools (cheats)

To enable the cheats, you need to edit one configuration file. Remember to backup files before editing.

  • In the regular SWAT 4, open the file at SWAT 4\Content\System\SWAT4.ini.
  • In TSS, open the file at SWAT 4\ContentExpansion\System\SWAT4X.ini.
  • Search for the line [Engine.GameEngine]. Locate the first occurrence of EnableDevTools=False under this section. Change the False value to True and save the ini file.

Now you can enter these commands to the console as explained above.

  • behindview <0 / 1> - Toggle 3rd person camera.
  • invisible <0 / 1> - Toggle invisibility for player.
  • god - Player becomes invulnerable.
  • fly - Set gravity to zero for player.
  • ghost - Set gravity to zero for player and allow passing through normally blocking surfaces ("no clipping" mode).
  • walk - Resets the ghost and fly modes to inactive.
  • showhands / handsdown - Toggle first-person hands & weapon rendering.
  • togglegui - Turn GUI/HUD rendering on/off.

Rendering options

  • showdebug - Show some general debugging info.
  • showfocus - Show details about the objects where the camera is pointed at.
  • show projectorbounds - Show bounds of projectors in-game.
  • show actors - Turn on/off rendering of actors.
  • show actorinfo - Turn on/off rendering of actor info.
  • show staticmesh - Turn on/off rendering of static meshes.
  • show fog - Turn on/off rendering of fog.
  • show sky - Turn on/off rendering of skyzone.
  • show corona - Turn on/off rendering of coronas.
  • show particle - Turn on/off rendering of particles.
  • show bsp - Turn on/off rendering of bsp surfaces.
  • show radii - Turn on/off rendering of radii for things using cylinder collision.
  • show fluid - Turn on/off rendering of fluid surfaces.
  • show projector - Turn on/off rendering of dynamic projectors.
  • show collision - Show non-havok collision bounds. Dynamic objects are in pink. Also show bone collision boxes.
  • rend collision - Show pawn collision. If pawn is on top of something, show that thing in yellow and draw line to it.
  • rend bound - Show the rendering bounding sphere/box for skeletal meshes (blue), the render bounding box for static meshes (green), the predicted render bounding box (red) and the emitter bounds (yellow).
  • RenderDetail <0-3> - Globally adjusts ALL other rendering settings; 3 is highest detail, 0 is lowest.
  • TextureDetail <0-3> - Changes texture detail (size); 3 is highest detail, 0 is lowest.
  • BumpDetail <0-3> - Changes bumpmapping settings. 3 = characters+staticmesh+bsp+emitters, 2 = characters+staticmesh; 1 = static mesh, 0 = nothing.

Gameplay / spawning

  • ChangeSize <float> - Change player character size. Default is 1.0.
  • SloMo <float> - Change global game speed factor. Default is 1.0.
  • Teleport - Move to the location where the camera is pointed at.
  • GetSprayed - Runs camera effect for Pepper Spray (with 0 damage).
  • GetGassed - Runs camera effect for CS Gas (similar to Pepper Spray) (with 0 damage).
  • GetTased - Runs camera effect for Taser (with 0 damage).
  • GetStung - Runs camera effect for Sting Grenade (with 0 damage).
  • LockAllDoors - Locks all doors in the level.
  • OpenDoorsToLeft - Opens all doors in the level to the left.
  • OpenDoorsToRight - Opens all doors in the level to the right.
  • SummonArchetype <Enemy / Hostage / Inanimate> <Archetype name> - Spawns an instance of the specified archetype in front of the player. Eg. 'summonarchetype enemy arms_dealer'.
  • TestSpawn - Spawn a 'TestSpawn' Archetype at each Enemy and Hostage Spawner.
  • UsePrimaryEntry <1 / 0> - If 1, singleplayer missions will use the primary entry point. If 0, they will use the secondary entry point.

AI stuff

  • HideAI - Hides all AIs.
  • ShowAI - Shows hidden AIs.
  • ToggleAIHiddenState - Toggle between ShowAI/HideAI.
  • AnimDrawDebugLines - Show where the pawns should be aiming.
  • DebugAIMovement - Show where the AIs think they are going.
  • DebugAssignments - Show where the AIs have assigned tasks.
  • DebugOfficerAwareness - Show how the officers navigate awareness points.
  • DebugMorale - Turn on/off morale debugging info.
  • HideVC - Hide AI vision cones.
  • ShowVC - Show AI vision cones.
  • EveryoneComply - Asks all enemy/hostage AIs to comply. Tougher enemies will start running.
  • MakeAIGod <optional: AI Class (ie. SwatOfficer)> - Makes particular types unhurtable (defaults to all AIs).
  • DebugAIs - Turn on/off AI debug info.
  • DebugTyrion - Turn on/off all Tyrion debug info.
  • DebugTyrionCharacter - Turn on/off Tyrion Character debug info.
  • DebugTyrionMovement - Turn on/off Tyrion Movement debug info.
  • DebugTyrionWeapon - Turn on/off Tyrion Weapon debug info.
  • DisableVision <optional: AI Class> - Disables AI vision.
  • EnableVision <optional: AI Class> - Enables vision for AIs whose vision has been disabled.
  • DisableHearing <optional: AI Class> - Disables AI hearing.
  • EnableHearing <optional: AI Class> - Enables hearing for AIs whose hearing has been disabled.
  • DisableAwareness <optional: AI Class> - Disables the awareness system of AIs.
  • EnableAwareness <optional: AI Class> - Enables the awareness system of AIs whose awareness has been disabled.
  • DisableCollisionAvoidance <optional: AI Class> - Disables collision avoidance.
  • EnableCollisionAvoidance <optional: AI Class> - Enables collision avoidance.