2 A secret has been found!
4 void trigger_secret_touch() {
5 // only a player can trigger this
6 if (other.classname != "player")
9 // update secrets found counter
11 //print("Secret found: ", ftos(secret_counter.cnt), "/");
12 //print(ftos(secret_counter.count), "\n");
14 // handle normal trigger features
19 /*QUAKED trigger_secret (.5 .5 .5) ?
20 Variable sized secret trigger. Can be targeted at one or more entities.
21 Basically, it's a trigger_once (with restrictions, see notes) that additionally updates the number of secrets found.
22 -------- KEYS --------
23 sounds: 1 to play misc/secret.wav, 2 to play misc/talk.wav, 3 to play misc/trigger1.wav (default: 1)
24 noise: path to sound file, if you want to play something else
25 target: trigger all entities with this targetname when triggered
26 message: print this message to the player who activated the trigger instead of the standard 'You found a secret!'
27 killtarget: remove all entities with this targetname when triggered
28 -------- NOTES --------
29 You should create a common/trigger textured brush covering the entrance to a secret room/area.
30 Trigger secret can only be trigger by a player's touch and can not be a target itself.
32 void spawnfunc_trigger_secret() {
33 // FIXME: should it be disabled in most modes?
35 // update secrets count
38 // add default message
39 if (self.message == "")
40 self.message = "You found a secret!";
45 self.sounds = 1; // misc/secret.wav
47 // this entity can't be a target itself!!!!
50 // you can't just shoot a room to find it, can you?
53 // a secret can not be delayed
56 // convert this trigger to trigger_once
57 self.classname = "trigger_once";
58 spawnfunc_trigger_once();
60 // take over the touch() function, so we can mark secret as found
61 self.touch = trigger_secret_touch;