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
Common Exceptions
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Common Exceptions

I'm working on a list of common exceptions encountered by Amnesia developers and their solutions, so that newbies can find an easy reference guide and avoid clogging up the forums with repeated isntances of the same problem. If you have any additions, please feel free to post here!

For almost every error, it will give you a pair of numbers such as (13,2). It marks the location of the error by line and character. So in the above example, scroll down to line 13 and inspect it for your problem.

Unexpected end of file

One of the most common exceptions, caused when you don't close up your functions with an open "{" and close "}" bracket, or open and close quotes. It always gives you the character at the end of your script, so you have to check every quote and bracket in your script and make sure nothing is left hanging open.

No matching signatures to [FUNCTION]

You are trying to use a function that either doesn't exist or uses improper syntax. Check all your functions to make sure everything is used properly. This must-have wiki page lists every function and its proper syntax.

Correct: StartCredits("unlove.ogg", false, "Credits", "Credits", 4);
Improper syntax: StartCredits("unlove.ogg", false);
No such function: MakeEnemyDisappear(true);

Always remember the following syntax rules when writing functions:
string: Any word that can be an internal name. ALWAYS HAS QUOTES. Example: "credits"
bool: A boolean value, either true or false. NEVER HAS QUOTES.
int: Any integer. Example: 4
float: Any number with a floating decimal. Always terminates with an "f." Example: 3.25f

Expected ) or ,

You left out one of the above symbols. Check your script for a missing symbol, such as:

Missing ")": AddEntityCollideCallback("Player", "Message_1", "Message1", true,
Missing ",": void StartMusic(string &in asParent, string &in asChild int alState)

Expected ;

You left out a semicolon at the end of a function. Pretty easy to catch.

Correct: StartCredits("unlove.ogg", false, "Credits", "Credits", 4);
Incorrect: StartCredits("unlove.ogg", false, "Credits", "Credits", 4)

Expected identifier

You messed up a symbol somewhere in your syntax. Most commonly seen when accidently putting a period instead of a comma, such as in:

StartCredits("unlove.ogg", false, "Credits". "Credits", 4);

'[VARIABLE]' is not declared

You are trying to use a variable that is not technically declared. Research how to declare variables; there are several ways to do it, such as in the following examples.

Defining as a single value
int x = RandInt(1,4); ////DECLARED
SetEntityActive("orbpiece_emerald_"+x, true); ////USED

Defining as a set of values
for(int i=1;i<=6;i++) ////DECLARED (by using a "for" loop)
{
SetEntityPlayerInteractCallback("orbpiece_emerald_"+i, "GetShard", true); ////USED
}

Could not load file

Often happens when trying to change maps. Either you've forgotten to name a map file in your level door, or the names do not match.

(This post was last modified: 05-22-2012, 11:35 PM by Damascus.)
05-22-2012, 11:28 PM
Find


Messages In This Thread
Common Exceptions - by Damascus - 05-22-2012, 11:28 PM
RE: Common Exceptions - by Putmalk - 05-22-2012, 11:49 PM
RE: Common Exceptions - by Putmalk - 05-25-2012, 03:21 PM



Users browsing this thread: 2 Guest(s)