Map Placeable Entities
Entities can be placed through the Entity Tool, as with everything else in s&box they are automatically hotloaded within your game and Hammer.
If your game is published on asset.party, people can place entities for your game after downloading all contents of your game in Hammer (models, materials and particles)
Creating an entity
Creating entities that can be placed in Hammer is as simple as marking them with [HammerEntity]
.
Properties
Any property in your class can be exposed to Hammer using the [Property]
attribute.
Inputs
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:
Outputs
Any output in your entity class is automatically exposed to Hammer as an output.
An example of an output being defined:
Firing Outputs
You can fire your output using Output.Fire(sender)
like this:
Hammer Attributes
All of these are optional attributes that can be added to your class to change its behavior and appearance in Hammer.
This is not an exhaustive list, and a more complete list can be found here
[Solid]
Tells Hammer this entity is brush based.
[SupportsSolid]
Tells Hammer this point entity can also be a brush entity, such as ent_door
entity.
[EditorModel]
Tells Hammer what model to use for the entity and is added to the class.
[EditorSprite]
Tells Hammer what sprite to use for the entity and is added to the class.
[Model]
Makes it so the model, skin and bodygroups can be set and changed in Hammer.
[AutoApplyMaterial]
Automatically applies the supplied material to the tied brush.