Frictional Games Forum (read-only)
[SCRIPT] A problem with doors - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] A problem with doors (/thread-18062.html)



A problem with doors - The chaser - 08-31-2012

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.


RE: A problem with doors - FlawlessHappiness - 08-31-2012

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);


RE: A problem with doors - The chaser - 08-31-2012

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


RE: A problem with doors - FlawlessHappiness - 08-31-2012

No problem ^_^


RE: A problem with doors - i3670 - 08-31-2012

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


RE: A problem with doors - The chaser - 09-01-2012

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