Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal error!
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#1
Fatal error!

i keep getting:

main (60,2) : ERR : Unexpected end of file


heres my code..


PHP Code: (Select All)
///////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("amb_extra02.ogg"true54.0f0false); //Plays music.
AddEntityCollideCallback("Player""ScriptArea_1""monstuh"true0); //Calls a function when two entites collide.
AddEntityCollideCallback("crowbar_joint_1""BreakDoor""CollideAreaBreakDoor"true1);
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"0false);
SetSwingDoorClosed("mansion_1"truetrue);
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
Find
Luis Offline
Frictional Games

Posts: 280
Threads: 19
Joined: Jun 2006
Reputation: 9
#2
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
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#3
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..


PHP Code: (Select All)
///////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("amb_extra02.ogg"true54.0f0false); //Plays music.
AddEntityCollideCallback("Player""ScriptArea_1""monstuh"true0); //Calls a function when two entites collide.
AddEntityCollideCallback("crowbar_joint_1""BreakDoor""CollideAreaBreakDoor"true1);
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"0false);
SetSwingDoorClosed("mansion_1"truetrue);
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
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#4
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
Find
Luis Offline
Frictional Games

Posts: 280
Threads: 19
Joined: Jun 2006
Reputation: 9
#5
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 Tongue
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 Smile

EOF
07-12-2011, 10:40 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#6
RE: Fatal error!

Yeah, I haven't really used anything but AngelScript and some css, in which /* */ is of course what you'll use Smile

C++ is almost completely unknown to me.
07-12-2011, 10:50 PM
Find
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#7
RE: Fatal error!

I fixed it, thanks for the help guys ! Big Grin
(This post was last modified: 07-12-2011, 11:18 PM by Dizturbed.)
07-12-2011, 11:08 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#8
RE: Fatal error!

Try to remove the backslashes then. I can't find any other error.
07-12-2011, 11:12 PM
Find




Users browsing this thread: 1 Guest(s)