Fixing first time HL2DM compile problems

From Valve Developer Community
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 );


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.

If your mod fails you in any aspects, follow this https://developer.valvesoftware.com/wiki/Compiling_under_VS2008#Fix_grenade_tripmine.cpp