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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Path Nodes.
Bonehead Offline
Member

Posts: 50
Threads: 12
Joined: Apr 2013
Reputation: 1
#1
Path Nodes.

Alright. I'm new to scripting and seeking some help. I have a basic system set up for when the player grabs a key, a grunt spawns in an outside hallway, then walks into the room. The player must hide in a provided cabinet in the room and stay hidden until he has left. My problem is, is that the grunt is pausing at EVERY patrol node. I'd like him to pause at 2 or two of them.. but not at ALL of them. Here's my script.


void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
}


Also if anyone can give me info on how to have him DESPAWN at his final patrolnode, that'd be great.
(This post was last modified: 05-19-2013, 04:37 PM by Bonehead.)
05-18-2013, 11:34 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Path Nodes.

You could use an area and a collidecallback. When the monster collides with the area just use the SetEntityActive command.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
05-18-2013, 11:38 PM
Find
Bonehead Offline
Member

Posts: 50
Threads: 12
Joined: Apr 2013
Reputation: 1
#3
RE: Path Nodes.

(05-18-2013, 11:38 PM)i3670 Wrote: You could use an area and a collidecallback. When the monster collides with the area just use the SetEntityActive command.

As for despawning? I'll try that out.. I'm still having the issue of him pausing for about 2-3 seconds on every node. Do I have a command wrong or should I reduce the amount of patrol nodes?
05-18-2013, 11:40 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#4
RE: Path Nodes.

Don't assign him each path node. Assign only the one you want him to travel to. The AI will select path based on the path nodes you place. If you don't like the path he takes, split it up into segments (every 4th node or so), or you could just adjust the path node placement in your map.

Edit: To clarify, don't DELETE any nodes. You want to have plenty in your map. Just don't assign grunty every single one.

(This post was last modified: 05-19-2013, 12:02 AM by palistov.)
05-19-2013, 12:01 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: Path Nodes.

The monster pauses at every path node because you told it to walk up to every path node (also, 0 doesn't mean don't waste any time on the path node). Don't use an entity collide callback, since the monster will still despawn even if the player isn't hiding or if the player is looking at the monster. Instead, make use of the Callbackfunc field for the monster in the level editor and check for OnAutoDisabled.

Tutorials: From Noob to Pro
05-19-2013, 12:07 AM
Website Find
Bonehead Offline
Member

Posts: 50
Threads: 12
Joined: Apr 2013
Reputation: 1
#6
RE: Path Nodes.

(05-19-2013, 12:07 AM)Your Computer Wrote: The monster pauses at every path node because you told it to walk up to every path node (also, 0 doesn't mean don't waste any time on the path node). Don't use an entity collide callback, since the monster will still despawn even if the player isn't hiding or if the player is looking at the monster. Instead, make use of the Callbackfunc field for the monster in the level editor and check for OnAutoDisabled.

I'll check it out.. and do monsters automatically de-spawn after a certain distance? I got the nodes working.. and when I have him walk a decent bit away, he just despawns.. Is that normal and automatic?
05-19-2013, 04:45 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#7
RE: Path Nodes.

(05-19-2013, 04:45 AM)Bonehead Wrote: I'll check it out.. and do monsters automatically de-spawn after a certain distance? I got the nodes working.. and when I have him walk a decent bit away, he just despawns.. Is that normal and automatic?

Monsters automatically despawn if the player is outside the monster's activation distance. Monsters also automatically despawn if they reach the last path node assigned to them and the player does not see the monster.

Tutorials: From Noob to Pro
05-19-2013, 09:22 AM
Website Find
Bonehead Offline
Member

Posts: 50
Threads: 12
Joined: Apr 2013
Reputation: 1
#8
RE: Path Nodes.

Okay thank you.
05-19-2013, 04:37 PM
Find




Users browsing this thread: 1 Guest(s)