Frictional Games Forum (read-only)

Full Version: Another FATAL ERROR problem :/
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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_taEkP...ata_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.
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();
}
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 '{'
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.
That did it, thanks! Forgot how tough this was :/