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
PathNode loop
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#1
PathNode loop

Hello Forum! I'm working on a monster right now and I'm trying to make it loop it's pathnodes. But I do not understand how to script it. I've read the script on the wiki, but don't get it.

wiki page: http://wiki.frictionalgames.com/hpl2/tut...rpathnodes

Can someone explain how to do it?
12-07-2011, 10:44 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: PathNode loop

The monster will only continue on its patrol path under one of two conditions: The player is still within its activation distance, or the player is still looking at the monster. If neither of these conditions are met, the monster will be automatically deactivated. That wiki article shows how to add path nodes to the monster, so i won't show how here.

Tutorials: From Noob to Pro
12-07-2011, 04:22 PM
Website Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#3
RE: PathNode loop

Ok, too bad. But, is there a way to compress the path nodes, so that I don't have put like a hundred
"AddEnemyPatrolNode" in the script?
12-07-2011, 08:47 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: PathNode loop

(12-07-2011, 08:47 PM)i3670 Wrote: Ok, too bad. But, is there a way to compress the path nodes, so that I don't have put like a hundred
"AddEnemyPatrolNode" in the script?
If you're not moving the enemy across the Atlantic Ocean or up TONS of stairs, you don't need a HUNDRED pathnodes... I covered a large area in my 24-hour challenge with about 15-20 pathnodes in total >> and that was 3 different enemies.

Just copy and paste as many as needed and change the number of the path node
(This post was last modified: 12-07-2011, 09:15 PM by Statyk.)
12-07-2011, 09:08 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#5
RE: PathNode loop

Have you been hacking my computer? Big Grin


No, I'm putting him in a corridor, don't want him to get stuck in the walls.
12-07-2011, 09:27 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#6
RE: PathNode loop

(12-07-2011, 08:47 PM)i3670 Wrote: Ok, too bad. But, is there a way to compress the path nodes, so that I don't have put like a hundred
"AddEnemyPatrolNode" in the script?
Yes
for (int b = 1; b <=100; b++) AddEnemyPatrolNode("ENEMY", "PathNodeArea_"+b, 0.01f, "");
(this example adds 100 pathnodes to ENEMY starting from PathNodeArea_1. Most useful for walking a straightforward path. )

Insanity. Static.
(This post was last modified: 12-07-2011, 10:05 PM by Juby.)
12-07-2011, 09:49 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#7
RE: PathNode loop

If you add all 100 path nodes, the grunt will pause momentarily at each one. If you want the grunt to move from the first path node to the last, simply script the enemy to move to the last one. The AI will handle the pathing, and the monster will take the shortest route to that node, and use the path nodes only if a direct path to the destination is obstructed.

On the flipside of that, if the grunt tries to make a straight line for the destination but you want it to take a very specific route, script it to move to waypoints along the path -- say, every 20th node. That way the monster isn't constantly stopping, and it takes the path you want it to.

12-07-2011, 09:57 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#8
RE: PathNode loop

(12-07-2011, 09:57 PM)palistov Wrote: If you add all 100 path nodes, the grunt will pause momentarily at each one. If you want the grunt to move from the first path node to the last, simply script the enemy to move to the last one. The AI will handle the pathing, and the monster will take the shortest route to that node, and use the path nodes only if a direct path to the destination is obstructed.
Will that work if I put it like this:

Let's say we have a + shaped map. There are 3 pathnodes. The monster starts at the upper arm. PathNode1 is in the left arm, Pathnode2 in the bottom and 3rd in the right one. I want him to follow the 1-2-3.

AddEnemyPatrolNode("grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("grunt_1", "PathNodeArea_3", 2, "");



(This post was last modified: 12-07-2011, 11:25 PM by i3670.)
12-07-2011, 11:18 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#9
RE: PathNode loop

Monsters have trouble with turning corners or going around corners, so if you want a monster to go around a corner, you'll need at least three path nodes so that it forms the shape of a L per corner turn. For a plus sign intersection, i would expect 5 path nodes would be required for best results.

Tutorials: From Noob to Pro
12-07-2011, 11:50 PM
Website Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#10
RE: PathNode loop

Yeah if it's a cross shape, you'll need a node in the intersection, so the grunt knows to path to the center and turn the corner. There's no real need for any other nodes, but the AI for detecting and investigating sounds/player sightings requires nearby path nodes, so populate the cross with a node every 1-2 meters, regardless of whether or not you'll actually tell the grunt to move to that exact location.

12-08-2011, 12:52 AM
Find




Users browsing this thread: 3 Guest(s)