Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Teleporting Jolts & Player Position Variables
Horrorable Offline
Junior Member

Posts: 7
Threads: 2
Joined: Feb 2014
Reputation: 0
#1
Teleporting Jolts & Player Position Variables

Heya.

I'm working on a script for a amnesia level and I've ran into a bump. Actually a jolt. I'm trying to teleport a player from one hallway to another, both hallways are identical. The goal is to get it so the player teleports, but no one can tell. What I have now is a Area across the hallway A, so when the player walks through it it teleports him to hallway B. However the teleport tends to screw things up. Change his camera angle, turn him around and stuff. This creates a jolt where as the player walks through this section of the hallway his camera will suddenly turn angles and he might find himself walking in another direction. Giving a noticeable jolt.

Is there any way to get a variable for the players exact positions/head position? Then I could save the info right before the teleport and restore afterwords. If not does anyone else know a way to do this?

ALSO, I could only figure out how to teleport from the area in the hallway A to a Player start in hallway B. So if the player is sneaking along the wall he is suddenly teleported into the middle. Another jolting problem.

Any ideas?
Thanks in advance for any help. You guys(and gals) are great Heart

If necessary I could fix the second problem by making multiple small areas across hallway A and multiple start positions in hallway B, and just teleport to different start positions based on which area the player collided with. There would still be a jolt but it would be smaller. I am hoping someone else has a smoother looking option though. Again, thanks to anyone that can help Smile
(This post was last modified: 02-14-2014, 03:30 AM by Horrorable.)
02-14-2014, 03:22 AM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#2
RE: Teleporting Jolts & Player Position Variables

Moved to development support.
02-14-2014, 07:43 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#3
RE: Teleporting Jolts & Player Position Variables

Teleporting players can be difficult to make appear seamless. To make it look a little more smooth, people often fade the screen out and back in. Frictional did this in the water cellar map with the water monster. If you don't do anything to control the movement of the player, it's going to look choppy. You can try forcing them to look in a certain direction using the StartPlayerLookAt function, or perhaps just make them faint or so.

But if you rotated the PlayerStartArea with the small blue arrow pointing in the direction you want the player to look, I don't see why the player doesn't look that way. He should unless something interupted it.

02-14-2014, 09:35 AM
Find
Horrorable Offline
Junior Member

Posts: 7
Threads: 2
Joined: Feb 2014
Reputation: 0
#4
RE: Teleporting Jolts & Player Position Variables

(02-14-2014, 09:35 AM)Mudbill Wrote: Teleporting players can be difficult to make appear seamless. To make it look a little more smooth, people often fade the screen out and back in. Frictional did this in the water cellar map with the water monster. If you don't do anything to control the movement of the player, it's going to look choppy. You can try forcing them to look in a certain direction using the StartPlayerLookAt function, or perhaps just make them faint or so.

But if you rotated the PlayerStartArea with the small blue arrow pointing in the direction you want the player to look, I don't see why the player doesn't look that way. He should unless something interupted it.

Ah OK- Maybe I'll just have to put heavy black fog and hope they don't notice the transition. The reason I can't just rotate the PlayerStartArea is because the direction it's pointing in has to change. If the player backs into Hallway 1 then they blue arrow would have to be pointing a different direction than if he walked straight into it.
What I planned to do was record the player's exact position/head position and then teleport him say 50 blocks over. Then restore the exact position (with 50 blocks added to his world position) and restore his head position exactly. But it seem's there are no functions for calling on the player's position, and no way to get that information.

BTW big fan of yours Mudbill Smile
02-14-2014, 04:34 PM
Find
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#5
RE: Teleporting Jolts & Player Position Variables

You can use if statements and script areas to check where the player is, and then teleport him to different PlayerStartAreas in the hallway depending on what the if statements and script areas return.

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
02-14-2014, 04:42 PM
Find
Horrorable Offline
Junior Member

Posts: 7
Threads: 2
Joined: Feb 2014
Reputation: 0
#6
RE: Teleporting Jolts & Player Position Variables

Basically what would be best would be if there was some function like
GetEntityPosition("Variable", "variable", "variable")
void TeleportPlayer("Variable + 50", "variable + 50", "variable + 50")
Where get entity position puts the players xyz coordinates into the variables
02-14-2014, 04:43 PM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#7
RE: Teleporting Jolts & Player Position Variables

but there isnt as far as i know, you could make 3 or 4 area and if they walk into that into area a then they get teleported to area a(2) in the second hallway. Fixes the sneaking along the wall problem.

02-14-2014, 04:55 PM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#8
RE: Teleporting Jolts & Player Position Variables

What if the one changing it's the level and not the player?

02-14-2014, 10:58 PM
Find
Horrorable Offline
Junior Member

Posts: 7
Threads: 2
Joined: Feb 2014
Reputation: 0
#9
RE: Teleporting Jolts & Player Position Variables

(02-14-2014, 10:58 PM)Amn Wrote: What if the one changing it's the level and not the player?

Not sure I understand what you mean. Are you suggesting switching the map instead of just moving the player? That wouldn't work because there would be a loading screen. Or do you mean somehow move the map instead of the player? I'm not sure how that would work...

(02-14-2014, 04:55 PM)WIWWM Wrote: but there isnt as far as i know, you could make 3 or 4 area and if they walk into that into area a then they get teleported to area a(2) in the second hallway. Fixes the sneaking along the wall problem.

Yeah this is what I'm working with right now. There's still a jolt but much smaller. Also if they are midjump during the teleport they suddenly find themselves on the ground again. If no one else can figure out a better way I guess I'll just add a lot of black fog and just hope they don't notice the small jolt from this method. Not sure how to fix the jumping problem.
(This post was last modified: 02-15-2014, 12:13 AM by Horrorable.)
02-14-2014, 11:09 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#10
RE: Teleporting Jolts & Player Position Variables

You can just disable the jump at that time using SetPlayerJumpDisabled(true);

02-15-2014, 12:18 AM
Find




Users browsing this thread: 1 Guest(s)