Forum

per-weapon crosshair configs

Created 4th February 2009 @ 19:42

Add A Reply Pages: 1 2 3 Next »

seraph

rEJ

Can anyone enlighten me on this:

for soldier I wish to have 3 different weapon/crosshair configs for each weapon. For rockets I want normal crosshair with viewmodelfov 70, for shotgun I want a pink dot with no model, and for spade I just want the normal spade. This is the config that I tried to make this happen:

//Weapon specific model settings

alias “one” “slot1; cl_crosshair_file “”; viewmodel_fov “70.0000”; r_drawviewmodel “1”; say one”
alias “two” “slot2; cl_crosshair_file “crosshair5”; r_drawviewmodel “0”; say two”
alias “three” “slot3; cl_crosshair_file “”; viewmodel_fov “50.0000”; r_drawviewmodel “1”; say three”

bind “1” “one”
bind “2” “two”
bind “3” “three”

needless to say I’m here asking ye what to do because it failed.

Any suggestions?

Anderson

TEZC
TEZC

the say command will actually says it, you might want to type “echo one” etc, maybe?

seraph

rEJ

oops, that was actually just there as a debug, to make sure that SOMETHING was happening.

Foxt

I’ve just made a config that does that. It only changes colors now, if you want deeper customization just modify “xhair_1”, “xhair_2” and “xhair_3” aliases.

It also switches beetween primary and secondary weapon with “lw” alias.


//
// Crosshair
//

cl_crosshair_file crosshair1
cl_crosshair_blue 50
cl_crosshair_green 220
cl_crosshair_red 0
cl_crosshair_scale 48

alias "xhair_set" "xhair_1"
alias "xhair_1" "cl_crosshair_blue 200; cl_crosshair_green 100; cl_crosshair_red 0; alias xhair_set xhair_2" // Primary weapon
alias "xhair_2" "cl_crosshair_blue 50; cl_crosshair_green 220; cl_crosshair_red 0; alias xhair_set xhair_1" // Secondary weapon
alias "xhair_3" "cl_crosshair_blue 0; cl_crosshair_green 80; cl_crosshair_red 255" // Melee

alias "lw" "lw2"
alias "lw1" "slot1; wait; alias lw lw2; xhair_1"
alias "lw2" "slot2; wait; alias lw lw1; xhair_2"

bind "q" "lw"
bind "1" "slot1; xhair_1; alias lw lw2"
bind "2" "slot2; xhair_2; alias lw lw1"
bind "3" "slot3; xhair_3; alias lw lw1"

I’ve tested this only a bit, but it seems to work fine.

AcidReniX

RaWr ::

I simple created a file that looks like this:

alias “xscattergun” “crosshair_file crosshair1; crosshair_scale 30”
alias “xrpg” ………………

etc. ..

Then I added ‘xscattergun’ to my reload script for each weapon so it works when I press slot1 or when I use the quick switch between primary and secondary weapon (a script like lastinv but no melee (I press E).

And example would be this for the soldier (soldier.cfg):

——————————————–

//SOLDIER CONFIG
-reload
sensitivity “1.3”

// Reload and Crosshairs
xrpg
alias “both_relON” “slot1; xrpg; +reload; bind e both_relOFF”
alias “both_relOFF” “slot2; xshotgun; +reload; bind e both_relON”

bind “e” “both_relON”

bind “1” “both_relON”
bind “2” “both_relOFF”
bind “3” “-reload; slot3; xmelee”

—————————————–

The first “xrpg” command selects the rpg crosshair when you first switch to the class (as you are holding the RPG to start with). After that, when I switch weapon it will change to the crosshair for the shotgun or rpg that are set in a different config using the line at the top of the post.

A little hint, if you want to hide your weapon models but want to see what gun you have, use this in the crosshair config file:

alias “xscattergun” “crosshair_file crosshair1; crosshair_scale 30; slot10”

The slot10 shows your current weapon in an overlay to the left of your screen. I tried it and found I didn’t like not using weapon models, but I might change to it in the future.

Also note you would need different reload configs for weapons that you don’t want autoreload for, so you can’t simply use the both_relON script for say, scout, otherwise it would reload your pistol.

klu

-[MG]-
MG//

From my config:

bind “mwheelup” “slot1; cl_crosshair_red 0; cl_crosshair_green 255; cl_crosshair_blue 0”
bind “mwheeldown” “slot2; cl_crosshair_red 0; cl_crosshair_green 0; cl_crosshair_blue 255”
bind “mouse4” “slot3; cl_crosshair_red 255; cl_crosshair_green 0; cl_crosshair_blue 0”

I don’t use Q, so this works perfectly for me.

You can add crosshair type and size to each button as needed.

string cl_crosshair_file “” (for default crosshair) can’t be used with alias string (because of “”), that’s why nothing works.

custom crosshairs and no weapon model:

Steamsteamapps…team fortress 2tfcfgscout.cfg
bind “1” “slot1; cl_crosshair_file crosshair5; cl_crosshair_scale 25”
bind “2” “slot2; cl_crosshair_file crosshair3; cl_crosshair_scale 25”
bind “3” “slot3; cl_crosshair_file crosshair7; cl_crosshair_scale 30”
r_drawviewmodel “0”
cl_crosshair_file “crosshair5”
cl_crosshair_scale “25”

this goes to other class cfgs to remove custom crosshairs

Steamsteamapps…team fortress 2tfcfgspy.cfg
r_drawviewmodel “1”
cl_crosshair_file “”

ofc, you need more complicated script to use Q (lastinv), like foxtreme’s. main disadvantage of this – often you need to tap key twice to change anything, i don’t like it (so i don’t use Q anymore).

Jh

Hey dats!

ugh… i still use the default crosshairs

Evil

I use the last weapon used to switch between rl and shotty, how to I get it to revert back to the orginal colour after i have switched back from shotty to rl?

klu

-[MG]-
MG//

you can setup some complex aliases and stuff to do it, too much hassle IMO though :)

Waebi

‹Con›

They just look so shiiiiiiiiiiiiiiiiiiiiiiite, why would I want to use them :S
Eye cancer ftw.

RaCio

GoT²

The basic idea of getting your crosshair colours, autoreloads different for each weapon is something like this:

alias wpn1 “slot1; cl_crosshair_red 0; cl_crosshair_green 0; cl_crosshair_blue 0; +reload″
alias wpn2 “slot2; cl_crosshair_red 255; cl_crosshair_green 0; cl_crosshair_blue 255; -reload″

Next, in your scripts and binds just use wpn1 instead of slot1 etc.
However you will need to make sure that things won’t mess up if you use different ways of switching your weapons.

When using Q and the number keys use something like this:
bind Q “swtch”
alias “swtch” “bswitch”
alias “aswitch” “wpn1; alias swtch bswitch”
alias “bswitch” “wpn2; alias swtch aswitch”

bind “1” “wpn1; alias swtch bswitch”
bind “2” “wpn2; alias swtch aswitch”
bind “3” “slot3; alias swtch aswitch”

veehell

-cavalier-

crosshair 7, size 4, pure green for all weapons…is great for me :)

gnus

HordeofGoats
s!

I had some problems with the cl_crosshair_file “” situation as well since you have to use “” inside of two other “”. I solved it by using another cfg-file. Lets say we call it normalcross.cfg. In that file all you write is:
cl_crosshair_file “”

This way you can change between the normal crosshairs and the new ones by executing that file inside your weapon changing script:
alias weapon_one “slot1; exec normalcross.cfg”
alias weapon_two “slot2; cl_crosshair_file crosshair4”
…and so on

But I found out that there was a tiny delay in the switch were you get to see a black and purpule square instead of the crosshair sometimes when you switched weapons so now I only use the new crosshairs. Might work better for you though. gl

AnAkkk

I found a way to do it without an other cfg.

Like this:

alias weapon_one “slot1; cl_crosshair_file ”

This is an invisible character, and the game will not look at any crosshair file, it’ll just be like cl_crosshair_file “”.

Add A Reply Pages: 1 2 3 Next »