Frictional Games Forum (read-only)
Patrol 2 enemy - 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: Patrol 2 enemy (/thread-18142.html)



Patrol 2 enemy - nemero - 09-03-2012

Hi, I would like to do it on one map, patrol 2 enemies in other places. I created in level editor scriptarena 1 that make enemy 1 spawn. I found and applied to:

void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

and it works. Now I would like to do that for the second place. I scriptarena 2 and the enemy2, patchnote 11-15. How to do to make it work, first and second together?


RE: Patrol 2 enemy - Steve - 09-03-2012

well just...

void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "PlayerCollideTwo", "MonsterFunctionTwo", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
}

void MonsterFunctionTwo(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_11", 2, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_15", 0, "");

}


RE: Patrol 2 enemy - The chaser - 09-03-2012

What do you mean?
If you want the monster to follow a path and disappear, it's very simple.


void OnStart()
AddEntityCollideCallback("Player", "ScriptCollide", "Mons", true, 1);
AddEntityCollideCallback("Monster", "Erase area", "Disa", true, 1);

void Mons (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
AddEnemyPatrolNode("Monster", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_5", 0, ""); (Where the Erase area is set)
}

void Disa(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", false);
}

If you want them to patrol, so they are always there, moving, I have a more complicated system.


RE: Patrol 2 enemy - nemero - 09-04-2012

thx steve
it is what I meant

end 1 more question. For monster waterlurker I need to create water on the floor?


RE: Patrol 2 enemy - FlawlessHappiness - 09-04-2012

Yea search on how to make water. You figure it out, but remember to place pathnodes everywhere the Kaernk could get stuck