Search
Username:
Password:

Register or Reset Password

SUBMISSIONS
Counter Strike
   New Maps
   New Tutorials
   New Skins
   New GUI's
   New Sounds
   New Threads
Other
   Media
   Gamers
   Clans
   Studios
Colour & Alpha tutorial
Difficulty: Beginner
Category: CS:S > ScriptingAuthor(s): J2K

//==================================
//Colour and alpha tutorial by J2K!
//==================================


NOTE: The following commands only work in 1.6, this tutorial is to teach you what RGBA is, NOT a script for crosshair colors. I just feel everyone from both versions of the game should learn how to use RGBA properly.

Ok, so basically a lot of people at this site are breaking my head by typing commands like cl_crosshairalpha 9999999999999.

This is messy, incorrect & unnecessary.

So it is time for a tutorial!

//Counter-Strike Source colour commands

For this example i will use the crosshair color command.

cl_crosshaircolor 255 255 255

The three numbers represent the three primary colours, red, green & blue in respective order. The different strengths of each primary colour are added together to form a final mixed colour. This is known as RGB code.

The minimum for each value is 0.
The maximum for each value is 255.

If all three values are 0, you make black.
If all three values are 255, you make white.

Remember pre-school? Blue + yellow = green. This is still true in RGB code.

Now when choosing your crosshair colour, try to keep this in mind, and don't use numbers higher than 255 because it is unnecessary.

//Counter-Strike Source alpha commands

For this example i will use the crosshair alpha command. Be sure to turn on cl_crosshairusealpha 1 before trying to adjust the crosshair alpha.

Basically, alpha refers to the opacity (solid) or transparency (see through) of an object. For uniformity's sake, they have made this work similar to RGB code.

The minimum for the alpha value is 0 (fully transparent).
The maximum for the alpha value is 255 (fully opaque).

Hopefully this guide will put an end to this mindless 999999999999999999 settings i see in far too many config files / tutorials!

Jay.
Added: 1 year agoTags: colour, color, alpha, max, maximum, transparency
Feedback (4)
rickstar121 .
Bananite Fun Sun ProtectionY2M
Posted 6 months ago
Nice man nice
GrimReaper .
Fear the ReaperY2M
Posted 10 months ago
I know it's a tut, but it says "Counter-Strike Source colour commands", then there is a command which isn't a CSS command.
You also say "when choosing your crosshair colour", by this you probably wanted people to use this command for changing the crosshair color, not just learn RGB.

Still, it's good for players to know the 255 is the highest value, I too have seen people use values like 300 and 999.
.
Scripting & Tutorial MasterY2M
Posted 10 months ago
The tutorial isn't about crosshair color. It's about teaching people what RGBA is. It belongs in CS:S and CS sections so everyone can learn how to use RGBA properly. The code is just EXAMPLE code. It's a tutorial, not a script. So i won't move or change it.
GrimReaper .
Fear the ReaperY2M
Posted 10 months ago
You cannot mix colors like that in Source, altough it would be nice.

cl_crosshaircolor 0 => Green
cl_crosshaircolor 1 => Red
cl_crosshaircolor 2 => Blue
cl_crosshaircolor 3 => Yellow
cl_crosshaircolor 4 => Light blue

Any value different than that just gives you the default, which is green color.

Alpha commands are the same in Source, to get the most visible cross, you would have to use these 2 commands:
cl_crosshairusealpha 1
cl_crosshairalpha 255

So, what to do with assessment, you can move this tutorial in CS1.6 section, or you can correct it so it would fit in CSS section.
As for now, wrong section.
Add Feedback
Provide constructive feedback. What is "constructive"?
You cannot post yet!
Get involved on FPSB by posting your thoughts. Give authors your feedback to help them develop.

To post in this submission register or login.
Assessment
The community's verdict.
User Rating [+]
10/10
bScore
10.0/10
You cannot assess yet!
Moderating FPSB is in your hands - when you assess a submission your vote determines its success or failure.

To vote on this submission register or login.
Stamps
This Tutorial in a nutshell...
No stamps recorded
You cannot stamp yet!
Stamps let you apply characteristics to submissions to help others understand them.

To stamp this submission register or login.

Brought to you by...
Sabotage Studios
Originality, Creativity, Simplicity
Membership: On Request
Primary Skills: ?
Inception: 2 years ago
Vote for Studio
Like this tut? Vote Sabotage Studios for one or more monthly awards.
You must login or register to access this!
Related Tutorials