This commit is contained in:
Melissa 2023-01-21 13:47:26 +01:00
parent ffb829f558
commit 4eedba212f
Signed by: nimble
GPG Key ID: F3D5185970F89FF2
8 changed files with 87 additions and 1 deletions

25
addons/tbloader/Usage.md Normal file
View File

@ -0,0 +1,25 @@
# Godot version notice
You'll want to make sure you're on the latest version of Godot 4 when using TBLoader, since that's
what we're aiming to support!
# Usage
To install TBLoader, you can either install it through [AssetLib](https://godotengine.org/asset-library/asset/1265)
(search for "TrenchBroom Loader"), or by downloading a [release from Github](https://github.com/codecat/godot-tbloader/releases)
and extracting it to your project's `addons` folder, so that you have a structure like this:
```
project/addons/tbloader/plugin.cfg
```
You might have to manually enable the plugin from your project settings. In the Godot editor, click
on Project -> Project Settings, and go to the Addons tab. Check the "Enable" box next to TBLoader.
To build a level's geometry, create a `TBLoader` node in your scene hierarchy. In the properties of
the node you can select where your `.map` file is located, plus some more useful settings. With the
node still selected and the 3D view open, you will see a button `Build Meshes` in the toolbar the 3D
view. Click that button to build the geometry.
# TrenchBroom game config
The `tb-gameconfig` folder contains a game configuration for this addon. This includes a simple FGD
which will have some common entities that create Godot nodes. Simply place the files in a folder
called `Godot` inside the `games` folder of your TrenchBroom installation, so you would have
`games/Godot/<files>`.

View File

@ -3,5 +3,5 @@
name="TBLoader" name="TBLoader"
description="TrenchBroom map loader." description="TrenchBroom map loader."
author="Codecat" author="Codecat"
version="0.11.0" version="0.14.0"
script="src/plugin.gd" script="src/plugin.gd"

View File

@ -0,0 +1,38 @@
{
version: 4,
name: "Godot",
icon: "Icon.png",
"fileformats": [
{ "format": "Standard", "initialmap": "initial_standard.map" }
],
"filesystem": {
"searchpath": ".",
"packageformat": { "extension": "pak", "format": "idpak" }
},
"textures": {
"package": { "type": "directory", "root": "textures" },
"format": { "extensions": ["png", "dds", "tga", "jpg", "jpeg", "bmp", "webp", "exr", "hdr"], "format": "image" },
"attribute": "_tb_textures"
},
"entities": {
"definitions": [ "Godot.fgd" ],
"defaultcolor": "0.6 0.6 0.6 1.0",
"modelformats": [ "bsp, mdl, md2" ]
},
"tags": {
"brush": [
{
"name": "Area",
"attribs": [ "transparent" ],
"match": "classname",
"pattern": "area",
"texture": "system/area"
}
],
"brushface": []
},
"faceattribs": {
"surfaceflags": [],
"contentflags": []
}
}

View File

@ -0,0 +1,23 @@
@baseclass = Angle [
// https://github.com/TrenchBroom/TrenchBroom/issues/3827
angles(string) : "Pitch Yaw Roll" : "0 0 0"
]
@baseclass = Targets [
target(string) : "Target"
targetname(string) : "Target Name"
]
@SolidClass = worldspawn : "World entity" []
@SolidClass = area : "Area" []
@PointClass base(Angle) size(-16 -16 -16, 16 16 16) color(0 255 0) = player : "Player" []
@PointClass size(-4 -4 -4, 4 4 4) color(255 255 0) = light : "Light" [
range(float) : "Range" : 10
energy(float) : "Energy" : 1 : "The light's strengh multiplier"
attenuation(float) : "Attenuation" : 1 : "The drop-off curve (lower values emit more light far away)"
specular(float) : "Specular" : 0.5 : "Intensity of the specular blob on reflective surfaces"
light_color(color255) : "Color" : "255 255 255"
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB