the problem
my solution
the scripts
the .zip file
prefabs
'office'
[email protected]
|
Need a SP/MP map to turn scarrier? Well, besides turning all the lights
off, you should realy 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
streches 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:
 |
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 untill 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 sconds
long, so you'll get 1 second of silence.
Anyway, back to those lights.
|
Each element has the folowing objects:
 |
- a group object; it sends the message it recieves 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 responsability 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:
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:
The Group object siply repeats the message it recieves to all the objects
listed:
 |
 |
In our case, Group0 will controll
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:
 |
There are two loops here: the blue one that
controlls 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 controll triggers
start/stop all loops by locking/unlocking and
triggering one trigger from each loop.
Settings and targets for each trigger as follows:
|
ELTrigger:
The last target from ELTrigger's list is the 'Next' trigger:
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; remeber? 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:
And the SoundFX itself:
 |
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 get's
heared 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 anothe couple of pictures:
EvacLightsStart: |
EvacLightsStop: |
 |
 |
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.
|