| 
		
	
		| T122002   Junior Member
 
 Posts: 24
 Threads: 10
 Joined: Dec 2012
 Reputation: 
1
 | 
			| Error: Expected Data Type 
 
				Hi everyone! I have a question about my scripting. I've been scripting for over a year, so this shouldn't throw me off. But I took a break for a couple months and I've recently started to get back into scripting and finish my project for good. However, I forgot quite a few things. 
I recently got a new computer which can now play Amnesia at Max settings, whereas, my old computer could barely play at Medium settings. So I decided to go back and completely redesign some maps and completely change the scripting to make it look and feel more professional.  
But now I receive this error, "Expected Data Type".  
And I noticed this error randomly come after I added everything on the 'OnStart'. 
 
Here is my entire new script for my tutorial level:
//////////// void OnStart()
 {
 AddEntityCollideCallback("Sledge", "Sledgebreak", "Break", true, 1);
 AddEntityCollideCallback("Player", "ExitMessage", "Message", true, 1);
 }
 
 void Message("string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "ExitMessage", 5.0f);
 }
 
 void Break(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorLocked("Door", true, true);
 SetPropHealth("Door", 0);
 }
 
 ////////////
 void OnEnter()
 {
 AddEntityCollideCallback("Player", "Message_1", "Message_1", true, 1);
 }
 
 void Message_1(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "Welcome", 10.0f);
 SetPlayerCrouching(true);
 SetPlayerActive(false);
 StartPlayerLookAt("look1", 7, 7, "");
 AddTimer("T1", 10, "look2");
 PlayGuiSound("react_sigh.snt", 5);
 }
 
 void look2(string &in asTimer)
 
 {
 SetMessage("Messages", "aMessage", 11.0f);
 SetPlayerCrouching(true);
 SetPlayerActive(false);
 StartPlayerLookAt("look2", 7, 7, "");
 AddTimer("T2", 10, "exit");
 PlayGuiSound("react_sigh.snt", 5);
 }
 
 void exit(string &in asTimer)
 
 {
 SetMessage("Messages", "Exit", 10.0f);
 SetPlayerCrouching(false);
 SetPlayerActive(true);
 StartPlayerLookAt("exit", 7, 7, "");
 AddTimer("T3", 10, "stop");
 PlayGuiSound("react_sigh.snt", 5);
 }
 
 void stop(string &in asTimer)
 {
 StopPlayerLookAt();
 }
 
 ////////////
 void OnLeave()
 {
 
 }
 
Here is the Error Message:
FATAL ERROR: Could not load script file 'custom_stories/Amnesia A New Story/maps/tutorial01.hps'! main (66, 2): ERR: Expected Data Type
 
 
The error is right in the very last line (66, 2) where its on the 'void OnLeave{} {
 
 }'
 
I don't remember ever getting this error before. And I can't find my error anywhere. Can someone please help me out with this and how to fix it for future use?  
I'm not even finished scripting for this map yet. I was just getting ready to play test what I have so far.
 
  (07-23-2013, 07:54 AM)T122002 Wrote:  Hi everyone! I have a question about my scripting. I've been scripting for over a year, so this shouldn't throw me off. But I took a break for a couple months and I've recently started to get back into scripting and finish my project for good. However, I forgot quite a few things.
 I recently got a new computer which can now play Amnesia at Max settings, whereas, my old computer could barely play at Medium settings. So I decided to go back and completely redesign some maps and completely change the scripting to make it look and feel more professional.
 But now I receive this error, "Expected Data Type".
 And I noticed this error randomly come after I added everything on the 'OnStart'.
 
 Here is my entire new script for my tutorial level:
 
 ////////////
 void OnStart()
 {
 AddEntityCollideCallback("Sledge", "Sledgebreak", "Break", true, 1);
 AddEntityCollideCallback("Player", "ExitMessage", "Message", true, 1);
 }
 
 void Message("string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "ExitMessage", 5.0f);
 }
 
 void Break(string &in asParent, string &in asChild, int alState)
 {
 SetSwingDoorLocked("Door", true, true);
 SetPropHealth("Door", 0);
 }
 
 ////////////
 void OnEnter()
 {
 AddEntityCollideCallback("Player", "Message_1", "Message_1", true, 1);
 }
 
 void Message_1(string &in asParent, string &in asChild, int alState)
 {
 SetMessage("Messages", "Welcome", 10.0f);
 SetPlayerCrouching(true);
 SetPlayerActive(false);
 StartPlayerLookAt("look1", 7, 7, "");
 AddTimer("T1", 10, "look2");
 PlayGuiSound("react_sigh.snt", 5);
 }
 
 void look2(string &in asTimer)
 
 {
 SetMessage("Messages", "aMessage", 11.0f);
 SetPlayerCrouching(true);
 SetPlayerActive(false);
 StartPlayerLookAt("look2", 7, 7, "");
 AddTimer("T2", 10, "exit");
 PlayGuiSound("react_sigh.snt", 5);
 }
 
 void exit(string &in asTimer)
 
 {
 SetMessage("Messages", "Exit", 10.0f);
 SetPlayerCrouching(false);
 SetPlayerActive(true);
 StartPlayerLookAt("exit", 7, 7, "");
 AddTimer("T3", 10, "stop");
 PlayGuiSound("react_sigh.snt", 5);
 }
 
 void stop(string &in asTimer)
 {
 StopPlayerLookAt();
 }
 
 ////////////
 void OnLeave()
 {
 
 }
 
 
 Here is the Error Message:
 
 FATAL ERROR: Could not load script file 'custom_stories/Amnesia A New Story/maps/tutorial01.hps'!
 main (66, 2): ERR: Expected Data Type
 
 
 The error is right in the very last line (66, 2) where its on the 'void OnLeave{}
 {
 
 }'
 
 
 I don't remember ever getting this error before. And I can't find my error anywhere. Can someone please help me out with this and how to fix it for future use?
 I'm not even finished scripting for this map yet. I was just getting ready to play test what I have so far.
 
Never mind. I found my own error. I accidentally added an extra "" in my script. While play testing it, I also found out my Sledge hammer script didn't work. How stupid of me.
			
				
(This post was last modified: 07-23-2013, 08:02 AM by T122002.)
 |  |  
	| 07-23-2013, 07:54 AM |  |  
	
		| Tomato Cat   Senior Member
 
 Posts: 287
 Threads: 2
 Joined: Sep 2012
 Reputation: 
20
 | 
			| RE: Error: Expected Data Type 
 
				Also, you may wish to take a look at this line: void Message("string &in asParent, string &in asChild, int alState) 
The quotation mark in front of the first parameter may be causing your error.
			 |  |  
	| 07-23-2013, 01:59 PM |  |  
	
		| PutraenusAlivius   Posting Freak
 
 Posts: 4,713
 Threads: 75
 Joined: Dec 2012
 Reputation: 
119
 | 
			| RE: Error: Expected Data Type 
 
				Well make it SOLVED then.
			 
 "Veni, vidi, vici.""I came, I saw, I conquered."
 |  |  
	| 07-23-2013, 03:15 PM |  |  |