For WORDs, possible values are generally 0..10'000, for DWORDs the range is 0..1'000'000'000. Other values (Ids, speeds) are more restricted. These ranges are the reason that ships may not carry more than 10000 mc, and that the parameters for 3rd-party missions (Intercept Id, Tow Id) must be between 0 and 500 (Ids!). See also the descriptions of the appropriate DAT files.

PHost ignores the command pointers and assumes that the commands are stored directly after the pointers, with no padding inbetween. Versions up to 3.4b also will not necessarily do the Right Thing(tm) if commands are not in their canonical order (i.e. first ship commands, then planet, then base, then rest; each block sorted by Id; each object sorted by command code). Most known MAKETURNs fulfill these conditions though THost does not require them.

--- Code 1 (01h=ShipChangeFc) ---
 +0     WORD    Ship Id
 +2   3 BYTEs   New Friendly code

Note that THost allows you to send multiple `ShipChangeFc' commands to trigger multiple alliance actions (eeX, ffX). This needs a specially prepared MAKETURN, however.

--- Code 2 (02h=ShipChangeSpeed) ---
 +0     WORD    Ship Id
 +2     WORD    New Warp factor (0..9)

--- Code 3 (03h=ShipChangeWaypoint) ---
 +0     WORD    Ship Id
 +2     WORD    X Waypoint, difference to current location
 +4     WORD    Y Waypoint, difference to current location
                (range -3000 .. 3000)

--- Code 4 (04h=ShipChangeMission) ---
 +0     WORD    Ship Id
 +2     WORD    New mission
                see SHIPx.DAT

--- Code 5 (05h=ShipChangePrimaryEnemy) ---
 +0     WORD    Ship Id
 +2     WORD    New Primary enemy

--- Code 6 (06h=ShipTowShip) ---
 +0     WORD    Ship Id
 +2     WORD    Id of ship to be towed

--- Code 7 (07h=ShipChangeName) ---
 +0     WORD    Ship Id
 +2  20 BYTEs   New name

--- Code 8 (08h=ShipBeamDownCargo) ---
 +0     WORD    Ship Id
 +2     WORD    Neutronium
 +4     WORD    Tritanium
 +6     WORD    Duranium
 +8     WORD    Molybdenum
+10     WORD    Colonists
+12     WORD    Supplies
+14     WORD    Target planet Id (0 for Jettison)

--- Code 9 (09h=ShipTransferCargo) ---
 +0     WORD    Ship Id
 +2     WORD    Neutronium
 +4     WORD    Tritanium
 +6     WORD    Duranium
 +8     WORD    Molybdenum
+10     WORD    Colonists
+12     WORD    Supplies
+14     WORD    Target ship Id

Note that, when transferring to an own ship, PLANETS.EXE generates "dull" transfers (all amounts except for the target Id are zero), those should not be written to TRN files to avoid confusing the host (PHost up to 3.4i/4.0f only sees a intra-race transfer which is not permitted using this command).

--- Code 10 (0Ah=ShipIntercept)
 +0     WORD    Ship Id
 +2     WORD    Id of ship to intercept

--- Code 11 (0Bh=ShipChangeNeutronium) ---
 +0     WORD    Ship Id
 +2     WORD    Neutronium / kt

--- Code 12 (0Ch=ShipChangeTritanium) ---
 +0     WORD    Ship Id
 +2     WORD    Tritanium / kt

--- Code 13 (0Dh=ShipChangeDuranium) ---
 +0     WORD    Ship Id
 +2     WORD    Duranium / kt

--- Code 14 (0Eh=ShipChangeMolybdenum) ---
 +0     WORD    Ship Id
 +2     WORD    Molybdenum / kt

--- Code 15 (0Fh=ShipChangeSupplies) ---
 +0     WORD    Ship Id
 +2     WORD    Supplies / kt

--- Code 16 (10h=ShipChangeColonists) ---
 +0     WORD    Ship Id
 +2     WORD    Colonist Clans

--- Code 17 (11h=ShipChangeTorpedoes) ---
 +0     WORD    Ship Id
 +2     WORD    Number of Torpedoes

--- Code 18 (12h=ShipChangeMoney) ---
 +0     WORD    Ship Id
 +2     WORD    Money / mc

The codes 19 (13h) and 20 (14h) are unused.

--- Code 21 (15h=PlanetChangeFc) ---
 +0     WORD    Planet Id
 +2   3 BYTEs   New Friendly Code

--- Code 22 (16h=PlanetChangeMineCnt) ---
 +0     WORD    Planet Id
 +2     WORD    Number of Mines

--- Code 23 (17h=PlanetChangeFactories) ---
 +0     WORD    Planet Id
 +2     WORD    Number of Factories

--- Code 24 (18h=PlanetChangeDefense) ---
 +0     WORD    Planet Id
 +2     WORD    Number of Defense Posts

--- Code 25 (19h=PlanetChangeNeutronium) ---
 +0     WORD    Planet Id
 +2     DWORD   Neutronium / kt

--- Code 26 (1Ah=PlanetChangeTritanium) ---
 +0     WORD    Planet Id
 +2     DWORD   Tritanium / kt

--- Code 27 (1Bh=PlanetChangeDuranium) ---
 +0     WORD    Planet Id
 +2     DWORD   Duranium / kt

--- Code 28 (1Ch=PlanetChangeMolybdenum) ---
 +0     WORD    Planet Id
 +2     DWORD   Molybdenum / kt

--- Code 29 (1Dh=PlanetChangeColonists) ---
 +0     WORD    Planet Id
 +2     DWORD   Colonist Clans

--- Code 30 (1Eh=PlanetChangeSupplies) ---
 +0     WORD    Planet Id
 +2     DWORD   Supplies / kt

--- Code 31 (1Fh=PlanetChangeMoney) ---
 +0     WORD    Planet Id
 +2     DWORD   Megacredits

--- Code 32 (20h=PlanetColonistTax) ---
 +0     WORD    Planet Id
 +2     WORD    Tax rate

--- Code 33 (21h=PlanetNativeTax) ---
 +0     WORD    Planet Id
 +2     WORD    Tax rate

--- Code 34 (22h=PlanetBuildBase) ---
 +0     WORD    Planet Id

Note that the `PlanetBuildBase' command has no data. It is sent if the last word in the planet record is non-zero meaning `build a base'. For THost, you can include the data word; however, PHost does not accept such turns (see above).

The codes 35 (23h) to 39 (27h) are unused.

--- Code 40 (28h=BaseChangeDefense) ---
 +0     WORD    Base Id
 +2     WORD    Base Defense Count

--- Code 41 (29h=BaseUpgradeEngineTech) ---
 +0     WORD    Base Id
 +2     WORD    New Tech Level

--- Code 42 (2Ah=BaseUpgradeHullsTech) ---
 +0     WORD    Base Id
 +2     WORD    New Tech Level

--- Code 43 (2Bh=BaseUpgradeWeaponsTech) ---
 +0     WORD    Base Id
 +2     WORD    New Tech Level

--- Code 44 (2Ch=BaseBuildEngines) ---
 +0     WORD    Base Id
 +2   9 WORDs   Number of engines of that type on the base

--- Code 45 (2Dh=BaseBuildHulls) ---
 +0     WORD    Base Id
 +2  20 WORDs   Number of Hulls of that type at the base. These are the 20
                ship types from TRUEHULL.DAT which the player can build.

--- Code 46 (2Eh=BaseBuildWeapons) ---
 +0     WORD    Base Id
 +2  10 WORDs   Number of Beams of that type on the base

--- Code 47 (2Fh=BaseBuildLaunchers) ---
 +0     WORD    Base Id
 +2  10 WORDs   Number of Torpedo Launchers of that type on the base

--- Code 48 (30h=BaseBuildTorpedoes) ---
 +0     WORD    Base Id
 +2  10 WORDs   Number of Torpedoes of that type on the base

--- Code 49 (31h=BaseBuildFighters) ---
 +0     WORD    Base Id
 +2     WORD    Number of Fighters on the base

--- Code 50 (32h=BaseFixRecycleShip) ---
 +0     WORD    Base Id
 +2     WORD    Ship Id

--- Code 51 (33h=BaseFixRecycleShip) ---
 +0     WORD    Base Id
 +2     WORD    Action
                 0      none
                 1      fix
                 2      recycle

--- Code 52 (34h=BaseChangeMission) ---
 +0     WORD    Base Id
 +2     WORD    Primary Order (see BDATAx.DAT)

--- Code 53 (35h=BaseBuildShip) ---
 +0     WORD    Base Id
 +2     WORD    Hull Number
 +4     WORD    Engine
 +6     WORD    Beam Weapon Type
 +8     WORD    Beam Weapon Count
+10     WORD    Torpedo Type
+12     WORD    Torpedo Count
+14     WORD    Set to zero. See BDATAx.DAT for more info.

A well-known Winplan bug (now fixed) is that its built-in MAKETURN did not generate this command if the build order _changed_; instead it generated it if it was present. This prevented users from canceling a build order after the ship limit.

PHost has a workaround for this, which you should be aware of when generating Winplan TRNs: if it receives a Winplan TRN, the BaseBuildShip command specifies the current build order for the starbase. If there is no such command for a particular starbase, the base's build order is canceled. So you must send this command for all bases with either changed or present build orders to generate TRNs suitable for both THost and PHost.

--- Code 54 (36h=BaseUpgradeTorpTech) ---
 +0     WORD    Base Id
 +2     WORD    New Tech Level

The codes 55 (37h) to 59 (3Bh) are unused.

--- Code 60 (3Ch=SendMessage) ---
 +0     WORD    Length of message. The maximum length in THost is 700
                bytes, PHost formats the message to 40 columns and then
                allows 18 lines to be transmitted.
 +2     WORD    Sender (=Player Id)
 +4     WORD    Receiver
 +6   n BYTEs   Message (encrypted): Each byte is increased by 13dec.
                While DOS programs only encode a single byte for a line
                feed (0Dh, encrypted as 1Ah), Windows MAKETURN uses 0Dh
                0Ah (encrypted 1Ah 17h). See also MDATAx.DAT /
                MDATA35x.DAT. You should prefer using a single 0Dh only:
                a line in a message must not be longer than 40 characters,
                and THost counts the 0Ah as text character.

--- Code 61 (3Dh=ChangePassword) ---
 +0     WORD    0 (?)
 +2  10 BYTEs   New password, encrypted. Each character is increased by 32h

--- Code 62 (3Eh=SendBack) [PHost 4.0+] ---
 +0     WORD    Receiver race, 0 means same as sender. Currently must be
                either 0 or same as sender to avoid spoofing.
 +2     WORD    Record Type
 +4     WORD    Data Size. Note that the complete TRN command must be
                below 32k, hence this value must be < 32760. You'd better
                set the limit a bit lower to not tempt fate :)
 +6   n BYTEs   Data

This command is ONLY supported by PHost 4.0 and later. The enclosed data will be echoed back to the player in his UTILx.DAT, as a normal UTILx.DAT record. This way, programs can send arbitrary information through the host. In particular, by sending file transfer records (type 34), one can send files.

This is a testing version.
It may be incomplete, and have more bugs (or features) than the public live version at planetscentral.com.