First release of double stacking containers on wagons works, and if I have time I'll provide a short video. Aldarion provided a container crane with cables and with a grabber which varies its extension depending from the length of the container, and the controls for such animations have been introduced in the code and work. Moreover now it is no more needed to move the train for every container. It is now possible to perform load/unload operations for all wagons that are within the Z-movement range of the crane.
Replying to Peter after some days of coding and testing: I'm open to discussion about file formats and so on, but I think that the best place is here, for two reasons: first, we are speaking about files that will be managed by content creators and by players, so here there is a wider audience. Second, I prefer not to duplicate the discussion.
At the moment for the containers I am using an intermediate solution: container data are stored in .inc files (one for every container type) within a directory, with a mnemonic name indicating the dimensions of the container and the brand. This way it is not needed to write specific code, and the data are centralized, easily accessible and don't require duplication. As this is a solution that didn't require writing code, another solution, if better, wouldn't mean that I have wasted time.
I am thinking at two ways to link container data to wagon data: the first way is - let's say so - an embedded way, where the .wag file contains the data of the containers carried by referencing the above .inc files. I think that wagon+container developers would like to have also this possibility. The second way is to insert the link in the .con file.
I am thinking at the following one:
...
Wagon (
WagonData ( DTTX_62142_3D ATW.DTTX_62142 )
UiD ( 6 )
ContainerData (
Container (
Include ( "..//..//common.containerdata//20hamburgsud.inc")
Alignment (CenterRear)
)
Container (
Include ( "..//..//common.containerdata//20cmacgm.inc")
Alignment (CenterFront)
)
...
)
...
Allowed alignments are Rear, CenterRear, CenterFront, Front, Center and Above. I believe I can manage all significant container layouts this way.
Center alignment is default.
Inserting the code to manage these insertions should not be a problem, and I think that this format is easily manageable by both activity creators and players.
In addition to that, a new file format is needed to define the containers that are present at game start in the various container stations. I'd prefer to keep it in "MSTS" format, because that would be coherent with the other files, but I see that for new file formats the .json format is mandatory...
This new file could then be recalled from .act files, and also from timetable files, provided someone would implement this second link.