Frictional Games Forum (read-only)

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

}

"//void OnStart()"

Why is there two of the
OnStart
OnLeave
OnEnter
?
EDIT: Or is it two scripts?
Is this the same script file? because you can only have 1 of OnStart, OnEnter and OnLeave
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?
No it's supposed to look like this:


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

}
(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"??

It work!!! Thank you all who help me with this promblem and SilentStriker thank you for putting a working script up for me.
You're welcome Smile
SilentStriker Ill message you if i need anything else is that alright?
Pages: 1 2