ParadropLocation
Module: paradroplocation.lua
Overview
ParadropLocation is the ground trigger that summons a paradrop plane. It is the script on a small marker object placed in the world: when that object wakes, it reads its own position and faction, flies a faction-appropriate paradrop aircraft over the spot (via Airstrike.Flyby), then deletes itself.
The aircraft it summons runs the separate Paradrop script, which is what actually spawns the Paratrooper soldiers.
Inheritance
- Inherits from:
none — base/utility module - Imports:
MrxUtil
Instance pattern
Stateless — no per-instance table, no Create/setmetatable. It reacts once per activation through its two top-level functions and then removes the triggering object.
Functions
OnActivate(uGuid)
Engine lifecycle callback. Wires an Event.ObjectHibernation "awake" event so Start runs once the trigger object leaves hibernation.
Start(uGuid)
Reads the object’s position (Object.GetPosition) and faction (MrxUtil.GetFaction). If position, faction, and tTemplates[sFaction] are all valid it calls Airstrike.Flyby(tTemplates[sFaction], x - 50, z + 300, x, z, y + 100, 40) — a flyby that approaches offset from the trigger, passes over it at y + 100 altitude, at speed 40 — then removes the trigger object with Object.Remove. If the faction has no template entry, it returns early without removing the object.
Events
Event.ObjectHibernation("awake"filter, wired inOnActivate) — the only subscription; firesStart.OnActivate/Startthemselves are lifecycle/handler functions, not events.
Module constants & tunables
tTemplates— the summoned aircraft per faction:China = "Support Vehicle (paradop_ch)"Allied = "Support Vehicle (paradop_al)"
Only these two factions are wired; any other faction is a no-op (the trigger stays in the world).
- Flyby geometry: approach offset
(-50, +300), over-point(x, z), altitudey + 100, speed40— the arguments toAirstrike.Flyby. Adjust to change the approach path/height/speed.
Notes for modders
- Swap the summoned plane by editing
tTemplates(or add rows for more factions). The plane template must itself carry theParadropscript to actually drop soldiers. - The trigger self-deletes only on the success path. If you rely on it firing once, note that a faction with no
tTemplatesentry leaves the object alive (it could re-fire on a later wake).