Documentation ¶
Index ¶
Constants ¶
View Source
const ( MaxHeight = 7 // Z coordinate MaxLength = 100 // Y coordinate MaxWidth = 130 // X coordinate CellSize = 16 // seems to be )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cell ¶
type Cell struct { DoorAndCanisterRelated byte `struc:"byte"` DoorLockAndReactorRelated byte `struc:"byte"` Unknown2 byte `struc:"byte"` Surface ObjRef Left ObjRef Right ObjRef Center ObjRef Unknown11 byte `struc:"byte"` Unknown12 byte `struc:"byte"` Unknown13 byte `struc:"byte"` Unknown14 byte `struc:"byte"` SquadRelated byte `struc:"byte"` }
type Character ¶
type Character struct { Unknown1 []byte `struc:"[178]byte"` Type data.CharacterType `struc:"byte"` Name string `struc:"[80]byte"` // Attributes guessed by matching up numbers. Starts at 0x103 WeaponSkill int `struc:"byte"` BallisticSkill int `struc:"byte"` Unknown2 byte `struc:"byte"` Leadership int `struc:"byte"` Toughness int `struc:"byte"` Strength int `struc:"byte"` ActionPoints int `struc:"byte"` Unknown3 byte `struc:"byte"` Unknown4 byte `struc:"byte"` Health int `struc:"byte"` Unknown5 []byte `struc:"[91]byte"` Armor int `struc:"byte"` Unknown6 []byte `struc:"[84]byte"` YPos int `struc:"byte"` // These are actually much more complicated XPos int `struc:"byte"` Unknown7 []byte `struc:"[317]byte"` SquadNumber byte `struc:"byte"` Unknown8 []byte `struc:"[895]byte"` Orientation byte `struc:"byte"` Unknown9 []byte `struc:"[31]byte"` }
type Characters ¶
type Characters []Character
type GameMap ¶
type GameMap struct { // Main Header IsCampaignMap bool `struc:"uint32"` // Tentatively: 0 = no, 1 = yes MinWidth int `struc:"uint32"` MinLength int `struc:"uint32"` MaxWidth int `struc:"uint32"` MaxLength int `struc:"uint32"` Unknown1 int `struc:"uint32"` Unknown2 int `struc:"uint32"` Unknown3 int `struc:"uint32"` Unknown4 int `struc:"uint32"` Magic []byte `struc:"[8]byte"` // "\x08\x00WHMAP\x00" Unknown5 int `struc:"uint32"` Unknown6 int `struc:"uint32"` SetName string `struc:"[8]byte"` // Links to a filename in `/Sets/*.set` Padding []byte `struc:"[212]byte"` // Per-cell data NumCells int `struc:"skip"` // FIXME: We can't use []Cell below without this field Cells []Cell `struc:"[]Cell,sizefrom=NumCells"` // Trailer header Discard1 [3]byte `struc:"[3]byte"` // First byte is size of trailer header? TrailerMaxWidth int `struc:"uint32"` TrailerMaxLength int `struc:"uint32"` TrailerMinWidth int `struc:"uint32"` TrailerMinLength int `struc:"uint32"` NumCharacters int `struc:"uint32"` TrailerUnknown1 int `struc:"uint32"` TrailerUnknown2 int `struc:"uint16"` TrailerUnknown3 int `struc:"uint16"` TrailerUnknown4 int `struc:"uint32"` NumThingies int `struc:"byte"` TrailerUnknown5 []byte `struc:"[3]byte"` Padding1 []byte `struc:"[20]byte"` Characters []Character `struc:"[]Character,sizefrom=NumCharacters"` Thingies []Thingy `struc:"[]Thingy,sizefrom=NumThingies"` Title string `struc:"[255]byte"` Briefing string `struc:"[2048]byte"` // Maybe? each contains either 0 or 1? Hard to say TrailerUnknown6 []byte `struc:"[85]byte"` }
func LoadGameMap ¶
A game map contains a .txt and a .map. If they're in the same directory, just pass the directory + basename to load both
func LoadGameMapByFiles ¶
A game map is composed of two files: .map and .txt. We ignore the text file, since the content is replicated in the map file.
func (*GameMap) MapSetFilename ¶
func (*GameMap) MapSetName ¶
Click to show internal directories.
Click to hide internal directories.