Frictional Games Forum (read-only)

Full Version: Scripting problem please help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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()
{

}
You forgot to close OnEnter and AddTimer is out of place.
(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 ()
{
}
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.
And post this here: http://www.frictionalgames.com/forum/forum-39.html

from now on :>