This is what I tried most recently. I thought that, maybe, consolidating all of the fading and render-style stuff into one script would help make sure things run exactly once when dying, and I wouldn't need to worry about the respawning or resurrecting issues. Sadly, this doesn't seem to work, as APROP_Alpha will only affect Translucency, not Stencils.
Code: Select all
ACTOR FadePlayer : DoomPlayer
{
StencilColor White
States
{
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_NoGravity
TNT1 A 0 A_NoBlocking
TNT1 A 0 ACS_NamedExecute("FadeScript")
PLAY A 40
TNT1 A -1
Stop
}
}
Code: Select all
script "FadeScript"(void)
{
SetActorProperty(0,APROP_RenderStyle,STYLE_Stencil);
Delay(20);
//This chunk would normally be written in a loop, but
//I wrote it out the long way for the quick 'n dirty test
SetActorProperty(0,APROP_Alpha,0.9);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.8);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.7);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.6);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.5);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.4);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.3);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.2);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.1);
Delay(2);
SetActorProperty(0,APROP_Alpha,0.0);
Delay(2);
SetActorProperty(0,APROP_Alpha,1.0);
SetActorProperty(0,APROP_RenderStyle,STYLE_Normal);
}