Garry's Mod
Оценок: 421
Combine Door Creator - E2 function (Wiremod) / Dupe-able / Customizable
   
Наградить
В избранное
В избранном
Удалить
Тип контента: Дополнение
Тип дополнения: Инструмент
Метки дополнений: Стройка, Ролевая игра
Размер файла
Добавлен
Изменён
1.678 KB
16 авг. 2014 г. в 4:25
21 сен. 2014 г. в 7:17
Обновлений: 3 (просмотреть)

Подпишитесь, чтобы загрузить
Combine Door Creator - E2 function (Wiremod) / Dupe-able / Customizable

Описание
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.


Популярные обсуждения Просмотреть все (1)
14
17 окт. 2020 г. в 20:39
ЗАКРЕПЛЕНО: FAQs
LibertyForce
Комментариев: 70
Paleo-mem 15 сен. 2024 г. в 1:43 
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
FIXPro#667 18 апр. 2024 г. в 0:04 
and how to use this mod?
Lexeychik 17 апр. 2024 г. в 3:57 
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 дек. 2023 г. в 10:45 
You saved my day, thank you!
Benevolence 20 дек. 2023 г. в 13:03 
Well at least I know what this does now.
Synthetic Xenomorph 27 окт. 2023 г. в 18:16 
all of this just to get a stupid door? jesus christ.
xelsg 1 сен. 2023 г. в 11:18 
Can you add Portal 2 Doors?
unlikeaboss 31 авг. 2023 г. в 8:04 
is there a mod that does this without E2? (i cant be bothered learning to code)
Benevolence 16 апр. 2023 г. в 0:47 
Nevermind, looked at it, not expecting to get ripped off.
Benevolence 16 апр. 2023 г. в 0:20 
Do you guys not have the "E2 Function" addon for Wiremod!?:steamfacepalm: