Frictional Games Forum (read-only)
Unexpected end of file!! ;( - 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: Unexpected end of file!! ;( (/thread-10627.html)

Pages: 1 2


Unexpected end of file!! ;( - cooleoj - 10-06-2011

So i get a error when i start my map and i really suck at scripting so i could really need some help Smile



void OnStart()

{
AddEntityCollideCallback("Player", "scarearea1", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("scaredoor1", 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);

AddUseItemCallback("", "hollowneedle1", "lockeddoor1", "FUNCTION", true);

}
void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockeddoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "lockeddoor1", 0, false);
RemoveItem("hollowneedle1");

{
AddEntityCollideCallback("Player", "monstertrigger1", "MonsterFunction", "true", 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState);
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");

}


That is my script.



RE: Unexpected end of file!! ;( - Gamemakingdude - 10-06-2011

No wait. This is completely wrong! Give me 2 minutes to fix this up and please take the time to read through the code and see what was wrong!
PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""scarearea1""func_slam"true1);
    
AddEntityCollideCallback("Player""monstertrigger1""MonsterFunction""true"1); 
    
AddUseItemCallback("""hollowneedle1""lockeddoor1""FUNCTION"true);


void func_slam(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("scaredoor1"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
    
PlaySoundAtEntity("""react_scare""Player"0false); PlaySoundAtEntity("""close_door.snt""Player"0false); 
    
GiveSanityDamage(5.0ftrue);

}
void FUNCTION(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("lockeddoor1"falsetrue);
PlaySoundAtEntity("""unlock_door""lockeddoor1"0false);
RemoveItem("hollowneedle1");
}


void MonsterFunction(string &in asParentstring &in asChildint alState);
{
    
SetEntityActive("servant_grunt_1"true); 
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_9"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_10"4"");


The problem was you had code in the wrong places, put backets where they werent supposed to go to and it wasnt indented correctly..


RE: Unexpected end of file!! ;( - cooleoj - 10-06-2011

Nope...
Now it crashes and says this instead:
main (25,1) : ERR : Unexpected token '{'



RE: Unexpected end of file!! ;( - xtron - 10-06-2011

Code:
void OnStart()

{
AddEntityCollideCallback("Player", "scarearea1", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("scaredoor1", 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);
AddUseItemCallback("", "hollowneedle1", "lockeddoor1", "FUNCTION", true);
}

void FUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockeddoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "lockeddoor1", 0, false);
RemoveItem("hollowneedle1");
}

AddEntityCollideCallback("Player", "monstertrigger1", "MonsterFunction", "true", 1);
{
void MonsterFunction(string &in asParent, string &in asChild, int alState);
}

{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

This might work.

BTW: if it works, don't be mad if your script doesn't work because it's like Gamemakingdude said "completly wrong".
If you can launch your map without any errors, tell me and I can fix the script for you.



RE: Unexpected end of file!! ;( - cooleoj - 10-06-2011

main (23,25) : ERR : Expected identifier
main (24,1) : ERR : unexpected token '{'
main (28,1) : ERR : unexpected token '{'
hmmm..

BTW everything worked before i tried to add a monster script



RE: Unexpected end of file!! ;( - Gamemakingdude - 10-06-2011

PHP Code:
void OnStart()
{
    
AddEntityCollideCallback("Player""scarearea1""func_slam"true1);
    
AddEntityCollideCallback("Player""monstertrigger1""MonsterFunction""true"1); 
    
AddUseItemCallback("""hollowneedle1""lockeddoor1""FUNCTION"true);


void func_slam(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("scaredoor1"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
    
PlaySoundAtEntity("""react_scare""Player"0false); PlaySoundAtEntity("""close_door.snt""Player"0false); 
    
GiveSanityDamage(5.0ftrue);

}
void FUNCTION(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("lockeddoor1"falsetrue);
PlaySoundAtEntity("""unlock_door""lockeddoor1"0false);
RemoveItem("hollowneedle1");
}


void MonsterFunction(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"true); 
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_9"0"");
    
AddEnemyPatrolNode("servant_grunt_1""PathNodeArea_10"4"");



Fixed it i found an ; at the end of one of your procedures.


RE: Unexpected end of file!! ;( - cooleoj - 10-06-2011

main (4,5) : ERR : no matching signatures to 'AddEntityCollideCallback("Player", "monstertrigger1", "MonsterFunction", "true", 1); '
Gahhh seems i messed up some crazy shit



RE: Unexpected end of file!! ;( - Gamemakingdude - 10-06-2011

Have you got that trigger in the map by any chance and is it named right?


RE: Unexpected end of file!! ;( - cooleoj - 10-06-2011

Yes i have and its named "monstertrigger1"



RE: Unexpected end of file!! ;( - Gamemakingdude - 10-06-2011

Try changing true to false.