[DECORATE] Fading A_Overlay* from screen?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Endie
Posts: 227
Joined: Thu Mar 16, 2017 7:34 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Somewhere in the void

[DECORATE] Fading A_Overlay* from screen?

Post by Endie »

As the title says, i'm currently using A_Overlay on my player, and would know if there's any way to slowly fade a light off the screen, smoothly too.
i mean, i could use several sprites with less opacity, but it would be cheap and also will consume more file size than the needed, so there's any way to do it?
User avatar
TensorMatrix
Posts: 41
Joined: Wed Mar 29, 2017 7:05 am

Re: [DECORATE] Fading A_Overlay* from screen?

Post by TensorMatrix »

Maybe you could use TEXTURES lump to create multiple sprites using the same image but with different transparency.

I used this to create pulsating glow effect for HUD:

Code: Select all

Graphic hpbarBR1, 135, 25
{
patch hpbarBR, 0, 0 { Alpha 0.9 Style Translucent }
}

Graphic hpbarBR2, 135, 25
{
patch hpbarBR, 0, 0 { Alpha 0.87 Style Translucent }
}

Graphic hpbarBR3, 135, 25
{
patch hpbarBR, 0, 0 { Alpha 0.84 Style Translucent }
}

Graphic hpbarBR4, 135, 25
{
patch hpbarBR, 0, 0 { Alpha 0.81 Style Translucent }
}

Graphic hpbarBR5, 135, 25
{
patch hpbarBR, 0, 0 { Alpha 0.78 Style Translucent }
}
after that i added ANIMDEFS to make it animated, but you probably don't need to use it since you can do it in the decorate.

Code: Select all

texture hpbarBR 
	OSCILLATE
	pic hpbarBR1 tics 2
	pic hpbarBR2 tics 2
	pic hpbarBR3 tics 2
	pic hpbarBR4 tics 2
	pic hpbarBR5 tics 2
Edit: Maybe A_SetRenderStyle could work too?
User avatar
phantombeta
Posts: 2163
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: [DECORATE] Fading A_Overlay* from screen?

Post by phantombeta »

Use [wiki=A_OverlayAlpha]A_OverlayAlpha[/wiki]. It allows you to set the alpha of the overlay, as the name implies.
User avatar
Endie
Posts: 227
Joined: Thu Mar 16, 2017 7:34 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Somewhere in the void

Re: [DECORATE] Fading A_Overlay* from screen?

Post by Endie »

Oh, thanks guys, this will help a lot
Post Reply

Return to “Scripting”