Powerup.TimeoutSound

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

XLightningStormL
Posts: 382
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here

Powerup.TimeoutSound

Post by XLightningStormL »

Like Quake's handling of Powerups in that when the timer is running out, a sound effect (and generally visual a-la Doom) is played to indicate to the player the powerup is timing out.

Doom and it's derivative source ports have a similar effect, albeit only the capability to flash the Powerup.Color or Shadow effect in and out during the last couple of seconds the powerup is active. Theoretically a TimeoutSound should be easy enough to hook it in, and would save a lot of people time (rather than having to worry about integer timer spam in Tick() wasting processing time or ACS trickery) Like other Sound properties it should default to empty and be an optional property.
Blue Shadow
Posts: 4935
Joined: Sun Nov 14, 2010 12:59 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Powerup.TimeoutSound

Post by Blue Shadow »

Code: Select all

class Boo : PowerDamage
{
    override void DoEffect ()
    {
        Super.DoEffect();

        if (Owner && EffectTics > 0 && EffectTics <= BLINKTHRESHOLD)
        {
            Owner.A_StartSound("misc/p_pkup", CHAN_5, CHANF_NOSTOP, 1.0, ATTN_NONE);
        }
    }
}
The above code has 0% "integer timer spam in Tick()" and "ACS trickery".

Return to “Feature Suggestions [GZDoom]”