Thread: [Entities] How to use !activator

Results 1 to 4 of 4
  1. #1
    Craazy! the-middleman's Avatar  
    Artist
    Join Date
    Sep 2012
    Location
    Entity-Guide
    Posts
    514

    Standard Crate [Entities] How to use !activator

    What is !activator?
    !activator is a new mapping function to refer to entities in SC. Normally you refer to entities using their name. For example you trigger "door1" to open door1. Or you use a trigger_changevalue to make door1 transparent. This method of referring to entities is very static because it can not be changed once the map has started and you can only refer to entities you named in the Hammer editor.

    If you use "!activator" (without the quotes) instead of the targetname then you will refer to the entity who started the trigger in the first place. For example: if a player walks into a trigger_multiple then he will become the !activator. All entities triggered by the trigger_multiple will know that the player is now the !activator. If a trigger_changevalue is triggered then it can make the player transparent.

    How do you become the !activator?
    Like I said, a player that walks into a trigger_multiple becomes the !activator for all the entities that are trigger by the trigger_multiple. But this does not only work with players. It also works with monsters that walk into the trigger_multiple or a func_pushable if you configure the trigger_multiple correctly.

    It does not have to be a trigger_multiple at all. It can also be a func_button. Whoever uses the button will be the !activator. Or an item_security. The one who picks it up is the !activator. Get it?

    One very interesting and useful way to determine the !activator is the trigger_entity_iterator. This entity searches through the map looking for all entities with specific attributes. For example you can make it look for all entities named "door1". Or you can look for a specific class like "monster_zombie" to look for all zombies in your map. Every entity that it finds will then be forced to trigger a target of your choice and will thus become the !activator. For example you can force all zombies in your map to trigger a target and be the activator. If you use this to trigger a trigger_changevalue then you can make all zombies in your map become invisible.

    What entities can I combine this with?
    Here is an (incomplete) list of entities that make sense to use with !activator:
    - trigger_changevalue: To change some of the !activators keyvalues such as rendermode, health or origin.
    - trigger_copyvalue: Similar to trigger_changevalue.
    - trigger_condition: To check wether the !activator fulfills a certain condition and if so trigger another entity.

    trigger_changevalue, trigger_copyvalue and trigger_condition are somewhat complicated entities but very fun once you understand them. I will make a tutorial for these too in the future. Until then check out the links below and the examples I made.

    Here are two examples on how to use !activator
    trigger_multiple
    Target: changevalue1
    Flags: [x] monsters

    trigger_changevalue
    name: changevalue1
    Destination entity: !activator
    Destination key: rendermode
    Source value: 5
    Action: Replace

    Any player or monster that walks into the trigger_multiple will become invisible because its rendermode will
    be set to "additive" and the renderammount is 0.


    func_button
    Target: zombieiterator

    trigger_entity_iterator
    Name: zombieiterator
    Filter Entities by Classname: monster_zombie
    Entity´s Trigger Target: morezombiehealth
    Entity´s Trigger State: On

    trigger_changevalue
    Name: morezombiehealth
    Destination entity: !activator
    Destination key: health
    Source value: 50
    Action: Add

    Using the button will give all zombies in this map an extra 50 healthpoints.

    Here are some useful links for further reading
    !activator
    trigger_changevalue
    trigger_copyvalue
    trigger_condition
    trigger_entity_iterator
    ZN progress:

  2. #2
    Donated 15NS$ for Sven's Holiday at the Bahamas Puchi's Avatar  
    Artist
    Join Date
    Nov 2002
    Location
    Akihabara, Bochum or Sailune
    Posts
    5,617

    Re: [Entities] How to use !activator

    Great.

    I use !activator in beatthis to check what box got put in, since you can not tell which one is used.
    We also have !caller though I do not know anymore what it was. I'm terrible at my job
    Do it with passion, or not at all.
    Do not say everything you know. Know everything you say.
    [ MarySP ][ nacl-h2o ][ The next SC Version ♥♥♥♥ing pwns! ][Puchis Maps ]

  3. #3
    Craazy! the-middleman's Avatar  
    Artist
    Join Date
    Sep 2012
    Location
    Entity-Guide
    Posts
    514

    Re: [Entities] How to use !activator

    !caller reffers to the previous entity in a triggerchain. For example if you have
    Player -> trigger_multiple -> trigger_relay - trigger_changevalue
    Then player will be the !activator but trigger_relay will be the !caller.

    I did not include !caller in this tutorial because I can not think of any situation where it might be useful.
    ZN progress:

  4. #4
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,079

    Re: [Entities] How to use !activator

    Quote Originally Posted by the-middleman View Post
    I did not include !caller in this tutorial because I can not think of any situation where it might be useful.
    e.g. Player -> Button -> Trigger; Trigger could use !caller to get the button's position and do something with it (instead of having every button target it's own entity system) like create some special effect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •