Frictional Games Forum (read-only)
Monster area trigger - 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: Monster area trigger (/thread-17427.html)



Monster area trigger - tokugawa1 - 08-02-2012

OK so when i added the path nodes and the stuff needed for the monster to spawn my map keeps crashing with this error:
FATAL ERROR: Could not load script file 'custom_stories/The Deception/maps/The Deception.hps'!
main (9,1) : ERR :Expected ',' or ';'


void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
void MonsterFunction(string &in asParent, string &in asChild, int alState) <-------This is the line number 9
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0.0f, false);
RemoveItem("key_1");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

void Spawn_Monster(string &in entity)
{
SetEntityActive("servant_brute_1", true);
SetEntityActive("servant_grunt_3", true);
}


RE: Monster area trigger - Adny - 08-02-2012

The "usekeyondoor" function didn't have any open/close brackets after it. I fixed that and added a default door unlocking script. Tbh I'm not quite sure what you're trying to do here, it seems that parts of 1 function are being separated for no real reason. Anyways, here it is:

void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlayGuiSound("unlock_door", 0.8f);
RemoveItem(asItem);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

void Spawn_Monster(string &in asEntity)
{
SetEntityActive("servant_brute_1", true);
SetEntityActive("servant_grunt_3", true);
}


RE: Monster area trigger - tokugawa1 - 08-02-2012

(08-02-2012, 07:38 PM)andyrockin123 Wrote: The "usekeyondoor" function didn't have any open/close brackets after it. I fixed that and added a default door unlocking script. Tbh I'm not quite sure what you're trying to do here, it seems that parts of 1 function are being separated for no real reason. Anyways, here it is:

void OnStart()
{
AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("monster_tinderbox", "Spawn_Monster", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlayGuiSound("unlock_door", 0.8f);
RemoveItem(asItem);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

void Spawn_Monster(string &in asEntity)
{
SetEntityActive("servant_brute_1", true);
SetEntityActive("servant_grunt_3", true);
}
thx it worked