O'Reilly logo

UnrealScript Game Programming Cookbook by Dave Voyles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making a pawn patrol PathNodes on a map

Our movement in the last recipe was very random, but we didn't have much control over where the bot went. With PathNodes, we can have precise control over where the bot can and cannot go.

We'll start by creating an AI Controller that allows our bot to wander from PathNode to PathNode in the order they were laid on the map.

Getting ready

Open your IDE and prepare to create a new class.

How to do it...

We've covered some simple AI up until this point, but now we want to take advantage of the PathNodes we've laid on a map. In this recipe we'll have our pawns maneuver the map using the scripts we've written.

  1. Create a new class called PatrolNodeBot and have it extend from UDKBot. We're extending from UDKBot because ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required