Frictional Games Forum (read-only)
Amnesia editor ERROR IN HPS 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: Amnesia editor ERROR IN HPS FILE! (/thread-24571.html)



Amnesia editor ERROR IN HPS FILE! - LienCraft - 02-08-2014

[/i]So this problem goes away when i delete the key codes but when i enter it i can't start my Custom Story, HELP!

My Hps File:

void OnStart()
{
AddUseItemCallback("", "Key1", "Key1Door", "Door1", true);
}

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

{
SetEntityPlayerInteractCallback("Key1", "ActivateMonster", true);

AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void MonsterFunction(string&in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0.001, "");
SetEntityActive("servant_grunt_1", true);
}

void ActivateMonster(string &in item)
{
SetEntityActive("Brute1", true);
AddEnemyPatrolNode("Brute1", "PathNodeArea_3", 0, "idle");
AddEnemyPatrolNode("Brute1", "PathNodeArea_4", 0, "idle");
AddEnemyPatrolNode("Brute1", "PathNodeArea_5", 0, "idle");
AddEnemyPatrolNode("Brute1", "PathNodeArea_6", 0, "idle");
AddEnemyPatrolNode("Brute1", "PathNodeArea_7", 0, "idle");
AddEnemyPatrolNode("Brute1", "PathNodeArea_8", 0, "idle");
AddEnemyPatrolNode("Brute1", "PathNodeArea_9", 0, "idle");
}


RE: Amnesia editor ERROR IN HPS FILE! - Wapez - 02-08-2014

(02-08-2014, 04:05 PM)LienCraft Wrote: {
SetEntityPlayerInteractCallback("Key1", "ActivateMonster", true);

AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

These brackets are not connected to a function. Are they supposed to be in the OnStart() function maybe?

PHP Code:
void OnStart()
{
SetEntityPlayerInteractCallback("Key1""ActivateMonster"true);

AddEntityCollideCallback("Player""PlayerCollide""MonsterFunction"true1);




RE: Amnesia editor ERROR IN HPS FILE! - Mudbill - 02-08-2014

Also be sure to move those functions to your already existant OnStart block. Having 2 will also cause a crash, and naming it OnStart2 will have it lose its effect.

Just felt like I'd mention this because I've seen many people try it.