Frictional Games Forum (read-only)

Full Version: Enemy does not patrol
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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)
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.
how can I make monster fade after reaching certain point ? can u give me example plz ? and yeah there was wrong condition sry
(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.
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