Frictional Games Forum (read-only)
Map Transitions - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Map Transitions (/thread-4779.html)



Map Transitions - Chilton - 09-27-2010

Before i begin, this may have already been stated somewere, but the search tool yielded far far far too many results when i searched for it, so i apologise if this has been stated.

My question is, how to you make an Area Script or somesuch thing to move you to another map? Or more accurately, what should the script look like?
I tried using an entity callback, but either i did something wrong, or the engine doesnt like callbacks leading to functions...

Any aid is much appreciated


RE: Map Transitions - Equil - 09-27-2010

Have you tried using the function:
Code:
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);



RE: Map Transitions - Chilton - 09-27-2010

(09-27-2010, 05:49 AM)Equil Wrote: Have you tried using the function:
Code:
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);

Yes, i have the function, but how to i make that function relevant to a particular area?

EDIT: Ie, how do i make it apply to a door, or Area Script?


RE: Map Transitions - Equil - 09-27-2010

In your OnStart() put
Code:
AddEntityCollideCallback("Player", "<NameOfArea>", "<FunctionToCall>", true, 1);

So it should look something like:
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "<NameOfArea>", "<FunctionToCall>", true, 1);
}

void FunctionToCall(string &in asParent, string &in asChild, int alState)
{
ChangeMap("<MapToChangeTo>", string& asStartPos, string& asStartSound, string& asEndSound);
}

Hope this helps.


RE: Map Transitions - Chilton - 09-27-2010

(09-27-2010, 06:07 AM)Equil Wrote: In your OnStart() put
Code:
AddEntityCollideCallback("Player", "<NameOfArea>", "<FunctionToCall>", true, 1);

So it should look something like:
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "<NameOfArea>", "<FunctionToCall>", true, 1);
}

void FunctionToCall[u](string &in asParent, string &in asChild, int alState)[/u]
{
ChangeMap("<MapToChangeTo>", string& asStartPos, string& asStartSound, string& asEndSound);
}

Hope this helps.

Worked a charm - Thankyou kindly - The underline is what i missed


RE: Map Transitions - Equil - 09-27-2010

No problem, glad to help. Smile