Welcome, Guest! Login | Register

The Input/Output system [Print this Article]
Posted by: Bulk
Date posted: Nov 22 2004
User Rating: 4.5 out of 5.0
Number of views: 19519
Number of comments: 5
Description: The input/output system for the Source engine is a very powerful tool, read on to learn its secrets.
This tutorial assumes you have basic knowledge of Hammer, either from Half-Life 1, or Source engine level design experience. You are expected to know how to place and create point and brush based entities, and know how to make at least a simple room.

By the end of the tutorial, you should be able to understand the Source engines input/output system, and put it to good use in your levels.

Let's start with a little theory shall we?

Each entity in a level has several "outputs" and several "inputs". Each output has a different trigger, and each set of outputs is usually different for each type of entity.

When an output is triggered, it sends a message in the form of an "input" to the desired entity. This input instructs the targeted entity to perform an action, or to change its state in some way.

Dude that makes no sense!

Indeed. The best way to explain just how this system works, and how powerful it is, is to walk you through constructing a specific example.

In the example map you start at one end of the corridor. As you walk towards the dark doorway at the other end, the lights come on. If you keep going (or go back) the lights turn off again. In the old Half-Life engine, this simple (and admittedly slightly pointless) effect would be impossible. In the Source engine, all it takes is one trigger_multiple entity and its predefined outputs.

We're now going to re-create this effect (If you wish, you can use the example map instead of making your own, but the values will of course already be filled in).

Zip FileFilename: tut_input_output.zip
File Size: 2.4 KB

Go ahead and make a room, a trigger_multiple entity, and some lights. Don't forget to include a light we can turn on/off in our example. Name this light "light1".

Now open up the properties of the trigger_multiple (by hitting ALT+Enter). You'll see the Output tab as the second tab along. Click on that tab, and then click the Add button. You should see something like this:

user posted image

If you click on the "My output named" menu, you'll get a list of all the outputs this trigger has. If you switch back to the "Class Info" tab and click the help button, you'll get a description of each of the outputs in the list. For the first output, we're going to use the OnStartTouch output. This means that when the player first starts touching our trigger entity, this output will be activated.

Now click on the "Target entities named" menu, and you'll get a list of all the entities you can target in that level. In my small example map, the only entity named is "light1". For maps with lots of entities, you can click on the eye dropper icon and click on the entity you want to target (this only works in the 3d view). Note: you will only be able to click on entities with a defined name; in addition only entities with a name will appear in the target drop down menu.

The next drop down menu is called "Via this input", and contains a list of all the inputs for the targeted entity. Each of these inputs has a different effect on the entity, and can even change the state of an entity. In this example, we will use the "toggle" input of the targeted light entity. This means the light will be "toggled", so it's either off or on, depending on its state previously. We could have used the "TurnOn" input for this instead, but in this instance it makes no difference. If you wish to see a description of the inputs for any entity, click on the help button in the "Class Info" tab.

The next field, called "With a parameter override of", will be greyed out. If we had chosen to use the "SetPattern" input, this field would let us define the light pattern to set on the target entity. For any input where a parameter, such as a new setting, is required, you should enter it here.

The last two options, "After a delay in seconds of", and "fire once only" are self explanatory, and we aren't using these options in the example.

Now to complete the effect, we need the light to turn off again as the player gets closer, or goes back. This can be achieved using another of trigger_multiples outputs, namely "OnEndTouch". As you might imagine, this is fired when the player stops touching the trigger_multiple. Instead of starting over, Valve have helpfully included a copy/paste feature, so all that’s requires is to click copy, then paste, then change the entity output to "OnEndTouch" for one of the output lines in the list. It should look something like this:

user posted image

One final note before the end, if you double click on one of the output lines, you will be taken to the settings of the target entity for that line. Click on one of the lines to be taken to the light entity, and then click on the Inputs tab. You'll notice two lines there, representing the two inputs for that entity. You can’t make any amendments on this tab; however you can double click one the input line to be taken back to the output tab of the targeting entity to make any changes you wish.

user posted image

Hopefully this specific example will help you make sense of what is frankly a very broad and open system. You can achieve so many different effects and game play constraints using this system, and will hopefully make for some very exiting user made levels.

This whole tutorial is pretty heavy reading, so don't be ashamed to read it over again, or bring up any questions (and mistakes/omissions) in the comments.

Rate This Article
This article is currently rated: 4.5 out of 5.0 (2 Votes)

You have to register to rate this article.
Related Files
Zip FileFilename: io2.jpg
File Size: 20.8 KB
Zip FileFilename: io3.jpg
File Size: 17.9 KB
Zip FileFilename: tut_input_output.zip
File Size: 2.4 KB
Zip FileFilename: io1.jpg
File Size: 19.2 KB

User Comments Showing comments 1-5

Posted By: WoW_Nirss on Nov 22 2004 at 15:26:25
Very nice, thanks.

Posted By: deathz0rz on Nov 22 2004 at 15:28:13
great article, its very basic, and basic=good :)

Posted By: ts2do on Nov 26 2004 at 07:54:36
some of this you can do ingame......like such
ent_setname burn;ent_fire burn ignite
and thatll burn the entity you're looking at... also if you do ent_fire and a space, you can see a list of entities by their targetnames, you can also do ent_fire for classnames.....ent_fire player ignite =p

Posted By: SoUlFaThEr on Dec 10 2004 at 04:17:37
what?

Posted By: nazitaco on Dec 24 2007 at 01:15:57
Hey everytime I try and do this, I end up with the light being on, but when i touch the trigger, the light goes off...i want it so that the light goes on when i touch the trigger, can u tel me how to fix that plz?Edited by nazitaco on Dec 24 2007, 01:16:32


You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 05 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005


Latest Comments
knock knock
General | News
By: omega | Dec 22 2016
 
knock knock
General | News
By: MIFUNE | Oct 10 2015
 
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
 
knock knock
General | News
By: Whistler | Nov 05 2011
 
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
 
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
 
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009
 
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Persuter | Aug 02 2009
 

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (7 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!