Frictional Games Forum (read-only)
[SCRIPT] Problem With A 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: [SCRIPT] Problem With A Script (/thread-16804.html)



Problem With A Script - stjazz - 07-07-2012

Hi, i have a problem with a script. (Fatal error)
Here is my script:



void OnStart()
{
PlayMusic("ambience 1.ogg", true, 50, 5, 0, true);
AddEntityCollideCallback("Player", "noback", "noback", true, 1);
AddEntityCollideCallback("Player", "To_Under The Shadows CH3", "toUnder The Shadows CH3", true, 1);
}

void noback(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("noback1",true);
AddEnemyPatrolNode("noback1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("noback1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("noback1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("noback1", "PathNodeArea_4", 0, "");
SetEntityActive("noback2",true);
AddEnemyPatrolNode("noback2", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("noback2", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("noback2", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("noback2", "PathNodeArea_4", 0, "");
SetEntityActive("noback3",true);
SetEntityActive("noback4",true);
FadePlayerFOVMulTo(3.5f, 0.01f);
GiveSanityDamage(3.0, true);
}

void toUnder The Shadows CH3(string &in asParent, string &in asChild, int alState)
{
ChangeMap("Under The Shadows CH3.map", "from_01", "", "");
}

Thanks for the support!


RE: Problem With A Script - palistov - 07-07-2012

Can't have spaces in function names. You should be more specific about what errors your having. Post the contents of the fatal error message for future problems. Smile

PHP Code:
void toUnder_The_Shadows_CH3(...) {...} 

Do something like that. Change the string value in your entity collide callback as well. The ... is just a placeholder, by the way. Good luck.