Skip to content

Commit f0a2518

Browse files
authored
Update index.md
1 parent a041733 commit f0a2518

File tree

1 file changed

+17
-76
lines changed

1 file changed

+17
-76
lines changed

docs/entities/index.md

Lines changed: 17 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -13,94 +13,36 @@ This page is a WIP, currently in the process of being broken into succinct subpa
1313
1. TOC
1414
{:toc}
1515

16-
## Introduction to Entity Types
16+
# Intro to Entities
1717

1818
There are three main types of entities:
1919
- Point Classes
2020
- Solid Classes
2121
- Base Classes
2222

23-
A point entity is a position in 3D space. They work well for spawn locations, pickups, and instancing Godot scenes.
23+
## Point Classes
2424

25-
Solid classes are pieces of geometry with special properties, like doors and breakable walls. You can use these entities to tie scripts and other functionality to brushes in the world. Collision and meshes are optional as well.
25+
A point class is a single position in 3D space. Often referred to as Point Entities.
2626

27-
Base classes are empty; they only contain properties as a template for other classes. They're handy when needed, but never required.
27+
A point class can either be a single node with a script attached, or an instantiated scene file (.tscn) placed at the point's location.
2828

29-
Keep in mind that "Entities" and "Classes" mean the same thing for this entire page. Qodot calls them classes, Trenchbroom calls them entities. Neither of these systems inherently interact with the classes found in GDscript or C#, they are completely separate.
29+
Point classes work well when placing objects that won't change in size.
3030

31-
# Creating an FGD file
31+
## Solid Classes
3232

33-
This should be your first step before adding any entities for a brand new Godot project.
33+
Solid classes are brushes separated from the static world. Often referred to as Brush Entities.
3434

35-
FGD fles (Forge Game Data) hold definitions for entities. They are required to make Trenchbroom and QodotMap understand custom entities.
35+
Solid classes can behave as any kind of CollisionObject. This includes `Area`, `StaticBody`, `RigidBody`, and `KinematicBody`.
3636

37-
While you can piggyback off of Qodot.fgd included in all installations of Qodot, this puts your custom entities at risk if you choose to update Qodot, since Qodot.fgd will be overwritten with the defaults.
37+
By default, they are given a CollisionShape child with a ConcaveShape resource matching their brush vertices.
3838

39-
It is safer to create a unique FGD file for your game that goes with the custom Trenchbroom game config created earlier in the [Applying Textures](./beginner's-guide-to-qodot/applying-textures) guide.
39+
## Base Classes
4040

41-
Right-click on the Filesystem dock and click Create New Resource. Make a QodotFGDFile:
41+
Base classes store properties shared by multiple classes. A base class does not function on its own, and it is is never required for any entity definition.
4242

43-
![](https://codahosted.io/images/77T7fADkTg/blobs/bl-WrbQagxvxB/faca91bba64558581e77c577cb043b0965b26a778f42fca7bec3dfb4f94cae095fc9cde8007ff62a736d0b63810ccdaf0fedafab6786e931a065248d5d31f0f73649901ad49482265f0434f2e0b836f7f0bc75208900d67723557efc068c3ac0a50bffaf)
43+
Base classes are helpful at encapsulating repeating properties between multiple entities. You can assure some code safety practices (like duck typing) by ensuring a certain group of entities all share similar properties.
4444

45-
I recommend saving this file as your_game_name_fgd.tres so it’s easy to search for “fgd” or just your game’s name the Filesystem dock. Mine is practice_fgd.tres.
46-
47-
Change the _Fgd Name_ to your game’s name.
48-
49-
Note
50-
{: .label .label-blue }
51-
You have to set the Fgd Name so it doesn’t conflict with the “Qodot” namespace, otherwise Trenchbroom will discard your FGD.
52-
53-
FGDs by default contain example entity definitions, which we don't need as Qodot.fgd contains all of these already. It helps to start an FGD with a completely clean entity definitions array, so you can focus on adding new entities not covered by Qodot.fgd.
54-
55-
## Adding an Entity Definition to an FGD
56-
57-
With your FGD open, click on the Entity Definitions array to open it. Drop your new entity definition into any empty slot in the list.
58-
59-
![](https://codahosted.io/images/77T7fADkTg/blobs/bl-y11gfMCDG5/7db319dcfe9df0846f090b47e5cb490f59ba0f2d2520f30e7b632c08fa30b30a7d5fbeb4a29b043d0268ee9a656e86a87cdd63b59403f3d4803efbbee7cc566c26027bab11d41b8b9906e8e4d3597741436fa3776f89ae374134171658a174d26d64cb60)
60-
61-
We still need to update the Trenchbroom game config to include our new entity definitions. Later we'll make sure the QodotMap node catches wind of the new entity definitions.
62-
63-
## Adding required Entity Definitions to your FGD
64-
65-
Before trying to consider your FGD complete, you may want to include worldspawn layer and group functionality in your FGD. These are kept as classes in Qodot.fgd, and are recommended to copy-over into all custom FGDs.
66-
67-
These entities are:
68-
69-
- worldspawn_solid
70-
- worldspawn_base
71-
- group_solid
72-
73-
You can expect them to work out of the box and not require changing, so they can be left in the `/addons/qodot` folder and updated as needed.
74-
75-
## Adding FGDs to your Trenchbroom game config
76-
Open the `config_folder.tres` resource and add a new item to the _Fgd Files_ array. Add the FGD you made by dragging and dropping, or by using the folder selection button.
77-
78-
Note
79-
{: .label .label-blue }
80-
Make sure to save your FGD resource first by clicking the save icon in the top right, or by pressing Ctrl + S with any scene open.
81-
82-
Click _Export File_ again.
83-
84-
Now you can open Trenchbroom, or go to File → Refresh Entity Definitions if you already have it open.
85-
86-
Note
87-
{: .label .label-blue }
88-
If you get a Trenchbroom error about incomplete strings, make sure the *Fgd Name* on your own FGD is not “Qodot”.
89-
90-
Note
91-
{: .label .label-blue }
92-
An error can occur if any entity definitions are missing a classname.
93-
94-
![](../images/entity-definitions-missing-classname.PNG)
95-
96-
You should be able to see more entity definitions in the entity collections list. This means your FGD made it into Trenchbroom successfully!
97-
98-
If you already have entities in your FGD, switching to your FGD should show your list of entities in the entity browser.
99-
100-
![](../images/fgd-success.png)
101-
102-
103-
# Creating new Entities
45+
# Creating Entity Resources
10446

10547
In Qodot, you define new types of entities by creating a new .tres resource file. Qodot provides 3 resource presets for this:
10648

@@ -122,11 +64,9 @@ Either will take you to the resource search screen. Here you can type in the fol
12264
- solidclass
12365
- baseclass
12466

125-
What follows is a breakdown of each property in the Inspector when editing one of the three main class types.
67+
# Point and Class Resource Properties
12668

127-
## Base Class Properties
128-
129-
These properties are shared by Point and Solid classes. Base Class only exists as a template for other classes, if you're looking for an ECS-like approach to sharing properties.
69+
These properties are shared by Point and Solid classes.
13070

13171
**Classname** - The name for this class in Trenchbroom.
13272

@@ -229,7 +169,6 @@ Concave allows for concave brush geometry, or if you chose Entity and want a sin
229169

230170
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`.
231171

232-
233172
# Class Property Data Types
234173

235174
As shown earlier in this page, you can define properties for entities in the Class Properties dictionary. The "key" for each dictionary entry should be a String. The "value" can only be one of these 8 data types:
@@ -266,6 +205,8 @@ The default value can be the previous data type, or even `null`. It is not read
266205

267206
See [Scripting Entities](scripting-entities.md).
268207

208+
-----
209+
269210
# Models in Trenchbroom
270211
You can display a model in TrenchBroom over a Point Class definition. You can then set up the equivalent model in Godot.
271212

0 commit comments

Comments
 (0)