Frictional Games Forum (read-only)
Strange Problem. - 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: Strange Problem. (/thread-11973.html)



Strange Problem. - spamqad - 12-21-2011

Hello fellow developers. Many days ago I cam across a common problem facing me and my customs story. My script would not work. so I posted on the forms, and good fellow triadtimes came to help me. however after taking his advice it still did not work. Infact not even the test script seemed to work. Please if someone knows the answer to my problem then dont hesitate to answer it.

The point of the script was that when the player walked into the first area ("ScriptArea_1") A monster would spawn. Then if the player tried to retreat to the cabinet they would trigger the next Area ("Causing a monster to spawn in the cabinet itself and run out.

-----------------------------------------------------------------------------------------------------------

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 0, "");
AddEntityCollideCallback("Player", "ScriptArea_2", "PlayerCollide2", true, 1);
}

void PlayerCollide2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 2, "");
}
-----------------------------------------------------------------------------------------------------------

The point of test script was to see if i could put a chair into an area and turn an entity on.

-----------------------------------------------------------------------------------------------------------

void onStart ()
{
AddEntityCollideCallback("ChairKey", "ChairLock", "ChairComplete", true, 0);
}
void ChairComplete()
{
SetEntityActive("ChairCandle", true);
}
-----------------------------------------------------------------------------------------------------------
*bump*


RE: Strange Problem. - RedMser - 03-31-2012

(12-21-2011, 12:01 AM)spamqad Wrote: Hello fellow developers. Many days ago I cam across a common problem facing me and my customs story. My script would not work. so I posted on the forms, and good fellow triadtimes came to help me. however after taking his advice it still did not work. Infact not even the test script seemed to work. Please if someone knows the answer to my problem then dont hesitate to answer it.

The point of the script was that when the player walked into the first area ("ScriptArea_1") A monster would spawn. Then if the player tried to retreat to the cabinet they would trigger the next Area ("Causing a monster to spawn in the cabinet itself and run out.

-----------------------------------------------------------------------------------------------------------

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 0, "");
AddEntityCollideCallback("Player", "ScriptArea_2", "PlayerCollide2", true, 1);
}

void PlayerCollide2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 2, "");
}
-----------------------------------------------------------------------------------------------------------

The point of test script was to see if i could put a chair into an area and turn an entity on.

-----------------------------------------------------------------------------------------------------------

void onStart ()
{
AddEntityCollideCallback("ChairKey", "ChairLock", "ChairComplete", true, 0);
}
void ChairComplete()
{
SetEntityActive("ChairCandle", true);
}
-----------------------------------------------------------------------------------------------------------
*bump*
I beleave you try to enable the Grunt 2 times: one at the first collision and again on the 2nd one. Also, when testing the map, are there no errors?