[Posting] Re: TRN BaseBuildShip with zero values
From:streu
Thread:TRN BaseBuildShip with zero values
Forum:Planets
In reply to:TRN BaseBuildShip with zero values
Date:Sat, 2020-07-11 07:37 GMT

Can someone who is familiar with the details of TRN file format explain what a Code 53 (35h=BaseBuildShip) command means if everything other than Base ID is set to zero?
[...]
I came across a trn file (I suspect from Winplan, perhaps?) that has one such command (it happens to be the last command in the TRN if that's relevant) that has baseID set, but the other components are all zero. What does this mean?

The meaning of this command, like most TRN commands, is: copy these values to the appropriate place in the host files. A BaseBuildShip command with everything zero therefore means: replace that base's build order with nothing (=cancel the build order).

For most commands, that would be the end of the story: Maketurn computes differences, Host applies patch, done.

There is a bug in Winplan that I tried to describe in filefmt.txt: Winplan doesn't send a BaseBuildShip if the build order is changed, but if (and only if) it is present (not sure about which versions are affected, PHost doc claims it partially affects Dosplan as well). Therefore, PHost interprets absence of a command as cancellation if the turn file is coming from Winplan. This means everyone who sends Winplan-style turns needs to send all present orders, even if unchanged, to avoid triggering that logic.

Corollary: the turn file you got does NOT come from Winplan, but most likely from PCC.

Corollary 2: Winplan users cannot cancel build orders with HOST.

--Stefan