Half-Life Re-imagined competition results on their way...
Check out Skewing textures in Hammer, our newest tutorial!
Say hello to MD_AZMAL, our newest member!

logo

Site Stuff

Reference

Maps

Community

ShoutBOX

Poll

Feeling Blue

What's your favourite shade of blue?

Azure

8

Cobalt

18

Turquoise

4

Cyan

8

Royal

3

Teal

3

Onliners

15 mins

789

15 mins

abbadon

23 mins

Windawz

30 mins

Archie

33 mins

Dimbeak

46 mins

Solokiller

1 hours

Dr. Orange

Affiliates

A gaming and technology blog by TWHL admins Penguinboy and Ant. A music blog by TWHL users Ant and Hugh.

Putting Monsters On Paths

By Chris 'autolycus' Bokitch

Introduction

This article demonstrates how to make a monster follow a path until it's AI kicks in (usually when it sees a player). This effect can be used to give a level a more dynamic feel and better replayability -- monsters won't always be in the same spot. This method is perfect for making patrolling groups of soldiers and other nasties.

Setup

The setup for this method is quite simple. Create a path of path_corners. In the example map the path_corners form a continuous loop (see picture below). Now, create a monster. In this example, we've used a monster_barney security guard. In his properties, set the Target value to the name of the first path_corner.


Hey -- that's pretty much all there is to it!

The example map is laid out so that the barney follows his path around a square set of corridors. You are in an area above him, but the floor is transparent so you can follow his movements.

The monster will follow the path until it's AI kicks in. In this case, if Barney were to see you, he'd stop following the path and greet you. If we'd used a soldier instead, upon seeing the player he'd start shooting. You can test these situations out by noclipping through the floor of the example map and letting the monster see you.

If you want the monster to do something in particular when his AI kicks in and he stops following the path, set the Trigger Condition and Trigger Target properties of the monster. More information on these can be found in the Common Monster Properties article.

Grr! Argh! Bug!

Due to a bug, the method described here will not work properly if a game is saved and reloaded. The NPCs state is not saved properly. Upon reloading the saved game, the NPC will just stand where he is and will not continue to follow the path. This tutorial will be expanded at a later date with different solutions to this problem.

Resources

Below is a list of entities related to this tutorial.

For a more concrete illustration, check out the example map linked below.