| 
		
	
		| Turner64   Junior Member
 
 Posts: 4
 Threads: 1
 Joined: Apr 2012
 Reputation: 
0
 | 
			| 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 |  |  
	
		| Cranky Old Man   Posting Freak
 
 Posts: 986
 Threads: 20
 Joined: Apr 2012
 Reputation: 
38
 | 
			| RE: Scripting help 
 
				"//void OnStart()"
 
 
 
 |  |  
	| 04-14-2012, 11:07 PM |  |  
	
		| Xanthos   Senior Member
 
 Posts: 318
 Threads: 9
 Joined: Mar 2012
 Reputation: 
8
 | 
			| RE: Scripting help 
 
				Why is there two of theOnStart
 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 |  |  
	
		| SilentStriker   Posting Freak
 
 Posts: 950
 Threads: 26
 Joined: Jul 2011
 Reputation: 
43
 | 
			| 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 |  |  
	
		| Turner64   Junior Member
 
 Posts: 4
 Threads: 1
 Joined: Apr 2012
 Reputation: 
0
 | 
			| 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 |  |  
	
		| SilentStriker   Posting Freak
 
 Posts: 950
 Threads: 26
 Joined: Jul 2011
 Reputation: 
43
 | 
			| 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 |  |  
	
		| Cranky Old Man   Posting Freak
 
 Posts: 986
 Threads: 20
 Joined: Apr 2012
 Reputation: 
38
 | 
			| 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"??
			 
 |  |  
	| 04-14-2012, 11:18 PM |  |  
	
		| Turner64   Junior Member
 
 Posts: 4
 Threads: 1
 Joined: Apr 2012
 Reputation: 
0
 | 
			| 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 |  |  
	
		| SilentStriker   Posting Freak
 
 Posts: 950
 Threads: 26
 Joined: Jul 2011
 Reputation: 
43
 | 
			| RE: Scripting help 
 
				You're welcome   
 |  |  
	| 04-15-2012, 12:11 AM |  |  
	
		| Turner64   Junior Member
 
 Posts: 4
 Threads: 1
 Joined: Apr 2012
 Reputation: 
0
 | 
			| RE: Scripting help 
 
				SilentStriker Ill message you if i need anything else is that alright?
			 |  |  
	| 04-15-2012, 12:13 AM |  |  |