Banner Image

Module AI.AI_Cargo_Ship

AI - Models the intelligent transportation of infantry and other cargo.


Author: acrojason (derived from AI_Cargo_APC by FlightControl)


Global(s)

Global AI_CARGO_SHIP

Brings a dynamic cargo handling capability for an AI naval group.

#AI_CARGO_SHIP AI_CARGO_SHIP

Brings a dynamic cargo handling capability for an AI naval group.

Naval ships can be utilized to transport cargo around the map following naval shipping lanes. The AI_CARGO_SHIP class uses the Cargo.Cargo capabilities within the MOOSE framework. Cargo.Cargo must be declared within the mission or warehouse to make the AI_CARGO_SHIP recognize the cargo. Please consult the Cargo.Cargo module for more information.

Cargo loading.

The module will automatically load cargo when the Ship is within boarding or loading radius. The boarding or loading radius is specified when the cargo is created in the simulation and depends on the type of cargo and the specified boarding radius.

Defending the Ship when enemies are nearby

This is not supported for naval cargo because most tanks don't float. Protect your transports...

Infantry or cargo health.

When cargo is unboarded from the Ship, the cargo is actually respawned into the battlefield. As a result, the unboarding cargo is very healthy every time it unboards. This is due to the limitation of the DCS simulator, which is not able to specify the health of newly spawned units as a parameter. However, cargo that was destroyed when unboarded and following the Ship won't be respawned again (this is likely not a thing for naval cargo due to the lack of support for defending the Ship mentioned above). Destroyed is destroyed. As a result, there is some additional strength that is gained when an unboarding action happens, but in terms of simulation balance this has marginal impact on the overall battlefield simulation. Given the relatively short duration of DCS missions and the somewhat lengthy naval transport times, most units entering the Ship as cargo will be freshly en route to an amphibious landing or transporting between warehouses.

Control the Ships on the map.

Currently, naval transports can only be controlled via scripts due to their reliance upon predefined Shipping Lanes created in the Mission Editor. An interesting future enhancement could leverage new pathfinding functionality for ships in the Ops module.

Cargo deployment.

Using the AI_CARGO_SHIP.Deploy() method, you are able to direct the Ship towards a Deploy zone to unboard/unload the cargo at the specified coordinate. The Ship will follow the Shipping Lane to ensure consistent cargo transportation within the simulation environment.

Cargo pickup.

Using the AI_CARGO_SHIP.Pickup() method, you are able to direct the Ship towards a Pickup zone to board/load the cargo at the specified coordinate. The Ship will follow the Shipping Lane to ensure consistent cargo transportation within the simulation environment.

Developer Note

Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE Therefore, this class is considered to be deprecated

Type(s)

Field(s)

Function(s)

FInd a free Carrier within a radius

Defined in:

AI_CARGO_SHIP

Parameters:

#number Radius

Return value:

NewCarrier

Follow Infantry to the Carrier

Defined in:

AI_CARGO_SHIP

Parameters:

CargoGroup

Return value:

Creates a new AI_CARGO_SHIP object.

Defined in:

AI_CARGO_SHIP

Parameters:

The carrier Ship group

The set of cargo to be transported

#number CombatRadius

Provide the combat radius to defend the carrier by unboarding the cargo when enemies are nearby. When CombatRadius is 0, no defense will occur.

#table ShippingLane

Table containing list of Shipping Lanes to be used

Return value:

Set the Carrier

Defined in:

AI_CARGO_SHIP

Parameter:

Wrapper.Group#GROUP CargoCarrier

Return value:

Defined in:

AI_CARGO_SHIP

Parameter:

CombatRadius

Defined in:

AI_CARGO_SHIP

Parameter:

ShippingLane

Check if cargo ship is alive and trigger Unload event.

Good time to remind people that Lua is case sensitive and Unload != UnLoad

Defined in:

AI_CARGO_SHIP

Parameters:

Coordinate

DeployZone

Check if cargo ship is alive and trigger Load event

Defined in:

AI_CARGO_SHIP

Parameters:

Coordinate

Speed

PickupZone

On after Deploy event.

Defined in:

AI_CARGO_SHIP

Parameters:

From

Event

To

Coordinate of the deploy point

#number Speed

Speed in km/h to sail to the deploy coordinate. Default is 50% of max speed for the unit

#number Height

Altitude in meters to move to the deploy coordinate. This parameter is ignored for Ships

Core.Zone#ZONE DeployZone

The zone where the cargo will be deployed.

Ship

Defined in:

AI_CARGO_SHIP

Parameters:

Ship

From

Event

To

Coordinate

Speed

Height

HomeZone

Defined in:

AI_CARGO_SHIP

Parameters:

Ship

From

Event

To

on after Pickup event.

Defined in:

AI_CARGO_SHIP

Parameters:

AI_CARGO_SHIP

Ship

From

Event

To

of the pickup point

#number Speed

Speed in km/h to sail to the pickup coordinate. Default is 50% of max speed for the unit

#number Height

Altitude in meters to move to the pickup coordinate. This parameter is ignored for Ships

Core.Zone#ZONE PickupZone

(optional) The zone where the cargo will be picked up. The PickupZone can be nil if there was no PickupZoneSet provided

self

Ship

On after Unload event.

Defined in:

AI_CARGO_SHIP

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Core.Zone#ZONE DeployZone

The zone wherein the cargo is deployed. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE.

Defend