I was working on a CS and I was trying to make it so when you picked up a certain key, a Grunt would be activated and follow Path Nodes. After putting in the script and testing it, the game crashed and I got this error.
"FATAL ERROR: Could not load script file 'custom_stories/Taco's Story/maps/tacostory.hps'! main (22, 1) : ERR : Unexpected token '{'".
And here is my .hps
void OnStart()
{
AddUseItemCallback("", "sexy_1", "mansion_3", "UsedKeyOnDoor", true);
AddUseItemCallback("", "salkey_1", "level_hub_1", "UsedKeyOnCabinet", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_3", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_3", 0, false);
RemoveItem("sexy_1");
}
void UsedKeyOnCabinet(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("level_hub_1", false, true);
PlaySoundAtEntity("", "unlock_door", "level_hub_1", 0, false);
RemoveItem("salkey_1");
}
{
SetEntityPlayerInteractCallback("salkey_1", "ActivateMonster", true);
}
void OnEnter()
{
}
void OnLeave()
{
}
void ActivateMonster(string &in item)
{
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");
}
I'm new to this kind of scripting but can anyone help me?
[EDIT] Don't worry I figured it out now. I put one of the scripts on the wrong line.