[Tutorial]Create and Add your Own Entities

Blue552

L3: Member
Sep 16, 2009
137
18
If this thread is inaccurate . . . lock it? no point trolling



This tutorial will teach you how to create your own entities and use additional entities in your map.

First off, an entity is pretty much anything which isn't already defined as a material, model or world brush, this includes the player.

This first section will be brief and I advise only decent programmers or intelligent people view it http://developer.valvesoftware.com/wiki/Your_First_Entity

By creating your own entities you have absolute freedom to create what ever you want - Including entirely new weapons and characters. Along with sounds, textures and models they could be added to your specific map and still work within TF2.
__________________________________________________________________________________________________________________________________

Now for the more useful section.

There are many custom entities floating around on the internet which you may find useful - yet more commonly you might want to nab entities from different games.

I'm going to show you how to do this:

Custom FDG's:

Any custom FDG's you download, you're going to want to extract to this location.

Program Files -> steam -> steam apps -> [Your User Name] -> sdk -> bin

Adding new entities:

It is actually very easy, open up hammer and go to tools -> options. From there just select add and direct to your FDG's.

FGD-3.gif


You're done - new entities :D

__________________________________________________________________________________________________________________________________

You can snatch entities from other games, most will be useless [weapon_shotgun for instance] yet there are a few golden ones Valve missed out on.

An example of a relevant TF2 entity you could create is an alternate KoTH type. Where you gain time for standing in a certain area rather then having to capture it first. Time goes up as well, rather then down.
 
Last edited:

senne teddy

L1: Registered
Nov 2, 2009
3
1
You cannot create your own entity's only define the ones that are already in the game.

You can find a good FGD here
[ame="http://forums.tf2maps.net/showthread.php?t=4674"]Ultimate Mapping Resource Pack - TF2Maps.net[/ame]
 

Freyja

aa
Jul 31, 2009
2,994
5,813
Entities just call upon parts of the games code. You can allow acess to certain entities, but not create them without modding the game.
 

Blue552

L3: Member
Sep 16, 2009
137
18
Valve adds new entities all the time, didn't they just add trigger_stun?

We definitely know that koth_logic is a newly added entity.

It's just a .cpp file coded in C++ The game engines functions are pre-defined and it requires adjusting the code but you can do a lot with just .cpp file including creating that alternate KoTH gametype.
 

jpr

aa
Feb 1, 2009
1,094
1,085
As far as I know they add them into the game's code, which we have no access to and therefore can't make new entities... I don't think FGDs have anything to do with the actual entities
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,818
This is genious! How come no one told me about this befo...

..oh yeah, It doesn't work. AT ALL!
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
This is such a conglomeration of misinformation...

"I... I don't even know where to start with you."

By creating your own entities you have absolute freedom to create what ever you want - Including entirely new weapons and characters. Along with sounds, textures and models they could be added to your specific map and still work within TF2.

You have pretty much the exact opposite of absolute freedom. You cannot create anything. Definitely not weapons and characters.

It's just a .cpp file coded in C++ The game engines functions are pre-defined and it requires adjusting the code but you can do a lot with just .cpp file including creating that alternate KoTH gametype.

Yes, it's "just" C++, but it's compiled into the server binary by valve and isn't something we can just make willy nilly as we choose. That article you linked is for people making their own mod, because that's where you can make your own entities. It is technically possible to make new entities in TF2 as a server side plugin, a few people can do this (voogru in particular), but this is nothing you can do in the map. The server has to have the code for it.

I tried to tell you this in the other thread you made, but apparently you outright ignored me...

"I mean, do you even know who your talkin to? Do you have any idea... any idea who I am?"

I know how FGDs and entities work. I've made and continue maintain my own which is included in my TF2 resource pack linked in my sig. All the FGD does is tell Hammer what to display. It has absolutely zero bearing on the game itself. The entity code still has to exist in the game's binaries. I can make Hammer display entities that are in the code but left out of the default FGD, but there is no way I can go make my own or steal one from another game.

"Basically... kinda a big deal..."

You don't even actually explain how to do this stuff. You don't give a link to places people can download custom FGDs, nor do you explain how to write your own. This isn't really of any help because anyone who has downloaded a custom FGD probably already knows how to use it, or the site they got it from tells them.

"You listening? Ok."

Next time, please, do some research into what you are trying to do before you post a "tutorial" about it. You have about three different subjects in this post that don't really fit together the way you present them it creates a horribly misinforming tutorial.

"Grass grows, birds fly, sun shines, and brudda..." I do entities. I'm the king of entities.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
To create new entities you are essentially creating a mod. You can't include any more entities that are currently present within TF2 (or the original FGD/game code the game was modified from; IE Half-Life 2. You may still be able to use some HL2 entities (such as path_corner, Valve use this as a replacement for the broken info_lighting used to change a models default origin to help with non-vertex lighting)) as is already mentioned, they are within the TF2 game code. Valve are obviously able to update this code, we are not. The best an individual can do is create a server mod or create new usable predefined entry positions within an existing entity. Such as creating the fourth control point in a single stage payload for the trainwatcher to make visible on the HUD.

Also, you seem to not understand the concept of an entity; an entity is not "pretty much anything" that isn't already defined as something else. It is a dynamic item that that can issue and take commands. These can be solid (converted world brushes) or point (invisible 'master controllers' that define the rules of the environment or used to cache items from outside of the game data such as sprites, particles, sound etc).


edit: ninja booj strikes again.
 
Last edited:

drp

aa
Oct 25, 2007
2,273
2,628
To create new entities you are essentially creating a mod. You can't include any more entities that are currently present within TF2 (or the original FGD/game code the game was modified from; IE Half-Life 2. You may still be able to use some HL2 entities (such as path_corner, Valve use this as a replacement for the broken info_lighting used to change a models default origin to help with non-vertex lighting)) as is already mentioned, they are within the TF2 game code. Valve are obviously able to update this code, we are not. The best an individual can do is create a server mod or create new usable predefined entry positions within an existing entity. Such as creating the fourth control point in a single stage payload for the trainwatcher to make visible on the HUD.

Also, you seem to not understand the concept of an entity; an entity is not "pretty much anything" that isn't already defined as something else. It is a dynamic item that that can issue and take commands. These can be solid (converted world brushes) or point (invisible 'master controllers' that define the rules of the environment or used to cache items from outside of the game data such as sprites, particles, sound etc).


edit: ninja booj strikes again.
you're definitely paying for my eye surgery now.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
To add a little analogy:

You can "add custom entities in hammer by editing the FGD" the same way you can "add custom HTML tags using notepad".

I don't care how much you want to use <awesome>tags for your</awesome> page, web browsers won't get it.