Frictional Games Forum (read-only)
[SCRIPT] Unexpected end of file error (SOLVED) - 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: [SCRIPT] Unexpected end of file error (SOLVED) (/thread-26062.html)



Unexpected end of file error (SOLVED) - A.M Team - 09-07-2014

I was making my custom story and so added a few more quests, then I get this error. Heres my .hps file. And before you say, yes, I tryed putting in the } in line 10 but that only caused more errors. HELP! Sad

My .hps file:

PHP Code:
void OnStart()
{
    
AddUseItemCallback("", "key_intro", "intro_door", "UseKeyOnDoor", true);
    
SetInventoryDisabled(true);
    
SetPlayerActive(false);
    
GiveSanityDamage(100, false);
    
FadeOut(0.1);
    
AddQuest("memento2", "memento2");


void InteractPassage(string &in asEntity); 
{
    
int interactCount = GetLocalVarInt("HitCount");

    
AddLocalVarInt("HitCount", 1);
    
AddTimer("", 0.5, "DecreaseHitCount");

    if (
interactCount == 1)
    {
        
SetPropHealth("BreakableJar", 0);
    }

    if (
GetTimerTimeLeft("limitsound") == 0)
    {
        
AddTimer("limitsound", 0.5, "");

        
PlayGuiSound("impact_glass.ogg", 1);
        
PlayGuiSound("break_glass_bottle1", 1);
    }
}

void VoiceDone ()
{
    
SetPlayerSanity(70); 
    
SetInventoryDisabled(false);
    
SetPlayerActive(true);
    
FadeIn(3);
    
AddEntityCollideCallback("Player", "AreaMemento", "EventQuest", true, 1);
    
AddEntityCollideCallback("Player", "AreaMemento_2", "AcidQuest", true, 1);
    
AddUseItemCallback("", "acido1", "organico1", "Dissolve", true);
}

void Dissolve (string &in asItem, string &in asEntity)
{
    
SetPropActiveAndFade("organico1", false, 3);
    
PreloadSound("puzzle_acid.snt");
    
CompleteQuest("memento2", "memento2");
}

void DecreaseHitCount(string &in asTimer)
{
    
AddLocalVarInt("HitCount", -1);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
    
SetSwingDoorLocked("intro_door", false, true);
    
PlaySoundAtEntity("Unlock_door", "unlock_door.snt", "intro_door", 0, false);
    
RemoveItem("intro_key");
}

void PickUpLantern(string &in asEntity, string &in type)
{
    
AddQuest("lantern", "pickuplantern");
}

void EventQuest(string &in asParent, string &in asChild, int alState)
{
    
AddQuest("area", "memento1");
}

void OnEnter()
{
    
PlayMusic("04_amb.ogg", true, 1, 15, 1, true);
}

void OnLeave()
{
    
StopMusic(2, 1);
    
CompleteQuest("lantern", "pickuplantern");
} 



RE: Unexpected end of file error - Romulator - 09-07-2014

Your OnStart() does not have a closing brace. ( } )

Put one after this line:
PHP Code:
AddQuest("memento2", "memento2"); 

So it becomes:
PHP Code:
AddQuest("memento2", "memento2"); 
} 


If there are more errors after this, let me know what the actual message of the error is Smile


RE: Unexpected end of file error - A.M Team - 09-07-2014

I got an error, "14,1 unexpected token {


RE: Unexpected end of file error - Neelke - 09-07-2014

Code:
void InteractPassage(string &in asEntity);

This has an ; that should be there. Delete it and it should be fine.


RE: Unexpected end of file error - A.M Team - 09-07-2014

Thank you so much, it works now! Smile

https://www.youtube.com/watch?v=qGITFJr_4Po