How can i allow sounds in the time freezer powerup?

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!)
Toiletpaper1337
Posts: 1
Joined: Sun Jan 28, 2018 11:59 am

How can i allow sounds in the time freezer powerup?

Post by Toiletpaper1337 »

I have made a timefreezer-powerupgiver and a cool sound for it but then i have realized that the timefreezer disables all sounds. I read that there's a allowsounds flag but when I tried to use it I got an error that "TIMEFREEZER.ALLOWSOUNDS" is an unknown flag.
Is there a way to allow sounds or in the best case only specific sounds or channels?

PS: sorry if my english is bad, im from germany.
PPS: I will give credits.
User avatar
Xane123
Posts: 165
Joined: Tue Nov 24, 2015 1:58 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Inwood, WV

Re: How can i allow sounds in the time freezer powerup?

Post by Xane123 »

My idea might not be that good but oh well.

Make a CustomInventory actor and set it up to look like the powerup. In its Pickup state, make it give the player the real powerup and play the sound using "CHAN_NOPAUSE", which will play even when time if frozen. For example:

Code: Select all

Pickup:
TNT1 A A_GiveInventory("POWERUP_ITEM", 1)
TNT1 A A_PlaySound("SOUND_NANE", CHAN_ITEM|CHAN_NOPAUSE)
Stop

Return to “Scripting”