Frictional Games Forum (read-only)
[SCRIPT] Another FATAL ERROR problem :/ - 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] Another FATAL ERROR problem :/ (/thread-17820.html)



Another FATAL ERROR problem :/ - Dominic0904 - 08-17-2012

Ok, trying to get back into scripting for this game for a Uni Project and went onto this tutorial;
http://www.youtube.com/watch?v=M5x_taEkP8s&feature=youtube_gdata_player


Did it all but I keep getting this error and I have no idea why

FATAL ERROR: Could not load script file
'custom_stories/ExampleStory/maps/01_Scripting_Tutorial.hps'"
main (7, 28): ERR : Expected '('
main (13, 22) ERR: Expected '('

Here is the script;


void OnStart()
{
{
AddEntityCollideCallback("Player", "RoomTwoArea_01", "CollideRoomTwo", true, 1);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState);
{
SetSwingDoorClosed("castle_arched01_1", true, true);
StartPlayerLookAt("castle_arched01_1", 10.0, 10.0, "");
AddTimer("", 1.0, "StopLook");
}
void StopLook(string &in asTimer);
{
StopPlayerLookAt();
}
}



I've tried all I can, I keep looking through it and searched online but can't find a solution :/ Halp?

Thanks.


RE: Another FATAL ERROR problem :/ - Adny - 08-17-2012

You had extra open/closed brackets; also, 10 is very fast for the player look function, 2-3 is fast enough:


void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea_01", "CollideRoomTwo", true, 1);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState);
{
SetSwingDoorClosed("castle_arched01_1", true, true);
StartPlayerLookAt("castle_arched01_1", 1.5f, 2.0f, "");
AddTimer("", 1.0f, "StopLook");
}

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


RE: Another FATAL ERROR problem :/ - Dominic0904 - 08-19-2012

Now it just says;

FATAL ERROR: Could not load script file
'custom_stories/ExampleStory/maps/01_Scripting_Tutorial.hps'"
main (7, 1): ERR : Unexpected token '{'
main (14, 1) ERR: Unexpected token '{'


RE: Another FATAL ERROR problem :/ - Ongka - 08-19-2012

void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea_01", "CollideRoomTwo", true, 1);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_1", true, true);
StartPlayerLookAt("castle_arched01_1", 1.5f, 2.0f, "");
AddTimer("", 1.0f, "StopLook");
}

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

There were two semicolons at the end of the function header which shouldn't have been there.


RE: Another FATAL ERROR problem :/ - Dominic0904 - 08-19-2012

That did it, thanks! Forgot how tough this was :/