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
script error
mr.bonent Offline
Junior Member

Posts: 47
Threads: 13
Joined: May 2011
Reputation: 0
#1
script error

What's the wrong in this script?

Sorry but I'm new in scripting.


Quote:{
AddEntityCollideCallback("Player", "DoorClosedArea_1", "DoorClosedAndLook", true, 1);
}

void DoorClosedAndLook(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_6", true, true);
StartPlayerLookAt("mansion_6", 10.0f, 10.0f, "");
AddTimer("", 1.0f, "stoplook");
}
void stoplook(string &in asTimer)
{
StopPlayerLookAt();
}




That's the error.



Attached Files
.jpg   error.jpg (Size: 6.81 KB / Downloads: 71)
07-31-2011, 06:20 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: script error

You're missing some of your script. There aren't even 17 lines in what you posted.

Anyways, in your script, look at the the first 17 lines. There's likely a extra/missing brace somewhere.

07-31-2011, 06:59 PM
Find
mr.bonent Offline
Junior Member

Posts: 47
Threads: 13
Joined: May 2011
Reputation: 0
#3
RE: script error

Here are the missing lines.

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "BuchErscheinung", true, 1);
}

void BuchErscheinung(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("buch", true);
AddDebugMessage("buch", false);
}






{
AddEntityCollideCallback("Player", "DoorClosedArea_1", "DoorClosedAndLook", true, 1);
}

void DoorClosedAndLook(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_6", true, true);
StartPlayerLookAt("mansion_6", 10.0f, 10.0f, "");
AddTimer("", 1.0f, "stoplook");
}
void stoplook(string &in asTimer)
{
StopPlayerLookAt();
}









void OnEnter()
{
}
void OnLeave()
{
}
07-31-2011, 09:22 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#4
RE: script error

You can't make functions out of nothing, there must be the type, name, and parameters for each one. The AddEntityCollideCallback is supposed to be in the "void OnStart()" function.

void OnStart()
{
     AddEntityCollideCallback("Player", "ScriptArea_1", "BuchErscheinung", true, 1);
     AddEntityCollideCallback("Player", "DoorClosedArea_1", "DoorClosedAndLook", true, 1);
}
void BuchErscheinung(string &in asParent, string &in asChild, int alState)
{
     SetEntityActive("buch", true);
     AddDebugMessage("buch", false);
}
void DoorClosedAndLook(string &in asParent, string &in asChild, int alState)
{
     SetSwingDoorClosed("mansion_6", true, true);
     StartPlayerLookAt("mansion_6", 10.0f, 10.0f, "");
     AddTimer("", 1.0f, "stoplook");
}
void stoplook(string &in asTimer)
{
     StopPlayerLookAt();
}
void OnEnter()
{
}
void OnLeave()
{
}

07-31-2011, 09:39 PM
Find
mr.bonent Offline
Junior Member

Posts: 47
Threads: 13
Joined: May 2011
Reputation: 0
#5
RE: script error

Well thank you very much.Smile It works.
07-31-2011, 09:53 PM
Find




Users browsing this thread: 1 Guest(s)