Documentation
¶
Index ¶
- Constants
- func ShipShieldStr(s *Ship) int
- func ShipSpeedMax(s *Ship) int
- type Asteroid
- type Background
- type Cockpit
- type CustomisableContainer
- type Debris
- type Dock
- type DummyAnimated
- type Factory
- type Gate
- type PageXML
- type Planet
- type Scene
- type SceneP
- type Script
- type Sector
- type Ship
- type Special
- type Sun
- type TBullet
- type TDock
- type TLaser
- type TShield
- type TSun
- type Text
- type TextFile
- type UShip
- type Universe
- type Ware
- type X
- func (x *X) AsteroidType(i int) string
- func (x *X) DockByID(id string) *TDock
- func (x *X) DockPorts() map[string]int
- func (x *X) GetDum() []DummyAnimated
- func (x *X) GetLasers() []TLaser
- func (x *X) GetShields() []TShield
- func (x *X) GetShips() []Ship
- func (x *X) GetSuns() []TSun
- func (x *X) GetText() Text
- func (x *X) GetUniverse() (u Universe)
- func (x *X) LtMask(lt string) uint
- func (x *X) Map(f func(string, string))
- func (x *X) Open(f string) io.ReadCloser
- func (x *X) PreCache()
- func (x *X) RaceName(r int) string
- func (x *X) Scene(f string) *Scene
- func (x *X) SectorFlavor(s *Sector) string
- func (x *X) SectorName(s *Sector) string
- func (x *X) ShipDock(s *Ship) map[string]int
- func (x *X) ShipNonFighterDock(s *Ship) int
- func (x *X) SunPercent(s *Sector) int
- type Xdata
- type Xfiles
Constants ¶
View Source
const ( DP_TS = 1 << iota DP_M6 DP_M8 DP_M1 DP_M2 DP_TL )
Variables ¶
This section is empty.
Functions ¶
func ShipSpeedMax ¶
Types ¶
type Background ¶
type Cockpit ¶
type Cockpit struct {
BodyFile string
PictureID string
RotX float64
RotY float64
RotZ float64
GalaxySubtype string
Description string
SceneFile string
LaserMask int
Volume string
ProductionRelValNPC string
PriceModifier1 string
PriceModifier2 string
WareClass int
ProductionRelValPlayer string
MinNotoriety string
VideoID string
Skin string
ObjectID string
}
type CustomisableContainer ¶
type CustomisableContainer struct {
S int `x3t:"o:s"`
Docks []Dock `x3t:"ot:5"` //huh?
Factories []Factory `x3t:"ot:6"` //huh?
Ships []UShip `x3t:"ot:7"`
Lasers []Ware `x3t:"ot:8"`
Shields []Ware `x3t:"ot:9"`
Missiles []Ware `x3t:"ot:10"`
Energy []Ware `x3t:"ot:11"`
Novelty []Ware `x3t:"ot:12"`
Bio []Ware `x3t:"ot:13"`
Food []Ware `x3t:"ot:14"`
Mineral []Ware `x3t:"ot:15"`
Tech []Ware `x3t:"ot:16"`
}
type DummyAnimated ¶
type Gate ¶
type Gate struct {
Gid int `x3t:"o:gid"` // 0,1,2,3 - N,S,W,E
// 0, 1, 2, 3 - normal gate N, S, W, E
// 4 - destroyed
// 5, 6, 7, 8 - Trans-orbital accelerator N, S, W, E
// 9 - 20 - xenon hub gates
S string `x3t:"o:s"`
// Gx, Gy - destination sector coordinates
Gx int `x3t:"o:gx"`
Gy int `x3t:"o:gy"`
Gtid int `x3t:"o:gtid"` // Destination gate direction.
F int `x3t:"o:f"`
// contains filtered or unexported fields
}
type Script ¶
type Sector ¶
type Sector struct {
F int `x3t:"o:f"`
X int `x3t:"o:x"` // map coordinates
Y int `x3t:"o:y"` // map coordinates
R int `x3t:"o:r"` // Race
Size int `x3t:"o:size"` // Radius
M int `x3t:"o:m"`
P int `x3t:"o:p"`
Qtrade int `x3t:"o:qtrade"`
Qfight int `x3t:"o:qfight"`
Qthink int `x3t:"o:qthink"`
Qbuild int `x3t:"o:qbuild"`
Suns []Sun `x3t:"ot:3"`
Asteroids []Asteroid `x3t:"ot:17"`
Background Background `x3t:"ot:2"`
Planets []Planet `x3t:"ot:4"`
Docks []Dock `x3t:"ot:5"`
Factories []Factory `x3t:"ot:6"`
Ships []UShip `x3t:"ot:7"`
Missiles []Ware `x3t:"ot:10"`
Food []Ware `x3t:"ot:14"`
Tech []Ware `x3t:"ot:16"`
Gates []Gate `x3t:"ot:18"`
Specials []Special `x3t:"ot:20"`
Debris []Debris `x3t:"ot:28"`
}
type Ship ¶
type Ship struct {
BodyFile string
PictureID string
Yaw float64
Pitch float64
Roll float64
// Class - ship class. Names of classes can be changed but classes itself are hardcoded into OBJ files
Class string
Description string `x3t:"page:17"`
Speed int // Seems to be scaled by 500.
Acceleration int
// Engine sound - Index to Sounds.txt
EngineSound string
AverageReactionDelay string
// Engine effect - Index to Effects.txt
EngineEffect string
EngineGlowEffect string
ReactorOutput string
SoundVolumeMax string
SoundVolumeMin string
// Ship scene - scene containing the ship graphics
ShipScene string
// Cockpit scene - scene containing the cockpit graphics (the real cockpit where you control the ship from)
CockPitScene string
//Possible lasers - bit mask
PossibleLasers int
// Gun count - sum of count of laser parts of all gun records
GunCount int
// Weapons energy - how is it related to TLaser.txt energy?
WeaponsEnergy int
// Weapons recharge rate - how is it related to TLaser.txt recharge rate?
WeaponsRechargeRate float64
// Shield type - biggest shield the ship can equip - index to TShields.txt
//ShieldType string
ShieldType *TShield `x3t:"tref:Shields,index"`
// Max shield count - Maximum number of shields
MaxShieldCount int
// Possible missiles - bit mask
PossibleMissiles int
// Number of missiles (NPC) - Maximum number of missiles an NPC ship can carry
NumberOfMissiles int
MaxEngineTuning int // One engine tuning seems to increase the speed by 10% of the minimum speed.
MaxRudderTuning int
// Cargo min (buy) - minimum cargo capacity (when the ship is bought)
CargoMin int
// Cargo max - maximum cargo capacity
CargoMax int
PredefinedWares string
// Turret descriptor - fixed length array - the reason why there is only 6 + 1 turrets
TurretDescriptor [6]struct {
// Cockpit index - index to TCockpits.txt
//CIndex int
Cockpit *Cockpit `x3t:"tref:Cockpits,index"`
// Cockpit position - front, rear, left, right, top, bottom - not sure what it's used for
CPos int
}
// Docking slots - maximum number of ships which can dock
DockingSlots int
// Cargo type - maximum cargo size the ship can carry - Ware class of TWare.txts
CargoType int
// Race - Race of the ship.
Race int
HullStrength int
// Explosion definition - index to Effects.txt
ExplosionDefinition string
// Body explosion definition - index to Effects.txt
BodyExplosionDefinition string
// Engine Trail - Particle Emitter - index to Effects.txt
EngineTrailParticleEmitter string
// Variation index - Hauler, Vanguard,... - index to Page 17 in text resource files. The String ID is calculated as 10000 + Variation index
Variation string `x3t:"page:17,offset:10000,ignore:20"`
// Max Rotation Acceleration - How fast the ship can go from 0 to maximum rotation speed
MaxRotationAcceleration int
// Class Description - String ID from Page 17 of text resource files (no, it isn't)
ClassDescription string
Cockpit []struct {
Index int
TurretIndex string
BodyID string
PathIndex string
}
GunGroup []struct {
// Initial laser index - calculated as 1 + count of laser parts in previous gun groups
InitialLaserIndex int
// No of guns - number of laser parts
NumGuns int
// Index - an index of the gun group - starting from 1
GunGroupIndex int
Gun []struct {
// Index - an index of the gun. The index continues between gun groups (i.e. it's unique and global)
Index int
// Count of laser parts - number of laser parts in BOD/BOB file
CountLaserParts int
// Body ID (primary) - Body ID from ship scene
BodyID string
// Path index (primary) - Path index from ship scene
PathIndex string
// Body ID (secondary) - Body ID from weapon scene
BodyID2 string
// Path index (secondary) - Path index from weapon scene
PathIndex2 string
}
}
Volume string
// Production RelVal (NPC) - Price for NPCs (it's not really a price)
ProductionRelValNPC int
// Price modifier (1)
PriceModifier1 int
// Price modifier (2)
PriceModifier2 int
WareClass int
// Production RelVal (player) - Price for the player (it's not really a price)
ProductionRelValPlayer int
// Min. Notoriety - minimum notoriety the player must have with corresponding race to be able to buy the ship
MinNotoriety int
// Video ID - ignored
VideoID string
// Unknown value
UknownValue string
ObjectID string
}
type TBullet ¶
type TBullet struct {
BodyFile string
PictureID string
Yaw float64
Pitch float64
Roll float64
Index string
Description string `x3t:"page:17"`
ShieldDamage int
EnergyUsed int
Sound string // index to Sounds.txt
Lifetime int
Speed int
Flags int
ColorB int
ColorG int
ColorR int
SizeX float64
SizeY float64
SizeZ float64
EngineEffect string // Effects.txt
ImpactEffect string // Effects.txt
LauchEffect string // Effects.txt
HullDamage int
EngineTrail string
AmbientSound string // Sounds.txt
VolumeMin int
VolumeMax int
Unknown1 int
Unknown2 int
Unknown3 int
Unknown4 int
Unknown5 int
Unknown6 int
Unknown7 int
Unknown8 int
Unknown9 int
Unknown10 int
Unknown11 int
Unknown12 int
Ammo string // TWareT.txt (or 128?)
ProductionRelValNPC int
PriceModifier1 int
PriceModifier2 int
WareClass int
ProductionRelValPlayer int
MinNotoriety int
VideoID string
Skin string
ObjectID string
}
type TDock ¶
type TDock struct {
BodyFile string
PictureID string
RotX float64
RotY float64
RotZ float64
GalaxySubtype string
Description string `x3t:"page:17"`
SoundID string
DockDistance string
RendezvousDistrance string
ThreeDSoundVolume string
SceneFile string
InnerScene string
Race int
Explosion string
BodyExplosion string
ShieldPowerGen string
HUDIcon string
Volume string
ProductionRelValNPC int
PriceModifier1 int
PriseModifier2 int
WareClass int
ProductionRelValPlayer int
MinNotoriety int
VideoID string
Skin string
ObjectID string
}
type TLaser ¶
type TLaser struct {
BodyFile string
PictureID string
RotX float64
RotY float64
RotZ float64
Index string
Description string `x3t:"page:17"`
RoF int // 1 shot per RoF milliseconds
Sound int
Projectile *TBullet `x3t:"tref:Bullets,index"`
Energy int
ChargeRate float64
HUDIcon string
Volume string
ProductionRelValNPC string
PriceMod1 string
PriceMod2 string
WareClass int
ProductionRelValPlayer string
MinNotoriety string
VideoID string
Skin string
OjectID string
}
type TShield ¶
type TShield struct {
BodyFile string
PictureID string
Yaw float64
Pitch float64
Roll float64
Index string
Description string `x3t:"page:17"`
ChargeRate int // kJ/s
Strength int // kJ
HitEffect string
Efficiency string
Volume string
ProductionRelValNPC int
PriceModifier1 int
PriceModifier2 int
WareClass int
ProductionRelValPlayer int
MinNotoriety int
VideoID string
Skin string
ObjectID string
}
type TSun ¶
type TSun struct {
Unknown01 int
Unknown02 int
Unknown03 int
Unknown04 int
Unknown05 float64
Unknown06 int
Unknown07 int
Unknown08 int
Unknown09 int
Brightness int // Seems to be fixed point scaled by 2^16
Unknown11 int
Unknown12 int
Unknown13 int
Unknown14 int
Unknown15 int
Unknown16 int
Unknown17 int
Unknown18 int
ObjectID string
}
the only documentation of this I found was wrong.
type UShip ¶
type UShip struct {
S string `x3t:"o:s"`
F int `x3t:"o:f"`
Ships []UShip `x3t:"ot:7"`
CCs []CustomisableContainer `x3t:"ot:23"`
// contains filtered or unexported fields
}
type Universe ¶
type X ¶
type X struct {
// contains filtered or unexported fields
}
Each thing we access is loaded and parsed on demand. To synchronize this, each member is protected by a sync.Once.
func (*X) AsteroidType ¶
func (*X) GetDum ¶
func (x *X) GetDum() []DummyAnimated
func (*X) GetShields ¶
func (*X) GetUniverse ¶
func (*X) PreCache ¶
func (x *X) PreCache()
Asynchronously pre-cache everything we might want to load later.
func (*X) SectorFlavor ¶
func (*X) SectorName ¶
func (*X) ShipNonFighterDock ¶
func (*X) SunPercent ¶
type Xdata ¶
type Xdata interface {
Open() io.ReadCloser
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.