I've been messing with materials lately, so I thought I'd try to figure this one out...which I believe I did.
The VMT, which I named "duppy/material_modify_test.vmt" looks like this:
Code:
"LightmappedGeneric"
{
"$basetexture" "brick/brickwall001b"
"$alpha" "1.0"
"Proxies"
{
"MaterialModify"
{
"dummy" "0"
}
}
}
To test it out, I made a basic room, and added a material_modify_control entity...
PROPERTIES:
Name:
myMaterialModifyControl
Parent:
myFuncBrush
Material to Modify:
duppy/material_modify_test
Material variable to modify:
$alpha
Then I made a func_brush, and applied the texture "duppy/material_modify_test" to it. The func_brush entities properties are all defaults, except the name:
PROPERTIES:
Name:
myFuncBrush
Then, in order to add an interactive component, I added some buttons. One button sets the alpha values to a specific value...I randomly chose 0.75. The other button does what you asked...it slowly fades the alpha value from 0.0 to 1.0 over a 10 second period.
Both buttons have default properties, but for the hell of it, I named them myButton1 and myButton2. For the first button I gave it an output of...
OUTPUT (first button):
My output name:
OnDamage
Target entities named:
myMaterialModifyControl
Via this input:
SetMaterialVar
With parameter override:
0.75
After delay in seconds of:
0.0
OUTPUT (second button):
My output name:
OnDamage
Target entities named:
myMaterialModifyControl
Via this input:
StartFloatLerp
With parameter override:
0.0 1.0 10 0
After delay in seconds of:
0.0
Note: the parameter format for StartFloatLerp is <Start Value> <End Value> <Transition Time> <Loop> ...so in this case, we're starting at 0.0, ending at 1.0 with a transition time of 10 seconds, and loop is set to 0 so it doesn't repeat. You can find that info here on the VDC
material_modify_control page.
I believe that's it. You can download the vmf, vmt, and compiled bsp
here to try it out yourself. When the map is loaded, just shoot either the green or blue button (note: green button takes 10 seconds, so be patient for it to fade in).
EDIT: oops, I just noticed you want it to go from 1.0 to 0.0 ....just flip the start and end values for StartFloatLerp. Should be 1.0 0.0 10 0. Also, If you play with the numbers some more, make sure to adjust the VMT $alpha value as well.