Frictional Games Forum (read-only)
Unexpected End of File - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Unexpected End of File (/thread-16740.html)



Unexpected End of File - Anonymous2343 - 07-04-2012

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);
}




RE: Unexpected End of File - Cruzore - 07-04-2012

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.


RE: Unexpected End of File - Adny - 07-04-2012

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!


RE: Unexpected End of File - Anonymous2343 - 07-04-2012

Ahh, I see, thanks to both of you!