Adding custom entities into your map

hhhmapper

L1: Registered
Nov 1, 2010
8
0
Despite what it may seem, adding custom entities and other things is easy once you get the hang of it. Follow these steps and you can have the hhh or a rtd variant designed to fit your map!
1.) spawn an entity in hammer, wherever you want.
2.) give it a title that fits what it is, for the sake of this tutorial, let's say headless_hatman
3.) you will see nothing in the keyvalues section, let's fix that, shall we? Hit 'add' on the right side.
4.) give the key the title "targetname" and the value "headless_hatman"
5.) hit ok, and your done! Compile the map and you will have the entity right where you placed it.
6.) if you made the HHH, RUN!!! YOUR IT!!!
Thanks for reading this, hope it will serve the community well. Feel free to leave notes if there are any other things you think are important.

NOTE: don't listen to the obsolete model, if you follow the instructions, the entity will work fine.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
Er yea... you can't add custom entities that do anything you want into your map. The code has to exist in the engine build used; what gives you access to entities through Hammer's UI is the FGD.

IE this entity already exists, it just isn't defined in the FGD's entity list.
 

hhhmapper

L1: Registered
Nov 1, 2010
8
0
Er yea... you can't add custom entities that do anything you want into your map. The code has to exist in the engine build used; what gives you access to entities through Hammer's UI is the FGD.

IE this entity already exists, it just isn't defined in the FGD's entity list.

Not really, I did it with several entities I added to the files. It worked pretty well. But the point of this is for people to add pumpkin bombs, stun areas, and bots that spawn on the map loading. So you can say use this for whatever, it's just a guideline. But feel free to test it yourself.
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,818
You can't create new entities. The end.

Grazr already explained how it works.


Edit:
http://developer.valvesoftware.com/wiki/FGD
"FGD stands for Forge Game Data. It is the file extension for Hammer's game definition files. They define all of the entities of a game so mappers can select them from within the editor. It is a key point to understand that an FGD is nothing more than a reference. You cannot create or modify entities by editing a FGD, you merely give Hammer different information about what it expects to find within the game."
 
Last edited:

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
If we could implement custom entities willy nilly we'd have a lot more custom game mode support. We only wish it worked like that, because it's being constrained to the rather specific logic that has annoyed so many level designers, particularly those who've moved on from Gold Source (HL1-TFC).

A lot of the difficulty trying to implement innovative gameplay with existing entities is trying to get certain aspects of the game logic working harmoniously. Some I/O's just don't seem to apply and some flags/commands are either broken or needlessly obsolete. Like constrained ropes that don't re-attatch on a round reset, or the "hitmax" command on the math_counter that doesn't work, but manually adding X does. Or the state of the CTF entity.

Edit: The only thing you'll ever need smart edit for in TF2 is adding more capture points to the train watcher for single stage payload. Valve even defined tf_gamerules for us in the FGD now so that newbies didn't get confused by pointing I/O's at a missing game entity.
 
Last edited: