Andys Stealth Package

Contains a generic alarm system to turn on/off groups of sounds and lights, a Security Camera with trigger or Line of Sight capability and a DropGun which can be attached to the ceiling and can be triggered to automatically point and shoot at a player.

Alarm System
The Alarm System acts a single place to manage all alarm state dependent functionality by using the alarmOnEvent (fired when the alarm is turned on) and alarmOffEvent (fired when the alarm is turned off). It also has enable / disable capability, so players can disable the alarm system.

The alarmDuration property will determine how long to wait from the last time the alarm was triggered before switching off the alarm. 0 will never switch the alarm off.

The Script Folders within the alarm system contain Scripts that can turn on or off groups of sounds and lights.

Security Camera
The Security Camera has a light and repeated beep. You might want to add functionality to turn these off if the player shoots the camera, or interacts with something.

The camera also includes a trigger, which is an estimate of what the camera can see. This is the simplest form of Line of Sight, although it cannot handle any kind of cover or walls - you will need to customise the trigger to handle this.

The line of sight script, attached to the camera, will only fire the LOSEvent if the following conditions are met:

  • The player is within the radius of maxDistance
  • There is an unbroken line of sight from the camera to the player (uses Raycasting)
  • The player is in front of the camera (uses the Dot Product).

The higher the fieldOfView Property value, the narrower the vision cone (less peripheral vision). For example:

  • 0 is widest possible viewing angle, but still in front.
  • 1 is narrowest possible angle - player must be directly in front of the camera.

The DropGun is an automated turret with two guns that can be triggered by using the Track function, and sending it an entity to track. The guns use a Script similar to the Gun Script, but technically track the target, so the AutoGun Script Raycasts to the exact player position - they have to hide behind cover to avoid being shot.

The warmupDuration is the amount of time from triggering the Track function to when the guns start shooting.

1 Like