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
Script Help A problem with doors
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#1
A problem with doors

Hi everyone!
Well, my problem is the following one:

I want that when the player interacts with a door, it teleports. No keys, only interact.
But i don't know how to do it. Seriously, i would like to do it myself, but i don't know.
Please, my CS is almost finished but I must cover this.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-31-2012, 01:29 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: A problem with doors

SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity)
asName - internal name
asCallback - function to call
abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity

Maybe locking the door would be a good idea.
And then:

TeleportPlayer(string& asStartPosName);

Trying is the first step to success.
(This post was last modified: 08-31-2012, 01:34 PM by FlawlessHappiness.)
08-31-2012, 01:34 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: A problem with doors

Thanks, beecake. You've helped me a lot.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-31-2012, 02:11 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: A problem with doors

No problem ^_^

Trying is the first step to success.
08-31-2012, 02:15 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#5
RE: A problem with doors

To shorten the script a bit you can write the callback name in the door under the entity tab.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
08-31-2012, 02:24 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#6
RE: A problem with doors

Ok, fixed it. Thanks everyone for being so attentive!

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-01-2012, 09:54 AM
Find




Users browsing this thread: 1 Guest(s)