Project Zomboid

Project Zomboid

Automatic Gate
Micky Pain [M-o-P] 11 Feb, 2024 @ 10:59am
PSA: Easily add additional gates
So..for anyone who wants to expand the functionality to more doors, here's the rundown:

1) Find the name of the door you want to add
(For my save, I added the large metal pole double gate from More Buildings Plus, the name is "Large Metal Gate")

2) Go to mod folder, and to \media\lua\client\AutoGate\UI

3) Open AG_UI.lua (Notepad++ works great for this)

4) Find the line:

if (instanceof(o, "IsoThumpable")) and ((name == "Double Door") or (name == "Double Metal Pole Gate") or (name == "Double Metal Wire Gate")) then

5) Copy "or (name == "Double Metal Pole Gate")" , paste it between the closing two parenthesis and replace the name within the double quotes with the name of your door

6) In this example, the line would now read:

if (instanceof(o, "IsoThumpable")) and ((name == "Double Door") or (name == "Double Metal Pole Gate") or (name == "Double Metal Wire Gate") or (name == "Large Metal Gate")) then

7) Save

8) Go to ..\media\lua\shared folder and open AG_Utils.lua

9) Find the same line as above, do the same edit and save

10) If you've done everything correct, you should now be able to install components and use the remote to open your gate


Might be a good idea to copy your modified mod to another folder and enable that one instead, in case this mod gets updated and you lose your changes...
Anyway, I thought I'd share if others want to get the cool metal gate auto-opened too :)

Enjoy