Frictional Games Forum (read-only)
Need help with script error - 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: Need help with script error (/thread-21923.html)



Need help with script error - liquiddr3amz - 06-25-2013

ok so i took a break from a custom story i was working on, i picked it back up, i decided (as shown in bold) i would like the door to lock after it slams shut, and then use a hollow needle to open it, does it matter if i code from bottom of my script or do i got to go back up to the middle where it is bold? i keep getting errors(when i try changing it, this script currently works) can someone please help?

void OnStart()
{
AddEntityCollideCallback("Player","scr2","monster",true,1);
AddEntityCollideCallback("jim","scr1","monsterend",true,-1);
AddEntityCollideCallback("Player", "push", "Push", true, 1);
AddEntityCollideCallback("Player", "scr_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player", "KillTheLights", "LightsOut", true, 1);
}


void monster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("jim",true);
AddEnemyPatrolNode("jim", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("jim", "PathNodeArea_8", 0, "");
}
void monsterend(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("jim",false);
}

void keyfunc(string &in asEntity, string &in type)
{
SetEntityActive("servant_brute_1",true);
GiveSanityDamage(10.0f, true);
StartPlayerLookAt("servant_brute_1",15,15,"");
AddTimer("monstertimer",2,"monstertimer");
ShowEnemyPlayerPosition("servant_brute_1");
PlayGuiSound("react/react_pant3.ogg",10.0f);
StartScreenShake(0.1f,2,0,0.6);
}


void monstertimer(string &in asTimer)
{
StopPlayerLookAt();
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
StartScreenShake(0.1f,2,0,0.3);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}

void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(0,10000, -30000, false);
}

void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("lamp_1", false, true);
AddTimer("", 1, "Out2");
}


void Out2(string &in asTimer)
{
SetLampLit("lamp_2", false, true);
AddTimer("", 1, "Out3");
}


void Out3(string &in asTimer)
{
SetLampLit("lamp_3", false, true);
AddTimer("", 1, "Out4");
}


void Out4(string &in asTimer)
{
SetLampLit("lamp_4", false, true);
AddTimer("", 1, "Out5");
}


void Out5(string &in asTimer)
{
SetLampLit("lamp_5", false, true);
AddTimer("", 1, "Out6");
}


void Out6(string &in asTimer)
{
SetLampLit("lamp_6", false, true);
AddTimer("",1,"Out7");
}

void Out7(string &in asTimer)
{
SetLampLit("lamp_7", false, true);
AddTimer("", 1, "Out8");
}


void Out8(string &in asTimer)
{
SetLampLit("lamp_8", false, true);
AddTimer("", 1, "Out9");
}


void Out9(string &in asTimer)
{
SetLampLit("lamp_9", false, true);
AddTimer("", 1, "Out10");
}


void Out10(string &in asTimer)
{
SetLampLit("lamp_10", false, true);
AddTimer("", 1, "Out11");
}


void Out11(string &in asTimer)
{
SetLampLit("lamp_11", false, true);
AddTimer("", 1, "Out12");
}


void Out12(string &in asTimer)
{
SetLampLit("lamp_12", false, true);
AddTimer("",1,"Out13");
}

void Out13(string &in asTimer)
{
SetLampLit("lamp_13", false, true);
AddTimer("", 1, "Out14");
}

void Out14(string &in asTimer)
{
SetLampLit("lamp_14", false, true);
}



RE: Need help with script error - PutraenusAlivius - 06-25-2013

It's okay. You can put any function called in the beginning everywhere.


RE: Need help with script error - Icaab2607 - 06-25-2013

And where scipt on keyfunc?


RE: Need help with script error - liquiddr3amz - 06-25-2013

ok but i when i try to put a command to lock the door i get a error, it says

token }

bla Bla what ever line its on,


RE: Need help with script error - PutraenusAlivius - 06-25-2013

(06-25-2013, 06:29 AM)liquiddr3amz Wrote: ok but i when i try to put a command to lock the door i get a error, it says

token }

bla Bla what ever line its on,

What's the command? And add it to the script and give us the contents of the function that's troublesome. Also as Icaab2607 said, where is keyfunc called?