How do I make a plug?

Avatar
yohoat9
274 Posts
Posted Dec 13, 2010
In "manic mechanic" theres a part with plugs and wires, the plugs snap to an area, and they can be taken out, how do I make this???
Advertisement
Registered users don’t see ads! Register now!
Avatar
msleeper
4,136 Posts
Admin
Posted Dec 13, 2010
Replied 5 minutes later
There are all kinds of tutorials about it. The concept comes from HL2, so just look for general HL2 tutorials.
Avatar
yohoat9
274 Posts
Posted Dec 13, 2010
Replied 12 minutes later

But in hl2 you can't take them back out, that's why I used "Manic Mechanic" as an example. So how do I make them so they can be taken out also?

[edit]
I found a tutorial covering removal also

http://www.twhl.co.za/tutorial.php?id=160

Avatar
msleeper
4,136 Posts
Admin
Posted Dec 13, 2010
Replied 1 hour later
Yeah making them not be able to removed isn't anything special. It's just different entity work. For example, the plugs in Kleiner's lab you can't remove.
Avatar
MrTwoVideoCards
584 Posts
Posted Dec 15, 2010
Replied 1 day later
Man, plugs. Plugs man. Plugs. Fuck them to hell.

Valve made that system ridiculously complicated and expensive. Even more so when a plug can be pulled out, and reinserted from any end of the plug itself.

I've found that an easier way to deal with plugs is saying "fuck it, make a plug-in bro aka new entity" Sadly as you cannot do this in Portal the next best thing would be to use "OnUser" inputs and outputs to get the plugs jacked-in status incase you do want them to come out. However I haver never thought about what happens if a plug has both ends going through a portal, which allows it to essentially cover mass distances from one socket to another.

This could pose a serious problem. If you close the portal allowing the plug to go between socket to socket some crazy shit will likely ensue. You will have to take EXTRA caution with this one.

Avatar
yohoat9
274 Posts
Posted Dec 15, 2010
Replied 5 hours later
Don't worry, I'm not actually making a "plug", but I'm using the exact same method that would be used when making a plug, minus the wire, generator, sounds, and the plug model itself, but seeing as it uses the exact same physics as what I'm trying to make, I decided to just make a plug, and delete the unnecessary aspects.
Avatar
msleeper
4,136 Posts
Admin
Posted Dec 15, 2010
Replied 1 hour later
MrTwo - I'm curious how plugs are expensive? The I/O isn't that heavy, it just detects when the plug model is in the area, teleports it to it's plugged-in destination, and disables pickup. Sparks, flickering lights, and so on are all outside of the actual plug mechanics. So I'm curious where you found they were expensive on the engine?
Avatar
King Of Sandvich
15 Posts
Posted Dec 16, 2010
Replied 7 hours later
Yeah, making a plug is easy. For removable plugs, do what msleeper said but keep pickup enabled and just disable motion and disable the teleport trigger after it's fired. Make sure "Enable motion on pickup" is checked for the plug, and have the insertion trigger re-enable a second or so after you remove the plug.
Advertisement
Registered users don’t see ads! Register now!
Avatar
HMW
806 Posts
Posted Jan 05, 2011
Replied 20 days later
Sorry for not answering, I've been so busy editing (and also that "real life" thing that happens sometimes) that I've been away from TWP for a while.

Msleeper's and Sandvich's explanations are very close to how I made it. If there's still something you can't figure out, have a look at the source vmf for Manic Mechanic. (It comes with the download.)