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



Unexpected end of the file? - MaksoPL - 02-14-2015

Hi. I've used somes scripts in .hps file, and
main 34,1 Unexpected end of the file.
This is my .hps file. What i've must do?

void OnStart()

{
AddEntityCollideCallback("Player","scared01","Barrel",true,1);
AddEntityCollideCallback("Player","thunderscript01","Burza",false,1);
AddUseItemCallback("","key1","door1","UseKeyOnDoor
}

void Barrel(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("barrel_script01",true);
}

void Burza(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("123","general_wind_whirl.snt","thunderscript01",0,false);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
SetLocalVarInt("Switch", 1);
CompleteQuest("door", "touchdoor");
}

void TouchDoor(string &in asEntity)
{
if(GetLocalVarInt("Switch") == 0)
}
{
AddQuest("door", "touchdoor");
}



RE: Unexpected end of the file? - Neelke - 02-14-2015

AddUseItemCallback("","key1","door1","UseKeyOnDoor

This is not even finished. It's meant to look like this:

AddUseItemCallback("","key1","door1","UseKeyOnDoor", true);


RE: Unexpected end of the file? - Mudbill - 02-14-2015

PHP Code:
void TouchDoor(string &in asEntity)
{
if(
GetLocalVarInt("Switch") == 0)
}
{
AddQuest("door""touchdoor");


This is another problem. It doesn't use the rules of the syntax.

This is probably how you want it to be:

PHP Code:
void TouchDoor(string &in asEntity)
{
    if(
GetLocalVarInt("Switch") == 0)
    {
        
AddQuest("door""touchdoor");
    }




RE: Unexpected end of the file? - MaksoPL - 02-14-2015

Oh... Thank you Smile I'm Newbie in developing.