Error: Expected Data Type - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Error: Expected Data Type (/thread-22211.html) |
Error: Expected Data Type - T122002 - 07-23-2013 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. 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. RE: Error: Expected Data Type - Tomato Cat - 07-23-2013 Also, you may wish to take a look at this line: PHP Code: void Message("string &in asParent, string &in asChild, int alState) The quotation mark in front of the first parameter may be causing your error. RE: Error: Expected Data Type - PutraenusAlivius - 07-23-2013 Well make it SOLVED then. |