Welcome, Guest! Login | Register

Multisource and env_globals [Print this Article]
Posted by: imaculata2000
Date posted: May 11 2003
User Rating: N/A
Number of views: 6657
Number of comments: 0
Description: Explanation
(*Note: This tutorial assumes you have both Half-Life AND Hammer/Worldcraft v2.0. This tutorial is designed for those of you who are familiar to the basics of Level editing and CSG (Constructive Solid Geometry) or Brush-type maps.
  • This tutorial covers:
    Setting up a multisource
    Setting up an env_global
    Using both to trigger an entity

This is my first tutorial, but don't worry, you'll get the hang of multisources and env_globals by the time you've read through this. Blue statements are the functions I want you to perform. So let's get started.

First of all load up Hammer (or Worldcraft as it's also known) now. This tutorial assumes you have the latest version, and that you use the default setup with a 2-button mouse - you should also have all of the proper directories and tools configured before using this tutorial. Refer to the documentation, the Hammer Setup guide. This tutorial also assumes you are familiar with Hammer's basic functions like cutting, pasting, making brushes, placing entities and compiling maps.

Start with a new map or continue with an old map you were working on. I don't care, just as long as your map is without errors. Set up a basic room and place two buttons. Put them a little bit apart, so it will be easier to use them during the game. Place a door somewhere in the map. It doesn't matter where, just as long as you can see it during game. To make the room playable there should of course also be an info_player_start and a light. So place an info_player_start and a light. Now what we want to do in this example, is create a button which opens the door, yet can only be activated, if the other button has also been activated.

How do we do this? Well with multisources and env_globals of course!

First give the door a name. In this tutorial I will call the door "door1". Place a multisource and an env_global. Make sure you place them inside the room. Entities should always be placed inside the map, never in the void. Open up the properties of the multisource. You'll see the following properties:

Name
Target
Global State Master

Give the multisource a name. In this tutorial I will call the multisource "doorsource", but you're free to choose your own name, just as long as you remember it. Now where it says "Global State Master" enter the following name: doorstate . Basically it doesn't matter which name you enter, because this is simply a global state that's being set. Confusing? Look at it like this. The state isn't the name of any entity, it's simply an expression. As soon as you enter this name as a "Global State Master" then Half-Life will know that that expression exists. Don't worry if you don't get it now, it will become clearer once we start editing the properties of the env_global, which is the next thing we are going to do.

Open up the properties of the env_global. You'll see the following properties :

Name
Global State To Set
Trigger Mode
Initial State

First give the env_global a name. In this tutorial I will call the env_global "doorglobal". But basically any name will do. Now on to the next parameter. Where it says "Global State To Set", enter the same name as you entered for the Global State Master of the multisource. In this tutorial I decided to call it "doorstate". Set the "Trigger State" to "Toggle", and set the "Initial State" to "Off". This means that when you start the map, the state will be off, but when the env_global is triggered it will be on.

Now to make the links between the entities. Set up the first button to target the door, which I decided to call "door1" in this tutorial. Set the button's "Master" to the name of the multisource, which I decided to call "doorsource" in this tutorial. Now open up the properties of the other button. We want it to target the env_global. So set it's target to the name of the env_global. In this tutorial I decided to name it "doorglobal".

Right, now you simply have to compile your map to see if it works. Which, if you followed the tutorial correctly, it will. First you have to activate button number two, and only then will button number one activate the door. This "trick" is essential for adding complex puzzles to your maps and/or mods.

An example map can be found here.

Rate This Article
This article has not yet been rated.

You have to register to rate this article.
User Comments

No User Comments

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: MIFUNE | Dec 31 2017
 
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
 

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

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!