advantages of !self?

Discussion in 'Mapping Questions & Discussion' started by 【EmNudge】, Oct 20, 2015.

  1. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    183
    Positive Ratings:
    37
    In the output of an entity, is there any advantages of using !self over selecting the entity you're using.

    i.e. is
    any worse than
     
  2. Izotope

    aa Izotope Never releases maps

    Messages:
    622
    Positive Ratings:
    586
    I use this for deathrun buttons.
    All my buttons are named the same, so I can easily kill them all at once. But to disable just one I use !self.
    You can also use this to disable an entity without giving it a name.
     
  3. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    183
    Positive Ratings:
    37
    oh I see, no advantages code or optimization wise, just better for unnamed or buttons with same names.

    btw, I usually make each button let's say "button_deaththing_01" and then trigger all the buttons related to the death thing by calling on "button_deaththing_*" which, as you know, triggers all entities with button_deaththing_ at the start of their name
     
  4. wiseguy149

    wiseguy149 Emperor of Entities and Amateur of Aesthetics

    Messages:
    103
    Positive Ratings:
    160
    All of the advantages of using !self are purely for the convenience of the mapper and make no difference in terms of how stuff actually runs.


    If you're going to rename your entity at any point, and you have an output that targets itself, you'd also have to rename that output. Or, if you use !self, you don't have to.

    If you have multiple entities with the same name (because you don't feel like using wildcards to target multiple entities at once) but you still want one entity to have an output that targets only itself instead of everything with it's name, you can use !self.

    If you don't want to name an entity at all, you can use !self.


    As a personal rule, I always use !self instead of having an entity target its own name. It usually saves me time, since I wind up renaming and duplicating my entities a lot. It's just more convenient.
     
  5. henke37

    aa henke37

    Messages:
    1,920
    Positive Ratings:
    449
    !self should also be useful for templated setups.
     
  6. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    836
    !self is cleaner, as it helps keep your logic entities modular. You can safely change the names of entities, or remove some of them, and they will still work. Just like !activator works for whatever triggers your logic, you don't have to pre-name any entity that does so it saves some effort. And also if you duplicate an entity, its logic is self-contained.

    It also helps to keep your entity data block down if you don't name entities.