If you want the red to only last for a few seconds, ColorRGBAOverTime is the code you want.
I'll explain what it does:
ObjectTemplate.colorRGBAOverTime 0/255/0/0/200|55/255/0/0/100|100/0/0/0/0
Every input in this code has 5 variables separated by slashes, and finally ending with a |
The first variable is time, it is a ratio of time 0 to 100 percent. So for instance if at the beginning of the effect I wanted a certain color I would type in 0, and lets say I wanted it to last 3 seconds and my time to live is 10 seconds, well then 3 is 30 percent of 10, so my first number is 30.
ObjectTemplate.colorRGBAOverTime 0/255/0/0|30/
Here I have RED as our base color, and I have added thirty to tell it what percentage of time will be used.
the Next 3 Numbers represent the color im going to be using. If I want red, I max out the red by putting 255/0/0, using photoshop or other programs I can get any color I want. Remember the values only range from 1 to 255. so my second value is that
ObjectTemplate.colorRGBAOverTime 0/255/0/0|30/255/0/0
My last variable is the Alpha, the alpha is just like RGB with a value from 0 to 255, and determines the transparency of the effect. 255 is fully opaque, 0 is fully transparent. so lets make it something in the middle, 128. Remember fully opaque effects will lag alot worse than semi-transparent ones.
ObjectTemplate.colorRGBAOverTime 0/255/0/0|30/255/0/0/128
I now have my first color, lets add a second one. If in a instant I wanted it to change to blue, well I need to make an instant change, so lets change that 30 to 31, and change the color. You start a new color with a |
ObjectTemplate.colorRGBAOverTime 0/255/0/0|30/255/0/0/128|31/0/0/255/128
Now at 31 percent time, the color will instantly change to blue, or rather fast anyway. All in all depending on how you code it the engine will create a ramp for the colors, and the inputs will tell the effect to change color throughout its life time. Experiment, and have fun!
|