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
alias rename setinfo name "my new name"
(you may not need quotes, try it with and without)
And then in your cfg
bind kp_end rename
EDIT:
Oh. Derp! Alternatively, I know for a fact this will work.
Create a new cfg, say, "GiveMeACoolName.cfg". Make the contents of this cfg,
setinfo name "My new name"
And now, bind kp_end exec GiveMeACoolName
But I need to use non-English characters, for example:
setinfo name "叒"
If I save this line to a .cfg file and exec it in-game, I'll get my name changed to "unnamed"
However, if I type this line into console, it would be perfectly fine.
I'm using UTF8(without BOM) for the .cfg file, maybe I should try something else?
Also did you try the alias? the only problem being you need to add the alias every time you launch, if you can't put it in a cfg.
EDIT:
Nope, just tried it, source only understands ANSI (UTF8 without BOM). The BOM screws it up. hmmmm
EDIT2:
Okay, I think I figured it out.
Postulation: the source engine cfg parser only handles 8 bit text files.
Observation: When using 16-bit aka Unicode, and a cfg file with the contents "foo", and I exec thet cfg, I get unknown command "�" (probably the BOM) and then unknown command f. So I changed to UTF8 (WITH BOM!). I still get the "�" BUT! if I put "foo" on the second line, by itself, I get unknown command "foo" after the �. So if you skip the first line, you can skip the BOM, but you still need 8-bit format (so UTF8).
Now, Notepad with UTF8 and BOM allows me to save your 叒. That doesn't necessarily mean it will work in game, though =( The reason being UTF8 is kindof a hack and 叒 will probably be interpreted as multiple 8-bit characters...
The reason I say this is that I tried echo 叒 in console and I got � � � . But you said the name thing works for you. Soooo idk maybe? Give it a shot.
That's the problem. Console won't display the character "叒" correctly unless you put quotation marks around it, like this:
] echo 叒
� � �
] echo "叒"
叒
That's why I can't simply use the command:
bind kp_end "setinfo name 叒"
The problem is, it seems that when console read a .cfg file, all unicode charactors would be ignored. For example, If I write the two commands above into a .cfg file and exec it in-game, I will get nothing but two blank lines.
Is this some kind of BUG?
Also. When all else fails...Auto Hot Key. You could make an auto hot key script that automatically types out the setinfo thing when you press a key. Then it's just "press console, press rename button, escape console" Might even be able to make it open the console for you, too, but you might need a bit of a wait between open console and typing the command.
@Bear, you cannot put quotes inside quotes. AFAIK there's no way to escape quotes in the cfg files either. The exception is to use the alias command.
And even if you could bind it, your binds are stored in config.cfg, so the next time you boot the game, same problem - it will fail to read the correct string out of config.cfg.
I've tried all the options, UTF-8 with/without BOM, UCS-2 Little Endian (I read on valve developer site saying this is required encoding for locazation files but it doesn't work in this case) Nothing helped.
Yeah... I use AHK quiet a lot, and I can set my mouse side button to input the long line for me but still, I'm looking for a "native" way to do this - worst case I'll just change my steam name and change it back when I'm done playing.
And this is the biggest problem. I think there's nothing left I can do unless valve fix the bug.
You seem technically competent and eager for a solution. After doing some more research I have the following suggestion.
Have you ever heard of a Resource File? It's a programmer thinger, the file has an extension .rc. Resource files are themselves Unicode in format, which is bomb for our purposes. Notably, Steam\steamapps\common\left 4 dead 2\left4dead2\cfg\valve.rc appears to be executed by the game (actually valve.rc is what execs autoexec.cfg)
Open valve.rc in a Unicode-enabled text editor and see if that might help you with the cfg problem. Since all Resource Files are in Unicode by default this *should* work...
EDIT:
Saddest face ever. I tried it. Didn't work. Calling it an .rc file is a lie - it's actually just another cfg file with a fancy file extension =(
Help me AHK-Kenobi. You're my only hope.
----------
#NoEnv
#SingleInstance force
Numpad1::
{
Send {SC029}
Sleep 100
Clipboard = setinfo name "叕"
Send ^v{enter}{esc}
}
----------
So it sends the ~ key (which opens the console) wait for a while, set the clipboard to desired content, and paste it into console then send enter key to submit and escape key to return to game.
I tried to send the string directly into console using ahk's send {u+XXXX} function, but somehow it fails (it works fine in the notepad but inputs wired things into in-game console. That's why I used clipboard to do the work. I didn't clear the clipboard or restore the content though but it's not hard to do.
Also, not sure about what noenv and singleinstance do, but one thing that I often do is wrap ifwinactive around my ahk gaming scripts. This way the script only works while the game is the active window, and if the window loses focus, the script won't run. This is especially important if you rebind m2 to +forward for games that won't let you rebind mouse buttons, like Dead Space. You can use AHK's Window Spy utility to see the ahk_class name.
For example, the ahk_class for Left 4 Dead 2 is Valve001 (this is the same for Portal 2 and, I imagine, many other Valve games). So, wrap this around your script.
#ifwinactive ahk_class Valve001
; insert ahk-fu here
#ifwinactive