Upvote Upvoted 0 Downvote Downvoted
Color Flashing Crosshair Help
posted in Q/A Help
1
#1
0 Frags +

Hey! So im using a hud called Hudas Icatiote and it has custom crosshairs , im currently using i think Fog's crosshair and is there anyway to make the crosshair change colors like every 0.5-1 second or maybe more?
Kinda like stabby , i know he has a script for that but i think it doesnt work with Hud Crosshairs
Also i knows there is something to do with hudlayoutanimations_tf or something but i cant find a way to make it flash other that when i hit somebody

I dont know if it is needed but im using Fog's crosshair "c"

Hey! So im using a hud called Hudas Icatiote and it has custom crosshairs , im currently using i think Fog's crosshair and is there anyway to make the crosshair change colors like every 0.5-1 second or maybe more?
Kinda like stabby , i know he has a script for that but i think it doesnt work with Hud Crosshairs
Also i knows there is something to do with hudlayoutanimations_tf or something but i cant find a way to make it flash other that when i hit somebody

I dont know if it is needed but im using Fog's crosshair "c"
2
#2
1 Frags +

Unfortunately it can't "easily" be done with a Hud crosshair. Now, I can set you in the right direction but in no way will I do the work for you.

What you need to do is make an animated vtf of the crosshair the you want. (google how to do this). Then you can add that animated vtf as a hud element and place it on your screen using the thumbnails method.

HERE is an example of one i saw on reddit.

/u/OffclassingMedicThe crosshair is simply a vtf file, which is loaded from an associated vmt file. The vtf can be any size and any colour, it can even be animated! Editing the vmt file allows applying material proxies (effects) to the vtf. You can mix these together to get some interesting results.
In the example I've made, the crosshair pulses between 0.3 and 0.5 blue every second, flashes to 1.0 green when moving, and constantly spins. These values can easily be adjusted. More info on material proxies. Be sure to have cl_crosshair_red, blue, and green set to 255, unless you want a colour mask.
Example and download:
http://a.pomf.se/bbzhnl.webm
http://a.pomf.se/alhehw.zip
Questions:
How do I use it? And does this work with sv_pure 2?
Read here, and yes: http://teamfortress.tv/thread/12383/real-custom-crosshairs-from-ozfortress
Can the crosshair be animated?
Yes.
Can this be applied to any existing crosshair?
Yes.
Would it be possible to use this to allow more than one crosshair on sv_pure 2?
Maybe, each frame of an animated vtf can have a different crosshair. Unfortunately I am not aware of a practical method for choosing which frame to display.
Does this work in other Source games?
Probably.
And now you'll never miss another shot again! Maybe!

Original post; http://www.reddit.com/r/truetf2/comments/26op93/more_intricate_crosshairs_colourchanging_flashing/

Hopefully this is enough to get you where you need. If you want to use this expect a bit of work to get it done.

Unfortunately it can't "easily" be done with a Hud crosshair. Now, I can set you in the right direction but in no way will I do the work for you.

What you need to do is make an animated vtf of the crosshair the you want. (google how to do this). Then you can add that animated vtf as a hud element and place it on your screen using the thumbnails method.

[url=http://a.pomf.se/bbzhnl.webm]HERE[/url] is an example of one i saw on reddit.

[quote=/u/OffclassingMedic]
The crosshair is simply a vtf file, which is loaded from an associated vmt file. The vtf can be any size and any colour, it can even be animated! Editing the vmt file allows applying material proxies (effects) to the vtf. You can mix these together to get some interesting results.
In the example I've made, the crosshair pulses between 0.3 and 0.5 blue every second, flashes to 1.0 green when moving, and constantly spins. These values can easily be adjusted. More info on material proxies. Be sure to have cl_crosshair_red, blue, and green set to 255, unless you want a colour mask.
Example and download:
http://a.pomf.se/bbzhnl.webm
http://a.pomf.se/alhehw.zip
Questions:
How do I use it? And does this work with sv_pure 2?
Read here, and yes: http://teamfortress.tv/thread/12383/real-custom-crosshairs-from-ozfortress
Can the crosshair be animated?
Yes.
Can this be applied to any existing crosshair?
Yes.
Would it be possible to use this to allow more than one crosshair on sv_pure 2?
Maybe, each frame of an animated vtf can have a different crosshair. Unfortunately I am not aware of a practical method for choosing which frame to display.
Does this work in other Source games?
Probably.
And now you'll never miss another shot again! Maybe![/quote]

Original post; http://www.reddit.com/r/truetf2/comments/26op93/more_intricate_crosshairs_colourchanging_flashing/

Hopefully this is enough to get you where you need. If you want to use this expect a bit of work to get it done.
3
#3
1 Frags +

It's easy to loop color changes on a HUD; the problem is the trigger. I know of 1 reliable, on-demand and independent trigger for all classes: voice menu. The animation stops on respawn/hud reload and may interfere with other HUD crosshair animations you may have.

If you still wish to stick exclusively to the HUD crosshair, you could try making changes in './scripts/HudAnimations_tf.txt':

Under 'event MenuClose' or 'event MenuPulse'.
MenuPulse to start it only when a voice command is used through the voice menu.

//Open Voice Menu. After close/use, crosshair color loop will start/reset.
	RunEvent xHairFlashLoop 0.0

The following defines the loop, and could go anywhere, preferably under (but outside) MenuClose/Pulse. Customize colors, # of colors and timing as desired.

event xHairFlashLoop
{
	Animate Crosshair'sFieldName FgColor "127 127 0 255"	Linear 0.0 0.0
	Animate Crosshair'sFieldName FgColor "0 255 0 255"	Linear 0.5 0.0
	Animate Crosshair'sFieldName FgColor "0 127 127 255"	Linear 1.0 0.0
	Animate Crosshair'sFieldName FgColor "0 0 255 255"	Linear 1.5 0.0
	Animate Crosshair'sFieldName FgColor "127 0 127 255"	Linear 2.0 0.0
	Animate Crosshair'sFieldName FgColor "255 0 0 255"	Linear 2.5 0.0
	RunEvent xHairFlashLoop 3.0
}

Optional:
Under 'event MenuOpen'.

//Stops crosshair flashing, but does not prevent it from starting or resetting.
	StopEvent xHairFlashLoop 0.0
	Animate Crosshair'sFieldName FgColor "127 127 0 255" Linear 0.0 0.0
It's easy to loop color changes on a HUD; the problem is the trigger. I know of 1 reliable, on-demand and independent trigger for all classes: voice menu. The animation stops on respawn/hud reload and may interfere with other HUD crosshair animations you may have.

If you still wish to stick exclusively to the HUD crosshair, you could try making changes in './scripts/HudAnimations_tf.txt':

Under 'event MenuClose' or 'event MenuPulse'.
MenuPulse to start it only when a voice command is used through the voice menu.
[code]
//Open Voice Menu. After close/use, crosshair color loop will start/reset.
RunEvent xHairFlashLoop 0.0
[/code]

The following defines the loop, and could go anywhere, preferably under (but outside) MenuClose/Pulse. Customize colors, # of colors and timing as desired.
[code]
event xHairFlashLoop
{
Animate Crosshair'sFieldName FgColor "127 127 0 255" Linear 0.0 0.0
Animate Crosshair'sFieldName FgColor "0 255 0 255" Linear 0.5 0.0
Animate Crosshair'sFieldName FgColor "0 127 127 255" Linear 1.0 0.0
Animate Crosshair'sFieldName FgColor "0 0 255 255" Linear 1.5 0.0
Animate Crosshair'sFieldName FgColor "127 0 127 255" Linear 2.0 0.0
Animate Crosshair'sFieldName FgColor "255 0 0 255" Linear 2.5 0.0
RunEvent xHairFlashLoop 3.0
}
[/code]

Optional:
Under 'event MenuOpen'.
[code]
//Stops crosshair flashing, but does not prevent it from starting or resetting.
StopEvent xHairFlashLoop 0.0
Animate Crosshair'sFieldName FgColor "127 127 0 255" Linear 0.0 0.0
[/code]
4
#4
2 Frags +

'kinda like stabby'

'kinda like stabby'
5
#5
0 Frags +
AElaiIt's easy to loop color changes on a HUD; the problem is the trigger. I know of 1 reliable, on-demand and independent trigger for all classes: voice menu. The animation stops on respawn/hud reload and may interfere with other HUD crosshair animations you may have.

If you still wish to stick exclusively to the HUD crosshair, you could try making changes in './scripts/HudAnimations_tf.txt':

Under 'event MenuClose' or 'event MenuPulse'.
MenuPulse to start it only when a voice command is used through the voice menu.
//Open Voice Menu. After close/use, crosshair color loop will start/reset.
	RunEvent xHairFlashLoop 0.0

The following defines the loop, and could go anywhere, preferably under (but outside) MenuClose/Pulse. Customize colors, # of colors and timing as desired.
event xHairFlashLoop
{
	Animate Crosshair'sFieldName FgColor "127 127 0 255"	Linear 0.0 0.0
	Animate Crosshair'sFieldName FgColor "0 255 0 255"	Linear 0.5 0.0
	Animate Crosshair'sFieldName FgColor "0 127 127 255"	Linear 1.0 0.0
	Animate Crosshair'sFieldName FgColor "0 0 255 255"	Linear 1.5 0.0
	Animate Crosshair'sFieldName FgColor "127 0 127 255"	Linear 2.0 0.0
	Animate Crosshair'sFieldName FgColor "255 0 0 255"	Linear 2.5 0.0
	RunEvent xHairFlashLoop 3.0
}

Optional:
Under 'event MenuOpen'.
//Stops crosshair flashing, but does not prevent it from starting or resetting.
	StopEvent xHairFlashLoop 0.0
	Animate Crosshair'sFieldName FgColor "127 127 0 255" Linear 0.0 0.0

Worked Thanks! Just had to change the "Crosshair'sFieldname" to "fogCrosshair"

[quote=AElai]It's easy to loop color changes on a HUD; the problem is the trigger. I know of 1 reliable, on-demand and independent trigger for all classes: voice menu. The animation stops on respawn/hud reload and may interfere with other HUD crosshair animations you may have.

If you still wish to stick exclusively to the HUD crosshair, you could try making changes in './scripts/HudAnimations_tf.txt':

Under 'event MenuClose' or 'event MenuPulse'.
MenuPulse to start it only when a voice command is used through the voice menu.
[code]
//Open Voice Menu. After close/use, crosshair color loop will start/reset.
RunEvent xHairFlashLoop 0.0
[/code]

The following defines the loop, and could go anywhere, preferably under (but outside) MenuClose/Pulse. Customize colors, # of colors and timing as desired.
[code]
event xHairFlashLoop
{
Animate Crosshair'sFieldName FgColor "127 127 0 255" Linear 0.0 0.0
Animate Crosshair'sFieldName FgColor "0 255 0 255" Linear 0.5 0.0
Animate Crosshair'sFieldName FgColor "0 127 127 255" Linear 1.0 0.0
Animate Crosshair'sFieldName FgColor "0 0 255 255" Linear 1.5 0.0
Animate Crosshair'sFieldName FgColor "127 0 127 255" Linear 2.0 0.0
Animate Crosshair'sFieldName FgColor "255 0 0 255" Linear 2.5 0.0
RunEvent xHairFlashLoop 3.0
}
[/code]

Optional:
Under 'event MenuOpen'.
[code]
//Stops crosshair flashing, but does not prevent it from starting or resetting.
StopEvent xHairFlashLoop 0.0
Animate Crosshair'sFieldName FgColor "127 127 0 255" Linear 0.0 0.0
[/code][/quote]


Worked Thanks! Just had to change the "Crosshair'sFieldname" to "fogCrosshair"
6
#6
1 Frags +

For anyone else looking to pursue the method dancenumber outlined: my guide on hud crosshairs might prove helpful. http://huds.tf/guides/?guide=3

For anyone else looking to pursue the method dancenumber outlined: my guide on hud crosshairs might prove helpful. http://huds.tf/guides/?guide=3
Please sign in through STEAM to post a comment.