Talk:My First Mod

From Valve Developer Community
Jump to: navigation, search

Help, map isn't working in my mod

Hey, my map isn't working in my mod. When i click on my chapter, my game crashes with hl2.exe stopped working. Anyone have a clue what going wrong? I have the good map name and stuff.. --Wilko343 19:36, 12 July 2010 (UTC)

HL2EP2 SP and MP glitch

Hi. I'm making a mod of ep2 that is both singleplayer and multiplayer. I edited the gameinfo.txt to omit the game type part, but when I start up the mod, there is no Find Servers or Create Server!!!! Also, there IS a multiplayer tab in Options, but it's all messed up, it's scrunched up in a block it the top left corner!! Please, help! Nameguy

>> Edit Gamemenu.res which is located in the resources folder of your mod, and add

	
	"9"
	{
		"label" "#GameUI_GameMenu_FindServers"
		"command" "OpenServerBrowser"
	}
	"10"
	{
		"label" "#GameUI_GameMenu_CreateServer"
		"command" "OpenCreateMultiplayerGameDialog"
	}

--Wobot <1:32 pm -6 GMT - May 9th 2010>

Crash with Virgin Mod

Hi, I create a HL2DM Mod just like all the documentation tells me, the files are created, and I can open, modify and compile the solution in VS2003. BUT... A virgin mod, compiled using the 'release' setting, with not a single line of code changed, crashes when I Select 'Create Server' and click OK/Go to create the server and start playing. It crashes to the desktop with a memory location addressing error (memory could not be read or written to at some location).

-- I am also having this exact problem. No maps are in the directory, and if you click the "game" tab it is blank. Also the options panel is blank for multiplayer setup. What is the issue here? -Draconis

-- I am having this same problem with the new SDK (updated for VS2005). I created a test map with two spawn points (one for combine and one for rebel), added a few lights and compiled. Thats the only map that shows up in the directory. And when I run, it just crashes to the desktop with a "Unhandled exception in hl2.exe". This is quite frustrating! --HeavyHelmet 07:24, 7 Jan 2007 (PST)

Please, surely this is not normal!?

--Mine doesn't crash, I have a basic HL2 DM mod with a generic map, 2 spawn points just for a start. I did have the blank multiplayer tab which I resolved by extracting the resource folder from hl2 dm with gfcscape. The problem I haven't been able to solve after 2 days of searching hear and google is the GAME tab is BLANK when I go to Create Server. My mod does run a listen server despite this but uses default settings like host name, no password ect. I tried extracting everything but the models, and maps folders but that didn't help, I copied the server.dll over from HL 2 DM and now the GAME tab in Create Server now shows up with the correct content but, then crashes with a memory error. Seems to me its coded into the server.dll, but I have no clue in the code where to even start. If someone could point me in the wright direction that would be great. HeavyMetal, sounds like maybe you haven't compiled your mod. the tutorials hear are very helpful, but lots of info is clearly missing. Kinda weird so much is already provided except this simple little listen server tab of info when you create a new mod. Jadepanther

I'm also having the very same problem with the "GAME" tab, it's blank. Maps, however, work fine for me. This problem occurs whether I launch from Steam or compile the source code through VC Express '08. My Multiplayer Options tab is also fine. I AM Your Reason
That's normal. If you want to add items, copy and/or edit another game's cfg\settings.scr file. --TomEdwards 17:50, 18 July 2009 (UTC)

Missing step?

I think there may be a missing step in these instructions. Having followed them slavishly, everything works fine until I try to run the mod at which point the console appears with the error "Unable to load maplist.txt" (and other resources). I've found other references to this problem in forums, so either there's a missing step here, or a few of us are making the same mistake that perhaps needs to be dealt with here.

One possible explanation I've found refers to the default HL2 server.dll being loaded at runtime, instead of the mod's version. Is this a build configuration issue?

I'm not after a personal response - I'm hoping to prompt an experienced developer to amend the "My First Mod" article. —Prlsmith

Since the mod has no content yet, it's acceptable for it to do that. Ignore the error. You can create a maplist.txt if you like, or just run map mapname in the console. Eventually you'll need to add content. See Adding chapters to your mod for how to add maps (although it's probably more information than you want). I'll try to fix up the article soon. —Maven (talk) 09:45, 23 Oct 2005 (PDT)
You're right, I just got spooked by the errors. Your changes to the article are fine. Thanks Maven. —Prlsmith 19:30, 27 Oct 2005 (UTC)

I found Visuall c++ 2005 express edition and an article about how valve suggests this as the best environment for creating mods. If anyone else wants to download it here is the link:


Help! I've also followed this tutorial.. get the exact same error.. but I _can't_ just run "map 'mapname'". Also, when I go to newgame, it's totally blank. When I do "maps *", it's blank. Whenever I do "map 'mapname'" for standards maps (ie the one suggested), it says it can't be found. When I do "maps ", as it says in the tutorial.. nothing happens. How have I screwed up? -Clb

I have the exact same problem as Clb. Following this tutorial to the letter leaves one with no maps from which to choose when testing the mod. Please help. Do you need to do something else before or after this tutorial to have maps available?

If you type into the console "map" and it wont show options underneath you probably have no maps! in your mods map folders.
Try to use hammer and create a simple map and compile it. Try it again. If it doesn't work try to run it from Hammer automaticaly after the compilation. -- Rotzi 18:29, 11 Aug 2006 (PDT)

Actually I did have several maps in my /maps directory. Someone suggested putting a maplist.txt in the root for the game and that seemed to have solved my problem. Any bsp's I add are visible in-game now. Thanks  :)

I also get the same problem as Clb. Is it normal that when you "Create a Mod..." based on Half-Life Single Player that no maps (.bsp files) are placed in the mods Maps folder? The tutorial seems to suggest that a newly created HL2 single player mod will have access to HL2 maps - is this not the case? Is this something to do with the latest SDK release maybe?

I am very dissapointed by the support valve provides so far. Followed the tutorial coulnd't find files. There were no maps in my mod. Hammer doesn't startup at all as it cannot find steam.dll After searching the net for a few hours I found GCFScape which you can use to extract maps from the original Halflife2. Still not working. Come on guys, I'm an expert C++ programmer, I could have used this time to create nice mods rather than figuring & puzzling out how you intended things should work. I did invest $60 in this SDK but I'm regretting it already. Vavle People get your act together! This is unprofessional & very discouraging for people wanting to build mods. --eelke

I find that odd TBH. Unless you went with the empty code your mod will be based off eithier HL2DM or HL2 and include all of its content. Theres also reems of development exmaples to be found in the <email>/sourcesdk_content section. As for the Hammer not starting ensure that you run the game once before you try loading that game into Hammer. Sometimes its dependant on files that are only generated after you run Hammer once. --Angry Beaver 15:37, 25 Sep 2006 (PDT)
You should try it. Seriously the maps dirs and everything is empty. What's the difference between source SDK & source SDK BASE? if you copy steam.dll to the directory where hammer.exe resides at least you can start hammer....No you can't it will crash... but that can be fixed if you click on reset game configurations in steam. What should be in maplist.txt? and where to put it. I've tried to put it in several places no success. Please someone help me. --eelke
I found a solution, see the solution I've posted @ the my first mod tutorial.

Suggested c++ Environment

http://msdn.microsoft.com/vstudio/express/visualc/

if you use this, follow this for it to work with the hl2 SDK
http://www.chatbear.com/board.plm?a=viewthread&t=104,1102070328,6443&id=741090&b=4991&v=flatold
PanFrie

First MultiPlayer Mod

I followed all of these steps, with the exception of using Half-Life 2 Multiplayer. When I try to launch a map using "map <mapname>" I get "STEAM validation rejected." Is the map launching different for multiplayer?

Azound 23:46, 15 Jan 2006 (PST)

it's a common error with mp mods...run with sv_lan 1—ts2do talk 14:46, 16 Jan 2006 (PST)

another fix for this is instead of opening your console and typing "map <mapname>", click on the "start server" button and it should work...


I follow the steps exactly but the RPG doesnt seem to slow down, even at 50. Also, I did not find a weapon_rpg.cpp in the hl2mp_dll folder, only in the hl2_dll folder, and when I build, after the first time, even if i change the file it doesnt seem to rebuild weapon_rpg.cpp... Is it not included? I cant find it on the class view either.

Thanks, Philippe

If you started with a single player mod then you can copy sdk_shader_samples.bsp from <steam install directory>/SteamApps/<username>/half-life 2/hl2/maps/ to your mod's /maps/ directory inside of SteamApps/SourceMods

I tried this and it works you can load this map and play it.

Compiling under VS2005

I did this, to the letter, but with microsoft visual c++ 2005 express edition, and when it compiled it gave me a good bit of errors some complaining of not being able to convert const char * to char *, and "cannot open file '.\release_hl2\AI_Activity.sbr':"

because of this i do not believe that it compiled at all, and there is no bin folder in my mod directory and running the mod and using rocket launcher yields no change as i expected.

any help would be very appreciated thanks,azraiel

yea, im getting this exact same error, when i opened the game_sdk it needed to convert it. im using microsoft visual c++ 2005 express, but i cant run my mod whatsoever, when i try to i get "could not load library client" as an error.
PanFrie
same here... any solution yet?!
AssA
that didn't work for me... got myself a .NET 2003 copy... works fine there...
Please refer to Compiling_under_VS2005 and its Talk:Compiling under VS2005 to help fix that. I didn't succeed yet, but it seems some people did... Does not work neither with VS Studio 05 nor with Express Edition for me :(
User:Rotzi

Help

doesn't seem to work when you make a multi player deathmatch game i've tryed and all i get is a user varification declined error said something about the listenserver.cgf file

so if anyone know how or why this is happening it might be usefull to finish this tutorial right because rite now it's not good.-User:Group437

Are you recieving STEAM validation rejected error?—ts2do 20:34, 14 Feb 2006 (PST)

Write- protected directories

Do not hit me too much- I am but a pixel pusher.

I've created custom mod (HL2 MP)- everything went well, directories were built and content copied. Working with content I encountered weird problem- when it comes to maps everything works well but when it comes to models and materials- entire directory under "\SourceMods" is write protected and no matter how much I try I can not move around it. Any ideas would be apreciated

Shutdown Steam? ;P
I know that you can't open the gcfs when steam is running... so... that would be the most simple reason possible... User:Rotzi

Rocket Speed

Heh, that's one of the first things I changed too. Of course, I made it into a cvar so I could change it in-game. (After making sure all the define's usages were dynamic). Fun!

Tutorial not working for vs 2005?

I tried compiling the source code using vs 2005 (the latest update added vs 2005 support), i tried to follow this tutorial, but i couldn't even compile. It gave me this:

c:\mymod\src\Public\winlite.h(22) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory editor_sendcommand.cpp
..\public\editor_sendcommand.cpp(17) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Generating Code...
Creating browse information file...
Microsoft Browse Information Maintenance Utility Version 8.00.50727
Copyright (C) Microsoft Corporation. All rights reserved.
BSCMAKE: error BK1506 : cannot open file '.\Release HL2\Editor_SendCommand.sbr': No such file or directory
Build log was saved at "file://c:\mymod\src\dlls\Release HL2\BuildLog.htm"
server_hl2 - 8 error(s), 0 warning(s)
//========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
i don't know wether this is a code bug or something else, but i can't compile anyway. Solokiller 09:49, 7 Nov 2006 (PST)
EDIT: I think this may be caused because i don't have the Direct X SDK.
EDIT2: Added name.
EDIT3: The problem was that i didn't have all the needed files installed on my computer, it's fixed now.

Okay, I'm having that problem, too... so I installed all three required files listed in http://developer.valvesoftware.com/wiki/Compiling_under_VS2005 and I'm still getting the same error. Are there any settings I need to configure, to make it work properly? AWESOME 11:15, 23 Oct 2007 (PDT)

Contradiction

Just ran a quick edit to update the tutorial to the latest happenings and after proof reading what I said I'm hitting a little snag.

  • Its illegal to redistributed valves content from GCF files to people who may not own them. Mods can't distribute extarcted content, nuff said.
  • The known issue is correct and that the only fix I know while using appid 215.

They contradict each other, here fix this by extracting something you can't give to other people, what should the advice be?? Is there another fix? --Angry Beaver 23:21, 18 Nov 2006 (PST)

The best option would probably be to just use Half Life 2 SP/MP as the mod base. Unless the offending code can be fixed, this is probably the only way of fixing the bug and keeping your mod distributable. --RabidZombie 11:09, 20 Nov 2006 (PST)
Thats basically what I'm asking, 'whats the code alteration to fix this thing and does anybody know?'. I've been an advocate of using 215 so I don't like changing side due to a tiny little fubar like this :) --Angry Beaver 15:22, 20 Nov 2006 (PST)

error: not even a console..

Using this Howto and starting my empty new mod does not even show me the cosole, as long as i dont use a +map namname command in my start_mod.bat. Instead of the console i get a blank screen, later on a white, screwed errormessage-unreadable. waiting some minutes does quit the game. i did not change the appid, got base sdk installed.. so im kind of confused..--Inbreed 03:50, 22 Nov 2006 (PST)


Mostly working

Goog little article this I got it all working except that I couldnt get a map to load by editing gameinfo.txt I had to grab one out of a .pak.

Seeing as this article is such a logica first step Id say this article could maybe do with a section at the end for logical second steps. Just a few links to articles on really common modding problems like adding your own or editing objects, weapons, maps or NPCs. I know there are a shedload of articles round here but knowing where to start and what is possible as a new modder it a real problem for me. --Poi 06:51, 27 Feb 2007 (PST)

Have a look at the stuff under the heading You've built your first MOD, that might help. I think I'll add a little extra link to the level design category though. --Daedalus 08:04, 27 Feb 2007 (PST)


Headline text

help

i did everything what i must do in de create your mod directory. and i followd all the steps. but now i must load Bold textGAME_SDK whit c++ but i cant find it. where is GAME_SDK please some one help me

It's in your src directory. --Daedalus 21:18, 2 Mar 2007 (PST)

No Microsoft Visual Studio

i don't have the Microsoft Visual Studio .NET in any folder, was it supposed to be installed or something?

and how do i get it? there are a bunch of link and stuff scattered all around and i just want to know how to get Microsoft Visual Studio .NET

Microsoft Visual Studio .NET is a separate product than the SourceSDK. You must first purchas and install it in order to build the SDK. (If that is what you are asking).--Reacher 15:03, 29 Mar 2007 (PDT)
Or you could Download The express version for free. Also be sure to read Compiling under VS2005 as it tells you exactly what to do. --Angry Beaver 16:11, 29 Mar 2007 (PDT)
Just a quick question, what's the diffenrence between these products?--Sortie 00:00, 30 Mar 2007 (PDT)
2003 Vs 2005 is like a pop gun compared to an artillery cannon. Express Vs regular is like a pop gun compared to a small artillery cannon. The key things are, Express is free but is missing a lot of nice features. and 2003 is out dated and seriosuly outclassed by 2005. Get Visual studio 2005 if you can afford it but else downlaod 2005 Express. --Angry Beaver 16:06, 30 Mar 2007 (PDT)
Well, thanks, I'll just download express and try it out.


Suggestion for the whole Maps/Content Thing

Since this tutorial assumes you're basing your mod on HL2 or HL2MP anyway, why doesn't it just show you how to LEGALLY load the content/maps from those .gcfs into your mod? Any modder who intends to base on existing content is going to need to know that stuff before they can make any more progress anyway.

As is, the largest single section of the tutorial is dedicated to a temporary / not-legally-distributable solution, and then it leaves them up a creek for the rest of their borrowed content.  :P

Couldn't this be done with, say, the IFileSystem and "Mount Steam Application Content"? --Daeval 13:54, 3 May 2007


Can be done with this: Mounting_Other_Content -- if the person doesnt have the content, it doesn't get loaded. Saves ripping maps and models from CSS/DODS/GMOD :P Trleighton 06:28, 25 May 2007 (PDT)


Rocket Speed doesn't change

I have been following the tutorial for My First Mod using Visual C++ 2005 Express. Compiling and linking works fine. Loading maps works fine (using appid 220). However the rocket speed doesn't seem to be any different. I've tried different values between 100 and 4000 but I can't see any difference. Grateful for any hints or tips!


[EDIT] I have now solved the problem: You must use appid 215 in order to load the server.dll properly. The tutorial states that you can use appid 220 in order to have the maps available. But using appid 220 won't load your server.dll. Hence you must use GCFScape tool to copy the required maps into your mod's map folder in order to run the tutoral mod.


I had the same issue. I followed the tutorial perfectly and even used appid 215 as mentioned above, but when I ran run_mod.bat, it always used the hl2 dlls instead of mine. Not sure why, nor am I sure how to get that batch file to run with my dlls, but I did find a different way to get this to work:
Go to Steam, under My Games you'll see your mod, right-click the mod and go to Properties, click Set Launch Options... and paste into that textfield everything in run_mod.bat starting with -dev.
For example I pasted in: -dev -game "c:\Program Files\Valve\SteamApps\SourceMods\MyMod" -allowdebug %1 %2 %3 %4 %5 %6 %7 %8 %9
Now I launch my mod directly from Steam and it pulls my dlls with my changes (including the rocket speed).
I had the same problem and this partially solved it. I also needed to change the appid to 218 (SDK Base Orange Box)
The reasons i think were the following:
1. I had EP2 selected when creating the mod for this tutorial. - Absolutetly sure this is true at least
2. I had EP2 not installed when running the mod. -Can't test if this is true as long i don't have it installed. Will test as soon as i have it installed again. --Beliar 22:34, 25 Jun 2008 (PDT)
The second is confirmed. So, if you create a mod from EP2 make sure you have it installed or changing the appid to 218 and download the SDK Base Orange Box (its a lot smaller than full EP2) or else changing anything in the code will not work. --Beliar 23:52, 25 Jun 2008 (PDT)
[EDIT] I have been trying to get this to work, but still no luck. Everything loads fine and maps are fine to load, the appId is 215, have changed my launch options to add in everything starting from -dev and nothing seems to be working to change the rocket speed. I am using VS2008, does anyone have any suggestions? --Xprestrain 09:05, 19 Jun 2008 (PDT)
VS2008 isn't fully supported, use VS2005 if you can. Solokiller 09:12, 19 Jun 2008 (PDT)
It works well enough, but only after you follow these instructions. Particularly the ones under this heading. --TomEdwards 09:25, 19 Jun 2008 (PDT)
I followed everything in the Compiling under 2008 tutorial, definitely everything in, yet still no visible changes to the rocket speed... guess I'll try 2005 unless theres any other suggestions.--Xprestrain 04:10, 20 Jun 2008 (PDT)
I updated the page and added some extra steps a few days ago. Try running through it again. --TomEdwards 05:59, 20 Jun 2008 (PDT)
I've been working from it for the past 3 days, if it was in a few days ago, I've already tried it. Anything else it could be? Thanks for all the help! --Xprestrain 09:37, 20 Jun 2008 (PDT)

I've been having the exact same issue. Tried adding that line to launch options, tried appId 215, 218, 220. No rocket speed change. Not sure where to go from here...

I was having that problem until I realized I had compiled the solution file in the C:\MyMod directory and the correct solution is in the src directory below that. Then I copied server.dll and client.dll from \src\game\server\Release_hl2 to C:\program files\steam\steamapps\SourceMods\FirstMod\bin and it worked for me. This worked for me at least using The Orange Box SDK base --UltraRat

I am having this exact problem and I feel that I have done all that I could find to solve the problem, I'll walk through the install: Installed HL2, HL2ep1, HL2ep2, installed Source SDK, installed Source SDK base, installed Source SDK orange box, installed Half-life 2 Deathmatch, created a mod with Source SDK using Half-life 2 Episode one/Deathmatch and Half-life 2 Multiplayer as the base. I have got my VS08 following all guidelines that I could find on here and my compile is clean. I get my client.dll and server.dll files in my c:\hoppsmod\bin and I have tried 215(sdk one), 218(sdk orange), 220(hl2), and 320(deathmatch) for the appids. None of these seem to change the rocket speed for me. ANY help please...--Ahopps 06:39, 27 Nov 2008 (PST)

This problem persists. I can't find any post on forums or here that properly explains the problem or provides a solution that works for me (tried the above). Anyone have any pointer? After all, people still do seem to mod...--Diskonaut 09:30, 15 May 2009 (UTC)

Ok, the problem is that the information regarding the custom build step in Visual Studio 2008 is misleading. The DLLs and PDBs should be copied to a bin directory in your mods directory under e.g. \steamapps\SourceMods\<YourModHere> NOT to a bin directory in the hierarchy where you store your C++ source files (.e.g. C:\<YourMod>\bin. Set the compiler accordingly or copy the files manually as suggested by UltraRat above. --Diskonaut 13:27, 18 May 2009 (UTC)

This solution worked for me using the Orange Box Engine (SteamAppId: 218). As you said, once the paths were changed to "..\steamapps\SourceMods\<YourModHere>\bin\" the correct dlls were being used. Thanks! --DoryuX 06:15, 19 May 2009 (UTC)

-Personaly,this fixed my problem with VS2005 EXPRESS :

In the Solution Explorer right click 'client_hl2', and select Properties, then: In the client_hl2 properties window, navigate to Linker -> Input Select the 'Additional Dependencies' box. Then click the '...' on the right hand side of the box If there is already an entry here, take a new line after it (a space will suffice if you cannot create a new line), and type 'user32.lib', and without the quotes. Vista users may have to input "user32.lib" and "kernel32.lib" within the double quotes. Repeat these steps for 'server_hl2'. Good luck !

What is the difference in mod types?

What code is present and what's not in each? I can't find anything even close to whats included in them.

Single Player-?

Has a lot of code that deals with sp items like ai and advanced entity's --Lodle

Multi-Player-?

Has optimized code for multiplayer and a reduced set of entity's (also missing ai) --Lodle

Scratch-?

Contains source code only. Use full for upgrading between versions. --Lodle

--Amess 10:00, 7 Nov 2007 (PST)

Loading maps using GCFScape

I got everything compiled and ready to test. I copy a map (ep2_outland_01.bsp) file out of episode 2 and when I load it via the console the whole app stops working game stops working and crashes...wondering if i am loading the right map or is there something else wrong. I tried another map (ep2_background01.bsp) and it loads with a but it shows a crazy screen with large "ERROR" text written all over the place. I tried looking for the canal map in the text but it does not exist. any ideas? Unsigned comment added by Csteinhoff (talkcontribs). Please use four tildes (~~~~) or {{Message}} template to sign your username.

I believe the problem is that although you have the map, you don't have its models/materials/etc. Try using the GameInfo.txt file to mount episode two content, and then you won't need to manually extract anything, not even maps. A discussion focusing on this issue already took place on the Help Desk. Also, please remember to sign your posts on talk pages. --Etset 15:47, 23 Feb 2008 (PST)

TF2-derived Mod

Is this possible/legal? I have a few ideas that I want to implement with the TF2 classes that aren't 100% supported with a 100% map-based entities. For example, I want to add additional changes to the prop_physics_multiplayer to enable QPong-style (circa Quake 2) game play. I also would like the ability to add additional characteristics to trigger_capture_area to allow special power-ups for players in the zone. To the point: I have found trigger_area_capture.h/.cpp and other TF2-related files, but none of the .sln files are including it.

Is there a better way to start this project w/o the n00b-hunt-and-peck routine? --Molaughlen 17:51, 18 May 2008 (PDT)

TF2's source code isn't available, so you'd be looking at a server plugin. --TomEdwards 02:43, 19 May 2008 (PDT)
Thanks. --Molaughlen 05:26, 19 May 2008 (PDT)

Errors while compiling


Build started: Project: Client (HL2), Configuration: Release Win32 ------

Compiling... achievementmgr.cpp ..\shared\achievementmgr.cpp(9) : fatal error C1083: Cannot open include file: 'winerror.h': No such file or directory Build log was saved at "file://c:\MyMod\src\game\client\Release_hl2\BuildLog.htm" Client (HL2) - 1 error(s), 0 warning(s)


Build started: Project: Server (HL2), Configuration: Release Win32 ------

Compiling... achievementmgr.cpp ..\shared\achievementmgr.cpp(9) : fatal error C1083: Cannot open include file: 'winerror.h': No such file or directory Build log was saved at "file://c:\MyMod\src\game\server\Release_hl2\BuildLog.htm" Server (HL2) - 1 error(s), 0 warning(s)

Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped

That's from the Output window. I don't know what to do about the achievementmgr.cpp file. and there is no client.dll neither server.dll created please help me out i don't know what to do

Do you have the Platform/Windows SDK installed? --TomEdwards 11:54, 12 Jun 2008 (PDT)

Compiling Virgin Mod Errors


Build started: Project: Client (HL2MP), Configuration: Release Win32 ------

Compiling... in_mouse.cpp C:\Program Files\Microsoft Visual Studio 8\VC\include\intrin.h(912) : error C2733: second C linkage of overloaded function '_interlockedbittestandset' not allowed

C:\Program Files\Microsoft Visual Studio 8\VC\include\intrin.h(912) : see declaration of '_interlockedbittestandset'

C:\Program Files\Microsoft Visual Studio 8\VC\include\intrin.h(913) : error C2733: second C linkage of overloaded function '_interlockedbittestandreset' not allowed

C:\Program Files\Microsoft Visual Studio 8\VC\include\intrin.h(913) : see declaration of '_interlockedbittestandreset'

hud_lcd.cpp C:\Program Files\Microsoft Visual Studio 8\VC\include\intrin.h(912) : error C2733: second C linkage of overloaded function '_interlockedbittestandset' not allowed

C:\Program Files\Microsoft Visual Studio 8\VC\include\intrin.h(912) : see declaration of '_interlockedbittestandset'

C:\Program Files\Microsoft Visual Studio 8\VC\include\intrin.h(913) : error C2733: second C linkage of overloaded function '_interlockedbittestandreset' not allowed

C:\Program Files\Microsoft Visual Studio 8\VC\include\intrin.h(913) : see declaration of '_interlockedbittestandreset'

Generating Code... Build log was saved at "file://d:\Robot Simulation with Source\src\game\client\Release_hl2mp\BuildLog.htm" Client (HL2MP) - 4 error(s), 0 warning(s)


Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped


That is the output that I get everytime I try to build the solution. I am using Visual Studio 2005 express edition and have tried to properly set it up according to the directions on this wiki (read: I'm not certain my configuration is correct). Does anyone have some insight into how I can resolve this error? I am using Vista 32-bit.


=

ok the fix for this seems to be to comment out the offending lines I.E. this //__MACHINEI(unsigned char _interlockedbittestandset(long *a, long b)) //__MACHINEI(unsigned char _interlockedbittestandreset(long *a, long b)) hope it helps -mants

Can't Modify Half-Life 2 Single Player?

Im on a new Computer and wanting to Modify Half-Life 2 Single player but i can't because i can't choose the option in "Create a Mod". I do have Half-Life 2 Deathmatch and Episode 1 also have Half-Life 2 as "Preloaded". Do i need to buy the game to do that? Because on my other computer it worked fine. Please help me someone.

I have the same problem. -- Col6y

You should contact steam support, or ask for help in the sdk forums. --psycommando 03:16, 30 May 2009 (UTC)

Trouble Compiling First Mod

I have followed the tutorial step by step but when I go to set the active configuration to Release and build, I get the following errors: (compiles source files)

1>Client (HL2) : error PRJ0007 : Could not create output directory 'c:\program files\steam\steamapps\sourcemods\my mod 2\bin\client.dll;c:\program files\steam\steamapps\sourcemods\my mod 2\bin'. 1>Copying to destination folder 1> 1 file(s) copied. 1>The system cannot find the path specified. 1> 0 file(s) copied. 1>Project : error PRJ0019: A tool returned an error code from "Copying to destination folder"

(compiles more source files)

2>Server (HL2) : error PRJ0007 : Could not create output directory 'c:\program files\steam\steamapps\sourcemods\my mod 2\bin'. 2>Copying to destination folder 2>The system cannot find the path specified. 2> 0 file(s) copied. 2> 1 file(s) copied.

I am using Visual Studio 2005 Pro and I really have no idea of what is happening. I have searched around and it looks like others have fixed this problem but they never post the solution. Any help would be great. --Bjohnson.bza 23:02, 12 Jan 2009 (PST)

I also had this problem when trying to checkout and compile my Google Code hosted mod project on a Vista machine - it worked fine previously on my XP setup. It seems that Visual Studio.NET 2003 is not completely happy with Vista. After checking my Configuration Properties > Custom Build Step paths to ensure they were correct (they were unchanged), I quit VS.NET. Rather than opening the solution via Game_HL2-2003.sln as I usualy would, I chose to open 'plain, standard' VS.NET from the Start Menu and by right-clicking and choosing 'Run As Administrator'. This resolved my problem with the two errors "PRJ0007 : Could not create output directory" for client and server. Previously, the build process was failing to even create the dlls in my mod's bin directory. --Gadbury 20:42, 31 Jan 2009 (PST)

One possible solution to this problem is to right-click on the Client and Server items in the explorer and navigate to Config Properties > Custom Build Step. Make sure that the individual paths in the Output field are encapsulated in double quotes. Got this solution from HERE. It fixed the PRJ0007 compilation problems that I had before. --Kronon 06:58, 8 April 2009 (UTC)

Yep, that - possible solution - of yours really saved me, I've been trying to solve this problem for 2, 3 days. Thanks! --Kweiko 00:20, 04 June 2009 (PST)

Weird glitch involving gravity gun. Help?

Okay, so I'm using Visual C++ 2005 EE, and I followed the article exactly. Once I compile my code however, the AppID is NOT 215 or 218, it is 420. So, when I change it to 215, everything loads up fine, but my changes to the RPG aren't taking place! Now, I switch it to 218, and it loads up, but the main menu has a gravity gun and it shows health at the bottom, as if you were playing. However, the menu is still there. I can create a server, and my RPG changes take place, but when I quit the game, the game freezes, locking up my computer! This is extremely frustrating, and I would appreciate help on this issue. I would also like to know which AppID I should use, as nobody makes it clear.

Gun/HUD on main menu

I have no problems with my HL2MP mod except that the main menu loads with the Gravity Gun and HUD. Is this normal? Either way, how do I get rid of it? --Zilk 00:10, 7 August 2009 (UTC)

You mean you get a HUD and a viewmodel behind the main menu? --TomEdwards 10:18, 7 August 2009 (UTC)
It doesn't overlap the menu options (FIND SERVER, CREATE SERVER, OPTIONS, QUIT), and I can't aim or fire. I guess I would say that it is "behind". The Lost Coast BSP (I think it is) loads in the background and the console says that a 2 player server has started.--Zilk 17:18, 7 August 2009 (UTC)
This was with SteamAppId as 215. It's fine with 320. --Zilk 20:02, 8 August 2009 (UTC)

HL2 Multiplayer Source won't compile

Having done nothing to the actual source, downloaded the Windows and Platform SDK, made it so that their Bin and Include folders are included, their Lib folders made libraries, and then building, two sorts of errors pop up.
One, I think it an error on Valve's part.
1>.\hl2mp\grenade_tripmine.cpp(276) : error C2039: 'OnTakeDamage_Alive' : is not a member of 'CBaseGrenade'
1> c:\Users\Nicholas\Documents\XWDeathmatch\src\game\shared\basegrenade_shared.h(32) : see declaration of 'CBaseGrenade'

The other two, though, look like I'm completely missing something.
2>hud_lcd.obj : error LNK2019: unresolved external symbol __imp__LoadImageA@24 referenced in function "private: void __thiscall CLCD::ParseIconMappings(class KeyValues *)" (?ParseIconMappings@CLCD@@AAEXPAVKeyValues@@@Z)
2>in_mouse.obj : error LNK2019: unresolved external symbol __imp__SystemParametersInfoA@16 referenced in function "public: virtual void __thiscall CInput::ActivateMouse(void)" (?ActivateMouse@CInput@@UAEXXZ)

Could I get some help?
I'll post the code snippets if needed. XutaWoo 03:10, 15 August 2009 (UTC)

KNOWN BUG
Tony (the guy who caused this error) has posted his preferred solution here: Tony Sergi
Credit needs to go to Winston from the Steam forums for finding this. --Justincase 13:55, 1 December 2010 (UTC)

Visual Studio Express 2010 won't load the source code.

I am using Microsoft Visual Studio C++ Express 2010 for programming for my mod, but whenever I open Game_HL2MP-2005.sln, convert it, the client and server files are grey and "unavailable". I try re-opening the converted file, and it said it cannot load the file with a .vcproj extension in it. How do I fix this?

I just tried this and had no problems. Perhaps start again and see if the problem happens again? --Artfunkel 07:39, 6 August 2011 (PDT)

Game crashes on startup

Whenever I compiled the *.DLL files (server and client) and started my mod, it crashes sometime during the blurred background, then the game instantaneously closes out, I found a freaking crash dump file in the SDK Base 2007 folder. Help me! If I start it up from Steam, it won't work If I start it up from "run_mod.bat" it doesn't load up EP2 content and the background is a big pink and black error checkerboard

I seem to be having this same problem. I am using VC2010, and have applied required fixes outlined at the compiling page here. Any help would be nice! --DarK St3alth 19:41, 7 January 2013 (PST)
Hey I actually had this problem today and figured out the solution, open your gameinfo.txt and change the steamapp ID to 218 that fixed it for me! --Wazanator 17:21, 30 March 2013 (PDT)

Non-functional for Visual Studio 2012

The tutorials need updated to include the latest Microsoft Visual Studio release (2012). Currently, opening the .vcproj files generates "The application for project . . . is not installed. Make sure the application for the project type (.vcproj) is installed." Anyone savvy enough to create Compiling under VS2012? —Mattshu 23:21, 29 January 2013 (PST)

Sounds on my sourcemod aren't working

Okay, so, I'm in the process of creating an HL2 mod called Genetic Variation. Now, when we placed the mod in sourcemods/(Our filepath), the sounds didn't work. Weapon, footsteps, nothing worked except the stuff we added. Now, the funny thing is, is that we have all the Half-Life 2 soundscripts in the scripts folder, but no sounds are working. I could use some help with this. Thanks.

No menu and missing textures

The game compiled correctly, but when I start the game up, I can't see a menu. Just a console and the title. I checked the "gamemenu.res" file and there were entries. I don't know what could've caused this problem. I can still start maps and do other stuff through the console, though. Also, the console is broken. The console just appears to be a white box with the purple and black error texture in the top left corner and a black "Submit" button.

EDIT: I'm making a multiplayer mod, just thought I'd disclose that since that may have something to do with my problem.

No games listed under Source 2007

I want to try making a Half-Life 2 singleplayer mod, but there's nothing in the Current Game dropdown when Source Engine 2007 is selected like this tutorial instructs. Source 2009 allows for selecting Half-Life 2, though. Is this supposed to be happening? Tiny Desk Engineer (Talk Page) 06:27, 19 December 2022 (PST)

Is it possible to use Visual Studio 2019 for this?

I already have Visual Studio 2019 installed on my PC, is it possible for me to create a sourcemod without having to install an older version of Visual Studio just so I can do something I'm not even yet sure I can do? --Tiny Desk Engineer (Talk Page) 14:13, 19 December 2022 (PST)

run_mod.bat not found in mod files

I'm trying to make a mod using Source SDK 2013 and just compiled it with weapon_rpg.cpp modified with a rocket speed of 400, but I cannot find the run_mod.bat file anywhere. Searching for it in File Explorer yields no results. --Tiny Desk Engineer (Talk Page) 11:07, 28 January 2023 (PST)