Talk:Targetname

From Valve Developer Community
Jump to navigation Jump to search

Flashlight on at start of round (CS:S)

Could someone tell me how to make it so, that, in CS:S, at the start of every round, only the flashlights of the CT are ON. So:

  • At the start of a round, flashlights on
  • Only the one of CT's

I already figured out that you can select all players by making a Logic_auto and set OnMapSpawn, and the target to player. Thanks in advance! --CrabbyData 08:10, 13 May 2006 (PDT)

You would need to use a logical statement of if player team = counter, or similar. I'm not sure that that's possible though. --TomEdwards 08:33, 13 May 2006 (PDT)
Where should I put that? Because, I can't alter everybody's CS:S source-code to make that work... --CrabbyData 09:01, 13 May 2006 (PDT)
That's why I don't know if it's possible. --TomEdwards 09:04, 13 May 2006 (PDT)
Does CS:S support filters for trigger brush entities? That would presumably be the best way of setting up this kind of if statement. How do you go about turning on a player's flashlight for them though? point_clientcommand? --Giles 09:21, 13 May 2006 (PDT)
Perhaps the filtering would be unnecessary though, if you just stretched a trigger around the appropriate player starts and then had it delete itself after it did its job ... --Giles 09:24, 13 May 2006 (PDT)
Filtering would be nessicary because not all of them would be used. Actually you might want to find a way to delete them all after all of the team members have been spawned because having any left over because there weren't enough players on the team would cause a CT walking through one to turn their flashlight on again even though it had been turned off. But since everyone spawns at once, you could have each delete all the rest after a 1sec delay or something. --AndrewNeo 09:41, 13 May 2006 (PDT)
Thanks for all your help guys :D I'll test somethings out, with your ideas, and see if it works. Update in a sec... (I think I'll go for a triggering brush (invisible ofcourse) for every player start (so 2 inf_player_counterterrorist = 2 trigger_proximity (or something else))
Sorry, the last post was from me... I figured it out! Click here to read my (mini) tutorial (including sample map). Sorry for the late reaction, but I had dinner and there were some very good tv-shows on the tellie ^^ And I had a good sleep ;) --CrabbyData 02:13, 14 May 2006 (PDT)

References

!player and !activator, generally all the special keywords can be seen as references to other entities. I'm currently trying to award a player points for shooting a physics prop into a certain spot (trigger_multiple), but this physics prop is seen as the !activator, not the player who fired it, so when the trigger_multiple triggers the game_score, no points are awarded to the player. So I wondered, is there a way to somehow store references to entities? E.g. when the player picks up the prop, the prop stores a reference to this player, which can then be referred to later when applying score. Can this currently be done?

Ignore what was previously writeen I thought this was a different page, and from the look of it no, i don't see a way. --Angry Beaver 14:23, 23 Dec 2006 (PST)

Examples?

I found the I/O chain somewhat confusing to set up, after a LOT of experimentation I figured out how to use !activator. I think it would helpful to give each of the keywords it's own specific page with an example use, but right now I've only have !activator working.

I just posted it on the forums for someone to use as there were no replies to their question, but I'm not sure it's the best method. Would this be a good example to add to the article? --Brandished 23:44, 29 Jun 2008 (PDT)


Start with the entity that gives a single player\npc a special value when triggered, eg, a func_button with an output:

  My Output Target Entity Target Input Parameter Delay Only Once
Io12.png OnPressed !activator AddOutput targetname button_pusher 0.00 No


Now the player\npc that pushed that button is the "button_pusher", what you have to do next is create a "filter_activator_name" entity that looks for someone who's been assigned the "button_pusher" targetname. The keyvalues for the "filter_activator_name" should look like this:

Property Name Value
Name filter_pusher_of_button
Filter mode Allow entities that match criteria
Filter Name button_pusher


Then simply tie an entity with a "Filter_Name" setting to that filter. eg, for a trigger_teleport go to the Filter Name setting and add "filter_pusher_of_button" to it.

Now only the player that pushed the button can use the teleport.


So how do you remove the button pushers ability to use the teleport? By simply creating another entity to give the player a new targetname. eg: a trigger_multiple with an output of:

  My Output Target Entity Target Input Parameter Delay Only Once
Io12.png OnStartTouchAll !activator AddOutput targetname not_button_pusher 0.00 No


!caller

When is !caller different from !self? The example doesn't really explain this. --4LT 20:29, 3 August 2009 (UTC)

The page should be clearer now. --TomEdwards 21:06, 3 August 2009 (UTC)
It should be noted that !caller often doesn't give the expected reference; for instance, if the Test input is called on a logic_branch, the logic_branch is the !caller when evaluating OnTrue or OnFalse (same as !self). --Ovdev006 07:16, 6 September 2011 (PDT)
I can confirm that !caller does not work on logic entities. I tested with a logic_case that triggered a logic_relay. relay is set to pick a case from the logic_case using !caller, but doesn't target said entity. Try to find workarounds when dealing with this issue. --Kanister

Portal 2 - How can I teleport pbody or Atlas

What is the keyword for pbody and Atlas? is !player used for Atlas and something like !player2 for p-body? Ldinos 14:43, 9 March 2013 (PST)

I don't know offhand if there's a !player2, but if not you could have a trigger_once that assigns pbody a new targetname at his spawn location, which would be something like "OnStartTouch !activator AddOutput targetname pbody" and then use "pbody" as the target from now on.--Obstipator 10:23, 10 March 2013 (PDT)
Hmmm I see. Do you ahve any other easier suggestions? This is kinda hard to be done. Are you sure there aren't any other keywords? Ldinos 07:23, 12 March 2013 (PDT)
Super late, but for anyone who goes on to read this, wondering the same thing, this plus a 'trigger_playerteam' (using the OnStartTouchOrange and OnStartTouchBlue outputs) is probably the best way, even if there were any wildcard outputs.Srs bsnss 08:03, 19 December 2013 (PST)