PDA

View Full Version : Lightning


NutWrench
11-01-2002, 08:46 PM
Is there any way to synchronize two or more DistanceLightning actors? I have a level with a DistanceLightning actor in a SkyBox and another DistanceLightning within the level itself. Basically, when the lightning flashes in the SkyBox, I want the lightning within the level to match.

Daedalus
11-02-2002, 12:50 AM
The effect you describe can be found in one of the original Undying maps. It's the very first map which follows after the cutscene when you start a new game, the one where you stand in front of the manor and which included that dead hung guy you could see when applying the Scrye spell.

In this dark map the skybox above was randomly flashing in a white color to simulate a lightning and illuminating the manor and the place around at the same time. They also used a nice thundering sound whenever the skybox and geometry were flashing.

I'm not sure how they did it, perhaps with event tags or s.th, but you could load that Undying map into UndEd (the UnrealEd2 for Undying maps) and check how that lightning effect was made.

I have Undying and UndEd on my HD. If you don't have Undying, I could look it up for you...

[ 11-02-2002, 01:01 AM: Message edited by: Daedalus ]

widowmaker
11-02-2002, 01:11 PM
I recall a lighting tutorial that dealt with something similar to this but to get the effect to work a small degree of scripting had to be done. The ffect was to create the lightning strike, the flash, followed by the thunder.

My self I would tru using a repeating mover to activate the lights together and activate a sound. I know I am strange I use movers as timing devices. LOL

Daedalus
11-02-2002, 02:28 PM
Well guys, I looked it up... I made a small testmap of mine with a room and a skybox... I spend the last 8 hours experimenting and testing stuff in UnrealEd2... it was a pain in the ass, but you won't believe... I ACTUALLY MANAGED TO CREATE THIS EFFECT!!!!!!! WITHOUT ANY SCRIPTING AND ANY MOVERS!! ALL DONE FOR UT! images/icons/cool.gif

Here are some facts I like to share with you:

1. Forget about the DistanceLightning actor class. It's useless for our purpose, because this class can't be triggered and can't trigger anything. Events and tags don't work either. If you put one in your skybox, one in your world, rebuild and save your map then both DistanceLightning actors will flash independent from each other. And that's not what we want, right. We want a totally synchronized effect with both actors flashing at the same time. But this effect can't be done with this actor, so delete any of them you might have in your map. Trust me. images/icons/smile.gif I tried EVERYTHING with that actor and it's only useful if you want to create a boring lightning somewhere in your map without sound. You probably understand now why this actor is called DistanceLightning.

2. The lightning effect in Undying is scripted and makes use of 2 Undying-only actor classes: LightningNavigationPoint and LightningShaft. The first one is used as a particle emitter and produces lightning lines like the ones seen in that GIF animation (very cool):
http://www.lightning-webhosting.com/images/lightning.gif
The second one is used to produce lightning decals which are drawn over the sky, so that you can actually see the lightning when it's flashing and not just its flashing light only.
Well, these are all cool additions to the Unreal engine made by the guys who developed Undying, but useless for our purpose, because

a) UT doesn't have those scripted Undying actors implemented, DUH! graemlins/dopefish.gif
b) lightning sound and other events aren't triggered, but played from those scripts
c) these special actors are used for particle effects and lightning decals and so they have completely nothing to do with our synchronized lightning effect.

3) The best way for creating syncronized lightning in skyboxes and the world is to use TriggerLighting actors, which are implemented in ANY Unreal-engine based game and editor, and to trigger them with a Trigger actor. I tried this and it works perfectly. I also used TiggerDispatcher actors for 1337 random lightnings. Ofcourse I use them in conjuction with SoundEvent actors (loud thunder and lightning sounds!), too. images/icons/cool.gif
However, Triggers, TriggerLight and TriggerDispatcher actors are a tricky thing and you'd have to consider a lot of settings and variables unless you want to have no effect at all. But when you manage it (as I did) then you can even produde better lighnting effects than in Undying. Best of all: if you make it this way you won't need to create scripts, movers or other obtrusive things.

Well, these were the facts. If you're interested in how I made a very 1337 synchronized and random(!) lightning with sounds then look for my UT domination map which I'm making for widowmaker's Halloween mapping contest and which I'm hopefully going to finish and release tommorrow.

This map is going to include my synchronized lightning, so you're able to load my map into UnrealEd and check out how I did it...

widowmaker
11-02-2002, 02:56 PM
Nice. Way to go.

NutWrench
11-03-2002, 11:24 AM
Cool! images/icons/smile.gif

Yeah, forget about DistanceLightning. I looked at the script for it, and there's a random number generator right at the beginning. So that's useless for synchronizing.

I ended up using a Stochastic trigger to trigger a Dispatcher which in turn, switched a pair of regular lights on and off (I set the lighting type to flicker)

Daedalus
11-03-2002, 04:09 PM
Same here. But I use a normal Trigger and 2 Dispatchers, one for triggering flickering TriggerLight on/off and one for triggering various thunder and lightning sound effects which are synchronized with the light.

I'm thinking about implementing a 3rd Dispatcher for some special effects...