Linking Entities to Hammer
Entities defined in your addon will automatically generate an FGD and put it into your addons
To link this entity to Hammer you need to add a [Library] Attribute to your class, this will define the entity name and description. A basic example:
All of these are optional attributes that can be added to your class to change the behaviour in Hammer.
[Hammer.Solid] tells Hammer this entity is brush based.
[Hammer.EditorModel] tells Hammer what model to use for the entity and is added to the class.
[Hammer.EditorSprite] tells Hammer what model to use for the entity and is added to the class.
[Hammer.EntityTool] appends this Entity to Hammer's Entity tool list like so:
[Hammer.Model] makes it so the model, skin and bodygroups can be set and changed in Hammer.
[Hammer.Skip] can be used if you do not want your entity exposed in Hammer.
Any property in your class can be exposed to Hammer using the [Property] attribute.
An example of a property being defined:
Your entity properties will then show up in Hammer:
Supported property types:
Any method in your entity class can be exposed to Hammer as an input using the [Input] attribute - parameters you define are automatically handled.
An example of an input being defined:
Any Output in your entity class is automatically exposed to Hammer as an output.
An example of an output being defined:
You can fire your output using
Entity.FireOutput(name, sender) like this: