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
Unexpected End of File
Anonymous2343 Offline
Junior Member

Posts: 10
Threads: 5
Joined: Jul 2012
Reputation: 0
#1
Unexpected End of File

I'm getting the error message "Unexpected end of file" when I try to run my custom map. I've looked through my code a few times, and I can't find the problem. Any help will be appreciated

Spoiler below!


void OnStart()
{
AddUseItemCallback("", "castlekey1", "castle_1", "UsedKeyOnDoor", true);
PlaySoundAtEntity("ambience", "amb_guardian.ogg", "Player", 0 ,false);
AddEntityCollideCallback("Player", "scr_playsound", "PlayGrowl", true, 1);
AddEntityCollideCallback("Player", "scr_scare", "LoudGrowl", true, 1);
AddEntityCollideCallback("Player", "scr_spawngrunt", "SpawnDoorGrunt", true, 1);
SetEntityPlayerLookAtCallback("haunt_door", "ScaryDoor", true);
SetEntityPlayerInteractCallback("potion_sanity_1", "Creepy", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("castlekey1");
AutoSave();
}

void PlayGrowl(string &in asParent, string &in asChild, int alState)
{
PlayMusic("enabled02.ogg", false, 0.8, 2, 0, true);
}

void LoudGrowl(string &in asParent, string &in asChild, int alState)
{
PlayMusic("metal_walk08.ogg", false, 1.0, 2, 0, true);
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0.0f, "");
}

void SpawnDoorGrunt(string &in asParent, string &in asChild, int alState)
{
PlayMusic("enabled02.ogg, false, 0.9, 2, 0, true);
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0.0f, "");
}

void ScaryDoor(string &in entity, int alState)
{
PlayMusic("break_wood1.ogg", false, 30.0, 2, 1, true);
CreateParticleSystemAtEntity("door_explosion", "ps_hit_wood.ps", "haunt_door", true);
AddPropImpulse("haunt_door", -12, 8, -92, "world");
}

void Creepy(string &in asParent, string &in asChild, int alState)
{
PlayMusic("general_wind_whirl1.ogg", false, 1.0, 2, 0, true);
SetLampLit("candlestick02_2", false, true);
SetLampLit("torch_static01_21", false, true);
SetLampLit("torch_static01_20", false, true);
SetLampLit("torch_static01_24", false, true);
SetLampLit("torch_static01_25", false, true);
}

(This post was last modified: 07-04-2012, 10:08 PM by Anonymous2343.)
07-04-2012, 09:58 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#2
RE: Unexpected End of File

void SpawnDoorGrunt(string &in asParent, string &in asChild, int alState)
{
PlayMusic("enabled02.ogg, false, 0.9, 2, 0, true);
Missing the closing " .
Because of mistakes like this, you should set up geany. It helps a lot, and this is how I found your mistake in 10 seconds.

Think, before you speak Google, before you post
07-04-2012, 10:07 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
RE: Unexpected End of File

In the callback "SpawnDoorGrunt", the function PlayMusic isn't correct; you forgot to put the sound file in quotations. You just missed 1 little ". Amazing what such a small mistake can do.

You have:

PlayMusic("enabled02.ogg, false, 0.9, 2, 0, true);


it should be:

PlayMusic("enabled02.ogg", false, 0.9, 2, 0, true);


Hope that helped!

I rate it 3 memes.
07-04-2012, 10:07 PM
Find
Anonymous2343 Offline
Junior Member

Posts: 10
Threads: 5
Joined: Jul 2012
Reputation: 0
#4
RE: Unexpected End of File

Ahh, I see, thanks to both of you!
07-04-2012, 10:08 PM
Find




Users browsing this thread: 1 Guest(s)