Dizturbed
Member
Posts: 160
Threads: 39
Joined: Jun 2011
Reputation:
0
|
Fatal error!
i keep getting:
main (60,2) : ERR : Unexpected end of file
heres my code..
/////////////////////////// // Run first time starting map void OnStart() { PlayMusic("amb_extra02.ogg", true, 5, 4.0f, 0, false); //Plays music. AddEntityCollideCallback("Player", "ScriptArea_1", "monstuh", true, 0); //Calls a function when two entites collide. AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1); SetEntityPlayerInteractCallback("key_study_1", "monsterspawn", false); //Calls a function when the player interacts with a certain entity. AddUseItemCallback("", "crowbar_1", "AreaUseCrowbar", "UseCrowbar", true); //Allows the player to use items on the world. }
// INTERACTKEY \\ void monsterspawn(string &in entity) { GiveSanityBoostSmall(); SetEntityActive("ScriptArea_1", true); PlayGuiSound("enabled.snt", 9.0f); PlaySoundAtEntity("12_girl_scream", "12_girl_scream.snt", "Player", 0, false); SetSwingDoorClosed("mansion_1", true, true); FadeOut(0.3);' PlayGuiSound("scare_wall_stomp1.ogg", 5.0f); PlayGuiSound("react_pant1.ogg", 7.0f); } void monstuh(string &in asParent, string &in asChild, int alState) { SetEntityActive("enemy_1", true); AddEnemyPatrolNode("enemy_1", "PathNodeArea_1", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_3", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_4", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_5", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_6", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_7", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_8", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_9", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_10", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_11", 0, ""); }
// CROWBAR EVENT \\ void UseCrowbar(string &in asItem, string &in asEntity) { SetEntityActive("crowbar_joint_1", true); PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false); RemoveItem("crowbar_1"); SetEntityPlayerInteractCallback("AreaUseCrowbar", "", true); } void TimerSwitchShovel(string &in asTimer) { PlaySoundAtEntity("","puzzle_place_jar.snt", asTimer, 0, false); } void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("","joint_oven_open", "AreaBreakEffect", 0, false); CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false); SetEntityActive("crowbar_joint_1", false); SetEntityActive("crowbar_dyn_1", true); SetEntityActive("AreaUseCrowbar", false); SetEntityActive("mansion_5", true); }
Help meeee :(
|
|
07-12-2011, 02:37 PM |
|
Luis
Frictional Games
Posts: 280
Threads: 19
Joined: Jun 2006
Reputation:
9
|
RE: Fatal error!
Try removing the \\ at the end of lines 12 and 41. If I am guessing correctly those are causing the lines following them to be treated as a comment too.
EOF
|
|
07-12-2011, 09:40 PM |
|
HumiliatioN
Posting Freak
Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation:
18
|
RE: Fatal error!
(07-12-2011, 02:37 PM)Dizturbed Wrote: i keep getting:
main (60,2) : ERR : Unexpected end of file
heres my code..
/////////////////////////// // Run first time starting map void OnStart() { PlayMusic("amb_extra02.ogg", true, 5, 4.0f, 0, false); //Plays music. AddEntityCollideCallback("Player", "ScriptArea_1", "monstuh", true, 0); //Calls a function when two entites collide. AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1); SetEntityPlayerInteractCallback("key_study_1", "monsterspawn", false); //Calls a function when the player interacts with a certain entity. AddUseItemCallback("", "crowbar_1", "AreaUseCrowbar", "UseCrowbar", true); //Allows the player to use items on the world. }
// INTERACTKEY \\ void monsterspawn(string &in entity) { GiveSanityBoostSmall(); SetEntityActive("ScriptArea_1", true); PlayGuiSound("enabled.snt", 9.0f); PlaySoundAtEntity("12_girl_scream", "12_girl_scream.snt", "Player", 0, false); SetSwingDoorClosed("mansion_1", true, true); FadeOut(0.3);' PlayGuiSound("scare_wall_stomp1.ogg", 5.0f); PlayGuiSound("react_pant1.ogg", 7.0f); } void monstuh(string &in asParent, string &in asChild, int alState) { SetEntityActive("enemy_1", true); AddEnemyPatrolNode("enemy_1", "PathNodeArea_1", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_3", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_4", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_5", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_6", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_7", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_8", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_9", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_10", 0, ""); AddEnemyPatrolNode("enemy_1", "PathNodeArea_11", 0, ""); }
// CROWBAR EVENT \\ void UseCrowbar(string &in asItem, string &in asEntity) { SetEntityActive("crowbar_joint_1", true); PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false); RemoveItem("crowbar_1"); SetEntityPlayerInteractCallback("AreaUseCrowbar", "", true); } void TimerSwitchShovel(string &in asTimer) { PlaySoundAtEntity("","puzzle_place_jar.snt", asTimer, 0, false); } void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("","joint_oven_open", "AreaBreakEffect", 0, false); CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false); SetEntityActive("crowbar_joint_1", false); SetEntityActive("crowbar_dyn_1", true); SetEntityActive("AreaUseCrowbar", false); SetEntityActive("mansion_5", true); }
Help meeee :(
// Run first time starting map
void OnStart()
{
PlayMusic("amb_extra02.ogg", true, 5, 4.0f, 0, false); //Plays music.
AddEntityCollideCallback("Player", "ScriptArea_1", "monstuh", true, 0);
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
SetEntityPlayerInteractCallback("key_study_1", "monsterspawn", false);
AddUseItemCallback("", "crowbar_1", "AreaUseCrowbar", "UseCrowbar", true);
}
// INTERACTKEY \\
void monsterspawn(string &in entity)
{
GiveSanityBoostSmall();
SetEntityActive("ScriptArea_1", true);
PlayGuiSound("enabled.snt", 9.0f);
PlaySoundAtEntity("12_girl_scream", "12_girl_scream.snt", "Player", 0, false);
SetSwingDoorClosed("mansion_1", true, true);
FadeOut(0.3);'
PlayGuiSound("scare_wall_stomp1.ogg", 5.0f);
PlayGuiSound("react_pant1.ogg", 7.0f);
}
void monstuh(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_1", true);
AddEnemyPatrolNode("enemy_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_11", 0, "");
}
// CROWBAR EVENT \\
void UseCrowbar(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_1", true);
PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false);
RemoveItem("crowbar_1");
SetEntityPlayerInteractCallback("AreaUseCrowbar", "", true);
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", asTimer, 0, false);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("","joint_oven_open", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_dyn_1", true);
SetEntityActive("AreaUseCrowbar", false);
SetEntityActive("mansion_5", true);
}
Couple errors, "No spaces on void "code parts" Try it now.
“Life is a game, play it”
|
|
07-12-2011, 09:48 PM |
|
Roenlond
Senior Member
Posts: 331
Threads: 3
Joined: Apr 2011
Reputation:
0
|
RE: Fatal error!
///////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("amb_extra02.ogg", true, 5, 4.0f, 0, false); //Plays music.
AddEntityCollideCallback("Player", "ScriptArea_1", "monstuh", true, 0); //Calls a function when two entites collide.
AddEntityCollideCallback("crowbar_joint_1", "BreakDoor", "CollideAreaBreakDoor", true, 1);
SetEntityPlayerInteractCallback("key_study_1", "monsterspawn", false); //Calls a function when the player interacts with a certain entity.
AddUseItemCallback("", "crowbar_1", "AreaUseCrowbar", "UseCrowbar", true); //Allows the player to use items on the world.
}
// INTERACTKEY \\
void monsterspawn(string &in entity)
{
GiveSanityBoostSmall();
SetEntityActive("ScriptArea_1", true);
PlayGuiSound("enabled.snt", 9.0f);
PlaySoundAtEntity("12_girl_scream", "12_girl_scream.snt", "Player", 0, false);
SetSwingDoorClosed("mansion_1", true, true);
FadeOut(0.3);
PlayGuiSound("scare_wall_stomp1.ogg", 5.0f);
PlayGuiSound("react_pant1.ogg", 7.0f);
}
void monstuh(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_1", true);
AddEnemyPatrolNode("enemy_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("enemy_1", "PathNodeArea_11", 0, "");
}
// CROWBAR EVENT \\
void UseCrowbar(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_1", true);
PlaySoundAtEntity("pickupcrow","player_crouch.snt", "Player", 0.05, false);
RemoveItem("crowbar_1");
SetEntityPlayerInteractCallback("AreaUseCrowbar", "", true);
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", asTimer, 0, false);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("","joint_oven_open", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_dyn_1", true);
SetEntityActive("AreaUseCrowbar", false);
SetEntityActive("mansion_5", true);
}
You had a ' on row 20. The \\ doesn't matter since everything on that row is commented out.
|
|
07-12-2011, 09:54 PM |
|
Luis
Frictional Games
Posts: 280
Threads: 19
Joined: Jun 2006
Reputation:
9
|
RE: Fatal error!
(07-12-2011, 09:54 PM)Roenlond Wrote: You had a ' on row 20. The \\ doesn't matter since everything on that row is commented out.
Oh yeah you got it there. I'm such a noob
As for the \\, while it works for angelscript (I didn't know that actually), it isn't something to be just assumed for every language. For example C++ would include the following line in the comment ( http://msdn.microsoft.com/en-us/library/k1dbk8bw.aspx ). Not that it matters in this case though
EOF
|
|
07-12-2011, 10:40 PM |
|
Roenlond
Senior Member
Posts: 331
Threads: 3
Joined: Apr 2011
Reputation:
0
|
RE: Fatal error!
Yeah, I haven't really used anything but AngelScript and some css, in which /* */ is of course what you'll use
C++ is almost completely unknown to me.
|
|
07-12-2011, 10:50 PM |
|
Dizturbed
Member
Posts: 160
Threads: 39
Joined: Jun 2011
Reputation:
0
|
RE: Fatal error!
I fixed it, thanks for the help guys !
(This post was last modified: 07-12-2011, 11:18 PM by Dizturbed.)
|
|
07-12-2011, 11:08 PM |
|
Roenlond
Senior Member
Posts: 331
Threads: 3
Joined: Apr 2011
Reputation:
0
|
RE: Fatal error!
Try to remove the backslashes then. I can't find any other error.
|
|
07-12-2011, 11:12 PM |
|
|