Thanks to help from Lee with scripts.
Firstly here is the level which needs to go into your mapbank directory.
http://www.tyranntrpg.org/alert/alert.fpm
Next here is a wav file that needs to go into audiobank\user directory (Unless you adjust the following script)
http://www.tyranntrpg.org/alert/siren1.zip
Next you need to create the following script and put it into the scriptbank\user (The level will look for it there, called lightoff_alert.fpi)
;Artificial Intelligence Script
;Header
desc = Light Toggle (Off By Default)
;Triggers
:state=0:state=2
:state=1,activated=1:lighton,lightred=255,lightgreen=0,lightblue=0,activate=ai1,sound=audiobank\user\siren1.wav
:state=2,activated=0:state=1,lighton,lightred=255,lightgreen=255,lightblue=255
;End of Script
The next script is to go in the same place an is called static.fpi.
;Artificial Intelligence Script
;Header
desc = Aggressive Sentry behaviour
;Triggers
:state=0,activated=1:state=1
:state=1:animate=1
:state=1,plrcanbeseen:settarget,rotatetoplr,shootplr
:state=1,random=20:rotateheadrandom=35
:state=1,shotdamage=10:settarget,rotatetotarget,resethead
:state=1,noiseheard=5:settarget,rotatetotarget,resethead
;End of Script
This is the map:
The light in the middle of the room is a dynamic light (So you need the dynamic lighting box checked in the preferences for it to work)
This light uses the script lightoff_alert.fpi shown above. This was basically copied from the lightoff.fpi script in the main script bank. You will see it's initial state is 2 which is making the light white. When it is activated it will change the light to red and play the sample contained in the siren1.zip file above.
The AI Characters at the bottom of the map use the static.fpi script above which is modified from the static script supplied with FPSC. In it's initial state it is not doing anything, it's waiting to be activated. Once activated it will run at the player shooting.
The name of the light entity and all the character entities is "alert". There is a reason for this is to be able to activate then all from the light switch. The light switch uses a standard script but has the following in the IFUSED section:
The upshot of it is, when the switch is used, it activates all entities called alert.
When run, the following small movie is what happens.
http://www.tyranntrpg.org/alert/alert.wmv
Jas
----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"