Fixing first time HL2DM compile problems

From Valve Developer Community
Revision as of 16:59, 18 March 2012 by Lukeme99 (talk | contribs) (Created page with "==The Error== If this is the first time you compiled a HL2DM project you may get an error that looks like this: <pre>Build: 1 succeeded, 1 failed, 0 up-to-date 0, skipped</pre>...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Error

If this is the first time you compiled a HL2DM project you may get an error that looks like this:

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

And somewhere in the output log, you will may or may-not have something something similar to this:

2>grenade_tripmine.cpp
2>.\hl2mp\grenade_tripmine.cpp(276) : error C2039: 'OnTakeDamage_Alive' : is not a member of 'CBaseGrenade'
2>        c:\moddir\src\game\shared\basegrenade_shared.h(34) : see declaration of 'CBaseGrenade'

This is not your fault, it is a code error!


The Fix

The problem is to do with this small code block being defined wrongly:

return BaseClass::OnTakeDamage_Alive( info );

It should actually look like this:

return OnTakeDamage_Alive( info );


So to fix this, hit Ctrl+F and type the first code block in, then press "Quick Replace" and type in the second code block and then press "Replace All"

This will correct all the errors throughout the project.

Then hit build solution, and you will have your mod up and running!


Notes

This may be to-do with this fix or not, but the side effect I get is the game window minimises and maximises rapidly, and to stop it, you need to Start+D out of it once it is assumed the menu loads up, then click back on the "Moddnamehere" in the stat bar to get it back up.