Frictional Games Forum (read-only)
Leaving map script - 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: Leaving map script (/thread-10025.html)

Pages: 1 2


Leaving map script - SilentStriker - 08-28-2011

I need help with something (if it's possible)

I want the character's vision to fade to black and then I want to change map. Is that possible? So it's going to be like he like faints and then wake up in another place.


RE: Leaving map script - JenniferOrange - 08-28-2011

It is very possible!
You just have to use ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); and void FadeOut(float afTime);.
Create a script area that the player will collide with to trigger your blackout. Use AddEntityCollideCallback making the entity Player and the entity it collides with the name of your script area. Name the function anything you'd like. Under void FunctionName, add FadeOut and ChangeMap. You can find every function I mentioned in the script functions page. Smile (also your holy bible) http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#game_scripts




RE: Leaving map script - SilentStriker - 08-28-2011

Will this work? Smile

void CollideCorridorFive(string &in asParent, string &in asChild, int alState)
{
FadeOut(1);
PlaySoundAtEntity("Fade_Screen_Sound", "grunt/enabled", "Player", 0, true);
AddTimer("Loadmap", 1.5f, "Loadmap"
}

void Loadmap(string &in asParent, string &in asChild, int alState)
{
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
}


RE: Leaving map script - MegaScience - 08-28-2011

You forgot the ); at the end of your AddTimer.


RE: Leaving map script - SilentStriker - 08-28-2011

Yes I know i changed it in the script but I strange enough still can't get it to change map.. :/ this is how my script looks like
void CollideCorridorSix(string &in asParent, string &in asChild, int alState)
{
FadeOut(1);
PlaySoundAtEntity("Fade_Screen_Sound", "grunt/enabled", "Player", 0, true);
AddTimer("Loadmap", 1.5f, "Loadmap");
}

void Loadmap(string &in asParent, string &in asChild, int alState)
{
ChangeMap("floor", "PlayerStartArea_2", "", "");
}


RE: Leaving map script - Kyle - 08-28-2011

It appears some people don't know how to tell what to do correctly... :/

Code:
void CollideCorridorSix(string &in asParent, string &in asChild, int alState)
{
     FadeOut(1);
     PlaySoundAtEntity("", "enabled01.snt", "Player", 0, false);
     AddTimer("", 1.5, "Loadmap");
}
void Loadmap(string &in asTimer)
{
     ChangeMap("floor.map", "PlayerStartArea_2", "", "");
}

If the rest of your script is right, then it should work.


RE: Leaving map script - SilentStriker - 08-28-2011

Now i got it to work Smile


RE: Leaving map script - Henriksen - 08-28-2011

(08-28-2011, 03:18 PM)SilentStriker Wrote: Yes I know i changed it in the script but I strange enough still can't get it to change map.. :/ this is how my script looks like
void CollideCorridorSix(string &in asParent, string &in asChild, int alState)
{
FadeOut(1);
PlaySoundAtEntity("Fade_Screen_Sound", "grunt/enabled", "Player", 0, true);
AddTimer("Loadmap", 1.5f, "Loadmap");
}

void Loadmap(string &in asParent, string &in asChild, int alState)
{
ChangeMap("floor", "PlayerStartArea_2", "", "");
}

Is the new map called "floor"? Or is the PlayerStartArea in the same map as the one you fade out in?




RE: Leaving map script - SilentStriker - 08-28-2011

floor was the name of the new map Smile


RE: Leaving map script - MegaScience - 08-28-2011

Can't wait to play the level Floor. Big Grin