Frictional Games Forum (read-only)
When player enters script area then load next level? - 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: When player enters script area then load next level? (/thread-16336.html)



When player enters script area then load next level? - Cetex1337 - 06-20-2012

Does anyone know what the script is so that if the player enters a specific area then it loads next level / room? And that it should work just as a door (that loads the other level / room)

Please reply ASAP.


RE: When player enters script area then load next level? - Adny - 06-20-2012

TeleportPlayer(string& asStartPosName);


can be used to teleport the player to another area of the same level they're in.

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


can be used to start a new level.


RE: When player enters script area then load next level? - Traggey - 06-20-2012

You can't honestly go telling people to reply ASAP to your questions when you're not even posting them in the right section of the forum.

Moved.


RE: When player enters script area then load next level? - JMFStorm - 06-20-2012

(06-20-2012, 07:21 PM)Traggey Wrote: You can't honestly go telling people to reply ASAP to your questions when you're not even posting them in the right section of the forum.

Moved.

You can't blame a newbie ^^


RE: When player enters script area then load next level? - Cetex1337 - 06-20-2012

What should i do after with:


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

??

Any help?


RE: When player enters script area then load next level? - Cruzore - 06-20-2012

no, just fill the spaces.
Changemap("yourmapname.map", "Yourstartpos", "", "");
use a collide callback for the area and yourself, and add a custom function, where the changemap function is inside.


RE: When player enters script area then load next level? - Chronogyros - 06-20-2012

(06-20-2012, 07:16 PM)Cetex1337 Wrote: Does anyone know what the script is so that if the player enters a specific area then it loads next level / room? And that it should work just as a door (that loads the other level / room)

Please reply ASAP.
AddEntityCollideCallback("Player", "SCRIPTAREA", "FUNCTION", true, 1);





void FUNCTION(string &in asParent, string &in asChild, int alState)
{
ChangeMap("YOURMAP.map", "PlayerStartArea_1", "", "");
}


RE: When player enters script area then load next level? - Cetex1337 - 06-21-2012

(06-20-2012, 07:55 PM)Chronogyros Wrote:
(06-20-2012, 07:16 PM)Cetex1337 Wrote: Does anyone know what the script is so that if the player enters a specific area then it loads next level / room? And that it should work just as a door (that loads the other level / room)

Please reply ASAP.
AddEntityCollideCallback("Player", "SCRIPTAREA", "FUNCTION", true, 1);





void FUNCTION(string &in asParent, string &in asChild, int alState)
{
ChangeMap("YOURMAP.map", "PlayerStartArea_1", "", "");
}
Thank you so much, now i understand Smile