Parenting to Player
You could try this...
If you create a trigger_once and say a brush called 'box1', and then on trigger do a 'box1:SetParent:!activator', that will parent it to the player.
That does it somewhat, but if you go too close to any objects it disappears 'into' the object if you get too close.
The item will also disappear if you go upto and through a portal, and then it reappears when you're through the other side.
Suppose, depending on what you wanna do, that could help you?
Rob.
Skotty wrote:
Use player for the player. !Player is just for outputs...
Ah, okay. So much more makes sense now! Thank you.
Robdon wrote:
Hi,You could try this...
If you create a trigger_once and say a brush called 'box1', and then on trigger do a 'box1:SetParent:!activator', that will parent it to the player.
Now that I know that parenting objects to players is possible, I will try that as well. Your method will help with dynamically setting the parent for some invisible entities like info_targets in the entity setup I'm trying to use, so thank you as well.
Object to pick up:
OnPlayerPickup pickup_trigger trigger
OnPlayerDrop drop_trigger trigger
OnUser2: -> The actual teleport.
pickup_trigger:
OnTrigger drop_trigger cancelpending
drop_trigger:
OnTrigger drop_thing fireuser2
But I have no idea how to teleport that thing to my position. What I tried:
using point_teleport:
Logic auto, onmapspawn point_teleport setparent !player
Logic auto, onmapspawn point_teleport setparent player
Both cases didn't move the point_player so the object was dropped back were I started.
A trigger_brush with onStarttouch point_teleport, SetParent !activator
A trigger_brush with onStarttouch point_teleport, SetParent !player
A trigger_brush with onStarttouch point_teleport, SetParent player
Soo... that also didn't work
Now I tried a trigger_teleport, parented to my object. with object
OnUser2 trigger_teleport enable 0.00
OnUser2 trigger_teleport disable 0.30 with the the remote destination to a parented info_target, but this does absolutely nothing.
Anyone suggestions? 
lpfreaky90 wrote:
I've got another question: I want an object to teleport to my position if it was dropped, with a delay of 10 seconds. What I got is:Object to pick up:
OnPlayerPickup pickup_trigger trigger
OnPlayerDrop drop_trigger trigger
OnUser2: -> The actual teleport.pickup_trigger:
OnTrigger drop_trigger cancelpendingdrop_trigger:
OnTrigger drop_thing fireuser2But I have no idea how to teleport that thing to my position. What I tried:
using point_teleport:
Logic auto, onmapspawn point_teleport setparent !player
Logic auto, onmapspawn point_teleport setparent playerBoth cases didn't move the point_player so the object was dropped back were I started.
A trigger_brush with onStarttouch point_teleport, SetParent !activator
A trigger_brush with onStarttouch point_teleport, SetParent !player
A trigger_brush with onStarttouch point_teleport, SetParent playerSoo... that also didn't work
Now I tried a trigger_teleport, parented to my object. with object
OnUser2 trigger_teleport enable 0.00
OnUser2 trigger_teleport disable 0.30 with the the remote destination to a parented info_target, but this does absolutely nothing.Anyone suggestions?
Try using point_teleport instead of triggers.
The only problem was that for some reason my point_teleport wouldn't parent to the player.
The ways I tried were:
Logic auto, onmapspawn point_teleport setparent !player
Logic auto, onmapspawn point_teleport setparent player
A trigger_once with onStarttouch point_teleport, SetParent !activator
A trigger_once with onStarttouch point_teleport, SetParent !player
A trigger_once with onStarttouch point_teleport, SetParent player
It's a little bit more complicated than that since certain entities have to be left behind by both the player and the cube prior to the teleports, but that's the basic idea: try a point_template and env_entity_maker. The only issue, however, is that the point_template seems to remember the cube's state only from when it first spawned. So if it gets painted, the paint will disappear after a teleport. I'm trying to work that issue out now.
Refer to this picture:
picture

chickenmobile wrote:
A point_teleport teleports an object to a certain spot (i.e. to an info_target) from an output. I don't see why you would need to parent the point_teleport whatsoever.Refer to this picture:
picture
The problem is that I want an ontrigger -> object teleport to player. That is why there is something that has to be target to the player, since the point where the object has to teleport is different.
chickenmobile wrote:
A point_teleport teleports an object to a certain spot (i.e. to an info_target) from an output. I don't see why you would need to parent the point_teleport whatsoever.Refer to this picture:
picture
You should start a site with Hammer tutorials all in picture form like that. But I just tested a point_teleport, and I could not get it to teleport any entities to any location other than that of the point_teleport.
The Teleport input teleports the entity to teleport (the one in the keyvalues) to the location of the point_teleport.
The TeleportToCurrentPos input seems to do the same thing.
The TeleportEntity input, the only of these three that has a parameter, teleports the entity that is placed in the parameter override to the location of the point_teleport.
Specifically, how would I use a point_teleport to teleport an entity to a mobile position?
Last night I wrote a whole paragraph that seemed to not have posted... anyway...
I was going to say it would be better to actually use scripting instead of a point_teleport in order to teleport the info_target to the player then parent it. Insert entity scripts inside your info_target which you want the object to teleport to and then on an output, make it activate the script which will parent the info_target to the player, like so:


function TeleportToPlayer()
{
self.SetOrigin(player.GetCenter())
EntFire( self.GetName(), "SetParent", "!player", 0, 0)
}
How about I make it easier for you by giving you the example I made 
chickenmobile wrote:
How about I make it easier for you by giving you the example I made
Thank you very much! 