Frictional Games Forum (read-only)
Going to the next map - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: SOMA (https://www.frictionalgames.com/forum/forum-55.html)
+--- Forum: User created content (https://www.frictionalgames.com/forum/forum-79.html)
+---- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-80.html)
+---- Thread: Going to the next map (/thread-31390.html)



Going to the next map - Seneth - 10-20-2015

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", "", "");


RE: Going to the next map - WALP - 10-20-2015

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.


RE: Going to the next map - Seneth - 10-20-2015

(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", "", "");
}


RE: Going to the next map - Mudbill - 10-20-2015

Add a debug message inside your timer to check if the line is ever ran.


RE: Going to the next map - WALP - 10-20-2015

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.