HOWTO : Start a Listening Server (HL2DM)

Edge

Newbie
Joined
Sep 21, 2003
Messages
686
Reaction score
0
This guide should aid anyone with questions regarding starting a listening server for HL2DM.

Create Shortcut for HL2DM

From the Steam Menu right click on Half-Life 2 : Deathmatch and choose "Create Desktop shortcut".

Locate the New Shortcut and right click on it and choose properties. In the target field place the following.
Code:
"C:\Program Files\Valve\Steam\Steam.exe" -applaunch 320 -console -heapsize 256000 -refresh 75 -novideo +snd_async_prefetch_priority 1
-applaunch 320 - is HL2DM
-console - enables console and prevents the live background in HL2
-heapsize - allocates the specified RAM to HL2DM (I recommend 256 unless you have more than 512MB. If you have less than 512MB you will need to test it out for yourself.)
-refresh 75 - specifies the refresh rate your game will use. If this is incorrect your game may not launch.
-novideo - bypasses the Valve intro video.
+snd_async_prefetch_priority 1 - this is one of the latest stutter bug fixes.. didn't do much for me. use at your own preference.


Create your configuration files

All configuration files will exist at the following location.
Code:
C:\Program Files\Valve\Steam\SteamApps\[email protected]\half-life 2 deathmatch\hl2mp\cfg
unless you installed in another location.
autoexec.cfg - this file runs everytime the game is launched. I place my binds and custom settings in this file so I can delete the automatically created config.cfg should the need arise during troubleshooting.
config.cfg - this is automatically generated based on the selections you make in the GUI.
game.cfg - this file I am not too familiar with I just know a line in this file aids when running a server.
settings.scr - this file contains the data shown when you choose the Create Server GUI selection. (I will include a custom settings.scr in this post.)
valve.rc - this is the launcher of sorts. It calls your autoexec on startup. You could place custom settings here as well but I prefer them in the autoexec.cfg
rm_wpns.cfg - custom config I created for removing all weapons and ammo from the level and players. (Used for Grav Gun Only)

Here are the contents of the config files.
autoexec.cfg
Code:
unbindall
bind "TAB" "+showscores"
bind "ESCAPE" "cancelselect"
etc etc contains my bind preferences.
Add the following to use the weapon removal script. Bind to the key of your preference.
bind "\" "sv_cheats 1;wait;exec rm_wpns.cfg;wait;sv_cheats 0"
config.cfg
automatically generated by HL2
game.cfg
Code:
sv_lan 0
rm_wpns.cfg
Code:
ent_remove_all weapon_pistol
ent_remove_all weapon_357
ent_remove_all weapon_shotgun
ent_remove_all weapon_smg1
ent_remove_all weapon_ar2
ent_remove_all weapon_rpg
ent_remove_all weapon_crossbow
ent_remove_all weapon_frag
ent_remove_all item_ammo_pistol
ent_remove_all item_ammo_357
ent_remove_all item_box_buckshot
ent_remove_all item_ammo_smg1
ent_remove_all item_ammo_smg1_grenade
ent_remove_all item_ammo_ar2
ent_remove_all item_ammo_ar2_large
ent_remove_all item_ammo_ar2_altfire
ent_remove_all item_rpg_round
ent_remove_all item_ammo_crossbow
ent_remove_all item_battery
If you wanted to just remove certain weapons such as the 357 or RPG place "//" in front of the weapons you want to allow.
Code:
//ent_remove_all weapon_pistol
ent_remove_all weapon_357
//ent_remove_all weapon_shotgun
//ent_remove_all weapon_smg1
//ent_remove_all weapon_ar2
ent_remove_all weapon_rpg
//ent_remove_all weapon_crossbow
//ent_remove_all weapon_frag
//ent_remove_all item_ammo_pistol
ent_remove_all item_ammo_357
//ent_remove_all item_box_buckshot
//ent_remove_all item_ammo_smg1
//ent_remove_all item_ammo_smg1_grenade
//ent_remove_all item_ammo_ar2
//ent_remove_all item_ammo_ar2_large
//ent_remove_all item_ammo_ar2_altfire
ent_remove_all item_rpg_round
//ent_remove_all item_ammo_crossbow
//ent_remove_all item_battery
settings. scr allows you to modify the following options
Hostname
Admin Email
Password
RCON Password
Max Players
FragLimit
TimeLimit
Player Timeout (Idle/Disconnected)
Gravity
Friction (How fast you move, Not Objects)
Bounce (How much you bounce, Not Objects)
Accelerate (How fast you accelerate, Not Objects)
MP Decal Limit
MP Item Respawn Time
MP Weapon Respawn Time
Deathmatch Gametype
COOP Gametype
Team Deathmatch Gametype
Allow Spectators
Force Respawn
Friendly Fire
Footsteps
Flashlight
Weapon Stay
Cheats
Unlag
Allow Upload
Allow Download
Force Spectator Camera
Disable Autosave
Falling Damage
Low Ping Server Physics
Autocrosshair
will include in post.
valve.rc
Code:
// load the base configuration
//exec default.cfg
// Setup custom controller
//  exec joystick.cfg
// run a user script file if present
exec autoexec.cfg
//
// stuff command line statements
//
stuffcmds
hostname "Arizona DM | Gravity Gun Fun"
mp_forcerespawn 1

Firewall Settings
This area is too indepth for this guide but I essentially disabled Windows Firewall and opened port 27015 UDP on my router. You can also place yourself in the DMZ but that is insecure. Steam FAQ has more information on ports.
http://steampowered.custhelp.com/cg...nBfcGFnZT0xJnBfc2VhcmNoX3RleHQ9cG9ydHM*&p_li=

Removing Weapons
Although the above works for removing all weapons from the server and each player it needs to be executed after each death to remove weapons players spawn with by default. It is not ideal by any means but it is an example for others who may want to remove weapons from the server that the players do not spawn with ie RPG, 357.

Other files of interest
C:\Program Files\Valve\Steam\SteamApps\[email protected]\half-life 2 deathmatch\hl2mp
motd.txt - contains your Message of The Day when others join your server.
maplist.txt - lists maps available
mapcycle.txt - lists order maps will cycle when changing maps.

Starting a listening server (Quick and Easy)
The above was all optional for a quick and easy solution do the following.
Handle the firewall mess.
Make a config file. server.cfg
Place the following in this file.
net_start
sv_lan 0
deathmatch 1
maxplayers (whatever you want)
map (mapname ie dm_overwatch, dm_lockdown)
restart

now your friends can connect via "connect YOURIP" in the console.
 

Attachments

  • hl2_edge_settings.zip
    1.3 KB · Views: 1,049
An excellent post - do you mind if i post that on a website?
 
Smeg said:
An excellent post - do you mind if i post that on a website?

Thank you.

Sure by all means. Spread the word! :)
 
What about listenserver.cfg this file auto executes each time server starts or map changes, you should put it into cfg folder, for dedicated server server.cfg goes.
 
Z_Unit said:
What about listenserver.cfg this file auto executes each time server starts or map changes, you should put it into cfg folder, for dedicated server server.cfg goes.
News to me. I don't have a listenserver.cfg and when I check the GCF's there is no generic one. I know it was included in HL1 but it isn't included in HL2 heh. I do notice it says can't execute listenserver.cfg when I start a server though. What should this file contain?

ket_ said:
Excellent post! Thanks for all the commands. :)

Thank you :cheers:
 
sv_lan 1 = lan is on

sv_lan 0 = lan is off


So no, sv_lan 1 = Local Area Network Game
 
HELP!!!

will the remove weapons cfg work on a dedicated server and if so how would you set that up?? someone please help
 
anyone got any advice for how to get ANY online server working with a D-link DSLG604-t? I have already unblocked the ports required by steam and have tried DMZ mode as well as many portforwarding techniques. I am connected to the router wirelessly, and an ethernet is not an option. my parents hate cables running through the house.
 
anyone got any advice for how to get ANY online server working with a D-link DSLG604-t? I have already unblocked the ports required by steam and have tried DMZ mode as well as many portforwarding techniques. I am connected to the router wirelessly, and an ethernet is not an option. my parents hate cables running through the house.

Set it up using a cable first, to see if it's a port forward problem or something else.

Servers on wireless network makes baby jesus cry.
 
thanks kazsymonds but if you read the bottom of my post you'd have seen that an ethernet cable is not an option. my dad won't let me run cables through the walls and my mum doesn't want cables running through the house. one of my friends has the same router as me and uses a wired connection and also cannot host internet servers. we are also with the same ISP, but have no prblem hosting online servers with any other games, just source engine games.
 
Back
Top