Upvote Upvoted 0 Downvote Downvoted
xhair script
posted in Q/A Help
1
#1
0 Frags +

is there any script that could set a bind to rotate between the in-game crosshairs?

is there any script that could set a bind to rotate between the in-game crosshairs?
2
#2
7 Frags +

Something like...

bind j "toggle cl_crosshair_file crosshair1 crosshair2 crosshair3 crosshair4 crosshair5 crosshair6 crosshair7 default"

But that can't be used if you wanted cl_crosshair_file "" (the 'none' crosshair) because you cannot nest quotes and afaik, there's no support for a special delimiter in tf2 scripting. Instead you'd need something like

alias "xhair_file_now"     "xhair_file_none"
alias "xhair_none"          "exec xhair_none.cfg"    // xhair_none.cfg should have cl_crosshair_file "" and nothing else
alias "xhair_cross"        "cl_crosshair_file crosshair7"
alias "xhair_circle"       "cl_crosshair_file crosshair3"
alias "xhair_dot"          "cl_crosshair_file crosshair5"
alias "xhair_file_none"    "xhair_none;   alias xhair_file_now xhair_file_cross"
alias "xhair_file_cross"   "xhair_cross;  alias xhair_file_now xhair_file_circle"
alias "xhair_file_circle"  "xhair_circle; alias xhair_file_now xhair_file_dot"
alias "xhair_file_dot"     "xhair_dot;    alias xhair_file_now xhair_file_none"
// you can fill in the rest here
bind j "xhair_file_now"

Basically each alias sets the current crosshair and then changes the bind's alias to the next one in the cycle.

Something like...

[code]bind j "toggle cl_crosshair_file crosshair1 crosshair2 crosshair3 crosshair4 crosshair5 crosshair6 crosshair7 default"[/code]

But that can't be used if you wanted cl_crosshair_file "" (the 'none' crosshair) because you cannot nest quotes and afaik, there's no support for a special delimiter in tf2 scripting. Instead you'd need something like

[code]alias "xhair_file_now" "xhair_file_none"
alias "xhair_none" "exec xhair_none.cfg" // xhair_none.cfg should have cl_crosshair_file "" and nothing else
alias "xhair_cross" "cl_crosshair_file crosshair7"
alias "xhair_circle" "cl_crosshair_file crosshair3"
alias "xhair_dot" "cl_crosshair_file crosshair5"
alias "xhair_file_none" "xhair_none; alias xhair_file_now xhair_file_cross"
alias "xhair_file_cross" "xhair_cross; alias xhair_file_now xhair_file_circle"
alias "xhair_file_circle" "xhair_circle; alias xhair_file_now xhair_file_dot"
alias "xhair_file_dot" "xhair_dot; alias xhair_file_now xhair_file_none"
// you can fill in the rest here
bind j "xhair_file_now"[/code]

Basically each alias sets the current crosshair and then changes the bind's alias to the next one in the cycle.
3
#3
0 Frags +

Are you looking to alternate between 2 for certain weapons? Or do you want a sort of cycle of all of the built in game crosshairs?

Edit: Enderp's got you covered most likely

Are you looking to alternate between 2 for certain weapons? Or do you want a sort of cycle of all of the built in game crosshairs?

Edit: Enderp's got you covered most likely
4
#4
0 Frags +
EnderpSomething like...
bind j "toggle cl_crosshair_file crosshair1 crosshair2 crosshair3 crosshair4 crosshair5 crosshair6 crosshair7 default"

But that can't be used if you wanted cl_crosshair_file "" (the 'none' crosshair) because you cannot nest quotes and afaik, there's no support for a special delimiter in tf2 scripting. Instead you'd need something like
alias "xhair_file_now"     "xhair_file_none"
alias "xhair_none"          "exec xhair_none.cfg"    // xhair_none.cfg should have cl_crosshair_file "" and nothing else
alias "xhair_cross"        "cl_crosshair_file crosshair7"
alias "xhair_circle"       "cl_crosshair_file crosshair3"
alias "xhair_dot"          "cl_crosshair_file crosshair5"
alias "xhair_file_none"    "xhair_none;   alias xhair_file_now xhair_file_cross"
alias "xhair_file_cross"   "xhair_cross;  alias xhair_file_now xhair_file_circle"
alias "xhair_file_circle"  "xhair_circle; alias xhair_file_now xhair_file_dot"
alias "xhair_file_dot"     "xhair_dot;    alias xhair_file_now xhair_file_none"
// you can fill in the rest here
bind j "xhair_file_now"

Basically each alias sets the current crosshair and then changes the bind's alias to the next one in the cycle.

thanks man

[quote=Enderp]Something like...

[code]bind j "toggle cl_crosshair_file crosshair1 crosshair2 crosshair3 crosshair4 crosshair5 crosshair6 crosshair7 default"[/code]

But that can't be used if you wanted cl_crosshair_file "" (the 'none' crosshair) because you cannot nest quotes and afaik, there's no support for a special delimiter in tf2 scripting. Instead you'd need something like

[code]alias "xhair_file_now" "xhair_file_none"
alias "xhair_none" "exec xhair_none.cfg" // xhair_none.cfg should have cl_crosshair_file "" and nothing else
alias "xhair_cross" "cl_crosshair_file crosshair7"
alias "xhair_circle" "cl_crosshair_file crosshair3"
alias "xhair_dot" "cl_crosshair_file crosshair5"
alias "xhair_file_none" "xhair_none; alias xhair_file_now xhair_file_cross"
alias "xhair_file_cross" "xhair_cross; alias xhair_file_now xhair_file_circle"
alias "xhair_file_circle" "xhair_circle; alias xhair_file_now xhair_file_dot"
alias "xhair_file_dot" "xhair_dot; alias xhair_file_now xhair_file_none"
// you can fill in the rest here
bind j "xhair_file_now"[/code]

Basically each alias sets the current crosshair and then changes the bind's alias to the next one in the cycle.[/quote]
thanks man
Please sign in through STEAM to post a comment.