Left 4 Dead 2

Left 4 Dead 2

Homemade Sentry Turret
 This topic has been pinned, so it's probably important
Rectus  [developer] 16 May, 2019 @ 10:25am
FAQ & Troubleshooting
  • Does the Sentry Turret replace any weapon?
    No, it is a brand new weapon. It does however replace a few melee weapon spawns on each map.

  • Does the Sentry Turret work in single player?
    Yes

  • Does the Sentry Turret work in multiplayer?
    Yes, but every player and, if using one, the server, needs to have the add-on as sell as the Custom Weapon Base installed. If hosting a lobby Local Hosting needs to be selected.

  • Does the Sentry Turret work on custom campaigns?
    No, unless noted otherwise in the campaign. The Sentry Turret would have to be added to each individual campaign along with a control script in order to work.

  • Where can I find the weapon?
    Anywhere melee weapons normally spawn.

  • What mods are incompatible with this?
    Mods that alter gameplay by running VScripts are likely incompatible. That includes the Admin System and CS:S weapon unlockers. The Sentry Turret is compatible with other mods using the Custom Weapon Base. A special compatible CS:S weapon unlocker also exists.

  • How do I spawn the Sentry Turret from console?
    Use the command:
    give sentry


Troubleshooting guide
  • The Sentry Turret can not be placed.
    This is likely caused by incompatibility with other mods. Disable other addons, especially conflicting ones.

    To place the turret hold down the fire button until the turret outline appears, then move the outline to a valid surface and make sure it turns green before releasing the fire button.

  • The Sentry Turret does not spawn.
    Disable other addons featuring custom melee weapons or modes featuring mission file replacements. Make sure the Custom Weapon Base is installed. Make sure you are not playing on a custom campaign/map, and that you're hosting the game or playing on a server with the mod installed.

Known issues and Limitations
  • No bullet holes are left on surfaces and infected dismemberment does not work at range.
  • Does not work with custom campaigns unless the campaign is modified to include it.
  • Incompatible with other addons that globally execute scripts.
Last edited by Rectus; 20 May, 2019 @ 12:59am
< >
Showing 1-15 of 16 comments
At first, thanks for the preview video. It made me have more questions:
  1. Is it possible to place a turret on a wall or ceiling in the future?
  2. Could players reload the turret with ammunition of shotguns, sniper rifles and grenade launchers?
  3. Would reloading the ammo of rifle get higher damage?
  4. Could players collect all ammunition from a turret with full ammo if we don't need it anymore? (The player must deploy it before scavenging its all ammo, of course)
Last edited by Morning 鰻魚精奶奶; 20 May, 2019 @ 11:21am
Rectus  [developer] 20 May, 2019 @ 1:05am 
The turret is set up to accept ammo from everything except the M60 and grenade launcher.

Your ideas sound cool and possible to do, but I don't think they fit this particular turret that well. Collecting ammo from the turret would probably make it harder to use.
Last edited by Rectus; 20 May, 2019 @ 1:05am
How many bullets of turret can replenish per shell? I think both smg and rifle are 1:1 exchange but shells of shotgun might be unable to be the same exchange rate like them.

Would it stop the player reloading to full ammo if player doesn't possess enough ammunition? At least leaving 1/5 or 1/3 reserved ammo for primary guns. (smg: 650 ÷ 5 = 130 or rifle: 360 ÷ 3 = 120)
Rectus  [developer] 20 May, 2019 @ 11:41pm 
It's set to use a third of the players maximum ammo to fully replenish the turret, regardless of ammo type.
blackjacksike 1 Jan, 2022 @ 6:12am 
Hey Rectus, may I ask how did you program the preview? :sentry:
Rectus  [developer] 1 Jan, 2022 @ 7:14am 
It is setup as a prop_dynamic with a transparent material. I spawn it when the player starts holding down the fire buttton, parent it to the players viewmodel to keep it moving smoothly with the view and only be visible to them. every tick I trace in the view direction, and then move the model down to the ground if it hits.

The code is available here if you want to use it:
https://github.com/Rectus/l4d2-vscripts/blob/master/custom_weapons/sentry_turret/custom_sentry.nut
BrounceLord 11 Jun, 2023 @ 12:22pm 
how to make stop attract zombies and make it unbreakable
Rectus  [developer] 11 Jun, 2023 @ 1:58pm 
To stop it from attracting zombies, you would have to remoce the relevant code in the script. To make it unbreakable, you would have to recompile the turret base model.
Shoah Kahn 14 Mar, 2024 @ 11:56pm 
For me, the turret place... The character leans down and looks like they are deploying it; only for the turret to disappear form the ground and back into their hands. I've tested this with all mods but the custom weapon base one, off, on both official and custom maps (the latter causing some other issues, like the map not loading).
Rectus  [developer] 15 Mar, 2024 @ 1:33am 
Do you have any auto-reload or shove scripts that interrupt firing?
multoman 30 Mar, 2024 @ 6:18am 
so i found out u cant deploy the sentry with the vscript lib for some reason
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2821408044
Last edited by multoman; 30 Mar, 2024 @ 6:18am
Rectus  [developer] 30 Mar, 2024 @ 8:08am 
Guessing one of the mods using that is preventing the turret scripts from running.
Does this work on classic L4d2 and l4d1 survival maps?
Rectus  [developer] 13 May, 2024 @ 9:03am 
Not sure if it works in survival by deafult. If I remember right, the way the weapons spawn in won't let it work. It should be possible to cheat and spawn it in from console though.
Hey Rectus

Usually when im using the turret mod it will fall over and just flip around and stuff, i tried uninstalling your other turret mod but that did not work, would you mind giving some insight into the problem?

Sincerely, Sentient Cinder Block
< >
Showing 1-15 of 16 comments
Per page: 1530 50