Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Leaving map script
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#1
Leaving map script

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.
(This post was last modified: 08-28-2011, 12:55 PM by SilentStriker.)
08-28-2011, 12:54 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#2
RE: Leaving map script

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


Ba-da bing, ba-da boom.
08-28-2011, 02:11 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#3
RE: Leaving map script

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);
}
(This post was last modified: 08-28-2011, 02:48 PM by SilentStriker.)
08-28-2011, 02:48 PM
Find
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#4
RE: Leaving map script

You forgot the ); at the end of your AddTimer.
08-28-2011, 03:14 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#5
RE: Leaving map script

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", "", "");
}
08-28-2011, 03:18 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#6
RE: Leaving map script

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

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.

(This post was last modified: 08-28-2011, 03:23 PM by Kyle.)
08-28-2011, 03:21 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#7
RE: Leaving map script

Now i got it to work Smile
08-28-2011, 03:21 PM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#8
RE: Leaving map script

(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?

08-28-2011, 03:23 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#9
RE: Leaving map script

floor was the name of the new map Smile
08-28-2011, 03:27 PM
Find
MegaScience Offline
Member

Posts: 213
Threads: 1
Joined: Aug 2011
Reputation: 2
#10
RE: Leaving map script

Can't wait to play the level Floor. Big Grin
08-28-2011, 03:39 PM
Find




Users browsing this thread: 6 Guest(s)