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


Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make player teleport when touching item?
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#1
How to make player teleport when touching item?

So how because i have no idea..

I tried to Teleport function and combine item with that but not working..

Somebody give me example?

Thanks.

“Life is a game, play it”
04-08-2011, 03:44 PM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#2
RE: How to make player teleport when touching item?

Don't use combine item, use SetEntityPlayerInteractCallback. Then, when they interact with the item (pick it up, carry it, etc.) they will be teleported.

04-08-2011, 04:08 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#3
RE: How to make player teleport when touching item?

(04-08-2011, 04:08 PM)Anxt Wrote: Don't use combine item, use SetEntityPlayerInteractCallback. Then, when they interact with the item (pick it up, carry it, etc.) they will be teleported.

Uhm.. Can you show me example script for teleporting when touching or picking up item?

“Life is a game, play it”
04-08-2011, 04:25 PM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#4
RE: How to make player teleport when touching item?

void OnStart()
{
SetEntityPlayerInteractCallback("key", "Stuff", true);
}
void Stuff(string &in asEntity)
{
TeleportPlayer("PlayerStartArea");
}

04-08-2011, 05:06 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#5
RE: How to make player teleport when touching item?

Thanks but one thing how i can add there when player is teleporting he scares and fades like timer... Now its only changing area quick when i pick lantern..

“Life is a game, play it”
04-08-2011, 06:07 PM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#6
RE: How to make player teleport when touching item?

Use a timer instead of directly teleporting the player. When the player picks up the lantern, use the FadeOut function and set the timer to the same time as the fadeout. Then, have the timer call a function that teleports the player and fades back in.

04-08-2011, 06:15 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#7
RE: How to make player teleport when touching item?

(04-08-2011, 06:15 PM)Anxt Wrote: Use a timer instead of directly teleporting the player. When the player picks up the lantern, use the FadeOut function and set the timer to the same time as the fadeout. Then, have the timer call a function that teleports the player and fades back in.

Its not working...

void Stuff(string &in asEntity)
{
TeleportPlayer("PlayerStartArea_2");
FadeIn(float 5.0f);
FadeOut(float 5.0f);
}

Complains many errors...

“Life is a game, play it”
04-08-2011, 06:24 PM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#8
RE: How to make player teleport when touching item?

Don't have the word float in your fade functions.

Also, that's not what I meant. Here's what I meant:

void OnStart()
{
SetEntityPlayerInteractCallback("key", "Stuff", true);
}

void Stuff(string &in asEntity)
{
FadeOut(5);
AddTimer("tele", 5, "Teleport");
}

void Teleport(string &in asTimer)
{
FadeIn(5);
TeleportPlayer("PlayerStartArea_2");
}

04-08-2011, 06:29 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#9
RE: How to make player teleport when touching item?

Oh good.. its working now..

Im so stupid and noob at scripting its too hard Sad

“Life is a game, play it”
04-08-2011, 06:33 PM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#10
RE: How to make player teleport when touching item?

It gets easier with time. Just be patient with it and you'll learn how to do pretty much everything.

04-08-2011, 06:43 PM
Find




Users browsing this thread: 1 Guest(s)