From 52b79f172febc552d856197a7a14a89e6472e956 Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Tue, 23 Jun 2026 11:59:34 +1000 Subject: [PATCH 1/3] Add a number of new options to npc_rocket_turret --- fgd/point/npc/npc_rocket_turret.fgd | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/fgd/point/npc/npc_rocket_turret.fgd b/fgd/point/npc/npc_rocket_turret.fgd index c5bb333c3..35f126309 100644 --- a/fgd/point/npc/npc_rocket_turret.fgd +++ b/fgd/point/npc/npc_rocket_turret.fgd @@ -1,5 +1,7 @@ @PointClass base(BaseNPC, ResponseContext) - studioprop() line(0 0 255, targetname, TripwireAimTarget) + studioprop() + line(0 0 255, targetname, TripwireAimTarget) + line(128 128 128, targetname, TripwireFilter) appliesto(P2CE) sphere(turretrange) = npc_rocket_turret: "Aims a rocket at a target." @@ -13,22 +15,34 @@ rocketlifetime(float) : "Rocket Lifetime" : 20 : "The rocket will automatically detonate after this number of seconds." FireCooldown(float) : "Fire Cooldown" : 4 : "The time it takes for the rocket turret to reset after firing a rocket." LockonTime(float) : "Lockon Time" : 1.5 : "The time it takes for the rocket turret to fire a rocket after locking onto a target." + AcquireEnemies(boolean) : "Acquire Enemies" : 0 : "If enabled, the turret will automatically find enemies with a HATE relationship." TripwireMode(boolean) : "Tripwire Mode" : 0 : "Makes the turret aim in a specific direction instead of following the target. When the beam is crossed, a rocket instantly fires." TripwireAimTarget(target_destination) : "Tripwire Aim Target" : : "In tripwire mode, the entity to aim at." - model(studio) : "Model" : "models/props_bts/rocket_sentry.mdl" : "Model to use in-game" + TripwireFilter(filterclass) : "Tripwire Filter" : : "If set, overrides which entities trigger rockets in tripwire mode. For normal mode, use an ai_relationship and 'Acquire Enemies'." + model(studio) : "Model" : "models/props_bts/rocket_sentry.mdl" : "Model to use for the turret." turretrange(float) : "Maximum Range" : 8192 : "How far the turret will be able to see targets." // Inputs input Toggle(void) : "Toggles between activated and deactivated states." - input Enable(void) : "Activate Rocket Turret, and allow it to begin scanning." - input Disable(void) : "Deactivate and retract the Rocket Turret." - input SetTarget(target_destination) : "Sets the target for this turret to attack." + input Enable(void) : "Activate the rocket turret, and allow it to begin scanning." + input Disable(void) : "Deactivate and retract the rocket turret." + input SetTarget(target_destination) : "Sets the target for this turret to attack. The turret will ignore everything else until a new target is given." + input SetAutoTarget(void) : "Allow this turret to automatically find enemies." input Destroy(void) : "Sets this turret to it's destroyed state." input ForceFire(void) : "Makes the turret immediately fire a rocket where it is pointing." + input SetTripwireTarget(target_destination) : "Set the aim target for tripwire mode." + input SetTripwireFilter(filterclass) : "Set the filter to determine which entities trigger the tripwire. Pass nothing to revert to default." + input ToggleTripwire(void) : "Toggle tripwire mode on and off." + input EnableTripwire(void) : "Enable tripwire mode." + input DisableTripwire(void) : "Disable tripwire mode." // Outputs output OnFoundTarget(void) : "Fired when the rocket turret finds an unobstructed target." output OnLostTarget(void) : "Fired when turret's target is blocked." output OnDeath(void) : "Fired after this turret finishes it's destroy think and begins it's death think." + output OnTripped(void): "Fired when the beam intersects an enemy, and is either locking on or immediately firing for tripwire mode. The target is passed as !activator." + output OnRocketFired(void): "Triggers when a rocket is fired, passing the rocket as !activator." + output OnRocketFizzled(void): "Triggers when a rocket hits a fizzler, or the turret itself." + output OnRocketExploded(void): "Triggers when a rocket impacts something." ] From 0996d0d3db2c637f8c5626b3a26374511f299a6c Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Wed, 24 Jun 2026 17:02:18 +1000 Subject: [PATCH 2/3] Allow customising rocket turret beams --- fgd/point/npc/npc_rocket_turret.fgd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fgd/point/npc/npc_rocket_turret.fgd b/fgd/point/npc/npc_rocket_turret.fgd index 35f126309..42cbad690 100644 --- a/fgd/point/npc/npc_rocket_turret.fgd +++ b/fgd/point/npc/npc_rocket_turret.fgd @@ -15,12 +15,17 @@ rocketlifetime(float) : "Rocket Lifetime" : 20 : "The rocket will automatically detonate after this number of seconds." FireCooldown(float) : "Fire Cooldown" : 4 : "The time it takes for the rocket turret to reset after firing a rocket." LockonTime(float) : "Lockon Time" : 1.5 : "The time it takes for the rocket turret to fire a rocket after locking onto a target." + LockonSound(sound): "Lockon Sound" : "RocketTurret.LockonBeep" : "The sound played when locking onto a target." AcquireEnemies(boolean) : "Acquire Enemies" : 0 : "If enabled, the turret will automatically find enemies with a HATE relationship." TripwireMode(boolean) : "Tripwire Mode" : 0 : "Makes the turret aim in a specific direction instead of following the target. When the beam is crossed, a rocket instantly fires." TripwireAimTarget(target_destination) : "Tripwire Aim Target" : : "In tripwire mode, the entity to aim at." TripwireFilter(filterclass) : "Tripwire Filter" : : "If set, overrides which entities trigger rockets in tripwire mode. For normal mode, use an ai_relationship and 'Acquire Enemies'." model(studio) : "Model" : "models/props_bts/rocket_sentry.mdl" : "Model to use for the turret." + beamcolor(color255) : "Beam Color" : "100 100 255 100" : "The color and brightness of the laser beam and glow sprite. The default beam material is not tintable." + beammaterial(sprite) : "Beam Material" : "effects/bluelaser1.vmt" : "Material to use for the laser beam." + glowmaterial(sprite) : "Glow Material" : "sprites/light_glow03.vmt" : "Material to use for the glow sprite at the end of the laser beam." + turretrange(float) : "Maximum Range" : 8192 : "How far the turret will be able to see targets." // Inputs From d3e1deeb7bb629226e404b8d33611febcca65800 Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Wed, 24 Jun 2026 17:02:45 +1000 Subject: [PATCH 3/3] Allow controlling whether rocket/sentry turrets shoot players/npcs through portals --- fgd/point/npc/npc_portal_turret_floor.fgd | 8 +++++++- fgd/point/npc/npc_rocket_turret.fgd | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/fgd/point/npc/npc_portal_turret_floor.fgd b/fgd/point/npc/npc_portal_turret_floor.fgd index b6ff9f38c..e934abb2f 100644 --- a/fgd/point/npc/npc_portal_turret_floor.fgd +++ b/fgd/point/npc/npc_portal_turret_floor.fgd @@ -36,7 +36,13 @@ usedasactor(boolean) : "Used As Actor" : 0 : "Turret will not run the standard floor turret code so it can be used as an actor." pickupenabled(boolean) : "Turret Pickup Allowed" : 1 : "Disables pickup by player." disablemotion(boolean) : "Disable Motion" : 0 : "Set for turrets that can't move in the world." - allowshootthroughportals(boolean) : "Allow Shooting Through Portals" : 0 : "Turrets will not try to shoot through portals unless this is set." + AllowShootThroughPortals[engine](integer): "Shooting Through Portals": 0 + AllowShootThroughPortals(choices): "Shooting Through Portals" : 0 : "Determines which enemies the turret will shoot at through portals." = + [ + 0: "Disabled" + 1: "Players Only" + 2: "Players + NPCs" + ] turretrange(float) : "Maximum Range" : 1024 : "How far the turret will be able to see targets." loadalternativemodels(boolean) : "Load Defective Models" : 0 : "Should this turret precache the defective models? Needed for late switching." usesuperdamagescale(boolean) : "Use Super Damage" : 0 : "Setting this to true will scale the turret's damage by a very large amount." diff --git a/fgd/point/npc/npc_rocket_turret.fgd b/fgd/point/npc/npc_rocket_turret.fgd index 42cbad690..dfd7629d2 100644 --- a/fgd/point/npc/npc_rocket_turret.fgd +++ b/fgd/point/npc/npc_rocket_turret.fgd @@ -17,6 +17,14 @@ LockonTime(float) : "Lockon Time" : 1.5 : "The time it takes for the rocket turret to fire a rocket after locking onto a target." LockonSound(sound): "Lockon Sound" : "RocketTurret.LockonBeep" : "The sound played when locking onto a target." AcquireEnemies(boolean) : "Acquire Enemies" : 0 : "If enabled, the turret will automatically find enemies with a HATE relationship." + AllowShootThroughPortals[engine](integer): "Shooting Through Portals": 0 + AllowShootThroughPortals(choices): "Shooting Through Portals" : 0 : "Determines which enemies the turret will shoot at through portals." = + [ + 0: "Disabled" + 1: "Players Only" + 2: "Players + NPCs" + ] + TripwireMode(boolean) : "Tripwire Mode" : 0 : "Makes the turret aim in a specific direction instead of following the target. When the beam is crossed, a rocket instantly fires." TripwireAimTarget(target_destination) : "Tripwire Aim Target" : : "In tripwire mode, the entity to aim at." TripwireFilter(filterclass) : "Tripwire Filter" : : "If set, overrides which entities trigger rockets in tripwire mode. For normal mode, use an ai_relationship and 'Acquire Enemies'."