flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
FATAL ERROR help :/ *UPDATED*
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute_1" , true);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.5f, false);
{
AddEntityCollideCallback("Player" , "ScriptArea_2" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("barrel01_20" , true);
SetEntityActive("barrel01_21" , true);
SetEntityActive("barrel01_22" , true);
SetEntityActive("barrel01_28" , true);
SetEntityActive("barrel01_29" , true);
SetEntityActive("barrel01_23" , true);
SetEntityActive("barrel01_24" , true);
SetEntityActive("barrel01_25" , true);
SetEntityActive("barrel01_27" , true);
SetEntityActive("barrel01_26" , true);
SetEntityActive("barrel01_10" , true);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.5f, false);
}
}
highlighted in bold is the one that is having the problems, it says there's an expected ( between the
void and the MonsterFunc1
Any help on this?
(This post was last modified: 10-13-2011, 10:20 AM by flamez3.)
|
|
10-13-2011, 08:22 AM |
|
Luis
Frictional Games
Posts: 280
Threads: 19
Joined: Jun 2006
Reputation:
9
|
RE: FATAL ERROR help :/
That call is "floating in the void". It should be inside of a function definition, i.e. if it belongs to the MonsterFunc1 function, move it above the closing bracket.
EOF
|
|
10-13-2011, 08:27 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: FATAL ERROR help :/
(10-13-2011, 08:27 AM)Luis Wrote: That call is "floating in the void". It should be inside of a function definition, i.e. if it belongs to the MonsterFunc1 function, move it above the closing bracket. THANK YOU, for the quick response and it actually works!
|
|
10-13-2011, 08:32 AM |
|
Luis
Frictional Games
Posts: 280
Threads: 19
Joined: Jun 2006
Reputation:
9
|
RE: FATAL ERROR help :/ *UPDATED*
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute_1" , true);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.5f, false);
{ <--- legal, but not needed
AddEntityCollideCallback("Player" , "ScriptArea_2" , "MonsterFunc1" , true , 1);
} <--- legal, but not needed
/*
These lines below are illegal, functions cannot be defined inside other functions. This means previous function is still being defined, because there's no closing bracket before this. Added to that, the following function has the same name.
*/
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("barrel01_20" , true);
SetEntityActive("barrel01_21" , true);
SetEntityActive("barrel01_22" , true);
SetEntityActive("barrel01_28" , true);
SetEntityActive("barrel01_29" , true);
SetEntityActive("barrel01_23" , true);
SetEntityActive("barrel01_24" , true);
SetEntityActive("barrel01_25" , true);
SetEntityActive("barrel01_27" , true);
SetEntityActive("barrel01_26" , true);
SetEntityActive("barrel01_10" , true);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.5f, false);
}
} <-- This is closing the first MonsterFunc1
I suggest you check the basics of the scripting language, as in how to build correct structures and stuff like that before doing any real work. Trust me, it will save you lots of headaches
EOF
|
|
10-13-2011, 11:58 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: FATAL ERROR help :/ *UPDATED*
(10-13-2011, 11:58 AM)Luis Wrote: void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute_1" , true);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.5f, false);
{ <--- legal, but not needed
AddEntityCollideCallback("Player" , "ScriptArea_2" , "MonsterFunc1" , true , 1);
} <--- legal, but not needed
/*
These lines below are illegal, functions cannot be defined inside other functions. This means previous function is still being defined, because there's no closing bracket before this. Added to that, the following function has the same name.
*/
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("barrel01_20" , true);
SetEntityActive("barrel01_21" , true);
SetEntityActive("barrel01_22" , true);
SetEntityActive("barrel01_28" , true);
SetEntityActive("barrel01_29" , true);
SetEntityActive("barrel01_23" , true);
SetEntityActive("barrel01_24" , true);
SetEntityActive("barrel01_25" , true);
SetEntityActive("barrel01_27" , true);
SetEntityActive("barrel01_26" , true);
SetEntityActive("barrel01_10" , true);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.5f, false);
}
} <-- This is closing the first MonsterFunc1
I suggest you check the basics of the scripting language, as in how to build correct structures and stuff like that before doing any real work. Trust me, it will save you lots of headaches
I did just that just then and it is not exactly helping me in this situation :S
|
|
10-13-2011, 12:16 PM |
|
Luis
Frictional Games
Posts: 280
Threads: 19
Joined: Jun 2006
Reputation:
9
|
RE: FATAL ERROR help :/ *UPDATED*
What did you do exactly? What I posted above was your code with some annotations and explanation of why it does not work, not a fix
EOF
|
|
10-13-2011, 12:33 PM |
|
|