Frictional Games Forum (read-only)
Amensia Script Error Expected '(' or ',' - 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: Amensia Script Error Expected '(' or ',' (/thread-14759.html)



Amensia Script Error Expected '(' or ',' - Loquendostrogg - 04-13-2012

Hey guys at frictional games Forums. After seeing the millions of possibilities of the amensia's level editor and playing lots of custom stories; I decided to make my own Custom. I got excelent with the level editor, I got perfect with the .lang file. What causes me trouble is the scripting, it's not really hard, but, when I try to put the callback scripts, it gives me this error: Expected ')' or ','. So if you could help me I will be very grateful.

Here's the script:

//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts


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

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "scareArea1", "func_slam", true, 1);

StartPlayerLookAt("LookArea1", 2, 2, "");


AddTimer("donelook", 2.5f, "TimerDoneLookAt");
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Mansiondoor1", true, true);

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



AddEntityCollideCallback("Player","ScriptArea_1","function1" true, 1);
}


////////// Callback Functions!!!

void function1(string &in asParent, string &in asChild, int alState)
{
SetPlayerSanity(true "100");
}
////////////////////////////
// Run when map is loaded
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
SetupLoadScreen("Loading", "", 1, "Loading_Level_Picture.jpg");
}



RE: Amensia Script Error Expected '(' or ',' - Unearthlybrutal - 04-13-2012

Spoiler below!
void TimerDoneLookAt(string &in asTimer)
{
StopPlayerLookAt();
}

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "scareArea1", "func_slam", true, 1);

StartPlayerLookAt("LookArea1", 2, 2, "");


AddTimer("donelook", 2.5f, "TimerDoneLookAt");
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Mansiondoor1", true, true);

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



AddEntityCollideCallback("Player","ScriptArea_1","function1" true, 1);
}


////////// Callback Functions!!!

void function1(string &in asParent, string &in asChild, int alState)
{
SetPlayerSanity(true "100");
}
////////////////////////////
// Run when map is loaded
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
SetupLoadScreen("Loading", "", 1, "Loading_Level_Picture.jpg");
}




Smile Replace the red part with: SetPlayerSanity(100);



RE: Amensia Script Error Expected '(' or ',' - Loquendostrogg - 04-13-2012


thnaks, you fixed me a problem, but in the AddEntityCollideCallback("Player","ScriptArea_1","function1" true, 1); it still gives me Expected ')' and ',' FATAL ERROR





RE: Amensia Script Error Expected '(' or ',' - Cranky Old Man - 04-13-2012

(04-13-2012, 09:38 PM)Loquendostrogg Wrote: thnaks, you fixed me a problem, but in the AddEntityCollideCallback("Player","ScriptArea_1","function1" true, 1); it still gives me Expected ')' and ',' FATAL ERROR
Yes, obviously. Check the line yourself and you'll spot the missing comma.




RE: Amensia Script Error Expected '(' or ',' - Loquendostrogg - 04-13-2012

(04-13-2012, 09:42 PM)Cranky Old Man Wrote: Yes, obviously. Check the line yourself and you'll spot the missing comma.

IT WORKS!!! IT WORKS!!!! THNKS, THANK YOU!!!! THANK YOU!!!!! :'D