@PointClass base(Targetname) size(-4 -4 -4, 4 4 4) = my_entity : "My point entity" []
It begins with specifying its entity class which may be one of three values:
@PointClass
: The class all point entities belongs to, which is all entities not made of brushes, such as sprites and monsters.@SolidClass
: All brush entities belongs to this class, such as func_door and trigger volumes such as trigger_multiple.@BaseClass
: This isn't used by any entity directly but instead is a base that other entity declarations can inherit from.base()
: Lists one or more base classes to inherit properties from, as a comma-separated list.size()
: Used by point entities to define the size of the cube used to display it, using the minimum X, Y, Z coordinates followed by the maximum X, Y, Z coordinates.color()
: Can be used to set the colour of the display cube for point entities, in R, G, B (0-255). Otherwise it will use the default magenta.iconsprite()
: Tells the editor to render the point entity using a sprite instead of a cube, e.g. iconsprite("sprites/light.spr").studio()
: Can be used to specify a specific model for the editor to render the point entity with instead of a cube, similar to iconsprite().@PointClass base(Targetname) size(-4 -4 -4, 4 4 4) = my_entity : "My point entity"
[
health(integer) : "Health" : 10
scale(string) : "Scale"
skin(choices): "Hat color" : 0 =
[
0 : "Red"
1 : "Yellow"
2 : "Orange"
3 : "Black"
]
spawnflags(flags) =
[
1: "Start on" : 0
2: "Prefer bananas" : 1
]
]
Properties are defined with the key and its type in parenthesis, next is its descriptive name in quotation marks, and lastly an optional default value for the property, all three separated by colons.spawnflags(flags)
as the key. The flags themselves are listed within square brackets with the flag value first (1, 2, 4, 8, etc), then its descriptive name, and finally whether it should be disabled (0) or enabled (1) by default. Again, all three are separated by colons.
string
: Used for text and decimal numbers.integer
: Intended to be used for integer (whole) numbers only.flags
: As far as I know is only used for the spawnflags key.studio
: Used with the model key and can be used by editors use a file picker in the models folder, and to use this model to display the entity with.sprite
: Similar to studio but for sprites.color255
: Lets the editor know the value can be set using a colour pickerchoices
: Allows the editor to display a dropdown of preset values for the key.You must log in to post a comment. You can login or register a new account.
@ThingClass
declaration across multiple lines in cases where there's a lot ofattrs()
with long values, for readability sake. The problem is that third party programs that doesn't use a proper DSL parser and parses directly, makes assumption that it's always on one line. Worse still there's one snapshot of TB that assumes property lines must be indented, and breaks with a custom FGD written with poor indent discipline.