Procgen Effects Showcase
README.md
ShieldFxDriver
ShieldFxDriver runs the energy-shield effect from the ShieldFx module around the entity it sits
on. The dome is centred on the entity's position, incoming fire hammers it, and the impact lights
named by lights flash where each shot lands. It runs while the scene is authored and while it
plays.
The fx_shield scene uses it on the ShieldDome entity (which also carries a Model), with
radius = 9 and lights = "ImpactLight"; the scene holds the lights ImpactLight1 to
ImpactLight4.
It requires ShieldFx (require("ShieldFx")). The impact lights are entities named lights
followed by 1, 2, 3 and so on, each with a Light component.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
radius | number | 9 | The dome's radius, in metres. |
lights | string | "ImpactLight" | The name every impact light starts with; the entities named it followed by 1, 2, 3 and so on flash at each impact. |
Both fields are Sync.
Lifecycle
start(): callsShieldFx.start, withcenterset to the entity's position andradiusset to theradiusfield, and keeps the token it returns. It then collects the impact lights, looking uplights .. 1,lights .. 2and onward for as long as each name finds an entity with aLightcomponent, and hands them toShieldFx.attachLights.update(dt): callsShieldFx.step(dt).editorUpdate(dt): callsShieldFx.step(dt)whileengine.pausedis true.onDestroy(): callsShieldFx.stop(token)with the token fromstart.