MrxCrateDelivery
Module: mrxcratedelivery.lua
Overview
MrxCrateDelivery is the ground-crate variant of the standard helicopter cargo delivery, and the workhorse of the supply-drop economy β MrxSupportData instantiates it for the overwhelming majority of catalog items (every Supply crate, plus most Light/Heavy/Civilian vehicle drops that arrive winched under a copter). Like MrxBoatDelivery itβs a thin subclass of MrxSupportDelivery: the whole file is one Create. All delivery logic is inherited; this module only sets a ground drop-zone validation function on the designator, blue smoke, and disables AA testing.
Inheritance
- Inherits from:
MrxSupportDelivery - Imports:
MrxSupportDesignator
Instance pattern
Same class-factory pattern as MrxSupportDelivery, not per-uGuid β Create(oSelf, uOwnerGuid) builds a new table via setmetatable/__index, exactly like its parent. No OnActivate/Awake, no tInstance registry. It extends the functionality of MrxSupportDelivery without adding new state fields. The instance primarily manages the delivery process, including setting up the cargo and vehicle, configuring the designator, and handling specific validation logic.
Functions
Create(oSelf, uOwnerGuid)
The only function in the file. Calls MrxSupportDelivery:Create(uOwnerGuid) for the base object, then copies the caller-prototypeβs cargo (SetCargo(oSelf.sCargoToDeliver)), delivery vehicle (SetDeliveryVehicle(oSelf.sDeliveryVehicle)) and careless flag (SetCareless(oSelf.bCareless)) onto it. It then reconfigures the existing designator (the blue-smoke one the parent already built β fetched via GetDesignator(), not replaced): installs MrxSupportDesignator.ValidateGroundDropZone as the validation function, sets smoke color "blue", and AA test level "none". Sets the module name and returns the object.
Events
None of its own. The delivery sequence β Event.ObjectHibernation (heli wake, then cargo wake) and Event.ObjectWinched ("Detach" β cargo dropped) β is entirely inherited from MrxSupportDeliveryβs _DesignatorCallback β _DeployWinch β _WaitCallback β CargoDropped chain. (There is no Awake function anywhere in the parent; an earlier version of this page claimed one.)
Notes for modders
- Cargo/vehicle come from the callerβs prototype, not from fields you set on the returned object. The catalog (
MrxSupportData) configuresSetCargo(...), optionallySetDeliveryVehicle("Mi26 (PMC) (Driver)")for heavy vehicles, andSetCareless(true)for crates, all on the prototype beforeCreatecopies them across. - Ground drop-zone validation (
MrxSupportDesignator.ValidateGroundDropZone) is the crate-specific gate β a designation over water/invalid terrain is rejected. Swap or clear the validation function on the designator if you need to allow other terrain. - Drop mechanics live on the parent β for drop height (and its documented
SetCargoDropHeightbug), cargo random-selection from a list, and the winch/Ai.Deliversequence, seeMrxSupportDelivery.