Skip to content

Commit 5c1e936

Browse files
authored
Clarify Godot/Trench transparency, Spawn Type
1 parent 8e6ef41 commit 5c1e936

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

docs/class-reference.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ These classes enable various Trenchbroom features for use in your game.
1717

1818
## TrenchbroomTag
1919

20+
A matching filter that identifies type of brushes and textures and applies in-editor appearance. Does not affect in-game appearance or in-game functionality.
21+
2022
**Tag Name**
2123

24+
Name to describe this tag. Not used as the matching pattern.
25+
2226
**Tag Attributes**
2327

2428
An array of strings determining the in-editor appearance of brushes/faces that match this tag.
@@ -72,11 +76,11 @@ A list of all [FGD](entities/fgd.md) files to include in the [Game Definition](e
7276

7377
**Brush Tags**
7478

75-
A lookup pattern for all brush entity classnames in the map to apply editor hints, such as `_transparent`.
79+
A lookup pattern for all brush entity classnames in the map to apply editor hints, such as `_transparent`. Only affects appearance in Trenchbroom, does not apply to making materials transparent in Godot.
7680

7781
**Face Tags**
7882

79-
A lookup pattern for all texture names in the map to apply editor hints, such as `_transparent`.
83+
A lookup pattern for all texture names in the map to apply editor hints, such as `_transparent`. Only affects appearance in Trenchbroom, does not apply to making materials transparent in Godot.
8084

8185
**Face Attrib Surface Flag**
8286

@@ -130,6 +134,10 @@ All base classes placed here will give the same class properties, meta propertie
130134

131135
**Class Properties** - A dictionary of properties.
132136

137+
Keys must be of type String. Keys are read as the property name in Trenchbroom.
138+
139+
Values must be of the following types:
140+
133141
Once exported to the Trenchbroom game config, the dictionary values are written by editing entities in Trenchbroom, and read by accessing `properties` on a QodotEntity once the map is built.
134142

135143
You can also set default values for your properties by repeating this process in Meta Properties, matching the key names and value datatypes from this dictionary.
@@ -138,25 +146,27 @@ You can also set default values for your properties by repeating this process in
138146

139147
Ensure the description's key matches the property's key. Description values can only be strings.
140148

141-
**Meta Properties** - Editor-specific properties, such as the default color and size used to represent this class.
149+
**Meta Properties** - Editor-specific properties, such as the default color and size used to represent this class. Primarily used by point classes.
142150

143-
Add an entry with a matching key to an existing property, set the value to the same data type, and whatever value is present will become the default. Only one meta property is read per class property.
151+
Keys must be of type String. Values must be a type determined by the key name.
152+
153+
Possible key/value pairs include:
154+
| Key String | Value type |
155+
|------|-----|
156+
| size | AABB |
157+
| color | Color |
144158

145159
**Node Class** - The type of Godot node to spawn at this location.
146160

147161
### QodotFGDPointClass
148162

163+
A single point for an entity.
164+
149165
**Scene File** - The .tscn Godot scene that spawns in place of QodotEntity. The easiest way to spawn a specific node at a specific point.
150166

151167
Scene File takes priority over every other option here, especially if there's already a script attached to the .tscn file.
152168

153-
**Script Class** - The script to attach to your entity's root node.
154-
155-
This is ideal for spawning nodes without a .tscn file. If you want to access this entities' Class Properties, add a script here that `extends QodotMap` and accesses `properties["key_name"]`.
156-
157-
You can extend other Spatial-derived node types too, and add necessary children (CollisionShape, MeshInstance) through code, but you lose out on the ablity to access `properties`. You can fix this by always choosing to extend `QodotEntity` and adding more complex nodes like Area and RigidBody as children through code.
158-
159-
Make sure to update Node Class so it matches the the script's `extends`!
169+
**Script Class** - The script to attach to your entity's root node. See [Scripting Entities](entities/scripting-entities) for details.
160170

161171
**Node Class** - The type of node to spawn at this location. This property should match the `extends` of your Script Class. You can ignore this property if you're using a Scene File.
162172

@@ -168,7 +178,7 @@ You can get around this by extending `QodotEntity` and using `var body = RigidBo
168178

169179
### QodotFGDSolidClass
170180

171-
Solid classes can have multiple brushes (select multiple brushes when making the entity) so these properties apply to the solid class as a single object, not to each brush individually.
181+
Solid classes can have multiple brushes (select multiple brushes before creating the entity). These properties apply to the solid class as a single node, with each brush built as one CollisionShape child.
172182

173183
**Spawn Type** - Changes how the QodotMap arranges these brushes in its node hierarchy.
174184

@@ -178,26 +188,24 @@ There are 4 settings:
178188
- Entity
179189
- Group
180190

181-
**Build Visuals** - Makes the solid class visible when checked.
191+
Worldspawn contributes this entity's brushes to a primary StaticBody node. Intended for the Worldspawn definition only.
192+
193+
Worldspawn contributes this entity's brushes to a primary StaticBody node without overriding the original definition of Worldspawn.
182194

183-
You may want to disable this for invisible triggers and other gameplay-related solid classes.
195+
Group separates brushes into a new StaticBody node. Intended for grouped brushes.
184196

185-
**Node Class** - Sets the node type of the solid class root.
197+
Entity separates brushes into a node separate from the primary StaticBody, supporting scripts and CollisionObject node types.
186198

187-
If you're adding a Script Class, this value should match the `extends` of the script.
199+
**Build Visuals** - Builds a MeshInstance child for the solid class when checked. Does not build a MeshInstance child when unchecked.
188200

189-
Setting this to RigidBody and setting Spawn Type to Entity changes these brushes from static geometry into physics objects.
201+
**Node Class** - Sets the node type of the solid class root. If you're adding a Script Class, this value should match the `extends` of the script. See [Scripting Entities](entities/scripting-entities).
190202

191-
**Collision Shape Type** - Changes how collision is built.
203+
**Collision Shape Type** - Changes the type of CollisionShape resource used for CollisionShape children.
192204

193205
- None
194206
- Convex
195207
- Concave
196208

197-
Convex creations a CollisionShape for each brush, depending on the Spawn Type. Entity creates an outer hull, Group creates individual shapes for each brush. Convex is a good bet for most situations.
198-
199-
Concave allows for concave brush geometry, or if you chose Entity and want a single concave CollisionShape to make up your solid class. 🚧
200-
201209
**Script Class** - The script applied to the entity's root.
202210

203211
Although `QodotFGDSolidClass` is a class you can extend from, this is meant as a Qodot internal to build solid classes. This does not extend QodotEntity, and will not give you access to `properties`.
@@ -226,9 +234,7 @@ You can define properties for entities in the Class Properties dictionary. The "
226234

227235
## Note on Arrays
228236

229-
When you add an Array as a class property, it must contain other Arrays, with each Array creating one flag. These flag Arrays must have 3 items: Name, Value, and Default value.
230-
231-
Name must be a String.
237+
Arrays create flags. When you add an Array as a class property, it must contain other Arrays, each Array creating one flag. These flag Arrays must have 3 items: Name, Value, and Default value. Name must be a String.
232238

233239
Value is traditionally a bool, but it can also be a float, int, or String. Qodot parses all these data types as Strings in the end, which will change how you will be [Accessing Class Properties in Code](#accessing-class-properties-in-code).
234240

0 commit comments

Comments
 (0)