Wednesday, November 16, 2011

New Map!

Yep, that is right I’m making a new map! I don’t know what to call it yet, maybe Coastal Warfare or something. From the title you’ve probably guessed it. This is a single player map set in the world of Half-Life 2 on the coastal chapters. Here are some screenshots. Click them to enlarge.

derp0006derp0007derp0008derp0009derp0010

More to come later!

Tuesday, November 15, 2011

Source SDK Tutorial: Music

So you played Half-Life 2, and I'm sure you heard the epic music play while fighting headcrabs and destroying an alien empire with a single crowbar. I'm here you show you how to do that. The difficulty on this tutorial is: Easy.
So if you want music to play when you first start the level:

  1. Create a Logic_Auto entity.
  2. Create an Ambient_Generic entity.
  3. Double click the ambient_generic and give it a name. Something like song_01 will suffice.
  4. Next click Sound Name under the ambient_generic and click browse. Under the Sound Type drop down list click Raw.
  5. On the filter field type "song".
  6. Click a sound such as "music\hl2_song20_submix0.mp3" and click OK. Then hit Apply on the ambient_generic.
  7. Go to your Logic_Auto entity's properties and click the Outputs tab.
  8. Click "Add" and then on "My Output named" select "OnMapSpawn". For "Target Entities Named" pick the name of your ambient_generic, I put song_01. For "ViaThisInput" select "Play Sound". Click apply and then you are SO close to being done.
  9. Go back to the properties of your ambient_generic and click the "Flags" tab. Make sure all boxes are ticked.
  10. You're done! Compile your map (F9) and listen to your new tunes!
But what if you want music to play at certain parts of the level? Simple! These steps are just as easy as the last ones!

  1. Find the "Trigger" texture in your texture browser. And make a block where you want the player to step to make the music play. 
  2. Click the newly made block and press "CTRL and T". This will open a properties box. Where it says func_detail at the top, change it to trigger_once. Then hit apply.
  3. Click the Outputs tab. Then just as before click "Add" and on "My Output Named" select "OnStartTouch". For "Target Entities Named" select the name of your sound, like before it was song_01. For "ViaThisInput" select "PlaySound".
  4. Click apply and you are done!