Frictional Games Forum (read-only)

Full Version: Brute Path Nodes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm not sure of the problem but my brute has path nodes set and in MapView it doesn't show that the nodes are linked. When I approach the scene in the game, the brute goes nuts and it almost looks like its lagging. The brute stays in place and will do multiple animations and sometimes start to float. Here's my script:
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", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 3, "");
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, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_12", 0, "");
for (int i = 1; i < 13; i++)
{
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_"+i, 0, "");
}
}

void OnLeave()
{
}
(04-28-2013, 02:38 PM)JohnandSerena Wrote: [ -> ]I'm not sure of the problem but my brute has path nodes set and in MapView it doesn't show that the nodes are linked. When I approach the scene in the game, the brute goes nuts and it almost looks like its lagging. The brute stays in place and will do multiple animations and sometimes start to float. Here's my script:
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", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 3, "");
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, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_12", 0, "");
for (int i = 1; i < 13; i++)
{
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_"+i, 0, "");
}
}

void OnLeave()
{
}

It's obvious that it drives nuts, you are assigning lots of path nodes at the same time: Just:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunction", true, 1);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
for (int i = 1; i < 13; i++)
{
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_"+i, 0, "");
}
}
PHP Code:
void MonsterFunction(string &in asParentstring &in asChildint alState)
{
SetEntityActive("servant_brute_1"true); 
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_1"0"");
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_2"0"");
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_3"3"");
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"");
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_9"0"");
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_10"0"");
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_11"0"");
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_12"0"");
for (
int i 113i++)
{
AddEnemyPatrolNode("servant_brute_1","PathNodeArea_"+i0"");
}


This might be your problem. Unless your nodes are in strange places?

PHP Code:
void MonsterFunction blahblah
{
  for(
int i=1;i<13,i++)
  {
    
AddEnemyPatrolNode(etcetc)
   }


Beat me to it.
I tried your script and I got the same result. Mapview shows that my nodes aren't linked.
Can you attach a download to your map file?
(04-28-2013, 07:35 PM)Mr Credits Wrote: [ -> ]Can you attach a download to your map file?
Now, I'm not sure if this is the exact reason, but when I moved the grass above the nodes, they connected.

Basically what chaser says. =p
Aaah, now I know why! Wink

You used a static_object, right? All static objects have collision enabled by default. As the grass was in the middle of the relation of the Path nodes, they couldn't link (it would be like trying to make a brute walk from a room to another crossing through the wall)

You must simply disable collision in grass and it'll work Wink