Adding an AI Enemy to a Map?

Aqwertybqwerty

L1: Registered
Aug 26, 2011
49
2
Specifically, if I wanted to create a new kind of AI enemy similar to monoculous or the HHH, how would I go about that? Are they hardcoded into the game, or can they be created entirely within hammer?
 
T

The Asylum

first you need to place a tf_logic_holiday entity in your map, and set it's holiday to Halloween

Before you do anything else, you need to put a prop_static of the HHH somewhere in your map, and ambient_generic entites of all his associated sounds. Run your map like that, and what it'll do is create a precache of the HHH and his animations, sounds, etc. If you don't, the map will crash.

Now once that's done, you need this setup:

env_entity_maker

name: maker
point_template to spawn: hhh_template

point_template

name: hhh_template
template 1: headless_hatman

headless_hatman (won't be in the fgd, you'll have to create this entity class yourself)

targetname: headless_hatman

Now all you need to do is send the entity maker a ForceSpawn output, and you should have a HHH spawning.

To actually make him move around though, you need a control point in your map (where he will be "attrcted" to), and a nav mesh. To make a nav mesh, turn sv_cheats on and type in console nav_generate
 
Apr 13, 2009
728
309
Well, you could try to create a boss-enemy out of regular entities. A very basic example would be the train/sawblades but with some imagination and a good knowledge of source entities you can make some pretty crazy stuff.
 

Aqwertybqwerty

L1: Registered
Aug 26, 2011
49
2
Well, you could try to create a boss-enemy out of regular entities. A very basic example would be the train/sawblades but with some imagination and a good knowledge of source entities you can make some pretty crazy stuff.

Actually, that's a good idea! I was thinking of a giant "mothership" hovering over the map, and every minute or two it would release 1 or more UFO "drones" that would bomb the map or, ideally, target players.

Of course, i'm not experienced with those kinds of entities yet, and I can't model at all...