Left 4 Dead 2

Left 4 Dead 2

Turret System [Prefab]
44 Comments
华裔小A 21 Feb @ 9:41pm 
It would be nice if a turret that can automate the original M2/M134 could be developed.
Fares 16 Jul, 2023 @ 8:50am 
as you know friendly turret fire still can damage survivors and incapacitate them.

easy solution: ( no scripting needed ):

1 open the turret instance with hammer editor
2 edit the "point_hurt" properties, set the Radius to 1
and the Damage to 1. (that way the point_hurt will do no damage)
3 create a "trigger_hurt" and parent it to the point_hurt.
4 filter your trigger_hurt with "filter_activator_team"
and that's it
Rectus  [author] 17 May, 2023 @ 8:01am 
Somewhere inside the TrackTarget() function inside the checks for a valid target I guess. It's been years though, so can't remember how everything is set up. You would probably have to keep track of whether the sound is playing though, so it doesn't keep restarting.
Fares 17 May, 2023 @ 7:48am 
@Rectus i want the turret to play a sound when it move while tracking players, can you tell me where i can put the line "EmitSoundOn("Forklift.Move", self);"
Rectus  [author] 17 Jan, 2022 @ 12:44am 
Nope. This is just a prefab to make new mods with. Someone would have to make a mod that does that.
Male18 16 Jan, 2022 @ 9:23pm 
Any way to spawn this in campaign with admin system?
Rectus  [author] 27 Jul, 2021 @ 11:55am 
Sorry, I'm not planning on updating it. You would have to do any work yourself.
Fares 27 Jul, 2021 @ 11:25am 
i hope you will got time to update this Turret System and remove friendly fire, right now when i add it on my custom map it always incapacitate the survivals
Rectus  [author] 27 Jul, 2021 @ 11:17am 
Good point, it should be possible to use the same way as in there.
Fares 27 Jul, 2021 @ 11:13am 
didn't you make the Homemade Sentry Turret https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1742953520
damage only zombies, so isn't possible to make this one damage only zombies too?
Rectus  [author] 18 May, 2021 @ 1:06am 
I don't have any on hand unfortuately.
Yakushi Saya 18 May, 2021 @ 12:59am 
may i ask for example? because im amateur
Rectus  [author] 18 May, 2021 @ 12:27am 
You would have to modify the FireWeapon() functions to check for team before doing damage.
Yakushi Saya 17 May, 2021 @ 11:52pm 
Anyway to remove friendly fire of Turret? Survivors can take damage from turret if stay near infected...
-VFSL-svsx 24 Mar, 2019 @ 8:14am 
god jez plz!!!
what a fucking amazing add-on!!!!!!
Can we make this turret can be carring and deploy on campain map?
maybe useing custom weapon base...?
GreenBucketMan 22 Mar, 2019 @ 11:17am 
This Could Renovate the Workshop of L4D2. I Really think this deserves More Apreciation. But I would Actually Want this to Become Better. Btw this is nice
ESI 10 Jan, 2018 @ 9:21am 
it is very unfortunate that they (Valve) abandoned VScripts API, because this made replacement SourceMod, but very little capabilities
Rectus  [author] 10 Jan, 2018 @ 9:17am 
BotQuery only lets you disable bots from meleeing props. It's used for the landmines in Holdout.
ESI 10 Jan, 2018 @ 9:00am 
Oh shit, only Garrys Mod provided this density functions ) What about BotQuery ? He is called when Survivor AI punch prop_physic !?
Rectus  [author] 10 Jan, 2018 @ 6:54am 
Unfortunately there isn't that much you can do with the AI. CommandABot() is the only AI related function exposed in the VScript API, and it's use is very limited. There is no real way of controlling the bot systems or accessing the nav mesh. CommandABot() lets you command the bots to move somewhere or attack something, but they're really stupid while doing so, and ignore everything around them.
ESI 10 Jan, 2018 @ 6:12am 
Brilliant, thank you. But i see how you proffesional used VScripts for L4D2 and i have last question. It's possible (for example) disabled default AI for Survivors and write custom used only VScripts or enought (example Nav Mesh functions, etc). Because standalone AI - it's a pity ...
Rectus  [author] 10 Jan, 2018 @ 5:59am 
Yeah, that would be possible with CommandABot(). This script should make common infected nearby attack the entity it's attached on. Although if you put it on the turret, you would need to modify the function to be called from the turret Think function instead of using AddThinkToEnt.
https://gist.github.com/Rectus/8d7604f350c824e45ec5ce378ed09264
ESI 10 Jan, 2018 @ 5:22am 
This possible say infected AI attack turrets (may be need used info_goal_infected or CommandABot). Please example :steamhappy:
Romaki 20 May, 2016 @ 3:26pm 
AWESOME
Rectus  [author] 8 Apr, 2016 @ 2:35am 
I think there are turret mods for sourcemod available, so check on alliedmodders. My turret system wouldn't work well as a server mod, since it doesn't work with the stock models so all players would need to download the turret models.
THE-LAST-SAINT 8 Apr, 2016 @ 2:02am 
i think most who read this can't mod at all like me so where can we find a turret that works
for local server that can be placed with a local server admin command!?
Rectus  [author] 8 Apr, 2016 @ 1:58am 
Yes. There is an turret in the example map that can be turned on and off.
THE-LAST-SAINT 8 Apr, 2016 @ 1:47am 
so can you make a single minigun turret that works on it's own!?
one you can place and turn on/off ?
MackBananas 20 Dec, 2015 @ 6:27am 
spy sapping your sentries!:steamhappy:
Ace73 13 Sep, 2015 @ 10:52am 
Well this was an unexpected bit of awesome. And it's as easy as placing them as instances? Sign me up, I love sentries!
Rectus  [author] 7 Sep, 2015 @ 11:46pm 
Read the guide below.
Porrero 7 Sep, 2015 @ 8:06pm 
Como se usa :(
Rectus  [author] 7 Sep, 2015 @ 5:39am 
Rectus  [author] 7 Sep, 2015 @ 12:15am 
The concept is pretty similar, but instead of Sourcemod, this is based on VScripts that can be attached to entities to make them behave like an autonomous turret.

Instead of directly installing it on a server, this can be added to custom maps, mutations or other script based mods by mod authors, and the scripts can be modified to suit their needs.

I'll probably write a guide instead of a video. Adding them in maps should be very easy though, just unpack the contents of the vpk, place a func_instance in the map and select the instance vmf for the turret you need.
Rectus  [author] 3 Sep, 2015 @ 2:07pm 
What exactly are you trying to do?
CygnusX1 3 Sep, 2015 @ 2:01pm 
you should make a video on how to do it
CygnusX1 3 Sep, 2015 @ 1:59pm 
did not work
Rectus  [author] 3 Sep, 2015 @ 1:39pm 
Use a func_instance to spawn it in a custom map, or see the Entity Placement Tool above for spawning it for a mutation.
CygnusX1 3 Sep, 2015 @ 1:32pm 
yes i want to spawn it
Jules 2 Sep, 2015 @ 6:13pm 
congrats
Qwazzy 2 Sep, 2015 @ 3:14pm 
Pretty awesome idea. I might make use of this in a map I've been working on lately. Thanks for sharing.
Rectus  [author] 2 Sep, 2015 @ 8:28am 
Do you want to spawn it in your map, or mutation?
CygnusX1 2 Sep, 2015 @ 8:22am 
how do you spawn it????
PeopleLikeStuff 1 Sep, 2015 @ 2:43pm 
Cool prefab, dude.