Frictional Games Forum (read-only)
Enemy does not patrol - 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: Enemy does not patrol (/thread-14234.html)



Enemy does not patrol - .eX. - 03-25-2012


void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_1", 3.50,"");
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_2", 0,"");
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_3", 0,"");
AddEntityCollideCallback("servant_brute_1", "PathNodeArea_3", "FadeEnemyToSmoke", false, 0);
FadeEnemyToSmoke("servant_brute_1", true);
}

enemy just stands still, can u plz help me with this ? I wanted em to walk to these path nodes and on the 3d note to fade (I am new to scripting plz be gentle)


RE: Enemy does not patrol - Your Computer - 03-25-2012

If he is standing still after that, then you either have the wrong monster or the collision condition did not occur. Your script will actually have the monster turn into smoke before it even has the chance to patrol. So the fact that you can still see the monster means you have one of the two issues i mentioned.


RE: Enemy does not patrol - .eX. - 03-25-2012

how can I make monster fade after reaching certain point ? can u give me example plz ? and yeah there was wrong condition sry


RE: Enemy does not patrol - Your Computer - 03-25-2012

(03-25-2012, 04:47 PM).eX. Wrote: how can I make monster fade after reaching certain point ? can u give me example plz ? and yeah there was wrong condition sry

Depends on whether or not you want it to be capable of chasing the player. Also, as far as i know, path nodes are not applicable to entity collision callbacks; you're going to need a script area. I'm not going to provide any example code since your current code shows that you have knowledge of entity collision callbacks, but your current code just needs to change the child name for the FadeEnemyToSmoke collision callback to a script area, remove the FadeEnemyToSmoke function from the MonsterFunction function, and define a FadeEnemyToSmoke function which complies with the entity collision callback syntax, which calls the original FadeEnemyToSmoke function.


RE: Enemy does not patrol - .eX. - 03-25-2012

void OnStart()
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_1", 3.50,"");
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_2", 0,"");
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_3", 0,"");
AddEntityCollideCallback("servant_brute_1", "ScriptArea_1", "MyFunc", false, 0);
}
void MyFunc(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_brute_1", true);
}


this works perfectly thx u explained everything perfectly