Zhlt 34.0.3

dotnet add package Zhlt --version 34.0.3
                    
NuGet\Install-Package Zhlt -Version 34.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Zhlt" Version="34.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zhlt" Version="34.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Zhlt" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Zhlt --version 34.0.3
                    
#r "nuget: Zhlt, 34.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Zhlt@34.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Zhlt&version=34.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Zhlt&version=34.0.3
                    
Install as a Cake Tool

Zhlt

.NET wrapper voor Vluzacn's ZHLT v34 — de Half-Life map compiler toolchain.

Bundelt hlcsg, hlbsp, hlvis en hlrad (Windows x64) in één NuGet-pakket en biedt een async .NET API om .map bestanden te compileren naar .bsp.

Installatie

dotnet add package Zhlt

De vier native executables worden automatisch naar de output-map gekopieerd via het meegeleverde MSBuild .targets bestand.

Snel voorbeeld

using Zhlt;

var compiler = new ZhltCompiler();

var result = await compiler.CompileAsync(
    @"C:\maps\mijnkaart.map",
    progress: new Progress<CompileProgress>(p =>
        Console.WriteLine($"[{p.Step}] {p.Message}")));

if (result.Success)
    Console.WriteLine($"BSP gereed: {result.BspFile}");
else
    Console.WriteLine("Compilatie mislukt.");

Uitgebreid voorbeeld

using Zhlt;
using Zhlt.Options;

var compiler = new ZhltCompiler(binDir: @"C:\tools\zhlt");

var options = new CompileOptions
{
    Steps = CompileSteps.All,

    Csg = new CsgOptions
    {
        WadAutoDetect = true,
        ClipType      = ClipType.Precise,
        Threads       = 4,
    },

    Bsp = new BspOptions(),

    Vis = new VisOptions
    {
        Mode = VisMode.Full,
    },

    Rad = new RadOptions
    {
        Extra      = true,
        Bounce     = 8,
        Scale      = 1.0f,
        Gamma      = 0.5f,
        VisMatrix  = VisMatrixMode.Sparse,
    },
};

using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(30));

var result = await compiler.CompileAsync(
    @"C:\maps\mijnkaart.map",
    options,
    progress: new Progress<CompileProgress>(p =>
        Console.WriteLine($"[{p.Step}] {p.Message}")),
    ct: cts.Token);

foreach (var step in result.Steps)
    Console.WriteLine($"{step.Step}: exitcode {step.ExitCode}, succes={step.Success}");

if (!result.Success)
{
    var mislukt = result.Steps.Last();
    Console.Error.WriteLine($"Gestopt bij stap {mislukt.Step}:\n{mislukt.Output}");
}

Alleen bepaalde stappen uitvoeren

// Alleen CSG + BSP (geen vis/rad — bruikbaar voor snelle geometrie-check)
var options = new CompileOptions
{
    Steps = CompileSteps.Csg | CompileSteps.Bsp,
};

await compiler.CompileAsync(@"C:\maps\test.map", options);

API-overzicht

ZhltCompiler

Lid Omschrijving
ZhltCompiler(binDir?) Maakt een compiler aan. binDir is de map met de executables; standaard AppContext.BaseDirectory.
CompileAsync(mapFile, options?, progress?, ct?) Voert de pipeline uit en geeft een CompileResult terug.
Csg, Bsp, Vis, Rad Toegang tot de individuele tools voor directe aanroep.

CompileOptions

Property Type Omschrijving
Steps CompileSteps Welke stappen worden uitgevoerd (vlag-enum, standaard All).
Csg CsgOptions Opties voor hlcsg.
Bsp BspOptions Opties voor hlbsp.
Vis VisOptions Opties voor hlvis.
Rad RadOptions Opties voor hlrad.

CompileResult

Property Omschrijving
Success true als alle uitgevoerde stappen geslaagd zijn.
BspFile Pad naar het gegenereerde .bsp bestand.
Steps Lijst van ToolResult per uitgevoerde stap.

ToolResult

Property Omschrijving
Step Welke stap (Csg, Bsp, Vis of Rad).
Success Of de tool met exitcode 0 is gestopt.
ExitCode Ruwe exitcode van het proces.
Output Gecombineerde stdout + stderr uitvoer.

Annuleren

Geef een CancellationToken mee. Als het token geannuleerd wordt, stopt het actieve child-process en gooit CompileAsync een OperationCanceledException.

Vereisten

  • .NET 10.0 of hoger
  • Windows x64

Licentie

De ZHLT-tools zijn het werk van Vluzacn. Raadpleeg de originele ZHLT-licentie voor gebruiksvoorwaarden.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
34.0.3 123 6/27/2026
34.0.0 116 6/27/2026