Parenting to Player
Quote from Brainstatic on December 16, 2011, 5:32 pmSimple question; is it possible to parent an entity to the player's origin in single player? I tried using !player as the parent, which did not work. Parenting to the portal gun is perfectly possible, but I can't get the offset quite right to be exactly where the player is standing.
Simple question; is it possible to parent an entity to the player's origin in single player? I tried using !player as the parent, which did not work. Parenting to the portal gun is perfectly possible, but I can't get the offset quite right to be exactly where the player is standing.
Quote from Skotty on December 16, 2011, 7:25 pmUse player for the player. !Player is just for outputs, but the player istelf is names player (developer 2; ent_text player and you will see a text under your with all your parameters).
Use player for the player. !Player is just for outputs, but the player istelf is names player (developer 2; ent_text player and you will see a text under your with all your parameters).
Quote from Robdon on December 16, 2011, 7:32 pmHi,
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.
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.
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.
Quote from Brainstatic on December 16, 2011, 7:38 pmSkotty 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.
Ah, okay. So much more makes sense now! Thank you.
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.
Quote from CaretCaret on December 16, 2011, 8:32 pmI think I had an logic_auto parent an object to !player onmapspawn.
I think I had an logic_auto parent an object to !player onmapspawn.
"I hear voices. But I ignore them and I just carry on killing."
Quote from Lpfreaky90 on December 17, 2011, 3:55 pmI'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?
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 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?
Quote from reepblue on December 17, 2011, 4:00 pmlpfreaky90 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.
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?
Try using point_teleport instead of triggers.
The more you give, the less appreciated it will be received.
Quote from Lpfreaky90 on December 17, 2011, 4:04 pmI tried point_teleport and that teleported my entity properly.
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
I tried point_teleport and that teleported my entity properly.
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
Quote from Brainstatic on December 17, 2011, 5:19 pmI'm actually doing something remotely similar, in which a cube and the player switch places on a button press. If I'm not mistaken, point_teleport cannot be parented. To "teleport" the cube, I actually make the cube silentdissolve, then respawn it at the player's position using a point_template and an env_entity_maker.
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.
I'm actually doing something remotely similar, in which a cube and the player switch places on a button press. If I'm not mistaken, point_teleport cannot be parented. To "teleport" the cube, I actually make the cube silentdissolve, then respawn it at the player's position using a point_template and an env_entity_maker.
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.

Quote from ChickenMobile on December 17, 2011, 11:32 pmA 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
[spoiler][/spoiler]
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
