Frictional Games Forum (read-only)

Full Version: Going to the next map
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have big problem. I can't go to another map with this scriptSad
Can you help me?
Map_ChangeMap("02_Generators.hpm", "PlayerStartArea_1", "", "", "");
Map_ChangeMap("02_Generators.hpm", "PlayerStartArea_1", "", "");
The function is the way it should be, the problem is not with it, but either another part of your script or something external. Try pasting us the entirety of your script.
(10-20-2015, 01:50 PM)WALP Wrote: [ -> ]The function is the way it should be, the problem is not with it, but either another part of your script or something external. Try pasting us the entirety of your script.
ll my scripts work good but this changemap no Big Grin
I try one change and then second, and in this script i use both without effect...
Everything work (fade,Imagetrail, but not changemap Sad
--------------------------------
///END OF THE MAP
bool EndOfTheMap(const tString &in asParent, const tString &in asChild, int alState)
{
Entity_SetActive("TriggerArea_10",false);
Effect_Fade_Out(2.0f);
Effect_ImageTrail_FadeOut(1,10.0f);
Map_AddTimer("",3.0f,"EndMapTimer");
return true;
}
void EndMapTimer(const tString &in asTimer)
{
Map_ChangeMap("02_Generators.hpm", "PlayerStartArea_1", "", "");
}
Add a debug message inside your timer to check if the line is ever ran.
I assume you only typed the changemap twice, to show you tried both versions of the fucntion, because you definitely should only use one.

If Fade_Out and image trail are running that indicates bool EndOfTheMap works, but we have no indication that EndMapTimer works, which I am guessing is the problem. This function is being called by a timer, which has not been given a name, and I think one might be required.

Maybe try this:

PHP Code:
bool EndOfTheMap(const tString &in asParent, const tString &in asChildint alState)
{
Effect_Fade_Out(2.0f); 
Effect_ImageTrail_FadeOut(1,10.0f);
Map_AddTimer("EndMapTimer",3.0f,"EndMapTimerFunc");    
return 
false;
}
void EndMapTimerFunc(const tString &in asTimer)
{
cLux_AddDebugMessage("changing map");
Map_ChangeMap("02_Generators.hpm""PlayerStartArea_1""""");    


I also just changed it to return false, so the function only calls once, and you dont need to disable the trigger area manually.