Help Desk

From Valve Developer Community
Revision as of 12:29, 8 June 2007 by Germano Guerrini (talk | contribs) (Problem with HDR lighting in custom maps)
Jump to: navigation, search

Got a question that is not answered in the Source SDK FAQ? Ask it here! Any sort of SDK question should be posted here. After they get answered, move them to the "Answered" portion of the page.

Suggestions before asking a question

Check to see if your question has been asked before:

Asking a question

  • Be specific and clear as possible.
  • Please sign your question (end it with ~~~~). This will help us direct follow-ups to you directly.
  • Check back for answers. We will not put answers in your talk page unless it is specific to you.
  • Use common sense. Hopefully, this won't require much more explanation.
  • Edit questions for follow-ups. Do not post a new question.
  • Use second-level headlines. Surround your question title with three equal signs (===) so they create a table of contents, split between pending and answered questions.
  • Only move your own question. An answer may not fully answer a question. When the question is fully answered, then move it to Answered Questions.
  • Where did my question go? Questions which have not had any activity for 2 months are moved to Dormant Help Desk Questions.


Pending Questions

Will not compile

FIXED:Did not know about user32.lib. That should really be put in a more obvious place. Elspin 19:44, 6 Jun 2007 (PST)

Vrad has an error

Everytime I compile a medium sized map in Hammer (to run it, not as a final compile), an error appears saying that Vrad "had a problem" and had to disabled. The map runs, but then there is no HDR ligting. ace14790 14:33, 5 Jun 2007 (PDT)

Problem with HDR lighting in custom maps

I cannot use HDR lighting when running custom maps made in Hammer. I have to uncheck HDR when running a map or there are problems with lighting on the map. When I start a map with HDR enabled I receive the following message: "custom hdr cubemap "materials/environment maps/borealis_003.hdr.vtf": can't be found on disk.This really should have an HDR version but I will tryfalling back to the non-hdr one. Signon traffic "CLIENT": incoming 32.417 Kb, outgoing 715 bytes"

What can I do to resolve this issue with HDR lighting?

Tom11235 16:01, 27 May 2007 (PDT)

That warning appears when you compile HDR lightmaps for a map that doesn't use a proper HDR skybox. HDR is not an option you can simply set in the video panel. Read the article above for further explanation. --uoz 12:29, 8 Jun 2007 (PDT)

Compile error: "Error trying to allocate X bytes."

I'm in the process of creating a map but I run into an error when compiling it. "Error trying to allocate 18840 bytes." comes up during the BuildVisLeafs process, after the "3" to be exact. When I run the map, there are no lightmaps, despite the fact that the BuildFacelights portion went without a hitch. Save for a number of "WARNING: Too many light styles on *Coordinates*." I'm not sure if this has anything to do with the previous error, as I've been getting those warnings since before I enountered the "Error trying to allocate 18840 bytes." Still, help would be appreciated, for both errors. I'm not sure if it's worth mentioning that if I choose not to have neither VIS or RAD when I compile, the filesize is nearly half that of when I compile with RAD and VIS, yet I get, apparently, the same results. I compile it using a fast VIS calculation and a normal RAD. I doubt it's a problem with my memory, as I've got 1532 MB's. Again, help would be appreciated.

Squadila 18:40, 15 May 2007 (PDT)

Seems to be using up too much memory. Even a gig and a half won't work if you have too many lights on one face. The errors are probably related, so I would cut down on the number of named lights.

Named Lights has nothing to do with it its just simply lights on directed on towards one single face or other words brush. Names really dont cause errors although you shouldn't have to name all of your lights just the ones that require naming for the use of reference to other entity's or even simple outputs and inputs, triggers, etc,. Even if its two lights casted upon one face that can still cause an error namely also if the lights have adjusted appearances like strobe or flicker or even pulse. Try cutting down on that especially if they are light_dynamic.--Gear 17:06, 23 May 2007 (PDT)

How do vehicle sounds and sound loops work?

Ive tried to do some sound modding for empires mod (it uses the hl2 single player buggy sounds and soundscripts), but the source sound system drives me crazy. I would like to hear some official information about how it handles sound loops, because i expreienced the following problems:

  • We have a separate sound loop for idle engine sounds, like v8_idle_loop1.wav. The default official single player buggy loop wav file doesnt contain any cue points. I made two different loop sounds to replace this. They are both identical in format, in lenght, in volume. One works the same way as the default v8_idle_loop1.wav, it loops when the engine is idle. The other one only does this when a cue point is present. How is this possible?
  • There is an engine start sound in hl2 single player: v8_start_loop1.wav. It doesnt have cue points. Ive tried to replace it with two different sounds, both same format. One is played when the engine starts, the other is not. The are 100% identical in lenght, format, volume level. Cue point doesnt help here.

So my questions: Does source really need cue points for vehicle loops? If it does where do they need to be placed? What may casue two identical formatted sounds to differ in playing? How does the default vehicle sound system build up, how do different sound effects loop themselves or follow each other based on the speed of the vehicle?

Petko 22:56, 13 May 2007 (CET)

Problems recording in Episode 1

Recently I've tried to make an .avi file out of a .DEM file using the "startmovie" method. I also changed host_framerate to 30. Problem is, Once I compressed it with VirtualDub into .avi, the video was out of sync with the audio. The only video codec that gave best results was Xvid and I used many of the codecs in MPEG-LAYER 3 for the audio compression, but it was still out of sync. After a lot of coffee and futile attempts I gave up on VirtualDub and started using the "startmovie [videoname] avi" method. That worked great, except that this time the audio was a bit ahead of the video at the start but as the video progressed the video eventually overtook the audio. Basically, I'm sick of virtualDub. I'm just gonna use the source recorder to compress it straight to.avi, but the video and audio is waaay out of sync.


  • The audio speed is fine it just starts before the actual video.
  • The video is too quick, eventually it overtakes the audio. Even though the audio started first.

Is the host_framerate not 30 for Ep1? Or is there another way of shortening the video speed without affecting audio, so they fit perfectly? Please help :( Tsmike92 08:38, 7 May 2007 (PDT)

Strangely even using regular demos recorded through the HL2 system creates problems when viewed upon other mods or systems its quite odd but im not sure what causes the problem if it would be any help though I'll look into it for you. I've been in the needs for creating a demo video for my mod as well so I'll see if i get the same problem.--Gear 17:12, 23 May 2007 (PDT)

Performance warning: Mark bone

I´ve been banging my head trying to fox this console error problem for ages now. All the answers i have found says to use $bonemerge to fix it. But this only fixed my problems for the firstperson stuff. The thirdperson errors are still there. The developer console is totally spammed with this error.

Drakir 15:29, 22 Apr 2007 (PDT)

Physics Gun compile problem

I followed the tutorial on another forum site, and it adds fine, until i try to compile when i get the error:


I have tried to fix this myself, following this:

But i am a very big Noobie to c++ hoping to pick some up on the way through half-life 2 modding.

Cheers, Hope i get a quick answer :P

Trleighton 13:32, 16 Apr 2007 (PDT)

Two scipting problems

First, the MOTD simply does not show up on my server. Also having a similar problem with an MP mod I'm working on, in which only the first character shows up.

Second, as usual the death notices are not working properly in my MP mod. Since there are custom weapon icons (which I do have working) I figured I'd just set up a new entry in clientscheme.res for them. So, under the HL2MPDeathType entry I have:

				"name"  "bsgcficons" // csd.ttf
				"tall"  "32"
				"weight" "0"
				"additive" "1"
				"antialias" "1"

and of course in the custom font declarations I have

 "3"		"resource/bsgcficons.ttf"

Then I went to mod_textures.txt and set the appropriate weapons to BSGCFTypeDeath, like this:

				"font"		"BSGCFTypeDeath"
				"character"	"/"

Well, I'm still getting the error where the icon shows up as the character it is assigned to. There is nothing wrong with my font file, the icon shows up properly in the buckets and loadouts.

Thanks in advance! -Mrhappy 19:42, 10 Apr 2007 (PDT)

I figured out the problem with the death notices, the HL2MP.ttf file which stores the icons for the notices is formated differently than the halflife2.ttf file which stores the icons for buckets and loadouts, and which I used as a template for bsgcficons.ttf. I'm still having problems with my motd files tho :/ -Mrhappy 11:57, 11 Apr 2007 (PDT)

More than 32 chapters in the chapter menu in a HL2 mod?

If you add more than 32 chapters to your mod, chapters 4, 5, 6, 7, 8 and 9 vanish from the menu and any chapters over 32 are left out. Is there any way to increase the 32 chapter limit?

Here is a some more information, following tests to explore the problem:

  • For every chapter over 32, 1 chapter between 4 and 9 is removed.
  • The remaining chapters are shifted down, and anything that's still left over after 32 is dropped.
  • Therefore if you have 40 chapters, you lose six chapters (4 to 9 inclusive), as well as the left over 39 and 40.
  • If you have 36 chapters, you lose 4 chapters (6 to 9 inclusive) but nothing is left over.
  • If you have 33 chapters, you just lose chapter 9.

The system is entirely governed by the contents of the cfg folder. The presence of the chapter1.cfg, chapter2.cfg etc. files in the cfg folder is what tells the new game menu to add chapters. The modname_english.txt file in the resources folder only gives those chapters a name, and the textures in the vgui folder only give them a picture. The chapter#.cfg's can be numbered in any way, using any combination of letters and numbers (such as valve's use of 9a for Entanglement), but it all makes no difference, as long as there are not more than 32 in total.

Can this limit of 32 be fixed or worked around?--Fitzroy doll 12:17, 15 May 2007 (PDT)

Answered Questions


Weapon handoff?

I'm trying to have an NPC hand a weapon to the player. The goal is to have an armed npc_citizen (for example) who meets the player, goes through a short sequence, and holds out the weapon for the player to take. I know this is possible because Odessa does it in HL2 with the rocket launcher. I can muddle through the rest of the choreography but this bit has me stumped. What's the general procedure for scripting weapon pickups/handoffs? There are inputs listed in npc_citizen for e.g. GiveWeapon but no obvious way to get rid of weapons... At this point I've been through all the SDK docs and can't even find a way to convince an NPC to drop their weapon on the ground.

Plasmadyne 01:20, 18 May 2007 (PDT)

I think they used a weapon_rpg with the "Player only" flag checked, and built animations around it. See the commentary in Ep1 when Barney gives you the crowbar. --Gman003 08:38, 21 May 2007 (PDT)

OK, thanks... I think I have an outline now.

Plasmadyne 14:00, 27 May 2007 (PDT)

Exporting from XSI Foundation 6.0

I'm pretty new to modeling and trying to learn. I have a copy of XSI Foundation 6.0 (yes its legal if that matters). The Valve plugin doesn't seem to work (the ValveSource menu wasn't added to the toolbar). I put the file directly into the /addons folder. I suppose I could get a copy of the mod tool and move my files over when I'm ready to export, but I was wondering if there were any other options. Maybe I'm installing the addon wrong? Maybe it shows up somewhere else in the full versions of XSI? Pre-emptive thank you! -Mrhappy 01:20, 26 Mar 2007 (PDT)

As noted here, the addon included with the SDK does not work in XSI 5. I'm guessing, and hoping, that the addon on the page there also works for XSI 6. Worth a shot anyway. --Daedalus 19:13, 26 Mar 2007 (PDT)
Thanks alot, I'm pretty sure it's working properly now. Moving to answered -Mrhappy 19:30, 10 Apr 2007 (PDT)

Problems with Engine / Map

I'm not sure if this is an error in the engine or a map, but everytime I try to run a certain map, I get the following error:

13/ - func_brush: UTIL_SetModel: not precached: *3

hl2.exe then crashes to desktop. This only affects one map. I can provide the .vmf if needed.

--Gman003 15:39, 12 May 2007 (PDT)

Fixed, it was the skybox. Accidentally tied it to a func_brush.

--Gman003 17:48, 12 May 2007 (PDT)

Half-Life 2 Episode 1 "tree_pine" models

I'm fairly new to SDK's Hammer Editor & am currently trying my hand at mapping for Half-Life 2 Deathmatch. My peticular map is of the outside variety in a mountain setting. I need evergreen trees to make it believeable (no evergreen models available in Half-Life 2). I did notice just before the end of Episode 1 (in "ep1_c17_06.bsp"), there are evergreen trees. So with my GCF Scape I searched the "episode 1 shared.gcf" file & found them (six models altogether). I extracted the models to "hl2mp\models\episode1pines" & extracted the materials to "hl2mp\materials\models\episode1pines". However, the models don't appear in my map. I'm pretty sure it has to do with the fact that there were only two ".vmt" (material) & two ".vtf" (texture) files, but none with the same names as the models. Don't I need six ".vmt" & six ".vtf" files with the same names of the models? These models are awesome & are exactly what I'm looking for. Any help with this will be greatly appreciated. Thanks!

P.S. I have also used bspzip.exe to extract embedded files within "ep1_c17_06.bsp" thinking the files I need may be there. No luck with that either. How can the game render these models if the necessary files aren't in "episode 1 shared.gcf" or "ep1_c17_06.bsp"? Is there another place I can look for these material & texture files?--YPE 19:18, 26 Mar 2007 (PDT)

There's nothing wrong with your models. You placed them in the wrong folder.
Eg. If they came from: epicsodic/models/prop_foliage/ in the episodic folder, THEY HAVE TO BE IN hl2mp/models/props_foliage, and the same goes for the materials. It's just how the .mdl system works.--Sortie 00:07, 30 Mar 2007 (PDT)
Thank you Sortie! I didn't realize the importance of keeping the directory intact. I moved the models to the "hl2mp\models\props_foliage" & the materials/textures to "hl2mp\materials\models\props_foliage". The models became visible when placed in my map. Now the only problem I have is feeling like a dork for putting them into the folder I created. I will give you due credit for helping me with the evergreen trees if I ever release my map. It's looking much better already! --YPE 16:58, 30 Mar 2007 (PDT)

Wait one minute i think hes wrong you're creating the maps in hammer and whant to include the props in youre map correct but you need to first extract the files to the Sourcesdk folder in the models and materials path for instance like this: c\programfiles\steam\steamies\username\sourcesdk_content\materials. Same goes for the the models but instead into the models folder. Sorry but the information he gave you is wrong once you place the props in that folder and materials you can then use them in Hammer. The game you design for also depends on the available content! However it being a mp map you can pack the textures and modles so servers can have the players download them. Ive made sourceforts map and ive use ep 1 content on them so i think i would know pretty well on that one so its not bad or anything but thats what you need to do. It needs to be placed within hammmer so when compiled it will show up in the map.--Gear 17:06, 30 Mar 2007 (PDT)

Also on one last note i cant wait to see youre map sounds great is it gonna look like this maybe a bit?:

Gear, I can totally understand what you're saying. However, the information Sortie has given worked 100%. There is no need for duplicating the tree models into the "sourcesdk_content" directory. I did a compilation & the evergreen trees did show in-game. Thank you too, Gear, for bringing to my attention the "sourcesdk_content" directory. It may very well come in handy. As for what my map will look like, I'm not sure exactly, for I am not finished yet. But I can say that it will look completely different from the screenshot you posted. Hopefully, with luck, it will look a bit more like the opening scenes in the original "Half-Life 2: Episode 2 Trailer". That's my goal anyway. It may not look as good as what Valve has created, But I'm going to give it a shot. I am paying a lot of attention to detail. Who knows!

P.S. I will move this to the "Answered Questions" section in a few days (so Sortie & Gear know that it has been answered).--YPE 17:51, 30 Mar 2007 (PDT)

Sounds fantastic cant wait send me a copy when you're done I'll beta test it you hahah if thats okay i was just wondering with he hammer thing due to you need to place the props first in the map before its compiled but im glad it worked good luck!--Gear 17:54, 4 Apr 2007 (PDT)

Well, Gears idea might work, but I guess it'll only work inside hammer. By putting it into the game/mods own folder, it's 100% secure it works, and simpler to release the map.
Thank you once again guys, I really appreciate the help you've given me. I certainly know where to go if i need help in the future! Peace... --YPE 15:42, 7 Apr 2007 (PDT)

Programming error

Every time I launch my mod, it works fine until I load a map. About 2/3 of the way through, I get "First-chance exception at 0x22b6d476 (server.dll) in hl2.exe: 0xC0000005: Access violation reading location 0x0000002c. Unhandled exception at 0x22b6d476 (server.dll) in hl2.exe: 0xC0000005: Access violation reading location 0x0000002c." Anyone know what that is? --Gman003 18:28, 19 Mar 2007 (PDT)

Full Log

Hope you don't mind, but I moved that log to a different page since it was so long.
As to your question, it looks as though you've built the game in the Debug release, have you? If so, clean your solution (it's in the Build menu), set your configuration to Release (it should be on the toolbar somewhere, a dropdown list that currently shows Debug), and then build your solution again. --Daedalus 20:26, 19 Mar 2007 (PDT)
No problem. And yes, it is a debug release, but that shouldn't affect it. I'll try rebuilding as release --Gman003 08:05, 20 Mar 2007 (PDT).
You'd think it wouldn't effect it, but I've been unable to use the SDK at all in Debug release, usually end up with errors I can't see. Release has been working fine for al ong time for me though. Let me know how it goes. --Daedalus 14:08, 20 Mar 2007 (PDT)
That seems to fix it. --Gman003 07:54, 23 Mar 2007 (PDT)

Wacked animations

For some reason my animations are all lagged out (on default weapons in a ep1: sp mod code base), this has happened between compiles, and I changed no code. - Links to videos - NORMAL WACKED --Amckern 16:13, 2 Nov 2006 (PST)

Hammer: %1 is not a valid Win32 Application

Whenever I try to load Hammer to edit either a mod I created or HL2, I get the above error. I tried resetting the game configuration and also deleting/reinstalling the SDK. No dice. I'll keep trying other stuff to get it working. If I do, then I'll answer my own question I guess :D Daemon Jax 15:46, 15 Mar 2007 (PDT)

A: Using a direct shortcut to hammer solves this problem. I found out how to do this at Daemon Jax 16:14, 15 Mar 2007 (PDT)

HudMsg Error

When ever I run my level, I receive DLL_MessageEnd: Refusing to send user message HudMsg of 335 bytes to client, user message size limit is 255 byte. What can i do to get rid of it? Is it because i have to many ents initializing at map load, or is it something more low level? --Amckern 16:09, 23 Nov 2006 (PST)

Steamappid's, engine updates, and .dll's

I used to think I understood the way the engine updates and how mod's access new code, but the more I read, the less I do. Also, I am not a programmer.

Using steamappid 215 is supposed to allow your mod to update in 'lockstep' with source engine updates. I am unclear if this means

  1. when you use the create a mod function the source code provided is the latest source code. this source code is updated when the source engine updates? Or client and server dll's are updated whenever steam updates, which would make no sense it would destroy custom code.
  2. I noticed there are many .dll's in the base source engine 2.gcf but that client.dll and server.dll are missing. As far as I can tell they only show up (besides in actualy games) in base source engine.gcf/sourcetest/bin What confuzzles me is that this is the directory for the video stress test, and that the client.dll and server.dll werent updated. I'm guessing that these other dll's are what update when the engine updates, and that the source code for them is unavailable without a lisence.
  3. I assumed that the engine only updated when a new episode/game is released, meaning that there has only been two updates (source base and source base 2), but this kinda doesnt make sense for two reasons:
    1. When compiling under Episode 1 (actually I havent done this only read it) you do not need the -novirtualmesh parameter for displacements to collide with physics objects. However, under steamappid 215 you do which is either the same or a later code base, the later of which means (to me) that either the bug cropped up then, although I read it was present pre-ep1 and fixed (didnt get back into mapping till hl2:ep1) or that the bug only came up with a later code base, and once again, I thought the latest code base was the ep1, one.
    2. Steamappid 212 exists, which is the steamappid for base source engine 2. Now, as I understand it the code base only updates with a new episode/SP game. This implies that 213 will be for ep2 and 214 for ep3. Now, since they are released so far apart it doesnt make sense for steamappid to exist unless the codebase is updated between games using the non client and server dll's, which would retroactively effect steamappid 215 games, which may actually be bad (for example HDR on certain specular shaders is bad) This only makes sense if the codebase updates routinely, between games, but is not applied retroactively even when steamappid 215 is used. But, as far as I know it, the .gcf's are never modified, new ones created yes, but not modified, and the latest one is source sdk base 2.

I probably overthought/overtyped this. I'm sure its really simple, but I havent seen a simple explanation anywhere. Anyone got one for me? Exactly how are standard-valve-made code updates applied to mods dynamically and when? --Mrhappy 00:38, 2 Feb 2007 (PST)

  1. There are two levels of code: engine code and game code. Engine code is updated in lock step for the SDK Base, that is, all engine updates immediately apply to mods; game code is updated when the game it's derived from changed, which isn't as often (look at the last HL2DM update!). Game code updates come as source code that must be merged into the mod's source (if the mod wants to use them).
  2. Engine code is in base source engine 2.gcf. Game code (client.dll and server.dll) is in the game's cache. The two DLLs are in the sdk base cache not because it's a stress test, but because they are the default, pre-compiled files that will be used if you are making a mod without custom code (like MINERVA). Source will see that you don't have code of your own and fall back to whatever's in the SDK Base cache. The same applies to all files.
  3. Valve update Source all the time.
    1. -novirtualmesh is for backwards-compatibility with older maps, AFAIK. Without it you'd need to recompile every map with a displacement in it.
    2. The only reason there is a separate "source engine 2" GCF is because of content issues between HL2 and Ep1. If it weren't for that, there would just be the one source engine.gcf. I would be very surprised if a third instance of Source were to crop up when Ep2 is released.
--TomEdwards 03:17, 2 Feb 2007 (PST)

Ok that makes sense, thank you! (I need to stop tying my brain in knots on stupid things like this.) Mrhappy 20:13, 2 Feb 2007 (PST)

HL2 in Outter Space?

Hello, I have been tearing at HL2 SDK for a while now trying to get a MOD to go into outer space as well as normal mode. I've done many things just short of completely breaking steam :P "sv_gravity 0" gives the no gravity effect, but you cant move. My guess is it's extremely simple or extremely hard. either way I desire to see HL2 in space! Anyone out there have a strategy or tutorial for making a space age level?

--Sir_BigOne 07:28, 25 Mar 2007 (PDT)

You can try creating a new class (cpp file) in the src/dlls directory:

Put this code in a cpp file in src/dlls (i.e. setPlayerPosition.cpp)

#include "cbase.h"
#include "convar.h"

void SetUserPosition( void ){
	CBasePlayer *pPlayer = ToBasePlayer( UTIL_GetCommandClient() );
	if(pPlayer != NULL && (engine->Cmd_Argc() == 3)){
		float x = atof(engine->Cmd_Argv(1));  //Get x coord
		float y = atof(engine->Cmd_Argv(2));  //Get y coord
		float z = atof(engine->Cmd_Argv(3));  //Get z coord

		Vector pos;
		pos = pPlayer->GetAbsOrigin();  //Get player position
		pos.x = x;
		pos.y = y;
		pos.z = z;
		pPlayer->SetAbsOrigin(pos);  //Set player position

static ConCommand set_user_position( "set_user_position", SetUserPosition, "Set the user's position (x,y,z)", 0 );

Compile it.

Now you can use the console command set_user_position(0,0,0) to move the player

To do the outer space jetpack, modify this code to increment x,y, or z everytime the command is called. Then bind a keyboard key to the command (using config.cfg)

You can also hack around in in_main.cpp in the src/cl_dll directory. This is where many of the input controls are handled. BE CAREFUL AND BACK UP FILES SO YOU DON'T BREAK YOUR MOD.

Good Luck.

--Steve Henderson 14:41, 27 Mar 2007 (PDT)

MY hammer crashes when I load a blank map NOT COMPILE I have tried reinstalling sdk base and source twice and I am stumped on what to do so can someone please help me Its says this is the error report (C:\DOCUME~1\SEANRA~1\LOCALS~1\Temp\9e03_appcompat.txt) and I cannot find that file

--Sean 14:41, 16 Apr 2007 (PDT)