Бінди

From DDraceNetwork
Revision as of 13:07, 30 December 2023 by Animeuz (talk | contribs) (Created page with "<span style="color:purple"># These lines change some settings</span> [command/setting] [value] [command/setting] [value] <span style="color:purple"># Наступний рядок прив'язує key </span> bind [key] exec file1.cfg")

Клієнт DDNet має безліч команд і налаштувань, які можна прив'язати майже до будь-якої клавіші або кнопки миші. Команди можна вводити у консолі, яка за замовчуванням відкривається натисканням клавіші F1.

Синтаксис

Поодинокі бiнди

bind [key] [command/setting] [value]

Це базовий синтаксис для простого бiнда.

  • [key] клавіша на клавіатурі/миші, до якої ви хочете прив'язати команду.
  • [command/setting] Повний список всіх команд і налаштувань можна знайти тут.
  • [value] це змінна, для якої ви хочете встановити налаштування, або аргумент для команди. Не всі команди потребують аргументів

Ви можете знайти ключові коди тут, або просто тимчасово введіть ключ в один з елементів керування на сторінці Налаштування > Елементи керування у клієнті DDNet, і він покаже назву ключа. Ви також можете використовувати ключі-модифікатори з прив'язками.

bind ctrl+[key] [command/setting] [value]

ви можете використовувати клавіші ctrl, alt, shift та gui. Gui використовується для позначення клавіші windows у Windows, командної клавіші у macOS/osx та super/meta у linux.

Множинні бiнди

Ви також можете об'єднати команди/налаштування в ланцюжок, розділивши їх крапкою з комою і взявши в лапки. Ви можете додати до цього ланцюжка стільки команд, скільки хочете.

bind [key] "[command/setting] [value]; [command/setting] [value]"

Важливо знати, що при такому об'єднанні всі команди/налаштування виконуються грою в один і той самий час, тобто вони не будуть виконуватися послідовно в тому порядку, в якому ви їх записали. Не існує команд типу sleep або delay, щоб розставити все так, як вам потрібно. Найкращий спосіб зробити так, щоб події відбувалися у впорядкованій послідовності, - це або зв'язати різні ключі для кожного кроку послідовності, або використати конфігураційні файли натискання однієї клавіші кілька разів для послідовного зчитування кількох файлів.

Вкладені бiнди

Ви можете вкласти кілька рядків у лапках в один рядок, екрануючи кожен новий набір лапок зворотними косими рисками.

bind [key] "bind [key] \"[command/setting] [value]; bind [key] \\\"[command/setting] [value] \\\"\""

Коли цитовані рядки стають глибшими, вам також потрібно екранувати зворотні слеші. Оскільки кожен новий шар буде знову відкривати їх, вам потрібно подвоїти кількість зворотних косих рисок для кожного шару. Максимальна кількість шарів, яку ви можете використати - 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 [key] 
 "bind [key] 
  \"[command/setting] [value]; bind [key]
   \\\"[command/setting] [value]; bind [key] 
    \\\\\\\"[command/setting] [value]
    \\\\\\\"
   \\\"
  \"
 "

Примітка: Ви не можете запустити конфігураційний файл, відформатований так, як показано в прикладі вище, він не буде працювати. Цей приклад наведено лише у тому, щоб отримати чітке візуальне уявлення у тому, як будується вкладений бінд.

Корисні Команди та Налаштування

Перемикачі

Перемикачі - це спосіб використання однієї кнопки для чергування двох значень параметра. Існує два типи перемикачів.

  • toggle використовується для того, щоб при кожному натисканні клавіші перемикатися між одним із двох значень налаштування.
  • +toggle використовується для того, щоб перше значення встановлювалося лише під час натискання клавіші, а друге значення встановлювалося, коли кнопка відпускається.
bind [key] toggle [setting] [value1] [value2]
bind [key] +toggle [setting] [value1] [value2]

Перемикачі працюють лише для налаштувань клієнта. Їх не можна використовувати для команд клієнта чи чату.

Say(Казати)

Say – важлива клієнтська команда для прив'язки. Це дозволяє включати команди чату в прив'язку, а також просто надсилати текст в чат.

bind [key] say /[chat command]
bind [key] say [chat message]

Кольори

Деякі команди клієнта дозволяють встановлювати кольори.

  • player_color_body
  • player_color_feet
  • cl_message_client_color

декілька прикладів.

Щоб отримати правильні значення кольору, перейдіть до Налаштування > Tії і за допомогою повзунків знайдіть потрібний колір. Зайдіть в консоль і введіть команду для кольору, який ви намагаєтеся встановити без значення. Число, яке йде після "Value:", є відповідним числом.

File:Colors.png

player_color_body 5635840 

або, якщо ви хочете використовувати шістнадцяткове значення:

player_color_body $00FF00 

Він також приймає кілька значень кольору на ім'я. red, yellow, green, cyan, blue, magenta, white, gray, black - всі вони працюють.

Емоції

Команда emote може бути використана для відображення емоцій без використання емоцій колеса. Кожен емойт представлений окремим номером.

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

Інше

binds [key]

Ви можете використовувати цю команду для написання того, що прив'язано до однієї кнопки. Використовуйте її без ключа в кінці, щоб отримати повний список усіх поточних прив'язок.

unbind [key]

Відв'язує бінд, який ви зазначили.

Використання Файлів Конфігурації

Синтаксис

Для більш складних біндів можна створити текстові файли з налаштуваннями/командами, які будуть виконуватися під час натискання клавіш.

settings.cfg

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

bind [key] [command/setting] [value]
bind [key] exec [file.cfg]

Налаштування/команди можуть бути з'єднані в ланцюжок через точку з комою або просто з нового рядка. Ви можете помістити в ці файли стільки команд/налаштувань/біндів, скільки захочете.

Примітка: Вам не обов'язково використовувати .cfg як розширення. Ви можете використовувати будь-яке розширення файлу. .cfg просто задається стандартним.

Path/Exec

Щоб виконати ці файли, необхідно помістити їх у правильний каталог та виконати за допомогою команди exec. Правильний шлях залежить від вашої операційної системи. Щоб знайти правильний шлях для вашої операційної системи, див. Де знаходиться DDNet config, config directory або save directory?

Коли файли знаходяться у правильному шляху, ви можете виконати їх у ігровій консолі за допомогою команди exec.

exec [file.cfg]

або

bind [key] exec [file.cfg]

Для організації файлів можна використовувати підкаталоги в каталозі 'DDNet' або 'Teeworlds'. Просто вкажіть шлях під час виконання файлу.

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

Поліпшення перемикання з конфігураційними файлами

Найбільш поширеною причиною використання файлів конфігурації є створення перемикання між двома файлами за допомогою однієї клавіші.

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

У цьому випадку [key] буде однією і тією ж кнопкою в обох файлах. Таким чином, при кожному натисканні клавіші відбуватиметься перемикання на інший файл. Після того, як обидва файли знаходяться в правильному шляху, ви можете виконати будь-який з них лише один раз, і вони будуть прив'язані назавжди, поки ви їх не знімете.

Кастомізація

Echo

Як наочний спосіб показати, який файл активується при натисканні кнопки bind, ви можете використовувати команду echo, щоб показати, який файл активний.

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

echo setting ON

Щоб зробити ще один крок уперед, існує команда для зміни кольору echo-повідомлень.
[command/setting] [value]
[command/setting] [value]

cl_message_client_color red
echo setting OFF

Використання різних кольорів для біндів "увімкнено" та "вимкнено" дозволяє легше помітити, яке налаштування активовано. Якщо ви хочете більш творчо підійти до використання кольорів, див.кольори.

Коментарі

Ви також можете розміщувати коментарі в бінд файли.

# These lines change some settings
[command/setting] [value]
[command/setting] [value]

# Наступний рядок прив'язує key

bind [key] exec file1.cfg

Приклади

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"

Deepfly

The deepfly 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 deepfly with a deep frozen tee, since it can sometimes enable players to do parts in ways that the mapper did not intend. The deepfly 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. There is also a delay between color changes, so changes don't happen the instant you press a key.

Дивіться також