Frictional Games Forum (read-only)
[SCRIPT] I don't know what's going on. FATAL ERROR - 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: [SCRIPT] I don't know what's going on. FATAL ERROR (/thread-22416.html)



I don't know what's going on. FATAL ERROR - LeonAnders - 08-15-2013

I have no clue, usually with any kind of scripting I can figure out why it's doing what it's doing but this one has me baffled it's either too complex for me or the answer is easy and i'm over looking it. I get this message:
FATAL ERROR: Could not load script "filelocation/filename.hps"
main (10.72) : ERR : Expected '('

From my knowlege that means it wants me to put a ( at the 72 column in the 10th line.... unless I messed something up there should be no need for one at that point

HERE IS MY CODE:
///////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Dooronearea", "CollideDoorone", true, 1);
}

void CollideDoorone(string &in asParent, string &in asChild, int alStates)
{
void PlaySoundAtEntity("Sound_1", "00_laugh.snt", "player", 0.1f, false);
}

///////////////////////////
// Run when entering map
void OnEnter()
{
}
///////////////////////////
// Run when leaving map
void OnLeave()
{
}


RE: I don't know what's going on. FATAL ERROR - PutraenusAlivius - 08-15-2013

Code:
void CollideDoorone(string &in asParent, string &in asChild, int alState)

It's int alState, not int alStates.

Code:
PlaySoundAtEntity("Sound_1", "00_laugh.snt", "Player", 0.1f, false);

You don't need a void in PlaySoundAtEntity. You only need it when it comes to functions. And it's Player, not player.


RE: I don't know what's going on. FATAL ERROR - LeonAnders - 08-15-2013

(08-15-2013, 04:16 AM)JustAnotherPlayer Wrote:
Code:
void CollideDoorone(string &in asParent, string &in asChild, int alState)

It's int alState, not int alStates.

Code:
PlaySoundAtEntity("Sound_1", "00_laugh.snt", "Player", 0.1f, false);

You don't need a void in PlaySoundAtEntity. You only need it when it comes to functions. And it's Player, not player.

Thank you for that. Big Grin there were also some other problems that came after I did these changes but as I said... i USUALLY know what i'm doing these minor things I over looked. But it was sort of in vain cause the audio don't play when i want it too... BACK THE THE SCRIPTING BOARD!!!


RE: I don't know what's going on. FATAL ERROR - Tomato Cat - 08-15-2013

(08-15-2013, 04:16 AM)JustAnotherPlayer Wrote:
Code:
void CollideDoorone(string &in asParent, string &in asChild, int alState)

It's int alState, not int alStates.

Code:
PlaySoundAtEntity("Sound_1", "00_laugh.snt", "Player", 0.1f, false);

You don't need a void in PlaySoundAtEntity. You only need it when it comes to functions. And it's Player, not player.

Parameter names are unimportant to a function's signature. The compiler/parser only complains if a parameter's type is different and no overloaded function with said signature exists.

I think. I dunno.

And yes, void is a return type.