Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: killface on November 01, 2008, 06:40:20 pm

Title: Flickering glow maps?
Post by: killface on November 01, 2008, 06:40:20 pm

Anyone know of a way to get a glowmap to "flicker" rapidly?  I've got a damaged vessel I want floating out there
Title: Re: Flickering glow maps?
Post by: Angelus on November 01, 2008, 07:15:43 pm
There are two ways i can think of, the first one would be to create an ani ( eff ) file, and each two files are dark, means no glowmaps ( 2 frames glowmap, then 2 frames a dark bitmap then 2 frames glowmap aso ).

The second way use the deactivate glowmaps / activate glowmaps SEXPs, with a delay of 1 second.

If the vessel is damaged when the player arrives you could make

has-arrived-delay  ( other triggers are probably better )
--------0
--------Alpha1
-----deactivate-glowmaps
------------<the name of your ship>


then make a similar event which activates the glowmaps, chain 'em with a high repeat count.





Title: Re: Flickering glow maps?
Post by: Droid803 on November 01, 2008, 07:32:47 pm
Just use "true" as the trigger...
Though the animated glowmap will probably go faster.
Title: Re: Flickering glow maps?
Post by: Retsof on November 01, 2008, 07:43:22 pm
I'd go for the ani, that way you could make it random-er, not just on-off-on-off-on-off-on-off.
Title: Re: Flickering glow maps?
Post by: killface on November 01, 2008, 08:03:57 pm

The ani would probably work best.  One second ons and offs I can do, but that isn't quite a "flicker", if you know what I mean.
Title: Re: Flickering glow maps?
Post by: Angelus on November 01, 2008, 08:10:30 pm
If you try the ani, then you can specify in the eff file how long the frame is shown, IIRC.
With a short value this will give ya the flickering look.
Title: Re: Flickering glow maps?
Post by: karajorma on November 02, 2008, 12:41:41 pm
I'd go for the ani, that way you could make it random-er, not just on-off-on-off-on-off-on-off.

You can do that with SEXPs too though. You simply have to turn the glowmap on and off at random times.
Title: Re: Flickering glow maps?
Post by: killface on November 02, 2008, 06:24:47 pm

But aren't you limited by one-second increments in SEXPs?  I want this to flicker several times a second, as a standard electric/damage flicker would.
Title: Re: Flickering glow maps?
Post by: FUBAR-BDHR on November 02, 2008, 06:52:07 pm
Well you have a couple of options.  You can use ever time which processes constantly.  Heck haveing 2 evertime loops running with on and off my give a flicker effect.  Of course it just may crash things. 

I managed to do a loop like 6 times a second some other way one time.  I'll have to look that one up and see how I did it if I still have it.  Wasn't my mission. 
Title: Re: Flickering glow maps?
Post by: Galemp on November 03, 2008, 10:31:16 am
Funny, I thought we had a flicker-glowmaps SEXP.
Title: Re: Flickering glow maps?
Post by: karajorma on November 03, 2008, 12:52:13 pm
But aren't you limited by one-second increments in SEXPs?  I want this to flicker several times a second, as a standard electric/damage flicker would.

Nope. Events are evaluate once per frame. If you set the repeat delay to zero the event will be evaluated the next frame. Clever use of variables to decide when to change the state of the glowmaps could quite easily give you a flickering effect without the need for a glowmap ani.

The advantage of using SEXPs is that at some point in the mission you have have the flickering stop and the glowmaps stay on or off. With an ani you can only turn them off (by deactivating glowmaps). 
Title: Re: Flickering glow maps?
Post by: Colonol Dekker on November 06, 2008, 07:06:42 am
Remember how *cough* managed to use a transports velocity and the when-distance < sexPEE to evaluate something in under a second in the burn baby burn mission of JADSE?
Title: Re: Flickering glow maps?
Post by: karajorma on November 06, 2008, 09:14:30 am
Yes but that's unnecessary here. Axem's problem was that he needed exactly half a second in order to have a piece of music play at the right time. Here timings don't need to be so precise
Title: Re: Flickering glow maps?
Post by: Colonol Dekker on November 06, 2008, 11:01:54 am
Still handy to know....