Frictional Games Forum (read-only)
HPL2 Help? - 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: HPL2 Help? (/thread-17276.html)



HPL2 Help? - raptorhunter6 - 07-26-2012

I get a "Fatal Error: Could Not Load Script File 'maps/castlehall.hps'! main (13,1) ERR:Unexpected '}' "

My Hps file is:


////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomOneArea", "CollideRoomOne", true, 1);
}

void CollideRoomOne(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_1", true, true);
}

{
SetEntityPlayerInteractCallback("Main_Key", "ActivateMonster", true);
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "idle");
}

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "Main_Key", "MainDoorOne", "UsedKeyOnDoor", true);
}

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

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


-------------------------> Its simple but its what I need for this map so far, it worked fine until I added:

" {
SetEntityPlayerInteractCallback("Main_Key", "ActivateMonster", true);
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "idle");
} "


I'm sorry if its something simple or something, I'm just beginning to use the Editor + Scripting, thank you in advance!


RE: HPL2 Help? - Your Computer - 07-26-2012

Code blocks need to be either part of a function definition or within a function body.


RE: HPL2 Help? - Adny - 07-26-2012

The:

"SetEntityPlayerInteractCallback("Main_Key", "ActivateMonster", true);"

Needs to be under: "void OnStart()", not in its own function.


RE: HPL2 Help? - raptorhunter6 - 07-26-2012

Thank you! Worked perfectly, I just wasn't sure how to add that part but thanks to your speedy replies I got it to work. Thank you Smile