Teleporters and Tilted Views

  • If you're asking a question make sure to set the thread type to be a question!
D

Digaag Wa Riz

Hello all, I have a problem and a question.

I want to use a mobile teleporter (and they can be parented to dynamic entities) that is parented to a flag. The flag is the same as the regular capture-the-flag flag and the entrance stays in one place. The problem I have is that when someone is holding the flag and someone else uses the teleporter, the teleported player's view is tilted in the direction the teleporter exit was facing. This screws with movement as well.

What I want to know is how can I correct the tilted camera angle?

I don't know if I can use AddOutput to reorient the teleporter exit so that it stays facing directly upward constantly or there is some other way to fix the player's view.

Note: Please give me something other than: "This is a stupid idea; just get rid of it". I'd really like to make this work.
 
Sep 7, 2012
638
500
Make two teleporters, one oriented correctly for when a player has the Intel and one for when it's on the ground. Then parent both of them to the flag and change the teleporter destination each time it is picked up or dropped.
 
D

Digaag Wa Riz

Make two teleporters, one oriented correctly for when a player has the Intel and one for when it's on the ground. Then parent both of them to the flag and change the teleporter destination each time it is picked up or dropped.

I'm sorry I should have mentioned this before. They are obj_teleporter entities as in the one engineers build. The problem is the teleporter moves EXACTLY as the flag moves. So if the player model flinches, the flag will move ever so slightly and reorient the teleporter as well. And the models are always moving.
 
D

Digaag Wa Riz

If there is a way to disable an obj_teleporter without destroying I'd do that as well so that the teleporter can not be used while someone is carrying the flag.

Ideally I'd like the teleporter to still be active even while a player is carrying the flag and for the exit to always be facing upward.

Is there any way to prevent an entity from rotating vertically?
 
Last edited by a moderator:

Dr. Spud

Grossly Incandescent
aa
Mar 23, 2009
880
854
This is going to be very difficult to do in Hammer.

You might be able to have the teleporter exit off somewhere else in the map in a blank room, and have a point_teleport parented to the flag. Then when they exit the teleporter into the blank room, you immediately teleport them to the point_teleport.
 
D

Digaag Wa Riz

I found an entity called phys_keepupright. It does exactly what I need I just don't know how to use it. I want to make the teleporter exit able to move up, down, sideways, but I want it to constantly face upwards. Anyone know how to use phys_keepupright? Portal mappers might know...
 

Dr. Spud

Grossly Incandescent
aa
Mar 23, 2009
880
854
I don't think phys_keepupright is going to work here. Even if you could give it a reference to the player who last used the teleporter (which I'm not sure is possible... maybe?), I can't find any evidence that the entity will work with players.
 
D

Digaag Wa Riz

I don't think phys_keepupright is going to work here. Even if you could give it a reference to the player who last used the teleporter (which I'm not sure is possible... maybe?), I can't find any evidence that the entity will work with players.

I'm not trying to use it on the player I'm trying to use it on the teleporter exit. If the teleporter exit is always facing upwards (as it should be) then the player should have no problem. I don't think phys_keepupright works on obj_teleporter or prop_dynamic. I think it only works with prop_physics but prop_physics can't be parented to anything.
 

WhyNott

L1: Registered
Oct 21, 2012
27
1
Have you tryed using SetTeam output on teleporter to set it on 0 or 1? This should make the tele nonfuncional for as long as you want. Just make sure to set the team back as it should be when you are done(2=Red 3=Blue). I'm not sure through.
 
D

Digaag Wa Riz

Have you tryed using SetTeam output on teleporter to set it on 0 or 1? This should make the tele nonfuncional for as long as you want. Just make sure to set the team back as it should be when you are done(2=Red 3=Blue). I'm not sure through.

Didn't work. I don't think 0 or 1 are valid parameters because a teleporter can not belong to no team. Even if I set the team to the opposite of the only team that was allowed to use it spies could still use it.
 
D

Digaag Wa Riz

A possibility might be using some other entity to attach the teleporter to the flag's position, without changing it's angle. What about logic_measure_movement?

The problem is that the flag model attaches to the back of the model of the player who picked it up, so whenever the model's back moves, so does the flag and, by extension, the teleporter. I don't think it's possible to keep a static orientation on an object that is parented to a flag.
 
D

Digaag Wa Riz

Does any one know how to fix the tilted camera angle that the player gets when he uses a lopsided teleporter? That's the only problem I have. That's the reason I want the teleporter to stay facing directly upwards.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
I believe the issue is a result of the roll value being non-zero, because a player normally only has control over pitch and yaw. You could try using AddOutput to force the player entity's angles to 0 0 0. But I'm not sure how to reliably target only the player being teleported, and not anyone else, since as far as I know obj_teleporter doesn't provide any outputs for such.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Yes, but the problem with that is you wouldn't have the full effect of the obj_teleporter. If you had a fake one on the destination player you would need to rig up all the particle effects manually and it would be difficult to make it look like real.