Upvote Upvoted 0 Downvote Downvoted
"Unknown command: �" upon executing cfg file
posted in Customization
1
#1
0 Frags +

I have a little problem where a .cfg file won't work and will show "Unknown command: �" in console, yet others work fine. I have everything saved where it should be and there seem to be no grammatical/syntax errors.

Here is the code:

alias +med "dropitem; +attack2; say_team UBERCHARGED";
alias -med "-attack2";
bind mouse2 +med;

I have another cfg with not one similar command that has the same issue, but about 9 more that have no issues at all no matter what I put in them.

Help pls?

I have a little problem where a .cfg file won't work and will show "Unknown command: �" in console, yet others work fine. I have everything saved where it should be and there seem to be no grammatical/syntax errors.

Here is the code:

alias +med "dropitem; +attack2; say_team UBERCHARGED";
alias -med "-attack2";
bind mouse2 +med;


I have another cfg with not one similar command that has the same issue, but about 9 more that have no issues at all no matter what I put in them.

Help pls?
2
#2
10 Frags +

semicolons go inside the quotes

semicolons go inside the quotes
3
#3
-14 Frags +

There needs to be a semi colon at the end of every line too as the cfg is read as one line.

There needs to be a semi colon at the end of every line too as the cfg is read as one line.
4
#4
8 Frags +

semicolon outside quotes is incorrect syntax

semicolon outside quotes is incorrect syntax
5
#5
0 Frags +
alias +med "dropitem; +attack2; say_team UBERCHARGED"
alias -med "-attack2"
bind "mouse2" "+med"

so yeah just get rid of the semicolons outside the qoutes

[code]alias +med "dropitem; +attack2; say_team UBERCHARGED"
alias -med "-attack2"
bind "mouse2" "+med"[/code]

so yeah just get rid of the semicolons outside the qoutes
6
#6
4 Frags +
Pizzza-blyatThere needs to be a semi colon at the end of every line too as the cfg is read as one line.

Line ends are definitely read as end statements.

[quote=Pizzza-blyat]There needs to be a semi colon at the end of every line too as the cfg is read as one line.[/quote]
Line ends are definitely read as end statements.
7
#7
-1 Frags +

I'm still getting the same error :(

On a side note, all my other cfgs have semi colons on the end of a line and they work fine
e.g.

alias +zoomer "fov_desired 75; r_drawviewmodel 0;"; alias -zoomer "fov_desired 90; viewmodel_fov 95; r_drawviewmodel 1"; bind shift +zoomer;

alias d1 "disguise 1 -1; bind b d2";
alias d2 "disguise 2 -1; bind b d3";
alias d3 "disguise 5 -1; bind b d4";
alias d4 "disguise 7 -1; bind b d5";
alias d5 "disguise 9 -1; bind b d1";
bind b d1;

cl_crosshair_file crosshair1;

bind mwheelup "slot1; r_drawviewmodel 1; viewmodel_fov 90; cl_crosshair_scale 20";

bind mwheeldown "slot2; r_drawviewmodel 1; viewmodel_fov 90; cl_crosshair_scale 3";

bind mouse5 "lastdisguise";

works every time.

I'm still getting the same error :(

On a side note, all my other cfgs have semi colons on the end of a line and they work fine
e.g.

alias +zoomer "fov_desired 75; r_drawviewmodel 0;"; alias -zoomer "fov_desired 90; viewmodel_fov 95; r_drawviewmodel 1"; bind shift +zoomer;

alias d1 "disguise 1 -1; bind b d2";
alias d2 "disguise 2 -1; bind b d3";
alias d3 "disguise 5 -1; bind b d4";
alias d4 "disguise 7 -1; bind b d5";
alias d5 "disguise 9 -1; bind b d1";
bind b d1;

cl_crosshair_file crosshair1;

bind mwheelup "slot1; r_drawviewmodel 1; viewmodel_fov 90; cl_crosshair_scale 20";

bind mwheeldown "slot2; r_drawviewmodel 1; viewmodel_fov 90; cl_crosshair_scale 3";

bind mouse5 "lastdisguise";



works every time.
8
#8
6 Frags +

that is because u are trying to bind something to the command +med; which isnt a command. thats why its giving you an unknown command. the actual command is +med without a semicolon

in other words, get rid of the semicolon. and no, you dont need semicolons at all in general since tf2 reads line breaks as command stops.

that is because u are trying to bind something to the command +med; which isnt a command. thats why its giving you an unknown command. the actual command is +med without a semicolon

in other words, get rid of the semicolon. and no, you dont need semicolons at all in general since tf2 reads line breaks as command stops.
9
#9
7 Frags +

The error message you're talking about is specifically what you get when you have a file encoded as utf8 or unicode with BOM (or some other weird encoding that uses some invisible heading character). Either encode the file as ascii (because your script doesn't need any unicode support), or if you have the option (notepad++) encode it as utf8 without BOM.

Not sure if that's what's causing the issue, it's been a while since I worked with unicode scripts, but iirc it breaks the first line of the file. Assuming your +med alias is on the first line and you didn't space it more, that's most likely why.

Also for the record everyone in this thread, semicolons outside of quotes and at the end of lines is completely acceptable and valid. It can actually be useful because you can copy/paste the script into console without going line-by-line if it ends lines with semicolons. It's not standard practice but it's not what's causing an issue. Semicolons get interpreted by the console first (only after doublequotes) and separate commands, they don't merge in to form weird unique names if you don't space them or anything like that.

The error message you're talking about is specifically what you get when you have a file encoded as utf8 or unicode with BOM (or some other weird encoding that uses some invisible heading character). Either encode the file as ascii (because your script doesn't need any unicode support), or if you have the option (notepad++) encode it as utf8 without BOM.

Not sure if that's what's causing the issue, it's been a while since I worked with unicode scripts, but iirc it breaks the first line of the file. Assuming your +med alias is on the first line and you didn't space it more, that's most likely why.

Also for the record everyone in this thread, semicolons outside of quotes and at the end of lines is completely acceptable and valid. It can actually be useful because you can copy/paste the script into console without going line-by-line if it ends lines with semicolons. It's not standard practice but it's not what's causing an issue. Semicolons get interpreted by the console first (only after doublequotes) and separate commands, they don't merge in to form weird unique names if you don't space them or anything like that.
10
#10
3 Frags +

It was the encoding!
Thanks a lot!

It was the encoding!
Thanks a lot!
11
#11
3 Frags +
JarateKingAlso for the record everyone in this thread, semicolons outside of quotes and at the end of lines is completely acceptable and valid.

^

[quote=JarateKing]
Also for the record everyone in this thread, semicolons outside of quotes and at the end of lines is completely acceptable and valid. [/quote]
^
12
#12
1 Frags +
JarateKingAlso for the record everyone in this thread, semicolons outside of quotes and at the end of lines is completely acceptable and valid. It can actually be useful because you can copy/paste the script into console without going line-by-line if it ends lines with semicolons. It's not standard practice but it's not what's causing an issue. Semicolons get interpreted by the console first (only after doublequotes) and separate commands, they don't merge in to form weird unique names if you don't space them or anything like that.

interesting, thx for the info

[quote=JarateKing]Also for the record everyone in this thread, semicolons outside of quotes and at the end of lines is completely acceptable and valid. It can actually be useful because you can copy/paste the script into console without going line-by-line if it ends lines with semicolons. It's not standard practice but it's not what's causing an issue. Semicolons get interpreted by the console first (only after doublequotes) and separate commands, they don't merge in to form weird unique names if you don't space them or anything like that.[/quote]

interesting, thx for the info
Please sign in through STEAM to post a comment.