|
||||||||||||||||||||||||||||||||||||||||||||||
This tutorial presumes you already know the basics of the editor and the entities.
These cameras will spawn enemies if you stay in the field of view of the camera for a certain amount of time. This tutorial shows how to build them using touchfields and triggers. It also goes on to briefly explain how to add advancements like disabling them, adding sounds and making panning cameras. Also included is a map containing all you need including a model I made for the camera. You can download it from here http://www.btinternet.com/~imurray/seccam.zip . Extract into your Serious Sam directory. The files will be placed in the correct directories.
What you need for the basic camera:
Before we set up anything place the following in a map.
A touchfield
Before adding the brush to your touchfield manipulate it, inserting vertices (right click on brush) where required. This will be the field of view for the camera. Name this 'Touchfield field of view'. By manipulating the brush you can create the effect of camera seeing through doorways etc.
4 triggers
Trigger 1 name this 'Trigger in view' Trigger 2 name this 'Trigger wait' Trigger 3 name this 'Trigger out of view '. Trigger 4 name it 'Trigger alarm'.
An Enemy Spawner
This will simply spawn enemies when triggered by trigger 4. Name this 'Enemy spawn alarm'. Set up this with whichever and how many enemys you wish.
The aim of this is that if you leave the touchfield within 3 seconds, Trigger 4 (the alarm) is de-activated before it is triggered by Trigger 2 (the wait)
This is achieved by setting up the the entities as below:
And thats it, job done. All that's left to do is add the camera itself. I've made a simple model for that and you can download it with the tutorial map. Drag a model holder into position and in it's properties set the model to seccam2.mdl (you'll find it in the models/sambdam directory). You can then play with the other settings to adjust its size etc.
Just incase you don't know how to use the enemy spawner: Create another room not touching the current one and put an enemy in it. In the settings for the enemy check the 'Template' option. Then in the Enemy spawner entity set the 'Template Target' to the enemy you just placed. One problem with the camera is that if you return in view of it while the 'Trigger Wait' is still counting 2 seconds and stay there when it finishes the alarm will go off, eventhough you may not have remained in view for 2 whole seconds.
Now to add some interaction..
Adding sounds
This is a good idea because it can alert the player when they come into view of a camera and alert them when they have set it off.
To achieve this you need to add 2 sound holders named 'Sound alarm warning' and 'Sound alarm' and another trigger, named 'Trigger reset alarm'. You will also need to add some new settings to the previous triggers.
Again i've made a couple of sounds you can use and you can download them with the tutorial map. Then in the soundholder properties set the sound to warning.wav or alarm.wav (you'll find it in the sounds/sambdammed directory)
Deactivating the alarm
This can be done in several ways (damage, hitting a switch are two useful ones)
When deactivating you should set it up so that the touchfield, the 'Trigger alarm' trigger and any sounds are deactivated. This is because that the de-activating event can occur while the player is still inside the touchfield.
Panning cameras
I have tried this but it doesn't work with touchfields. For some reason the collision event for a touchfield only works in one way. You have to touch it, if it touches you, nothing happens. Instead I used 2 overlapping WatchPlayer? entities. You set up the 'owned target' property of one to 'Trigger in view' and you set up the other to 'Trigger out of view', for this second entity you also need to set 'close event type' to 'don't send event' and 'far event type' to 'trigger event'. You can then parent the WatchPlayer? entities to a moving brush to get the effect of a panning camera. |
||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||