Frictional Games Forum (read-only)

Full Version: Patrol Node Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I set up a path for a grunt and also placed the correct script into the file.
The monster also walks that path just perfectly. The problem is: Instead of disappearing after the last pathnode, it just walks through the entire patrol again, even when it doesn't see me (because I'm hiding in a closet).
Here's the script:

Code:
void OnStart()
{
StopMusic(3.0f, 0);
PlaySoundAtEntity("", "door_level_cellar_close.snt", "level_celler_1", 0, false);
PlayMusic("01_amb_darkness.ogg", true, 80, 1, 0, false);
CompleteQuest("00Investigate","00Investigate");  
AddEntityCollideCallback("Player", "activateScare", "ScareZoneEnable", true, 1);
AddEnemyPatrolNode("cellargrunt", "cellar_pn1", 0, "");
AddEnemyPatrolNode("cellargrunt", "cellar_pn2", 0, "");
AddEnemyPatrolNode("cellargrunt", "cellar_pn3", 0, "");
AddEnemyPatrolNode("cellargrunt", "cellar_pn4", 0, "");
AddEnemyPatrolNode("cellargrunt", "cellar_pn5", 0, "");
AddEnemyPatrolNode("cellargrunt", "cellar_pn6", 0, "");
AddEnemyPatrolNode("cellargrunt", "cellar_pn7", 0, "");
AddEnemyPatrolNode("cellargrunt", "cellar_pn8", 0, "");
}
I had this problem once too, but the solution was to make it go farther then before. I think you can't be able to hear it either, for it to disappear.
If everything fails you can create a script area and add a collide callback with the grunt to make it disappear.
(10-21-2010, 06:28 PM)Zergalag Wrote: [ -> ]I had this problem once too, but the solution was to make it go farther then before. I think you can't be able to hear it either, for it to disappear.

Thanks, that worked. Smile

Also thanks to you, Pandemoneus. Wink
Glad to be of service. Smile
One thing you should know about patrol nodes is that they will auto-link if there is a clear path between them. This means that you aren't required to add every node you want your enemy to path to, only the ones where you want him to pause or finish patrolling.

In an example, you want the enemy to path from Point A to Point C. Instead of adding a script like this:

Quote:AddEnemyPatrolNode("Enemy", "Point_A", 0, "");
AddEnemyPatrolNode("Enemy", "Point_B", 0, "");
AddEnemyPatrolNode("Enemy", "Point_C", 0, "");

You could instead do this:

Quote:AddEnemyPatrolNode("Enemy", "Point_A", 0, "");
AddEnemyPatrolNode("Enemy", "Point_C", 0, "");

Assuming A, B and C ar linear, they will auto-link, and the enemy will path seamlessly from Point A to Point C without stopping at Point B.
(10-21-2010, 06:17 PM)ThePaSch Wrote: [ -> ]The problem is: Instead of disappearing after the last pathnode, it just walks through the entire patrol again.

What? Thats odd. I made a fun level and when the grunt came to his last patrol node, he disappeared. I was acculty close to him too.
(10-26-2010, 02:28 AM)Cellrage Wrote: [ -> ]Assuming A, B and C ar linear, they will auto-link, and the enemy will path seamlessly from Point A to Point C without stopping at Point B.
If they're linear, you could leave out point B entirely as well. Rolleyes