Door System

I need a door system like the one from dark rp but for custom gm. I tried and failed. I thought I would post it here so if someone makes it, everyone can use it.

Hey, welcome to Facepunch… Before the piranhas come out, this isn’t a request and receive forum… The dev forum is for people who try, and do or need help or a push in the right direction. A door system can range from simple, to advanced depending on the features.

If you want the client to see text on the doors, of anything: You can either use serverside functions to get the map creation id, the network everything to the client OR hash/map ids to entities without needing to network anything ( how I do it ).

Show us what you’ve tried and how far you’ve come. I’m sure we’ll be happy to help so long you’re putting in the effort. Otherwise:

General Learning Lua Help Thread:

Problems that don’t need their own thread ( All simple questions / quickies should go here ):

DarkRP Help Thread ( ALL DarkRP Questions go here ):

Looking to HIRE a coder? Read this:

Coderhire Thread:

Facepunch Style Fixer for GreaseMonkey:

Thanks for giving me a warm welcome. I actually deleted it after getting so pissed. But I basically looked at the dark rp code and tried to remake it. But as I said, I failed.

[editline]7th July 2014[/editline]

I can make the client side stuff. Like displaying the name and such.

Are you using a custom map, making your own, or using DarkRP Maps? As for setting ownership and permissions and such, I would use SetNWString() because its the simplest, but I wouldn’t know if theres a more optimal way to do it. As for the names on the doors, a 3d2d panel is the coolest IMO, but likely the most expensive compared to some in-hud options(like showing the name on the door when the player looks at it, maybe?) Good luck with the gamemode! Also I totally gave Ace the wrong rating, but whatever.

This describes the hash/map version of building ids vs using them:

It requires you build tables of data, basically each door on the map that can be owned should be in the table somewhere. Additionally, don’t allow any new entities to spawn until InitPostEntity; otherwise the id will shift and give you problems.

Making a 3d2d panel appear on the door when you’re close and looking at it isn’t that expensive. Just make sure you don’t create fonts, vgui elements, etc inside the draw hook. At most, if a value doesn’t exist make them in the hook; otherwise it is better to create them outside of the hook.

If you have already succeeded at making something work / show up, using the above information should help getting started again ( When starting out, design the system on paper if it is easier for you… What is the system, what are the features such as linking doors for properties or display door name or room name etc, how should it work meaning if you look at it should it do this that or what, etc… Get a solid understanding of the idea, break it into small problems and then use those small problem solutions together as building blocks to complete the task ). Post an update when you have one, get stuck, etc…

I’d recommend starting with one door first… The easiest thing is to grab a trace and see if the trace entity is a door, and use that. When you have it to where it looks right, you can link the trace.Entity to a table value to grab information. Then you just have to populate the tables…