title: Configuration
author: cdunde/PuG

In this short tutorial we will be showing you how to quickly setup QuArK to compile maps
for Valve's Half-Life 2. Please remember: to be able to create maps for Half-Life 2, or any
of its modifications you must have the latest version of the <a href="http://developer.valvesoftware.com/wiki/SDK_Docs">Source SDK</a> downloaded and installed for the necessary <g>build tools</g> & materials. This can be downloaded from Steam itself, under the Tools tab. Also, here is a link that list all of the games entities and how to use them:
<a href="http://developer.valvesoftware.com/wiki/List_of_entities">HL2 Entities</a>.

<table border=0 cellspacing=0>
<tr><td valign=top align=left>
<b>Part 1 - Setting up QuArK to work with Steam</b>

First we need to setup QuArK to work with Steam. Start QuArK, and you should be
greeted with the 'QuArK Explorer' panel. The QuArK Explorer allows you to define
which game environment you wish to work in, as well as doing many other things.

We need to select the game we want to map for. We do this by simply going to the
<tt>Games</tt> button located on the top right of the Explorer panel, once pressed it will
present you with a drop list of all the currently available games, select
Half-Life 2 as shown in the screen shot to the right.

Next we need to setup QuArK to work with Steam, to do so go back to the <tt>Games</tt>
button and press the <tt>Configuration</tt> button at the bottom of the list.

Once selected a new window will be opened called <tt>Configuration</tt>. Select the item
Steam selected on the left navigation panel; it's located under the Games folder. We now need
to fill out some of the necessary settings on the right of the Configuration panel.

</td>
<td>
<img valign=top align=right>hl2_config1.png</img>
</td></tr>
</table>

<table border=0 cellspacing=0>
<tr><td valign=top align=left>

Click on the button to the right of the first field and locate the folder
in which you have installed Steam. If you used the default when you installed Steam,
this should be:
<ul>
<li>C:/Program Files/Valve/Steam
</ul>
In the next field, Enter your Steam account name. This is used to locate files in the
Steam directory.
The other options can be changed to alter the way QuArK works with Steam. The default
settings are probably best.

</td></tr>
<tr><td valign=top align=middle>
<img border=1 valign=top align=middle>steam_config.png</img>
</td></tr>
<tr><td valign=top align=left>

<b>Part 2 - Setting up QuArK to work with Half-Life 2</b>

In this section we will quickly go over how to setup QuArK to work with Half-Life 2.

Go to the Configuration panel of Half-Life 2 (described above for Steam).

To start with we must select which of the Half-Life 2 games we wish to work with. To
do so simply use the drop down menu to the right of the 'Steam game' setting
(under the Game Settings tab). This should give you a selection of several games, for
this tutorial we are going to be working with Counter-Strike: Source, so select:

"Counter-Strike: Source"

(Tip: You may want to increase the width & height of the Half-Life 2 window for when
we use the 'Run Half-Life 2' option later on in the tutorial e.g. '-window -width
1280 -height 1024'.)

All other relevant settings are set to "*auto*" on default, so you don't need to
change those. However, should you ever want to, here's a few pointers:

<ul>
<li>Set the Game directory to the directory containing all the game's files, relative to
the Steam directory.

<li>Set the 'Steam App Id' to the Application ID of the game you want Steam to run. Look
<a href="http://developer.valvesoftware.com/wiki/Steam_Application_IDs">here</a> for a complete list of all the application IDs.

<li>Set the Game data directory to the directory in which the game's data is located. For
Counter-Strike: Source, it's 'cstrike'. This is the directory that contains the 'bin'
folder with the executable, and the 'GameInfo.txt' file, and is the last directory
of the Game directory setting.

<li>Set the Source SDK Bin directory to the directory containing the SDK tools for that
game. This directory should contain the compilers.

<li>Set the Compiler version setting to the type of compiler the game uses.
</ul>

The compiler settings should work just fine, but if they need to be changed and you
are unsure on any of the settings, hold your mouse cursor over the white
box and it will come up with a quick example.

Note: If you change to any other game than Half-Life 2, be sure to also change the
Addons used to make sure you're not using Half-Life 2 items in other games, and that
you have that games entities available to you too.
</td></tr>
<tr><td valign=top align=middle>
<img border=1 valign=top align=middle>hl2_config2.png</img>
</td></tr>
</table>

<table border=0 cellspacing=0 align=middle>
<tr><td valign=top align=middle>
<tr><td>
Once you have finished setting QuArK to work with the HL2 compiler, simply press the 'OK' button to close the Configuration panel; this will leave you back in the QuArK Explorer.
</td></tr>
</table>

<table border=0 cellspacing=0>
<tr><td valign=top align=left>
<b>Part 3 - Compiling</b>
</td></tr>

<tr><td valign=top align=left>
In the section above we setup QuArK to work with the HL2 compiler. Now it's time to do something more exciting.
First we need to create a new map. To do this click on the 'New Map' icon which is the leftmost button on the toolbar with the
'Games' button. You should now be confronted with the map editor itself with some pre-made structures and entities as shown below.
</td><td valign=top>
<img border=1 valign=top align=right>hl2_config3.png</img>
</td></tr>
</table>

<table border=0 cellspacing=0 align=middle>
<tr><td valign=top align=middle>
<img border=1 valign=top align=middle>hl2_config4.png</img>
</td></tr>

<tr><td>
(Your QuArK Map editor may look slightly different to mine, this is because I have Quad view ports set, and the colors have been
slightly adjusted to my own personal taste.)

If we compile the map as it stands, it will work fine in game though you may not be able to spawn (only look around). 
To compile the map simply go up to the 'Half-Life 2' button at the top of the page, and on the drop down list select the
'Complete Rebuild' Option.
</td></tr>

<tr><td valign=top align=middle>
<img border=1 valign=top align=middle>hl2_config5.png</img>
</td></tr>

<tr><td valign=top align=left>
The QuArK 'Console' should now appear, and a text output will show the progress of the compile. Once completed you should see the
following text at the bottom of the Console window:

<ul>
<li>/quark.cfg: exists
<li>/maps/newmap.bsp: ready
<li>/maps/newmap.pts: ignored
<li>Files stored in C:\Program Files\Valve\Steam\SteamApps\...\counte<br>r-strike source\cstrike\
<li>Operation finished.
</ul>
The Console outputs what the Valve compiler is doing, and you should always
review the output regarding any error reports such as <g>leaks</g>.

With the map now compiled, you can either load up Counter-Strike: Source, and
create a server making sure you have select your map from the CS:S Map list (as
default it should be called 'newmap'); or within the QuArK Map Editor once
again press the Half-Life 2 button at the top tool bar & select 'Run Half-Life
2', this should now start CS:S, and automatically create a server with your
newly compiled map.

With the default pre-made map you will not be able to spawn with CS:S, only
join as a Spectator; and with any luck you should now be viewing a box room
with sky like the one shown below.
</td></tr>

<tr><td valign=top align=middle>
<img border=1 valign=top align=middle>hl2_config6.png</img>
</td></tr>
</table>
