[Tutorial]Create and Add your Own Entities

Discussion in 'Tutorials & Resources' started by Blue552, Nov 2, 2009.

  1. Blue552

    Blue552 L3: Member

    Messages:
    137
    Positive Ratings:
    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.

    [​IMG]

    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: Nov 2, 2009
  2. senne teddy

    senne teddy L1: Registered

    Messages:
    3
    Positive Ratings:
    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]
     
    • Thanks Thanks x 1
  3. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,868
    Positive Ratings:
    4,896
    Entities just call upon parts of the games code. You can allow acess to certain entities, but not create them without modding the game.
     
    • Thanks Thanks x 1
  4. Blue552

    Blue552 L3: Member

    Messages:
    137
    Positive Ratings:
    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.
     
  5. jpr

    aa jpr

    Messages:
    1,095
    Positive Ratings:
    507
    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
     
  6. Cameron:D

    Cameron:D L6: Sharp Member

    Messages:
    363
    Positive Ratings:
    145
    Fgd files contain the references to the properties that are used in the engine. The entity itself is hard coded into the game.
     
    • Thanks Thanks x 1
  7. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,495
    This is genious! How come no one told me about this befo...

    ..oh yeah, It doesn't work. AT ALL!
     
    • Thanks Thanks x 1
    • Funny Funny x 1
  8. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    This is such a conglomeration of misinformation...

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

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

    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.
     
    • Thanks Thanks x 9
  9. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,568
    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: Nov 2, 2009
  10. drp

    aa drp

    Messages:
    2,251
    Positive Ratings:
    2,552
    you're definitely paying for my eye surgery now.
     
  11. littleedge

    aa littleedge L1111: Clipping Guru

    Messages:
    983
    Positive Ratings:
    573
    Highlight the text, Drpepper. Also: Snark gets a Thanks for awesomeness, and you, Mr. Blue, get a disthanks (in mah head) for this.
     
    • Thanks Thanks x 1
  12. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    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.
     
    • Thanks Thanks x 1