Jumpman
Junior Member
Posts: 31
Threads: 10
Joined: May 2011
Reputation:
0
|
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 |
|
Khyrpa
Senior Member
Posts: 638
Threads: 10
Joined: Apr 2011
Reputation:
24
|
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 |
|
Jumpman
Junior Member
Posts: 31
Threads: 10
Joined: May 2011
Reputation:
0
|
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 |
|
Jumpman
Junior Member
Posts: 31
Threads: 10
Joined: May 2011
Reputation:
0
|
RE: Enemy Patrol
np. I fixed it
|
|
05-13-2011, 03:01 PM |
|
ferryadams10
Senior Member
Posts: 288
Threads: 40
Joined: Apr 2011
Reputation:
19
|
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 |
|
|