Sign in to follow this  
Followers 0
atrX

Triggers

1 post in this topic

Types of triggers

There's a couple different types of triggers:

  • trigger_use: Activates when a player presses the "use" button on it.
  • trigger_use_touch: Activates when a player presses the "use" button when touching it.
  • trigger_radius: Activates when a player (and/or AI, depending on how it's set up) is in its radius.
  • trigger_multiple: Activates when a player (and/or AI, depending on how it's set up) is touching it.
  • trigger_damage: Activates when it gets damaged.
  • trigger_hurt: Activates when a player (and/or AI, depending on how it's set up) is touching it, will deal trigger_hurt.dmg amount of damage to the entity touching it.
  • trigger_lookat: Activates when a player is looking at it.

There's some more trigger types which you most likely will never use and I will therefore not mention them.

 

Basic trigger setup

Please login or register to see this code.

 

Trigger more than once

This can be done with a simple loop:

Please login or register to see this code.

 

Enabling/disabling triggers

These functions differ for solo and multiplayer, they're also included in different utility scripts.

 

Solo:

Includes required:

Please login or register to see this code.

Implementation:

Please login or register to see this code.

 

Multiplayer:

Includes required:

Please login or register to see this code.

Implementation:

Please login or register to see this code.

 

Spawning triggers in manually

Please login or register to see this code.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0