Jump to content
aliasedfrog

Crosshair for each weapon

Recommended Posts

Have seen this referenced a few times but nothing posted here threw this together today for anyone interested.

Widget -> Options. you can set what cross hair type, size and color for each cross hair (if your into that thing).

 

Updated: 09/21/15

  • 08/29/15 fixed no menu replay's causing options to bug out.    
  • 09/21/15 updated crosshair x/y/z defaults and  fixed so it doesn't force it to defaults unless you set it in options.
  •  

Source: http://pastebin.com/raw.php?i=ng2JrpRE 

 

Install: Save As, <steam>/<reflex>/base/internal/ui/<where ever (recommend a sub folder named custom)>/CrosshairWeapons.lua

           Launch game, go to: options -> widgets -> CrosshairWeapons -> Click visible.

           This is setup to work off the default cross hair widget. if you want to get it working with something custom feel free to message me and i'll take a look at it.

crosshairweapons.png

Edited by aliasedfrog

Share this post


Link to post
Share on other sites

This is really nice.

 

I'm currently using the widget that, I believe, was made by bonuspunkt for gaiia.(may be wrong) Because it adds a convar for xhair scale so I could set that up with addbind. Your widget seems much cleaner and user friendly.

 

Is there anyway you can add a preview to that widget so you don't have to flip between widgets setting it up?

 

Unfortunately I won't use this because of how retarded the scaling is on the cross. A problem with the default crosshairs and not your widget. Only thing I can get out of the cross is small and obnoxiously fat, or obnoxiously large and still obnoxiously fat. The cross bonuspunkt made is still very fat for my tastes, but at least it's not practically a square at smaller settings.

 

Again that's my gripes with the default xhairs, sorry. This is a very nice widget.

Share this post


Link to post
Share on other sites

 

 

Thanks,

Short of copying of the default crosshair.lua into that script I cannot do a preview due to a what I consider a bug with widgetGetConsoleVariable() trying to call the Crosshairs:draw() from another .lua file causes the console variables to

come back nil since they are looking under the wrong widget's name(I presume). I may do this if there looks to be no long term solution from but going to speak with dev's first to see if that can be addressed or not.

Share this post


Link to post
Share on other sites

If someone could make a similar widget for the cl_weapon_offset_x,y,z and cl_show_gun values, I'd be grateful! 

​Updated widget to include those. the cl_show_gun is kinda 'meh' since it waits on the switch/reload to finish before triggering you may see the weapon for a sec then it disappear.

Share this post


Link to post
Share on other sites

​Updated widget to include those. the cl_show_gun is kinda 'meh' since it waits on the switch/reload to finish before triggering you may see the weapon for a sec then it disappear.

​Awesome, Thanks! 

Share this post


Link to post
Share on other sites

aliasedfrog, do you think you could possibly add fov column? It will allow players use custom fov for each weapon :) Great work! 

​Added, NOTE: this will probably function poorly due to fov not changing until the weapon has actually changed and the fov change being instant and not 'tweened'

Share this post


Link to post
Share on other sites

thanks for the post ! though for some reason I'm running into an issue. For some reason the .lua doesnt appear in my widgets 

​Odd, I just saved a new copy from the pastebin and it worked as expected. did you copy paste it into a .lua or save it from browser?

I would recommend saving it from the browser as 'filename.lua' somewhere in the '<steam>/reflex/base/ui/' directory.

Share this post


Link to post
Share on other sites

​Odd, I just saved a new copy from the pastebin and it worked as expected. did you copy paste it into a .lua or save it from browser?

I would recommend saving it from the browser as 'filename.lua' somewhere in the '<steam>/reflex/base/ui/' directory.

​Hey !

I saved the content inside a text file and changed the language inside notepad ++, and now it appears within the list in widgets. Though when I open the the widget to change settings, the option menu closes and is bugged out until I restart reflex. I can upload images if that helps troubleshooting it ! 

Share this post


Link to post
Share on other sites

try saving it again from the pastebin link and just rename it from .txt to .lua as you save it. if that doesn't work

When you open it in option menu and it bugs out, open console & see what the error was, should be something like.

'lua: filename.lua:000 : error name' where 000 represents the line number that caused an error, and grab a ss of that.

Share this post


Link to post
Share on other sites

Anybody knows each weapon RGB value? I mean that colour what it's in weaponrack. I would like that my crosshair colour for RL would be that exact red, yellow for bolt, blue for IC etc.

Share this post


Link to post
Share on other sites

Anybody knows each weapon RGB value? I mean that colour what it's in weaponrack. I would like that my crosshair colour for RL would be that exact red, yellow for bolt, blue for IC etc.

​Take a screenshot and check the values in paint.

Share this post


Link to post
Share on other sites

^Thanks for the tip.

 However I have same issue with the widget as made. I would also rather not to use widgets if there's going to be callvote for HUD lockdown in the future. I could bind it like this "bind 4 weapon 4; ui_crosshairs_r 98; ui_crosshairs_g 218; ui_crosshairs_b 73" but then it would just change regardless did I have the gun or not. Any tips how to do this otherwise? Also if someone is interested in the RGb values they are:

axe      253 253 253
burst     0 252 252
sg     252 148 0
grenade 98 218 73
plasma     252 0 252
RL     242 0 0
ic     0 126 252
bolt     244 244 2
stake     126 0 0

 

Share this post


Link to post
Share on other sites

Doesnt seem to work for me. I see in the options menu, but does nothing. Cant change values. I deleted the"stock" crosshairs widget. Was this one dependant on it? Thanks!

​Yes depends on the stock crosshairs widget, most likely why nothing is working =)

Share this post


Link to post
Share on other sites

What's the default positioning for the weapons? I wish it didn't move everything by default...

​I will get it updated to not change the weapon position unless you set it in the options.

as far as defaults. unless they changed in recent updates it set's to 'default' by default.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×