Command Line Options:it

From Valve Developer Community

Jump to: navigation, search
English 日本語

Contents

Giochi Source

Questi parametri della linea di comando, lavorano con qualunque gioco del motore Source (Half-Life 2, Counter-strike: Source, ecc.).

Note.png Nota: I parametri di comando sono racchiusi tra i caratteri < e >.

Sintassi: hl2.exe <parametro1> <parametro2> <cvar1> <cvar2>

Utilizzo

Queste opzioni possono essere usate con:

  • Hammer editor nella finestra Run Map Run-map.jpg.
  • Windows shortcuts pointing to hl2.exe directly.
  • Windows shortcuts pointing to steam.exe with the proper -applaunch <AppID> specified (see Steam section below).
  • Command-line batch script files launching these applications.

Esempi

  • steam.exe -applaunch 280 -dev -console -sw +sv_lan 1 +map MiaMappa
  • hl2.exe -game cstrike -dev -console -fullscreen +sv_lan 1 +map de_dust

Parametri della linea di comando

  • -autoconfig - Restores video and performance settings to default for the current hardware detected. Ignores settings inside any .cfg files until this parameter is removed.
  • -dev - Enables developer mode. Also disables the automatic loading of menu background maps and stops the quit dialog from appearing on exit.
  • -condebug - Logs all console output into the console.log text file.
  • -console - Starts the game with the developer console enabled.
  • -toconsole - Starts the engine directly in the console, unless a map is specified with +map.
  • -dxlevel <level> - Forces a specific DirectX version when launching the engine. This is useful if your graphics card is DirectX 9 capable, but a lot faster using only DirectX 8 (e.g. NVidia GeForce FX 5200). Multiply the desired DirectX version to use with ten. E.g. for DirectX 8.0 you would use -dxlevel 80.
  • -32bit - Forces the engine to start in 32-bit mode. Only useful on 64-bit Operating Systems.
  • -fullscreen - Forces the engine to start in fullscreen mode.
  • -window or -sw - Forces the engine to start in windowed mode.
  • -w <width> - Forces the engine to start with resolution set to <width>.
  • -h <height> - Forces the engine to start with resolution set to <height>.
  • -refresh <rate> - Force a specific refresh rate.
  • -heapsize <kilobytes> - Specifies the heapsize (in kilobyte) the game will use.
  • -nocrashdialog - Suppresses some 'memory could not be read' unhandled errors.
  • -novid - When loading a game with this parameter, the intro Valve video will not play.
  • -noborder - When used with the game set to windowed mode, will make the game fullscreen, making Alt+Tab faster.

Console variables

  • +<console variable> <arg> - Sets the Cvar (or console variable) to the specified setting.

Some useful console variables

  • +map <map name> - Loads the map specified after the engine starts.
    Note:the .BSP extension is not needed.
  • +map_background <map name> - Forces a specified background map to be used. Useful for testing custom background maps. To avoid loading standard background maps for speed reasons, use the -dev command-line parameter.
  • +sv_lan <0/1> - When set to 1, launches the game in LAN mode. Useful to stop players from joining your game from the Internet.
  • +sv_cheats <0/1> -- When set to 1, starts the game with cheats enabled.

Goldsource Games

These command-line parameters will work with any Goldsource engine games (Half-Life, Counter-Strike, etc.).

Note:Command parameters are described inside the < and > characters.

Syntax: hl.exe <parameter1> <parameter2> <cvar1> <cvar2>

Usage

These options can be used with:

  • Hammer editor Run Map dialog.
  • Windows shortcuts pointing to hl.exe directly.
  • Windows shortcuts pointing to steam.exe with the proper -applaunch <AppID> specified (see Steam section below).
  • Command-line batch script files launching these applications.

Examples

  • steam.exe -applaunch 70 -dev -console -sw +sv_lan 1 +map MyMap
  • hl.exe -game cstrike -dev -console -fullscreen +sv_lan 1 +map de_dust

Command-line parameters

Parameter list from Gameplanet forums:

What parameters can I use with hl.exe? (advanced)

OK. There are a quite a few parameters you can tag onto the end of your shortcut to hl.exe, or straight off the command line (start >> run).

Here is a list of them, and what they do.

  • -console - this will enable the Half Life console. Press ~ (tilde) to bring it down in game, or use the console button in the main menu.
  • -game <variable> - this will set the custom game to whatever variable is set. eg cstrike, dod, dmc. The valid variables are the abbreviated names of the mods inside your base halflife directory.
  • -height <variable> - Display resolution. Use with -width. Eg. "1200" for 1600x1200.
  • -numericping - this will replace those goofy dots in the Halflife game browser with your actual ping time (measured in milliseconds, not dots :) )
  • -noipx - this will disable IPX support. Which is fine, because you don't need IPX at all for Halflife. Recommended :)
  • -noip - useful for single player. Will disable IP. (note: im not sure about this one).
  • -nointro - This is to skip the two avi's at the start.
  • -nojoy - disables joystick support.
  • -noforcemparms -noforcemaccel -noforcemspd - This will disable mouse parms, acceleration, speed... Useful for Windows XP.
  • -refresh <variable> - set vertical refresh frequency. Other than 60Hz, You might need ReForce (Win2k/XP) to enable this feature.
  • -toconsole - when you open hl.exe with this parameter, it will load straight into the console.
  • -dev - enables developer mode. Useful for testing a homemade map, or debugging. Will show a more detailed summary of what is being loaded/initialized in the console. Use 'developer 1' and 'developer 2' in console to set debug message detail level
  • -d3d - will use direct 3D only.
  • -gl - will use OpenGL only.
  • -soft - will use software rendering only.
  • -full - will use fullscreen mode. Again, not important.
  • -window - window mode.
  • -wavonly - will disable directsound, and attempt to play all sound files as wav files.
  • -w <variable> - sets video mode width (variable is number of pixels wide).
  • -width <variable> - sets video mode width (use with -height). Eg. "1600" for 1600x1200.
  • -gamegauge - runs the demo in demoname.dem in benchmaking mode and saves the results in fps.txt file. 1.0.0.9+ only. Can do the same thing in-game with cl_gg 1; gg in the console.
  • -heapsize <variable> - Where <variable> is how much RAM you got. Say you got 32 MB of RAM. Replace the variable with 32768. Don't be foolish and replace the variable with more than what you got in RAM. People with more than 64 MB of RAM sometimes feel that it's not using the RAM being supplied. Well, they're right. This command invokes to show Half-Life all the RAM that you have and it can be used.
  • -particles <variable> - Variable number is the number of particles for which to set aside buffer space. This is useful for seraching for leaks in maps.
  • -port <variable> - will set the port (for a listen server). Default is 27015.
  • -zone <variable> - appears to solve most script memory errors if you set it to 1024 (I believe the default is 255). Maybe the max line length (in characters) of a script or cfg file.
Note:You can also add any console commands onto the command line with +command_name command_setting.

Example hl.exe shortcut: D:\sierra\halflife\hl.exe -game cstrike -console -dev -numericping -noipx -toconsole +exec kani.cfg

Steam (Windows)

These command-line parameters work when launching the Steam application (steam.exe) under Windows.

Command-line parameters

  • -applaunch %id %c - This launches an Game or Application through Steam. Replace the %id with the Game/Application ID number that you want to open up, replace %c with the command line parameters for the game as listed in the Source Games section above.
  • -install %p - Install a product from a specified path (e.g. "D:" for the DVD-ROM drive if D: is one).
  • -language %l - Sets the Steam language to the one specified. (Examples: "english", "german")
  • -login %u %p - This logs into Steam with the specified Username and Password combination. Replace %u with the username, and %p with the password you want to login with (Steam must be off for this to work.)
  • -nocache - This starts steam with no cache (Steam must be off for this to work properly.)
  • -script %s - This runs a Steam script. Replace %s with the script filename. All scripts must be in a subdirectory of the Steam folder called test scripts (Steam must be off for this to work.)
  • -shutdown - This shuts down (exits) Steam.
  • -silent - This suppresses the dialog box that opens when you start steam. It is used when you have Steam set to auto-start when your computer turns on. (Steam must be off for this to work.)

hldsupdatetool (Windows), Steam (Unix)

Syntax: hldsupdatetool -command <command> [parameters] [flags]

Commands

  • -command update - Install or update HLDS.
  • -command version - View installed versions.
  • -command list - View available games.

Parameters

  • -game <game> - Mod game directory name.
  • -dir <installdir> - HLDS Install directory (if dir not specified, will use value from last run of tool).

Flags

  • -verify_all - Verify all HLDS files are up to date.
  • -retry - Automatically retry every 30 seconds if the Steam Network is busy.
  • -remember_password - Remember password (if a username is supplied).

Optional parameters

These are only needed to access limited content.

  • -username <username> - Steam account username
  • -password <password> - Steam account password


Source Dedicated Server

Command-line arguments for the Source Dedicated Server executable (srcds.exe, srcds_run)

Command-line parameters

  • -allowdebug - (Same as -debug ?)
  • -autoupdate - The server is searching for updates on startup (Linux/Unix only).
  • -console - SrcDS will run in console mode (Windows only).
  • -dev - Show developer messages.
  • -debug - Debug Mode.
  • -game <game> - Specifies which game/mod to run.
  • -insecure - Will start the server without Valve Anti-Cheat technology.
  • -norestart - Won't attempt to restart failed servers.
  • -nobots - Disable bots.
  • -ip - Specifies the IP when multiple network cards are installed.
  • -port - The port the server advertises to clients.
  • -maxplayers <number> - Specifies how many player slots the server can contain.
  • -timeout <number> Sleep for <number> seconds before restarting a failed server.
  • -tickrate <number> - Specifies Server-Tickrate (for more info see Source Multiplayer Networking).
  • -verify_all - Will check that each file in the install matches the latest Steam version.

Console variables

  • +<console variable> <arg> - Sets the Cvar (or console variable) to the specified setting.

Some useful console variables

  • +hostname "Nome Server" - Specifica il nome del server.
  • +ip - Specifica l'indirizzo IP quando ci siano installa diverse schede di rete. Richiesto per le operazioni VAC2.
  • +map <Mappa> - Specifica con quale mappa il server partirà.
  • +maxplayers <numero> - Specifica quanti giocatori massimi il server può contenere.
  • +hostport <porta> - Specifies the host port (Port specification before -port was added, but can still be used).
  • +clientport <porta> - Specifica la porta del client (The port the server advertises to clients, the same as -port and clientport in console)
  • +sv_lan <0/1> - Se è impostata a 1, il server è disponibile solo in LAN (Local Area Network).

Linux command options in Left 4 Dead

The linux version of Left 4 Dead dedicated server added extra server commands.

  • -netconport <number> - Creates a remotely accessible server console on the specified port. This can be connected to with telnet or similar applications, and allows controlling of the server as if the commands were being typed in at the console
  • -netconpassword "password" - It set, users must type PASS "password" to use the remote console described above
  • -fork <number> - Starts up the specified number of servers at once. They will each use the first available port number at 27015 or above.

Half-Life Dedicated Server

These command-line parameters are used with hlds.exe for Goldsource (Half-Life) games.

Command-line parameters

  • -autoupdate - The server is searching for updates on startup.
  • -console - HLDS will run in console mode (Windows only).
  • -game <game> - Specifies which game/mod to run.
  • -insecure - Disables Valve Anti-Cheat technology.
  • -sport <port> - Specifies the VAC2 port the server should use.

Variabili di Console

  • +<Variabile console> <argomento> - Sets the Cvar (or console variable) to the specified setting.

Alcune utili variabili per la console

  • +hostname "Nome Server" - Specifica il nome del server.
  • +ip - Specifica l'indirizzo IP quando ci siano installa diverse schede di rete. Richiesto per le operazioni VAC2.
  • +map <Mappa> - Specifica con quale mappa il server partirà.
  • +maxplayers <numero> - Specifica quanti giocatori massimi il server può contenere.
  • +port <porta> - Specifica which port to open for client connections.
  • +sv_lan <0/1> - Se è impostata a 1, il server è disponibile solo in LAN (Local Area Network).
  • +mapchangecfgfile "<file>" - Simile al file Server.cfg, ran after every round change, before Plugins are started.
  • -pingboost <1/2/3> - Selects between optimized HLDS network code stack. Set this on 2 usually reduces latency toward 1ms without loss of activity input packets.

Esempio di comando d'avvio per HLDS su Linux

./hlds_run -game cstrike -autoupdate -pingboost 2 +maxplayers 20 +mapchangecfgfile "mapchange.cfg" +map de_dust2 -port 27015 -sport 27035 +ip 62.93.204.15

Troubleshooting the Server Console

Specifying a map is necessary, otherwise the server is not ready to accept connections from players to your server. You may wish to specify the "ip" and "port" parameters if you are experiencing problems.

Note:This only applies to dedicated servers.

Vedere Anche

Developer Console

Personal tools
Namespaces
Variants
Actions