Pmcgate
Module: pmcgate.lua
Overview
Pmcgate is a minimal “auto-open” script for a PMC gate object: once the gate wakes, it opens itself 2 seconds later. That’s the entire module. (Contrast FriendlyGate for a richer/faction-aware gate.)
Inheritance
- Inherits from: none — base/utility module
- Imports: none
Instance pattern
Stateless — no per-instance table, no stored event handles. It just chains two engine events and never keeps a reference to them.
Functions
OnActivate(uGateGuid, args)
Engine lifecycle callback. Wires an Event.ObjectHibernation "awake" event that runs OpenGate once the gate leaves hibernation. args is received but not used.
OpenGate(uGateGuid)
Schedules Object.OpenGate(uGateGuid) via Event.TimerRelative after 2 seconds. Note it passes Object.OpenGate directly as the timer callback rather than a wrapper.
Events
Event.ObjectHibernation("awake", inOnActivate) →OpenGate.Event.TimerRelative(2s, inOpenGate) →Object.OpenGate.
Neither handle is stored, so there is no cancellation path — the gate will open 2s after waking regardless of anything else.
Notes for modders
- The only tunable is the
2(seconds) inOpenGate’sEvent.TimerRelative— change it to open the gate sooner or later after it wakes. - Because the timer handle isn’t kept, you can’t cancel the open. If you need a gate that can stay closed conditionally, this module won’t do it — override
OpenGateor use a different gate script.