Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Привет. Больше всего эта информация может пригодиться хардкорным игрокам. Я ничего не нашёл на эту тему в интернетах, поэтому решил что этими знаниями есть смысл поделиться. Описанный приём я тестировал только с Alien Swarm, но я думаю что он будет работать и в других играх на движке Source.
ПРЕДУПРЕЖДЕНИЕ. Этот топик рассчитан на продвинутых игроков. Используйте гугл, если вы не в курсе, где найти папку игры Alien Swarm, или что такое алиасы и бинды, или как сохранить файл в utf-8.
Я нашёл способ, как добавить символы юникода в привязки клавиш. В принципе, ничто не мешает сделать бинды с юникодом через консоль игры. Проблема в том, что символы юникода будут вырезаны при сохранения конфига. Даже если отредактировать конфиг вручную и сделать его только-для-чтения, игра просто проигнорирует символы юникода при загрузке конфига.
В качестве обхода этой проблемы мы можем использовать файлы типа "vtest". Как сказано на вики Valve, эти файлы предназначались для запуска каких-либо тестов, скорее всего в процессе разработки игры. По своей сути файлы этого типа мало чем отличаются от обычных конфиг-файлов. Интересно, что когда игра загружает эти файлы, она не выкидывает из них юникод. С другой стороны, есть неприятный косяк: в этих файлах некорректно работают строки, содержащие точку с запятой, а именно, команды после точки с запятой не выполняются. Чтобы обойти этот баг, мы можем прописать в файл типа "vtest" алиасы для команд с юникодом, а потом использовать эти алиасы в нормальном конфиге.
Сперва для игры в Стиме нужно добавить параметр запуска, который запустит конфиг "my.vtest" после загрузки движка игры. Пример:
Далее, создаём папку "testscripts" в "Alien Swarm\swarm", итоговая папка имеет путь "Alien Swarm\swarm\testscripts". Я надеюсь мне не придётся объяснять, где найти папку игры.
Далее, создаём файл "my.vtest" в этой папке. Запишем сюда алиасы для нужны команд. Файл необходимо сохранить в кодировке "utf-8". Это важно, кодировка должна быть именно "utf-8", а не просто "юникод". Пример:
Далее, открываем обычный конфиг "Alien Swarm\swarm\cfg\config.cfg", используем алиасы в нужных биндах. Пример:
Здесь я выкладываю свой собственный конфиг, его можно использовать в качестве образца.
Алиасы в my.vtest:
Бинды, это лишь часть config.cfg:
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?
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.
Works perfectly:) Thank you so much.
Win 7 x64 and was using notepad.
Но у меня почему-то отказывается принимать мои алиасы. Все делал по инструкции, сохранял через AkelPad x64 в кодировке UTF-8 без BOM. Параметр запуска прописан, но в игре выдает ошибку: неизвестная комада "say_horde" (пример). Интересно, в чем же проблема?
Если не поможет, будем копать дальше.
Ну да, именно здесь и проблема. Папку не так назвал, а точнее одну букву пропустил. Все работает, спасибо за помощь.