Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enemy Patrol
Jumpman Offline
Junior Member

Posts: 31
Threads: 10
Joined: May 2011
Reputation: 0
#1
Enemy Patrol

Enemy Patrol

I cant get the enemy to patrol the path I made, he just stands there after he spawns..

In the editor I used pathnode from the monster to the end..

The scripting is..

void OnStart()
{

AddEntityCollideCallback("Player", "EnemyTrigger", "CollideEnemyTrigger", true, 0);

AddEntityCollideCallback("Infected", "EnemyEnd", "GruntEndMusic", true, 1);

}

void OnEnter()
{
}

void CollideEnemyTrigger(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Infected", true);
GiveSanityDamage(0, true);
}

void EnemyFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Infected", true);
AddEnemyPatrolNode("Infected", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("Infected", "PathNodeArea_123", 0.0f, "");
}

void OnLeave()
{
}


So what Im I doing wrong? Plz help.
Thx
05-13-2011, 01:15 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Enemy Patrol

you have nothing that triggers this
void EnemyFunction(string &in asParent, string &in asChild, int alState)
So just put:
AddEnemyPatrolNode("Infected", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("Infected", "PathNodeArea_123", 0.0f, "");
those under give sanity damage
(This post was last modified: 05-13-2011, 01:18 PM by Khyrpa.)
05-13-2011, 01:17 PM
Find
Jumpman Offline
Junior Member

Posts: 31
Threads: 10
Joined: May 2011
Reputation: 0
#3
RE: Enemy Patrol

okey.. it's working, BUT.. he is not walking the path I made... he's taking he's own way to PathNodeArea_123.. how do I fix that?

and also.. If I want to make him loop a path, how do I do that?

thx
05-13-2011, 01:42 PM
Find
Jumpman Offline
Junior Member

Posts: 31
Threads: 10
Joined: May 2011
Reputation: 0
#4
RE: Enemy Patrol

np. I fixed it
05-13-2011, 03:01 PM
Find
ferryadams10 Offline
Senior Member

Posts: 288
Threads: 40
Joined: Apr 2011
Reputation: 19
#5
RE: Enemy Patrol

AddEntityCollideCallback("Infected", "EnemyEnd", "EnemyFunction", true, 1);

that'll do it

Got a nice sofa
Please come and have a seat for a while

05-14-2011, 10:10 AM
Find




Users browsing this thread: 1 Guest(s)