Talk:Cepheïde Transport Gate
From PlanetsWiki
If the Special section of the Gate will not work. I will add the Pod Launch Pad to the race and that last part will be different:
Ground Units, Fighters, Prisoners, Ore and Ship parts can be send thru the gate, when they are placed into a Pod. The pod must be docked to the ship who will activate te Gate. The Pods will land in the base or will made a base if not present on the planet.
The Mivorari White Star Monitor get then 3 pod bays, the Mivorari Phase Starbase get then 9 pod bays and the Mivorari Population Coloniser get 6 pod bays.
--Mivorari
I don't believe that using the Transporters in such a way will be a problem.
You can set a transport at any distance, as it is now. Every tick of movement, all ships check to see if their transport target is within range (~3-5 ly), and the cargo is transferred when close enough. It should be possible to include an OR portion to the check.
A boolean variable should be created, call it booMivGate. Initialize it to 0.
IF Ship has Dial Gate Device THEN
IF (Transport target is Base with CTG building) OR (Transport target is a Planet at same location as Hull, owned by same player as Ship, with Portable Gate Device) THEN
IF (Ship speed = 0) AND (Transport target speed = 0) THEN
booMivGate = 1
END IF
END IF
END IF
Now, in the same check to see if the Ship and its Transport target are within range, add the OR portion.
IF (distance between Ship and Transport target <= transport range) OR (booMivGate = 1) THEN
<existing transport code here>
END IF
This algorithm is slightly different from yours, though the effects should be identical. The two valid transfer targets of this algorithm are a Base with the Gate building or a Planet with Portable Gate device in orbit. Yours has the Base and a Ship with the device as the targets. I believe that would be more complex to code, as the target of the transfer would have to be changed within the code to be the Planet under the Hull that is actually the target.
Additionally, using Pods would allow Ship parts, Hull plans, Fighters, Mechs, Contraband and Prisoners to be transported, which is not possible when using the Ship transporter. That would be a significant increase in potential power.
Amaranthine
P.S. I totally spaced the fact that the special section was entirely about sending some of those special items. I don't see an issue with the programming to do so within the Transport code, though it would be possible to do so in half the time than other, standard, cargo.
Standard cargo takes 1 turn to beam up and another to beam it via the DGD. For these special items, all it takes is 1 turn to set the Command Code to automatically transfer all material of the specific type (max 3 types possible per turn) to the target location. The special cargo also has no limit on the amount that can be transferred and standard cargo is limited by the Ship's capacity.
I think you make it more complex. The transport take place before movement or after movement. It does not matter when. The ship speed must be set on 0 (zero). So if the ship has a speed more then zero the transport don't takes place. Very simple it is.
However the proc of sending metal and people thru the gate is an other story.
What if you must target a planet of base with a ship in orbit. So the program must check if there is a ship around. Location is the same.
Second problem is. The metal and people who will transport thru the gate are on the base and not in the ship around the base. The Ships cargos are less then 100. Why need a big cargo room if there is a Gate building for transport....
The transporting ship must always an active DGD and is a Mivorari ship owned by the Mivorari.
What if we do this:
IF Ship has Dial Gate Device AND (owner = Mivorari) THEN
IF (Dail Gate Device = On) THEN
IF (WayPoint1 is Base with CTG building) OR (WayPoint1 is a Planet with a HullNr between 536 and 551, owned by same player as Ship) THEN
IF (Ship speed = 0) AND (Ship at WayPoint1 speed = 0) THEN
booMivGate = 1
END IF
END IF
END IF
END IF
BooMivBase = 0
IF WayPoint1 is Base with CTG THEN
booMivBase = 1
END IF
IF (BooMivGate = 1) AND (BooMivBase = 1) THEN
Send Selected amount in trans screen to Base at WayPoint1
ELSE IF (BooMivGate = 1) AND (BooMivBase = 0) THEN
Send Selected amount in trans screen to planet and create a base for player
END IF
Then we have the Ground Units, Fighters and Prisoners section.
IF CommandCode = gu1 THEN send all Solstilium Tanks to WP1
ELSE IF CommandCode = gu2 THEN send all Perihelium Anti Air to WP1
ELSE IF CommandCode = gu3 THEN send all Mineral Miner to WP1
ELSE IF CommandCode = fi1 THEN send all Apex Short Range Fighter to WP1
ELSE IF CommandCode = fi2 THEN send all Terminator Attack Fighter to WP1
ELSE IF CommandCode = fi3 THEN send all Antapex Long Range Fighter to WP1
END IF
IF right(CommandCode,1) = R AND (left(val(CommandCode),2) => 1 AND left(val(CommandCode),2) <= 30 THEN send race ## to WP1
END IF
Or something like this. I write in Clipper and not in basic or pascal.
