diff --git a/addons/tbloader/Usage.md b/addons/tbloader/Usage.md new file mode 100644 index 0000000..f7f0c4d --- /dev/null +++ b/addons/tbloader/Usage.md @@ -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/`. diff --git a/addons/tbloader/bin/libtbloader.linux.x86_64.so b/addons/tbloader/bin/libtbloader.linux.x86_64.so index cc4ed5f..9905135 100644 Binary files a/addons/tbloader/bin/libtbloader.linux.x86_64.so and b/addons/tbloader/bin/libtbloader.linux.x86_64.so differ diff --git a/addons/tbloader/bin/libtbloader.macos.universal.dylib b/addons/tbloader/bin/libtbloader.macos.universal.dylib index a51c45d..1b25487 100644 Binary files a/addons/tbloader/bin/libtbloader.macos.universal.dylib and b/addons/tbloader/bin/libtbloader.macos.universal.dylib differ diff --git a/addons/tbloader/bin/tbloader.windows.x86_64.dll b/addons/tbloader/bin/tbloader.windows.x86_64.dll index 065fde5..0a9dcd1 100644 Binary files a/addons/tbloader/bin/tbloader.windows.x86_64.dll and b/addons/tbloader/bin/tbloader.windows.x86_64.dll differ diff --git a/addons/tbloader/plugin.cfg b/addons/tbloader/plugin.cfg index 937474c..9092b74 100644 --- a/addons/tbloader/plugin.cfg +++ b/addons/tbloader/plugin.cfg @@ -3,5 +3,5 @@ name="TBLoader" description="TrenchBroom map loader." author="Codecat" -version="0.11.0" +version="0.14.0" script="src/plugin.gd" diff --git a/addons/tbloader/tb-gameconfig/GameConfig.cfg b/addons/tbloader/tb-gameconfig/GameConfig.cfg new file mode 100644 index 0000000..b087d18 --- /dev/null +++ b/addons/tbloader/tb-gameconfig/GameConfig.cfg @@ -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": [] + } +} diff --git a/addons/tbloader/tb-gameconfig/Godot.fgd b/addons/tbloader/tb-gameconfig/Godot.fgd new file mode 100644 index 0000000..e35fe2d --- /dev/null +++ b/addons/tbloader/tb-gameconfig/Godot.fgd @@ -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" +] diff --git a/addons/tbloader/tb-gameconfig/Icon.png b/addons/tbloader/tb-gameconfig/Icon.png new file mode 100644 index 0000000..743b2ac Binary files /dev/null and b/addons/tbloader/tb-gameconfig/Icon.png differ