Friday, November 11, 2011

Entities: All types of triggers

You have already used the trigger_multiple in the previous tutorial. Now, we will try out different kinds of triggers. Keep in mind a few important things first:

  • If you don't know anything about triggering other entities or the name and target system, go here first.
  • It is advisable to place a delay of 0.2 seconds in the delay before fire field in all the triggers.
  • Triggers trigger other entities by player interaction but keep in mind that all the brush based entities can also be triggered by other entities.
  • Toggle means that the entity will give a signal of 1 if it previously gave a signal of 0 to the entity to be triggered hence making it like a switch while specifying 1s and 0s will only give a particular signal to the triggered entity.

Brush based entities:

Trigger_multiple:This entity is used for triggering other entities. Will trigger other entities when the player moves through the trigger_multiple brush. You can also specify the delay value which states how much time will elapse after which this entity will be made triggerable again.

Trigger_once: This entity acts just like trigger_multiple except that it can only trigger other entities once. This entity saves its state so that if this entity is triggered, it wont be able to trigger other entities after the round when it was triggered. It will remain disabled until the server restarts the round.

Trigger_push:This entity will push the player in a specified direction when a player moves over it. Useful for making jumps and ramps just like in quake 3. To make the player move in a specified direction, change the yaw and pitch values. Note that the pushables flag does not work properly.

Trigger_teleport: When a player moves through this entity, he will be teleported to a specified location. To use this entity, simply place a point based entity called the info_teleport_destination entity on the place you want the player to teleport. Don't forget to name the info_teleport_destination entity and match in the trigger_teleport target.

Trigger_hurt:When a player moves through this entity, he will take damage based on the value specified in the damage box. There is also a damage type option given in which you can specify the damage type. Keep in mind that some damage types are resistant to kevlar while others are not.

Trigger_gravity:Any player who moves in this entity will experience a shift in gravity. To use, just type a value between 0.1 to 1 in the gravity box.

Trigger_counter:One of the most useful and also the most underused entity in the fgd. This entity stores the number of times a player and then only does it trigger the other entity. It has a useful flag called reset on fire by which this entity will reset its counter every time it triggers another entity. It can also be used in conjunction with the game_counter_set entity.

Point based entities

Trigger_auto:This entity is used in conjunction with multisource and the env_global entity. What this entity does is that it triggers any one entity after reading the global state from a multisource entity. You can run this entity without the multisource entity though. This entity is very good for activating certain entities after the game has started.

Trigger_camera:Used to make cameras. Basically, you can make security cameras in your map, make a spawn camera which activates upon joining a server(The camera placement  around your map when you join a server or make your own one). To make a spawn camera( I will call it spawn camera from now on), place a trigger_camera entity and a info_target entity. Join the two entities using the name and target system and name it something logically, like c1. Don't mess the flags or other settings for now. Just change the hold time to 4 seconds or something.
Remember that this entity can be used in lots of creative ways.

Trigger_changetarget: This entity simply changes the target of any entity to the one you choose. For example, I have placed two lights in my map. One is on and the other is off. I have linked the light which is on to a func_button. But I have made another button which makes the button trigger the other light( the one which is off) thereby changing the path of the original button and the light entity. To use, just type the name of the entity you want to target in the target box and the new name of the entity you want to target in the new target box. Also type a unique name in the name box and type it in the target field of the entity by which it gets triggered.

Trigger_relay: One of the most useful entities. This entity can send either 1s or 0s to the entity specified in the target field.  There is also a toggle option given in the trigger state to read field which basically makes this entity act like a switch( which turns on and off whenever triggered by another entity)

No comments:

Post a Comment

Post your views here