LeonAnders
Junior Member
Posts: 2
Threads: 1
Joined: Aug 2013
Reputation:
0
|
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 |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
LeonAnders
Junior Member
Posts: 2
Threads: 1
Joined: Aug 2013
Reputation:
0
|
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. 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 |
|
Tomato Cat
Senior Member
Posts: 287
Threads: 2
Joined: Sep 2012
Reputation:
20
|
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 |
|
|