MrxArtilleryAttack
Module: mrxartilleryattack.lua
Overview
MrxArtilleryAttack is a small, self-contained helper that drops a staggered falling-ordnance strike onto an objectβs position β a plain function you call with a target uGuid, not a player-facing support type. It spawns several shells at randomized positions around the target to fake an artillery bombardment. Unlike MrxArtillery, it has no designator, no cost, no VO, and no inheritance β itβs the raw βmake N shells fall on this spotβ primitive.
Inheritance
- Inherits from:
none β base/utility module - Imports:
none(calls the Airstrike engine namespace directly)
Instance pattern
This is a stateless manager/utility module (no per-instance table). It does not track any persistent state.
Functions
Create(uGuid, nShells, nDistance, sTemplate, nTime)
Spawns an artillery bombardment at the specified location (uGuid). Configures the number of shells (nShells), distance from the target (nDistance), shell template (sTemplate), and total time for the attack (nTime). Randomizes positions for each shell and schedules their deployment using timers.
Not mentioned above but confirmed in source: before scheduling any of the nShells, Create immediately fires one extra shot at the raw (un-offset) target position using a hardcoded "Artillery Smoke Shell" template β always, regardless of sTemplate, and not configurable via any parameter. This is likely a marker/ranging round rather than a real hit.
TriggerFallingMissile(x, y, z, sTemplate)
Spawns a single falling round at the given coordinates via Airstrike.SpawnOrdnance:
Airstrike.SpawnOrdnance(sTemplate, x, y, z, 0, -100, 0, "impact", 1)
Downward velocity -100, "impact" detonation. Note it passes no uOwner (9-arg form), so kills from this strike arenβt attributed to a player β a real difference from MrxArtillery.TriggerFallingMissile, which passes self.uOwner.
Events
No event subscriptions. Create schedules each of the nShells rounds with Event.TimerRelative at 5 + i * (nTime / nShells) seconds. The marker smoke shell is fired immediately (no timer), so the strike opens with an un-offset ranging round and the real barrage lands starting ~5 seconds later β two different time bases worth knowing when tuning nTime.
Module constants & tunables
All are Create parameters with defaults, plus one hardcoded literal:
nShells = 5,nDistance = 10,sTemplate = "Artillery Shell",nTime = 4(defaults applied viaor).- Marker round: always
"Artillery Smoke Shell", un-offset, fired with no timer β not configurable (see the callout above). - Drop height:
y + 250(marker and barrage share the same computed Y).
Notes for modders
- Call it with just
MrxArtilleryAttack.Create(uTarget)for the defaults, or pass all five args to retune count/spread/template/duration. sTemplateaccepts any Airstrike template string β swap"Artillery Shell"for something heavier to change the payload without touching the timing.- If you donβt want the tell-tale smoke ranging round, youβd have to override
Createwholesale β the"Artillery Smoke Shell"shot is hardcoded, not parameterized.