Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting problem please help
ModestWalrus Offline
Junior Member

Posts: 26
Threads: 3
Joined: Jan 2012
Reputation: 0
#1
Scripting problem please help

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()
{

}

[Image: modestwalrus.gif]
02-12-2012, 06:52 PM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Scripting problem please help

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

Tutorials: From Noob to Pro
02-12-2012, 08:24 PM
Website Find
ModestWalrus Offline
Junior Member

Posts: 26
Threads: 3
Joined: Jan 2012
Reputation: 0
#3
RE: Scripting problem please help

(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 ()
{
}
(This post was last modified: 02-13-2012, 03:41 AM by ModestWalrus.)
02-13-2012, 03:39 AM
Website Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
RE: Scripting problem please help

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.

02-13-2012, 04:03 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
RE: Scripting problem please help

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

from now on :>

02-13-2012, 04:41 AM
Find




Users browsing this thread: 1 Guest(s)