Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Scripting help
Author Message
Turner64 Offline
Junior Member

Posts: 4
Joined: Apr 2012
Reputation: 0
Post: #1
Scripting help
Hi, I have had this scripting problem for a while now and I have been searching on the internet for solutions but I have not yet found one. I have turned to this website for a solution, I'm hoping someone here can help me. My scripting looks all right but when I get on Amnesia: The Dark Descent I get a FATAL ERROR: (29,1) unexpected token '{' I will post my script below.

void OnStart()
{
SetEntityPlayerInteractCallback("lantern_1", "ActivateMonster", true);
}

void OnEnter()
{

}

void OnLeave()
{

}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "Idle");
}
////////////////////////////
//void OnStart()
{
AddEntityCollideCallback("Player", "push", "Push", true, 1);
AddEntityCollideCallback("Player", "door_slam", "Slam", true, 1);
}


void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(30000, 0, 0, false);
}


void Slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_12", true, true);
SetSwingDoorLocked("mansion_12", true, true);
PlaySoundAtEntity("", "00_laugh.snt", "door_scare", 0, false);
}

void OnEnter()
{

}

void OnLeave()
{

}
04-14-2012 11:05 PM
Find all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 925
Joined: Apr 2012
Reputation: 37
Post: #2
RE: Scripting help
"//void OnStart()"

Noob scripting tutorial: From Noob to Pro

04-14-2012 11:07 PM
Find all posts by this user Quote this message in a reply
Xanthos Offline
Senior Member

Posts: 322
Joined: Mar 2012
Reputation: 8
Post: #3
RE: Scripting help
Why is there two of the
OnStart
OnLeave
OnEnter
?
EDIT: Or is it two scripts?

(This post was last modified: 04-14-2012 11:09 PM by Xanthos.)
04-14-2012 11:08 PM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #4
RE: Scripting help
Is this the same script file? because you can only have 1 of OnStart, OnEnter and OnLeave

04-14-2012 11:09 PM
Find all posts by this user Quote this message in a reply
Turner64 Offline
Junior Member

Posts: 4
Joined: Apr 2012
Reputation: 0
Post: #5
RE: Scripting help
It's two scripts in one hps folder for the same map.
oh ok so what your saying is I need two hps folders for one map?
(This post was last modified: 04-14-2012 11:13 PM by Turner64.)
04-14-2012 11:11 PM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #6
RE: Scripting help
No it's supposed to look like this:


void OnStart()
{
SetEntityPlayerInteractCallback("lantern_1", "ActivateMonster", true);
AddEntityCollideCallback("Player", "push", "Push", true, 1);
AddEntityCollideCallback("Player", "door_slam", "Slam", true, 1);
}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "Idle");
}

void Push(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "push", 0, false);
AddPlayerBodyForce(30000, 0, 0, false);
}

void Slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_12", true, true);
SetSwingDoorLocked("mansion_12", true, true);
PlaySoundAtEntity("", "00_laugh.snt", "door_scare", 0, false);
}

void OnEnter()
{

}

void OnLeave()
{

}

(This post was last modified: 04-14-2012 11:16 PM by SilentStriker.)
04-14-2012 11:16 PM
Find all posts by this user Quote this message in a reply
Cranky Old Man Offline
Posting Freak

Posts: 925
Joined: Apr 2012
Reputation: 37
Post: #7
RE: Scripting help
(04-14-2012 11:11 PM)Turner64 Wrote:  It's two scripts in one hps folder for the same map.
oh ok so what your saying is I need two hps folders for one map?
What we're saying is that you should merge them, because you can only have one function of each. What on earth are "hps folders"??

Noob scripting tutorial: From Noob to Pro

04-14-2012 11:18 PM
Find all posts by this user Quote this message in a reply
Turner64 Offline
Junior Member

Posts: 4
Joined: Apr 2012
Reputation: 0
Post: #8
RE: Scripting help
It work!!! Thank you all who help me with this promblem and SilentStriker thank you for putting a working script up for me.
04-15-2012 12:10 AM
Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 939
Joined: Jul 2011
Reputation: 39
Post: #9
RE: Scripting help
You're welcome Smile

04-15-2012 12:11 AM
Find all posts by this user Quote this message in a reply
Turner64 Offline
Junior Member

Posts: 4
Joined: Apr 2012
Reputation: 0
Post: #10
RE: Scripting help
SilentStriker Ill message you if i need anything else is that alright?
04-15-2012 12:13 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)