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.

Changing Berserk red tint duration

Postby Boondorl » Sat Jan 12, 2019 2:35 pm

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
Boondorl
 
Joined: 11 Jul 2018

Re: Changing Berserk red tint duration

Postby Graf Zahl » Sat Jan 12, 2019 6:22 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Changing Berserk red tint duration

Postby Boondorl » Sat Jan 12, 2019 8:37 pm

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
Boondorl
 
Joined: 11 Jul 2018

Re: Changing Berserk red tint duration

Postby ramon.dexter » Sun Jan 13, 2019 2:42 am

Yes, graf pretty clearly tells you what has to done ;)
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia

Re: Changing Berserk red tint duration

Postby Arctangent » Sun Jan 13, 2019 12:25 pm

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.
User avatar
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest