Example gadget: viewtopic.php?f=23&t=34417
Glossary:
Legacy Transports - Any unit with transportCapacity > 0 and transportMass > 0 (unit.isTransport in lua)
Airbase Removal
The airbase code in the engine was a bad case of highly specific & buggy code and its maintenance wasn't worth keeping it.
Fuel code was slightly better, but still highly specific and not worth keeping.
Removed Tags:
- minAirBasePower
- maxFuel
- refuelTime
Since isAirbase is used with some AIs it was kept for now, it doesn't affect anything and it is only useful for marking a unit's role.
New Transporting
In order to make a lua reimplementation possible, the transport system was made more generic and new lua callouts were added.
The behaviour of Legacy Transports should stay the same, other than the fact that now every mobile unit can be a Legacy Transport (including builders).
The main change in New Transporting is that now every unit can have units attached (or detached) to it (form it) by using:
- Spring.UnitAttach(transporterID, passengerID, pieceNum) - When used on Legacy Transports this will be equivalent to the script AttachUnit.
- Spring.UnitDetach(passengerID), Spring.UnitDetachFromAir(passengerID)
- Spring.SetUnitLoadingTransport(passengerID, transportID) - Turns off collisions between these two.
Units that were attached are still selectable and can still fire. You can make them unselectable/stun them as necessary.
A Legacy Transport isn't usable for New Transporting.
Air Units Landing
Another required capabilty was to force air units to land in a specific point. This is still being tweaked, but a new lua callout was added:
Spring.SetUnitLandGoal(unitID, x, y, z [, radius]) which tells the unit to land (even if it is in fly mode) in the supplied point (doesn't have to be on ground).
This callout can be called every frame to update the landing position if it needs to be changed (i.e. when landing on a carrier).
Example:
All the above changes are already live in the latest dev version (100.0.1-150-g7bf559f)