Frictional Games Forum (read-only)
Teleport the player when he collides an area - 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: Teleport the player when he collides an area (/thread-17492.html)



Teleport the player when he collides an area - KingCrimson - 08-05-2012

Hi there, my problem is that my player has to sleep to go to the other levels, so i put a script area on the bed so when the player gets on it, it gets teleported to another map. But i can't think the script. How should it be? Is it possible to do it?

Thanks in advance


RE: Teleport the player when he collides an area - EXAWOLT - 08-05-2012

http://wiki.frictionalgames.com/hpl2/amnesia/script_functions
everything is in the forum!
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
=the script


RE: Teleport the player when he collides an area - KingCrimson - 08-05-2012

Thanks, it was very useful


RE: Teleport the player when he collides an area - Melvin - 08-06-2012

(08-05-2012, 01:05 AM)ExenderVes Wrote: Thanks, it was very useful
Can you tell me how you did it? I can't seem to figure out were to put


void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);


My next problem is: how does the script know what areas I want to use??
(the callback code perhaps?)


-SmokeMelvin


RE: Teleport the player when he collides an area - lolmaster - 08-07-2012

There are lots of ways to incorporate ChangeMap.

Code:
AddTimer(string& asName, float afTime, string& asFunction);

Code:
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);

Code:
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);