PDA

View Full Version : [Tutorial] Using the Command "Color"



Loller Dan
25 Jun 2008, 10:03am
This is a tutorial on how to use the Output Command "Color"
--------------------------------------------------------------------------------------------------------
1 button (which is what we are using), or any entity that can send out Outputs
the object to be colored (for this tutorial, 3 lights)
--------------------------------------------------------------------------------------------------------
Many people want to color things that look like crap. I totally agree with their thinking. But sometimes these people don't know how. Read this or die.

1) Make the object to be colored (for this tutorial it will be 3 objects, 1 green light, 1 yellow light, and one red light).

2) Tie the object to the "func_brush" entity (if your object is not going to do anything map oriented, if it is a breakable object or something then tie it to "func_breakable" instead).

http://i189.photobucket.com/albums/z274/Danoverkill/colortut1a.jpg

3) Make a button (which is what I am using, you can use whatever you want).

4) Give that button a name to refer to it in the map (ours is "light_switch")

5) Go into the Outputs section and ADD the following:
-My Output Named ----- Onpressed
-Target Entities Names ----- green_light
-Via this Input ----- Color
-With a Parameter Override of ----- 0 255 0

This will make it so that when the button is pressed it will color the brush "0 255 0" which is green.

Let's make this juicier.

6) Copy step 5 and change the the entity that is targeted to "yellow_light" and the parameter override to "255 255 0" which is yellow.

Do this one more time for the red brush, but change the entity that is targeted to "red_light" and the parameter override to "255 0 0" which is red.

It should now look something like this

http://i189.photobucket.com/albums/z274/Danoverkill/blah.jpg

Unfortunately, when you want the next color to start and the first one to stop on different brushes, you have to manually do that too.

7) Go into the Outputs section and ADD the following:
-My Output Named ----- Onpressed
-Target Entities Names ----- green_light
-Via this Input ----- Color
-With a Parameter Override of ----- 255 255 255
-After a Delay in Seconds of ----- 10.00

This will make the green_light turn off after 10 seconds, "255 255 255" means the objects default texture color, aka normal.

You will want to do this to the "yellow_light" and the "red_light", but change the Delay of the "yellow_light" to 12.00 and the Delay of the "red_light" to 20.00

This makes it so that when the yellow light is colored, the "green_light" is turned back to its normal color, and when the red light is colored, the "yellow_light" is turned back to its normal color. After a certain amount of time, 20.00, the red_light will turn back to its normal color.

http://i189.photobucket.com/albums/z274/Danoverkill/greenlight.jpg
http://i189.photobucket.com/albums/z274/Danoverkill/yellowlight.jpg
http://i189.photobucket.com/albums/z274/Danoverkill/redlight.jpg

Now that we have that done, we need to make it so the button, or whatever entity you are using, cannot be reused until the sequence has finshed.

8) Go into the Outputs section and ADD the following:
-My Output Named ----- Onpressed
-Target Entities Names ----- light_switch
-Via this Input ----- Lock

Now that it is locked we will need it to unlock.

9) Go into the Outputs section and ADD the following:
-My Output Named ----- Onpressed
-Target Entities Names ----- light_switch
-Via this Input ----- Unlock
-After a Delay in Seconds of ----- 20.00

Why 20.00, because that is when the "red_light" turns its color back to normal, it is also the last entity to be affected. (I also put the reuse delay to 20 seconds in the Properties window just in case)

http://i189.photobucket.com/albums/z274/Danoverkill/blah2.jpg

-----------------------------------------------------------------------------------------------------

You can also add triggers to color entities, it's all up to you.

-----------------------------------------------------------------------------------------------------
Coloring Players

You can color players (as seen in deathrun_tp_dissolution).
-----------------------------------------------------------------------------------------------------
OPTIONAL
1 trigger of any kind
1 button
-----------------------------------------------------------------------------------------------------

For some reason, Valve had to be an asshole and make you find out how to color players yourself since the Output you have to name is ridiculously impossible to find if you don't know what to do.
------------------
TRIGGERS
------------------

1) Make your trigger (you don't have to name it)

2) Go to Outputs and write EXACTLY as I write.
-My Output Named ----- OnStartTouch
-Target Entities Names ----- !activator
-Via this Input ----- Color
-With a Parameter Override of ----- 0 0 255

This makes it so when you touch the trigger it colors you, the "!activator", whatever color you have set in the Parameter Override.

Note, "!activator" will show up in RED when you are typing it in.
------------------
BUTTONS
------------------

1) Make your button (you don't have to name it)

2) Go to Outputs and write EXACTLY as I write.
-My Output Named ----- OnPressed
-Target Entities Names ----- !activator
-Via this Input ----- Color
-With a Parameter Override of ----- 0 0 255

This makes it so when you touch the trigger it colors you, the "!activator", whatever color you have set in the Parameter Override.

Note, "!activator" will show up in RED when you are typing it in.

http://i189.photobucket.com/albums/z274/Danoverkill/active.jpg

I hope this tutorial has helped, Loller Dan.