Frictional Games Forum (read-only)

Full Version: Amnesia editor ERROR IN HPS FILE!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[/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");
}
(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);

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.