Frictional Games Forum (read-only)

Full Version: Leaving map script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.
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/amn...me_scripts

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);
}
You forgot the ); at the end of your AddTimer.
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", "", "");
}
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.
Now i got it to work Smile
(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?

floor was the name of the new map Smile
Can't wait to play the level Floor. Big Grin
Pages: 1 2