The entity atdm:alarm_sound uses the script object tdm_alarm. It can be used to send audio alarms to AI as well play a sound that is audible to the player at the same time.
- an atdm:alarm_sound entity (in DR under Sounds), it can emit a audible sound (for the player) and a propagated sound for AI. It can do so infinitely (active_duration == 0), or for X seconds (active_duration == x). It can also toggle bound children or targets, meaning you can link this entity directly to f.i. a light. (or a speaker if you'd wanted, or multiple lights, or a door that closes slowly. Whatever you want :) You can also have multiple alarm sounds.
- behind the scenes there is a script object that implements this
- there are two target entities, atdm:start_alarm and atdm:stop_alarm (in DR under Targets), these basically just call the proper function on the atdm:alarm_sound entity they are linked to. You can trigger them from any trigger you want, even multiple times, or from switches, buttons, whatever you want.
I also made a test map, test/trigger_alarm.map. If you walk through the trigger, you will start the alarm. Two levers, one for shutting it down (left) and one for restarting it (right).
How to use
Place one in your map, you find it under "Sound" in the DR entity list.
Also place an atdm:start_alarm and atdm:stop_alarm (both are under "Targets") and link these to the atdm:alarm_sound entity. Then use triggers or levers targetted at the stop/start entities to turn the alert on or off.
You can also link further entities from the atdm:alarm_sound entity. For instance lights (slowly closing) doors. These will all be turned on when the alarm is turned on, and off when the alarm is disabled.