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
Script Help I don't know what's going on. FATAL ERROR
LeonAnders Offline
Junior Member

Posts: 2
Threads: 1
Joined: Aug 2013
Reputation: 0
#1
I don't know what's going on. FATAL ERROR

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()
{
}
08-15-2013, 03:58 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: I don't know what's going on. FATAL ERROR

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

It's int alState, not int alStates.

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.

"Veni, vidi, vici."
"I came, I saw, I conquered."
08-15-2013, 04:16 AM
Find
LeonAnders Offline
Junior Member

Posts: 2
Threads: 1
Joined: Aug 2013
Reputation: 0
#3
RE: I don't know what's going on. FATAL ERROR

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

It's int alState, not int alStates.

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!!!
08-15-2013, 04:31 AM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#4
RE: I don't know what's going on. FATAL ERROR

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

It's int alState, not int alStates.

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.
(This post was last modified: 08-15-2013, 04:41 AM by Tomato Cat.)
08-15-2013, 04:40 AM
Find




Users browsing this thread: 1 Guest(s)