Posted by: Bulk
Date posted: Nov 22 2004 User Rating: 4.5 out of 5.0 | Number of views: 20938 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).
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:
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:
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.
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. |
|
 | Filename: io2.jpg File Size: 20.8 KB |
 | Filename: io3.jpg File Size: 17.9 KB | |
 | Filename: io1.jpg File Size: 19.2 KB | |
|
User Comments
Showing comments 1-5
great article, its very basic, and basic=good :) |
|
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 |
|
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.
|
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (3 guests)
|
|