Console commands: Difference between revisions

From ZDoom Wiki
Jump to navigation Jump to search
Content deleted Content added
No edit summary
No edit summary
Line 41: Line 41:


Button commands are commands that represent buttons and come in pairs. Each "button" has a command prefixed by a + and another corresponding command prefixed by a -. The + version of the command simulates pushing the button, and the - version of the command simulates releasing the button.
Button commands are commands that represent buttons and come in pairs. Each "button" has a command prefixed by a + and another corresponding command prefixed by a -. The + version of the command simulates pushing the button, and the - version of the command simulates releasing the button.

When you bind a command that begins with + to a key, releasing the key will automatically execute the same command with the + replaced by a -. Note that this works for aliases as well as the commands listed here. This provides a useful way to bind multiple actions to a single key. Suppose you want the normal Doom behavior of moving forward and using when you double click the right mouse button. If you use the commands
When you bind a command that begins with + to a key, releasing the key will automatically execute the same command with the + replaced by a -. Note that this works for aliases as well as the commands listed here. This provides a useful way to bind multiple actions to a single key. Suppose you want the normal Doom behavior of moving forward and using when you double click the right mouse button. If you use the commands



Revision as of 11:28, 5 January 2004

Console Commands are used to alter the way ZDoom does something, such as changing the sound volume, changing DMflags, ect...

you access the console by pressing "~" at any time

Console variable types

There are six types of cvars: Boolean, Integer, Float, String, Colour and Flag.

boolean

This type of variable represents a yes/no or on/off value. It can only be set to true or false. As shorthand, setting a boolean variable to 0 will set it to false, and setting it to anything non-zero will set it to true.

integer

This is an ordinary number without a decimal point. For example, 1 is an integer, but 1.2 is not.

float

This is an ordinary number that can have a decimal point.

string

This is a series of text characters enclosed in quotes: For example, "Felix loitered lecherously on the lot" is a string. If you removed the quotes around it, then it would not be a string. If you need to use quotes inside a string, preface it with a backslash.

Are you "The One" of old?

would be written like this as a string:

"Are you \"The One\" of old?"

colour

This type of variable is a series of three hexadecimal numbers representing the amounts of red, green, and blue (in that order) in a color. For example, pure red would be represented as "ff 00 00". As a shorthand, you can set a color variable with one of several color names, and the RGB values will be set for you.

flag

This type of variable mirrors a setting in dmflags or dmflags2. Setting its value will set the corresponding value in one of those variables, and getting its value will get the corresponding value from one of the other two variables. This is designed to make using dmflags easier, because you don't have to memorize any numbers.

Button Commands

Button commands are commands that represent buttons and come in pairs. Each "button" has a command prefixed by a + and another corresponding command prefixed by a -. The + version of the command simulates pushing the button, and the - version of the command simulates releasing the button.

When you bind a command that begins with + to a key, releasing the key will automatically execute the same command with the + replaced by a -. Note that this works for aliases as well as the commands listed here. This provides a useful way to bind multiple actions to a single key. Suppose you want the normal Doom behavior of moving forward and using when you double click the right mouse button. If you use the commands

bind mouse2 +forward
doublebind mouse2 +use

ZDoom will move you forward when you press the right mouse button. When you double click it, you will press use, but you will not move forward. To simulate the standard Doom behavior, you can replace the doublebind command with these three commands instead:

alias +useforward "+use; +forward"
alias -useforward "-use; -forward"

doublebind mouse2 +useforward

Now when you double click the right mouse button, the +useforward alias will be executed. Because +useforward's name begins with a + releasing the right mouse button will execute the -useforward alias (whether or not -useforward is defined).

This behavior of executing a - command when a key is released applies only to the first command or alias bound to the key. If you bind a key to "+forward; +right", releasing the key will execute the command "-forward; +right" and not "-forward; -right". As shown above, you can use aliases to get the correct behavior.

Another trick you can do with aliases is to create a key that only executes the + command without executing the - command. If you wanted a key that will make you move forward when you press it, and will keep you moving forward even after releasing it, you can use an alias like this:

alias go "+forward"

Then instead of binding +forward to a key, you bind go to the key instead. This works because go does not begin with a + so nothing will happen when you release the key—ZDoom only looks at the command actually bound to the key to determine if it should execute a - command when the key is released; it does not look inside aliases.

Standard buttons

+attack Use your weapon.
-attack Stop using your weapon.

+use Start trying to use anything in front of you.
-use Stop trying to use anything in front of you.

+back Move backward.
-back Stop moving backward.

+forward Move forward.
-forward Stop moving forward.

+jump Start jumping.
-jump Stop jumping.

+left Start turning left.
-left Stop turning left.

+right Start turning right.
-right Stop turning right.

+moveleft Start strafing left.
-moveleft Stop strafing left.

+moveright Start strafing right.
-moveright Stop strafing right.

+lookdown Start lowering your view.
-lookdown Stop lowering your view.

+lookup Start raising your view.
-lookup Stop raising your view.

+movedown Start moving down if swimming or flying.
-movedown Stop moving down.

+moveup Start moving up if swimming or flying.
-moveup Stop moving up if swimming or flying.

+strafe Causes +left and +right to behave like +moveleft and +moveright;
-strafe Returns +left and +right to their normal behavior.

+klook Causes +forward and +back to act like +lookup and +lookdown instead.
-klook Returns +forward and +back to their normal behavior.

+mlook Moving the mouse up and down will make you look up and down.
-mlook Moving the mouse up and down will make you move forward and backward. However, if freelook is true, then moving the mouse up and down will still change your view instead of moving you.

+showscores Display a scorelist for deathmatch games.
-showscores Hide the deathmatch scorelist.

+speed Start running.
-speed Start walking.

Customization

Screenshots

Chatting

Cheating

Display

Renderer

Video

Bots

Automap

Player Settings

Debugging