Add basic transport load/unload#936
Conversation
stavrosfa
left a comment
There was a problem hiding this comment.
Good stuff, I can imagine this being a slight pain to work out 😅
I have encountered some bugs and such, but i mostly think these can be attributed to the fact that anything can be loaded into anything with enough capacity. Should be ok once this is implemented.
| prototype.attack = prto.Attack; | ||
| prototype.defense = prto.Defense; | ||
| prototype.movement = prto.Movement; | ||
| prototype.capacity = prto.Capacity; |
There was a problem hiding this comment.
We are missing a couple of Unit special actions.
Looking at the editor, each unit (PRTO) than can be loaded into something (not sure if this means an Army as well, but I am pretty sure it means a transport unit), has a "Special Action" called Load
Check the Infantry for example, it has the Load action
In contrast, a Galley that can load, and subsequently unload units, has the Unload action
The Galley doesn't have the Load because, it can't be loaded into something else.
These two actions are located here
OpenCiv3/QueryCiv3/BiqSections/Prto.cs
Line 164 in 8119dd4
So that means, that we can directly check if a unit can be loaded into something that can load units, right now we can load anything, to a unit with enough capacity.
There was a problem hiding this comment.
Lines 1151-1152 in ImportCiv3.ImportBicUnits() solve this, I think. I added them in, but then commented out as I figured I'd get the capacity and some cleanup in first in the base ruleset. I can take another look.
For the base ruleset, I think the unit promotion stuff isn't quite lined up perfectly, as when I save, I seem to get unitPrototype upgrade paths featuring unique units instead of the regular ones.
|
|
||
| textures.transport_infobox = { | ||
| box = { | ||
| path = INTERFACE .. "box trans color.pcx", |
There was a problem hiding this comment.
These two need to be imported somewhere around here
OpenCiv3/C7/Lua/texture_configs/c7.lua
Line 67 in 8119dd4
and we also need to add the equivalent texture for the standalone mode
|
|
||
| [GlobalClass] | ||
| [Tool] | ||
| public partial class TransportInfoBox : Civ3TextureRect { |
There was a problem hiding this comment.
Feel free to ignore this, but my ocd doesn't let me ignore that the box is missalighned compared to the LowerInfoBox. I know it's the same in the original, feel free to leave this as is 😄
A few actual comments on the box:
- We can click throught, although we shouldn't
- The textures in the original are about half the texture size of the InfoBox. Perhaps to accomodate for larger capacities? Should we stick to that?
- In the original, there is a box outline around (only) the transport unit? Again, should we be replicating that?
- We should be able to select a unit inside a transport to activate/wake, etc.. That also probably means, that these are not simple texture, rather texture buttons.
There was a problem hiding this comment.
- Adjusted box position a bit -- sadly the visually heavy next turn blinker makes the simple box looks out of place still
- Removed the click-through, but need to revisit the texture button even capture
- Resized units sprites, but each unit still goes into a 50x50 unit button -- unit sprites don't seem to share a common baseline, or I'm missing something
- Added transport unit highlight box with Line2D
Add basic support for transport mechanic: loading and unloading units from a vehicle with transport capacity.
move(..)to allow load/unloadmove(..)so transports can move other unitsL/U)Manual
Loading and Unloading
You can have a ship wait until it is loaded to capacity with units by clicking the Load order or pressing [L]. Boarding a
ship uses up all a unit’s movement points for the turn. If you attempt to move a naval unit into a land square that does not contain a port city, any passengers who have not already moved this turn are offered the option to disembark and make landfall. You can also order a ship to unload all its passengers by clicking the Unload order or pressing [L].
Demo