MrxSatClusterBomb
Module: mrxsatclusterbomb.lua
Overview
MrxSatClusterBomb is the satellite-targeted cluster bomb: same two-projectile idea as MrxClusterBomb (a "Cluster Bomb Projectile" shell that scatters "Cluster Bomblet Projectile" submunitions on detonation), but designated through a satellite mini-game instead of ground smoke β and it fires a wider four-ring spread rather than two. Extends MrxSupport and uses MrxSupportDesignatorSatellite.
Inheritance
- Inherits from:
MrxSupport - Imports:
MrxSupportDesignatorSatellite
Instance pattern
Same class-factory pattern as MrxSupport, not per-uGuid β Create(oSelf, uPlayerGuid) builds a new table via setmetatable/__index, exactly like its parent. No OnActivate/Awake, no tInstance registry. It tracks the following key fields:
oDesignator: The designator satellite used for targeting.uOwner: The GUID of the player who owns this support system.sDeliveryVehicle: The name of the delivery vehicle.uDeliveryVehicle: The GUID of the delivery vehicle.uJet: The GUID of the jet used for delivering the bombs.uSpawnedBomb: The GUID of the spawned bomb projectile.
Module constants & templates
tVOCuesβ three"Misha-None-Freeplay-Support-*"lines (03/14/25) declared at module scope, but this file never callsPlayAirstrikeVO, so theyβre not actually played here (unlike its ground sibling MrxClusterBomb).- Ordnance:
"Cluster Bomb Projectile"(shell,nSpeedScale = 35) β"Cluster Bomblet Projectile"(submunitions,nSpeed = 20). Shell detonation trigger:"distance"withnDistance = nSpawnY - nTargetY - 15. - Satellite designator config:
SetMinigameSectors({{45,135},{225,315}})andSetCost(0)β this strike is free (no support-resource cost).
Functions
Create(oSelf, uPlayerGuid)
Class-factory constructor (uses oSelf as the prototype name). Builds a satellite designator with _NoValidation, the two minigame sectors above and SetCost(0), sets owner / recruit "Pilot" / module name, and copies the delivery-vehicle fields.
DesignationCallback(oSelf)
Runs after the satellite mini-game. Computes spawn/target points from the camera and flies the jet with Airstrike.Flyby(β¦, 100, DropBomb, {oSelf, nTargetX, nTargetY, nTargetZ}). (No VO call β see the note above.)
DropBomb(oSelf, nTargetX, nTargetY, nTargetZ)
Reads the jet position and the current designator target, computes nDistance = nSpawnY - nTargetY - 15, and fires the shell with Airstrike.SpawnOrdnance("Cluster Bomb Projectile", β¦, "distance", nDistance, oSelf:GetOwner(), BombExplodes, {oSelf}).
BombExplodes(oSelf)
Detonation callback. Aims a normalized vector at the target and fires four forward cones of bomblets (vs the ground cluster bombβs two):
Airstrike.ConeSpawn("Cluster Bomblet Projectile", β¦, 10, 20, 4) -- 10Β° / speed 20 / 4 bomblets
Airstrike.ConeSpawn("Cluster Bomblet Projectile", β¦, 15, 20, 4) -- 15Β° / 4
Airstrike.ConeSpawn("Cluster Bomblet Projectile", β¦, 30, 20, 6) -- 30Β° / 6
Airstrike.ConeSpawn("Cluster Bomblet Projectile", β¦, 50, 20, 6) -- 50Β° / 6
~20 submunitions across four escalating rings out to a 50Β° cone β a broader footprint than the ground variant.
Events
- No
Event.Createsubscriptions.DesignationCallback/DropBomb/BombExplodesare wired by the parent designation flow and theAirstrike.Flyby/Airstrike.SpawnOrdnancecallbacks β not event handlers.
Notes for modders
- The four
Airstrike.ConeSpawncalls (angle, speed, count) are the spread lever β widen the angles (10/15/30/50) or raise the counts (4/4/6/6) in an override ofBombExplodes(a plain global) for a bigger saturation pattern; compare the two-ring MrxClusterBomb. SetCost(0)makes this strike free β flip it to a nonzero cost (or setSetCostin an override ofCreate) if you want it to consume support resources.SetMinigameSectors({{45,135},{225,315}})defines the satellite-aiming mini-gameβs valid arcs; adjust for an easier/harder designation.