entitylump

package
v0.1.125 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package entitylump reads the entities a compiled Source 2 map stores.

A map's world resource, maps/<map>/world.vwrld_c, lists its entity lumps in m_entityLumps. Each lump is a compiled resource whose DATA block holds KeyValues3 with m_entityKeyValues, one entry per entity whose keyValues3Data.values are its keyvalues, and m_childLumps, the lumps nested under it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data

func Data(read func(name string) ([]byte, error), name string) (map[string]any, error)

Data reads the compiled resource named name and decodes its DATA block.

func Lumps

func Lumps(world map[string]any) []string

Lumps returns the compiled resource names of the entity lumps a world's decoded DATA block lists. The world names each lump without its _c.

func Number

func Number(value any) float64

Number returns an entity keyvalue as a number. Lumps store many numbers as text and flags as booleans; a value that is neither reads as 0.

func Walk

func Walk(read func(name string) ([]byte, error), name string, visit func(values map[string]any)) error

Walk calls visit with the keyvalues of each entity in the lump named name and in its child lumps, depth first, in stored order. read returns a compiled resource's bytes by name. A lump that cannot be read or decoded adds nothing and Walk goes on to the next; Walk returns the first such error, so a caller that needs every entity can refuse a partial walk.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL