바인드

From DDraceNetwork
Revision as of 10:52, 7 March 2023 by Fwanny (talk | contribs) (Created page with "*'''player_color_body''' *'''player_color_feet''' *'''cl_message_client_color'''")

DDNet 클라이언트에는 거의 모든 키와 마우스 버튼에 바인딩(binding)할 수 있는 다양한 커맨드와 세팅들이 있습니다. 기본적으로 F1을 눌러 액세스하는 콘솔 창에서 명령어을 입력할 수 있습니다.

구문

단일 바인드

bind [키] [커맨드/세팅] [값]

위 명령어는 단순 바인드의 기본적인 구문입니다.


  • [키] 는 명령어를 바인딩하려는 키보드/ 마우스의 설정 공간입니다. 다시말해 설정해 놓고 싶은 조작키를 설정하는 곳입니다.
  • [커맨드/세팅] 모든 명령어와 세팅 용어의 전체 목록은 여기에서 찾을 수 있습니다.
  • [값]은 설정하려는데 있어서 지정하려는 변수 또는 명령어에 대한 인수를 넣는 공간입니다. 모든 명령어에 인수가 필요한 것은 아닙니다.

여기에서 키 코드를 찾거나 DDNet 클라이언트에서 설정 -> 조작에 있는 것 중 하나를 일시적으로 입력해보면 키 이름이 표시가 됩니다. 바인드와 함께 수정 키를 사용할 수도 있습니다.

bind ctrl+[키] [커멘드/세팅] [값]

ctrl, alt, shiftgui를 함께 사용할 수 있습니다. gui는 Windows의 Windows 키, macos/osx의 커맨드 키, Linux의 super/meta를 나타내는 데 사용됩니다.

다중 바인드

커맨드/세팅을 세미콜론(;)으로 구분하고 따옴표로 묶어 함께 연결할 수도 있습니다. 원하는 만큼 해당 체인에 명령을 추가할 수 있습니다.

 bind [키] "[커맨드/세팅] [값]; [커맨드/세팅] [값]"

이렇게 하면 여러 가지의 명렁어를 함께 연결하면 모든 커맨드/세팅들이 정확히 동시에 게임에서 실행된다는 점이 중요합니다. 즉, 작성한 순서대로 순차적으로 실행되지 않는다는 의미입니다. 간격을 두어 지연시키는 유형의 명령어는 없습니다. 순서대로 작업을 수행하는 가장 좋은 방법은 시퀀스의 각 단계마다 다른 키를 바인딩하거나 구성 파일을 사용하여 하나의 키를 여러 번 눌러 여러 파일을 읽는 것입니다.

중첩 바인드

백슬래시(\)를 사용하여 각각의 새 따옴표 집합을 탈출 처리하여 여러 따옴표로 묶인 문자열을 한 줄에 중첩할 수 있습니다.

bind [키] "bind [키] \"[커맨드/세팅] [값]; bind [키] \\\"[커맨드/세팅] [값] \\\"\""

위의 명령어처럼 명령어가 질어지면 백슬래시도 탈출 처리해야 합니다. 각각의 새 레이어가 다시 탈출 해제되므로 레이어당 백슬래시 양을 두 배로 늘려야 합니다. 콘솔에서 오류를 표시하기 전까지 사용할 수 있는 최대 백슬래시를 사용한 레이어 수는 5입니다. 이는 콘솔의 최대 문자 제한이 255이기 때문입니다. 6개의 레이어에 대한 백슬래시의 양은 240(1*2 + 3*2 + 7*2 + 15*2 + 31*2 + 63*2)이므로 15만 남습니다.

 1 = 1   \
 2 = 3   \\\
 3 = 7   \\\\\\\
 4 = 15  \\\\\\\\\\\\\\\
 5 = 31  \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

보기에는 혼란스러울 수 있을 테지만 더 명확하게 시각적으로 탈출 처리된 새로운 명령어을 만들어 보면 아래와 같이 만들 수 있습니다.

bind [키] 
 "bind [키] 
  \"[커맨드/세팅] [값]; bind [키]
   \\\"[커맨드/세팅] [값]; bind [키] 
    \\\\\\\"[커맨드/세팅] [값]
    \\\\\\\"
   \\\"
  \"
  "

참고: 위의 예와 같은 형식의 구성 파일을 실행할 수 없습니다. 작동하지 않습니다. 이 예제는 중첩된 바인드가 구성되는 방법에 대한 명확한 시각적 아이디어를 얻기 위한 것입니다.

유용한 커맨드/세팅

Toggles

Toggles[1]는 하나의 키를 사용하여 어떠한 설정에 대한 2개의 값을 번갈아 사용하는 방법입니다. Toggles에는 두 가지 유형이 있습니다.

  • toggle 은 키를 누를 때마다 설정에 대한 두 값 중 하나가 변경되도록 사용됩니다.
  • +toggle 은 키를 누르고 있는 동안에만 첫 번째 값이 설정되고 키에서 손을 떼면 두 번째 값이 설정되도록 사용됩니다.
 bind [키] "toggle [커맨드/세팅] [값1] [값2]"
bind [키] "+toggle [커맨드/세팅] [값1] [값2]"

Toggles는 클라이언트 설정(F1)에서만 작동합니다. 클라이언트 또는 채팅창에서는 사용할 수 없습니다.

Say

Say 는 바인딩을 위한 중요한 클라이언트 명령입니다. 채팅 명령어을 바인드에 통합하고 채팅창에 텍스트를 보낼 수 있습니다.

bind [키] say /[채팅 커맨드]
bind [키] say [채팅하고자 하는 말]

Colors

일부 클라이언트 명령을 사용하면 색상을 설정할 수 있습니다.

  • player_color_body
  • player_color_feet
  • cl_message_client_color

몇 가지 예시입니다.


올바른 색상 값을 얻으려면 설정 > Tee로 이동하고 사용자 정의 색상 을 눌러 원하는 색상을 찾으십시오. 그 다음 콘솔로 이동하여 위에 나온 명령어을 입력하십시오. "Value:" 다음에 나오는 숫자가 관련 숫자입니다.

File:Colors.png

player_color_body 5635840

또는 16진수 값으로 사용하려는 경우:

player_color_body $00FF00

또한 이름으로도 몇 가지 색상 값이 적용됩니다. red, yellow, green, cyan, blue, magenta, white, gray, black 등 모두 적용됩니다.

Emotes

emote 명령어을 사용하면 이모트 휠(shift)을 사용하지 않고 이모티콘를 나타낼 수 있습니다. 각 이모티콘들은 다른 숫자로 표시됩니다.

emote 0 oop
emote 1 exclamation
emote 2 hearts
emote 3 drop
emote 4 dotdot
emote 5 music
emote 6 sorry
emote 7 ghost
emote 8 sushi
emote 9 splattee
emote 10 deviltee
emote 11 zomg
emote 12 zzz
emote 13 wtf
emote 14 eyes
emote 15 question

예를 들어:

bind h emote 14

Other

binds [키]

이 명령을 사용하여 [키]에 바인딩된 내용을 지정할 수 있습니다. 현재 바인드의 전체 목록을 얻으려면 마지막에 키 없이 사용하십시오.

unbind [키]

지정한 키를 바인딩 해제합니다.

구성 파일 사용하기

구문

보다 복잡한 바인드의 경우 키 누름을 통해 실행되는 커맨드/세팅이 포함된 텍스트 파일을 만들 수 있습니다.

settings.cfg

[커맨드/세팅] [값]
[커맨드/세팅] [값]
[커맨드/세팅] [값]; [커맨드/세팅] [값]
[커맨드/세팅] [값]; [커맨드/세팅] [값]

bind [키] [커맨드/세팅] [값]
bind [키] exec [file.cfg]

커맨드/세팅은 세미콜론을 통하거나 새로운 줄을 사용하여 연결할 수 있습니다. 만들고자 하는 파일에 원하는 만큼 많은 커맨드/세팅/바인드들을 넣을 수 있습니다.

참고: 확장자로 .cfg를 사용할 필요가 없습니다. 실제로 원하는 파일 확장자를 사용할 수 있습니다. .cfg가 표준인 것 같습니다.

Path/Exec

이 파일을 실행하려면 올바른 디렉토리에 넣고 exec 명령으로 실행해야 합니다. 올바른 경로는 운영 체제에 따라 다릅니다. 올바른 경로는 운영 체제에 따라 다릅니다. 운영 체제에 맞는 올바른 경로를 찾으려면 다음을 참조하십시오. DDNet 구성 디렉토리 또는 저장 디렉토리는 어디에 있습니까?

Once the files are in the correct path, you can execute them in the game console with the exec command.

exec [file.cfg]

or

bind [key] exec [file.cfg]

You can use sub-directories within the 'DDNet' or 'Teeworlds' directory to organize files. Just include the path when you execute the file.

bind [key] exec [path/to/file.cfg]

Improved toggle with config files

The most common reason to use config files is to create a single-key toggle to alternate between two files.

file1.cfg

[command/setting] [value]
[command/setting] [value]
[command/setting] [value]

bind [key] exec file2.cfg

file2.cfg

[command/setting] [value]
[command/setting] [value]
[command/setting] [value]

bind [key] exec file1.cfg

In this case, [key] would be the same key in both files. This way each time you press the key, it will switch to the other file. Once you have both of these files in the correct path, you can exec either one just once and they will be bound forever until you unbind them.

bind [key] exec file1.cfg

You can use this method to cycle between any amount of files.

Customization

Echo

As a more clear way to show which file you're activating when you press a bind, you can use the echo command to display which one is active.

[command/setting] [value]
[command/setting] [value]

echo setting ON

bind [key] exec file1.cfg

To take this a step further, there is a command to change the color of the echo messages.

[command/setting] [value]
[command/setting] [value]

cl_message_client_color red
echo setting OFF

bind [key] exec file1.cfg

Having different colors for "on" and "off" binds makes it a bit easier to notice which setting you've activated. If you want to get more creative with colors, see colors.

Comments

You can put comments in your bind files too.

# These lines change some settings

[command/setting] [value]
[command/setting] [value]

# This next line rebinds the key
bind [key] exec file1.cfg

Examples

Hook line always on

The command cl_show_hook_coll_own, sets whether you will see your own hook collision line or not when you hold your +showhookcoll bind (defaulted to S). When set to 2, your hook collision line will always show only to you. Others players won't see it.

hook_line_on.cfg

cl_show_hook_coll_own 2

cl_message_client_color green
echo Hook Line ON

bind x exec hook_line_off.cfg

hook_line_off.cfg

cl_show_hook_coll_own 1

cl_message_client_color red
echo Hook Line OFF

bind x exec hook_line_on.cfg

Put both of these in the correct path, and in console:

bind x exec hook_line_on.cfg

Everyone's hooklines

The command cl_show_hook_coll_other allows you to see other tee's hooklines, which can be useful when they are out of your view. You can add this to the basic hookline bind to "upgrade" it:

cl_show_hook_coll_other

bind x "+showhookcoll; +toggle cl_show_hook_coll_other 2 1"

Deep Fly

The deep fly bind is a way to make your dummy hammer/fire toward you whenever you fire with your main tee. If your dummy is deep frozen, they can hammer back at you when you hammer them with this bind on. You can use this to fly with your dummy, but it takes practice. If your dummy is not deep frozen, you can just use this as a alternative version of the regular Dummy Hammerfly bind included in the games settings, where you can fire your pistol each time you want to be hammered. It offers better control since you can control the timing of your dummy's hammers.


Note: If the mapper has set sv_deepfly 0 on their map, you will not be able to deep fly with a deep frozen tee, since it can sometimes enable players to do parts in ways that the mapper did not intend. The deep fly bind will still work normally with frozen or unfrozen tees. As a player, this is not a setting you can adjust.

The command cl_dummy_hammer 1 is what is used for the regular Dummy Hammerfly bind in the games control options. By using a toggle, you can make your dummy hammer you only when you fire, and can make an on/off switch with config files.

Using 2 Config Files

deepfly_on.cfg

bind mouse1 "+fire; +toggle cl_dummy_hammer "1 0"

cl_message_client_color green
echo Deep Fly ON

bind x exec deepfly_off.cfg

deepfly_off.cfg

bind mouse1 +fire
cl_dummy_hammer 0

cl_message_client_color red
echo Deep Fly OFF

bind x exec deepfly_on.cfg

Put both of these in the correct path, and in console:

bind x exec deepfly_on.cfg

Using 1 Config File

You can accomplish the same thing as above using only 1 config file.

bind x "bind mouse1 \"+fire; +toggle cl_dummy_hammer 1 0\";cl_message_client_color green; echo Deep Fly ON; bind x \"bind mouse1 +fire; cl_dummy_hammer 0; cl_message_client_color red; echo Deep Fly OFF; exec deepfly.cfg\"" Put this file in the correct path, and in console:

bind x exec deepfly.cfg

Note 1: This assumes mouse1 is your +fire bind.

Note 2: If you turn deep fly off while you're holding your +fire bind, your dummy will get stuck in a hammering rhythm since cl_dummy_hammer is set to 1 still. The cl_dummy_hammer 0 line in deepfly_off.cfg fixes this.

Weapon Swapping

If your dummy isn't holding hammer when you turn the bind on, they will switch back and forth between pistol and hammer. If you want to fix this:

cl_dummy_restore_weapon 0

Now if they're holding pistol when you start using the bind, they will switch to hammer and stay there after 1 pistol shot. There are however some benefits of having this setting set to 1.

cl_dummy_restore_weapon 1

This will allow you to laser yourself with your dummy with perfect aim. It can also be useful with shotgun.

To manage dealing with both of these settings, you can either create a toggle, use config files, or have this setting attached to your weapon binds.

bind [key] "+weapon1; cl_dummy_restore_weapon 0"

bind [key] "+weapon5; cl_dummy_restore_weapon 1" This of course only works if you have dedicated weapon binds as opposed to +nextweapon and +prevweapon which is by default bound to mousewheelup and mousewheeldown.

45° Aiming

This bind allows you to only aim in 45° angles when holding down the key. This is useful for shooting rockets straight up for double rockets and a few other scenarios.

bind x "+toggle cl_mouse_max_distance 2 400; +toggle inp_mousesens 1 200; +showhookcoll"

Keep in mind that if you have changed cl_mouse_max_distance or inp_mousesens from the default, using the example above will reset those settings to default. Before you just enter the binds, check your settings for both first by typing cl_mouse_max_distance and inp_mousesens into the console.

bind x "+toggle cl_mouse_max_distance 2 [Your Value]; +toggle inp_mousesens 1 [Your Value]; +showhookcoll"

Note: the +showhookcoll line is optional. It's just helpful to see which way you're aiming since your tee's eyes don't follow the 45° constraints, and by nature of how this bind works, your crosshair won't show direction either.

Rainbow Tee

You will sometimes see players rapidly changing color as they play. To do this you just have to bind a player_color_body change to each of your regular movement inputs.

bind a "+left; player_color_body red"

You can do this for several common inputs and get a variety of to cycle through.

rainbow_tee.cfg

bind a "+left; player_color_body red"
bind d "+right; player_color_body yellow"
bind space "+jump; player_color_body green"
bind mouse1 "+fire; player_color_body blue"
bind mouse2 "+hook; player_color_body cyan"

Here's an example of what a rainbow tee file looks like. You could save that in the correct path and execute it once.

exec rainbow_tee.cfg

Or if you want a key to toggle it on and off:

rainbow_tee_on.cfg

bind a "+left; player_color_body red"
bind d "+right; player_color_body yellow"
bind space "+jump; player_color_body green"
bind mouse1 "+fire; player_color_body blue"
bind mouse2 "+hook; player_color_body cyan"

bind x exec rainbow_tee_off.cfg

rainbow_tee_off.cfg

bind a +left
bind d +right
bind space +jump
bind mouse1 +fire
bind mouse2 +hook

bind x exec rainbow_tee_on.cfg

Put both of these in the correct path, and in console:

bind x exec rainbow_tee_on.cfg

You can of course get more creative with colors and use player_color_feet too. To learn more about how colors work, see colors

Note: This assumes you have default binds for left, right, jump, fire, and hook.

See also

  1. 한국어로 코트에 달린 막대모양의 단추를 의미합니다. 단추이기에 끼우고 떼고 가능하다 해서 코딩 용어로 Toggle key라고도 쓰이는데 "한번 누르면 어떤 기능이 ON되고, 한번 더 누르면 OFF되는 키"를 말합니다.