Vlatitude: HL2 - Changes from HL1 Last edited 1 year ago2022-09-29 07:56:11 UTC

This is not so much a tutorial, as it is a quick list of stuff that has changed since HL1 in the use of hammer and HL2.
User posted image


Don't run hammer using the steam menu. Its a waste of time and CPU. Instead, run it using a shortcut to steamdir\SteamApps\username\sourcesdk\bin\hammer.exe.

Don't forget to disable auto-update from the steam menu, and if you then run the SourceSDK once, you can just use the shortcut to run hammer, which is much faster. You may need to run the SourceSDK menu again to change game-configs or after an update (only once; after that the shortcut works again)

A few new options are: Well, those are the most important ones


A new tool has been added: the Overlay Tool (shift+O). It's a tool for advanced decal placing.

Extra options are:

Ground-textures, independent rotating, flipping and resizing (you can rotate and resize overlays just like you do it with normal brushes). Overlays can also be added to displacement maps.

To flip overlays, edit the U End and V end values lower than the U start and V start values, each representing horizontal and vertical flipping respectively.

Also, overlays can be applied to brush-faces you specify, by clicking "select brush faces" and then selecting your (hold ctrl for multiple) faces you want the overlay to apply to.

You can specify a render order, so you can choose which overlay is rendered first (at the bottom) and which overlays should be rendered over that one. One negative point however, is that overlays take a little more stress on the engine compared to decals, especially if they are big. If possible, use decals instead


All pretty much the same, except for the lightmap option. You can set the size of lightmaps higher or lower. Higher looks better, lower looks worse.

Also instead of just textures, you can add displacements to a face. To do that, start the texture application tool (shift + A), go to the displacements tab, press select, select your face, press create (power=detailedness, more looks better but is laggier) and you can edit your displacement using all the tools.

The basic ones are: NOTE: Displacements don't stop leaks. Once a brush has one or more displacements on it, it won't stop any leaks. Use a nodraw-textured brush to battle this


Valve has improved the compile tools greatly. Instead of four programs (hlcsg, hlbsp, hlvis and hlrad) there are only three left (csg has been integrated into bsp), thus you only run vbsp, vvis and vrad. Also, vvis has been improved speed-wise. Big ass maps can be compiled in 10 minutes! Compare that to the hours of compiling on HL1 maps...

A few basic hints though: Unfortunately, all errors have different names too, so its back to square one for their meanings. . .


Two major things changed in entity world: outputs/inputs and helpers.


Instead of triggering an entity, you give it an input. It works sort of like

"When I do this, you do that". In other words, you can't just trigger an entity, but you can give it an assignment to do anything you want, when you want.

To use it, simply click on an entity and go to its OUTPUTS-tab.

The screen you see now:
User posted image
Explanation of the buttons: When you press "add..", you can add an output. You can have as many as you want. You must fill out the form to make it work. Here's what it all means: When I do this, you do that:
My output named: here you specify when your entity must trigger the other one. Remember that these conditions differ from entity to entity. You can select it from a list if you want. So, if you put OnTrigger here, the output will be passed if the current entity is triggered

When I do this, you do that:
Target entity: which one? Specify the targetname of that entity here. If it's in red, the entity does not exist, and if it's in bold, there are more entities with that name.

When I do this, you do that:
Via this input: what must the other entity do? Of course these values also differ from what the other entity can do. If you remembered to make the other entity before making this output, you can select the inputs from a list

parameters: sometimes you have to specify something apart from the input itself, for instance a value to pass, or a target to change. Again, the availability of this option differs from entity to entity

When I do this, you do that some time later:
Delay: specifies a time before the input is fired.


HL2 doesn't need origin brushes anymore (they are still there for compatibility only, they work, but using helpers is easier).

Most rotating entities rotate around their origin (which you can select and move; it's a little white circle) but sometimes entities have a location of a movement axle, or a place to hinge around, and that's where you use helpers. Helpers are small spheres, which you can move all around. Almost all moving point-based entities and all physics entities use helpers. If you want more info about them, I suggest you take a look at the example maps in your username\sourcesdk_content\hl2\mapsrc directory.


Some smaller entity changes are:


This nifty little point-entity is used for creating shiny stuff. Basically, using "buildcubemaps" in the HL2 console (INGAME, yes, you heard it) the engine makes pictures of your level, which it will project on shiny/reflective entities, models, or walls to create a shiny/reflective effect.

Placement: Anywhere. Best point is eye-height of the player, minimal 16 units from any wall/brush/floor etc.

You can also tie it to certain faces, but that should rarely be necessary (everything already defaults to the nearest env_cubemap).

NOTE: Cubemaps may be a major engine load if their size is big and their numbers are abundant (or the entities they are used for). Don't overdo them!


They are still there, only different names:


Look in:

username\sourcesdk_content\hl2\mapsrc for a great amount of example maps. Look, reproduce, and learn

Other notes: Exploding barrels don't seem to respawn right. This is a bug, and a stupid one.

Workaround for exploding barrels-bug

Make a point_template. It's an entity that can make copies of other entities.

Name it, and set template1 to the name of your barrels (they can all have the same name).

Make a math_counter. It counts if sufficient barrels have been destroyed, and if there are, makes them respawn. Set the maximum value of the math_counter to the amount of barrels you have, and make it trigger the point_template if it reaches its maximum:

my output named: OnHitMax
Target entity: point_template
input: Forcespawn

The math_counter also has to target itself to reset itself.

my output named: OnHitMAx
Target entity: math_counter
input: SetValue

Have all barrels trigger the math_counter:

my output named: OnBreak
Target entity: math_counter
input: Add

Once all barrels have triggered the math_counter, the math_counter will make them respawn using the point_template.
This article was originally published on 69th Vlatitude.
The original URL of the article was http://www.vlatitude.com/tutorials.php?tutID=61.
The archived page is available here.
TWHL only publishes archived articles from defunct websites, or with permission. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.


You must log in to post a comment. You can login or register a new account.