Frictional Games Forum (read-only)
Scripting problem please help - 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: Scripting problem please help (/thread-13281.html)



Scripting problem please help - ModestWalrus - 02-12-2012

I made this script and it has an error saying
main (22,1) : ERR : Unexpected end of file
-------------------
Heres my script
----------------


void OnEnter ()
/////////////////////////////////////////////////////////
{
AddEntityCollideCallback("Player", "hallway1", "statuemanspawns", true, 1);

void statuemanspawns(string &in asParent, string &in asChild, int alState);
{
SetEntityActive("statueman1", true);
PlaySoundAtEntity("", "react_breath4.ogg", "Player", 0.5, false);
StartPlayerLookAt("statueman1", 15, 15, "");
}
AddTimer("", 1.0f, "Stoplooking");
void Stoplooking(string &in asTimer);
{
StopPlayerLookAt();
}
////////////////////////////////////
void OnLeave()
{

}


RE: Scripting problem please help - Your Computer - 02-12-2012

You forgot to close OnEnter and AddTimer is out of place.


RE: Scripting problem please help - ModestWalrus - 02-13-2012

(02-12-2012, 08:24 PM)Your Computer Wrote: You forgot to close OnEnter and AddTimer is out of place.
Now I have this and it wont open
FATAL ERROR
main (2,1) : ERR : Expected , or ;


void OnEnter ()
}
{
AddEntityCollideCallback("Player", "hallway1", "statuemanspawns", true, 1);
void statuemanspawns(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("statueman1", true);
PlaySoundAtEntity("", "react_breath.sfn", "Player", 0.5, false);
StartPlayerLookAt("statueman1", 15, 15, "");
AddTimer("", 1.0f, "Stoplooking");
void Stoplooking(string &in asTimer)
{
StopPlayerLookAt();
}
}
//-------------------------------------------------------
void OnLeave ()
{
}


RE: Scripting problem please help - Tanshaydar - 02-13-2012

A function block should be like that:
void FunctionName( parameter 1, parameter 2)
{
statements;
}

If you look at your OnEnter function, it has }{ instead of {}

You have to open the block with { and close it with }
Your code will give many errors as it is now, even if you fix only OnEnter.


RE: Scripting problem please help - flamez3 - 02-13-2012

And post this here: http://www.frictionalgames.com/forum/forum-39.html

from now on :>