STEAM GROUP
Alien Swarm Mods and Campaigns A S M A C
STEAM GROUP
Alien Swarm Mods and Campaigns A S M A C
158
IN-GAME
1,411
ONLINE
Founded
29 June, 2012
Language
English
All Discussions > Forum1 > Topic Details
 This topic has been pinned, so it's probably important
[config] Persistent unicode bindings. ✚ ☆ ☎ ◯
[en]

Sup, comrades. Hardcore players might find this useful. I have found nothing about this topic on internets, so I vent to share my knowledge. This was tested only with Alien Swarm, but might actually work with other Source Engine games.

WARNING. This topic is for advanced players. Use google if you don't know where to find your Alien Swarm game folder, or what are aliases, or what are key bindings, or how to save file in utf-8.

I have found how to make key bindings with unicode symbols. Well, you already may input unicode symbols in game console, and make unicode bindings this way. Problem was, unicode symbols will not be saved in your config files. And even if you edit your config with text editor and freeze it as read-only, game will ignore unicode symbols when loading config.

As workaround, we may use so called "vtest" files. They are intended for running some tests, perhaps during game development, as stated in Valve wiki. They are almost identical to usual config files. Somewhy, when game loads them, it does not strips out unicode symbols. But there is another bug, id does not support lines with semicolons in it, i.e. you can't create multi-command bindings. As workaround for this specific bug, we may use vtest file to create aliases, one alias per one command with unicode, and then use given aliases in normal config file.

First what you need is to add launch option which will run config file named "my.vtest" when game engine loads:
-testscript my.vtest

Next, create folder "testscripts" in "Alien Swarm\swarm", so it will be "Alien Swarm\swarm\testscripts". I hope I don't need to explain where you find your Alien swarm game folder.
Next, create file called "my.vtest" in this folder. Write down here some aliases with unicode symbols. Save it as "utf-8". Note, this is important: exactly "utf-8", not just "unicode". Example:
alias say_hello "say Hello. Привет."

Next, open "Alien Swarm\swarm\cfg\config.cfg", use your aliases here. Example:
bind "h" "say_hello"


Here is my config for example, you may use it as template.

Aliases in my.vtest:
alias say_hello "say Hello. Привет." alias say_medic "say ░░░ hey, medic ✚" alias say_officer "say ░░░ hey, officer ☆" alias say_technic "say ░░░ hey, tech ☎" alias say_spweapons "say ░░░ hey, heavy ◯" alias say_ndyr_help "say ░░░ need YOUR help" alias say_help_mate "say ░░░ assist your teammate" alias say_omg_help "say ░░░ AAAA HELP (o,,,o)" alias say_warning "say ░░░ ☀ warning ☀" alias say_kill "say ░░░ kill" alias say_adren "say ░░░ adrenaline NOW" alias say_do_not "say ░░░ do not" alias say_ready_do "say ░░░ ready / do" alias say_done "say ░░░ done" alias say_okay "say ░░░ ok" alias say_thanx "say ░░░ thanx ☺" alias say_yes "say ░░░ yes" alias say_no "say ░░░ no" alias say_stop "say ░░░ stop / wait" alias say_go "say ░░░ go / move" alias say_grenade "say ░░░ grenade Œ Œ Œ Œ" alias say_shieldbug "say ░░░ shield-bug ℧" alias say_parasite "say ░░░ parasite ℥" alias say_mortar "say ░░░ mortar" alias say_horde "say ░░░ horde" alias say_aaa "say ░░░ AAA-AAAAAA-AA-AAAA-A" alias say_holy_shit "say ░░░ ☀ holy shit ☀" alias say_epic "say ░░░ ☀ epic ☀" alias say_marine_down "say ░░░ † marine down †" alias say_game_over "say ░░░ † game over †" alias say_take_this "say ░░░ take this" alias say_give_me "say ░░░ give me" alias say_outof_item "say ░░░ 0 items" alias say_outof_med "say ░░░ 0 medicine" alias say_outof_ammo "say ░░░ 0 ammo" alias say_need_vodka "say ░░░ need Vodka" alias say_drink_vodka "say ░░░ let's drink Vodka" alias say_dinosaur "say ░░░ f*cking dinosaur" alias say_ffuu "say ░░░ fffuuuuu" alias say_lag "say ░░░ lag"

Key bindings, only part of config.cfg:
bind "0" "cl_chatter 59; say_aaa" bind "1" "+grenade1" bind "2" "cl_emote 0; say_medic" bind "3" "say_officer" bind "4" "say_technic" bind "5" "say_spweapons" bind "6" "cl_chatter 15; cl_emote 13666; say_thanx" bind "a" "+moveleft" bind "c" "+voicerecord" bind "d" "+moveright" bind "e" "+use" bind "f" "+secondary" bind "g" "ASW_Drop" bind "h" "asw_suicide" bind "j" "cl_chatter 56; say_marine_down" bind "k" "say_okay" bind "l" "say_drink_vodka" bind "m" "say_ndyr_help" bind "n" "cl_chatter 56; say_need_vodka" bind "o" "say_dinosaur" bind "p" "say_lag" bind "q" "ASW_InvLast" bind "r" "+reload" bind "s" "+back" bind "t" "say" bind "u" "say_ffuu" bind "v" "cl_emote 4" bind "w" "+forward" bind "x" "asw_orderMarinesHold" bind "y" "say" bind "z" "+mouse_menu" bind "KP_INS" "asw_dropextra; say_take_this" bind "KP_END" "say_outof_item" bind "KP_DOWNARROW" "cl_chatter 71; say_outof_med" bind "KP_PGDN" "cl_emote 1; say_outof_ammo" bind "KP_LEFTARROW" "say_game_over" bind "KP_5" "cl_emote 5; say_warning" bind "KP_RIGHTARROW" "say_holy_shit" bind "KP_HOME" "say_do_not" bind "KP_UPARROW" "cl_chatter 53; say_kill" bind "KP_PGUP" "say_help_mate" bind "KP_MINUS" "disconnect" bind "KP_PLUS" "cl_chatter 60; say_omg_help" bind "KP_ENTER" "say_done" bind "KP_DEL" "say_give_me" bind "[" "cl_chatter 57" bind "]" "cl_chatter 58" bind "'" "cl_chatter 53" bind "`" "toggleconsole" bind "/" "cl_emote 13666" bind "\" "cl_chatter 60" bind "-" "say_hello" bind "ENTER" "cl_chatter 32; say_ready_do" bind "SPACE" "+jump" bind "BACKSPACE" "cl_chatter 52; say_grenade" bind "TAB" "ingamebriefing" bind "ESCAPE" "cancelselect" bind "INS" "say_adren" bind "DEL" "say_epic" bind "HOME" "say_mortar" bind "END" "cl_chatter 47; say_shieldbug" bind "PGUP" "cl_chatter 49; say_parasite" bind "PGDN" "say_horde" bind "PAUSE" "pause" bind "SHIFT" "+walk" bind "ALT" "mycam" bind "UPARROW" "cl_chatter 2; say_yes" bind "LEFTARROW" "cl_emote 3; say_stop" bind "DOWNARROW" "say_no" bind "RIGHTARROW" "cl_emote 4; say_go" bind "F1" "+selectmarine1" bind "F2" "+selectmarine2" bind "F3" "+selectmarine3" bind "F4" "+selectmarine4" bind "F5" "vote_yes" bind "F6" "vote_no" bind "F7" "asw_restart_mission" bind "F8" "playerlist" bind "F9" "jpeg" bind "MOUSE1" "+attack" bind "MOUSE2" "+alt1" bind "MWHEELUP" "+attack" bind "MWHEELDOWN" "+attack"
Last edited by Lukewarm (tea); 20 Nov, 2014 @ 1:50pm
< >
Showing 1-11 of 11 comments
Lukewarm (tea) 20 Nov, 2014 @ 1:53pm 
[ru]

Привет. Больше всего эта информация может пригодиться хардкорным игрокам. Я ничего не нашёл на эту тему в интернетах, поэтому решил что этими знаниями есть смысл поделиться. Описанный приём я тестировал только с Alien Swarm, но я думаю что он будет работать и в других играх на движке Source.

ПРЕДУПРЕЖДЕНИЕ. Этот топик рассчитан на продвинутых игроков. Используйте гугл, если вы не в курсе, где найти папку игры Alien Swarm, или что такое алиасы и бинды, или как сохранить файл в utf-8.

Я нашёл способ, как добавить символы юникода в привязки клавиш. В принципе, ничто не мешает сделать бинды с юникодом через консоль игры. Проблема в том, что символы юникода будут вырезаны при сохранения конфига. Даже если отредактировать конфиг вручную и сделать его только-для-чтения, игра просто проигнорирует символы юникода при загрузке конфига.

В качестве обхода этой проблемы мы можем использовать файлы типа "vtest". Как сказано на вики Valve, эти файлы предназначались для запуска каких-либо тестов, скорее всего в процессе разработки игры. По своей сути файлы этого типа мало чем отличаются от обычных конфиг-файлов. Интересно, что когда игра загружает эти файлы, она не выкидывает из них юникод. С другой стороны, есть неприятный косяк: в этих файлах некорректно работают строки, содержащие точку с запятой, а именно, команды после точки с запятой не выполняются. Чтобы обойти этот баг, мы можем прописать в файл типа "vtest" алиасы для команд с юникодом, а потом использовать эти алиасы в нормальном конфиге.

Сперва для игры в Стиме нужно добавить параметр запуска, который запустит конфиг "my.vtest" после загрузки движка игры. Пример:
-testscript my.vtest

Далее, создаём папку "testscripts" в "Alien Swarm\swarm", итоговая папка имеет путь "Alien Swarm\swarm\testscripts". Я надеюсь мне не придётся объяснять, где найти папку игры.
Далее, создаём файл "my.vtest" в этой папке. Запишем сюда алиасы для нужны команд. Файл необходимо сохранить в кодировке "utf-8". Это важно, кодировка должна быть именно "utf-8", а не просто "юникод". Пример:
alias say_hello "say Hello. Привет."

Далее, открываем обычный конфиг "Alien Swarm\swarm\cfg\config.cfg", используем алиасы в нужных биндах. Пример:
bind "h" "say_hello"


Здесь я выкладываю свой собственный конфиг, его можно использовать в качестве образца.

Алиасы в my.vtest:
alias say_hello "say Hello. Привет." alias say_medic "say ░░░ hey, medic ✚" alias say_officer "say ░░░ hey, officer ☆" alias say_technic "say ░░░ hey, tech ☎" alias say_spweapons "say ░░░ hey, heavy ◯" alias say_ndyr_help "say ░░░ need YOUR help" alias say_help_mate "say ░░░ assist your teammate" alias say_omg_help "say ░░░ AAAA HELP (o,,,o)" alias say_warning "say ░░░ ☀ warning ☀" alias say_kill "say ░░░ kill" alias say_adren "say ░░░ adrenaline NOW" alias say_do_not "say ░░░ do not" alias say_ready_do "say ░░░ ready / do" alias say_done "say ░░░ done" alias say_okay "say ░░░ ok" alias say_thanx "say ░░░ thanx ☺" alias say_yes "say ░░░ yes" alias say_no "say ░░░ no" alias say_stop "say ░░░ stop / wait" alias say_go "say ░░░ go / move" alias say_grenade "say ░░░ grenade Œ Œ Œ Œ" alias say_shieldbug "say ░░░ shield-bug ℧" alias say_parasite "say ░░░ parasite ℥" alias say_mortar "say ░░░ mortar" alias say_horde "say ░░░ horde" alias say_aaa "say ░░░ AAA-AAAAAA-AA-AAAA-A" alias say_holy_shit "say ░░░ ☀ holy shit ☀" alias say_epic "say ░░░ ☀ epic ☀" alias say_marine_down "say ░░░ † marine down †" alias say_game_over "say ░░░ † game over †" alias say_take_this "say ░░░ take this" alias say_give_me "say ░░░ give me" alias say_outof_item "say ░░░ 0 items" alias say_outof_med "say ░░░ 0 medicine" alias say_outof_ammo "say ░░░ 0 ammo" alias say_need_vodka "say ░░░ need Vodka" alias say_drink_vodka "say ░░░ let's drink Vodka" alias say_dinosaur "say ░░░ f*cking dinosaur" alias say_ffuu "say ░░░ fffuuuuu" alias say_lag "say ░░░ lag"

Бинды, это лишь часть config.cfg:
bind "0" "cl_chatter 59; say_aaa" bind "1" "+grenade1" bind "2" "cl_emote 0; say_medic" bind "3" "say_officer" bind "4" "say_technic" bind "5" "say_spweapons" bind "6" "cl_chatter 15; cl_emote 13666; say_thanx" bind "a" "+moveleft" bind "c" "+voicerecord" bind "d" "+moveright" bind "e" "+use" bind "f" "+secondary" bind "g" "ASW_Drop" bind "h" "asw_suicide" bind "j" "cl_chatter 56; say_marine_down" bind "k" "say_okay" bind "l" "say_drink_vodka" bind "m" "say_ndyr_help" bind "n" "cl_chatter 56; say_need_vodka" bind "o" "say_dinosaur" bind "p" "say_lag" bind "q" "ASW_InvLast" bind "r" "+reload" bind "s" "+back" bind "t" "say" bind "u" "say_ffuu" bind "v" "cl_emote 4" bind "w" "+forward" bind "x" "asw_orderMarinesHold" bind "y" "say" bind "z" "+mouse_menu" bind "KP_INS" "asw_dropextra; say_take_this" bind "KP_END" "say_outof_item" bind "KP_DOWNARROW" "cl_chatter 71; say_outof_med" bind "KP_PGDN" "cl_emote 1; say_outof_ammo" bind "KP_LEFTARROW" "say_game_over" bind "KP_5" "cl_emote 5; say_warning" bind "KP_RIGHTARROW" "say_holy_shit" bind "KP_HOME" "say_do_not" bind "KP_UPARROW" "cl_chatter 53; say_kill" bind "KP_PGUP" "say_help_mate" bind "KP_MINUS" "disconnect" bind "KP_PLUS" "cl_chatter 60; say_omg_help" bind "KP_ENTER" "say_done" bind "KP_DEL" "say_give_me" bind "[" "cl_chatter 57" bind "]" "cl_chatter 58" bind "'" "cl_chatter 53" bind "`" "toggleconsole" bind "/" "cl_emote 13666" bind "\" "cl_chatter 60" bind "-" "say_hello" bind "ENTER" "cl_chatter 32; say_ready_do" bind "SPACE" "+jump" bind "BACKSPACE" "cl_chatter 52; say_grenade" bind "TAB" "ingamebriefing" bind "ESCAPE" "cancelselect" bind "INS" "say_adren" bind "DEL" "say_epic" bind "HOME" "say_mortar" bind "END" "cl_chatter 47; say_shieldbug" bind "PGUP" "cl_chatter 49; say_parasite" bind "PGDN" "say_horde" bind "PAUSE" "pause" bind "SHIFT" "+walk" bind "ALT" "mycam" bind "UPARROW" "cl_chatter 2; say_yes" bind "LEFTARROW" "cl_emote 3; say_stop" bind "DOWNARROW" "say_no" bind "RIGHTARROW" "cl_emote 4; say_go" bind "F1" "+selectmarine1" bind "F2" "+selectmarine2" bind "F3" "+selectmarine3" bind "F4" "+selectmarine4" bind "F5" "vote_yes" bind "F6" "vote_no" bind "F7" "asw_restart_mission" bind "F8" "playerlist" bind "F9" "jpeg" bind "MOUSE1" "+attack" bind "MOUSE2" "+alt1" bind "MWHEELUP" "+attack" bind "MWHEELDOWN" "+attack"

Last edited by Lukewarm (tea); 20 Nov, 2014 @ 1:57pm
Очень познавательно) Как будет нужно - знаю, где найти)
Ghost Apple 21 Nov, 2014 @ 8:39am 
thank you! :sfsmile:
S C R U B L O R D 21 Nov, 2014 @ 9:38am 
nice :D:
Tosha [01 KZ] 12 Dec, 2014 @ 8:41am 
YAY!
KANEDA 31 Dec, 2014 @ 12:40pm 
This has been a giant rabbit hole for me.:KSmiley:

The instructions are clear and to the point but I can not get it to work. After some troubleshooting I think I've found the problem but I don't know how to fix it.

If I encode my.vtest in UTF-8, console returns"Unknown command: say_hello". If I encode my.vtest in unicode I get "Hello. ??????." in chat (I did this to confirm that launch options is pointed at the right file and aliases are formatted correctly.) It seems as though AS is not recognizing UTF-8.

So am I missing something? Is there another step to get AS to read UTF-8? Or am I way off?


Last edited by KANEDA; 31 Dec, 2014 @ 12:40pm
Lukewarm (tea) 31 Dec, 2014 @ 12:52pm 
Originally posted by KANEDA:
Or am I way off?

I believe your file wasn't saved correctly. I bet you are using notepad.exe, and frankly, I have not tested if it produces correct files. Try Notepad++ (free), set encoding to 'utf-8 without BOM' and save. Alternatively, try Sublime Text 2 (virtually free), invoke 'File' -> 'Save With Encoding' -> 'UTF-8'.

BTW, which OS and editor you are using?

As another guess, there might be some parasite byte in your text file, that wrecks parsing. Try writing my.vtest from scratch, by hands.

Also remember you can't use semicolon (;) in *vtest files.
Last edited by Lukewarm (tea); 31 Dec, 2014 @ 12:55pm
KANEDA 31 Dec, 2014 @ 1:02pm 
eureka!

Works perfectly:) Thank you so much.

Win 7 x64 and was using notepad.
Sanitar 5 Jan, 2015 @ 10:35pm 
Спасибо, познавательно.
Но у меня почему-то отказывается принимать мои алиасы. Все делал по инструкции, сохранял через AkelPad x64 в кодировке UTF-8 без BOM. Параметр запуска прописан, но в игре выдает ошибку: неизвестная комада "say_horde" (пример). Интересно, в чем же проблема?
Lukewarm (tea) 6 Jan, 2015 @ 5:28am 
Originally posted by Sanitar:
Интересно, в чем же проблема?
Для начала нужно убедиться, что my.vtest лежит в нужном месте. Чтобы исключить проблему с кодировкой, можно прописать в my.vtest что-нибудь простое, одну строчку (т.е. всё остальное удалить) без юникода:
alias my_vtest "echo okay"
Команда my_vtest должна напечатать в консоль текст "okay". Причём команда должна быть доступна сразу, как загруится меню игры.

Если не поможет, будем копать дальше.
Sanitar 7 Jan, 2015 @ 1:06am 
Originally posted by Meh >-(..)-<:
Для начала нужно убедиться, что my.vtest лежит в нужном месте

Ну да, именно здесь и проблема. Папку не так назвал, а точнее одну букву пропустил. Все работает, спасибо за помощь.
< >
Showing 1-11 of 11 comments
Per page: 1530 50

All Discussions > Forum1 > Topic Details