Changing Berserk red tint duration

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
Boondorl
Posts: 137
Joined: Wed Jul 11, 2018 10:57 pm

Changing Berserk red tint duration

Post by Boondorl »

Bit of an odd one, but how exactly do you change this? PowerStrength already has a duration of 1 tic but just seems to ignore it anyway. Is there a way to get around this?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Changing Berserk red tint duration

Post by Graf Zahl »

Surely you can do something here. But as you noticed it is coded into the object itself so you'll have to take the ZScript implementation for PowerStrength and create a copy, and then a new item replacing the original Berserk to give that new power.
User avatar
Boondorl
Posts: 137
Joined: Wed Jul 11, 2018 10:57 pm

Re: Changing Berserk red tint duration

Post by Boondorl »

For some reason I thought it used the standard blinking effect other power ups use when running out. :lol: I guess that gets me to the real question:

Is there a way to speed up the fading out effect? I'd like to cut it down to about 3 seconds or so.
User avatar
ramon.dexter
Posts: 1520
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Changing Berserk red tint duration

Post by ramon.dexter »

Yes, graf pretty clearly tells you what has to done ;)
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: Changing Berserk red tint duration

Post by Arctangent »

Specifically, it's done through manipulation of PowerStrength's EffectTics variable, which is then fed into its GetBlend function to produce a screen blend that fades over time instead of being tied to its duration ( as it has none ). There's multiple angles you could take with this - the simplest would be to make EffectTics go up by more than 2, but you could also alter the blend itself to start less intense, or to fade exponentially instead of linearly.
Post Reply

Return to “Scripting”