Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
Not again ):
Hey guys last time i had this problem i found out out, thanks to Rapture, that i missed an end parentheses, but this time i can't see what the problem is
Error messeage: signature is missing for OnStart and that there is an Unexpected end of file on the end of void OnLeave()
//////////////////////////////
//Run first entering map
void OnStart()
{
AddEntityCollideCallback("Player", "LightOutArea_1", "KillTheLight", true, 1);
AddEntityCollideCallback("Player", "ArmourArea_1", "ArmourScare", true, 1);
SetEntityPlayerInteractCallback("key_torture_chamber_1", "ActivateArea", true);
AddEntityCollideCallback("Player", "ArmourArea_2", "ArmourScare2", true, 1);
AddUseItemCallback("", "key_torture_chamber_1", "prison_4", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "VoiceArea_1", "MonsterRoar", true, 1);
AddEntityCollideCallback("Player", "BodyVoiceArea_1", "BodyVoice", true, 1);
AddEntityCollideCallback("Player", "SlammingDoorArea_2", "SlammingDoor2", true, 1);
AddEntityCollideCallback("Player", "SlammingDoorArea_2", "SlammingDoor2", true, 1);
AddEntityCollideCallback("Player", "MonsterArea_1", "ActivateMonster", true, 1);
}
void KillTheLight(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_static01_1", false, true);
SetLampLit("torch_static01_2", false, true);
SetLampLit("torch_static01_3", false, true);
SetLampLit("torch_static01_4", false, true);
SetLampLit("torch_static01_5", false, true);
SetLampLit("torch_static01_6", false, true);
SetLampLit("torch_static01_7", false, true);
SetLampLit("torch_static01_8", false, true);
SetLampLit("torch_static01_9", false, true);
SetLampLit("torch_static01_10", false, true);
SetLampLit("torch_static01_11", false, true);
SetLampLit("torch_static01_12", false, true);
SetLampLit("torch_static01_13", false, true);
SetLampLit("torch_static01_14", false, true);
SetLampLit("torch_static01_15", false, true);
SetLampLit("torch_static01_16", false, true);
PlaySoundAtEntity("", "scare_wind", "Player", 0, false);
GiveSanityDamage(15, true);
}
void ArmourScare(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_rusty_complete_1", true);
SetEntityActive("armour_rusty_complete_4", true);
PlaySoundAtEntity("", "24_iron_maiden", "Player", 0, false);
GiveSanityDamage(20, true);
}
void ActivateArea(string &in asEntity)
{
SetEntityActive("ArmourArea_2", true);
}
void ArmourScare2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_rusty_complete_2", true);
SetEntityActive("armour_rusty_complete_3", true);
SetEntityActive("armour_rusty_complete_1", false);
SetEntityActive("armour_rusty_complete_4", false);
PlaySoundAtEntity("", "24_iron_maiden", "Player", 0, false);
GiveSanityDamage(20, true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_4", false, true);
PlaySoundAtEntity("", "unlock_door", "prison_4", 0, false);
RemoveItem("key_torture_chamber_1");
}
void MonsterRoar(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "insanity_monster_roar01", "Player", 0, false);
PlaySoundAtEntity("", "react_pant2", "Player", 0, false);
}
void BodyVoice(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_male_terrified1", "ritual_prisoner_1", 0, false);
PlaySoundAtEntity("", "react_pant1", Player", 0, false);
StartPlayerLookAt("ritual_prisoner_1", 3, 5, "");
StopPlayerLookAt();
GiveSanityDamage(5, true);
}
void SlammingDoor2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_slam_door", "prison_7", 0, false);
}
void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "idle");
GiveSanityDamage(10, true);
}
//////////////////////////////
//Run when entering map
void OnEnter()
{
}
//////////////////////////////
//Run when leaving map
void OnLeave()
{
}
CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 07-14-2012, 12:58 PM by Lizard.)
|
|
07-14-2012, 12:58 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Not again ):
Usually it is these: "
And i found it:
PlaySoundAtEntity("", "react_pant1", Player", 0, false);
should be
PlaySoundAtEntity("", "react_pant1", "Player", 0, false);
Trying is the first step to success.
|
|
07-14-2012, 01:32 PM |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
RE: Not again ):
Thanks man. Would have taken me a long time to find that
CURRENT PROJECT:
A Fathers Secret == Just started
|
|
07-14-2012, 01:34 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Not again ):
Just look out for the " when it says "Unexpected end of file"
Trying is the first step to success.
|
|
07-14-2012, 02:13 PM |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
RE: Not again ):
I will, thanks man...
I wonder if some of you could help me with this aswell.
I've done it alot of times, but this time the sound just won't play.
I don't get any error messeages, and I also checked if i used the wrong syntax, but to me all seems to be right.
void OnStart()
{
AddEntityCollideCallback("Player", "VoiceArea_1", "MonsterRoar", true, 1);
AddEntityCollideCallback("Player", "BodyVoiceArea_1", "BodyVoice", true, 1);
}
void MonsterRoar(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "insanity_monster_roar01.ogg", "Player", 0, false);
PlaySoundAtEntity("", "react_pant2.ogg", "Player", 0, false);
}
void BodyVoice(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_male_terrified1.ogg.", "ritual_prisoner_1", 0, false);
PlaySoundAtEntity("", "react_pant1.ogg", "Player", 0, false);
GiveSanityDamage(5, true);
}
PS. I also tryed without the .ogg at the soundfiles
CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 07-14-2012, 03:08 PM by Lizard.)
|
|
07-14-2012, 03:07 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Not again ):
Which of the sounds? All of them?
Edit: Well i guess the sounds you are playing are NOT .ogg sounds. Instead write .snt. or dont even write an extension
.ogg is for music files
Trying is the first step to success.
|
|
07-14-2012, 03:14 PM |
|
Lizard
Member
Posts: 174
Threads: 23
Joined: Jul 2012
Reputation:
5
|
RE: Not again ):
yes, all of them
Edit: Normaly i dont use the .ogg or .snt, but since it did not work, i tried to put the . ogg on, but that did not work either, and it is .ogg files
CURRENT PROJECT:
A Fathers Secret == Just started
(This post was last modified: 07-14-2012, 03:44 PM by Lizard.)
|
|
07-14-2012, 03:17 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Not again ):
Just don't write an extension and you should be fine. But remember to use the .snt files of the sound when using PlaySoundAtEntity
|
|
07-14-2012, 10:44 PM |
|
|