Fatal error! - Dizturbed - 07-12-2011
i keep getting:
main (60,2) : ERR : Unexpected end of file
heres my code..
PHP 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 :(
RE: Fatal error! - Luis - 07-12-2011
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.
RE: Fatal error! - HumiliatioN - 07-12-2011
(07-12-2011, 02:37 PM)Dizturbed Wrote: i keep getting:
main (60,2) : ERR : Unexpected end of file
heres my code..
PHP 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.
RE: Fatal error! - Roenlond - 07-12-2011
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);
}
You had a ' on row 20. The \\ doesn't matter since everything on that row is commented out.
RE: Fatal error! - Luis - 07-12-2011
(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 ![Tongue Tongue](https://www.frictionalgames.com/forum/images/smilies/tongue.gif)
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
RE: Fatal error! - Roenlond - 07-12-2011
Yeah, I haven't really used anything but AngelScript and some css, in which /* */ is of course what you'll use ![Smile Smile](https://www.frictionalgames.com/forum/images/smilies/smile.gif)
C++ is almost completely unknown to me.
RE: Fatal error! - Dizturbed - 07-12-2011
I fixed it, thanks for the help guys !
RE: Fatal error! - Roenlond - 07-12-2011
Try to remove the backslashes then. I can't find any other error.
|