Garry's Mod

Garry's Mod

423 ratings
Combine Door Creator - E2 function (Wiremod) / Dupe-able / Customizable
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Roleplay
File Size
Posted
Updated
1.678 KB
16 Aug, 2014 @ 4:25am
21 Sep, 2014 @ 7:17am
3 Change Notes ( view )

Subscribe to download
Combine Door Creator - E2 function (Wiremod) / Dupe-able / Customizable

Description
Have you ever wanted to use the large Combine gates for your own base? Did you try serveral Door STools, only to figure out that it's impossible to dupe the prop_dynamic class?

That actually made me mad, so I figured out a way, to make this kind of doors dupeable. I created a new function for Wiremod Expression 2, that allows you to create doors. That way, you only have to dupe the E2 chip and it will re-create the doors wherever you want. The function also returns the created entity, for further use in the E2 code.

Although it's not the easiest or most comfortable method, it worked fine for me so far and I thought I share it, along with the Entity:fire() function I created to control these. Originally only created for the Combine gates, I thought it lacked enough features for a release and therefore I added the other prop_dynamic gates from HL2 and the prop_rotating Doors. I also added the ability to set (almost) all flags someone could set in Hammer. Futhermore, the spawning is undo-able.


This is an Wiremod E2 extension. Therefore it requires Wiremod!


Version 1.2: Changelog


Combine Gates and other prop_dynamic doors:
doorCombineCreate([string] name, [number] model, [vector] position, [number] rotation)

name - Enter a (unique) name for the entity. Useful for the findByName() function.
Example: "MyDoor"
model - Number of the model you want to use. Must be one of these or it will not work:
1 - Combine Door - Tall
2 - Combine Gate - Citizen
3 - Combine Gate - Vehicle
4 - Dr. Kleiner's lab blast door
5 - Elevator door
6 - Mining elevator door (Requires HL2 EP2)
7 - Garage door (Requires HL2 EP2)
position - Vector of the position, where you want the door to spawn (ground position!).
Easiest way: Use entity():pos() to spawn the door where the E2 chip is placed. Be sure to place it on the ground.
rotation - Rotation of the door, this is always relative to world. Enter a number from 0 to 359. Recommended to use 0, 45, 90, 135, 180, 225, 270 or 315.

Example:
E = doorCombineCreate("CombineDoor", 1, entity():pos(), 180)
Spawns a tall combine door named "CombineDoor" at the position of the E2 chip with a rotation of 180°. Saves the created entity under variable E.


Rotating / normal doors (prop_door_rotating)
doorRotatingCreate([string] name, [number] model, [number] skin, [number] hardware, [vector] position, [number] rotation) doorRotatingCreate([string] name, [string] path, [number] skin, [number] hardware, [vector] position, [number] rotation) doorRotatingCreate([string] name, [number] model, [number] skin, [number] hardware, [number] locked, [number] no_use, [number] silent, [vector] position, [number] rotation) doorRotatingCreate([string] name, [string] path, [number] skin, [number] hardware, [number] locked, [number] no_use, [number] silent, [vector] position, [number] rotation)

name - Enter a (unique) name for the entity. Useful for the findByName() function.
model OR path - Enter either one of the model numbers from below OR the path to an own door model (must be compatible with prop_door_rotating!).
1 - standard door - (Skins: 0-12 / Hardware: 0-3)
2 - metal door with hole - (Skins: don't work / Hardware: 0-2)
3 - small door (to be used as double door) - (Skins: 0-1 / Hardware: 0-1)
4 - industrial door with window (Skins: 0-1 / Hardware: 0-3) - Requires HL2 EP1
5 - fence gate (Skins: 0 / Hardware: 0) - Requires HL2 EP2
"models/mycustomdoor/example.mdl" - Your own path to a compatible door.
skin - Choose a skin from 0 to the highest number (look under models). Doesn't work with door no. 2, choose 0 there.
hardware - Choose the type of lever for the door. Look under models, which are compatible.
0 - No lever
1 - normal lever
2 - pushbar
3 - keypad (this is not an actual working keypad)
locked (optional) - If set to 1, door will be locked on spawn. Default: 0
no_use (optional) - If set to 1, door can NOT be opened by pressing use on it. You must fire the inputs "open" / "close" to interact with the door. Default: 0
silent (optional) - If set to 1, door will make no sound when opening / closing and does not alert NPCs. If set to 2, door makes sound but does not alert NPCs. Alerting of NPCs doesn't seem to have an effect in Garry's Mod. Default: 0
position - Vector of the position, where you want the door to spawn (ground position!).
Easiest way: Use entity():pos() to spawn the door where the E2 chip is placed. Be sure to place it on the ground.
rotation - Rotation of the door, this is always relative to world. Enter a number from 0 to 359. Recommended to use 0, 45, 90, 135, 180, 225, 270 or 315.

Example:
E = doorRotatingCreate("MyDoor", 1, 5, 2, 1, 0, 0, vec(250,100,0), 90)
Spawns a door named "MyDoor" with with normal model [1] skin no. 5 [5] and a pushbar [2], that is locked [1], useable [0] and makes sound [0] at coordinates X:250, Y:100, Z:0 with 90° rotation. Saves the created entity under variable E.


Popular Discussions View All (1)
14
17 Oct, 2020 @ 8:39pm
PINNED: FAQs
LibertyForce
70 Comments
Paleo-mem 15 Sep, 2024 @ 1:43am 
what does it mean?
] doorCombineCreate([container_gate] name, [2] model, [entity():pos()] position, [0] rotation)
Unknown command: doorCombineCreate
Got Subscription details!
Addons have changes - remounting
Unmounting (addon unsubscribed) 'cache/workshop/407030840.gma'
Addons have changes - remounting
⛔Elliot#658⛔ 18 Apr, 2024 @ 12:04am 
and how to use this mod?
Lexeychik 17 Apr, 2024 @ 3:57am 
Too hard to use, there are doors in Wiremod extras. Both of your addon and the extras doors in wiremod do not work on saves!
Nikitza Inc 29 Dec, 2023 @ 10:45am 
You saved my day, thank you!
Benevolence 20 Dec, 2023 @ 1:03pm 
Well at least I know what this does now.
Sergeant Arch Dornan 27 Oct, 2023 @ 6:16pm 
all of this just to get a stupid door? jesus christ.
AlgretSynonymous 1 Sep, 2023 @ 11:18am 
Can you add Portal 2 Doors?
unlikeaboss 31 Aug, 2023 @ 8:04am 
is there a mod that does this without E2? (i cant be bothered learning to code)
Benevolence 16 Apr, 2023 @ 12:47am 
Nevermind, looked at it, not expecting to get ripped off.
Benevolence 16 Apr, 2023 @ 12:20am 
Do you guys not have the "E2 Function" addon for Wiremod!?:steamfacepalm: