level

package
v0.7.35 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtraPrefab added in v0.7.18

type ExtraPrefab struct {
	UUIDHash stingray.Hash
	Path     stingray.Hash
	stingray.Transform
	UnkFloats [3]float32
	UnkInt    uint32
}

type ExtraUnit added in v0.7.18

type ExtraUnit struct {
	UUIDHash stingray.Hash
	Path     stingray.Hash
	Name     stingray.Hash

	stingray.Transform
	UnkFloats [3]float32
	UnkInt    uint32
	UnkInt2   uint32
	// contains filtered or unexported fields
}

type ExtraUnitsContainer added in v0.7.18

type ExtraUnitsContainer struct {
	UnkInt              uint32
	UnkInt2             uint32
	LevelName           stingray.Hash
	ExtraUnits          []ExtraUnit
	ExtraPrefabs        []ExtraPrefab
	UnkIntList          []uint32
	UnkFloatTwoIntsList []FloatTwoInts
	UnkIntsAndFloatList []IntsAndFloat
}

type FloatTwoInts added in v0.7.18

type FloatTwoInts struct {
	UnkFloat float32 `json:"unk_float"`
	UnkInt1  uint32  `json:"unk_int_1"`
	UnkInt2  uint32  `json:"unk_int_2"`
}

type HashIndexRange added in v0.7.18

type HashIndexRange struct {
	Hash  stingray.ThinHash
	Start uint32 // Inclusive
	End   uint32 // Exclusive
}

type IntsAndFloat added in v0.7.18

type IntsAndFloat struct {
	UnkInts  [14]uint32 `json:"unk_ints"`
	UnkFloat float32    `json:"unk_float"`
}

type Level

type Level struct {
	Name                   stingray.Hash
	Metadata               map[int][]MetadataEntry
	Prefabs                []Prefab
	MaterialOverrides      map[int]map[stingray.ThinHash]stingray.Hash
	Units                  []Unit
	Speedtrees             []Speedtree
	UnkTransformedItems    []UnknownTransformedItem
	UnkExtraUnitContainers []ExtraUnitsContainer
	UnitHashIndexRange     []HashIndexRange
	UnkHashIndexRange1     []HashIndexRange
	UnkHashIndexRange2     []HashIndexRange
	UnkHashIndexRange3     []HashIndexRange
	PrefabHashIndexRange   []HashIndexRange
	UnkHashIndexRange4     []HashIndexRange
	UnkHashIndexRange5     []HashIndexRange
}

func LoadLevel

func LoadLevel(r io.ReadSeeker) (*Level, error)

type LevelMetadataType

type LevelMetadataType uint32
const (
	LevelMetadata_NotSeen LevelMetadataType = iota
	LevelMetadata_uint32
	LevelMetadata_float32
	LevelMetadata_string
)

func (LevelMetadataType) MarshalText

func (p LevelMetadataType) MarshalText() ([]byte, error)

func (LevelMetadataType) String

func (i LevelMetadataType) String() string

type Material

type Material struct {
	Slot stingray.ThinHash
	Path stingray.Hash
}

type MaterialSlotOverrides

type MaterialSlotOverrides struct {
	Index     uint32 // Index into unit array?
	Materials []Material
}

type MetadataEntry

type MetadataEntry struct {
	VariableNames []stingray.ThinHash
	Type          LevelMetadataType
	ValueUint     uint32
	ValueFloat    float32
	ValueString   string
}

func (*MetadataEntry) Key added in v0.7.27

func (m *MetadataEntry) Key(lookupThinhash func(stingray.ThinHash) string) string

func (*MetadataEntry) Value added in v0.7.27

func (m *MetadataEntry) Value() any

type Prefab

type Prefab struct {
	UUIDHash stingray.Hash
	Path     stingray.Hash
	stingray.Transform
	UnkExtraRotation mgl32.Vec4
}

type Speedtree added in v0.7.26

type Speedtree struct {
	stingray.Hash
	Layers     []SpeedtreeLayer
	Transforms []SpeedtreeTransform
}

func (*Speedtree) Path added in v0.7.26

func (s *Speedtree) Path() stingray.Hash

type SpeedtreeLayer added in v0.7.26

type SpeedtreeLayer struct {
	Name     stingray.ThinHash
	UnkInt00 uint32
	UnkInt01 uint32
}

type SpeedtreeTransform added in v0.7.26

type SpeedtreeTransform struct {
	Position    mgl32.Vec4
	MinRotation mgl32.Vec4 // not sure if this is actually a range of rotations or what, maybe its a max wind deflection or something?
	MaxRotation mgl32.Vec4
}

type Unit

type Unit struct {
	UUIDHash stingray.Hash // hm yes, today I'll represent a 128 bit number as a 64 bit hash of the string representation of the 128 bit number
	Name     stingray.Hash
	stingray.Hash

	stingray.Transform
	UnkFloats [6]float32 // Maybe a bounding box?
	// contains filtered or unexported fields
}

func (*Unit) Path

func (p *Unit) Path() stingray.Hash

type UnknownTransformedItem added in v0.7.18

type UnknownTransformedItem struct {
	Hash stingray.Hash
	stingray.Transform
	UnkFloats [6]float32
}

Jump to

Keyboard shortcuts

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