Target the player

W4E

Newbie
Joined
Jun 19, 2004
Messages
409
Reaction score
0
For a mod, we need to trigger something when the player faces a wall. Im using a point_anglesensor, how can i make the entity that it checks the angle of the player..

I seem to remember it being !player but that didnt work.. any ideas?
 
You might have more luck with the brush entity trigger_look.
 
how well trigger_look will work depends on how big your wall is (and it needs some named ent to be looked at). the default setting for angle of looking is iirc 0.9. for a whole wall you might need to decrease that to 0.5 or even smaller (smaller = wider angle you need to be looking in for the trigger to work)
 
Yea, im just going to use an info_null.. Then set it to about 0.9.

Ive managed that, but now im trying to set the player as a landmark of a teleport... So that an npc spawns in relation to where the player is.

Any suggestions?

could i parent the teleport destination to the player somehow?
 
eh?

there's a good reason why you can't do that - local geometry means your parented teleport destination could end up in a wall. you really don't need anything like that anyway. for a trigger_look to work it needs a brush trigger to stand in while looking at the object in question - just make the brush trigger reasonably small so whatever it is teleports in is always at more or less the same relative position to the player
 
I doubt you'd want to use info_null since it's removed upon map spawn. :P
 
lolz..

Erm.. well i want a zombie to spawn behind you when you face away..

How could i accomplish this?
 
i dont think you can actually parent anything to the player but i think raeven0 could give a better explaination as to why. I wish you could target the player too, that would allow me to do some of the things i wanna do.
 
I would suggest trigger_look targetting the wall itself. I don't know whether it would take the origin or the entire wall, but in either case you could modify the field of view appropriately.

You can parent things to the player, but in most cases it's a fruitless effort, especially since the children will move up and down to match the player's current pitch. Targetting the player can be done by way of !player, for the first player in the server; player, for all players; !activator, for the person who activated the trigger; and !pvsplayer, a player chosen randomly from the searching entity's PVS.
 
Is there a list of other special things like that or is that it?
 
http://www.editlife.net/tutorials.php?id=34

!activator - The entity that activated this one. Useful for trigger_* entities that can actually be activated. If logical entities (like a logic_case) are placed between the activator and the trigger, delaying its being triggered, HL2 can usually follow the chain of entities to the original activator.

!picker - The entity that the first player to join the server is looking at. !picker will even pick invisible entities like func_useableladder, but it won't pick the world.

!player - The first player to join the server. Most useful in single-player missions. To affect all players, use player instead.

!pvsplayer - The entity will look in its Potential Visibility Set and pick the first player it sees. That means it'll look around itself and find a player.

!self - The entity sending the input. Useful for point_template-spawned entities that will have different names.
 
Back
Top