otbm

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeMapData   = 2
	NodeTileArea  = 4
	NodeTile      = 5
	NodeItem      = 6
	NodeTowns     = 12
	NodeTown      = 13
	NodeHouseTile = 14
)
View Source
const (
	AttrDescription = 1
	AttrTileFlags   = 3
	AttrItem        = 9
	AttrSpawnFile   = 11
	AttrHouseFile   = 13
)

Variables

This section is empty.

Functions

func PackPos

func PackPos(x, y uint16, z uint8) uint64

Types

type FloorBounds

type FloorBounds struct {
	MinX, MinY, MaxX, MaxY uint16
}

type GameMap

type GameMap struct {
	Tiles       map[uint64]*MapTile
	MinX, MinY  uint16
	MaxX, MaxY  uint16
	Floors      []uint8
	Towns       []Town
	FloorBounds map[uint8]*FloorBounds
}

func ParseOTBM

func ParseOTBM(path string) (*GameMap, error)

type MapTile

type MapTile struct {
	Items   []uint16
	Flags   uint32
	HouseID uint32
}

type Node

type Node struct {
	Type     uint8
	Data     []byte
	Children []*Node
	// contains filtered or unexported fields
}

func ParseFile

func ParseFile(path string) (*Node, error)

func (*Node) GetString

func (n *Node) GetString() (string, error)

func (*Node) GetU8

func (n *Node) GetU8() (uint8, error)

func (*Node) GetU16

func (n *Node) GetU16() (uint16, error)

func (*Node) GetU32

func (n *Node) GetU32() (uint32, error)

func (*Node) Remaining

func (n *Node) Remaining() int

func (*Node) ResetPos

func (n *Node) ResetPos()

func (*Node) Skip

func (n *Node) Skip(count int) error

type OTB

type OTB struct {
	ServerToClient map[uint16]uint16
}

func ParseOTB

func ParseOTB(path string) (*OTB, error)

type Town

type Town struct {
	ID   uint32
	Name string
	X, Y uint16
	Z    uint8
}

Jump to

Keyboard shortcuts

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