Skip to content

FireSiegeEngine

Fires a loaded siege engine, as its operator’s fire key would.

The shot leaves a moment later - a trebuchet’s sling lets go 2 s into the swing, a cannon’s fuse burns 1.5 s - along the engine’s aim (AimSiegeEngine; never aimed: straight ahead). Its operator, if anyone works it, is the shooter. Refused (the second value says why) when it is not loaded.

FireSiegeEngine(id)
Parameter Type
id number the engine

boolean, string - whether it fires, and why not

-- the mode's own battery: every loaded cannon fires at the gate
for _, id in ipairs(GetSiegeEngines()) do
if GetEntityTemplate(id) == "cannon" then
AimSiegeEngine(id, GATE_X, GATE_Y, GATE_Z)
FireSiegeEngine(id)
end
end

LoadSiegeEngine · OnSiegeShot · OnSiegeImpact · the Siege engines group of the index