The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error: Expected Data Type
T122002 Offline
Junior Member

Posts: 24
Threads: 10
Joined: Dec 2012
Reputation: 1
#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
Find


Messages In This Thread
Error: Expected Data Type - by T122002 - 07-23-2013, 07:54 AM
RE: Error: Expected Data Type - by Tomato Cat - 07-23-2013, 01:59 PM



Users browsing this thread: 1 Guest(s)