MrxBoatDelivery
Module: mrxboatdelivery.lua
Overview
MrxBoatDelivery is the water-drop variant of the standard helicopter cargo delivery. It’s a very thin subclass of MrxSupportDelivery — the entire file is one Create function. All the real work (spawn cargo, spawn heli, winch, fly to target, drop) is inherited from MrxSupportDelivery; the only thing this module changes is swapping the smoke designator for a flare designator with anti-air testing disabled, which suits a marker dropped over open water. MrxSupportData uses it for every Boat-type catalog item (jetskis, speedboats, the PMC patrol boat, etc.).
The
inherit("MrxSupportDesignatorFlare")line is effectively unused:Createcreates the flare designator explicitly viaMrxSupportDesignatorFlare:Create(), it doesn’t inherit designator methods. Behaviorally this is aMrxSupportDeliverywith a flare designator bolted on.
Inheritance
- Inherits from:
MrxSupportDelivery,MrxSupportDesignatorFlare - Imports: none
Instance pattern
Same class-factory pattern as MrxSupportDelivery/MrxSupportDesignatorFlare, not per-uGuid — Create(oSelf, uOwnerGuid) builds a new table via setmetatable/__index, exactly like its parents. No OnActivate/Awake, no tInstance registry. It tracks the following key fields:
sCargoToDeliver: The type of cargo to be delivered.oDesignator: The designator used for marking the drop zone.
Functions
Create(oSelf, uOwnerGuid)
The only function in the file. Calls MrxSupportDelivery:Create(uOwnerGuid) to build the base delivery object, then: copies the caller-prototype’s sCargoToDeliver via SetCargo(oSelf.sCargoToDeliver), sets the module name to "MrxBoatDelivery", creates a MrxSupportDesignatorFlare with SetAATestLevel("none"), and installs it as the designator (replacing the blue-smoke one the parent Create set up). Returns the new support object.
New to Lua? Click to expand
oSelf.sCargoToDeliver reads the cargo name off the prototype table the catalog set up (e.g. oSupport:SetCargo({"Dinghy", ...}) in MrxSupportData), and SetCargo here copies it onto the freshly built instance. That’s why the boat items in the catalog configure cargo on the object before it ever runs — the value is read back out at Create time.
Events
None of its own — every event subscription (Event.ObjectHibernation for the heli/cargo wake, and Event.ObjectWinched for the drop) comes from MrxSupportDelivery’s _DesignatorCallback → _DeployWinch → _WaitCallback → CargoDropped chain. See that page for the full delivery sequence.
Notes for modders
- What to change lives on the parent, not here. Drop height, the delivery helicopter template, cargo picking, and the actual winch sequence are all on
MrxSupportDelivery— this file only chooses a flare designator with AA disabled. - Cargo is set by the caller’s prototype. The catalog (
[MrxSupportData](mrxsupportdata)) setsSetCargo(...)andSetCareless(true)on the prototype;Createcopies the cargo across. To change what a boat item delivers, change the catalog entry’s cargo (or setsCargoToDeliveron the prototype beforeCreate), not a field on the returned instance. - Flare vs. smoke over water: the flare designator +
SetAATestLevel("none")is the water-specific choice. If you clone this for a land drop you’d typically want smoke and a ground-drop-zone validation function instead — seeMrxCrateDeliveryfor that shape.