GameBanana shows no ads to members. Sign up now!
Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Easy Plug setup tutorial

A Tutorial for Source Engine

Easy plug tutorial

INTRODUCTION

In this tutorial we will make some variants of simple plug that can be seen in Half Life 2 series. This tutorial is written in detail so it should be easy to follow for beginners.

ONE-INSERT PLUG

Plan:

  • Power
  • Cable (connected from power to plug)
  • Plug (main actor)
  • Socket (where the plug goes)
  • Triggered event (gate open, light on…)

Ingredients
  1. Power
  • Prop_static (for Power)
  1. Cable
  • Move_rope
  • Keyframe_rope (for cable wire)
  • Phys_lengthconstraint (for length limitation of cable… OPTIONAL)
  1. Plug
  • Prop_dynamic (for plug model)
  • Func_physbox (for plug physics)
  1. Socket
  • Prop_static (for socket model)
  • Trigger_Once
  • Filter_activator_name
  • Point_teleport (for socket setup)
  1. Triggered event (in this example)
  • Prop_static (for lamp model)
  • Light (for explosion… kidding...for light obviously :D )

Before we start


Note this:
  • The plug can be plugged only once
  • Position of the plug should be near socket (if we place the plug to far from socket, the stretching of the cable will look a bit unrealistic)
  • All names are ending with _1, so if you wish to copy the entire setup you will go Paste special and the next setup will have _2 ending. (fast copy)

The setup (with pictures):
  1. Scene setup
Place prop_static models (power, socket and lamp in position)


  1. Plug setup
Pace prop_dynamic entity and name it plug_prop_1, then model a box around it with “invisible” texture. Make it func_phybox and name it plug_1.

Note: prop_dynamic will not collide with world so you have to make boundaries of physbox to match prop dimensions (approx as i have did)

Properties for:
  • func_phybox 

  • prop_dynamic 


Note: Preferred carry angles are used to fix orientation of the physbox on pickup (example. Buzzsaw, combine turret…)

  1. The cable
  • Infinite length
Place move_rope entity in the appropriate place on prop and name it plug_cable_A_1

Then place the keyframe_rope entity on “place of power” and name it plug_cable_B_1. (A means start and B is for end of cable, so we can keep _1 in name)

Properties for:
  • Move_rope

  • Keyframe_rope

  • Fixed length (OPTIONAL)
    Place phys_lengthconstraint in the same place as move_rope, and name it plug_lngcons_1 (then move it 1inch inside the prop so you can easily select it), select it and go to top/side views and drag the circle in position of the keyframe_rope.


Note: The circle represents the other end of the cable

Properties:

Notes:
  • Additional length: self explanatory
  • Attached object 2 point: coordinates of the circle we moved in views
  1. Socket setup
Inside the socket prop, model a small box and make it trigger_once. Create filter_activator_name and name it plug_filter_1. Then create point_teleport entity and place it directly in front of the socket prop (Hint - center of plug physbox will teleport to center of the point_teleport entity).

Properties for:
  • filter_activator_name 

  • trigger_once


  • point_teleport 

  1. Trigger event setup (Lamp in this example)
Place a light entity in front of the Lamp prop and name it plug_light_1.

Properties:


  1. Trigger_once outputs


EXPLANATION

When physbox (plug_1) touches trigger_once, it triggers point_teleport to “place” the plug in the right position and immediately disables his motion and GravityGun pickup.
Magic!!

MULTI-INSERT PLUG

Note this:
  • this plug can be plugged multiple times
The setup (with pictures):
  1. Scene setup
Same as for ONE-INSERT plug.

  1. Plug setup
Same as for ONE-INSERT plug.

Properties for func_physbox:

  1. The cable
Same as for ONE-INSERT plug.

  1. Socket setup
Change trigger_once to trigger_multiple, name it plug_tigger_1 and model another trigger_multiple, name it light_trigger_1 in front of the existing one.


Properties:
  • light_trigger_1


  • plug_trigger_1


  1. Trigger event setup (Lamp in this example)
Same as for ONE-INSERT plug.

EXPLANATION: 

When physbox (plug_1) touches plug_trigger_1 and light_trigger_1, it triggers point_teleport to “place” the plug in the right position and immediately disables the trigger (if we don’t do so, on GravityGun pickup the trigger will teleport it again in the same place in same time we grab it). 

On GravityGun grab the plug enables the trigger after 0.5 sec.

Light_trigger_1 is separate. (easier control)

NOTES:

If you encounter any problems or difficulties you can contact me. Anyway, I hope this tutorial will be useful and easy to follow. 
You can download my tutorial map from here: https://gamebanana.com/prefabs/7603

Sign up to access this!

No comments yet

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Studio

Sign up to access this!

Credits

Tutorial Autor
DomiTibingen
DomiTibingen Joined 7y ago
Offline
256 points Ranked 53625th
17 medals 2 rare
  • Submitted 15 Models Medal icon
  • 6 years a member Medal icon
  • Became a Studio Leader Medal icon
  • Reached 1,000 Points Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
Writer

Submitter

DomiTibingen avatar
DomiTibingen Joined 7y ago
Offline
256 points Ranked 53625th
17 medals 2 rare
  • Submitted 15 Models Medal icon
  • 6 years a member Medal icon
  • Became a Studio Leader Medal icon
  • Reached 1,000 Points Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
DomiTibingen
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Intermediate

Attributes

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 0
  • 213
  • 9d
  • 6d

More from Submitter

Realistic rain
Realistic rain folder Mapping Beginner

WiPs by Submitter

More from Studio

Realistic rain
Realistic rain folder Mapping Beginner

WiPs by Studio

More Mapping Tutorials

Teleports
Teleports folder Mapping Beginner
Advanced Displacement
Advanced Displacement folder Mapping Intermediate
Advanced Destruction
Advanced Destruction folder Mapping Intermediate
3D Skybox
3D Skybox folder Mapping Beginner