Evac Lights

Need a SP/MP map to turn scarier? Well, besides turning all the lights off, you should really consider placing some evac lights. You know, those runaway lights that show you the closest evacuation point; you’ve seen them in Alien: Resurrection, when Call ‘asks’ the aliens to go for that corp dude.

Anyway, this prefab will give you just that: an evac lights system that stretches for 2560 units. 10 light elements (actually scale sprites) that turn on and off in a manner that will give the impression of runaway lights:

evac_lights0

So what we’ll do is turn on sprite group 0, keep it on for 0.1 seconds, that turn it off; at the same time turn on the group 1. After 0.1 seconds, turn it off and move on to group 2, then group 3 and so on until we reach group 9. Then back to group 0 and keep the loop running.

Each of those 10 elements is spaced 256 units from the next one. The placement will give you the illusion of runaway lights.

To make things a little bit more dramatic, I’ve added a SoundFX that gets triggered each 4 seconds. The alarm sound itself is 3 seconds long, so you’ll get 1 second of silence.

Anyway, back to those lights. Each element has the following objects:

evac_lights1

  • a group object; it sends the message it receives to all 4 sprites
  • the ‘On’ trigger. This one sends it’s messages delayed according to it’s placement. The On0 will have a 0 sec. delay, On1 will have 0.1 sec. delay, On2 – 0.2 sec. and so on. It also triggers the ‘Off’ trigger
  • the ‘Off’ trigger will turn of the sprites 0.1 sec. after being triggered. Period.
  • the sprites

What we’ll do is send each second the trigger messages to ALL the On  triggers. Depending on their ‘SendDelay’, each trigger will then turn on their sprites. Sending the message each second will be the responsibility of a trigger loop, like the one used in the AI Escort prefab.

Regarding the On trigger, best thing to do is to show you the settings for the On3 trigger:

evac_lights3

The ‘Off’ trigger simply sends the OFF message to the group object exactly 0.1 seconds after it was triggered. It’s ‘SendDelay’ dictates how long the sprite stays on:

evac_lights4

The Group object simply repeats the message it receives to all the objects listed:

evac_lights5 evac_lights1

In our case, Group0 will control ScaleSprite0 to ScaleSprite3.

So, all we need now is a loop that triggers all On triggers each second. That’s exactly what the red underlined triggers do:

evac_lights2

There are two loops here: the blue one that controls the SoundFX object and the one in red, that maintains the sprites turned on and off.

However, because I needed to close the loop and the fact that the trigger object has only 10 targets, I had to add another trigger called next to handle the last two On triggers.

Without being underlined, the control triggers start/stop all loops by locking/unlocking and triggering one trigger from each loop. Settings and targets for each trigger as follows:

ELTrigger:

evac_lights6

The last target from ELTrigger’s list is the ‘Next’ trigger:

evac_lights7

As you can see, it has no delay; it’s merely an extension for ELTrigger.

This is the ‘CloseLoop’ trigger for the one second loop:

evac_lights8

Remember, the period is always the sum of the delays:

 0.5 sec (the ELTrigger) +
 0.5 sec (the CloseLoop)
 ------------------------
 1 second period

So, although the send delays for these two triggers were 0.5 seconds, because only the ELTrigger sends the trigger message to the On triggers, you’ll get the sequence wanted.

The 4 seconds alarm sound loop:

evac_lights9 evac_lights10

And the SoundFX itself:

evac_lights11

Select the appropriate sound. I went for the ‘alarm.wav’ sound. It lasts 3 seconds. That and the 4 seconds loop will give you one second pause.

Now when you have more SoundFX objects and you want to make sure the FX gets heard give it higher priorities. They range from 0 to 2.

Now we don’t want this one to loop! We have our triggers handling this one, remember?

The ‘EvacLightsStart’ and ‘EvacLightsStop’ triggers? Well, I’ve said earlier what they do, but I’ll throw in another couple of pictures:

EvacLightsStart:

evac_lights12

EvacLightsStop:

evac_lights13

To make things sweeter, I’ll throw in a .zip file. This one is 100% copy-paste compliant, so you can use several of this babies in the same map.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s