| 
		
	
		| Coolfromdah00d   Junior Member
 
 Posts: 38
 Threads: 5
 Joined: Mar 2013
 Reputation: 
0
 | 
			| Script Problems 
 
				Alright so I've just started with my first custom story. I've entered the hps codes I need but everytime I open the custom story to try it says unexpected error  main (11,1):err:unexpected tokenmain (10,15):err:expected identifier
 
 My script file looks like this:
 
 
 void OnStart ()
 {
 AddUseItemCallBack("", "GuestRoomKey", "door01", "UsedKeyOnDoor", true);
 }
 
 void UsedKeyOnDoor(string &in asItem, string &in asEntity
 {
 SetSwingDoorLocked("door01", false, true);
 PlaySoundAtEntity"", "Unlock_door", "door01", 0, false);
 RemoveItem("GuestRoomKey");
 }
 
 void OnEnter()
 {
 
 }
 
 void OnLeave()
 {
 
 }
 |  |  
	| 03-04-2013, 04:10 PM |  |  
	
		| darksky   Member
 
 Posts: 52
 Threads: 8
 Joined: Nov 2012
 Reputation: 
2
 | 
			| RE: Script Problems 
 
				PlaySoundAtEntity("", "Unlock_door", "door01", 0, false);
			 |  |  
	| 03-04-2013, 04:52 PM |  |  
	
		| Coolfromdah00d   Junior Member
 
 Posts: 38
 Threads: 5
 Joined: Mar 2013
 Reputation: 
0
 | 
			| RE: Script Problems 
 
				 (03-04-2013, 04:52 PM)darksky Wrote:  PlaySoundAtEntity("", "Unlock_door", "door01", 0, false); 
thank you
 
  (03-04-2013, 05:09 PM)Coolfromdah00d Wrote:   (03-04-2013, 04:52 PM)darksky Wrote:  PlaySoundAtEntity("", "Unlock_door", "door01", 0, false); thank you
 
Now I just get unexpected end of file...
			 
				
(This post was last modified: 03-04-2013, 05:11 PM by Coolfromdah00d.)
 |  |  
	| 03-04-2013, 05:09 PM |  |  
	
		| ExpectedIdentifier   Member
 
 Posts: 234
 Threads: 10
 Joined: Sep 2012
 Reputation: 
11
 | 
			| RE: Script Problems 
 
				You need a bracket at the end of:void UsedKeyOnDoor(string &in asItem, string &in asEntity
 |  |  
	| 03-04-2013, 05:16 PM |  |  
	
		| Coolfromdah00d   Junior Member
 
 Posts: 38
 Threads: 5
 Joined: Mar 2013
 Reputation: 
0
 | 
			| RE: Script Problems 
 
				 (03-04-2013, 05:16 PM)sonataarctica Wrote:  You need a bracket at the end of:void UsedKeyOnDoor(string &in asItem, string &in asEntity
 
Yeah I saw that but now I get this instead. 
 
main (3,5) ERR: No matching signatures to 
AddUseItemCallBack(string@&,string@&,string@&,string@&, const bool
			 |  |  
	| 03-04-2013, 05:49 PM |  |  
	
		| ExpectedIdentifier   Member
 
 Posts: 234
 Threads: 10
 Joined: Sep 2012
 Reputation: 
11
 | 
			| RE: Script Problems 
 
				It's because you've written AddUseItemCallback as AddUseItemCallBack. Make the B lowercase and it'll work. And use this page from now on to make sure you get the syntax right:Engine scripts [Frictional Game Wiki] 
You need to understand the basics of how scripting works otherwise you're just going to keep running into these problems. I'd suggest reading some tutorials, there are loads linked on the page I just linked.
			 |  |  
	| 03-04-2013, 06:03 PM |  |  
	
		| Coolfromdah00d   Junior Member
 
 Posts: 38
 Threads: 5
 Joined: Mar 2013
 Reputation: 
0
 | 
			| RE: Script Problems 
 
				 (03-04-2013, 06:03 PM)sonataarctica Wrote:  It's because you've written AddUseItemCallback as AddUseItemCallBack. Make the B lowercase and it'll work. And use this page from now on to make sure you get the syntax right:
 Engine scripts [Frictional Game Wiki]
 
 
 You need to understand the basics of how scripting works otherwise you're just going to keep running into these problems. I'd suggest reading some tutorials, there are loads linked on the page I just linked.
 
thank you 
 ¨ 
I'll use that page whenever I get a new problem
			 |  |  
	| 03-04-2013, 06:58 PM |  |  
	
		| Coolfromdah00d   Junior Member
 
 Posts: 38
 Threads: 5
 Joined: Mar 2013
 Reputation: 
0
 | 
			| RE: Script Problems 
 
				Alright I've got another problem now... I just keep getting the unexpected token error when I try to set up my jumpscare. I need some help here again...
 {
 SetEntityCallbackFunc("GuestRoomKey", "jump");
 }
 
 void jump(string &in asEntity, string &in type)
 
 {
 SetEntityActive("corpse01", true);
 PlaySoundAtEntity("", "21_screams.snt", "corpse01", 0, false);
 }
 |  |  
	| 03-05-2013, 08:34 PM |  |  
	
		| darksky   Member
 
 Posts: 52
 Threads: 8
 Joined: Nov 2012
 Reputation: 
2
 | 
			| RE: Script Problems 
 
				what's the exact error message?
			 |  |  
	| 03-05-2013, 10:19 PM |  |  
	
		| Coolfromdah00d   Junior Member
 
 Posts: 38
 Threads: 5
 Joined: Mar 2013
 Reputation: 
0
 | 
			| RE: Script Problems 
 
				 (03-05-2013, 10:19 PM)darksky Wrote:  what's the exact error message? 
unexpected token {
			 |  |  
	| 03-06-2013, 03:47 PM |  |  |