Technical Information
This page contains information about data structures and other internals that might be useful for patching or modding Hardwar.
General Definitions
General stuff that will be used throughout, and scale-related constants.
D=DWORD and B=BYTE. const D TD_Second=0xC22; #define Foot 488 #define Inch 41 #define Metre 1600 #define Mile 2575610 #define Kilometre 1600000 #define Gravity (Metre*8) #define MPH 715 #define KMH 444
Moths
There is a separate page describing various aspects of the moths here
Object Definition
This describes an Object Type, and is used in the Master Object Types definition.
typedef struct { B TName[32]; // Name used in terminal commands B Name[32]; // Original 'game' name D Value; D Properties; // Properties - see OP_xxxx in OBJECT.H B CompShapeName[16]; B Description[256]; D Mass; // Mass per unit in kg. } ObjDef;
Object property flags are a bitmask as follows:
1 OP_Commodity - A commodity that can be bought and sold. 2 OP_Part - A part that can be fitted to a moth. 4 OP_Weapon - Can be fitted, is a weapon. 8 OP_NewMoth - A complete new moth. 16 OP_EWeapon - An energy weapon (Always has OP_Weapon) 32 OP_Pod - A pod. 64 OP_Fusion - Requires fusion technology. Hidden from player until relevant point in plot 128 OP_BgInstall - Can be installed in a building.
Installable Manufacturing Machinery
The machinery that can be installed in buildings to allow custom manufacturing is based on normal objects, with the OP_BgInstall property. These objects are defined in the Master Object Types list in the usual way. However, the manufacturing capabilities of each of these objects are hard-coded. It should be possible to locate this in the EXE and customise it. For reference:
//**************************************************************************** // // Install an object in a building. Returns non-zero if successful. // //**************************************************************************** D BgInstallObject(BgID b,ObjType ot,D num) { switch(ot) { case OT_Clone: b->ClonesInstalled+=num; return(1); case OT_IndManWeapons: b->Flags|=BgFlag_UseNewMan; BgAllowManufacture(b,OT_Sprat); BgAllowManufacture(b,OT_Swarm); BgAllowManufacture(b,OT_Devastator); BgAllowManufacture(b,OT_Leach); BgAllowManufacture(b,OT_FireBurst); BgAllowManufacture(b,OT_Underkill); BgAllowManufacture(b,OT_Groundbase); BgAllowManufacture(b,OT_Hologram); BgAllowManufacture(b,OT_Trojan); return(1); case OT_IndManComp: b->Flags|=BgFlag_UseNewMan; BgAllowManufacture(b,OT_CompComp); BgAllowManufacture(b,OT_MachParts); BgAllowManufacture(b,OT_Drone); BgAllowManufacture(b,OT_Chaff); BgAllowManufacture(b,OT_Cell1); BgAllowManufacture(b,OT_Cell2); BgAllowManufacture(b,OT_Cell3); BgAllowManufacture(b,OT_Cell4); BgAllowManufacture(b,OT_FCell); return(1); case OT_IndManOreProc: b->Flags|=BgFlag_UseNewMan; BgAllowManufacture(b,OT_SheetMetal); BgAllowManufacture(b,OT_ExMetal); return(1); case OT_IndManBooze: b->Flags|=BgFlag_UseNewMan; BgAllowManufacture(b,OT_Booze); return(1); case OT_IndManNarcotics: b->Flags|=BgFlag_UseNewMan; BgAllowManufacture(b,OT_Narcotics); return(1); default: return(0); } }