If I made a mistake somewhere or if you think something could be improved, tell me, I have the feeling I forgot something.So, this is a tutorial for entity workers. Sometimes it is usefull to let only one player get affected by several triggers. This is a very powerfull function in Hammer, you can do things beyond imagination!
There are several ways to let this happen. But all of them have differences. Right now I will only discuss 2 ways. Maybe I can add more later.
Individual triggering: !! likes you. ! is very usefull. What is ''!'' ?
Well it is hard to describe the absolute correct way, but to say it very simple: "!" is a command towards several entities who are involved with the entity that fires it.
Hehe, yeah don't worry I will give you an example.
Every time you wish to use this, you will let something change in an entity that is involved.
!activator!activator says it all, pretty much. !activator means that you will let something happen with the
individual person that triggers the trigger that will fire the !activator commandSo, let's say the players that triggers a trigger_multiple will be set on fire. Only that person, and nobody else unless someone else
also hits that trigger. (That means it is still
individual)
Recipe:
1 trigger_multiplePreparation:
trigger_multiple outputs:
-
!activator (
IS SOMETIMES DISPLAYED IN RED, WORRY NOT! IT WILL WORK. JUST MAKE SURE THE OUTPUT IS 100% CORRECT AND IT WILL WORK)
-Ignite
That's it. Now the person that hits the trigger will be set on fire. It's fun isn't it?
!self!self means that the entity that fires the !self command will be affected by that same command.
It is pretty useless in my opinion because you can either use !self or you can use the targetname of the entity.about the !self command, it is actually really usefull, in the right situation
say for example, you had 4 entities with all the same target_name and you could not under any circumstances change their target_name, then what you could do is from another entity fire the user1 input, then have an output on each entity,
Onuser1 - !self - do shit
this way, even tho the 4 entitys have the same target name, they could in theory, do different things
So:
Recipe:
1 func_buttonPreperation:
func_button outputs:
-!self
-Kill
But it would be the same as:
func_botton outputs:
-
func_button-Kill
That is what I mean.
You can try to experiment with it yourself, as long as you understand what it does. Hopefully you will do that now.
Individual triggering: "targetname"This is what I personally LOVE. It is so extremely powerfull and usefull. But hang on, please do not try to understand this if you are not an advanced mapper.
What can it do?
Let one individual player get affected by all kinds of stuff, as long as that stuff has a filter.
I am going to give one raw example;
Goal:When a player hits a trigger_multiple, a trigger_push somewhere else in the map will only affect this player. (same thing as with the "!" trigger. Anyone who ALSO hits this trigger will be affected ALSO, but this time the "!" is required, you will see.)
Recipe:
1 trigger_multiple1 filter_activator_name1 trigger_pushPreparation:
filter_activator_name settings:
targetname: <your choice>, will be
filter_activator_name in this tut.
filtermode: Allow entities that match criteria (depending on the situation, you might want to allow or disallow, in this case we will allow because we want the player to ALLOW something when it hits the
trigger_multiple).
filtername: <your choice>, will be
X in this tut.
trigger_push settings:
filtername:
filter_activator_nameAll the other settings can be adjusted to your own needs.
trigger_multiple outputs:
-
!activator-AddOutput
-targetname
X [[×]]And there you go. You've just set a player's entity targetname to
X. As long as any entity that can have a filter has the
filter_activator_name added, this entity will only affect players with entity targetname
X. Simple, huh?
It can be used for far more things than this. For example if you have 5 doors and a player has to go through all 5 in a particular order so he can get teleported or something, then:
a player with name X5 can be teleported
door 1 gives the player the name X1
door 2 gives the player the name X2
door 3 gives the player the name X3
door 4 gives the player the name X4
door 5 gives the player the name X5
Get it?
I hope this will open some new doors for
you with entity work. It's really fun to make and you can do countless more things with it!
Enjoy.
[[×]]:
THE FOLLOWING IS IMPORTANT!
Everytime you give a player a targetname then YOU MUST set its targetname to blanco if it is not needed anymore or else you have a shitload of complications.
At a certain point where you know the targetname is not needed anymore, create a trigger_multiple with the same settings as the one that gives a player a targetname, but instead of X you must type: targetname<space><space> (targetname )
THE TWO SPACES ARE A MUST!
The first space is to seperate the targetname from the name and the second space indicates that the targetname is empty, so it will be set to default.
ALWAYS DO THIS! ALSO DO THIS AT THE SPAWNS BECAUSE IF SOMEONE HAS A TARGETNAME AND THE ROUND ENDS, HE WILL HAVE IT NEXT ROUND ALSO (OR THE PERSON THAT HAS THIS SPAWNPOINT) SO MAKE THAT SAME TRIGGER_MULTIPLE WITH "TARGETNAME " AT EVERY SPAWN.Sorry for the big yell but it is very very very important. Or else you will have so many gameplay glitches