In the tutorial you will be told shown different types of triggers and how they work. You will be shown "keys" and [values]. Keys are a small piece of text you can enter in the entity window (press n in CoDRadiant).
To create a trigger, simply create a brush with the texture [common/trigger] then right click the 2d window and select "Trigger<[type]" where type is the trigger type you want. The following types of trigger are available (the actual type is shown in the brackets)
Damage (trigger_damage)
Explanation:
The damage trigger can be used to detect any form of damage. Melee, bullets, explosions.
Hurt (trigger_hurt)
Explanation:
The trigger will give damage to a player touching the trigger (once every frame rate).
Keys:
dmg: Amount of damage to give per damage rate [value: number]
Look At (trigger_lookat)
Explanation:
The trigger will be activated if the player is "looking" at it.
Multiple (trigger_multiple)
Explanation:
The trigger is triggered when a player is touching it.
Use (trigger_use)
Explanation:
A trigger that must have a person "use" it (using their use key).
Keys:
hintstring: The text that is seen when the trigger is targeted [Value: text]
cursorhint: The hint icon that is displayed. [Value: see caps below]
HINT_ACTIVATE - This will display a hand icon
HINT_NOACTIVATE - This will display no icon (secret trigger)
HINT_HEALTH - This will display a health (cross) icon
HINT_FRIENDLY - This will change the colour of the crosshair to green (also a hand icon)
Accumulate (trigger_damage)
Explanation:
A custom trigger that requires a preset amount of damage before it is triggered.
Using a trigger to find a user
The person who triggered a trigger can be found by a slight modification to the scripting.
Simply change
Code: Select all
multiple_trig waittill ("trigger");
Code: Select all
multiple_trig waittill ("trigger",user);
Code: Select all
user iprintln("Hello " + user.name);
.Map
Triggers in the provided map [Download: Here].
From left to right.
1 - Damage (Shoot it once to trigger it)
2 - Hurt (Stand on it to recieve 10 damage a second)
3 - LookAt (Aim crosshair at it)
4 - Multiple (Stand on it)
5 - Use [Activate Icon] (Press your use key)
6 - Use [NoActivate Icon] (Press your use key)
7 - Use [Health Icon] (Press your use key)
8 - Use [Friendly Icon] (Aim at it to change crosshair colour)
9 - Accumulate (Shoot it until damage is greater than 300)
All scripting can be found inside the pk3.
Enjoy.