[Solved] Player Target / Parent Player
Quote from baca25 on March 20, 2012, 5:17 pmSo. 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_opSo what I need to know now is how to parent a info_target onto Atlas and P-Body
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
Mapping Since May 21, 2011
Quote from ChickenMobile on March 20, 2012, 10:39 pmIn 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
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
Quote from baca25 on March 21, 2012, 12:44 amchickenmobile 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 targetnamesThis 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.
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.
Mapping Since May 21, 2011
Quote from ChickenMobile on March 21, 2012, 5:56 amOk 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.vmfEDIT: 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.
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.
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.
Quote from baca25 on March 21, 2012, 8:07 pmWoooooW. 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
. I hate it when simple little tiny itty bitty teeny wheeny things cause me so much pain.
Thanks.
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
. I hate it when simple little tiny itty bitty teeny wheeny things cause me so much pain.
Thanks.
Mapping Since May 21, 2011
