Frictional Games Forum (read-only)
Coding problem - 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: Coding problem (/thread-15563.html)



Coding problem - Ac33 - 05-22-2012

I have an error on my .hps file. It says its on line 18 (I had to clean it up, it's the last line), but I can't see what's wrong there.

Code:
void OnStart ()
{
    AddUseItemCallback("", "key1", "mansion_1", "KeyOnDoor", true);
    
    SetEntityPlayerInteractCallback("key1", "ActivateMonster", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity) {
    SetSwingDoorLocked("mansion_1", false, true);
    PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
    RemoveItem("key1);
}

void ActivateMonster(string &in asItem) {
    SetEntityActive("morso1", true);
    AddEnemyPatrolNode("morso1", "PathNodeArea_1", 0, "Idle");
    AddEnemyPatrolNode("morso1", "PathNodeArea_2", 0, "Idle");
}



RE: Coding problem - Obliviator27 - 05-22-2012

In the line
RemoveItem("key1);
is your issue.
You didn't fully enclose key1 in quotation marks,
RemoveItem("key1"); is what you'll want.


RE: Coding problem - Ac33 - 05-22-2012

Oh how stupid I am. That must have come when I cleaned the script. Thank you.


RE: Coding problem - Putmalk - 05-22-2012

In the future when asking for debugging, best if you tell us everything the game tells us (This was Unexpected end of file?), that we way know that it's not the last line but rather something else.


RE: Coding problem - Ac33 - 05-22-2012

Yes it was Unexpected end of file. I'll tell that if I'll have problems in the future,