Please or Register to create posts and topics.

[Solved] Player Target / Parent Player

So. I am trying to catapult something at the player, but I dont know how to set the target to the player. I decompiled the Wheatly fight and they used a futbol shooter to shoot at the player. But that futbol shooters target is set by a relay with a parameter of !player. So seeing how I can't set a catapult's target that way, I'm a bit stuck on how to do it.
I would also like to know how to parent things to a player.
I'm also trying to do this for a co-op map.

*EDIT*
ok i figured out how to parent something to Chell. So I parented the info_target, and that seems to be working well. I just set the parent of the info_target in an logic_auto with the parameter of !player
Now i need to figure out how to do it in co_op

So what I need to know now is how to parent a info_target onto Atlas and P-Body

Maps(Newest to Oldest): Storming the Castle / The Amazing Race / Wreaked / Mental Breakdown / Lost In Transition / Split / Mind Lock
Mapping Since May 21, 2011

In coop the players are automatically named to 'blue' and 'orange'. So referencing the coop players won't be too difficult.

You can also use scripting to do the same thing.

An info target with a script in it:

Code: Select all
local variable = playername.getOrigin()
self.setOrigin(variable)
EntFire("nameoftarget", "setParent", "playername", 0.0)

// Note: this may not work seeing as setOrigin needs 3 values not a vector position. Perhaps you can do it like this:
self.setOrigin(variable.x, variable.y, variable.z)

Honeslty I don't know why you just set the target for the catapult to !pvsplayer (this is the first player in a radius around the entity). VDC targetnames

?????????????????????????????TWP Releases | My Workshop
chickenmobile wrote:
Honeslty I don't know why you just set the target for the catapult to !pvsplayer (this is the first player in a radius around the entity). VDC targetnames

This wouldn't work for what I'm trying to do in coop, I was just testing it in sp. I was trying Orange and Blue, but it didn't seem to work. I'll give it another shot and check out the scripting as well.
*Edit*
Seeing how I couldn't get Orange or Blue to work still... I just spawned each player in their own trigger with the info_target in the middle of them. Set the trigger to parent the info_target with a parameter of !activator.

Maps(Newest to Oldest): Storming the Castle / The Amazing Race / Wreaked / Mental Breakdown / Lost In Transition / Split / Mind Lock
Mapping Since May 21, 2011

Ok so I was able to make the catapults launch to the specified player I wanted to WITHOUT using a script or parenting any target.

mp_coop_new.vmf

EDIT: I am sorry, I made a mistake in the last post: the orange bot is referenced as 'red' seeing as Valve probably re-used TF2 code to make Portal 2 coop.

EDIT2: !pvsplayer doesn't work (it only fires at blue). Must be strictly other valve multiplayer games.

?????????????????????????????TWP Releases | My Workshop

WoooooW. The only reason why I couldn't get the Red and blue thing to work was because I didn't have the setlaunchtarget delay 1 sec on the logic_auto :notwant: . I hate it when simple little tiny itty bitty teeny wheeny things cause me so much pain.
Thanks.

Maps(Newest to Oldest): Storming the Castle / The Amazing Race / Wreaked / Mental Breakdown / Lost In Transition / Split / Mind Lock
Mapping Since May 21, 2011